From owner-svn-src-all@freebsd.org Sun Aug 14 00:24:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A1C0BB802C; Sun, 14 Aug 2016 00:24:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 596971C2C; Sun, 14 Aug 2016 00:24:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7E0O0XG029987; Sun, 14 Aug 2016 00:24:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E0O0K8029986; Sun, 14 Aug 2016 00:24:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608140024.u7E0O0K8029986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 14 Aug 2016 00:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304066 - head/usr.bin/nfsstat 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 00:24:01 -0000 Author: markj Date: Sun Aug 14 00:24:00 2016 New Revision: 304066 URL: https://svnweb.freebsd.org/changeset/base/304066 Log: nfsstat depends on libdevstat as of r304058. X-MFC-With: r304058 Modified: head/usr.bin/nfsstat/Makefile Modified: head/usr.bin/nfsstat/Makefile ============================================================================== --- head/usr.bin/nfsstat/Makefile Sat Aug 13 23:35:20 2016 (r304065) +++ head/usr.bin/nfsstat/Makefile Sun Aug 14 00:24:00 2016 (r304066) @@ -4,4 +4,6 @@ PROG= nfsstat CFLAGS+=-DNFS +LIBADD+= devstat + .include From owner-svn-src-all@freebsd.org Sun Aug 14 00:40:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CDBCBB8342; Sun, 14 Aug 2016 00:40:18 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AF091332; Sun, 14 Aug 2016 00:40:18 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7E0eHt8033816; Sun, 14 Aug 2016 00:40:17 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E0eHBC033814; Sun, 14 Aug 2016 00:40:17 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201608140040.u7E0eHBC033814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Sun, 14 Aug 2016 00:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304067 - stable/11/sys/dev/virtio/network X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 00:40:18 -0000 Author: smh Date: Sun Aug 14 00:40:17 2016 New Revision: 304067 URL: https://svnweb.freebsd.org/changeset/base/304067 Log: MFC r303971: Fix vtnet hang with max_virtqueue_pairs > VTNET_MAX_QUEUE_PAIRS Sponsored by: Multiplay Modified: stable/11/sys/dev/virtio/network/if_vtnet.c stable/11/sys/dev/virtio/network/if_vtnetvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- stable/11/sys/dev/virtio/network/if_vtnet.c Sun Aug 14 00:24:00 2016 (r304066) +++ stable/11/sys/dev/virtio/network/if_vtnet.c Sun Aug 14 00:40:17 2016 (r304067) @@ -230,18 +230,32 @@ static void vtnet_disable_interrupts(str static int vtnet_tunable_int(struct vtnet_softc *, const char *, int); /* Tunables. */ +static SYSCTL_NODE(_hw, OID_AUTO, vtnet, CTLFLAG_RD, 0, "VNET driver parameters"); static int vtnet_csum_disable = 0; TUNABLE_INT("hw.vtnet.csum_disable", &vtnet_csum_disable); +SYSCTL_INT(_hw_vtnet, OID_AUTO, csum_disable, CTLFLAG_RDTUN, + &vtnet_csum_disable, 0, "Disables receive and send checksum offload"); static int vtnet_tso_disable = 0; TUNABLE_INT("hw.vtnet.tso_disable", &vtnet_tso_disable); +SYSCTL_INT(_hw_vtnet, OID_AUTO, tso_disable, CTLFLAG_RDTUN, &vtnet_tso_disable, + 0, "Disables TCP Segmentation Offload"); static int vtnet_lro_disable = 0; TUNABLE_INT("hw.vtnet.lro_disable", &vtnet_lro_disable); +SYSCTL_INT(_hw_vtnet, OID_AUTO, lro_disable, CTLFLAG_RDTUN, &vtnet_lro_disable, + 0, "Disables TCP Large Receive Offload"); static int vtnet_mq_disable = 0; TUNABLE_INT("hw.vtnet.mq_disable", &vtnet_mq_disable); -static int vtnet_mq_max_pairs = 0; +SYSCTL_INT(_hw_vtnet, OID_AUTO, mq_disable, CTLFLAG_RDTUN, &vtnet_mq_disable, + 0, "Disables Multi Queue support"); +static int vtnet_mq_max_pairs = VTNET_MAX_QUEUE_PAIRS; TUNABLE_INT("hw.vtnet.mq_max_pairs", &vtnet_mq_max_pairs); +SYSCTL_INT(_hw_vtnet, OID_AUTO, mq_max_pairs, CTLFLAG_RDTUN, + &vtnet_mq_max_pairs, 0, "Sets the maximum number of Multi Queue pairs"); static int vtnet_rx_process_limit = 512; TUNABLE_INT("hw.vtnet.rx_process_limit", &vtnet_rx_process_limit); +SYSCTL_INT(_hw_vtnet, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, + &vtnet_rx_process_limit, 0, + "Limits the number RX segments processed in a single pass"); static uma_zone_t vtnet_tx_header_zone; @@ -597,7 +611,6 @@ static void vtnet_setup_features(struct vtnet_softc *sc) { device_t dev; - int max_pairs, max; dev = sc->vtnet_dev; @@ -646,32 +659,31 @@ vtnet_setup_features(struct vtnet_softc if (virtio_with_feature(dev, VIRTIO_NET_F_MQ) && sc->vtnet_flags & VTNET_FLAG_CTRL_VQ) { - max_pairs = virtio_read_dev_config_2(dev, + sc->vtnet_max_vq_pairs = virtio_read_dev_config_2(dev, offsetof(struct virtio_net_config, max_virtqueue_pairs)); - if (max_pairs < VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN || - max_pairs > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX) - max_pairs = 1; } else - max_pairs = 1; + sc->vtnet_max_vq_pairs = 1; - if (max_pairs > 1) { + if (sc->vtnet_max_vq_pairs > 1) { /* - * Limit the maximum number of queue pairs to the number of - * CPUs or the configured maximum. The actual number of - * queues that get used may be less. + * Limit the maximum number of queue pairs to the lower of + * the number of CPUs and the configured maximum. + * The actual number of queues that get used may be less. */ + int max; + max = vtnet_tunable_int(sc, "mq_max_pairs", vtnet_mq_max_pairs); - if (max > 0 && max_pairs > max) - max_pairs = max; - if (max_pairs > mp_ncpus) - max_pairs = mp_ncpus; - if (max_pairs > VTNET_MAX_QUEUE_PAIRS) - max_pairs = VTNET_MAX_QUEUE_PAIRS; - if (max_pairs > 1) - sc->vtnet_flags |= VTNET_FLAG_MULTIQ; + if (max > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN) { + if (max > mp_ncpus) + max = mp_ncpus; + if (max > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX) + max = VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX; + if (max > 1) { + sc->vtnet_requested_vq_pairs = max; + sc->vtnet_flags |= VTNET_FLAG_MULTIQ; + } + } } - - sc->vtnet_max_vq_pairs = max_pairs; } static int @@ -2982,13 +2994,11 @@ vtnet_set_active_vq_pairs(struct vtnet_s dev = sc->vtnet_dev; if ((sc->vtnet_flags & VTNET_FLAG_MULTIQ) == 0) { - MPASS(sc->vtnet_max_vq_pairs == 1); sc->vtnet_act_vq_pairs = 1; return; } - /* BMV: Just use the maximum configured for now. */ - npairs = sc->vtnet_max_vq_pairs; + npairs = sc->vtnet_requested_vq_pairs; if (vtnet_ctrl_mq_cmd(sc, npairs) != 0) { device_printf(dev, @@ -3852,6 +3862,9 @@ vtnet_setup_sysctl(struct vtnet_softc *s SYSCTL_ADD_INT(ctx, child, OID_AUTO, "max_vq_pairs", CTLFLAG_RD, &sc->vtnet_max_vq_pairs, 0, "Maximum number of supported virtqueue pairs"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "requested_vq_pairs", + CTLFLAG_RD, &sc->vtnet_requested_vq_pairs, 0, + "Requested number of virtqueue pairs"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "act_vq_pairs", CTLFLAG_RD, &sc->vtnet_act_vq_pairs, 0, "Number of active virtqueue pairs"); Modified: stable/11/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- stable/11/sys/dev/virtio/network/if_vtnetvar.h Sun Aug 14 00:24:00 2016 (r304066) +++ stable/11/sys/dev/virtio/network/if_vtnetvar.h Sun Aug 14 00:40:17 2016 (r304067) @@ -155,6 +155,7 @@ struct vtnet_softc { int vtnet_if_flags; int vtnet_act_vq_pairs; int vtnet_max_vq_pairs; + int vtnet_requested_vq_pairs; struct virtqueue *vtnet_ctrl_vq; struct vtnet_mac_filter *vtnet_mac_filter; From owner-svn-src-all@freebsd.org Sun Aug 14 03:49:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61BC0BB904E; Sun, 14 Aug 2016 03:49:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31AFC14FF; Sun, 14 Aug 2016 03:49:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7E3nbLM004537; Sun, 14 Aug 2016 03:49:37 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E3nbnY004536; Sun, 14 Aug 2016 03:49:37 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608140349.u7E3nbnY004536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 14 Aug 2016 03:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304068 - head/sys/powerpc/mpc85xx 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 03:49:38 -0000 Author: jhibbits Date: Sun Aug 14 03:49:37 2016 New Revision: 304068 URL: https://svnweb.freebsd.org/changeset/base/304068 Log: Only flush bp_kernload from the dcache, no need to sync the icache on the boot CPU. __syncicache() only syncs the icache on the current CPU, it doesn't touch the cache on any other core. Replace the call with cpu_flush_dcache() instead. Since bp_kernload is not touched again by the boot CPU in this code path, dcbf is no less efficient than the dcbst from __syncicache() by invalidating the cache line. Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c Modified: head/sys/powerpc/mpc85xx/platform_mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sun Aug 14 00:40:17 2016 (r304067) +++ head/sys/powerpc/mpc85xx/platform_mpc85xx.c Sun Aug 14 03:49:37 2016 (r304068) @@ -404,7 +404,7 @@ mpc85xx_smp_start_cpu(platform_t plat, s * bp_kernload is in the boot page. Sync the cache because ePAPR * booting has the other core(s) already running. */ - __syncicache(&bp_kernload, sizeof(bp_kernload)); + cpu_flush_dcache(&bp_kernload, sizeof(bp_kernload)); ap_pcpu = pc; __asm __volatile("msync; isync"); From owner-svn-src-all@freebsd.org Sun Aug 14 04:11:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29F52BB9403; Sun, 14 Aug 2016 04:11:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EAE891DF9; Sun, 14 Aug 2016 04:11:37 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7E4BbX3014022; Sun, 14 Aug 2016 04:11:37 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E4BbtY014021; Sun, 14 Aug 2016 04:11:37 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608140411.u7E4BbtY014021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 14 Aug 2016 04:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304069 - head/sys/powerpc/mpc85xx 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 04:11:38 -0000 Author: jhibbits Date: Sun Aug 14 04:11:36 2016 New Revision: 304069 URL: https://svnweb.freebsd.org/changeset/base/304069 Log: Return 0 instead of an error code on failure to find dcsr. mpc85xx_map_dcsr() returns a vm_offset_t, not an error code. mpc85xx_fix_errata() will gracefully exit if mpc85xx_map_dcsr() returns 0, as that indicates an error (NULL pointer). Modified: head/sys/powerpc/mpc85xx/mpc85xx.c Modified: head/sys/powerpc/mpc85xx/mpc85xx.c ============================================================================== --- head/sys/powerpc/mpc85xx/mpc85xx.c Sun Aug 14 03:49:37 2016 (r304068) +++ head/sys/powerpc/mpc85xx/mpc85xx.c Sun Aug 14 04:11:36 2016 (r304069) @@ -358,10 +358,10 @@ mpc85xx_map_dcsr(void) * Find the node the long way. */ if ((node = OF_finddevice("/")) == -1) - return (ENXIO); + return (0); if ((node = ofw_bus_find_compatible(node, "fsl,dcsr")) == 0) - return (ENXIO); + return (0); moveon: err = fdt_get_range(node, 0, &b, &s); From owner-svn-src-all@freebsd.org Sun Aug 14 04:35:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDFCFBB9903; Sun, 14 Aug 2016 04:35:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADC44178E; Sun, 14 Aug 2016 04:35:05 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7E4Z4JV022555; Sun, 14 Aug 2016 04:35:04 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E4Z4Fm022554; Sun, 14 Aug 2016 04:35:04 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201608140435.u7E4Z4Fm022554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 14 Aug 2016 04:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r304070 - svnadmin/conf X-SVN-Group: svnadmin 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 04:35:06 -0000 Author: gjb Date: Sun Aug 14 04:35:04 2016 New Revision: 304070 URL: https://svnweb.freebsd.org/changeset/base/304070 Log: Do not include C function changes by default in svn commit email. No objection: svnadmin Submitted by: des Sponsored by: The FreeBSD Foundation Modified: svnadmin/conf/mailer.conf Modified: svnadmin/conf/mailer.conf ============================================================================== --- svnadmin/conf/mailer.conf Sun Aug 14 04:11:36 2016 (r304069) +++ svnadmin/conf/mailer.conf Sun Aug 14 04:35:04 2016 (r304070) @@ -143,7 +143,7 @@ # This is not passed to the shell, so do not use shell metacharacters. # The command is split around whitespace, so if you want to include # whitespace in the command, then ### something ###. -diff = /usr/bin/diff -up -L %(label_from)s -L %(label_to)s %(from)s %(to)s +diff = /usr/bin/diff -u -L %(label_from)s -L %(label_to)s %(from)s %(to)s # The default prefix for the Subject: header for commits. commit_subject_prefix = svn commit: From owner-svn-src-all@freebsd.org Sun Aug 14 04:39:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27375BB99AF; Sun, 14 Aug 2016 04:39:18 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f170.google.com (mail-io0-f170.google.com [209.85.223.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFC94194C; Sun, 14 Aug 2016 04:39:17 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f170.google.com with SMTP id m101so56879420ioi.2; Sat, 13 Aug 2016 21:39:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=dwYJJwsWEVY2EA2JWI/cxjwKQ22jagiQI2AUdPVffdc=; b=CZFn8RIXidR0ZJqn/1CqbAbM4uKiB3Rw9NocBIpyHwTr5sMNX0P1xjvXliPEe7uo5i gT3ezqZg0u5u6o4X5EIRUd8VziZhVudhhp9HIYP+ESpmFxWoeLGLnzZgZR8yh5TMkwua oPCmcR9v1IySgIJyuKDiHEKuGNBNz5rrHzBWdSaKl69fCKoFYgKOM9WRYd0YqDu/1EiD jn0OoC+am7brzTJhRPcb6ysJigJ7PZvjsJMzW0DMRirDK+FLMXeQV3Ml9I7KXva2ClPK if6MgtvhNWm28sSQbiKVEAfv94KKSMMdpwlQylx60+w9uoJUWIhDenoLArUjoK5zldsl zYhw== X-Gm-Message-State: AEkoousX3Xzoi3MP7HdwrCX89N//RoWZRXgWs5hd/1Y09vg0lkM3D6V4ct7SJnKAw0oRPw== X-Received: by 10.107.135.142 with SMTP id r14mr28564346ioi.133.1471149555714; Sat, 13 Aug 2016 21:39:15 -0700 (PDT) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com. [209.85.214.44]) by smtp.gmail.com with ESMTPSA id h99sm7036380iod.9.2016.08.13.21.39.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Aug 2016 21:39:15 -0700 (PDT) Received: by mail-it0-f44.google.com with SMTP id c13so5485941ith.1; Sat, 13 Aug 2016 21:39:15 -0700 (PDT) X-Received: by 10.36.76.16 with SMTP id a16mr6977454itb.86.1471149555229; Sat, 13 Aug 2016 21:39:15 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.129 with HTTP; Sat, 13 Aug 2016 21:39:14 -0700 (PDT) In-Reply-To: <201608140435.u7E4Z4Fm022554@repo.freebsd.org> References: <201608140435.u7E4Z4Fm022554@repo.freebsd.org> From: Conrad Meyer Date: Sat, 13 Aug 2016 21:39:14 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r304070 - svnadmin/conf To: Glen Barber Cc: src-committers , svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 04:39:18 -0000 Wait, what? Why not? This option provides useful context for reviewing changes. Best, Conrad On Sat, Aug 13, 2016 at 9:35 PM, Glen Barber wrote: > Author: gjb > Date: Sun Aug 14 04:35:04 2016 > New Revision: 304070 > URL: https://svnweb.freebsd.org/changeset/base/304070 > > Log: > Do not include C function changes by default in svn commit > email. > > No objection: svnadmin > Submitted by: des > Sponsored by: The FreeBSD Foundation > > Modified: > svnadmin/conf/mailer.conf > > Modified: svnadmin/conf/mailer.conf > ============================================================================== > --- svnadmin/conf/mailer.conf Sun Aug 14 04:11:36 2016 (r304069) > +++ svnadmin/conf/mailer.conf Sun Aug 14 04:35:04 2016 (r304070) > @@ -143,7 +143,7 @@ > # This is not passed to the shell, so do not use shell metacharacters. > # The command is split around whitespace, so if you want to include > # whitespace in the command, then ### something ###. > -diff = /usr/bin/diff -up -L %(label_from)s -L %(label_to)s %(from)s %(to)s > +diff = /usr/bin/diff -u -L %(label_from)s -L %(label_to)s %(from)s %(to)s > > # The default prefix for the Subject: header for commits. > commit_subject_prefix = svn commit: > From owner-svn-src-all@freebsd.org Sun Aug 14 04:47:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49E24BB9B27; Sun, 14 Aug 2016 04:47:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 210871D33; Sun, 14 Aug 2016 04:47:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id B8E0A1FB7; Sun, 14 Aug 2016 04:47:24 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Sun, 14 Aug 2016 04:47:23 +0000 From: Glen Barber To: Conrad Meyer Cc: src-committers , svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org, svnadm@FreeBSD.org Subject: Re: svn commit: r304070 - svnadmin/conf Message-ID: <20160814044723.GF11079@FreeBSD.org> References: <201608140435.u7E4Z4Fm022554@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1RkCiX/UEfbG28Bk" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 04:47:25 -0000 --1RkCiX/UEfbG28Bk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Quoting the original request to remove this, which I tend to agree: -------------------------- begin quoted text --------------------------- The svn commit mail script uses some form of 'diff -p' (or 'svn diff -x-p') to include function names at the top of each hunk. The problem is that diff gets it wrong more often than not, especially (but not only) when functions are added or renamed, or outside a funciton, or in headers, or in code that makes heavy use of macros, or in files that aren't C-like source code: shell scripts, man pages, Makefiles... All it really does is clutter up the patch and mislead the reader. --------------------------- end quoted text ---------------------------- Glen On Sat, Aug 13, 2016 at 09:39:14PM -0700, Conrad Meyer wrote: > Wait, what? Why not? This option provides useful context for > reviewing changes. >=20 > Best, > Conrad >=20 > On Sat, Aug 13, 2016 at 9:35 PM, Glen Barber wrote: > > Author: gjb > > Date: Sun Aug 14 04:35:04 2016 > > New Revision: 304070 > > URL: https://svnweb.freebsd.org/changeset/base/304070 > > > > Log: > > Do not include C function changes by default in svn commit > > email. > > > > No objection: svnadmin > > Submitted by: des > > Sponsored by: The FreeBSD Foundation > > > > Modified: > > svnadmin/conf/mailer.conf > > > > Modified: svnadmin/conf/mailer.conf > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- svnadmin/conf/mailer.conf Sun Aug 14 04:11:36 2016 (r30406= 9) > > +++ svnadmin/conf/mailer.conf Sun Aug 14 04:35:04 2016 (r30407= 0) > > @@ -143,7 +143,7 @@ > > # This is not passed to the shell, so do not use shell metacharacters. > > # The command is split around whitespace, so if you want to include > > # whitespace in the command, then ### something ###. > > -diff =3D /usr/bin/diff -up -L %(label_from)s -L %(label_to)s %(from)s = %(to)s > > +diff =3D /usr/bin/diff -u -L %(label_from)s -L %(label_to)s %(from)s %= (to)s > > > > # The default prefix for the Subject: header for commits. > > commit_subject_prefix =3D svn commit: > > >=20 --1RkCiX/UEfbG28Bk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXr/fbAAoJEAMUWKVHj+KTlKEP/1u+vpJnUQrFYWaIcyOWK2lU BrkyaMFah00I0ih+4rFLPAWfGSEi0Gi8EPGsv4YuTRU+yFwBXhYfnmTDGI9lSeq6 LJr826+3yDhpoJr+Ck58UVS59PhXpHSExZbrGragRg770HsbYLT1b4ufglcqOtSc ExTwBnM3FJNvI5JqtCL7ySV6xMmCHkA24iRDhQpjRv2pKGCE2qLDVXd5fBdrGnuz +SYPA0+685CPbB0Akge08bGOBX2EfcW8UC0plAhc5UB/e4LO04rXtCL7Dvzby41I YuhrUg3DZc1SBpiYzhePuSF/txfmYD+9C7wQtHFVhzzfrtFl8MHEPYVaoLSYXuvl Tf/vVQldXCTOcAw+h2VLhi6S+4ZF738z2yofZ0woEZcW+Bvr0nQL06uLOGaXS6DU 5iqy74bTtyiCIb48BVtZCfSI635hg4oLEXorHPDj72iHgQP5rC5Jpo9AgWqJ01vz CxzMiNeAoXUhh+1tCPtulplaIicy6mOZJ85kRvD08SclnMU7TpNue0OjJjzur6Ht 2Xt1nuQhhhy/+6dsiwS4145yE1HPN8IVt+pDp8m12Z9KcHSW1+HZpJ9KKfBKKLsW obBDOq7Zj0GsTZrFDRcobfyTalo+sNKZgPbUcCzefem2OcNmdYXYdgSPN12gejGh NiAqNaZOQ4PItXTf0FAa =xHml -----END PGP SIGNATURE----- --1RkCiX/UEfbG28Bk-- From owner-svn-src-all@freebsd.org Sun Aug 14 05:10:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60B95BB9ECD; Sun, 14 Aug 2016 05:10:27 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E06D16CA; Sun, 14 Aug 2016 05:10:27 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7E5AQhr033959; Sun, 14 Aug 2016 05:10:26 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E5AQQb033958; Sun, 14 Aug 2016 05:10:26 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201608140510.u7E5AQQb033958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sun, 14 Aug 2016 05:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304071 - head/sys/dev/ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 05:10:27 -0000 Author: mmel Date: Sun Aug 14 05:10:26 2016 New Revision: 304071 URL: https://svnweb.freebsd.org/changeset/base/304071 Log: OFWPCI: Don't strip RF_ACTIVE from flags when parent bus method is called. Reviewed by: nwhitehorn MFC after: 3 weeks Modified: head/sys/dev/ofw/ofwpci.c Modified: head/sys/dev/ofw/ofwpci.c ============================================================================== --- head/sys/dev/ofw/ofwpci.c Sun Aug 14 04:35:04 2016 (r304070) +++ head/sys/dev/ofw/ofwpci.c Sun Aug 14 05:10:26 2016 (r304071) @@ -414,14 +414,14 @@ #if defined(NEW_PCIB) && defined(PCI_RES_BUS) if (type == PCI_RES_BUS) { return (pci_domain_alloc_bus(sc->sc_pci_domain, child, rid, - start, end, count, flags)); + start, end, count, flags | needactivate)); } #endif rm = ofw_pci_get_rman(sc, type, flags); if (rm == NULL) { return (bus_generic_alloc_resource(bus, child, type, rid, - start, end, count, flags)); + start, end, count, flags | needactivate)); } rv = rman_reserve_resource(rm, start, end, count, flags, child); From owner-svn-src-all@freebsd.org Sun Aug 14 05:18:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40067BB9035; Sun, 14 Aug 2016 05:18:39 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1012C1AB5; Sun, 14 Aug 2016 05:18:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7E5IcpD037515; Sun, 14 Aug 2016 05:18:38 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E5Icf1037514; Sun, 14 Aug 2016 05:18:38 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201608140518.u7E5Icf1037514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 14 Aug 2016 05:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304072 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 05:18:39 -0000 Author: delphij Date: Sun Aug 14 05:18:38 2016 New Revision: 304072 URL: https://svnweb.freebsd.org/changeset/base/304072 Log: Now that the portsnap buildbox is generating the raw bits for INDEX-12, add it to the set of INDEX files built by portsnap. Switch to INDEX-12 for head/. Modified: head/etc/portsnap.conf Modified: head/etc/portsnap.conf ============================================================================== --- head/etc/portsnap.conf Sun Aug 14 05:10:26 2016 (r304071) +++ head/etc/portsnap.conf Sun Aug 14 05:18:38 2016 (r304072) @@ -32,4 +32,5 @@ # List of INDEX files to build and the DESCRIBE file to use for each #INDEX INDEX-9 DESCRIBE.9 #INDEX INDEX-10 DESCRIBE.10 -INDEX INDEX-11 DESCRIBE.11 +#INDEX INDEX-11 DESCRIBE.11 +INDEX INDEX-12 DESCRIBE.12 From owner-svn-src-all@freebsd.org Sun Aug 14 05:48:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBFAFBB9455 for ; Sun, 14 Aug 2016 05:48:39 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-qk0-x22f.google.com (mail-qk0-x22f.google.com [IPv6:2607:f8b0:400d:c09::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 92DE615DD for ; Sun, 14 Aug 2016 05:48:39 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: by mail-qk0-x22f.google.com with SMTP id v123so20543562qkh.2 for ; Sat, 13 Aug 2016 22:48:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clockworksquid.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Moy1h3uh+zEiyxmzGsPaFIHn0ohNu09AMyAIUGBwj88=; b=d1TH0OICkq/bCc/4IIBXgQHWRgBhsaraY/taxfhduJDRdSGNupZ6iBlGzP1Mvgi8uf WjFQ0PF6dL9fE1GL8ruILmNLjTzJ0b9sKZNz8wsDxYUBf6OddSuegbfkKZjYj6b4jmyF 2eDQAXvjZ8SNPz59sEg5i0MGqZWp/IwnSjLSA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Moy1h3uh+zEiyxmzGsPaFIHn0ohNu09AMyAIUGBwj88=; b=nN1TpZnrg6RjDanZcp8PsdsnHDZNmddDcMyBTJbjUjesqayHdZgtnW0ipn8QNqLZVG Thc8vx14AB/7KrcWrhyJFsePMaxcqr4PamgKec/r0Shv2XccNCiEZ0bQsj8zeN7NViNs PEB0t4GtGGurWTgv9969euOqCMiJqBUaSXfcoKIsxHhs3LfMo+GqzVp9/OiKb63lZ1YX inb4U/CcQzH/uHatigw+Vo/JkNF/O31O7NTpsYfPZVa2k62tWO0zu9/b8U/OMO8GaU61 sFv3wYlNFSAS/GQJWqETkTlFZo0OMAQWtRwozDuaA4pW2YvaFGV7l8eBn1CXjc7wefD4 RSpA== X-Gm-Message-State: AEkoouu+QFNBzAH85KH95OVRdZFeDEcHTLUr05t29+H02XYuA/7WYMxyDNON+nYWa2uALW/YR2ttHPe+Db/Xwg== X-Received: by 10.55.5.17 with SMTP id 17mr25420905qkf.280.1471153718522; Sat, 13 Aug 2016 22:48:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.56.105 with HTTP; Sat, 13 Aug 2016 22:48:18 -0700 (PDT) In-Reply-To: <20160814044723.GF11079@FreeBSD.org> References: <201608140435.u7E4Z4Fm022554@repo.freebsd.org> <20160814044723.GF11079@FreeBSD.org> From: Juli Mallett Date: Sat, 13 Aug 2016 22:48:18 -0700 Message-ID: Subject: Re: svn commit: r304070 - svnadmin/conf To: Glen Barber Cc: Conrad Meyer , src-committers , svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org, svnadm@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 05:48:40 -0000 On Sat, Aug 13, 2016 at 9:47 PM, Glen Barber wrote: > Quoting the original request to remove this, which I tend to agree: > > -------------------------- begin quoted text --------------------------- > The svn commit mail script uses some form of 'diff -p' (or 'svn diff > -x-p') to include function names at the top of each hunk. The problem > is that diff gets it wrong more often than not, especially (but not > only) when functions are added or renamed, or outside a funciton, or in > headers, or in code that makes heavy use of macros, or in files that > aren't C-like source code: shell scripts, man pages, Makefiles... All > it really does is clutter up the patch and mislead the reader. > --------------------------- end quoted text ---------------------------- :( I'm deeply skeptical that the described conditions add up to "more often than not," and that tangible harm is done in those cases, outweighing benefit added in the other, ostensibly rarer, case (changes in ordinary C source files, which are actually fairly abundant in FreeBSD.) Juli. From owner-svn-src-all@freebsd.org Sun Aug 14 05:52:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32830BB95F2; Sun, 14 Aug 2016 05:52:02 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f178.google.com (mail-io0-f178.google.com [209.85.223.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04BF2195A; Sun, 14 Aug 2016 05:52:01 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f178.google.com with SMTP id 38so57651313iol.0; Sat, 13 Aug 2016 22:52:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=ZXGSn10+pCzoSv4vmJZ5WZaFTrNb1FE/od16kTktGCQ=; b=O5/W+UEQd0HqOik2hqOiBb1j1SGEI9Rc4fEzQG9f4JjEkdXSNcQ0+taHNs4XA6pD+h ZZNJkWWRiSIckUE88NZjLe5yYAjg/rTLNXWVmBWc22WN8Vg9ZxWyOdUbMPRQY6NmeUvp QzISdLKChXcS03mSiDnvs5/lS5KvgrU9HR2CL/Ipfw4ya3CRSNBAhf/rklKjlHBTCLHl omyF14pD8CnVUIMUzHjG6xvGWkUvEUkJ/OIsSa5ENymR41Zjo5tS014tXLFwysIvVGBH 4FLcVvQPxQhd7HbVAtLUwctBtbZnbQ5RvwPw8p2G1Dzl7avppaxAn0HuX3SicbMSxsVa eBGQ== X-Gm-Message-State: AEkoout/DPZxuYeYksCWntvAPQ6M/VgfMArDQmE7tVStgq3fYpAFDeDUVye5IK77swgwRg== X-Received: by 10.107.195.14 with SMTP id t14mr29928472iof.175.1471153920495; Sat, 13 Aug 2016 22:52:00 -0700 (PDT) Received: from mail-it0-f41.google.com (mail-it0-f41.google.com. [209.85.214.41]) by smtp.gmail.com with ESMTPSA id h67sm7110878ioe.40.2016.08.13.22.52.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Aug 2016 22:52:00 -0700 (PDT) Received: by mail-it0-f41.google.com with SMTP id c13so6100407ith.1; Sat, 13 Aug 2016 22:52:00 -0700 (PDT) X-Received: by 10.36.227.130 with SMTP id d124mr6798285ith.97.1471153919950; Sat, 13 Aug 2016 22:51:59 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.129 with HTTP; Sat, 13 Aug 2016 22:51:59 -0700 (PDT) In-Reply-To: References: <201608140435.u7E4Z4Fm022554@repo.freebsd.org> <20160814044723.GF11079@FreeBSD.org> From: Conrad Meyer Date: Sat, 13 Aug 2016 22:51:59 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r304070 - svnadmin/conf To: Juli Mallett Cc: Glen Barber , src-committers , svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org, svnadm@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 05:52:02 -0000 On Sat, Aug 13, 2016 at 10:48 PM, Juli Mallett wrote: > On Sat, Aug 13, 2016 at 9:47 PM, Glen Barber wrote: >> Quoting the original request to remove this, which I tend to agree: >> >> -------------------------- begin quoted text --------------------------- >> The svn commit mail script uses some form of 'diff -p' (or 'svn diff >> -x-p') to include function names at the top of each hunk. The problem >> is that diff gets it wrong more often than not, especially (but not >> only) when functions are added or renamed, or outside a funciton, or in >> headers, or in code that makes heavy use of macros, or in files that >> aren't C-like source code: shell scripts, man pages, Makefiles... All >> it really does is clutter up the patch and mislead the reader. >> --------------------------- end quoted text ---------------------------- > > :( > > I'm deeply skeptical that the described conditions add up to "more > often than not," and that tangible harm is done in those cases, > outweighing benefit added in the other, ostensibly rarer, case > (changes in ordinary C source files, which are actually fairly > abundant in FreeBSD.) Exactly. Yes, it gets it wrong sometimes. But not enough to make it more harmful than beneficial. Best, Conrad From owner-svn-src-all@freebsd.org Sun Aug 14 06:06:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3781FBB9AC4; Sun, 14 Aug 2016 06:06:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00A331FAB; Sun, 14 Aug 2016 06:06:10 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7E66AlE055955; Sun, 14 Aug 2016 06:06:10 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E66Ah5055954; Sun, 14 Aug 2016 06:06:10 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201608140606.u7E66Ah5055954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Sun, 14 Aug 2016 06:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r304073 - svnadmin/conf X-SVN-Group: svnadmin 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 06:06:11 -0000 Author: gjb Date: Sun Aug 14 06:06:09 2016 New Revision: 304073 URL: https://svnweb.freebsd.org/changeset/base/304073 Log: Revert r304070. I have more important things to deal with than bikesheds. With hat: svnadm Modified: svnadmin/conf/mailer.conf Modified: svnadmin/conf/mailer.conf ============================================================================== --- svnadmin/conf/mailer.conf Sun Aug 14 05:18:38 2016 (r304072) +++ svnadmin/conf/mailer.conf Sun Aug 14 06:06:09 2016 (r304073) @@ -143,7 +143,7 @@ mail_command = /usr/sbin/sendmail # This is not passed to the shell, so do not use shell metacharacters. # The command is split around whitespace, so if you want to include # whitespace in the command, then ### something ###. -diff = /usr/bin/diff -u -L %(label_from)s -L %(label_to)s %(from)s %(to)s +diff = /usr/bin/diff -up -L %(label_from)s -L %(label_to)s %(from)s %(to)s # The default prefix for the Subject: header for commits. commit_subject_prefix = svn commit: From owner-svn-src-all@freebsd.org Sun Aug 14 06:06:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B881BB9B06; Sun, 14 Aug 2016 06:06:42 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 095D1125E; Sun, 14 Aug 2016 06:06:42 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 9609B1C50; Sun, 14 Aug 2016 06:06:41 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Sun, 14 Aug 2016 06:06:39 +0000 From: Glen Barber To: Conrad Meyer Cc: Juli Mallett , src-committers , svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org, svnadm@freebsd.org Subject: Re: svn commit: r304070 - svnadmin/conf Message-ID: <20160814060639.GG11079@FreeBSD.org> References: <201608140435.u7E4Z4Fm022554@repo.freebsd.org> <20160814044723.GF11079@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="GN/IAAAoV4GJoJGS" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 06:06:42 -0000 --GN/IAAAoV4GJoJGS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Aug 13, 2016 at 10:51:59PM -0700, Conrad Meyer wrote: > On Sat, Aug 13, 2016 at 10:48 PM, Juli Mallett = wrote: > > On Sat, Aug 13, 2016 at 9:47 PM, Glen Barber wrote: > >> Quoting the original request to remove this, which I tend to agree: > >> > >> -------------------------- begin quoted text -------------------------= -- > >> The svn commit mail script uses some form of 'diff -p' (or 'svn diff > >> -x-p') to include function names at the top of each hunk. The problem > >> is that diff gets it wrong more often than not, especially (but not > >> only) when functions are added or renamed, or outside a funciton, or = in > >> headers, or in code that makes heavy use of macros, or in files that > >> aren't C-like source code: shell scripts, man pages, Makefiles... All > >> it really does is clutter up the patch and mislead the reader. > >> --------------------------- end quoted text --------------------------= -- > > > > :( > > > > I'm deeply skeptical that the described conditions add up to "more > > often than not," and that tangible harm is done in those cases, > > outweighing benefit added in the other, ostensibly rarer, case > > (changes in ordinary C source files, which are actually fairly > > abundant in FreeBSD.) >=20 > Exactly. Yes, it gets it wrong sometimes. But not enough to make it > more harmful than beneficial. >=20 Reverted. I won't deal with this topic further. Glen --GN/IAAAoV4GJoJGS Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXsApvAAoJEAMUWKVHj+KTGHwP/14XNX/9qwt5ZV6YRJA3JywA DvztMwltIvKI7G3ki5ZEwouOR40e+Mq57cAfVVlQVCY56wckflQoOdIyWi+KW26W b2WxQ5ZZApZYSRw2KPYJcL9i7fxih5sbE+pfJq77WOj9Uze7jQ1CblLHavFwTjee VGe+ePH5uGNUY0KBfgmR0SHgrGWWzS8SHB2GIZzG9CPnqGLkfaSdeMlBMcw9CBc1 1asX+1HkiN4B0oogCnYQSWcLsNCl5BhDhG3gtZxSfssxJZnh4qxND9x29wKKaZsz NiUYylpYWFJ3Ub39Aq4SB7tYmx4uLGI3gctyolp3tkAhcT3MVNgBFX/5uF1rSjaF QTBKqOQNTr5/nhWtCD3SQ07cm7SEnhK2ig87WL+V+vUr0xtbIVcGrYVObFWTKM/N ruGXidTO2rywkWxUqTdn5tiREe3bTAGHKhrkXSGSywhzo1p6fEMThLpf6Ytce+Pe 9x5JqIQERvNClisQjSyBRkxk0H1V5WXFKtdxu/jPHWlzT0TEPNLCvpv+Temhgtmi Yc1EbqdbRvynwfq2FIOKsr+cEx2DjgrCYRiL24p7JnQnOmNb6qVyI8Zy9HyGs2zg oLscvU+oWqUMQSWzkZmo4I3i8wqC4dQZssyDX4Vj8EUkqkqSbdf0/oRcrPYXeCgc sqDvZuU5pL3zjWKBr9kq =ah93 -----END PGP SIGNATURE----- --GN/IAAAoV4GJoJGS-- From owner-svn-src-all@freebsd.org Sun Aug 14 07:42:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA98DBB9DD2; Sun, 14 Aug 2016 07:42:42 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf0-x22d.google.com (mail-pf0-x22d.google.com [IPv6:2607:f8b0:400e:c00::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A567C196C; Sun, 14 Aug 2016 07:42:42 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf0-x22d.google.com with SMTP id p64so8620200pfb.1; Sun, 14 Aug 2016 00:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=c6kH7SjAZNvpappXSOm7aNNBKXhK/Q6KldfHYpN8Ey0=; b=Nt/dSrzvwi1YoLwCwceaajn+240FCqHHBhua1xnBxHeTYCO9kfqklB9ZypH/spI0Wf KSIRO7FtiKVR6FlMbTLo+ryryXssp1+wG7KRXTtu5hfP0bav6HpRSy7h3F+CCVHFEN6a MYHV9G/A1+4gfVwBEY8nOZOEPwODi+ZNor3WghcYL+8pgVKkgJ+HyPs6wTnZFf6nbmba tVF7Lc0AAxRJf4HAqz+H715dfaOWb48SgU0R0JRvsXNCy01JVe6i9Kni9JTZsDovGpVm KmBIX6a3BX+H9lUZvKeKbEMNBtdohyDEJTBOVTycOyCyk1+rmVajqdy0Ovu8V7xsJWRp GlbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:reply-to:subject:references:to:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=c6kH7SjAZNvpappXSOm7aNNBKXhK/Q6KldfHYpN8Ey0=; b=Uju/YM2TMG2YrC8scub0OpnJRE3ZiyMKktrC4MDa4+sB0WdhIuDhrURNTzn7hVsLqb MLMp25Lp8X9y8jmOhYCuoR69xJIG0Yj/SfQe7YprROh8aGjVCdAX8lTkB+2MKt31dHgM AnMa3KEbEr1hyFdAgeHQjFyV7bUnc3BUCgCmlxcsNRci0pgbjZkaaJjJdkUeR541I4f8 JLaqdahGh1DA9ZStOfNaZOwWnB7WMamBl/UaVtW7DFVcBqMOSuBtGHb4AJFca6GBOOde 2SYvNDug7uIeOZZOFe4nBYbddss4r14yRdA0peTiaUHDJoBIa1o3d/ajgPQwKgQvdqP4 lA3g== X-Gm-Message-State: AEkoouuty2ZEmsZbASYqWkBcZTYKglNMdHjiEa9zT6rfr3M+qSTvjsV5sjZ8X7oK5zqg8w== X-Received: by 10.98.51.131 with SMTP id z125mr43017425pfz.109.1471160562005; Sun, 14 Aug 2016 00:42:42 -0700 (PDT) Received: from ?IPv6:2001:44b8:31ae:7b01:f985:3c4b:2a0c:8bea? (2001-44b8-31ae-7b01-f985-3c4b-2a0c-8bea.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:f985:3c4b:2a0c:8bea]) by smtp.gmail.com with ESMTPSA id e2sm24421703pfd.45.2016.08.14.00.42.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Aug 2016 00:42:41 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r304072 - head/etc References: <201608140518.u7E5Icf1037514@repo.freebsd.org> To: Xin LI , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Kubilay Kocak Message-ID: <7ac3c224-fcdd-1132-207f-e1533b0c5141@FreeBSD.org> Date: Sun, 14 Aug 2016 17:42:33 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Thunderbird/50.0a2 MIME-Version: 1.0 In-Reply-To: <201608140518.u7E5Icf1037514@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-AU Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 07:42:43 -0000 On 14/08/2016 3:18 PM, Xin LI wrote: > Author: delphij Date: Sun Aug 14 05:18:38 2016 New Revision: 304072 > URL: https://svnweb.freebsd.org/changeset/base/304072 > > Log: Now that the portsnap buildbox is generating the raw bits for > INDEX-12, add it to the set of INDEX files built by portsnap. Thank you! > Switch to INDEX-12 for head/. > > Modified: head/etc/portsnap.conf > > Modified: head/etc/portsnap.conf > ============================================================================== > > --- head/etc/portsnap.conf Sun Aug 14 05:10:26 2016 (r304071) > +++ head/etc/portsnap.conf Sun Aug 14 05:18:38 2016 (r304072) @@ > -32,4 +32,5 @@ # List of INDEX files to build and the DESCRIBE file > to use for each #INDEX INDEX-9 DESCRIBE.9 #INDEX INDEX-10 > DESCRIBE.10 -INDEX INDEX-11 DESCRIBE.11 +#INDEX INDEX-11 DESCRIBE.11 > +INDEX INDEX-12 DESCRIBE.12 > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head To > unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-all@freebsd.org Sun Aug 14 07:59:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82AF4BB9FA6; Sun, 14 Aug 2016 07:59:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 551731E18; Sun, 14 Aug 2016 07:59:35 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7E7xYjF096750; Sun, 14 Aug 2016 07:59:34 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E7xYxi096749; Sun, 14 Aug 2016 07:59:34 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608140759.u7E7xYxi096749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 14 Aug 2016 07:59:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304074 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 07:59:35 -0000 Author: kib Date: Sun Aug 14 07:59:34 2016 New Revision: 304074 URL: https://svnweb.freebsd.org/changeset/base/304074 Log: MFC r303958: The pmap_delayed_invl_wait() function blocks on turnstile, it does not spin, in the committed version. Remove stray '*' in the text. Modified: stable/11/sys/amd64/amd64/pmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/pmap.c ============================================================================== --- stable/11/sys/amd64/amd64/pmap.c Sun Aug 14 06:06:09 2016 (r304073) +++ stable/11/sys/amd64/amd64/pmap.c Sun Aug 14 07:59:34 2016 (r304074) @@ -561,9 +561,9 @@ pmap_delayed_invl_wait(vm_page_t m) * block to complete before proceeding. * * The function works by setting the DI generation number for m's PV - * list to at least * the number for the current thread. This forces - * a caller to pmap_delayed_invl_wait() to spin until current thread - * calls pmap_delayed_invl_finished(). + * list to at least the DI generation number of the current thread. + * This forces a caller of pmap_delayed_invl_wait() to block until + * current thread calls pmap_delayed_invl_finished(). */ static void pmap_delayed_invl_page(vm_page_t m) From owner-svn-src-all@freebsd.org Sun Aug 14 09:26:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D79DBB7655; Sun, 14 Aug 2016 09:26:15 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9D051671; Sun, 14 Aug 2016 09:26:14 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7E9QEYx030879; Sun, 14 Aug 2016 09:26:14 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7E9QBfT030848; Sun, 14 Aug 2016 09:26:11 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201608140926.u7E9QBfT030848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Sun, 14 Aug 2016 09:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304075 - in head: contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/t... 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 09:26:15 -0000 Author: mm Date: Sun Aug 14 09:26:10 2016 New Revision: 304075 URL: https://svnweb.freebsd.org/changeset/base/304075 Log: MFV r304060: Sync libarchive with vendor including three security fixes Vendor issues fixed: Issue #744: Very long pathnames evade symlink checks Issue #748: libarchive can compress, but cannot decompress zip some files PR #750: ustar: fix out of bounds read on empty string ("") filename PR #755: fix use of acl_get_flagset_np() on FreeBSD MFC after: 3 days Added: head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c - copied unchanged from r304060, vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.c head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu - copied unchanged from r304060, vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.zip.uu head/contrib/libarchive/libarchive/test/test_write_disk_secure744.c - copied unchanged from r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure744.c head/contrib/libarchive/libarchive/test/test_write_disk_secure745.c - copied unchanged from r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure745.c head/contrib/libarchive/libarchive/test/test_write_disk_secure746.c - copied unchanged from r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure746.c Modified: head/contrib/libarchive/cat/test/test_version.c head/contrib/libarchive/cpio/cmdline.c head/contrib/libarchive/cpio/test/test_option_version.c head/contrib/libarchive/libarchive/archive_match.c head/contrib/libarchive/libarchive/archive_ppmd7_private.h head/contrib/libarchive/libarchive/archive_read_add_passphrase.c head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c head/contrib/libarchive/libarchive/archive_read_disk_posix.c head/contrib/libarchive/libarchive/archive_read_private.h head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c head/contrib/libarchive/libarchive/archive_read_support_format_lha.c head/contrib/libarchive/libarchive/archive_read_support_format_warc.c head/contrib/libarchive/libarchive/archive_util.c head/contrib/libarchive/libarchive/archive_write_disk_acl.c head/contrib/libarchive/libarchive/archive_write_disk_posix.c head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c head/contrib/libarchive/libarchive/archive_write_set_format_ustar.c head/contrib/libarchive/libarchive/test/main.c head/contrib/libarchive/libarchive/test/test.h head/contrib/libarchive/libarchive/test/test_archive_string_conversion.c head/contrib/libarchive/libarchive/test/test_fuzz.c head/contrib/libarchive/libarchive/test/test_read_format_rar.c head/contrib/libarchive/tar/cmdline.c head/contrib/libarchive/tar/test/test_version.c head/lib/libarchive/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) head/contrib/libarchive/cpio/ (props changed) head/contrib/libarchive/libarchive/ (props changed) head/contrib/libarchive/tar/ (props changed) Modified: head/contrib/libarchive/cat/test/test_version.c ============================================================================== --- head/contrib/libarchive/cat/test/test_version.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/cat/test/test_version.c Sun Aug 14 09:26:10 2016 (r304075) @@ -83,7 +83,7 @@ DEFINE_TEST(test_version) if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') ++q; /* Skip arbitrary third-party version numbers. */ - while (s > 0 && (*q == ' ' || *q == '/' || *q == '.' || isalnum(*q))) { + while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) { ++q; --s; } Modified: head/contrib/libarchive/cpio/cmdline.c ============================================================================== --- head/contrib/libarchive/cpio/cmdline.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/cpio/cmdline.c Sun Aug 14 09:26:10 2016 (r304075) @@ -63,6 +63,7 @@ static const struct option { } cpio_longopts[] = { { "b64encode", 0, OPTION_B64ENCODE }, { "create", 0, 'o' }, + { "dereference", 0, 'L' }, { "dot", 0, 'V' }, { "extract", 0, 'i' }, { "file", 1, 'F' }, Modified: head/contrib/libarchive/cpio/test/test_option_version.c ============================================================================== --- head/contrib/libarchive/cpio/test/test_option_version.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/cpio/test/test_option_version.c Sun Aug 14 09:26:10 2016 (r304075) @@ -75,7 +75,7 @@ verify(const char *p, size_t s) if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') ++q; /* Skip arbitrary third-party version numbers. */ - while (s > 0 && (*q == ' ' || *q == '/' || *q == '.' || isalnum(*q))) { + while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) { ++q; --s; } Modified: head/contrib/libarchive/libarchive/archive_match.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_match.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_match.c Sun Aug 14 09:26:10 2016 (r304075) @@ -655,7 +655,7 @@ add_pattern_from_file(struct archive_mat } } - /* If something error happend, report it immediately. */ + /* If an error occurred, report it immediately. */ if (r < ARCHIVE_OK) { archive_copy_error(&(a->archive), ar); archive_read_free(ar); Modified: head/contrib/libarchive/libarchive/archive_ppmd7_private.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_ppmd7_private.h Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_ppmd7_private.h Sun Aug 14 09:26:10 2016 (r304075) @@ -19,7 +19,7 @@ If you need the compatibility with origi #define PPMD7_MAX_ORDER 64 #define PPMD7_MIN_MEM_SIZE (1 << 11) -#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFF - 12 * 3) +#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFFu - 12 * 3) struct CPpmd7_Context_; Modified: head/contrib/libarchive/libarchive/archive_read_add_passphrase.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_add_passphrase.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_read_add_passphrase.c Sun Aug 14 09:26:10 2016 (r304075) @@ -125,7 +125,7 @@ void __archive_read_reset_passphrase(struct archive_read *a) { - a->passphrases.candiate = -1; + a->passphrases.candidate = -1; } /* @@ -137,31 +137,31 @@ __archive_read_next_passphrase(struct ar struct archive_read_passphrase *p; const char *passphrase; - if (a->passphrases.candiate < 0) { + if (a->passphrases.candidate < 0) { /* Count out how many passphrases we have. */ int cnt = 0; for (p = a->passphrases.first; p != NULL; p = p->next) cnt++; - a->passphrases.candiate = cnt; + a->passphrases.candidate = cnt; p = a->passphrases.first; - } else if (a->passphrases.candiate > 1) { + } else if (a->passphrases.candidate > 1) { /* Rotate a passphrase list. */ - a->passphrases.candiate--; + a->passphrases.candidate--; p = remove_passphrases_from_head(a); add_passphrase_to_tail(a, p); - /* Pick a new passphrase candiate up. */ + /* Pick a new passphrase candidate up. */ p = a->passphrases.first; - } else if (a->passphrases.candiate == 1) { - /* This case is that all cadiates failed to decryption. */ - a->passphrases.candiate = 0; + } else if (a->passphrases.candidate == 1) { + /* This case is that all candidates failed to decrypt. */ + a->passphrases.candidate = 0; if (a->passphrases.first->next != NULL) { /* Rotate a passphrase list. */ p = remove_passphrases_from_head(a); add_passphrase_to_tail(a, p); } p = NULL; - } else /* There is no passphrase candaite. */ + } else /* There is no passphrase candidate. */ p = NULL; if (p != NULL) @@ -177,7 +177,7 @@ __archive_read_next_passphrase(struct ar if (p == NULL) return (NULL); insert_passphrase_to_head(a, p); - a->passphrases.candiate = 1; + a->passphrases.candidate = 1; } } else passphrase = NULL; Modified: head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Sun Aug 14 09:26:10 2016 (r304075) @@ -641,13 +641,16 @@ translate_acl(struct archive_read_disk * * Libarchive stores "flag" (NFSv4 inheritance bits) * in the ae_perm bitmap. */ - acl_get_flagset_np(acl_entry, &acl_flagset); - for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (acl_get_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit)) - ae_perm |= acl_inherit_map[i].archive_inherit; - - } + // XXX acl_get_flagset_np on FreeBSD returns EINVAL for + // non-NFSv4 ACLs + r = acl_get_flagset_np(acl_entry, &acl_flagset); + if (r == 0) { + for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { + if (acl_get_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit)) + ae_perm |= acl_inherit_map[i].archive_inherit; + } + } #endif acl_get_permset(acl_entry, &acl_permset); Modified: head/contrib/libarchive/libarchive/archive_read_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_disk_posix.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_read_disk_posix.c Sun Aug 14 09:26:10 2016 (r304075) @@ -938,7 +938,7 @@ next_entry(struct archive_read_disk *a, r = archive_match_path_excluded(a->matching, entry); if (r < 0) { archive_set_error(&(a->archive), errno, - "Faild : %s", archive_error_string(a->matching)); + "Failed : %s", archive_error_string(a->matching)); return (r); } if (r) { @@ -1041,7 +1041,7 @@ next_entry(struct archive_read_disk *a, r = archive_match_time_excluded(a->matching, entry); if (r < 0) { archive_set_error(&(a->archive), errno, - "Faild : %s", archive_error_string(a->matching)); + "Failed : %s", archive_error_string(a->matching)); return (r); } if (r) { @@ -1067,7 +1067,7 @@ next_entry(struct archive_read_disk *a, r = archive_match_owner_excluded(a->matching, entry); if (r < 0) { archive_set_error(&(a->archive), errno, - "Faild : %s", archive_error_string(a->matching)); + "Failed : %s", archive_error_string(a->matching)); return (r); } if (r) { Modified: head/contrib/libarchive/libarchive/archive_read_private.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_private.h Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_read_private.h Sun Aug 14 09:26:10 2016 (r304075) @@ -221,7 +221,7 @@ struct archive_read { struct { struct archive_read_passphrase *first; struct archive_read_passphrase **last; - int candiate; + int candidate; archive_passphrase_callback *callback; void *client_data; } passphrases; Modified: head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c Sun Aug 14 09:26:10 2016 (r304075) @@ -595,7 +595,7 @@ lz4_filter_read_data_block(struct archiv #endif } - /* Check if an error happend in decompression process. */ + /* Check if an error occurred in the decompression process. */ if (uncompressed_size < 0) { archive_set_error(&(self->archive->archive), ARCHIVE_ERRNO_MISC, "lz4 decompression failed"); Modified: head/contrib/libarchive/libarchive/archive_read_support_format_lha.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_lha.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_read_support_format_lha.c Sun Aug 14 09:26:10 2016 (r304075) @@ -1715,8 +1715,11 @@ lha_crc16(uint16_t crc, const void *pp, #undef bswap16 #if defined(_MSC_VER) && _MSC_VER >= 1400 /* Visual Studio */ # define bswap16(x) _byteswap_ushort(x) -#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8) \ - || defined(__clang__) +#elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4) +/* GCC 4.8 and later has __builtin_bswap16() */ +# define bswap16(x) __builtin_bswap16(x) +#elif defined(__clang__) +/* All clang versions have __builtin_bswap16() */ # define bswap16(x) __builtin_bswap16(x) #else # define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8)) Modified: head/contrib/libarchive/libarchive/archive_read_support_format_warc.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_warc.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_read_support_format_warc.c Sun Aug 14 09:26:10 2016 (r304075) @@ -318,7 +318,7 @@ start_over: } memcpy(w->pool.str, fnam.str, fnam.len); w->pool.str[fnam.len] = '\0'; - /* let noone else know about the pool, it's a secret, shhh */ + /* let no one else know about the pool, it's a secret, shhh */ fnam.str = w->pool.str; /* snarf mtime or deduce from rtime Modified: head/contrib/libarchive/libarchive/archive_util.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_util.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_util.c Sun Aug 14 09:26:10 2016 (r304075) @@ -580,7 +580,7 @@ void __archive_ensure_cloexec_flag(int fd) { #if defined(_WIN32) && !defined(__CYGWIN__) - (void)fd; /* UNSED */ + (void)fd; /* UNUSED */ #else int flags; Modified: head/contrib/libarchive/libarchive/archive_write_disk_acl.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_acl.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_write_disk_acl.c Sun Aug 14 09:26:10 2016 (r304075) @@ -145,7 +145,7 @@ set_acl(struct archive *a, int fd, const gid_t ae_gid; const char *ae_name; int entries; - int i; + int i, r; ret = ARCHIVE_OK; entries = archive_acl_reset(abstract_acl, ae_requested_type); @@ -223,12 +223,16 @@ set_acl(struct archive *a, int fd, const } #ifdef ACL_TYPE_NFS4 - acl_get_flagset_np(acl_entry, &acl_flagset); - acl_clear_flags_np(acl_flagset); - for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { - if (ae_permset & acl_inherit_map[i].archive_inherit) - acl_add_flag_np(acl_flagset, - acl_inherit_map[i].platform_inherit); + // XXX acl_get_flagset_np on FreeBSD returns EINVAL for + // non-NFSv4 ACLs + r = acl_get_flagset_np(acl_entry, &acl_flagset); + if (r == 0) { + acl_clear_flags_np(acl_flagset); + for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { + if (ae_permset & acl_inherit_map[i].archive_inherit) + acl_add_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit); + } } #endif } Modified: head/contrib/libarchive/libarchive/archive_write_disk_posix.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_disk_posix.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_write_disk_posix.c Sun Aug 14 09:26:10 2016 (r304075) @@ -1796,7 +1796,7 @@ edit_deep_directories(struct archive_wri char *tail = a->name; /* If path is short, avoid the open() below. */ - if (strlen(tail) <= PATH_MAX) + if (strlen(tail) < PATH_MAX) return; /* Try to record our starting dir. */ @@ -1806,7 +1806,7 @@ edit_deep_directories(struct archive_wri return; /* As long as the path is too long... */ - while (strlen(tail) > PATH_MAX) { + while (strlen(tail) >= PATH_MAX) { /* Locate a dir prefix shorter than PATH_MAX. */ tail += PATH_MAX - 8; while (tail > a->name && *tail != '/') Modified: head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Sun Aug 14 09:26:10 2016 (r304075) @@ -436,7 +436,7 @@ struct iso_option { * Type : string * Default: Auto detect * : We check a size of boot image; - * : If ths size is just 1.22M/1.44M/2.88M, + * : If the size is just 1.22M/1.44M/2.88M, * : we assume boot_type is 'fd'; * : otherwise boot_type is 'no-emulation'. * COMPAT : Modified: head/contrib/libarchive/libarchive/archive_write_set_format_ustar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_ustar.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/archive_write_set_format_ustar.c Sun Aug 14 09:26:10 2016 (r304075) @@ -307,7 +307,7 @@ archive_write_ustar_header(struct archiv * case getting WCS failed. On POSIX, this is a * normal operation. */ - if (p != NULL && p[strlen(p) - 1] != '/') { + if (p != NULL && p[0] != '\0' && p[strlen(p) - 1] != '/') { struct archive_string as; archive_string_init(&as); Modified: head/contrib/libarchive/libarchive/test/main.c ============================================================================== --- head/contrib/libarchive/libarchive/test/main.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/test/main.c Sun Aug 14 09:26:10 2016 (r304075) @@ -1440,6 +1440,31 @@ assertion_file_size(const char *file, in return (0); } +/* Verify mode of 'pathname'. */ +int +assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode) +{ + int mode; + int r; + + assertion_count(file, line); +#if defined(_WIN32) && !defined(__CYGWIN__) + failure_start(file, line, "assertFileMode not yet implemented for Windows"); +#else + { + struct stat st; + r = lstat(pathname, &st); + mode = (int)(st.st_mode & 0777); + } + if (r == 0 && mode == expected_mode) + return (1); + failure_start(file, line, "File %s has mode %o, expected %o", + pathname, mode, expected_mode); +#endif + failure_finish(NULL); + return (0); +} + /* Assert that 'pathname' is a dir. If mode >= 0, verify that too. */ int assertion_is_dir(const char *file, int line, const char *pathname, int mode) Modified: head/contrib/libarchive/libarchive/test/test.h ============================================================================== --- head/contrib/libarchive/libarchive/test/test.h Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/test/test.h Sun Aug 14 09:26:10 2016 (r304075) @@ -182,6 +182,8 @@ assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks) #define assertFileSize(pathname, size) \ assertion_file_size(__FILE__, __LINE__, pathname, size) +#define assertFileMode(pathname, mode) \ + assertion_file_mode(__FILE__, __LINE__, pathname, mode) #define assertTextFileContents(text, pathname) \ assertion_text_file_contents(__FILE__, __LINE__, text, pathname) #define assertFileContainsLinesAnyOrder(pathname, lines) \ @@ -246,6 +248,7 @@ int assertion_file_mtime_recent(const ch int assertion_file_nlinks(const char *, int, const char *, int); int assertion_file_not_exists(const char *, int, const char *); int assertion_file_size(const char *, int, const char *, long); +int assertion_file_mode(const char *, int, const char *, int); int assertion_is_dir(const char *, int, const char *, int); int assertion_is_hardlink(const char *, int, const char *, const char *); int assertion_is_not_hardlink(const char *, int, const char *, const char *); Modified: head/contrib/libarchive/libarchive/test/test_archive_string_conversion.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_archive_string_conversion.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/test/test_archive_string_conversion.c Sun Aug 14 09:26:10 2016 (r304075) @@ -800,8 +800,8 @@ DEFINE_TEST(test_archive_string_conversi assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assert((fp = fopen(testdata, "w")) != NULL); while ((size = archive_read_data(a, buff, 512)) > 0) - fwrite(buff, 1, size, fp); - fclose(fp); + assertEqualInt(size, fwrite(buff, 1, size, fp)); + assertEqualInt(0, fclose(fp)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); test_archive_string_normalization_nfc(testdata); Modified: head/contrib/libarchive/libarchive/test/test_fuzz.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_fuzz.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/test/test_fuzz.c Sun Aug 14 09:26:10 2016 (r304075) @@ -110,13 +110,17 @@ test_fuzz(const struct files *filesets) for (i = 0; filesets[n].names[i] != NULL; ++i) { tmp = slurpfile(&size, filesets[n].names[i]); - rawimage = (char *)realloc(rawimage, oldsize + size); + char *newraw = (char *)realloc(rawimage, oldsize + size); + if (!assert(newraw != NULL)) + { + free(rawimage); + continue; + } + rawimage = newraw; memcpy(rawimage + oldsize, tmp, size); oldsize += size; size = oldsize; free(tmp); - if (!assert(rawimage != NULL)) - continue; } } if (size == 0) Modified: head/contrib/libarchive/libarchive/test/test_read_format_rar.c ============================================================================== --- head/contrib/libarchive/libarchive/test/test_read_format_rar.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/libarchive/test/test_read_format_rar.c Sun Aug 14 09:26:10 2016 (r304075) @@ -3603,7 +3603,7 @@ DEFINE_TEST(test_read_format_rar_multivo assertEqualIntA(a, 0, archive_read_data(a, buff, sizeof(buff))); /* - * Eigth header. + * Eighth header. */ assertA(0 == archive_read_next_header(a, &ae)); assertEqualString("testdir/testsymlink6", archive_entry_pathname(ae)); Copied: head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c (from r304060, vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.c Sun Aug 14 09:26:10 2016 (r304075, copy of r304060, vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.c) @@ -0,0 +1,143 @@ +/*- + * Copyright (c) 2016 Tim Kientzle + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD"); + +#include + + +/* + * Github Issue 748 reported problems with end-of-entry handling + * with highly-compressible data. This resulted in the end of the + * data being truncated (extracted as zero bytes). + */ + +/* + * Extract the specific test archive that was used to diagnose + * Issue 748: + */ +DEFINE_TEST(test_read_format_zip_high_compression) +{ + const char *refname = "test_read_format_zip_high_compression.zip"; + char *p; + size_t archive_size; + struct archive *a; + struct archive_entry *entry; + + const void *pv; + size_t s; + int64_t o; + + extract_reference_file(refname); + p = slurpfile(&archive_size, refname); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, p, archive_size, 16 * 1024)); + assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &entry)); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(262144, s); + assertEqualInt(0, o); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(160, s); + assertEqualInt(262144, o); + + assertEqualInt(ARCHIVE_EOF, archive_read_data_block(a, &pv, &s, &o)); + + assertEqualInt(ARCHIVE_OK, archive_free(a)); + free(p); +} + +/* + * Synthesize a lot of varying inputs that are highly compressible. + */ +DEFINE_TEST(test_read_format_zip_high_compression2) +{ + const size_t body_size = 1024 * 1024; + const size_t buff_size = 2 * 1024 * 1024; + char *body, *body_read, *buff; + int n; + + assert((body = malloc(body_size)) != NULL); + assert((body_read = malloc(body_size)) != NULL); + assert((buff = malloc(buff_size)) != NULL); + + /* Highly-compressible data: all bytes 255, except for a + * single 1 byte. + * The body is always 256k + 6 bytes long (the internal deflation + * buffer is exactly 256k). + */ + + for(n = 1024; n < (int)body_size; n += 1024) { + struct archive *a; + struct archive_entry *entry; + size_t used = 0; + const void *pv; + size_t s; + int64_t o; + + memset(body, 255, body_size); + body[n] = 1; + + /* Write an archive with a single entry of n bytes. */ + assert((a = archive_write_new()) != NULL); + assertEqualInt(ARCHIVE_OK, archive_write_set_format_zip(a)); + assertEqualInt(ARCHIVE_OK, archive_write_open_memory(a, buff, buff_size, &used)); + + entry = archive_entry_new2(a); + archive_entry_set_pathname(entry, "test"); + archive_entry_set_filetype(entry, AE_IFREG); + archive_entry_set_size(entry, 262150); + assertEqualInt(ARCHIVE_OK, archive_write_header(a, entry)); + archive_entry_free(entry); + assertEqualInt(262150, archive_write_data(a, body, 262150)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Read back the entry and verify the contents. */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory(a, buff, used, 17)); + assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &entry)); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(262144, s); + assertEqualInt(0, o); + + assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &pv, &s, &o)); + assertEqualInt(6, s); + assertEqualInt(262144, o); + + assertEqualInt(ARCHIVE_EOF, archive_read_data_block(a, &pv, &s, &o)); + + assertEqualInt(ARCHIVE_OK, archive_free(a)); + } + + free(body); + free(body_read); + free(buff); +} Copied: head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu (from r304060, vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.zip.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_read_format_zip_high_compression.zip.uu Sun Aug 14 09:26:10 2016 (r304075, copy of r304060, vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.zip.uu) @@ -0,0 +1,18 @@ +begin 644 test_read_format_zip_high_compression.zip +M4$L#!!0`"``(`*=Y]4@``````````*``!``(`"``8VAA +MD5>>))%7GB215W5X"P`!!/8!```$%````.W=06K#,!`%T&E)P8LL?*2XC@N% +M)#5QO>AM@9WDJ6!%\6$K/Q6T3LAX]N/GQ'Z9G&KA^*K1'S +M.`[GOIM*[TP_Q_>O0[G_:3X.Y\^^V/X2<>))%7=7@+``$$]@$```04````4$L%!@`````!``$`5@````L"```` +!```` +` +end Copied: head/contrib/libarchive/libarchive/test/test_write_disk_secure744.c (from r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure744.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_write_disk_secure744.c Sun Aug 14 09:26:10 2016 (r304075, copy of r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure744.c) @@ -0,0 +1,95 @@ +/*- + * Copyright (c) 2003-2007,2016 Tim Kientzle + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +#define UMASK 022 + +/* + * Github Issue #744 describes a bug in the sandboxing code that + * causes very long pathnames to not get checked for symlinks. + */ + +DEFINE_TEST(test_write_disk_secure744) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + size_t buff_size = 8192; + char *buff = malloc(buff_size); + char *p = buff; + int n = 0; + int t; + + assert(buff != NULL); + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_SYMLINKS); + + while (p + 500 < buff + buff_size) { + memset(p, 'x', 100); + p += 100; + p[0] = '\0'; + + buff[0] = ((n / 1000) % 10) + '0'; + buff[1] = ((n / 100) % 10)+ '0'; + buff[2] = ((n / 10) % 10)+ '0'; + buff[3] = ((n / 1) % 10)+ '0'; + buff[4] = '_'; + ++n; + + /* Create a symlink pointing to the testworkdir */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, buff); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_copy_symlink(ae, testworkdir); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + *p++ = '/'; + sprintf(p, "target%d", n); + + /* Try to create a file through the symlink, should fail. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, buff); + archive_entry_set_mode(ae, S_IFDIR | 0777); + + t = archive_write_header(a, ae); + archive_entry_free(ae); + failure("Attempt to create target%d via %d-character symlink should have failed", n, (int)strlen(buff)); + if(!assertEqualInt(ARCHIVE_FAILED, t)) { + break; + } + } + archive_free(a); + free(buff); +#endif +} Copied: head/contrib/libarchive/libarchive/test/test_write_disk_secure745.c (from r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure745.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_write_disk_secure745.c Sun Aug 14 09:26:10 2016 (r304075, copy of r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure745.c) @@ -0,0 +1,76 @@ +/*- + * Copyright (c) 2003-2007,2016 Tim Kientzle + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +#define UMASK 022 + +/* + * Github Issue #745 describes a bug in the sandboxing code that + * allows one to use a symlink to edit the permissions on a file or + * directory outside of the sandbox. + */ + +DEFINE_TEST(test_write_disk_secure745) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_SYMLINKS); + + /* The target dir: The one we're going to try to change permission on */ + assertMakeDir("target", 0700); + + /* The sandbox dir we're going to run inside of. */ + assertMakeDir("sandbox", 0700); + assertChdir("sandbox"); + + /* Create a symlink pointing to the target directory */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "sym"); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_copy_symlink(ae, "../target"); + assert(0 == archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Try to alter the target dir through the symlink; this should fail. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "sym"); + archive_entry_set_mode(ae, S_IFDIR | 0777); + assert(0 == archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Permission of target dir should not have changed. */ + assertFileMode("../target", 0700); +#endif +} Copied: head/contrib/libarchive/libarchive/test/test_write_disk_secure746.c (from r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure746.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_write_disk_secure746.c Sun Aug 14 09:26:10 2016 (r304075, copy of r304060, vendor/libarchive/dist/libarchive/test/test_write_disk_secure746.c) @@ -0,0 +1,125 @@ +/*- + * Copyright (c) 2003-2007,2016 Tim Kientzle + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +#define UMASK 022 + +/* + * Github Issue #746 describes a problem in which hardlink targets are + * not adequately checked and can be used to modify entries outside of + * the sandbox. + */ + +/* + * Verify that ARCHIVE_EXTRACT_SECURE_NODOTDOT disallows '..' in hardlink + * targets. + */ +DEFINE_TEST(test_write_disk_secure746a) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* The target directory we're going to try to affect. */ + assertMakeDir("target", 0700); + assertMakeFile("target/foo", 0700, "unmodified"); + + /* The sandbox dir we're going to work within. */ + assertMakeDir("sandbox", 0700); + assertChdir("sandbox"); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_NODOTDOT); + + /* Attempt to hardlink to the target directory. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "bar"); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_set_size(ae, 8); + archive_entry_copy_hardlink(ae, "../target/foo"); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); + assertEqualInt(ARCHIVE_FAILED, archive_write_data(a, "modified", 8)); + archive_entry_free(ae); + + /* Verify that target file contents are unchanged. */ + assertTextFileContents("unmodified", "../target/foo"); +#endif +} + +/* + * Verify that ARCHIVE_EXTRACT_SECURE_NOSYMLINK disallows symlinks in hardlink + * targets. + */ +DEFINE_TEST(test_write_disk_secure746b) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + skipping("archive_write_disk security checks not supported on Windows"); +#else + struct archive *a; + struct archive_entry *ae; + + /* Start with a known umask. */ + assertUmask(UMASK); + + /* The target directory we're going to try to affect. */ + assertMakeDir("target", 0700); + assertMakeFile("target/foo", 0700, "unmodified"); + + /* The sandbox dir we're going to work within. */ + assertMakeDir("sandbox", 0700); + assertChdir("sandbox"); + + /* Create an archive_write_disk object. */ + assert((a = archive_write_disk_new()) != NULL); + archive_write_disk_set_options(a, ARCHIVE_EXTRACT_SECURE_SYMLINKS); + + /* Create a symlink to the target directory. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "symlink"); + archive_entry_copy_symlink(ae, "../target"); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Attempt to hardlink to the target directory via the symlink. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "bar"); + archive_entry_set_mode(ae, S_IFREG | 0777); + archive_entry_set_size(ae, 8); + archive_entry_copy_hardlink(ae, "symlink/foo"); + assertEqualInt(ARCHIVE_FAILED, archive_write_header(a, ae)); + assertEqualInt(ARCHIVE_FAILED, archive_write_data(a, "modified", 8)); + archive_entry_free(ae); + + /* Verify that target file contents are unchanged. */ + assertTextFileContents("unmodified", "../target/foo"); +#endif +} Modified: head/contrib/libarchive/tar/cmdline.c ============================================================================== --- head/contrib/libarchive/tar/cmdline.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/tar/cmdline.c Sun Aug 14 09:26:10 2016 (r304075) @@ -68,6 +68,7 @@ static const struct bsdtar_option { { "auto-compress", 0, 'a' }, { "b64encode", 0, OPTION_B64ENCODE }, { "block-size", 1, 'b' }, + { "blocking-factor", 1, 'b' }, { "bunzip2", 0, 'j' }, { "bzip", 0, 'j' }, { "bzip2", 0, 'j' }, Modified: head/contrib/libarchive/tar/test/test_version.c ============================================================================== --- head/contrib/libarchive/tar/test/test_version.c Sun Aug 14 07:59:34 2016 (r304074) +++ head/contrib/libarchive/tar/test/test_version.c Sun Aug 14 09:26:10 2016 (r304075) @@ -88,7 +88,7 @@ DEFINE_TEST(test_version) if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd') ++q; /* Skip arbitrary third-party version numbers. */ - while (s > 0 && (*q == ' ' || *q == '/' || *q == '.' || isalnum(*q))) { + while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) { ++q; --s; } Modified: head/lib/libarchive/tests/Makefile ============================================================================== --- head/lib/libarchive/tests/Makefile Sun Aug 14 07:59:34 2016 (r304074) +++ head/lib/libarchive/tests/Makefile Sun Aug 14 09:26:10 2016 (r304075) @@ -175,6 +175,7 @@ TESTS_SRCS= \ test_read_format_zip_encryption_header.c \ test_read_format_zip_encryption_partially.c \ test_read_format_zip_filename.c \ + test_read_format_zip_high_compression.c \ test_read_format_zip_mac_metadata.c \ test_read_format_zip_malformed.c \ test_read_format_zip_msdos.c \ @@ -209,6 +210,9 @@ TESTS_SRCS= \ test_write_disk_no_hfs_compression.c \ test_write_disk_perms.c \ test_write_disk_secure.c \ + test_write_disk_secure744.c \ + test_write_disk_secure745.c \ + test_write_disk_secure746.c \ test_write_disk_sparse.c \ test_write_disk_symlink.c \ test_write_disk_times.c \ @@ -504,6 +508,7 @@ ${PACKAGE}FILES+= test_read_format_zip_f ${PACKAGE}FILES+= test_read_format_zip_filename_utf8_jp.zip.uu ${PACKAGE}FILES+= test_read_format_zip_filename_utf8_ru.zip.uu ${PACKAGE}FILES+= test_read_format_zip_filename_utf8_ru2.zip.uu +${PACKAGE}FILES+= test_read_format_zip_high_compression.zip.uu ${PACKAGE}FILES+= test_read_format_zip_length_at_end.zip.uu ${PACKAGE}FILES+= test_read_format_zip_mac_metadata.zip.uu ${PACKAGE}FILES+= test_read_format_zip_malformed1.zip.uu From owner-svn-src-all@freebsd.org Sun Aug 14 13:15:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27134BB991F; Sun, 14 Aug 2016 13:15:12 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0098.outbound.protection.outlook.com [65.55.169.98]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7ACBB1881; Sun, 14 Aug 2016 13:15:10 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YQBPR01MB0401.CANPRD01.PROD.OUTLOOK.COM (10.169.142.147) by YQBPR01MB0404.CANPRD01.PROD.OUTLOOK.COM (10.169.142.150) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21; Sun, 14 Aug 2016 12:59:52 +0000 Received: from YQBPR01MB0401.CANPRD01.PROD.OUTLOOK.COM ([10.169.142.147]) by YQBPR01MB0401.CANPRD01.PROD.OUTLOOK.COM ([10.169.142.147]) with mapi id 15.01.0557.021; Sun, 14 Aug 2016 12:59:52 +0000 From: Rick Macklem To: Mark Johnston , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r304066 - head/usr.bin/nfsstat Thread-Topic: svn commit: r304066 - head/usr.bin/nfsstat Thread-Index: AQHR9cIyxorfsJ37wE2jgtMo7Us9JaBIay6L Date: Sun, 14 Aug 2016 12:59:52 +0000 Message-ID: References: <201608140024.u7E0O0K8029986@repo.freebsd.org> In-Reply-To: <201608140024.u7E0O0K8029986@repo.freebsd.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rmacklem@uoguelph.ca; x-originating-ip: [24.57.164.61] x-ms-office365-filtering-correlation-id: 5e38a7ab-7976-41d0-0f5c-08d3c442e198 x-microsoft-exchange-diagnostics: 1; YQBPR01MB0404; 6:TvLvVtvf2xyox4fQcs2f0GL7yBA3jFS3WdA/f87slPWh/Sf2m/80g1BxHZb90DeY/hHsrfUmLZcEwHZtBOTu0WzzJjxyMwqTO9jWzIXwWoz7t81Ad+U+J1DBXtGPT1ZDGTBOb3o2uODYg/mtXpw1V2MXBqYVYm3SuyRqU5m3mKCIrIWpy5N7Jei+V33oG53QQPWOZZJeoyyp+Te/YtdLk1kC6isG6IzDeKZUSkGiCwNOX45Za6H1u7b4WG6IrW/OQla/wQ1Ljv/k32rMuY6TY5kcZsLeoYdh2jiKGvNr1gBcrOP3bzke2mH/W2Mx2L6E; 5:qtOHWiosk9KTgRa57e2d4FruipsnHW4d48gyWcT3nMHpC6ccIOyflEwirz9WWGF8cPX3Qj8xdprLCL64y8bgEkv04CsYK+Ty5Nezobl3W/molE+IFAUUn+IhKm9xrmq8n4ZkLdj9fXMar5E3QxeURg==; 24:5N3b6+GdJY478FNpFumfwROFJJ934++RFhJCOl4l3HkXtY0BZCe2P/3PwW6bQgNExZcDMUfshn3IBQox28FECrjO7yuSxHnrmYqgQwsf3Oc=; 7:DdM5xuHy/GfO7xNJXo5Q00zJe30kaCei1Vqu6eTawai5GGZ9yEqlnFc3i++gx+Q6pSJAjKxcaSI+jiscJfVsiFI4c4+E0nUJNWcGQoZy5u9tkUA64aHyKDTCcHYFBOVKLGlaZV7JAx1lwm02lFmQkH31I1rT9OYCnYV6QEdLQ3jIaLjCYbOwy1jgUS2BlDwkahY+UTOA6dkVZAxASZRKaGoKXQdk9YmFrG+5ZiOfXmAKNhKwSux2mXazzfkK9Kc6 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:YQBPR01MB0404; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(56005881305849); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040176)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6042046)(6043046); SRVR:YQBPR01MB0404; BCL:0; PCL:0; RULEID:; SRVR:YQBPR01MB0404; x-forefront-prvs: 00342DD5BC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(7916002)(199003)(24454002)(189002)(19625215002)(106116001)(105586002)(101416001)(107886002)(15975445007)(77096005)(450100001)(66066001)(189998001)(2501003)(7906003)(81156014)(74316002)(81166006)(3660700001)(10400500002)(3846002)(7736002)(9686002)(19580395003)(5002640100001)(7696003)(11100500001)(68736007)(5001770100001)(54356999)(97736004)(8936002)(76176999)(6116002)(586003)(7846002)(102836003)(3280700002)(50986999)(2201001)(8676002)(86362001)(106356001)(33656002)(19627405001)(74482002)(19617315012)(16236675004)(2900100001)(2950100001)(122556002)(2906002)(87936001)(558084003)(92566002); DIR:OUT; SFP:1101; SCL:1; SRVR:YQBPR01MB0404; H:YQBPR01MB0401.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Aug 2016 12:59:52.0305 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR01MB0404 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 13:15:12 -0000 Mark Johnson wrote: >Author: markj >Date: Sun Aug 14 00:24:00 2016 >New Revision: 304066 >URL: https://svnweb.freebsd.org/changeset/base/304066 > >Log: > nfsstat depends on libdevstat as of r304058. Oops, sorry. I missed committing the Makefile change. Thanks for doing it, = rick From owner-svn-src-all@freebsd.org Sun Aug 14 13:17:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C21AFBB99EB; Sun, 14 Aug 2016 13:17:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E4991A05; Sun, 14 Aug 2016 13:17:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EDHteR016398; Sun, 14 Aug 2016 13:17:55 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EDHtNS016395; Sun, 14 Aug 2016 13:17:55 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608141317.u7EDHtNS016395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 14 Aug 2016 13:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304076 - head/sbin/ipfw 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 13:17:56 -0000 Author: ae Date: Sun Aug 14 13:17:55 2016 New Revision: 304076 URL: https://svnweb.freebsd.org/changeset/base/304076 Log: Make statistics nat64lsn, nat64stl an nptv6 output netstat-like: "@value @description" and fix build due to -Wformat errors. Modified: head/sbin/ipfw/nat64lsn.c head/sbin/ipfw/nat64stl.c head/sbin/ipfw/nptv6.c Modified: head/sbin/ipfw/nat64lsn.c ============================================================================== --- head/sbin/ipfw/nat64lsn.c Sun Aug 14 09:26:10 2016 (r304075) +++ head/sbin/ipfw/nat64lsn.c Sun Aug 14 13:17:55 2016 (r304076) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -687,7 +688,6 @@ nat64lsn_get_stats(const char *name, uin return (-1); } -#define _P_STAT(_s, _f) printf("%8s:\t%lu\n", #_f, _s._f) static void nat64lsn_stats(const char *name, uint8_t set) { @@ -696,34 +696,61 @@ nat64lsn_stats(const char *name, uint8_t if (nat64lsn_get_stats(name, set, &stats) != 0) err(EX_OSERR, "Error retrieving stats"); - _P_STAT(stats, opcnt64); - _P_STAT(stats, opcnt46); - _P_STAT(stats, ofrags); - _P_STAT(stats, ifrags); - _P_STAT(stats, oerrors); - _P_STAT(stats, noroute4); - _P_STAT(stats, noroute6); - _P_STAT(stats, noproto); - _P_STAT(stats, nomem); - _P_STAT(stats, dropped); - - _P_STAT(stats, hostcount); - _P_STAT(stats, tcpchunks); - _P_STAT(stats, udpchunks); - _P_STAT(stats, icmpchunks); - _P_STAT(stats, jcalls); - _P_STAT(stats, jrequests); - _P_STAT(stats, jhostsreq); - _P_STAT(stats, jportreq); - _P_STAT(stats, jhostfails); - _P_STAT(stats, jportfails); - _P_STAT(stats, jreinjected); - _P_STAT(stats, jmaxlen); - _P_STAT(stats, jnomem); - _P_STAT(stats, screated); - _P_STAT(stats, sdeleted); - _P_STAT(stats, spgcreated); - _P_STAT(stats, spgdeleted); + if (co.use_set != 0 || set != 0) + printf("set %u ", set); + printf("nat64lsn %s\n", name); + printf("\t%ju packets translated from IPv6 to IPv4\n", + (uintmax_t)stats.opcnt64); + printf("\t%ju packets translated from IPv4 to IPv6\n", + (uintmax_t)stats.opcnt46); + printf("\t%ju IPv6 fragments created\n", + (uintmax_t)stats.ofrags); + printf("\t%ju IPv4 fragments received\n", + (uintmax_t)stats.ifrags); + printf("\t%ju output packets dropped due to no bufs, etc.\n", + (uintmax_t)stats.oerrors); + printf("\t%ju output packets discarded due to no IPv4 route\n", + (uintmax_t)stats.noroute4); + printf("\t%ju output packets discarded due to no IPv6 route\n", + (uintmax_t)stats.noroute6); + printf("\t%ju packets discarded due to unsupported protocol\n", + (uintmax_t)stats.noproto); + printf("\t%ju packets discarded due to memory allocation problems\n", + (uintmax_t)stats.nomem); + printf("\t%ju packets discarded due to some errors\n", + (uintmax_t)stats.dropped); + printf("\t%ju packets not matched with IPv4 prefix\n", + (uintmax_t)stats.nomatch4); + + printf("\t%ju mbufs queued for post processing\n", + (uintmax_t)stats.jreinjected); + printf("\t%ju times the job queue was processed\n", + (uintmax_t)stats.jcalls); + printf("\t%ju job requests queued\n", + (uintmax_t)stats.jrequests); + printf("\t%ju job requests queue limit reached\n", + (uintmax_t)stats.jmaxlen); + printf("\t%ju job requests failed due to memory allocation problems\n", + (uintmax_t)stats.jnomem); + + printf("\t%ju hosts allocated\n", (uintmax_t)stats.hostcount); + printf("\t%ju hosts requested\n", (uintmax_t)stats.jhostsreq); + printf("\t%ju host requests failed\n", (uintmax_t)stats.jhostfails); + + printf("\t%ju portgroups requested\n", (uintmax_t)stats.jportreq); + printf("\t%ju portgroups allocated\n", (uintmax_t)stats.spgcreated); + printf("\t%ju portgroups deleted\n", (uintmax_t)stats.spgdeleted); + printf("\t%ju portgroup requests failed\n", + (uintmax_t)stats.jportfails); + printf("\t%ju portgroups allocated for TCP\n", + (uintmax_t)stats.tcpchunks); + printf("\t%ju portgroups allocated for UDP\n", + (uintmax_t)stats.udpchunks); + printf("\t%ju portgroups allocated for ICMP\n", + (uintmax_t)stats.icmpchunks); + + printf("\t%ju states created\n", (uintmax_t)stats.screated); + printf("\t%ju states deleted\n", (uintmax_t)stats.sdeleted); } static int Modified: head/sbin/ipfw/nat64stl.c ============================================================================== --- head/sbin/ipfw/nat64stl.c Sun Aug 14 09:26:10 2016 (r304075) +++ head/sbin/ipfw/nat64stl.c Sun Aug 14 13:17:55 2016 (r304076) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -386,7 +387,6 @@ nat64stl_get_stats(const char *name, uin return (-1); } -#define _P_STAT(_s, _f) printf("%8s:\t%lu\n", #_f, _s._f) static void nat64stl_stats(const char *name, uint8_t set) { @@ -395,16 +395,30 @@ nat64stl_stats(const char *name, uint8_t if (nat64stl_get_stats(name, set, &stats) != 0) err(EX_OSERR, "Error retrieving stats"); - _P_STAT(stats, opcnt64); - _P_STAT(stats, opcnt46); - _P_STAT(stats, ofrags); - _P_STAT(stats, ifrags); - _P_STAT(stats, oerrors); - _P_STAT(stats, noroute4); - _P_STAT(stats, noroute6); - _P_STAT(stats, noproto); - _P_STAT(stats, nomem); - _P_STAT(stats, dropped); + if (co.use_set != 0 || set != 0) + printf("set %u ", set); + printf("nat64stl %s\n", name); + + printf("\t%ju packets translated from IPv6 to IPv4\n", + (uintmax_t)stats.opcnt64); + printf("\t%ju packets translated from IPv4 to IPv6\n", + (uintmax_t)stats.opcnt46); + printf("\t%ju IPv6 fragments created\n", + (uintmax_t)stats.ofrags); + printf("\t%ju IPv4 fragments received\n", + (uintmax_t)stats.ifrags); + printf("\t%ju output packets dropped due to no bufs, etc.\n", + (uintmax_t)stats.oerrors); + printf("\t%ju output packets discarded due to no IPv4 route\n", + (uintmax_t)stats.noroute4); + printf("\t%ju output packets discarded due to no IPv6 route\n", + (uintmax_t)stats.noroute6); + printf("\t%ju packets discarded due to unsupported protocol\n", + (uintmax_t)stats.noproto); + printf("\t%ju packets discarded due to memory allocation problems\n", + (uintmax_t)stats.nomem); + printf("\t%ju packets discarded due to some errors\n", + (uintmax_t)stats.dropped); } /* Modified: head/sbin/ipfw/nptv6.c ============================================================================== --- head/sbin/ipfw/nptv6.c Sun Aug 14 09:26:10 2016 (r304075) +++ head/sbin/ipfw/nptv6.c Sun Aug 14 13:17:55 2016 (r304076) @@ -309,11 +309,14 @@ nptv6_stats(const char *name, uint8_t se if (nptv6_get_stats(name, set, &stats) != 0) err(EX_OSERR, "Error retrieving stats"); - printf("Number of packets translated (internal to external): %ju\n", + if (co.use_set != 0 || set != 0) + printf("set %u ", set); + printf("nptv6 %s\n", name); + printf("\t%ju packets translated (internal to external)\n", (uintmax_t)stats.in2ex); - printf("Number of packets translated (external to internal): %ju\n", + printf("\t%ju packets translated (external to internal)\n", (uintmax_t)stats.ex2in); - printf("Number of packets dropped due to some error: %ju\n", + printf("\t%ju packets dropped due to some error\n", (uintmax_t)stats.dropped); } From owner-svn-src-all@freebsd.org Sun Aug 14 13:18:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AFF7BB9A0A; Sun, 14 Aug 2016 13:18:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9AA21A36; Sun, 14 Aug 2016 13:18:00 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EDI0XW016450; Sun, 14 Aug 2016 13:18:00 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EDI0lS016446; Sun, 14 Aug 2016 13:18:00 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608141318.u7EDI0lS016446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 14 Aug 2016 13:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304077 - head/sys/arm/allwinner 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 13:18:01 -0000 Author: manu Date: Sun Aug 14 13:17:59 2016 New Revision: 304077 URL: https://svnweb.freebsd.org/changeset/base/304077 Log: Correct the size of the softc in a10_ehci Reported by: andrew MFC after: 1 week Modified: head/sys/arm/allwinner/a10_ehci.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Sun Aug 14 13:17:55 2016 (r304076) +++ head/sys/arm/allwinner/a10_ehci.c Sun Aug 14 13:17:59 2016 (r304077) @@ -358,7 +358,7 @@ static device_method_t ehci_methods[] = static driver_t ehci_driver = { .name = "ehci", .methods = ehci_methods, - .size = sizeof(ehci_softc_t), + .size = sizeof(struct aw_ehci_softc), }; static devclass_t ehci_devclass; From owner-svn-src-all@freebsd.org Sun Aug 14 13:23:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61A65BB9C6D; Sun, 14 Aug 2016 13:23:03 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DD52118D; Sun, 14 Aug 2016 13:23:03 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EDN2V1020105; Sun, 14 Aug 2016 13:23:02 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EDN2DI020104; Sun, 14 Aug 2016 13:23:02 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608141323.u7EDN2DI020104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 14 Aug 2016 13:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304078 - head/sys/ddb 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 13:23:03 -0000 Author: bde Date: Sun Aug 14 13:23:02 2016 New Revision: 304078 URL: https://svnweb.freebsd.org/changeset/base/304078 Log: Don't print an extra newline after the instruction when printing for single stepping of multiple instructions (e.g., s/p, and n/p). db_print_loc_and_inst() already prints a newline on all arches although it probably shouldn't. Especially on SMP systems, single stepping tends to deadlock or panic too quickly to be useful for anything except finding bugs in itself, but with printing "itself" includes console drivers so it is useful for generating stress tests for console drivers. Modified: head/sys/ddb/db_run.c Modified: head/sys/ddb/db_run.c ============================================================================== --- head/sys/ddb/db_run.c Sun Aug 14 13:17:59 2016 (r304077) +++ head/sys/ddb/db_run.c Sun Aug 14 13:23:02 2016 (r304078) @@ -145,7 +145,6 @@ db_stop_at_pc(bool *is_breakpoint) if (db_sstep_print) { db_printf("\t\t"); db_print_loc_and_inst(pc); - db_printf("\n"); } return (false); /* continue */ } @@ -165,7 +164,6 @@ db_stop_at_pc(bool *is_breakpoint) for (i = db_call_depth; --i > 0; ) db_printf(" "); db_print_loc_and_inst(pc); - db_printf("\n"); } } if (inst_call(ins)) From owner-svn-src-all@freebsd.org Sun Aug 14 14:50:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49B73BBA5F1; Sun, 14 Aug 2016 14:50:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 07B68178F; Sun, 14 Aug 2016 14:50:33 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EEoXqj049952; Sun, 14 Aug 2016 14:50:33 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EEoWJh049948; Sun, 14 Aug 2016 14:50:32 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608141450.u7EEoWJh049948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 14 Aug 2016 14:50:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304079 - in stable/11: sbin/ipfw sys/netinet sys/netpfil/ipfw X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 14:50:34 -0000 Author: ae Date: Sun Aug 14 14:50:32 2016 New Revision: 304079 URL: https://svnweb.freebsd.org/changeset/base/304079 Log: MFC r303955: Restore "nat global" support. Now zero value of arg1 used to specify "tablearg", use the old "tablearg" value for "nat global". Introduce new macro IP_FW_NAT44_GLOBAL to replace hardcoded magic number to specify "nat global". Also replace 65535 magic number with corresponding macro. Fix typo in comments. PR: 211256 Modified: stable/11/sbin/ipfw/ipfw2.c stable/11/sys/netinet/ip_fw.h stable/11/sys/netpfil/ipfw/ip_fw2.c stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw2.c ============================================================================== --- stable/11/sbin/ipfw/ipfw2.c Sun Aug 14 13:23:02 2016 (r304078) +++ stable/11/sbin/ipfw/ipfw2.c Sun Aug 14 14:50:32 2016 (r304079) @@ -1575,7 +1575,7 @@ show_static_rule(struct cmdline_opts *co break; case O_NAT: - if (cmd->arg1 != 0) + if (cmd->arg1 != IP_FW_NAT44_GLOBAL) bprint_uint_arg(bp, "nat ", cmd->arg1); else bprintf(bp, "nat global"); @@ -3733,7 +3733,7 @@ compile_rule(char *av[], uint32_t *rbuf, action->len = F_INSN_SIZE(ipfw_insn_nat); CHECK_ACTLEN; if (*av != NULL && _substrcmp(*av, "global") == 0) { - action->arg1 = 0; + action->arg1 = IP_FW_NAT44_GLOBAL; av++; break; } else Modified: stable/11/sys/netinet/ip_fw.h ============================================================================== --- stable/11/sys/netinet/ip_fw.h Sun Aug 14 13:23:02 2016 (r304078) +++ stable/11/sys/netinet/ip_fw.h Sun Aug 14 14:50:32 2016 (r304079) @@ -60,6 +60,7 @@ #define IPFW_ARG_MAX 65534 #define IP_FW_TABLEARG 65535 /* Compat value for old clients */ #define IP_FW_TARG 0 /* Current tablearg value */ +#define IP_FW_NAT44_GLOBAL 65535 /* arg1 value for "nat global" */ /* * Number of entries in the call stack of the call/return commands. Modified: stable/11/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw2.c Sun Aug 14 13:23:02 2016 (r304078) +++ stable/11/sys/netpfil/ipfw/ip_fw2.c Sun Aug 14 14:50:32 2016 (r304079) @@ -2489,7 +2489,7 @@ do { \ set_match(args, f_pos, chain); /* Check if this is 'global' nat rule */ - if (cmd->arg1 == 0) { + if (cmd->arg1 == IP_FW_NAT44_GLOBAL) { retval = ipfw_nat_ptr(args, NULL, m); break; } Modified: stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Sun Aug 14 13:23:02 2016 (r304078) +++ stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Sun Aug 14 14:50:32 2016 (r304079) @@ -524,9 +524,11 @@ import_rule0(struct rule_check_info *ci) /* * Alter opcodes: - * 1) convert tablearg value from 65335 to 0 - * 2) Add high bit to O_SETFIB/O_SETDSCP values (to make room for targ). + * 1) convert tablearg value from 65535 to 0 + * 2) Add high bit to O_SETFIB/O_SETDSCP values (to make room + * for targ). * 3) convert table number in iface opcodes to u16 + * 4) convert old `nat global` into new 65535 */ l = krule->cmd_len; cmd = krule->cmd; @@ -548,19 +550,21 @@ import_rule0(struct rule_check_info *ci) case O_NETGRAPH: case O_NGTEE: case O_NAT: - if (cmd->arg1 == 65535) + if (cmd->arg1 == IP_FW_TABLEARG) cmd->arg1 = IP_FW_TARG; + else if (cmd->arg1 == 0) + cmd->arg1 = IP_FW_NAT44_GLOBAL; break; case O_SETFIB: case O_SETDSCP: - if (cmd->arg1 == 65535) + if (cmd->arg1 == IP_FW_TABLEARG) cmd->arg1 = IP_FW_TARG; else cmd->arg1 |= 0x8000; break; case O_LIMIT: lcmd = (ipfw_insn_limit *)cmd; - if (lcmd->conn_limit == 65535) + if (lcmd->conn_limit == IP_FW_TABLEARG) lcmd->conn_limit = IP_FW_TARG; break; /* Interface tables */ @@ -606,7 +610,7 @@ export_rule0(struct ip_fw *krule, struct /* * Alter opcodes: - * 1) convert tablearg value from 0 to 65335 + * 1) convert tablearg value from 0 to 65535 * 2) Remove highest bit from O_SETFIB/O_SETDSCP values. * 3) convert table number in iface opcodes to int */ @@ -631,19 +635,21 @@ export_rule0(struct ip_fw *krule, struct case O_NGTEE: case O_NAT: if (cmd->arg1 == IP_FW_TARG) - cmd->arg1 = 65535; + cmd->arg1 = IP_FW_TABLEARG; + else if (cmd->arg1 == IP_FW_NAT44_GLOBAL) + cmd->arg1 = 0; break; case O_SETFIB: case O_SETDSCP: if (cmd->arg1 == IP_FW_TARG) - cmd->arg1 = 65535; + cmd->arg1 = IP_FW_TABLEARG; else cmd->arg1 &= ~0x8000; break; case O_LIMIT: lcmd = (ipfw_insn_limit *)cmd; if (lcmd->conn_limit == IP_FW_TARG) - lcmd->conn_limit = 65535; + lcmd->conn_limit = IP_FW_TABLEARG; break; /* Interface tables */ case O_XMIT: From owner-svn-src-all@freebsd.org Sun Aug 14 15:26:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6FF7BBAB9D; Sun, 14 Aug 2016 15:26:41 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 650C317FC; Sun, 14 Aug 2016 15:26:41 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EFQegI064978; Sun, 14 Aug 2016 15:26:40 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EFQeUe064977; Sun, 14 Aug 2016 15:26:40 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608141526.u7EFQeUe064977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 14 Aug 2016 15:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304080 - head/sys/ddb 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 15:26:41 -0000 Author: bde Date: Sun Aug 14 15:26:40 2016 New Revision: 304080 URL: https://svnweb.freebsd.org/changeset/base/304080 Log: In ddb ps, left justify the non-numeric fields 'state' and 'wmesg' and the fixed-width numeric field 'wchan', as in ps(1). They were sort of centered, although the template shows 'state' as right-justified. The `wmesg' field very rarely has a prefix of '*' (for lock names) that is still to the left of the header, and the width of this field is reduced from 8 to 7 (more than 6 is an error). The 'wmesg' and 'wchan' fields are still misnamed and poorly handled. They are named sort of backwards relative to ps(1): - wmesg in ddb = mwchan in ps - wmesg in ddb = wchan in ps (if it is a wait channel name, not a lock name) - wchan in ddb = nwchan in ps ddb ps wastes lots of space for the unimportant 'wchan' field (20 columns altogether on 64-bit arches). ps(1) documents using a compressed format, but the compression only omits leading nybbles of 0 so it has neveqr worked on arches that put the kernel in the top half of the address space. It just avoids wasting space for an 0x prefix. Modified: head/sys/ddb/db_ps.c Modified: head/sys/ddb/db_ps.c ============================================================================== --- head/sys/ddb/db_ps.c Sun Aug 14 14:50:32 2016 (r304079) +++ head/sys/ddb/db_ps.c Sun Aug 14 15:26:40 2016 (r304080) @@ -69,10 +69,10 @@ DB_SHOW_ALL_COMMAND(procs, db_procs_cmd) * * 1 2 3 4 5 6 7 * 1234567890123456789012345678901234567890123456789012345678901234567890 - * pid ppid pgrp uid state wmesg wchan cmd - * < wmesg > < wchan > + * pid ppid pgrp uid state wmesg wchan cmd + * * (threaded) - * < wmesg > < wchan > + * * * For machines with 64-bit pointers, we expand the wchan field 8 more * characters. @@ -95,9 +95,9 @@ db_ps(db_expr_t addr, bool hasaddr, db_e p = &proc0; #ifdef __LP64__ - db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); + db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); #else - db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); + db_printf(" pid ppid pgrp uid state wmesg wchan cmd\n"); #endif while (--np >= 0 && !db_pager_quit) { if (p == NULL) { @@ -279,15 +279,15 @@ dumpthread(volatile struct proc *p, vola wmesg = ""; wchan = NULL; } - db_printf("%c%-8.8s ", wprefix, wmesg); + db_printf("%c%-7.7s ", wprefix, wmesg); if (wchan == NULL) #ifdef __LP64__ - db_printf("%18s ", ""); + db_printf("%18s ", ""); #else - db_printf("%10s ", ""); + db_printf("%10s ", ""); #endif else - db_printf("%p ", wchan); + db_printf("%p ", wchan); if (p->p_flag & P_SYSTEM) db_printf("["); if (td->td_name[0] != '\0') From owner-svn-src-all@freebsd.org Sun Aug 14 15:28:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBEC3BBABF1; Sun, 14 Aug 2016 15:28:00 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D6901980; Sun, 14 Aug 2016 15:28:00 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EFRxQf065066; Sun, 14 Aug 2016 15:27:59 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EFRx6t065063; Sun, 14 Aug 2016 15:27:59 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201608141527.u7EFRx6t065063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Sun, 14 Aug 2016 15:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304081 - stable/10/sys/dev/virtio/network X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 15:28:00 -0000 Author: smh Date: Sun Aug 14 15:27:59 2016 New Revision: 304081 URL: https://svnweb.freebsd.org/changeset/base/304081 Log: MFC r303971: Fix vtnet hang with max_virtqueue_pairs > VTNET_MAX_QUEUE_PAIRS Sponsored by: Multiplay Modified: stable/10/sys/dev/virtio/network/if_vtnet.c stable/10/sys/dev/virtio/network/if_vtnetvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- stable/10/sys/dev/virtio/network/if_vtnet.c Sun Aug 14 15:26:40 2016 (r304080) +++ stable/10/sys/dev/virtio/network/if_vtnet.c Sun Aug 14 15:27:59 2016 (r304081) @@ -230,18 +230,32 @@ static void vtnet_disable_interrupts(str static int vtnet_tunable_int(struct vtnet_softc *, const char *, int); /* Tunables. */ +static SYSCTL_NODE(_hw, OID_AUTO, vtnet, CTLFLAG_RD, 0, "VNET driver parameters"); static int vtnet_csum_disable = 0; TUNABLE_INT("hw.vtnet.csum_disable", &vtnet_csum_disable); +SYSCTL_INT(_hw_vtnet, OID_AUTO, csum_disable, CTLFLAG_RDTUN, + &vtnet_csum_disable, 0, "Disables receive and send checksum offload"); static int vtnet_tso_disable = 0; TUNABLE_INT("hw.vtnet.tso_disable", &vtnet_tso_disable); +SYSCTL_INT(_hw_vtnet, OID_AUTO, tso_disable, CTLFLAG_RDTUN, &vtnet_tso_disable, + 0, "Disables TCP Segmentation Offload"); static int vtnet_lro_disable = 0; TUNABLE_INT("hw.vtnet.lro_disable", &vtnet_lro_disable); +SYSCTL_INT(_hw_vtnet, OID_AUTO, lro_disable, CTLFLAG_RDTUN, &vtnet_lro_disable, + 0, "Disables TCP Large Receive Offload"); static int vtnet_mq_disable = 0; TUNABLE_INT("hw.vtnet.mq_disable", &vtnet_mq_disable); -static int vtnet_mq_max_pairs = 0; +SYSCTL_INT(_hw_vtnet, OID_AUTO, mq_disable, CTLFLAG_RDTUN, &vtnet_mq_disable, + 0, "Disables Multi Queue support"); +static int vtnet_mq_max_pairs = VTNET_MAX_QUEUE_PAIRS; TUNABLE_INT("hw.vtnet.mq_max_pairs", &vtnet_mq_max_pairs); +SYSCTL_INT(_hw_vtnet, OID_AUTO, mq_max_pairs, CTLFLAG_RDTUN, + &vtnet_mq_max_pairs, 0, "Sets the maximum number of Multi Queue pairs"); static int vtnet_rx_process_limit = 512; TUNABLE_INT("hw.vtnet.rx_process_limit", &vtnet_rx_process_limit); +SYSCTL_INT(_hw_vtnet, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, + &vtnet_rx_process_limit, 0, + "Limits the number RX segments processed in a single pass"); static uma_zone_t vtnet_tx_header_zone; @@ -591,7 +605,6 @@ static void vtnet_setup_features(struct vtnet_softc *sc) { device_t dev; - int max_pairs, max; dev = sc->vtnet_dev; @@ -640,32 +653,31 @@ vtnet_setup_features(struct vtnet_softc if (virtio_with_feature(dev, VIRTIO_NET_F_MQ) && sc->vtnet_flags & VTNET_FLAG_CTRL_VQ) { - max_pairs = virtio_read_dev_config_2(dev, + sc->vtnet_max_vq_pairs = virtio_read_dev_config_2(dev, offsetof(struct virtio_net_config, max_virtqueue_pairs)); - if (max_pairs < VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN || - max_pairs > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX) - max_pairs = 1; } else - max_pairs = 1; + sc->vtnet_max_vq_pairs = 1; - if (max_pairs > 1) { + if (sc->vtnet_max_vq_pairs > 1) { /* - * Limit the maximum number of queue pairs to the number of - * CPUs or the configured maximum. The actual number of - * queues that get used may be less. + * Limit the maximum number of queue pairs to the lower of + * the number of CPUs and the configured maximum. + * The actual number of queues that get used may be less. */ + int max; + max = vtnet_tunable_int(sc, "mq_max_pairs", vtnet_mq_max_pairs); - if (max > 0 && max_pairs > max) - max_pairs = max; - if (max_pairs > mp_ncpus) - max_pairs = mp_ncpus; - if (max_pairs > VTNET_MAX_QUEUE_PAIRS) - max_pairs = VTNET_MAX_QUEUE_PAIRS; - if (max_pairs > 1) - sc->vtnet_flags |= VTNET_FLAG_MULTIQ; + if (max > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN) { + if (max > mp_ncpus) + max = mp_ncpus; + if (max > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX) + max = VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX; + if (max > 1) { + sc->vtnet_requested_vq_pairs = max; + sc->vtnet_flags |= VTNET_FLAG_MULTIQ; + } + } } - - sc->vtnet_max_vq_pairs = max_pairs; } static int @@ -2991,13 +3003,11 @@ vtnet_set_active_vq_pairs(struct vtnet_s dev = sc->vtnet_dev; if ((sc->vtnet_flags & VTNET_FLAG_MULTIQ) == 0) { - MPASS(sc->vtnet_max_vq_pairs == 1); sc->vtnet_act_vq_pairs = 1; return; } - /* BMV: Just use the maximum configured for now. */ - npairs = sc->vtnet_max_vq_pairs; + npairs = sc->vtnet_requested_vq_pairs; if (vtnet_ctrl_mq_cmd(sc, npairs) != 0) { device_printf(dev, @@ -3853,6 +3863,9 @@ vtnet_setup_sysctl(struct vtnet_softc *s SYSCTL_ADD_INT(ctx, child, OID_AUTO, "max_vq_pairs", CTLFLAG_RD, &sc->vtnet_max_vq_pairs, 0, "Maximum number of supported virtqueue pairs"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "requested_vq_pairs", + CTLFLAG_RD, &sc->vtnet_requested_vq_pairs, 0, + "Requested number of virtqueue pairs"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "act_vq_pairs", CTLFLAG_RD, &sc->vtnet_act_vq_pairs, 0, "Number of active virtqueue pairs"); Modified: stable/10/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- stable/10/sys/dev/virtio/network/if_vtnetvar.h Sun Aug 14 15:26:40 2016 (r304080) +++ stable/10/sys/dev/virtio/network/if_vtnetvar.h Sun Aug 14 15:27:59 2016 (r304081) @@ -155,6 +155,7 @@ struct vtnet_softc { int vtnet_if_flags; int vtnet_act_vq_pairs; int vtnet_max_vq_pairs; + int vtnet_requested_vq_pairs; struct virtqueue *vtnet_ctrl_vq; struct vtnet_mac_filter *vtnet_mac_filter; From owner-svn-src-all@freebsd.org Sun Aug 14 15:50:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13997BB915C; Sun, 14 Aug 2016 15:50:40 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE9F4150E; Sun, 14 Aug 2016 15:50:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EFode4072536; Sun, 14 Aug 2016 15:50:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EFoc5j072535; Sun, 14 Aug 2016 15:50:38 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608141550.u7EFoc5j072535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 14 Aug 2016 15:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304082 - stable/11/sys/netinet X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 15:50:40 -0000 Author: tuexen Date: Sun Aug 14 15:50:38 2016 New Revision: 304082 URL: https://svnweb.freebsd.org/changeset/base/304082 Log: MFC r303927: Improve a consistency check to not detect valid cases for unordered user messages using DATA chunks as invalid ones. While there, ensure that error causes are provided when sending ABORT chunks in case of reassembly problems detected. Thanks to Taylor Brandstetter for making me aware of this problem. Modified: stable/11/sys/netinet/sctp_indata.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctp_indata.c ============================================================================== --- stable/11/sys/netinet/sctp_indata.c Sun Aug 14 15:27:59 2016 (r304081) +++ stable/11/sys/netinet/sctp_indata.c Sun Aug 14 15:50:38 2016 (r304082) @@ -1747,21 +1747,27 @@ sctp_process_a_data_chunk(struct sctp_tc * If its a fragmented message, lets see if we can find the control * on the reassembly queues. */ - if ((chtype == SCTP_IDATA) && ((chunk_flags & SCTP_DATA_FIRST_FRAG) == 0) && (fsn == 0)) { + if ((chtype == SCTP_IDATA) && + ((chunk_flags & SCTP_DATA_FIRST_FRAG) == 0) && + (fsn == 0)) { /* * The first *must* be fsn 0, and other (middle/end) pieces - * can *not* be fsn 0. + * can *not* be fsn 0. XXX: This can happen in case of a + * wrap around. Ignore is for now. */ + snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", + msg_id, chunk_flags); goto err_out; } + control = sctp_find_reasm_entry(strm, msg_id, ordered, old_data); + SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x look for control on queues %p\n", + chunk_flags, control); if ((chunk_flags & SCTP_DATA_NOT_FRAG) != SCTP_DATA_NOT_FRAG) { /* See if we can find the re-assembly entity */ - control = sctp_find_reasm_entry(strm, msg_id, ordered, old_data); - SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x look for control on queues %p\n", - chunk_flags, control); - if (control) { + if (control != NULL) { /* We found something, does it belong? */ if (ordered && (msg_id != control->sinfo_ssn)) { + snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", msg_id); err_out: op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_15; @@ -1774,6 +1780,8 @@ sctp_process_a_data_chunk(struct sctp_tc * We can't have a switched order with an * unordered chunk */ + snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + tsn); goto err_out; } if (!ordered && (((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) == 0)) { @@ -1781,6 +1789,8 @@ sctp_process_a_data_chunk(struct sctp_tc * We can't have a switched unordered with a * ordered chunk */ + snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + tsn); goto err_out; } } @@ -1790,14 +1800,21 @@ sctp_process_a_data_chunk(struct sctp_tc * re-assembly going on with the same Stream/Seq (for * ordered) or in the same Stream for unordered. */ - SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x look for msg in case we have dup\n", - chunk_flags); - if (sctp_find_reasm_entry(strm, msg_id, ordered, old_data)) { - SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on msg_id: %u\n", - chunk_flags, - msg_id); - - goto err_out; + if (control != NULL) { + if (ordered || (old_data == 0)) { + SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on msg_id: %u\n", + chunk_flags, msg_id); + snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", msg_id); + goto err_out; + } else { + if ((tsn == control->fsn_included + 1) && + (control->end_added == 0)) { + snprintf(msg, sizeof(msg), "Illegal message sequence, missing end for MID: %8.8x", control->fsn_included); + goto err_out; + } else { + control = NULL; + } + } } } /* now do the tests */ From owner-svn-src-all@freebsd.org Sun Aug 14 15:52:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33D2BBB9365; Sun, 14 Aug 2016 15:52:01 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0540918D6; Sun, 14 Aug 2016 15:52:00 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EFq06M073970; Sun, 14 Aug 2016 15:52:00 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EFq0tu073969; Sun, 14 Aug 2016 15:52:00 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608141552.u7EFq0tu073969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 14 Aug 2016 15:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304083 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 15:52:01 -0000 Author: bde Date: Sun Aug 14 15:52:00 2016 New Revision: 304083 URL: https://svnweb.freebsd.org/changeset/base/304083 Log: Print the tid of curthread in "show pcpu" in ddb. It was remarkably hard to trace all current threads. "show pcpu" only showed the pid, and there was nothing (?) better than searching ps output to find the tids on CPUs. This change simplifies the search, but you still have to trace the tid for each CPU manually. Modified: head/sys/kern/subr_pcpu.c Modified: head/sys/kern/subr_pcpu.c ============================================================================== --- head/sys/kern/subr_pcpu.c Sun Aug 14 15:50:38 2016 (r304082) +++ head/sys/kern/subr_pcpu.c Sun Aug 14 15:52:00 2016 (r304083) @@ -354,8 +354,8 @@ show_pcpu(struct pcpu *pc) db_printf("curthread = "); td = pc->pc_curthread; if (td != NULL) - db_printf("%p: pid %d \"%s\"\n", td, td->td_proc->p_pid, - td->td_name); + db_printf("%p: pid %d tid %d \"%s\"\n", td, td->td_proc->p_pid, + td->td_tid, td->td_name); else db_printf("none\n"); db_printf("curpcb = %p\n", pc->pc_curpcb); From owner-svn-src-all@freebsd.org Sun Aug 14 16:32:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22603BB9CDD; Sun, 14 Aug 2016 16:32:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D045B1D08; Sun, 14 Aug 2016 16:32:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EGWOpv091261; Sun, 14 Aug 2016 16:32:24 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EGWNEv091251; Sun, 14 Aug 2016 16:32:23 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608141632.u7EGWNEv091251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 14 Aug 2016 16:32:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304084 - in releng/11.0: sbin/ipfw sys/netinet sys/netpfil/ipfw X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 16:32:25 -0000 Author: ae Date: Sun Aug 14 16:32:23 2016 New Revision: 304084 URL: https://svnweb.freebsd.org/changeset/base/304084 Log: Merge from stable/11 r304079: Restore "nat global" support. Now zero value of arg1 used to specify "tablearg", use the old "tablearg" value for "nat global". Introduce new macro IP_FW_NAT44_GLOBAL to replace hardcoded magic number to specify "nat global". Also replace 65535 magic number with corresponding macro. Fix typo in comments. PR: 211256 Approved by: re (kib) Modified: releng/11.0/sbin/ipfw/ipfw2.c releng/11.0/sys/netinet/ip_fw.h releng/11.0/sys/netpfil/ipfw/ip_fw2.c releng/11.0/sys/netpfil/ipfw/ip_fw_sockopt.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/sbin/ipfw/ipfw2.c ============================================================================== --- releng/11.0/sbin/ipfw/ipfw2.c Sun Aug 14 15:52:00 2016 (r304083) +++ releng/11.0/sbin/ipfw/ipfw2.c Sun Aug 14 16:32:23 2016 (r304084) @@ -1575,7 +1575,7 @@ show_static_rule(struct cmdline_opts *co break; case O_NAT: - if (cmd->arg1 != 0) + if (cmd->arg1 != IP_FW_NAT44_GLOBAL) bprint_uint_arg(bp, "nat ", cmd->arg1); else bprintf(bp, "nat global"); @@ -3733,7 +3733,7 @@ compile_rule(char *av[], uint32_t *rbuf, action->len = F_INSN_SIZE(ipfw_insn_nat); CHECK_ACTLEN; if (*av != NULL && _substrcmp(*av, "global") == 0) { - action->arg1 = 0; + action->arg1 = IP_FW_NAT44_GLOBAL; av++; break; } else Modified: releng/11.0/sys/netinet/ip_fw.h ============================================================================== --- releng/11.0/sys/netinet/ip_fw.h Sun Aug 14 15:52:00 2016 (r304083) +++ releng/11.0/sys/netinet/ip_fw.h Sun Aug 14 16:32:23 2016 (r304084) @@ -60,6 +60,7 @@ #define IPFW_ARG_MAX 65534 #define IP_FW_TABLEARG 65535 /* Compat value for old clients */ #define IP_FW_TARG 0 /* Current tablearg value */ +#define IP_FW_NAT44_GLOBAL 65535 /* arg1 value for "nat global" */ /* * Number of entries in the call stack of the call/return commands. Modified: releng/11.0/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- releng/11.0/sys/netpfil/ipfw/ip_fw2.c Sun Aug 14 15:52:00 2016 (r304083) +++ releng/11.0/sys/netpfil/ipfw/ip_fw2.c Sun Aug 14 16:32:23 2016 (r304084) @@ -2489,7 +2489,7 @@ do { \ set_match(args, f_pos, chain); /* Check if this is 'global' nat rule */ - if (cmd->arg1 == 0) { + if (cmd->arg1 == IP_FW_NAT44_GLOBAL) { retval = ipfw_nat_ptr(args, NULL, m); break; } Modified: releng/11.0/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- releng/11.0/sys/netpfil/ipfw/ip_fw_sockopt.c Sun Aug 14 15:52:00 2016 (r304083) +++ releng/11.0/sys/netpfil/ipfw/ip_fw_sockopt.c Sun Aug 14 16:32:23 2016 (r304084) @@ -524,9 +524,11 @@ import_rule0(struct rule_check_info *ci) /* * Alter opcodes: - * 1) convert tablearg value from 65335 to 0 - * 2) Add high bit to O_SETFIB/O_SETDSCP values (to make room for targ). + * 1) convert tablearg value from 65535 to 0 + * 2) Add high bit to O_SETFIB/O_SETDSCP values (to make room + * for targ). * 3) convert table number in iface opcodes to u16 + * 4) convert old `nat global` into new 65535 */ l = krule->cmd_len; cmd = krule->cmd; @@ -548,19 +550,21 @@ import_rule0(struct rule_check_info *ci) case O_NETGRAPH: case O_NGTEE: case O_NAT: - if (cmd->arg1 == 65535) + if (cmd->arg1 == IP_FW_TABLEARG) cmd->arg1 = IP_FW_TARG; + else if (cmd->arg1 == 0) + cmd->arg1 = IP_FW_NAT44_GLOBAL; break; case O_SETFIB: case O_SETDSCP: - if (cmd->arg1 == 65535) + if (cmd->arg1 == IP_FW_TABLEARG) cmd->arg1 = IP_FW_TARG; else cmd->arg1 |= 0x8000; break; case O_LIMIT: lcmd = (ipfw_insn_limit *)cmd; - if (lcmd->conn_limit == 65535) + if (lcmd->conn_limit == IP_FW_TABLEARG) lcmd->conn_limit = IP_FW_TARG; break; /* Interface tables */ @@ -606,7 +610,7 @@ export_rule0(struct ip_fw *krule, struct /* * Alter opcodes: - * 1) convert tablearg value from 0 to 65335 + * 1) convert tablearg value from 0 to 65535 * 2) Remove highest bit from O_SETFIB/O_SETDSCP values. * 3) convert table number in iface opcodes to int */ @@ -631,19 +635,21 @@ export_rule0(struct ip_fw *krule, struct case O_NGTEE: case O_NAT: if (cmd->arg1 == IP_FW_TARG) - cmd->arg1 = 65535; + cmd->arg1 = IP_FW_TABLEARG; + else if (cmd->arg1 == IP_FW_NAT44_GLOBAL) + cmd->arg1 = 0; break; case O_SETFIB: case O_SETDSCP: if (cmd->arg1 == IP_FW_TARG) - cmd->arg1 = 65535; + cmd->arg1 = IP_FW_TABLEARG; else cmd->arg1 &= ~0x8000; break; case O_LIMIT: lcmd = (ipfw_insn_limit *)cmd; if (lcmd->conn_limit == IP_FW_TARG) - lcmd->conn_limit = 65535; + lcmd->conn_limit = IP_FW_TABLEARG; break; /* Interface tables */ case O_XMIT: From owner-svn-src-all@freebsd.org Sun Aug 14 16:51:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A1C1BBA02E; Sun, 14 Aug 2016 16:51:27 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9A341368; Sun, 14 Aug 2016 16:51:26 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EGpQEx095944; Sun, 14 Aug 2016 16:51:26 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EGpQRr095942; Sun, 14 Aug 2016 16:51:26 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608141651.u7EGpQRr095942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Sun, 14 Aug 2016 16:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304085 - in head/sys/i386: i386 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 16:51:27 -0000 Author: bde Date: Sun Aug 14 16:51:25 2016 New Revision: 304085 URL: https://svnweb.freebsd.org/changeset/base/304085 Log: Fix the variables $esp, $ds, $es, $fs, $gs and $ss in vm86 mode. Fix PC_REGS() so that printing of instructions works in some useful cases. ddb only understands a single flat address space, but this macro allows mapping $cs:$eip into vm86's flat address space well enough for the MI parts of ddb. This doesn't work for the MD parts that do stack traces, and there are no similar macros for data addresses. PC_REGS() has to use the trapframe pointer instead of the pcb for this. For other CPUs, the trapframe pointer is not available except by tracing back to it. But tracing back through vm86 trapframes is broken even starting with one. Modified: head/sys/i386/i386/db_trace.c head/sys/i386/include/db_machdep.h Modified: head/sys/i386/i386/db_trace.c ============================================================================== --- head/sys/i386/i386/db_trace.c Sun Aug 14 16:32:23 2016 (r304084) +++ head/sys/i386/i386/db_trace.c Sun Aug 14 16:51:25 2016 (r304085) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -81,8 +82,8 @@ struct db_variable *db_eregs = db_regs + static __inline int get_esp(struct trapframe *tf) { - return ((ISPL(tf->tf_cs)) ? tf->tf_esp : - (db_expr_t)tf + (uintptr_t)DB_OFFSET(tf_esp)); + return ((ISPL(tf->tf_cs) || kdb_frame->tf_eflags & PSL_VM) ? + tf->tf_esp : (intptr_t)&tf->tf_esp); } static int @@ -104,12 +105,32 @@ db_frame(struct db_variable *vp, db_expr static int db_frame_seg(struct db_variable *vp, db_expr_t *valuep, int op) { + struct trapframe_vm86 *tfp; + int off; uint16_t *reg; if (kdb_frame == NULL) return (0); - reg = (uint16_t *)((uintptr_t)kdb_frame + (db_expr_t)vp->valuep); + off = (intptr_t)vp->valuep; + if (kdb_frame->tf_eflags & PSL_VM) { + tfp = (void *)kdb_frame; + switch ((intptr_t)vp->valuep) { + case (intptr_t)DB_OFFSET(tf_cs): + reg = (uint16_t *)&tfp->tf_cs; + break; + case (intptr_t)DB_OFFSET(tf_ds): + reg = (uint16_t *)&tfp->tf_vm86_ds; + break; + case (intptr_t)DB_OFFSET(tf_es): + reg = (uint16_t *)&tfp->tf_vm86_es; + break; + case (intptr_t)DB_OFFSET(tf_fs): + reg = (uint16_t *)&tfp->tf_vm86_fs; + break; + } + } else + reg = (uint16_t *)((uintptr_t)kdb_frame + off); if (op == DB_VAR_GET) *valuep = *reg; else @@ -134,7 +155,16 @@ db_esp(struct db_variable *vp, db_expr_t static int db_gs(struct db_variable *vp, db_expr_t *valuep, int op) { + struct trapframe_vm86 *tfp; + if (kdb_frame != NULL && kdb_frame->tf_eflags & PSL_VM) { + tfp = (void *)kdb_frame; + if (op == DB_VAR_GET) + *valuep = tfp->tf_vm86_gs; + else + tfp->tf_vm86_gs = *valuep; + return (1); + } if (op == DB_VAR_GET) *valuep = rgs(); else @@ -150,8 +180,9 @@ db_ss(struct db_variable *vp, db_expr_t return (0); if (op == DB_VAR_GET) - *valuep = (ISPL(kdb_frame->tf_cs)) ? kdb_frame->tf_ss : rss(); - else if (ISPL(kdb_frame->tf_cs)) + *valuep = (ISPL(kdb_frame->tf_cs) || + kdb_frame->tf_eflags & PSL_VM) ? kdb_frame->tf_ss : rss(); + else if (ISPL(kdb_frame->tf_cs) || kdb_frame->tf_eflags & PSL_VM) kdb_frame->tf_ss = *valuep; return (1); } Modified: head/sys/i386/include/db_machdep.h ============================================================================== --- head/sys/i386/include/db_machdep.h Sun Aug 14 16:32:23 2016 (r304084) +++ head/sys/i386/include/db_machdep.h Sun Aug 14 16:51:25 2016 (r304085) @@ -35,7 +35,10 @@ typedef vm_offset_t db_addr_t; /* address - unsigned */ typedef int db_expr_t; /* expression - signed */ -#define PC_REGS() ((db_addr_t)kdb_thrctx->pcb_eip) +#define PC_REGS() ((db_addr_t)(kdb_frame->tf_eflags & PSL_VM ? \ + (kdb_frame->tf_eip & 0xffff) + \ + ((kdb_frame->tf_cs & 0xffff) << 4) : \ + kdb_frame->tf_eip)) #define BKPT_INST 0xcc /* breakpoint instruction */ #define BKPT_SIZE (1) /* size of breakpoint inst */ From owner-svn-src-all@freebsd.org Sun Aug 14 16:57:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 966BBBBA0F5; Sun, 14 Aug 2016 16:57:12 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57C3C174C; Sun, 14 Aug 2016 16:57:12 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EGvBnv098970; Sun, 14 Aug 2016 16:57:11 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EGvANS098968; Sun, 14 Aug 2016 16:57:10 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201608141657.u7EGvANS098968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Sun, 14 Aug 2016 16:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304086 - stable/11/sys/netinet X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 16:57:12 -0000 Author: karels Date: Sun Aug 14 16:57:10 2016 New Revision: 304086 URL: https://svnweb.freebsd.org/changeset/base/304086 Log: MFC r303978; Fix kernel build with TCP_RFC7413 option The current in_pcb.h includes route.h, which includes sockaddr structures. Including should require ; add it in the appropriate place. PR: 211385 Submitted by: Sergey Kandaurov and iron at mail.ua Reviewed by: gnn Approved by: gnn (mentor) Modified: stable/11/sys/netinet/tcp_fastopen.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_fastopen.c ============================================================================== --- stable/11/sys/netinet/tcp_fastopen.c Sun Aug 14 16:51:25 2016 (r304085) +++ stable/11/sys/netinet/tcp_fastopen.c Sun Aug 14 16:57:10 2016 (r304086) @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@freebsd.org Sun Aug 14 18:05:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E064CBBAF0E; Sun, 14 Aug 2016 18:05:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B09A81640; Sun, 14 Aug 2016 18:05:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EI5fVO024737; Sun, 14 Aug 2016 18:05:41 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EI5fmu024736; Sun, 14 Aug 2016 18:05:41 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608141805.u7EI5fmu024736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 14 Aug 2016 18:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304087 - head/sbin/ipfw 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 18:05:43 -0000 Author: ae Date: Sun Aug 14 18:05:41 2016 New Revision: 304087 URL: https://svnweb.freebsd.org/changeset/base/304087 Log: Do not warn about ambiguous state name when we inspect a comment token. Reported by: lev Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Sun Aug 14 16:57:10 2016 (r304086) +++ head/sbin/ipfw/ipfw2.c Sun Aug 14 18:05:41 2016 (r304087) @@ -3718,11 +3718,14 @@ compile_rule(char *av[], uint32_t *rbuf, } if (strcmp(*av, "any") == 0) action->arg1 = 0; - else if (match_token(rule_options, *av) != -1) { + else if ((i = match_token(rule_options, *av)) != -1) { action->arg1 = pack_object(tstate, default_state_name, IPFW_TLV_STATE_NAME); - warn("Ambiguous state name '%s', '%s' used instead.\n", - *av, default_state_name); + if (i != TOK_COMMENT) + warn("Ambiguous state name '%s', '%s'" + " used instead.\n", *av, + default_state_name); + break; } else if (state_check_name(*av) == 0) action->arg1 = pack_object(tstate, *av, IPFW_TLV_STATE_NAME); @@ -4563,8 +4566,8 @@ read_options: errx(EX_USAGE, "only one of keep-state " "and limit is allowed"); if (*av == NULL || - match_token(rule_options, *av) != -1) { - if (*av != NULL) + (i = match_token(rule_options, *av)) != -1) { + if (*av != NULL && i != TOK_COMMENT) warn("Ambiguous state name '%s'," " '%s' used instead.\n", *av, default_state_name); @@ -4615,8 +4618,8 @@ read_options: av++; if (*av == NULL || - match_token(rule_options, *av) != -1) { - if (*av != NULL) + (i = match_token(rule_options, *av)) != -1) { + if (*av != NULL && i != TOK_COMMENT) warn("Ambiguous state name '%s'," " '%s' used instead.\n", *av, default_state_name); From owner-svn-src-all@freebsd.org Sun Aug 14 18:30:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6564BB94BD; Sun, 14 Aug 2016 18:30:31 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B67FD1F85; Sun, 14 Aug 2016 18:30:31 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EIUUbk032201; Sun, 14 Aug 2016 18:30:30 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EIUU4r032200; Sun, 14 Aug 2016 18:30:30 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201608141830.u7EIUU4r032200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Sun, 14 Aug 2016 18:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304088 - releng/11.0/sys/netinet X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 18:30:32 -0000 Author: karels Date: Sun Aug 14 18:30:30 2016 New Revision: 304088 URL: https://svnweb.freebsd.org/changeset/base/304088 Log: MFC r303978: Fix kernel build with TCP_RFC7413 option The current in_pcb.h includes route.h, which includes sockaddr structures. Including should require ; add it in the appropriate place. PR: 211385 Submitted by: Sergey Kandaurov and iron at mail.ua Reviewed by: gnn Approved by: gnn (mentor) Approved by: re (gjb) Modified: releng/11.0/sys/netinet/tcp_fastopen.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/sys/netinet/tcp_fastopen.c ============================================================================== --- releng/11.0/sys/netinet/tcp_fastopen.c Sun Aug 14 18:05:41 2016 (r304087) +++ releng/11.0/sys/netinet/tcp_fastopen.c Sun Aug 14 18:30:30 2016 (r304088) @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include From owner-svn-src-all@freebsd.org Sun Aug 14 18:34:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60182BB95F3; Sun, 14 Aug 2016 18:34:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29DD91497; Sun, 14 Aug 2016 18:34:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EIYG79035899; Sun, 14 Aug 2016 18:34:16 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EIYGwf035898; Sun, 14 Aug 2016 18:34:16 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608141834.u7EIYGwf035898@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 14 Aug 2016 18:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304089 - head/sbin/ipfw 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 18:34:17 -0000 Author: ae Date: Sun Aug 14 18:34:16 2016 New Revision: 304089 URL: https://svnweb.freebsd.org/changeset/base/304089 Log: Add an ability to attach comment to check-state rules. MFC after: 1 week Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Sun Aug 14 18:30:30 2016 (r304088) +++ head/sbin/ipfw/ipfw2.c Sun Aug 14 18:34:16 2016 (r304089) @@ -4120,8 +4120,17 @@ chkarg: cmd = next_cmd(cmd, &cblen); } - if (have_state) /* must be a check-state, we are done */ + if (have_state) { /* must be a check-state, we are done */ + if (*av != NULL && + match_token(rule_options, *av) == TOK_COMMENT) { + /* check-state has a comment */ + av++; + fill_comment(cmd, av, cblen); + cmd = next_cmd(cmd, &cblen); + av[0] = NULL; + } goto done; + } #define OR_START(target) \ if (av[0] && (*av[0] == '(' || *av[0] == '{')) { \ From owner-svn-src-all@freebsd.org Sun Aug 14 18:59:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1075BB9CF4; Sun, 14 Aug 2016 18:59:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD0481208; Sun, 14 Aug 2016 18:59:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EIxM7I043988; Sun, 14 Aug 2016 18:59:22 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EIxMFu043987; Sun, 14 Aug 2016 18:59:22 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608141859.u7EIxMFu043987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 14 Aug 2016 18:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304090 - stable/10/sys/vm X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 18:59:23 -0000 Author: markj Date: Sun Aug 14 18:59:22 2016 New Revision: 304090 URL: https://svnweb.freebsd.org/changeset/base/304090 Log: MFC r303244, r303399 De-pluralize "queues" in the pagedaemon code. Modified: stable/10/sys/vm/vm_pageout.c Modified: stable/10/sys/vm/vm_pageout.c ============================================================================== --- stable/10/sys/vm/vm_pageout.c Sun Aug 14 18:34:16 2016 (r304089) +++ stable/10/sys/vm/vm_pageout.c Sun Aug 14 18:59:22 2016 (r304090) @@ -262,7 +262,7 @@ vm_pageout_init_marker(vm_page_t marker, * * Lock vm object currently associated with `m'. VM_OBJECT_TRYWLOCK is * known to have failed and page queue must be either PQ_ACTIVE or - * PQ_INACTIVE. To avoid lock order violation, unlock the page queues + * PQ_INACTIVE. To avoid lock order violation, unlock the page queue * while locking the vm object. Use marker page to detect page queue * changes and maintain notion of next page on page queue. Return * TRUE if no changes were detected, FALSE otherwise. vm object is @@ -950,7 +950,7 @@ vm_pageout_scan(struct vm_domain *vmd, i int vnodes_skipped = 0; int maxlaunder, scan_tick, scanned, starting_page_shortage; int lockmode; - boolean_t queues_locked; + boolean_t queue_locked; /* * If we need to reclaim memory ask kernel caches to return @@ -1015,12 +1015,12 @@ vm_pageout_scan(struct vm_domain *vmd, i pq = &vmd->vmd_pagequeues[PQ_INACTIVE]; maxscan = pq->pq_cnt; vm_pagequeue_lock(pq); - queues_locked = TRUE; + queue_locked = TRUE; for (m = TAILQ_FIRST(&pq->pq_pl); m != NULL && maxscan-- > 0 && page_shortage > 0; m = next) { vm_pagequeue_assert_locked(pq); - KASSERT(queues_locked, ("unlocked queues")); + KASSERT(queue_locked, ("unlocked inactive queue")); KASSERT(m->queue == PQ_INACTIVE, ("Inactive queue %p", m)); PCPU_INC(cnt.v_pdpages); @@ -1076,7 +1076,7 @@ vm_pageout_scan(struct vm_domain *vmd, i */ TAILQ_INSERT_AFTER(&pq->pq_pl, m, &vmd->vmd_marker, plinks.q); vm_pagequeue_unlock(pq); - queues_locked = FALSE; + queue_locked = FALSE; /* * We bump the activation count if the page has been @@ -1109,12 +1109,12 @@ vm_pageout_scan(struct vm_domain *vmd, i m->act_count += act_delta + ACT_ADVANCE; } else { vm_pagequeue_lock(pq); - queues_locked = TRUE; + queue_locked = TRUE; vm_page_requeue_locked(m); } VM_OBJECT_WUNLOCK(object); vm_page_unlock(m); - goto relock_queues; + goto relock_queue; } if (m->hold_count != 0) { @@ -1129,7 +1129,7 @@ vm_pageout_scan(struct vm_domain *vmd, i * loop over the active queue below. */ addl_page_shortage++; - goto relock_queues; + goto relock_queue; } /* @@ -1175,7 +1175,7 @@ vm_pageout_scan(struct vm_domain *vmd, i */ m->flags |= PG_WINATCFLS; vm_pagequeue_lock(pq); - queues_locked = TRUE; + queue_locked = TRUE; vm_page_requeue_locked(m); } else if (maxlaunder > 0) { /* @@ -1206,9 +1206,9 @@ vm_pageout_scan(struct vm_domain *vmd, i vm_pagequeue_lock(pq); vm_page_unlock(m); VM_OBJECT_WUNLOCK(object); - queues_locked = TRUE; + queue_locked = TRUE; vm_page_requeue_locked(m); - goto relock_queues; + goto relock_queue; } /* @@ -1263,7 +1263,7 @@ vm_pageout_scan(struct vm_domain *vmd, i VM_OBJECT_WLOCK(object); vm_page_lock(m); vm_pagequeue_lock(pq); - queues_locked = TRUE; + queue_locked = TRUE; /* * The page might have been moved to another * queue during potential blocking in vget() @@ -1303,7 +1303,7 @@ vm_pageout_scan(struct vm_domain *vmd, i goto unlock_and_continue; } vm_pagequeue_unlock(pq); - queues_locked = FALSE; + queue_locked = FALSE; } /* @@ -1324,9 +1324,9 @@ unlock_and_continue: vm_page_lock_assert(m, MA_NOTOWNED); VM_OBJECT_WUNLOCK(object); if (mp != NULL) { - if (queues_locked) { + if (queue_locked) { vm_pagequeue_unlock(pq); - queues_locked = FALSE; + queue_locked = FALSE; } if (vp != NULL) vput(vp); @@ -1334,14 +1334,14 @@ unlock_and_continue: vn_finished_write(mp); } vm_page_lock_assert(m, MA_NOTOWNED); - goto relock_queues; + goto relock_queue; } vm_page_unlock(m); VM_OBJECT_WUNLOCK(object); -relock_queues: - if (!queues_locked) { +relock_queue: + if (!queue_locked) { vm_pagequeue_lock(pq); - queues_locked = TRUE; + queue_locked = TRUE; } next = TAILQ_NEXT(&vmd->vmd_marker, plinks.q); TAILQ_REMOVE(&pq->pq_pl, &vmd->vmd_marker, plinks.q); From owner-svn-src-all@freebsd.org Sun Aug 14 18:59:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 095A6BB9D5A; Sun, 14 Aug 2016 18:59:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0A741369; Sun, 14 Aug 2016 18:59:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EIxv1P044054; Sun, 14 Aug 2016 18:59:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EIxvJu044053; Sun, 14 Aug 2016 18:59:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608141859.u7EIxvJu044053@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 14 Aug 2016 18:59:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304091 - stable/11/sys/vm X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 18:59:59 -0000 Author: markj Date: Sun Aug 14 18:59:57 2016 New Revision: 304091 URL: https://svnweb.freebsd.org/changeset/base/304091 Log: MFC r303244, r303399 De-pluralize "queues" in the pagedaemon code. Modified: stable/11/sys/vm/vm_pageout.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_pageout.c ============================================================================== --- stable/11/sys/vm/vm_pageout.c Sun Aug 14 18:59:22 2016 (r304090) +++ stable/11/sys/vm/vm_pageout.c Sun Aug 14 18:59:57 2016 (r304091) @@ -266,7 +266,7 @@ vm_pageout_init_marker(vm_page_t marker, * * Lock vm object currently associated with `m'. VM_OBJECT_TRYWLOCK is * known to have failed and page queue must be either PQ_ACTIVE or - * PQ_INACTIVE. To avoid lock order violation, unlock the page queues + * PQ_INACTIVE. To avoid lock order violation, unlock the page queue * while locking the vm object. Use marker page to detect page queue * changes and maintain notion of next page on page queue. Return * TRUE if no changes were detected, FALSE otherwise. vm object is @@ -884,7 +884,7 @@ vm_pageout_scan(struct vm_domain *vmd, i int act_delta, addl_page_shortage, deficit, error, maxlaunder, maxscan; int page_shortage, scan_tick, scanned, starting_page_shortage; int vnodes_skipped; - boolean_t pageout_ok, queues_locked; + boolean_t pageout_ok, queue_locked; /* * If we need to reclaim memory ask kernel caches to return @@ -949,12 +949,12 @@ vm_pageout_scan(struct vm_domain *vmd, i pq = &vmd->vmd_pagequeues[PQ_INACTIVE]; maxscan = pq->pq_cnt; vm_pagequeue_lock(pq); - queues_locked = TRUE; + queue_locked = TRUE; for (m = TAILQ_FIRST(&pq->pq_pl); m != NULL && maxscan-- > 0 && page_shortage > 0; m = next) { vm_pagequeue_assert_locked(pq); - KASSERT(queues_locked, ("unlocked queues")); + KASSERT(queue_locked, ("unlocked inactive queue")); KASSERT(m->queue == PQ_INACTIVE, ("Inactive queue %p", m)); PCPU_INC(cnt.v_pdpages); @@ -1024,7 +1024,7 @@ unlock_page: */ TAILQ_INSERT_AFTER(&pq->pq_pl, m, &vmd->vmd_marker, plinks.q); vm_pagequeue_unlock(pq); - queues_locked = FALSE; + queue_locked = FALSE; /* * Invalid pages can be easily freed. They cannot be @@ -1112,7 +1112,7 @@ free_page: m->flags |= PG_WINATCFLS; requeue_page: vm_pagequeue_lock(pq); - queues_locked = TRUE; + queue_locked = TRUE; vm_page_requeue_locked(m); } else if (maxlaunder > 0) { /* @@ -1150,15 +1150,15 @@ requeue_page: addl_page_shortage++; } vm_page_lock_assert(m, MA_NOTOWNED); - goto relock_queues; + goto relock_queue; } drop_page: vm_page_unlock(m); VM_OBJECT_WUNLOCK(object); -relock_queues: - if (!queues_locked) { +relock_queue: + if (!queue_locked) { vm_pagequeue_lock(pq); - queues_locked = TRUE; + queue_locked = TRUE; } next = TAILQ_NEXT(&vmd->vmd_marker, plinks.q); TAILQ_REMOVE(&pq->pq_pl, &vmd->vmd_marker, plinks.q); From owner-svn-src-all@freebsd.org Sun Aug 14 19:01:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F0F9BB9EFB; Sun, 14 Aug 2016 19:01:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F3C915C7; Sun, 14 Aug 2016 19:01:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EJ1FW5044875; Sun, 14 Aug 2016 19:01:15 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EJ1Fxo044874; Sun, 14 Aug 2016 19:01:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608141901.u7EJ1Fxo044874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 14 Aug 2016 19:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304092 - stable/10/sys/vm X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 19:01:16 -0000 Author: markj Date: Sun Aug 14 19:01:15 2016 New Revision: 304092 URL: https://svnweb.freebsd.org/changeset/base/304092 Log: MFC r303516 Use vm_page_undirty() instead of manually setting a page field. Modified: stable/10/sys/vm/vm_page.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_page.c ============================================================================== --- stable/10/sys/vm/vm_page.c Sun Aug 14 18:59:57 2016 (r304091) +++ stable/10/sys/vm/vm_page.c Sun Aug 14 19:01:15 2016 (r304092) @@ -2651,7 +2651,7 @@ vm_page_advise(vm_page_t m, int advice) * But we do make the page as freeable as we can without * actually taking the step of unmapping it. */ - m->dirty = 0; + vm_page_undirty(m); else if (advice != MADV_DONTNEED) return; From owner-svn-src-all@freebsd.org Sun Aug 14 19:01:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01BCABB9F58; Sun, 14 Aug 2016 19:01:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C5F89181E; Sun, 14 Aug 2016 19:01:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EJ1W2G046931; Sun, 14 Aug 2016 19:01:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EJ1W73046930; Sun, 14 Aug 2016 19:01:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608141901.u7EJ1W73046930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 14 Aug 2016 19:01:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304093 - stable/11/sys/vm X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 19:01:34 -0000 Author: markj Date: Sun Aug 14 19:01:32 2016 New Revision: 304093 URL: https://svnweb.freebsd.org/changeset/base/304093 Log: MFC r303516 Use vm_page_undirty() instead of manually setting a page field. Modified: stable/11/sys/vm/vm_page.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_page.c ============================================================================== --- stable/11/sys/vm/vm_page.c Sun Aug 14 19:01:15 2016 (r304092) +++ stable/11/sys/vm/vm_page.c Sun Aug 14 19:01:32 2016 (r304093) @@ -3397,7 +3397,7 @@ vm_page_advise(vm_page_t m, int advice) * But we do make the page as freeable as we can without * actually taking the step of unmapping it. */ - m->dirty = 0; + vm_page_undirty(m); else if (advice != MADV_DONTNEED) return; From owner-svn-src-all@freebsd.org Sun Aug 14 19:02:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EAADBBA00E; Sun, 14 Aug 2016 19:02:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5AF9E1A33; Sun, 14 Aug 2016 19:02:58 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EJ2vWd047625; Sun, 14 Aug 2016 19:02:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EJ2vAE047624; Sun, 14 Aug 2016 19:02:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608141902.u7EJ2vAE047624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 14 Aug 2016 19:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304094 - stable/10/sys/vm X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 19:02:58 -0000 Author: markj Date: Sun Aug 14 19:02:57 2016 New Revision: 304094 URL: https://svnweb.freebsd.org/changeset/base/304094 Log: MFC r303059 Release the second critical section in uma_zfree_arg() slightly earlier. Modified: stable/10/sys/vm/uma_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Sun Aug 14 19:01:32 2016 (r304093) +++ stable/10/sys/vm/uma_core.c Sun Aug 14 19:02:57 2016 (r304094) @@ -2770,6 +2770,8 @@ zfree_start: goto zfree_start; } cache->uc_freebucket = NULL; + /* We are no longer associated with this CPU. */ + critical_exit(); /* Can we throw this on the zone full list? */ if (bucket != NULL) { @@ -2782,9 +2784,6 @@ zfree_start: LIST_INSERT_HEAD(&zone->uz_buckets, bucket, ub_link); } - /* We are no longer associated with this CPU. */ - critical_exit(); - /* * We bump the uz count when the cache size is insufficient to * handle the working set. From owner-svn-src-all@freebsd.org Sun Aug 14 19:03:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 045CDBBA063; Sun, 14 Aug 2016 19:03:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB0A71BE8; Sun, 14 Aug 2016 19:03:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EJ3YeK047691; Sun, 14 Aug 2016 19:03:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EJ3Ylf047690; Sun, 14 Aug 2016 19:03:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608141903.u7EJ3Ylf047690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 14 Aug 2016 19:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304095 - stable/11/sys/vm X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 19:03:35 -0000 Author: markj Date: Sun Aug 14 19:03:33 2016 New Revision: 304095 URL: https://svnweb.freebsd.org/changeset/base/304095 Log: MFC r303059 Release the second critical section in uma_zfree_arg() slightly earlier. Modified: stable/11/sys/vm/uma_core.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/uma_core.c ============================================================================== --- stable/11/sys/vm/uma_core.c Sun Aug 14 19:02:57 2016 (r304094) +++ stable/11/sys/vm/uma_core.c Sun Aug 14 19:03:33 2016 (r304095) @@ -2744,6 +2744,8 @@ zfree_start: goto zfree_start; } cache->uc_freebucket = NULL; + /* We are no longer associated with this CPU. */ + critical_exit(); /* Can we throw this on the zone full list? */ if (bucket != NULL) { @@ -2756,9 +2758,6 @@ zfree_start: LIST_INSERT_HEAD(&zone->uz_buckets, bucket, ub_link); } - /* We are no longer associated with this CPU. */ - critical_exit(); - /* * We bump the uz count when the cache size is insufficient to * handle the working set. From owner-svn-src-all@freebsd.org Sun Aug 14 19:04:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FD05BBA0BF; Sun, 14 Aug 2016 19:04:39 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E4FC91D47; Sun, 14 Aug 2016 19:04:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EJ4cYk047795; Sun, 14 Aug 2016 19:04:38 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EJ4cpg047794; Sun, 14 Aug 2016 19:04:38 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608141904.u7EJ4cpg047794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 14 Aug 2016 19:04:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304096 - head/lib/libthr/arch/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 19:04:39 -0000 Author: adrian Date: Sun Aug 14 19:04:37 2016 New Revision: 304096 URL: https://svnweb.freebsd.org/changeset/base/304096 Log: [mips] convert over =v to =r for the inline assembly. Later gcc and clang have deprecated =v (which maps to a specific temp register) and instead we should just use =r to have the assembler (hopefully!) save/restore things appropriately after choosing a register. Tested: * AR9344 SoC, with userreg support * AR9331 SoC, with no userreg support Sponsored by: Sponsored by: DARPA, AFRL (MIPS TLS user register work) Modified: head/lib/libthr/arch/mips/include/pthread_md.h Modified: head/lib/libthr/arch/mips/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/mips/include/pthread_md.h Sun Aug 14 19:03:33 2016 (r304095) +++ head/lib/libthr/arch/mips/include/pthread_md.h Sun Aug 14 19:04:37 2016 (r304096) @@ -84,7 +84,7 @@ _tcb_get(void) ".set\tmips64r2\n\t" "rdhwr\t%0, $29\n\t" ".set\tpop" - : "=v" (_rv)); + : "=r" (_rv)); /* * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' @@ -106,7 +106,7 @@ _tcb_get(void) ".set\tmips32r2\n\t" "rdhwr\t%0, $29\n\t" ".set\tpop" - : "=v" (_rv)); + : "=r" (_rv)); /* * XXXSS See 'git show c6be4f4d2d1b71c04de5d3bbb6933ce2dbcdb317' From owner-svn-src-all@freebsd.org Sun Aug 14 19:05:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D50BABBA11E; Sun, 14 Aug 2016 19:05:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A4DAA1EC9; Sun, 14 Aug 2016 19:05:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EJ5iJg047880; Sun, 14 Aug 2016 19:05:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EJ5ixR047879; Sun, 14 Aug 2016 19:05:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608141905.u7EJ5ixR047879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 14 Aug 2016 19:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304097 - stable/11/sys/vm X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 19:05:45 -0000 Author: markj Date: Sun Aug 14 19:05:44 2016 New Revision: 304097 URL: https://svnweb.freebsd.org/changeset/base/304097 Log: MFC r303243 Update a comment in vm_page_advise() to match behaviour after r290529. Modified: stable/11/sys/vm/vm_page.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_page.c ============================================================================== --- stable/11/sys/vm/vm_page.c Sun Aug 14 19:04:37 2016 (r304096) +++ stable/11/sys/vm/vm_page.c Sun Aug 14 19:05:44 2016 (r304097) @@ -3411,9 +3411,11 @@ vm_page_advise(vm_page_t m, int advice) vm_page_dirty(m); /* - * Place clean pages at the head of the inactive queue rather than the - * tail, thus defeating the queue's LRU operation and ensuring that the - * page will be reused quickly. + * Place clean pages near the head of the inactive queue rather than + * the tail, thus defeating the queue's LRU operation and ensuring that + * the page will be reused quickly. Dirty pages are given a chance to + * cycle once through the inactive queue before becoming eligible for + * laundering. */ _vm_page_deactivate(m, m->dirty == 0); } From owner-svn-src-all@freebsd.org Sun Aug 14 19:07:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33573BBA19C; Sun, 14 Aug 2016 19:07:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DBBA211CF; Sun, 14 Aug 2016 19:07:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EJ7EDI047987; Sun, 14 Aug 2016 19:07:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EJ7EWX047985; Sun, 14 Aug 2016 19:07:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608141907.u7EJ7EWX047985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 14 Aug 2016 19:07:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304098 - stable/11/sys/ofed/drivers/infiniband/hw/mthca X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 19:07:15 -0000 Author: markj Date: Sun Aug 14 19:07:13 2016 New Revision: 304098 URL: https://svnweb.freebsd.org/changeset/base/304098 Log: MFC r303786 mthca: Add a wrapper for the firmware's DIAG_RPRT command. Modified: stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.c stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.c ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.c Sun Aug 14 19:05:44 2016 (r304097) +++ stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.c Sun Aug 14 19:07:13 2016 (r304098) @@ -1927,6 +1927,13 @@ int mthca_MGID_HASH(struct mthca_dev *de return err; } +int mthca_DIAG_RPRT(struct mthca_dev *dev, int mod, + struct mthca_mailbox *mailbox, u8 *status) +{ + return mthca_cmd_box(dev, 0, mailbox->dma, 0, mod, CMD_DIAG_RPRT, + CMD_TIME_CLASS_A, status); +} + int mthca_NOP(struct mthca_dev *dev, u8 *status) { return mthca_cmd(dev, 0, 0x1f, 0, CMD_NOP, msecs_to_jiffies(100), status); Modified: stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.h ============================================================================== --- stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.h Sun Aug 14 19:05:44 2016 (r304097) +++ stable/11/sys/ofed/drivers/infiniband/hw/mthca/mthca_cmd.h Sun Aug 14 19:07:13 2016 (r304098) @@ -112,6 +112,15 @@ enum { DEV_LIM_FLAG_UD_MULTI = 1 << 21, }; +enum { + DIAG_RPRT_Q_XPRT_CIERR = 2, + DIAG_RPRT_QR_XPRT_CIERR = 3, + DIAG_RPRT_Q_PERF = 4, + DIAG_RPRT_QR_PERF = 5, + DIAG_RPRT_Q_MISC = 6, + DIAG_RPRT_QR_MISC = 7, +}; + struct mthca_mailbox { dma_addr_t dma; void *buf; @@ -325,6 +334,8 @@ int mthca_WRITE_MGM(struct mthca_dev *de struct mthca_mailbox *mailbox, u8 *status); int mthca_MGID_HASH(struct mthca_dev *dev, struct mthca_mailbox *mailbox, u16 *hash, u8 *status); +int mthca_DIAG_RPRT(struct mthca_dev *dev, int mod, + struct mthca_mailbox *mailbox, u8 *status); int mthca_NOP(struct mthca_dev *dev, u8 *status); #endif /* MTHCA_CMD_H */ From owner-svn-src-all@freebsd.org Sun Aug 14 20:19:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E447BBAF45; Sun, 14 Aug 2016 20:19:49 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB26A1F43; Sun, 14 Aug 2016 20:19:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EKJmRU074109; Sun, 14 Aug 2016 20:19:48 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EKJmqJ074108; Sun, 14 Aug 2016 20:19:48 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608142019.u7EKJmqJ074108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 14 Aug 2016 20:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304100 - stable/11/sbin/route X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 20:19:49 -0000 Author: ae Date: Sun Aug 14 20:19:47 2016 New Revision: 304100 URL: https://svnweb.freebsd.org/changeset/base/304100 Log: MFC r303374: Due to dropped mbuf in netisr queue route(8) can fall into infinity loop of reading the rtsock's feed. When it used by some scripts, this leads to growing number of not finished route(8) instances and thus growing number of rtsock consumers. Add SIGALRM handler to prevent this. Modified: stable/11/sbin/route/route.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/route/route.c ============================================================================== --- stable/11/sbin/route/route.c Sun Aug 14 19:54:40 2016 (r304099) +++ stable/11/sbin/route/route.c Sun Aug 14 20:19:47 2016 (r304100) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -144,6 +145,16 @@ static int fiboptlist_range(const char * static void usage(const char *) __dead2; +#define READ_TIMEOUT 10 +static volatile sig_atomic_t stop_read; + +static void +stopit(int sig __unused) +{ + + stop_read = 1; +} + static void usage(const char *cp) { @@ -776,6 +787,7 @@ set_metric(char *value, int key) static void newroute(int argc, char **argv) { + struct sigaction sa; struct hostent *hp; struct fibl *fl; char *cmd; @@ -791,6 +803,12 @@ newroute(int argc, char **argv) hp = NULL; TAILQ_INIT(&fibl_head); + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + sa.sa_handler = stopit; + if (sigaction(SIGALRM, &sa, 0) == -1) + warn("sigaction SIGALRM"); + cmd = argv[0]; if (*cmd != 'g' && *cmd != 's') shutdown(s, SHUT_RD); /* Don't want to read back our messages */ @@ -1541,9 +1559,17 @@ rtmsg(int cmd, int flags, int fib) return (-1); } if (cmd == RTM_GET) { + stop_read = 0; + alarm(READ_TIMEOUT); do { l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg)); - } while (l > 0 && (rtm.rtm_seq != rtm_seq || rtm.rtm_pid != pid)); + } while (l > 0 && stop_read == 0 && + (rtm.rtm_seq != rtm_seq || rtm.rtm_pid != pid)); + if (stop_read != 0) { + warnx("read from routing socket timed out"); + return (-1); + } else + alarm(0); if (l < 0) warn("read from routing socket"); else From owner-svn-src-all@freebsd.org Sun Aug 14 20:22:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18110BBA0A7; Sun, 14 Aug 2016 20:22:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D03191373; Sun, 14 Aug 2016 20:22:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EKM4So076915; Sun, 14 Aug 2016 20:22:04 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EKM3on076913; Sun, 14 Aug 2016 20:22:03 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608142022.u7EKM3on076913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 14 Aug 2016 20:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304101 - stable/11/sys/netinet6 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 20:22:05 -0000 Author: ae Date: Sun Aug 14 20:22:03 2016 New Revision: 304101 URL: https://svnweb.freebsd.org/changeset/base/304101 Log: MFC r302906: Add net.inet6.ip6.intr_queue_maxlen sysctl. It can be used to change netisr queue limit for IPv6 at runtime. Modified: stable/11/sys/netinet6/in6.h stable/11/sys/netinet6/ip6_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/in6.h ============================================================================== --- stable/11/sys/netinet6/in6.h Sun Aug 14 20:19:47 2016 (r304100) +++ stable/11/sys/netinet6/in6.h Sun Aug 14 20:22:03 2016 (r304101) @@ -637,7 +637,10 @@ struct ip6_mtuinfo { * receiving IF. */ #define IPV6CTL_RFC6204W3 50 /* Accept defroute even when forwarding enabled */ -#define IPV6CTL_MAXID 51 +#define IPV6CTL_INTRQMAXLEN 51 /* max length of IPv6 netisr queue */ +#define IPV6CTL_INTRDQMAXLEN 52 /* max length of direct IPv6 netisr + * queue */ +#define IPV6CTL_MAXID 53 #endif /* __BSD_VISIBLE */ /* Modified: stable/11/sys/netinet6/ip6_input.c ============================================================================== --- stable/11/sys/netinet6/ip6_input.c Sun Aug 14 20:19:47 2016 (r304100) +++ stable/11/sys/netinet6/ip6_input.c Sun Aug 14 20:22:03 2016 (r304101) @@ -86,6 +86,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -145,6 +146,24 @@ static struct netisr_handler ip6_nh = { #endif }; +static int +sysctl_netinet6_intr_queue_maxlen(SYSCTL_HANDLER_ARGS) +{ + int error, qlimit; + + netisr_getqlimit(&ip6_nh, &qlimit); + error = sysctl_handle_int(oidp, &qlimit, 0, req); + if (error || !req->newptr) + return (error); + if (qlimit < 1) + return (EINVAL); + return (netisr_setqlimit(&ip6_nh, qlimit)); +} +SYSCTL_DECL(_net_inet6_ip6); +SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_INTRQMAXLEN, intr_queue_maxlen, + CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_netinet6_intr_queue_maxlen, "I", + "Maximum size of the IPv6 input queue"); + #ifdef RSS static struct netisr_handler ip6_direct_nh = { .nh_name = "ip6_direct", @@ -154,6 +173,24 @@ static struct netisr_handler ip6_direct_ .nh_policy = NETISR_POLICY_CPU, .nh_dispatch = NETISR_DISPATCH_HYBRID, }; + +static int +sysctl_netinet6_intr_direct_queue_maxlen(SYSCTL_HANDLER_ARGS) +{ + int error, qlimit; + + netisr_getqlimit(&ip6_direct_nh, &qlimit); + error = sysctl_handle_int(oidp, &qlimit, 0, req); + if (error || !req->newptr) + return (error); + if (qlimit < 1) + return (EINVAL); + return (netisr_setqlimit(&ip6_direct_nh, qlimit)); +} +SYSCTL_PROC(_net_inet6_ip6, IPV6CTL_INTRDQMAXLEN, intr_direct_queue_maxlen, + CTLTYPE_INT|CTLFLAG_RW, 0, 0, sysctl_netinet6_intr_direct_queue_maxlen, + "I", "Maximum size of the IPv6 direct input queue"); + #endif VNET_DEFINE(struct pfil_head, inet6_pfil_hook); From owner-svn-src-all@freebsd.org Sun Aug 14 22:00:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DBFABBA4E5; Sun, 14 Aug 2016 22:00:47 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E606C1C66; Sun, 14 Aug 2016 22:00:46 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EM0kI1011638; Sun, 14 Aug 2016 22:00:46 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EM0jpA011635; Sun, 14 Aug 2016 22:00:45 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608142200.u7EM0jpA011635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Sun, 14 Aug 2016 22:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304102 - in head/sys: kern vm 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 22:00:47 -0000 Author: alc Date: Sun Aug 14 22:00:45 2016 New Revision: 304102 URL: https://svnweb.freebsd.org/changeset/base/304102 Log: Eliminate unneeded vm_page_xbusy() and vm_page_xunbusy() operations when neither vm_pager_has_page() nor vm_pager_get_pages() is called. Reviewed by: kib, markj MFC after: 3 weeks Modified: head/sys/kern/kern_exec.c head/sys/kern/uipc_shm.c head/sys/vm/vm_glue.c Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Sun Aug 14 20:22:03 2016 (r304101) +++ head/sys/kern/kern_exec.c Sun Aug 14 22:00:45 2016 (r304102) @@ -984,8 +984,9 @@ exec_map_first_page(imgp) #if VM_NRESERVLEVEL > 0 vm_object_color(object, 0); #endif - ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL); + ma[0] = vm_page_grab(object, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY); if (ma[0]->valid != VM_PAGE_BITS_ALL) { + vm_page_xbusy(ma[0]); if (!vm_pager_has_page(object, 0, NULL, &after)) { vm_page_lock(ma[0]); vm_page_free(ma[0]); @@ -1021,10 +1022,10 @@ exec_map_first_page(imgp) VM_OBJECT_WUNLOCK(object); return (EIO); } + vm_page_xunbusy(ma[0]); for (i = 1; i < initial_pagein; i++) vm_page_readahead_finish(ma[i]); } - vm_page_xunbusy(ma[0]); vm_page_lock(ma[0]); vm_page_hold(ma[0]); vm_page_activate(ma[0]); Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Sun Aug 14 20:22:03 2016 (r304101) +++ head/sys/kern/uipc_shm.c Sun Aug 14 22:00:45 2016 (r304102) @@ -182,8 +182,9 @@ uiomove_object_page(vm_object_t obj, siz * lock to page out tobj's pages because tobj is a OBJT_SWAP * type object. */ - m = vm_page_grab(obj, idx, VM_ALLOC_NORMAL); + m = vm_page_grab(obj, idx, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY); if (m->valid != VM_PAGE_BITS_ALL) { + vm_page_xbusy(m); if (vm_pager_has_page(obj, idx, NULL, NULL)) { rv = vm_pager_get_pages(obj, &m, 1, NULL, NULL); if (rv != VM_PAGER_OK) { @@ -198,8 +199,8 @@ uiomove_object_page(vm_object_t obj, siz } } else vm_page_zero_invalid(m, TRUE); + vm_page_xunbusy(m); } - vm_page_xunbusy(m); vm_page_lock(m); vm_page_hold(m); if (m->queue == PQ_NONE) { Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Sun Aug 14 20:22:03 2016 (r304101) +++ head/sys/vm/vm_glue.c Sun Aug 14 22:00:45 2016 (r304102) @@ -236,8 +236,9 @@ vm_imgact_hold_page(vm_object_t object, VM_OBJECT_WLOCK(object); pindex = OFF_TO_IDX(offset); - m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL); + m = vm_page_grab(object, pindex, VM_ALLOC_NORMAL | VM_ALLOC_NOBUSY); if (m->valid != VM_PAGE_BITS_ALL) { + vm_page_xbusy(m); rv = vm_pager_get_pages(object, &m, 1, NULL, NULL); if (rv != VM_PAGER_OK) { vm_page_lock(m); @@ -246,8 +247,8 @@ vm_imgact_hold_page(vm_object_t object, m = NULL; goto out; } + vm_page_xunbusy(m); } - vm_page_xunbusy(m); vm_page_lock(m); vm_page_hold(m); vm_page_activate(m); From owner-svn-src-all@freebsd.org Sun Aug 14 22:43:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21AF6BBACD6; Sun, 14 Aug 2016 22:43:50 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D6D9B123C; Sun, 14 Aug 2016 22:43:49 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7EMhnkF029278; Sun, 14 Aug 2016 22:43:49 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7EMhnA4029277; Sun, 14 Aug 2016 22:43:49 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608142243.u7EMhnA4029277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 14 Aug 2016 22:43:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304104 - stable/11/usr.bin/truss X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 22:43:50 -0000 Author: bapt Date: Sun Aug 14 22:43:48 2016 New Revision: 304104 URL: https://svnweb.freebsd.org/changeset/base/304104 Log: MFC: r303685 truss: fix uninitialized trussinfo->curthread in add_threads()/enter_syscall trussinfo->curthread must be initialized before calling enter_syscall(), it is used by t->proc->abi->fetch_args(). Without that truss is segfaulting and the attached program also crash. Submitted by: Nikita Kozlov (nikita@gandi.net) Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D7399 Modified: stable/11/usr.bin/truss/setup.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/setup.c ============================================================================== --- stable/11/usr.bin/truss/setup.c Sun Aug 14 22:08:25 2016 (r304103) +++ stable/11/usr.bin/truss/setup.c Sun Aug 14 22:43:48 2016 (r304104) @@ -223,8 +223,10 @@ add_threads(struct trussinfo *info, stru t = new_thread(p, lwps[i]); if (ptrace(PT_LWPINFO, lwps[i], (caddr_t)&pl, sizeof(pl)) == -1) err(1, "ptrace(PT_LWPINFO)"); - if (pl.pl_flags & PL_FLAG_SCE) + if (pl.pl_flags & PL_FLAG_SCE) { + info->curthread = t; enter_syscall(info, t, &pl); + } } free(lwps); } From owner-svn-src-all@freebsd.org Sun Aug 14 23:28:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CB8BBB9459 for ; Sun, 14 Aug 2016 23:28:40 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D233E1499 for ; Sun, 14 Aug 2016 23:28:39 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by mail-wm0-x22d.google.com with SMTP id i5so74104103wmg.0 for ; Sun, 14 Aug 2016 16:28:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to; bh=eQXQHDX5jc6LaD5eCvR9AXqJbi88AUIzffxVcGFVMqI=; b=Tok11dp27Y9pjLJNXv5A8QN8/q0t8VPSXPTOZPSvPz9iImeaIzWxGZnbiDNZ5PDX0e knu5hfvXVwvGXM5dR2thJHHGr3DFV2itraiqx49Ius9pFmfVRzp78vh/XNAS9ifgyXVE P7hGKxH80Kxkj5HX1WUHHLcAKzSWf9ZOA5wmO5y0hLU8B1VMdfFfy3viVfyqz6CLpyI4 wViddOJtPGq/ChOO1JI/6rGc5irA4wnnLM0bqwJ/ycNK/eu6LfhvacVGnc9xNRY6a/z6 ja2lUIL/qpsfUlALlH4HCBr7YTFwFNKicJfjkmIgPQE5FJSyQsVFclK7y5pN9JtkESeh MOmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=eQXQHDX5jc6LaD5eCvR9AXqJbi88AUIzffxVcGFVMqI=; b=BzzUOu76IoQVXjA0n2AH/tWPaaBE+46NsMQRAhYbF6eoF6Dxq4hAT0Swy9G2g93Kop IxckcnN/kubKLZotMihnpe2ZGl+VdCdo+XreatpGJqAX/xFRInPmcLr/Stt3kytgyGXf PZjZRsv6XtgFnVVb96vgwQH29EaEsREcUdbWuqJBcm2J8A55V2PrLnItgVTaSDBybG/Z yAQJLpY/kJWLvuPfMvCb0Pjmi5uIpxxm4jyPRTGJ44r/0sIf3M5OEu8ebNtMz7wXJjf/ lsoebqgekWL2VOmFWjnpjAOhP9sGllQDehEsH5d28NHmjjU4+Qa+cRcjnRe72d+vfgpB VMpA== X-Gm-Message-State: AEkoouu6ocAg3IUh/Rc3in4EAp70we7nHjC90bNJJfdPOP3A/C310/drkafWaEfwc+F3BLFl X-Received: by 10.194.176.165 with SMTP id cj5mr33200890wjc.82.1471217317948; Sun, 14 Aug 2016 16:28:37 -0700 (PDT) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id c8sm18679181wjm.19.2016.08.14.16.28.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Aug 2016 16:28:36 -0700 (PDT) Subject: Re: svn commit: r304104 - stable/11/usr.bin/truss To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org References: <201608142243.u7EMhnA4029277@repo.freebsd.org> From: Steven Hartland Message-ID: Date: Mon, 15 Aug 2016 00:28:40 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608142243.u7EMhnA4029277@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 23:28:40 -0000 This going to make it into 11.0-RELEASE? On 14/08/2016 23:43, Baptiste Daroussin wrote: > Author: bapt > Date: Sun Aug 14 22:43:48 2016 > New Revision: 304104 > URL: https://svnweb.freebsd.org/changeset/base/304104 > > Log: > MFC: r303685 > > truss: fix uninitialized trussinfo->curthread in add_threads()/enter_syscall > > trussinfo->curthread must be initialized before calling enter_syscall(), > it is used by t->proc->abi->fetch_args(). > Without that truss is segfaulting and the attached program also crash. > > Submitted by: Nikita Kozlov (nikita@gandi.net) > Reviewed by: jhb > Differential Revision: https://reviews.freebsd.org/D7399 > > Modified: > stable/11/usr.bin/truss/setup.c > Directory Properties: > stable/11/ (props changed) > > Modified: stable/11/usr.bin/truss/setup.c > ============================================================================== > --- stable/11/usr.bin/truss/setup.c Sun Aug 14 22:08:25 2016 (r304103) > +++ stable/11/usr.bin/truss/setup.c Sun Aug 14 22:43:48 2016 (r304104) > @@ -223,8 +223,10 @@ add_threads(struct trussinfo *info, stru > t = new_thread(p, lwps[i]); > if (ptrace(PT_LWPINFO, lwps[i], (caddr_t)&pl, sizeof(pl)) == -1) > err(1, "ptrace(PT_LWPINFO)"); > - if (pl.pl_flags & PL_FLAG_SCE) > + if (pl.pl_flags & PL_FLAG_SCE) { > + info->curthread = t; > enter_syscall(info, t, &pl); > + } > } > free(lwps); > } > From owner-svn-src-all@freebsd.org Sun Aug 14 23:34:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9944EBB967D; Sun, 14 Aug 2016 23:34:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 7F0B81A37; Sun, 14 Aug 2016 23:34:04 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 1EE78114A; Sun, 14 Aug 2016 23:34:03 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Sun, 14 Aug 2016 23:34:02 +0000 From: Glen Barber To: Steven Hartland Cc: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r304104 - stable/11/usr.bin/truss Message-ID: <20160814233402.GL11079@FreeBSD.org> References: <201608142243.u7EMhnA4029277@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="LXESt2jNC8oCvz8w" Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 23:34:04 -0000 --LXESt2jNC8oCvz8w Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Once re@ receives the proper request, yes. Glen On Mon, Aug 15, 2016 at 12:28:40AM +0100, Steven Hartland wrote: > This going to make it into 11.0-RELEASE? >=20 > On 14/08/2016 23:43, Baptiste Daroussin wrote: > >Author: bapt > >Date: Sun Aug 14 22:43:48 2016 > >New Revision: 304104 > >URL: https://svnweb.freebsd.org/changeset/base/304104 > > > >Log: > > MFC: r303685 > > truss: fix uninitialized trussinfo->curthread in add_threads()/enter_= syscall > > trussinfo->curthread must be initialized before calling enter_syscall= (), > > it is used by t->proc->abi->fetch_args(). > > Without that truss is segfaulting and the attached program also crash. > > Submitted by: Nikita Kozlov (nikita@gandi.net) > > Reviewed by: jhb > > Differential Revision: https://reviews.freebsd.org/D7399 > > > >Modified: > > stable/11/usr.bin/truss/setup.c > >Directory Properties: > > stable/11/ (props changed) > > > >Modified: stable/11/usr.bin/truss/setup.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 > >--- stable/11/usr.bin/truss/setup.c Sun Aug 14 22:08:25 2016 (r304103) > >+++ stable/11/usr.bin/truss/setup.c Sun Aug 14 22:43:48 2016 (r304104) > >@@ -223,8 +223,10 @@ add_threads(struct trussinfo *info, stru > > t =3D new_thread(p, lwps[i]); > > if (ptrace(PT_LWPINFO, lwps[i], (caddr_t)&pl, sizeof(pl)) =3D=3D -1) > > err(1, "ptrace(PT_LWPINFO)"); > >- if (pl.pl_flags & PL_FLAG_SCE) > >+ if (pl.pl_flags & PL_FLAG_SCE) { > >+ info->curthread =3D t; > > enter_syscall(info, t, &pl); > >+ } > > } > > free(lwps); > > } > > >=20 --LXESt2jNC8oCvz8w Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXsP/qAAoJEAMUWKVHj+KTlCkP/2IsKJLgEMCL4PprsjRQTuOf QbXnN2aE8eE7tDL8aie14SZUllrYZgcqN+KyUEP6LLwQrgu/noJkKY49v+V57oYY CKhFXTxs6wx4oJLg0IJxnR0wzAwSlhl/bRFtE34WtRCK7vTugbNRB3G0WAuaHh/X EAIDzT6pO4LqM7u9gI927m4bmVyEmlPs5p7/K+XMqb6qd0EoyBDgSnGbO/b1Arve xx/Nmx0boijpOLEtMCDg+8KIRKpWfwkNDBklpZxxocWg7KVU5CDdxAUSwQw6zk2m L9xsihVBSJblpw736okpjpg9007yOZ9mt855Q8XLmIeJDk1Ghzf7HpcBqEcTCF6D 3PEMd1g8Kw0jIkgwh4WHwC+ZmJl6Snd4vKqJHScTdgDT8NWWlZYhcsQkxZbgjtsE pUkiqnkSnl9NDgDSeO3euQ+3Q6qAWokwckKT+qS4J4Bo46x55AsHOR49s/xCSdc/ Asew6NniBYIobWtFQmQBhlzPpRTrHhUCAghBWjWGgqcNhbH6y8o0rQ5D1/A4E1Cb uT25vwFEDki0Sll2iSIBZMe6k2zk1isQDpnau6vUyj0oGKA+N3m4vmUC9U/TNSLS 2t2xImhgq+eyjTqM/0z2PfuXiyTvRo8SGYTdcJXUmNORRURnf27KGRRQNQZvmbbi VdYe939AI7GsfPFBRa4D =cL7P -----END PGP SIGNATURE----- --LXESt2jNC8oCvz8w-- From owner-svn-src-all@freebsd.org Sun Aug 14 23:38:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6413BB99B9; Sun, 14 Aug 2016 23:38:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A2C91DC8; Sun, 14 Aug 2016 23:38:52 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7ENcpJ7048187; Sun, 14 Aug 2016 23:38:51 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ENcpiY048179; Sun, 14 Aug 2016 23:38:51 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201608142338.u7ENcpiY048179@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 14 Aug 2016 23:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304106 - in head: include lib/libc/string 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.22 Precedence: list List-Id: "SVN commit messages 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, 14 Aug 2016 23:38:52 -0000 Author: delphij Date: Sun Aug 14 23:38:50 2016 New Revision: 304106 URL: https://svnweb.freebsd.org/changeset/base/304106 Log: Add timingsafe_bcmp and timingsafe_memcmp. Obtained from: OpenBSD Reviewed by: trasz MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D7280 Added: head/lib/libc/string/timingsafe_bcmp.3 (contents, props changed) head/lib/libc/string/timingsafe_bcmp.c (contents, props changed) head/lib/libc/string/timingsafe_memcmp.c (contents, props changed) Modified: head/include/string.h head/lib/libc/string/Makefile.inc head/lib/libc/string/Symbol.map head/lib/libc/string/bcmp.3 head/lib/libc/string/memcmp.3 Modified: head/include/string.h ============================================================================== --- head/include/string.h Sun Aug 14 22:58:06 2016 (r304105) +++ head/include/string.h Sun Aug 14 23:38:50 2016 (r304106) @@ -134,6 +134,8 @@ typedef __ssize_t ssize_t; void swab(const void * __restrict, void * __restrict, ssize_t); #endif /* _SWAB_DECLARED */ +int timingsafe_bcmp(const void *, const void *, size_t); +int timingsafe_memcmp(const void *, const void *, size_t); #endif /* __BSD_VISIBLE */ #if __POSIX_VISIBLE >= 200809 || defined(_XLOCALE_H_) Modified: head/lib/libc/string/Makefile.inc ============================================================================== --- head/lib/libc/string/Makefile.inc Sun Aug 14 22:58:06 2016 (r304105) +++ head/lib/libc/string/Makefile.inc Sun Aug 14 23:38:50 2016 (r304106) @@ -16,7 +16,10 @@ MISRCS+=bcmp.c bcopy.c bzero.c explicit_ strcspn.c strdup.c strerror.c strlcat.c strlcpy.c strlen.c strmode.c \ strncat.c strncmp.c strncpy.c strndup.c strnlen.c strnstr.c \ strpbrk.c strrchr.c strsep.c strsignal.c strspn.c strstr.c strtok.c \ - strxfrm.c swab.c wcpcpy.c wcpncpy.c wcscasecmp.c wcscat.c \ + strxfrm.c swab.c \ + timingsafe_bcmp.c \ + timingsafe_memcmp.c \ + wcpcpy.c wcpncpy.c wcscasecmp.c wcscat.c \ wcschr.c wcscmp.c wcscoll.c wcscpy.c wcscspn.c wcsdup.c \ wcslcat.c wcslcpy.c wcslen.c wcsncasecmp.c wcsncat.c wcsncmp.c \ wcsncpy.c wcsnlen.c wcspbrk.c \ @@ -34,7 +37,9 @@ MAN+= bcmp.3 bcopy.3 bstring.3 bzero.3 f memcmp.3 memcpy.3 memmem.3 memmove.3 memset.3 strcasecmp.3 strcat.3 \ strchr.3 strcmp.3 strcoll.3 strcpy.3 strdup.3 strerror.3 \ string.3 strlcpy.3 strlen.3 strmode.3 strpbrk.3 strsep.3 \ - strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 wcscoll.3 wcstok.3 \ + strspn.3 strstr.3 strtok.3 strxfrm.3 swab.3 \ + timingsafe_bcmp.3 \ + wcscoll.3 wcstok.3 \ wcswidth.3 wcsxfrm.3 wmemchr.3 MLINKS+=bzero.3 explicit_bzero.3 @@ -69,6 +74,7 @@ MLINKS+=strstr.3 strcasestr.3 \ strstr.3 strcasestr_l.3 MLINKS+=strtok.3 strtok_r.3 MLINKS+=strxfrm.3 strxfrm_l.3 +MLINKS+=timingsafe_bcmp.3 timingsafe_memcmp.3 MLINKS+=wmemchr.3 wcpcpy.3 \ wmemchr.3 wcpncpy.3 \ wmemchr.3 wcscasecmp.3 \ Modified: head/lib/libc/string/Symbol.map ============================================================================== --- head/lib/libc/string/Symbol.map Sun Aug 14 22:58:06 2016 (r304105) +++ head/lib/libc/string/Symbol.map Sun Aug 14 23:38:50 2016 (r304106) @@ -104,6 +104,11 @@ FBSD_1.4 { explicit_bzero; }; +FBSD_1.5 { + timingsafe_bcmp; + timingsafe_memcmp; +}; + FBSDprivate_1.0 { __strtok_r; }; Modified: head/lib/libc/string/bcmp.3 ============================================================================== --- head/lib/libc/string/bcmp.3 Sun Aug 14 22:58:06 2016 (r304105) +++ head/lib/libc/string/bcmp.3 Sun Aug 14 23:38:50 2016 (r304106) @@ -30,7 +30,7 @@ .\" @(#)bcmp.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd August 15, 2016 .Dt BCMP 3 .Os .Sh NAME @@ -62,7 +62,8 @@ The strings may overlap. .Xr strcasecmp 3 , .Xr strcmp 3 , .Xr strcoll 3 , -.Xr strxfrm 3 +.Xr strxfrm 3 , +.Xr timingsafe_bcmp 3 .Sh HISTORY A .Fn bcmp Modified: head/lib/libc/string/memcmp.3 ============================================================================== --- head/lib/libc/string/memcmp.3 Sun Aug 14 22:58:06 2016 (r304105) +++ head/lib/libc/string/memcmp.3 Sun Aug 14 23:38:50 2016 (r304106) @@ -32,7 +32,7 @@ .\" @(#)memcmp.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd August 15, 2016 .Dt MEMCMP 3 .Os .Sh NAME @@ -75,6 +75,7 @@ Zero-length strings are always identical .Xr strcmp 3 , .Xr strcoll 3 , .Xr strxfrm 3 , +.Xr timingsafe_memcmp 3 , .Xr wmemcmp 3 .Sh STANDARDS The Added: head/lib/libc/string/timingsafe_bcmp.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/string/timingsafe_bcmp.3 Sun Aug 14 23:38:50 2016 (r304106) @@ -0,0 +1,92 @@ +.\" $OpenBSD: timingsafe_bcmp.3,v 1.2 2014/06/21 20:22:15 tedu Exp $ +.\" +.\" Copyright (c) 2014 Google Inc. +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $FreeBSD$ +.Dd August 15, 2016 +.Dt TIMINGSAFE_BCMP 3 +.Os +.Sh NAME +.Nm timingsafe_bcmp , +.Nm timingsafe_memcmp +.Nd timing-safe byte sequence comparisons +.Sh SYNOPSIS +.In string.h +.Ft int +.Fn timingsafe_bcmp "const void *b1" "const void *b2" "size_t len" +.Ft int +.Fn timingsafe_memcmp "const void *b1" "const void *b2" "size_t len" +.Sh DESCRIPTION +The +.Fn timingsafe_bcmp +and +.Fn timingsafe_memcmp +functions lexicographically compare the first +.Fa len +bytes (each interpreted as an +.Vt unsigned char ) +pointed to by +.Fa b1 +and +.Fa b2 . +.Pp +Additionally, their running times are independent of the byte sequences compared, +making them safe to use for comparing secret values such as cryptographic MACs. +In contrast, +.Xr bcmp 3 +and +.Xr memcmp 3 +may short-circuit after finding the first differing byte. +.Sh RETURN VALUES +The +.Fn timingsafe_bcmp +function returns 0 or not zero if the byte sequence pointed to by +.Fa b1 +compares equal to or not equal to (respectively) +the byte sequence pointed to by +.Fa b2 . +.Pp +The +.Fn timingsafe_memcmp +function returns a negative value, 0, or positive value if the byte sequence +pointed to by +.Fa b1 +compares less than, equal to, or greater than (respectively) +the byte sequence pointed to by +.Fa b2 . +.Sh SEE ALSO +.Xr bcmp 3 , +.Xr memcmp 3 +.Sh STANDARDS +The +.Fn timingsafe_bcmp +and +.Fn timingsafe_memcmp +functions are +.Fx +extensions. +.Sh HISTORY +The +.Fn timingsafe_bcmp +function first appeared in +.Ox 4.9 . +.Pp +The +.Fn timingsafe_memcmp +function first appeared in +.Ox 5.6 . +.Pp +Both functions first appeared in +.Fx 12.0 . Added: head/lib/libc/string/timingsafe_bcmp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/string/timingsafe_bcmp.c Sun Aug 14 23:38:50 2016 (r304106) @@ -0,0 +1,36 @@ +/* $OpenBSD: timingsafe_bcmp.c,v 1.3 2015/08/31 02:53:57 guenther Exp $ */ +/* + * Copyright (c) 2010 Damien Miller. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +int __timingsafe_bcmp(const void *, const void *, size_t); + +int +__timingsafe_bcmp(const void *b1, const void *b2, size_t n) +{ + const unsigned char *p1 = b1, *p2 = b2; + int ret = 0; + + for (; n > 0; n--) + ret |= *p1++ ^ *p2++; + return (ret != 0); +} + +__weak_reference(__timingsafe_bcmp, timingsafe_bcmp); Added: head/lib/libc/string/timingsafe_memcmp.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/string/timingsafe_memcmp.c Sun Aug 14 23:38:50 2016 (r304106) @@ -0,0 +1,53 @@ +/* $OpenBSD: timingsafe_memcmp.c,v 1.2 2015/08/31 02:53:57 guenther Exp $ */ +/* + * Copyright (c) 2014 Google Inc. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +int __timingsafe_memcmp(const void *, const void *, size_t); + +int +__timingsafe_memcmp(const void *b1, const void *b2, size_t len) +{ + const unsigned char *p1 = b1, *p2 = b2; + size_t i; + int res = 0, done = 0; + + for (i = 0; i < len; i++) { + /* lt is -1 if p1[i] < p2[i]; else 0. */ + int lt = (p1[i] - p2[i]) >> CHAR_BIT; + + /* gt is -1 if p1[i] > p2[i]; else 0. */ + int gt = (p2[i] - p1[i]) >> CHAR_BIT; + + /* cmp is 1 if p1[i] > p2[i]; -1 if p1[i] < p2[i]; else 0. */ + int cmp = lt - gt; + + /* set res = cmp if !done. */ + res |= cmp & ~done; + + /* set done if p1[i] != p2[i]. */ + done |= lt | gt; + } + + return (res); +} + +__weak_reference(__timingsafe_memcmp, timingsafe_memcmp); From owner-svn-src-all@freebsd.org Mon Aug 15 01:30:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 672F6BB8380; Mon, 15 Aug 2016 01:30:11 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) by mx1.freebsd.org (Postfix) with ESMTP id 51FED1990; Mon, 15 Aug 2016 01:30:10 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from ford.home.vangyzen.net (unknown [76.164.15.242]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 96AB2564A3; Sun, 14 Aug 2016 20:30:03 -0500 (CDT) Subject: Re: svn commit: r304046 - in head: sbin/ipfw sys/conf sys/modules sys/modules/ipfw_nat64 sys/netinet sys/netinet6 sys/netpfil/ipfw/nat64 To: "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608131609.u7DG9nLe044837@repo.freebsd.org> From: Eric van Gyzen Message-ID: <258b2981-7738-9f3b-305c-4776b5a6fdc4@FreeBSD.org> Date: Sun, 14 Aug 2016 20:29:24 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608131609.u7DG9nLe044837@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 01:30:11 -0000 On 08/13/16 11:09 AM, Andrey V. Elsukov wrote: > Author: ae > Date: Sat Aug 13 16:09:49 2016 > New Revision: 304046 > URL: https://svnweb.freebsd.org/changeset/base/304046 > > Log: > Add ipfw_nat64 module that implements stateless and stateful NAT64. Thanks for contributing this. When you get a moment, "make universe" is now broken: /usr/src/sys/amd64/conf/LINT: unknown option "IPFIREWALL_NAT64" *** [buildkernel] Error code 1 Cheers, Eric From owner-svn-src-all@freebsd.org Mon Aug 15 04:59:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4DCCBB7D80; Mon, 15 Aug 2016 04:59:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9603211D6; Mon, 15 Aug 2016 04:59:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F4xcdp066990; Mon, 15 Aug 2016 04:59:38 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F4xc0L066989; Mon, 15 Aug 2016 04:59:38 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608150459.u7F4xc0L066989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 15 Aug 2016 04:59:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304108 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 04:59:39 -0000 Author: sephe Date: Mon Aug 15 04:59:38 2016 New Revision: 304108 URL: https://svnweb.freebsd.org/changeset/base/304108 Log: Unbreak LINT build. Sponsored by: Microsoft Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Aug 15 04:48:29 2016 (r304107) +++ head/sys/conf/options Mon Aug 15 04:59:38 2016 (r304108) @@ -418,6 +418,7 @@ IPFILTER_LOOKUP opt_ipfilter.h IPFIREWALL opt_ipfw.h IPFIREWALL_DEFAULT_TO_ACCEPT opt_ipfw.h IPFIREWALL_NAT opt_ipfw.h +IPFIREWALL_NAT64 opt_ipfw.h IPFIREWALL_NAT64_DIRECT_OUTPUT opt_ipfw.h IPFIREWALL_NPTV6 opt_ipfw.h IPFIREWALL_VERBOSE opt_ipfw.h From owner-svn-src-all@freebsd.org Mon Aug 15 05:00:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B988BB7DF1; Mon, 15 Aug 2016 05:00:39 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2E651355; Mon, 15 Aug 2016 05:00:38 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F50cmp067860; Mon, 15 Aug 2016 05:00:38 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F50cEt067858; Mon, 15 Aug 2016 05:00:38 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608150500.u7F50cEt067858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 15 Aug 2016 05:00:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304109 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 05:00:39 -0000 Author: sephe Date: Mon Aug 15 05:00:37 2016 New Revision: 304109 URL: https://svnweb.freebsd.org/changeset/base/304109 Log: hyperv/hn: Simplify chimney sending buffer disconnection. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7479 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/if_hnreg.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 15 04:59:38 2016 (r304108) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 15 05:00:37 2016 (r304109) @@ -436,33 +436,24 @@ hv_nv_destroy_rx_buffer(netvsc_dev *net_ static int hv_nv_destroy_send_buffer(netvsc_dev *net_dev) { - nvsp_msg *revoke_pkt; int ret = 0; - /* - * If we got a section count, it means we received a - * send_rx_buf_complete msg - * (ie sent nvsp_msg_1_type_send_rx_buf msg) therefore, - * we need to send a revoke msg here - */ if (net_dev->send_section_size) { - /* Send the revoke send buffer */ - revoke_pkt = &net_dev->revoke_packet; - memset(revoke_pkt, 0, sizeof(nvsp_msg)); - - revoke_pkt->hdr.msg_type = - nvsp_msg_1_type_revoke_send_buf; - revoke_pkt->msgs.vers_1_msgs.revoke_send_buf.id = - NETVSC_SEND_BUFFER_ID; + struct hn_nvs_chim_disconn disconn; - ret = vmbus_chan_send(net_dev->sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, 0, revoke_pkt, sizeof(nvsp_msg), - (uint64_t)(uintptr_t)&hn_send_ctx_none); /* - * If we failed here, we might as well return and have a leak - * rather than continue and a bugchk + * Disconnect chimney sending buffer from NVS. */ + memset(&disconn, 0, sizeof(disconn)); + disconn.nvs_type = HN_NVS_TYPE_CHIM_DISCONN; + disconn.nvs_sig = HN_NVS_CHIM_SIG; + + ret = vmbus_chan_send(net_dev->sc->hn_prichan, + VMBUS_CHANPKT_TYPE_INBAND, 0, &disconn, sizeof(disconn), + (uint64_t)(uintptr_t)&hn_send_ctx_none); if (ret != 0) { + if_printf(net_dev->sc->hn_ifp, + "send chim disconn failed: %d\n", ret); return (ret); } } Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Mon Aug 15 04:59:38 2016 (r304108) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Mon Aug 15 05:00:37 2016 (r304109) @@ -45,6 +45,7 @@ #define HN_NVS_TYPE_RXBUF_DISCONN 103 #define HN_NVS_TYPE_CHIM_CONN 104 #define HN_NVS_TYPE_CHIM_CONNRESP 105 +#define HN_NVS_TYPE_CHIM_DISCONN 106 #define HN_NVS_TYPE_NDIS_CONF 125 /* @@ -135,4 +136,12 @@ struct hn_nvs_chim_connresp { uint32_t nvs_sectsz; /* section size */ } __packed; +/* No response */ +struct hn_nvs_chim_disconn { + uint32_t nvs_type; /* HN_NVS_TYPE_CHIM_DISCONN */ + uint16_t nvs_sig; /* HN_NVS_CHIM_SIG */ + uint8_t nvs_rsvd[26]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_chim_disconn) >= HN_NVS_REQSIZE_MIN); + #endif /* !_IF_HNREG_H_ */ From owner-svn-src-all@freebsd.org Mon Aug 15 05:07:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B4A8BBA0DA; Mon, 15 Aug 2016 05:07:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA7661911; Mon, 15 Aug 2016 05:07:03 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F573rF070796; Mon, 15 Aug 2016 05:07:03 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F573MQ070795; Mon, 15 Aug 2016 05:07:03 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608150507.u7F573MQ070795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 15 Aug 2016 05:07:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304110 - releng/11.0/sys/netinet X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 05:07:04 -0000 Author: tuexen Date: Mon Aug 15 05:07:02 2016 New Revision: 304110 URL: https://svnweb.freebsd.org/changeset/base/304110 Log: MFC r304082: Improve a consistency check to not detect valid cases for unordered user messages using DATA chunks as invalid ones. While there, ensure that error causes are provided when sending ABORT chunks in case of reassembly problems detected. Thanks to Taylor Brandstetter for making me aware of this problem. Approved by: re (gjb) Modified: releng/11.0/sys/netinet/sctp_indata.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/sys/netinet/sctp_indata.c ============================================================================== --- releng/11.0/sys/netinet/sctp_indata.c Mon Aug 15 05:00:37 2016 (r304109) +++ releng/11.0/sys/netinet/sctp_indata.c Mon Aug 15 05:07:02 2016 (r304110) @@ -1747,21 +1747,27 @@ sctp_process_a_data_chunk(struct sctp_tc * If its a fragmented message, lets see if we can find the control * on the reassembly queues. */ - if ((chtype == SCTP_IDATA) && ((chunk_flags & SCTP_DATA_FIRST_FRAG) == 0) && (fsn == 0)) { + if ((chtype == SCTP_IDATA) && + ((chunk_flags & SCTP_DATA_FIRST_FRAG) == 0) && + (fsn == 0)) { /* * The first *must* be fsn 0, and other (middle/end) pieces - * can *not* be fsn 0. + * can *not* be fsn 0. XXX: This can happen in case of a + * wrap around. Ignore is for now. */ + snprintf(msg, sizeof(msg), "FSN zero for MID=%8.8x, but flags=%2.2x", + msg_id, chunk_flags); goto err_out; } + control = sctp_find_reasm_entry(strm, msg_id, ordered, old_data); + SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x look for control on queues %p\n", + chunk_flags, control); if ((chunk_flags & SCTP_DATA_NOT_FRAG) != SCTP_DATA_NOT_FRAG) { /* See if we can find the re-assembly entity */ - control = sctp_find_reasm_entry(strm, msg_id, ordered, old_data); - SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x look for control on queues %p\n", - chunk_flags, control); - if (control) { + if (control != NULL) { /* We found something, does it belong? */ if (ordered && (msg_id != control->sinfo_ssn)) { + snprintf(msg, sizeof(msg), "Reassembly problem (MID=%8.8x)", msg_id); err_out: op_err = sctp_generate_cause(SCTP_CAUSE_PROTOCOL_VIOLATION, msg); stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_15; @@ -1774,6 +1780,8 @@ sctp_process_a_data_chunk(struct sctp_tc * We can't have a switched order with an * unordered chunk */ + snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + tsn); goto err_out; } if (!ordered && (((control->sinfo_flags >> 8) & SCTP_DATA_UNORDERED) == 0)) { @@ -1781,6 +1789,8 @@ sctp_process_a_data_chunk(struct sctp_tc * We can't have a switched unordered with a * ordered chunk */ + snprintf(msg, sizeof(msg), "All fragments of a user message must be ordered or unordered (TSN=%8.8x)", + tsn); goto err_out; } } @@ -1790,14 +1800,21 @@ sctp_process_a_data_chunk(struct sctp_tc * re-assembly going on with the same Stream/Seq (for * ordered) or in the same Stream for unordered. */ - SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags:0x%x look for msg in case we have dup\n", - chunk_flags); - if (sctp_find_reasm_entry(strm, msg_id, ordered, old_data)) { - SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on msg_id: %u\n", - chunk_flags, - msg_id); - - goto err_out; + if (control != NULL) { + if (ordered || (old_data == 0)) { + SCTPDBG(SCTP_DEBUG_XXX, "chunk_flags: 0x%x dup detected on msg_id: %u\n", + chunk_flags, msg_id); + snprintf(msg, sizeof(msg), "Duplicate MID=%8.8x detected.", msg_id); + goto err_out; + } else { + if ((tsn == control->fsn_included + 1) && + (control->end_added == 0)) { + snprintf(msg, sizeof(msg), "Illegal message sequence, missing end for MID: %8.8x", control->fsn_included); + goto err_out; + } else { + control = NULL; + } + } } } /* now do the tests */ From owner-svn-src-all@freebsd.org Mon Aug 15 05:08:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 855ABBBA158; Mon, 15 Aug 2016 05:08:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 461771A85; Mon, 15 Aug 2016 05:08:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F58gXV070897; Mon, 15 Aug 2016 05:08:42 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F58g3v070893; Mon, 15 Aug 2016 05:08:42 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608150508.u7F58g3v070893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 15 Aug 2016 05:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304111 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 05:08:43 -0000 Author: sephe Date: Mon Aug 15 05:08:41 2016 New Revision: 304111 URL: https://svnweb.freebsd.org/changeset/base/304111 Log: hyperv/hn: Switch to vmbus xact APIs for sub-channel alloc request. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7480 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnreg.h head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 15 05:07:02 2016 (r304110) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Mon Aug 15 05:08:41 2016 (r304111) @@ -73,9 +73,6 @@ static void hv_nv_on_receive(netvsc_dev static void hn_nvs_sent_none(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, const struct nvsp_msg_ *msg, int); -static void hn_nvs_sent_xact(struct hn_send_ctx *sndc, - struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, - const struct nvsp_msg_ *msg, int dlen); static struct hn_send_ctx hn_send_ctx_none = HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL); @@ -756,16 +753,6 @@ hv_nv_on_device_remove(struct hn_softc * } void -hn_nvs_sent_wakeup(struct hn_send_ctx *sndc __unused, - struct netvsc_dev_ *net_dev, struct vmbus_channel *chan __unused, - const struct nvsp_msg_ *msg, int dlen __unused) -{ - /* Copy the response back */ - memcpy(&net_dev->channel_init_packet, msg, sizeof(nvsp_msg)); - sema_post(&net_dev->channel_init_sema); -} - -static void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev __unused, struct vmbus_channel *chan __unused, const struct nvsp_msg_ *msg, int dlen) Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 15 05:07:02 2016 (r304110) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Mon Aug 15 05:08:41 2016 (r304111) @@ -46,9 +46,11 @@ __FBSDID("$FreeBSD$"); #include #include -#include "hv_net_vsc.h" -#include "hv_rndis.h" -#include "hv_rndis_filter.h" +#include +#include +#include +#include +#include struct hv_rf_recvinfo { const ndis_8021q_info *vlan_info; @@ -1060,12 +1062,16 @@ hv_rf_on_device_add(struct hn_softc *sc, int ret; netvsc_dev *net_dev; rndis_device *rndis_dev; - nvsp_msg *init_pkt; rndis_offload_params offloads; struct rndis_recv_scale_cap rsscaps; uint32_t rsscaps_size = sizeof(struct rndis_recv_scale_cap); netvsc_device_info *dev_info = (netvsc_device_info *)additl_info; device_t dev = sc->hn_dev; + struct hn_nvs_subch_req *req; + const struct hn_nvs_subch_resp *resp; + size_t resp_len; + struct vmbus_xact *xact; + uint32_t status, nsubch; rndis_dev = hv_get_rndis_device(); if (rndis_dev == NULL) { @@ -1153,36 +1159,65 @@ hv_rf_on_device_add(struct hn_softc *sc, goto out; } - /* request host to create sub channels */ - init_pkt = &net_dev->channel_init_packet; - memset(init_pkt, 0, sizeof(nvsp_msg)); - - init_pkt->hdr.msg_type = nvsp_msg5_type_subchannel; - init_pkt->msgs.vers_5_msgs.subchannel_request.op = - NVSP_SUBCHANNE_ALLOCATE; - init_pkt->msgs.vers_5_msgs.subchannel_request.num_subchannels = - net_dev->num_channel - 1; + /* + * Ask NVS to allocate sub-channels. + */ + xact = vmbus_xact_get(sc->hn_xact, sizeof(*req)); + if (xact == NULL) { + if_printf(sc->hn_ifp, "no xact for nvs subch req\n"); + ret = ENXIO; + goto out; + } + + req = vmbus_xact_req_data(xact); + req->nvs_type = HN_NVS_TYPE_SUBCH_REQ; + req->nvs_op = HN_NVS_SUBCH_OP_ALLOC; + req->nvs_nsubch = net_dev->num_channel - 1; + + hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); + vmbus_xact_activate(xact); - hn_send_ctx_init_simple(&sndc, hn_nvs_sent_wakeup, NULL); ret = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)&sndc); + req, sizeof(*req), (uint64_t)(uintptr_t)&sndc); if (ret != 0) { - device_printf(dev, "Fail to allocate subchannel\n"); + if_printf(sc->hn_ifp, "send nvs subch req failed: %d\n", ret); + vmbus_xact_deactivate(xact); + vmbus_xact_put(xact); goto out; } - sema_wait(&net_dev->channel_init_sema); - - if (init_pkt->msgs.vers_5_msgs.subchn_complete.status != - nvsp_status_success) { - ret = ENODEV; - device_printf(dev, "sub channel complete error\n"); + resp = vmbus_xact_wait(xact, &resp_len); + if (resp_len < sizeof(*resp)) { + if_printf(sc->hn_ifp, "invalid subch resp length %zu\n", + resp_len); + vmbus_xact_put(xact); + ret = EINVAL; + goto out; + } + if (resp->nvs_type != HN_NVS_TYPE_SUBCH_RESP) { + if_printf(sc->hn_ifp, "not subch resp, type %u\n", + resp->nvs_type); + vmbus_xact_put(xact); + ret = EINVAL; goto out; } - net_dev->num_channel = 1 + - init_pkt->msgs.vers_5_msgs.subchn_complete.num_subchannels; + status = resp->nvs_status; + nsubch = resp->nvs_nsubch; + vmbus_xact_put(xact); + + if (status != HN_NVS_STATUS_OK) { + if_printf(sc->hn_ifp, "subch req failed: %x\n", status); + ret = EIO; + goto out; + } + if (nsubch > net_dev->num_channel - 1) { + if_printf(sc->hn_ifp, "%u subchans are allocated, requested %u\n", + nsubch, net_dev->num_channel - 1); + nsubch = net_dev->num_channel - 1; + } + net_dev->num_channel = nsubch + 1; ret = hv_rf_set_rss_param(rndis_dev, net_dev->num_channel); Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Mon Aug 15 05:07:02 2016 (r304110) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Mon Aug 15 05:08:41 2016 (r304111) @@ -47,6 +47,8 @@ #define HN_NVS_TYPE_CHIM_CONNRESP 105 #define HN_NVS_TYPE_CHIM_DISCONN 106 #define HN_NVS_TYPE_NDIS_CONF 125 +#define HN_NVS_TYPE_SUBCH_REQ 133 +#define HN_NVS_TYPE_SUBCH_RESP 133 /* same as SUBCH_REQ */ /* * Any size less than this one will _not_ work, e.g. hn_nvs_init @@ -144,4 +146,20 @@ struct hn_nvs_chim_disconn { } __packed; CTASSERT(sizeof(struct hn_nvs_chim_disconn) >= HN_NVS_REQSIZE_MIN); +#define HN_NVS_SUBCH_OP_ALLOC 1 + +struct hn_nvs_subch_req { + uint32_t nvs_type; /* HN_NVS_TYPE_SUBCH_REQ */ + uint32_t nvs_op; /* HN_NVS_SUBCH_OP_ */ + uint32_t nvs_nsubch; + uint8_t nvs_rsvd[20]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_subch_req) >= HN_NVS_REQSIZE_MIN); + +struct hn_nvs_subch_resp { + uint32_t nvs_type; /* HN_NVS_TYPE_SUBCH_RESP */ + uint32_t nvs_status; /* HN_NVS_STATUS_ */ + uint32_t nvs_nsubch; +} __packed; + #endif /* !_IF_HNREG_H_ */ Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Aug 15 05:07:02 2016 (r304110) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Mon Aug 15 05:08:41 2016 (r304111) @@ -75,7 +75,7 @@ hn_send_ctx_init_simple(struct hn_send_c NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX, 0); } -void hn_nvs_sent_wakeup(struct hn_send_ctx *sndc, +void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, const struct nvsp_msg_ *msg, int dlen); void hn_chim_free(struct netvsc_dev_ *net_dev, uint32_t chim_idx); From owner-svn-src-all@freebsd.org Mon Aug 15 08:07:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35DC9BBA881; Mon, 15 Aug 2016 08:07:09 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E82F41D20; Mon, 15 Aug 2016 08:07:08 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F8783U037341; Mon, 15 Aug 2016 08:07:08 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F877Un037339; Mon, 15 Aug 2016 08:07:07 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201608150807.u7F877Un037339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 15 Aug 2016 08:07:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304112 - releng/11.0/sys/dev/virtio/network X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 08:07:09 -0000 Author: smh Date: Mon Aug 15 08:07:07 2016 New Revision: 304112 URL: https://svnweb.freebsd.org/changeset/base/304112 Log: MFS r304067: Fix vtnet hang with max_virtqueue_pairs > VTNET_MAX_QUEUE_PAIR Approved by: re (gjb) Sponsored by: Multiplay Modified: releng/11.0/sys/dev/virtio/network/if_vtnet.c releng/11.0/sys/dev/virtio/network/if_vtnetvar.h Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- releng/11.0/sys/dev/virtio/network/if_vtnet.c Mon Aug 15 05:08:41 2016 (r304111) +++ releng/11.0/sys/dev/virtio/network/if_vtnet.c Mon Aug 15 08:07:07 2016 (r304112) @@ -230,18 +230,32 @@ static void vtnet_disable_interrupts(str static int vtnet_tunable_int(struct vtnet_softc *, const char *, int); /* Tunables. */ +static SYSCTL_NODE(_hw, OID_AUTO, vtnet, CTLFLAG_RD, 0, "VNET driver parameters"); static int vtnet_csum_disable = 0; TUNABLE_INT("hw.vtnet.csum_disable", &vtnet_csum_disable); +SYSCTL_INT(_hw_vtnet, OID_AUTO, csum_disable, CTLFLAG_RDTUN, + &vtnet_csum_disable, 0, "Disables receive and send checksum offload"); static int vtnet_tso_disable = 0; TUNABLE_INT("hw.vtnet.tso_disable", &vtnet_tso_disable); +SYSCTL_INT(_hw_vtnet, OID_AUTO, tso_disable, CTLFLAG_RDTUN, &vtnet_tso_disable, + 0, "Disables TCP Segmentation Offload"); static int vtnet_lro_disable = 0; TUNABLE_INT("hw.vtnet.lro_disable", &vtnet_lro_disable); +SYSCTL_INT(_hw_vtnet, OID_AUTO, lro_disable, CTLFLAG_RDTUN, &vtnet_lro_disable, + 0, "Disables TCP Large Receive Offload"); static int vtnet_mq_disable = 0; TUNABLE_INT("hw.vtnet.mq_disable", &vtnet_mq_disable); -static int vtnet_mq_max_pairs = 0; +SYSCTL_INT(_hw_vtnet, OID_AUTO, mq_disable, CTLFLAG_RDTUN, &vtnet_mq_disable, + 0, "Disables Multi Queue support"); +static int vtnet_mq_max_pairs = VTNET_MAX_QUEUE_PAIRS; TUNABLE_INT("hw.vtnet.mq_max_pairs", &vtnet_mq_max_pairs); +SYSCTL_INT(_hw_vtnet, OID_AUTO, mq_max_pairs, CTLFLAG_RDTUN, + &vtnet_mq_max_pairs, 0, "Sets the maximum number of Multi Queue pairs"); static int vtnet_rx_process_limit = 512; TUNABLE_INT("hw.vtnet.rx_process_limit", &vtnet_rx_process_limit); +SYSCTL_INT(_hw_vtnet, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, + &vtnet_rx_process_limit, 0, + "Limits the number RX segments processed in a single pass"); static uma_zone_t vtnet_tx_header_zone; @@ -597,7 +611,6 @@ static void vtnet_setup_features(struct vtnet_softc *sc) { device_t dev; - int max_pairs, max; dev = sc->vtnet_dev; @@ -646,32 +659,31 @@ vtnet_setup_features(struct vtnet_softc if (virtio_with_feature(dev, VIRTIO_NET_F_MQ) && sc->vtnet_flags & VTNET_FLAG_CTRL_VQ) { - max_pairs = virtio_read_dev_config_2(dev, + sc->vtnet_max_vq_pairs = virtio_read_dev_config_2(dev, offsetof(struct virtio_net_config, max_virtqueue_pairs)); - if (max_pairs < VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN || - max_pairs > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX) - max_pairs = 1; } else - max_pairs = 1; + sc->vtnet_max_vq_pairs = 1; - if (max_pairs > 1) { + if (sc->vtnet_max_vq_pairs > 1) { /* - * Limit the maximum number of queue pairs to the number of - * CPUs or the configured maximum. The actual number of - * queues that get used may be less. + * Limit the maximum number of queue pairs to the lower of + * the number of CPUs and the configured maximum. + * The actual number of queues that get used may be less. */ + int max; + max = vtnet_tunable_int(sc, "mq_max_pairs", vtnet_mq_max_pairs); - if (max > 0 && max_pairs > max) - max_pairs = max; - if (max_pairs > mp_ncpus) - max_pairs = mp_ncpus; - if (max_pairs > VTNET_MAX_QUEUE_PAIRS) - max_pairs = VTNET_MAX_QUEUE_PAIRS; - if (max_pairs > 1) - sc->vtnet_flags |= VTNET_FLAG_MULTIQ; + if (max > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MIN) { + if (max > mp_ncpus) + max = mp_ncpus; + if (max > VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX) + max = VIRTIO_NET_CTRL_MQ_VQ_PAIRS_MAX; + if (max > 1) { + sc->vtnet_requested_vq_pairs = max; + sc->vtnet_flags |= VTNET_FLAG_MULTIQ; + } + } } - - sc->vtnet_max_vq_pairs = max_pairs; } static int @@ -2982,13 +2994,11 @@ vtnet_set_active_vq_pairs(struct vtnet_s dev = sc->vtnet_dev; if ((sc->vtnet_flags & VTNET_FLAG_MULTIQ) == 0) { - MPASS(sc->vtnet_max_vq_pairs == 1); sc->vtnet_act_vq_pairs = 1; return; } - /* BMV: Just use the maximum configured for now. */ - npairs = sc->vtnet_max_vq_pairs; + npairs = sc->vtnet_requested_vq_pairs; if (vtnet_ctrl_mq_cmd(sc, npairs) != 0) { device_printf(dev, @@ -3852,6 +3862,9 @@ vtnet_setup_sysctl(struct vtnet_softc *s SYSCTL_ADD_INT(ctx, child, OID_AUTO, "max_vq_pairs", CTLFLAG_RD, &sc->vtnet_max_vq_pairs, 0, "Maximum number of supported virtqueue pairs"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "requested_vq_pairs", + CTLFLAG_RD, &sc->vtnet_requested_vq_pairs, 0, + "Requested number of virtqueue pairs"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "act_vq_pairs", CTLFLAG_RD, &sc->vtnet_act_vq_pairs, 0, "Number of active virtqueue pairs"); Modified: releng/11.0/sys/dev/virtio/network/if_vtnetvar.h ============================================================================== --- releng/11.0/sys/dev/virtio/network/if_vtnetvar.h Mon Aug 15 05:08:41 2016 (r304111) +++ releng/11.0/sys/dev/virtio/network/if_vtnetvar.h Mon Aug 15 08:07:07 2016 (r304112) @@ -155,6 +155,7 @@ struct vtnet_softc { int vtnet_if_flags; int vtnet_act_vq_pairs; int vtnet_max_vq_pairs; + int vtnet_requested_vq_pairs; struct virtqueue *vtnet_ctrl_vq; struct vtnet_mac_filter *vtnet_mac_filter; From owner-svn-src-all@freebsd.org Mon Aug 15 08:20:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E72DBBACB2; Mon, 15 Aug 2016 08:20:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 316DD1456; Mon, 15 Aug 2016 08:20:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F8KcGi041519; Mon, 15 Aug 2016 08:20:38 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F8KcHS041518; Mon, 15 Aug 2016 08:20:38 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608150820.u7F8KcHS041518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 15 Aug 2016 08:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304113 - releng/11.0/usr.bin/truss X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 08:20:39 -0000 Author: bapt Date: Mon Aug 15 08:20:37 2016 New Revision: 304113 URL: https://svnweb.freebsd.org/changeset/base/304113 Log: MFC: r303685 truss: fix uninitialized trussinfo->curthread in add_threads()/enter_syscall trussinfo->curthread must be initialized before calling enter_syscall(), it is used by t->proc->abi->fetch_args(). Without that truss is segfaulting and the attached program also crash. Submitted by: Nikita Kozlov (nikita@gandi.net) Reviewed by: jhb Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D7399 Modified: releng/11.0/usr.bin/truss/setup.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/usr.bin/truss/setup.c ============================================================================== --- releng/11.0/usr.bin/truss/setup.c Mon Aug 15 08:07:07 2016 (r304112) +++ releng/11.0/usr.bin/truss/setup.c Mon Aug 15 08:20:37 2016 (r304113) @@ -223,8 +223,10 @@ add_threads(struct trussinfo *info, stru t = new_thread(p, lwps[i]); if (ptrace(PT_LWPINFO, lwps[i], (caddr_t)&pl, sizeof(pl)) == -1) err(1, "ptrace(PT_LWPINFO)"); - if (pl.pl_flags & PL_FLAG_SCE) + if (pl.pl_flags & PL_FLAG_SCE) { + info->curthread = t; enter_syscall(info, t, &pl); + } } free(lwps); } From owner-svn-src-all@freebsd.org Mon Aug 15 08:44:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA5C1BBA344; Mon, 15 Aug 2016 08:44:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5EE51EB1; Mon, 15 Aug 2016 08:44:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F8iMBY052545; Mon, 15 Aug 2016 08:44:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F8iMSS052544; Mon, 15 Aug 2016 08:44:22 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150844.u7F8iMSS052544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 08:44:22 +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: r304114 - stable/9/cddl/contrib/opensolaris/cmd/zdb 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 08:44:24 -0000 Author: avg Date: Mon Aug 15 08:44:22 2016 New Revision: 304114 URL: https://svnweb.freebsd.org/changeset/base/304114 Log: MFC r303084: 6391 Override default SPA config location via environment Note that there was a merge conflict because of an unmerged earlier change. Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: stable/9/cddl/contrib/opensolaris/cmd/zdb/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Aug 15 08:20:37 2016 (r304113) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Aug 15 08:44:22 2016 (r304114) @@ -3273,12 +3273,22 @@ main(int argc, char **argv) nvlist_t *policy = NULL; uint64_t max_txg = UINT64_MAX; int rewind = ZPOOL_NEVER_REWIND; + char *spa_config_path_env; (void) setrlimit(RLIMIT_NOFILE, &rl); (void) enable_extended_FILE_stdio(-1, -1); dprintf_setup(&argc, argv); + /* + * If there is an environment variable SPA_CONFIG_PATH it overrides + * default spa_config_path setting. If -U flag is specified it will + * override this environment variable settings once again. + */ + spa_config_path_env = getenv("SPA_CONFIG_PATH"); + if (spa_config_path_env != NULL) + spa_config_path = spa_config_path_env; + while ((c = getopt(argc, argv, "bcdhilmM:suCDRSAFLXevp:t:U:P")) != -1) { switch (c) { case 'b': From owner-svn-src-all@freebsd.org Mon Aug 15 08:44:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDEE6BBA396; Mon, 15 Aug 2016 08:44:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D2F61172; Mon, 15 Aug 2016 08:44:49 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F8imKG052607; Mon, 15 Aug 2016 08:44:48 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F8imER052606; Mon, 15 Aug 2016 08:44:48 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150844.u7F8imER052606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 08:44:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304115 - stable/10/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 08:44:49 -0000 Author: avg Date: Mon Aug 15 08:44:48 2016 New Revision: 304115 URL: https://svnweb.freebsd.org/changeset/base/304115 Log: MFC r303084: 6391 Override default SPA config location via environment Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Aug 15 08:44:22 2016 (r304114) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Aug 15 08:44:48 2016 (r304115) @@ -3559,12 +3559,22 @@ main(int argc, char **argv) nvlist_t *policy = NULL; uint64_t max_txg = UINT64_MAX; int rewind = ZPOOL_NEVER_REWIND; + char *spa_config_path_env; (void) setrlimit(RLIMIT_NOFILE, &rl); (void) enable_extended_FILE_stdio(-1, -1); dprintf_setup(&argc, argv); + /* + * If there is an environment variable SPA_CONFIG_PATH it overrides + * default spa_config_path setting. If -U flag is specified it will + * override this environment variable settings once again. + */ + spa_config_path_env = getenv("SPA_CONFIG_PATH"); + if (spa_config_path_env != NULL) + spa_config_path = spa_config_path_env; + while ((c = getopt(argc, argv, "bcdhilmMI:suCDRSAFLXx:evp:t:U:P")) != -1) { switch (c) { From owner-svn-src-all@freebsd.org Mon Aug 15 08:45:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26FE8BBA3EB; Mon, 15 Aug 2016 08:45:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB0D012D2; Mon, 15 Aug 2016 08:45:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F8jElB052685; Mon, 15 Aug 2016 08:45:14 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F8jEbg052684; Mon, 15 Aug 2016 08:45:14 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150845.u7F8jEbg052684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 08:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304116 - stable/11/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 08:45:15 -0000 Author: avg Date: Mon Aug 15 08:45:13 2016 New Revision: 304116 URL: https://svnweb.freebsd.org/changeset/base/304116 Log: MFC r303084: 6391 Override default SPA config location via environment Modified: stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Aug 15 08:44:48 2016 (r304115) +++ stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Aug 15 08:45:13 2016 (r304116) @@ -3558,12 +3558,22 @@ main(int argc, char **argv) nvlist_t *policy = NULL; uint64_t max_txg = UINT64_MAX; int rewind = ZPOOL_NEVER_REWIND; + char *spa_config_path_env; (void) setrlimit(RLIMIT_NOFILE, &rl); (void) enable_extended_FILE_stdio(-1, -1); dprintf_setup(&argc, argv); + /* + * If there is an environment variable SPA_CONFIG_PATH it overrides + * default spa_config_path setting. If -U flag is specified it will + * override this environment variable settings once again. + */ + spa_config_path_env = getenv("SPA_CONFIG_PATH"); + if (spa_config_path_env != NULL) + spa_config_path = spa_config_path_env; + while ((c = getopt(argc, argv, "bcdhilmMI:suCDRSAFLXx:evp:t:U:P")) != -1) { switch (c) { From owner-svn-src-all@freebsd.org Mon Aug 15 08:48:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72100BBA567; Mon, 15 Aug 2016 08:48:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29E3E14E3; Mon, 15 Aug 2016 08:48:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F8mXvs052903; Mon, 15 Aug 2016 08:48:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F8mXHj052901; Mon, 15 Aug 2016 08:48:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150848.u7F8mXHj052901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 08:48:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304117 - stable/11/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 08:48:34 -0000 Author: avg Date: Mon Aug 15 08:48:33 2016 New Revision: 304117 URL: https://svnweb.freebsd.org/changeset/base/304117 Log: MFC r303086: 7164 zdb should be able to open the root dataset Modified: stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Mon Aug 15 08:45:13 2016 (r304116) +++ stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Mon Aug 15 08:48:33 2016 (r304117) @@ -86,6 +86,17 @@ pool, and is inherently unstable. The precise output of most invocations is not documented, a knowledge of ZFS internals is assumed. .Pp +If the +.Ar dataset +argument does not contain any +.Sy / +or +.Sy @ +characters, it is interpreted as a pool name. +The root dataset can be specified as +.Pa pool Ns Sy / +(pool name followed by a slash). +.Pp When operating on an imported and active pool it is possible, though unlikely, that zdb may interpret inconsistent pool data and behave erratically. .Sh OPTIONS Modified: stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Aug 15 08:45:13 2016 (r304116) +++ stable/11/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Aug 15 08:48:33 2016 (r304117) @@ -3559,6 +3559,7 @@ main(int argc, char **argv) uint64_t max_txg = UINT64_MAX; int rewind = ZPOOL_NEVER_REWIND; char *spa_config_path_env; + boolean_t target_is_spa = B_TRUE; (void) setrlimit(RLIMIT_NOFILE, &rl); (void) enable_extended_FILE_stdio(-1, -1); @@ -3738,8 +3739,23 @@ main(int argc, char **argv) } } + if (strpbrk(target, "/@") != NULL) { + size_t targetlen; + + target_is_spa = B_FALSE; + /* + * Remove any trailing slash. Later code would get confused + * by it, but we want to allow it so that "pool/" can + * indicate that we want to dump the topmost filesystem, + * rather than the whole pool. + */ + targetlen = strlen(target); + if (targetlen != 0 && target[targetlen - 1] == '/') + target[targetlen - 1] = '\0'; + } + if (error == 0) { - if (strpbrk(target, "/@") == NULL || dump_opt['R']) { + if (target_is_spa || dump_opt['R']) { error = spa_open_rewind(target, &spa, FTAG, policy, NULL); if (error) { From owner-svn-src-all@freebsd.org Mon Aug 15 08:49:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6046ABBA5F2; Mon, 15 Aug 2016 08:49:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 154481662; Mon, 15 Aug 2016 08:49:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F8n8bF052977; Mon, 15 Aug 2016 08:49:08 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F8n81Z052975; Mon, 15 Aug 2016 08:49:08 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150849.u7F8n81Z052975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 08:49:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304118 - stable/10/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 08:49:09 -0000 Author: avg Date: Mon Aug 15 08:49:07 2016 New Revision: 304118 URL: https://svnweb.freebsd.org/changeset/base/304118 Log: MFC r303086: 7164 zdb should be able to open the root dataset Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Mon Aug 15 08:48:33 2016 (r304117) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Mon Aug 15 08:49:07 2016 (r304118) @@ -86,6 +86,17 @@ pool, and is inherently unstable. The precise output of most invocations is not documented, a knowledge of ZFS internals is assumed. .Pp +If the +.Ar dataset +argument does not contain any +.Sy / +or +.Sy @ +characters, it is interpreted as a pool name. +The root dataset can be specified as +.Pa pool Ns Sy / +(pool name followed by a slash). +.Pp When operating on an imported and active pool it is possible, though unlikely, that zdb may interpret inconsistent pool data and behave erratically. .Sh OPTIONS Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Aug 15 08:48:33 2016 (r304117) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Aug 15 08:49:07 2016 (r304118) @@ -3560,6 +3560,7 @@ main(int argc, char **argv) uint64_t max_txg = UINT64_MAX; int rewind = ZPOOL_NEVER_REWIND; char *spa_config_path_env; + boolean_t target_is_spa = B_TRUE; (void) setrlimit(RLIMIT_NOFILE, &rl); (void) enable_extended_FILE_stdio(-1, -1); @@ -3739,8 +3740,23 @@ main(int argc, char **argv) } } + if (strpbrk(target, "/@") != NULL) { + size_t targetlen; + + target_is_spa = B_FALSE; + /* + * Remove any trailing slash. Later code would get confused + * by it, but we want to allow it so that "pool/" can + * indicate that we want to dump the topmost filesystem, + * rather than the whole pool. + */ + targetlen = strlen(target); + if (targetlen != 0 && target[targetlen - 1] == '/') + target[targetlen - 1] = '\0'; + } + if (error == 0) { - if (strpbrk(target, "/@") == NULL || dump_opt['R']) { + if (target_is_spa || dump_opt['R']) { error = spa_open_rewind(target, &spa, FTAG, policy, NULL); if (error) { From owner-svn-src-all@freebsd.org Mon Aug 15 08:49:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F9F3BBA652; Mon, 15 Aug 2016 08:49:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1672A17C1; Mon, 15 Aug 2016 08:49:33 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F8nWvR053049; Mon, 15 Aug 2016 08:49:32 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F8nWIa053047; Mon, 15 Aug 2016 08:49:32 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150849.u7F8nWIa053047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 08:49:32 +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: r304119 - stable/9/cddl/contrib/opensolaris/cmd/zdb 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 08:49:33 -0000 Author: avg Date: Mon Aug 15 08:49:31 2016 New Revision: 304119 URL: https://svnweb.freebsd.org/changeset/base/304119 Log: MFC r303086: 7164 zdb should be able to open the root dataset Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: stable/9/cddl/contrib/opensolaris/cmd/zdb/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Mon Aug 15 08:49:07 2016 (r304118) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.8 Mon Aug 15 08:49:31 2016 (r304119) @@ -85,6 +85,17 @@ pool, and is inherently unstable. The precise output of most invocations is not documented, a knowledge of ZFS internals is assumed. .Pp +If the +.Ar dataset +argument does not contain any +.Sy / +or +.Sy @ +characters, it is interpreted as a pool name. +The root dataset can be specified as +.Pa pool Ns Sy / +(pool name followed by a slash). +.Pp When operating on an imported and active pool it is possible, though unlikely, that zdb may interpret inconsistent pool data and behave erratically. .Sh OPTIONS Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Aug 15 08:49:07 2016 (r304118) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Aug 15 08:49:31 2016 (r304119) @@ -3274,6 +3274,7 @@ main(int argc, char **argv) uint64_t max_txg = UINT64_MAX; int rewind = ZPOOL_NEVER_REWIND; char *spa_config_path_env; + boolean_t target_is_spa = B_TRUE; (void) setrlimit(RLIMIT_NOFILE, &rl); (void) enable_extended_FILE_stdio(-1, -1); @@ -3434,8 +3435,23 @@ main(int argc, char **argv) } } + if (strpbrk(target, "/@") != NULL) { + size_t targetlen; + + target_is_spa = B_FALSE; + /* + * Remove any trailing slash. Later code would get confused + * by it, but we want to allow it so that "pool/" can + * indicate that we want to dump the topmost filesystem, + * rather than the whole pool. + */ + targetlen = strlen(target); + if (targetlen != 0 && target[targetlen - 1] == '/') + target[targetlen - 1] = '\0'; + } + if (error == 0) { - if (strpbrk(target, "/@") == NULL || dump_opt['R']) { + if (target_is_spa || dump_opt['R']) { error = spa_open_rewind(target, &spa, FTAG, policy, NULL); if (error) { From owner-svn-src-all@freebsd.org Mon Aug 15 08:53:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D73EBBA813; Mon, 15 Aug 2016 08:53:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E00D1BEF; Mon, 15 Aug 2016 08:53:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F8rPK7056631; Mon, 15 Aug 2016 08:53:25 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F8rOq4056628; Mon, 15 Aug 2016 08:53:24 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150853.u7F8rOq4056628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 08:53:24 +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: r304120 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 08:53:26 -0000 Author: avg Date: Mon Aug 15 08:53:24 2016 New Revision: 304120 URL: https://svnweb.freebsd.org/changeset/base/304120 Log: MFC r302839: 6940 Cannot unlink directories when over quota Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 15 08:49:31 2016 (r304119) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 15 08:53:24 2016 (r304120) @@ -2360,6 +2360,7 @@ top: dmu_tx_hold_zap(tx, zfsvfs->z_unlinkedobj, FALSE, NULL); zfs_sa_upgrade_txholds(tx, zp); zfs_sa_upgrade_txholds(tx, dzp); + dmu_tx_mark_netfree(tx); error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT); if (error) { rw_exit(&zp->z_parent_lock); From owner-svn-src-all@freebsd.org Mon Aug 15 08:53:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9743FBBA845; Mon, 15 Aug 2016 08:53:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BA981C53; Mon, 15 Aug 2016 08:53:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F8rURZ056686; Mon, 15 Aug 2016 08:53:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F8rUmK056685; Mon, 15 Aug 2016 08:53:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150853.u7F8rUmK056685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 08:53:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304121 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 08:53:31 -0000 Author: avg Date: Mon Aug 15 08:53:30 2016 New Revision: 304121 URL: https://svnweb.freebsd.org/changeset/base/304121 Log: MFC r302839: 6940 Cannot unlink directories when over quota Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 15 08:53:24 2016 (r304120) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 15 08:53:30 2016 (r304121) @@ -2438,6 +2438,7 @@ top: dmu_tx_hold_zap(tx, zfsvfs->z_unlinkedobj, FALSE, NULL); zfs_sa_upgrade_txholds(tx, zp); zfs_sa_upgrade_txholds(tx, dzp); + dmu_tx_mark_netfree(tx); error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT); if (error) { rw_exit(&zp->z_parent_lock); From owner-svn-src-all@freebsd.org Mon Aug 15 08:54:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74803BBA8F0; Mon, 15 Aug 2016 08:54:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4513A1EA3; Mon, 15 Aug 2016 08:54:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F8s9W6056774; Mon, 15 Aug 2016 08:54:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F8s9S6056773; Mon, 15 Aug 2016 08:54:09 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150854.u7F8s9S6056773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 08:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304122 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 08:54:10 -0000 Author: avg Date: Mon Aug 15 08:54:09 2016 New Revision: 304122 URL: https://svnweb.freebsd.org/changeset/base/304122 Log: MFC r302839: 6940 Cannot unlink directories when over quota Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 15 08:53:30 2016 (r304121) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 15 08:54:09 2016 (r304122) @@ -2244,6 +2244,7 @@ zfs_rmdir(vnode_t *dvp, vnode_t *vp, cha dmu_tx_hold_zap(tx, zfsvfs->z_unlinkedobj, FALSE, NULL); zfs_sa_upgrade_txholds(tx, zp); zfs_sa_upgrade_txholds(tx, dzp); + dmu_tx_mark_netfree(tx); error = dmu_tx_assign(tx, TXG_WAIT); if (error) { dmu_tx_abort(tx); From owner-svn-src-all@freebsd.org Mon Aug 15 08:56:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2934BBA958; Mon, 15 Aug 2016 08:56:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B42D81190; Mon, 15 Aug 2016 08:56:26 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F8uPvP056989; Mon, 15 Aug 2016 08:56:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F8uPTf056985; Mon, 15 Aug 2016 08:56:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608150856.u7F8uPTf056985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Aug 2016 08:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304123 - in stable/11/sys: dev/mlx5/mlx5_en modules/mlx5en X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 08:56:27 -0000 Author: hselasky Date: Mon Aug 15 08:56:25 2016 New Revision: 304123 URL: https://svnweb.freebsd.org/changeset/base/304123 Log: MFC r303837: Switch to the new block based LRO input function for the mlx5en driver. This change significantly increases the overall RX aggregation ratio for heavily loaded networks handling 10-80 thousand simultaneous connections. Remove the turbo LRO code and all references to it which has now been superceeded by the tcp_lro_queue_mbuf() function. Tested by: Netflix Sponsored by: Mellanox Technologies Deleted: stable/11/sys/dev/mlx5/mlx5_en/tcp_tlro.c stable/11/sys/dev/mlx5/mlx5_en/tcp_tlro.h Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c stable/11/sys/modules/mlx5en/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Mon Aug 15 08:54:09 2016 (r304122) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Mon Aug 15 08:56:25 2016 (r304123) @@ -59,10 +59,6 @@ #include -#ifdef HAVE_TURBO_LRO -#include "tcp_tlro.h" -#endif - #include #include #include @@ -460,11 +456,7 @@ struct mlx5e_rq { struct ifnet *ifp; struct mlx5e_rq_stats stats; struct mlx5e_cq cq; -#ifdef HAVE_TURBO_LRO - struct tlro_ctrl lro; -#else struct lro_ctrl lro; -#endif volatile int enabled; int ix; Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Aug 15 08:54:09 2016 (r304122) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Aug 15 08:56:25 2016 (r304123) @@ -666,10 +666,15 @@ mlx5e_create_rq(struct mlx5e_channel *c, } wq_sz = mlx5_wq_ll_get_size(&rq->wq); + + err = -tcp_lro_init_args(&rq->lro, c->ifp, TCP_LRO_ENTRIES, wq_sz); + if (err) + goto err_rq_wq_destroy; + rq->mbuf = malloc(wq_sz * sizeof(rq->mbuf[0]), M_MLX5EN, M_WAITOK | M_ZERO); if (rq->mbuf == NULL) { err = -ENOMEM; - goto err_rq_wq_destroy; + goto err_lro_init; } for (i = 0; i != wq_sz; i++) { struct mlx5e_rx_wqe *wqe = mlx5_wq_ll_get_wqe(&rq->wq, i); @@ -694,20 +699,12 @@ mlx5e_create_rq(struct mlx5e_channel *c, mlx5e_create_stats(&rq->stats.ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), buffer, mlx5e_rq_stats_desc, MLX5E_RQ_STATS_NUM, rq->stats.arg); - -#ifdef HAVE_TURBO_LRO - if (tcp_tlro_init(&rq->lro, c->ifp, MLX5E_BUDGET_MAX) != 0) - rq->lro.mbuf = NULL; -#else - if (tcp_lro_init(&rq->lro)) - rq->lro.lro_cnt = 0; - else - rq->lro.ifp = c->ifp; -#endif return (0); err_rq_mbuf_free: free(rq->mbuf, M_MLX5EN); +err_lro_init: + tcp_lro_free(&rq->lro); err_rq_wq_destroy: mlx5_wq_destroy(&rq->wq_ctrl); err_free_dma_tag: @@ -726,11 +723,8 @@ mlx5e_destroy_rq(struct mlx5e_rq *rq) sysctl_ctx_free(&rq->stats.ctx); /* free leftover LRO packets, if any */ -#ifdef HAVE_TURBO_LRO - tcp_tlro_free(&rq->lro); -#else tcp_lro_free(&rq->lro); -#endif + wq_sz = mlx5_wq_ll_get_size(&rq->wq); for (i = 0; i != wq_sz; i++) { if (rq->mbuf[i].mbuf != NULL) { Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Aug 15 08:54:09 2016 (r304122) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Aug 15 08:56:25 2016 (r304123) @@ -369,15 +369,9 @@ mlx5e_poll_rx_cq(struct mlx5e_rq *rq, in mlx5e_build_rx_mbuf(cqe, rq, mb, byte_cnt); rq->stats.packets++; -#ifdef HAVE_TURBO_LRO - if (mb->m_pkthdr.csum_flags == 0 || - (rq->ifp->if_capenable & IFCAP_LRO) == 0 || - rq->lro.mbuf == NULL) { - /* normal input */ - rq->ifp->if_input(rq->ifp, mb); - } else { - tcp_tlro_rx(&rq->lro, mb); - } + +#if !defined(HAVE_TCP_LRO_RX) + tcp_lro_queue_mbuf(&rq->lro, mb); #else if (mb->m_pkthdr.csum_flags == 0 || (rq->ifp->if_capenable & IFCAP_LRO) == 0 || @@ -395,9 +389,6 @@ wq_ll_pop: /* ensure cq space is freed before enabling more cqes */ wmb(); -#ifndef HAVE_TURBO_LRO - tcp_lro_flush_all(&rq->lro); -#endif return (i); } @@ -437,8 +428,6 @@ mlx5e_rx_cq_comp(struct mlx5_core_cq *mc } mlx5e_post_rx_wqes(rq); mlx5e_cq_arm(&rq->cq); -#ifdef HAVE_TURBO_LRO - tcp_tlro_flush(&rq->lro, 1); -#endif + tcp_lro_flush_all(&rq->lro); mtx_unlock(&rq->mtx); } Modified: stable/11/sys/modules/mlx5en/Makefile ============================================================================== --- stable/11/sys/modules/mlx5en/Makefile Mon Aug 15 08:54:09 2016 (r304122) +++ stable/11/sys/modules/mlx5en/Makefile Mon Aug 15 08:56:25 2016 (r304123) @@ -12,15 +12,14 @@ mlx5_en_txrx.c \ device_if.h bus_if.h vnode_if.h pci_if.h \ opt_inet.h opt_inet6.h opt_rss.h -.if defined(HAVE_TURBO_LRO) -CFLAGS+= -DHAVE_TURBO_LRO -SRCS+= tcp_tlro.c -.endif - .if defined(HAVE_PER_CQ_EVENT_PACKET) CFLAGS+= -DHAVE_PER_CQ_EVENT_PACKET .endif +.if defined(HAVE_TCP_LRO_RX) +CFLAGS+= -DHAVE_TCP_LRO_RX +.endif + CFLAGS+= -I${.CURDIR}/../../ofed/include CFLAGS+= -I${.CURDIR}/../../compat/linuxkpi/common/include From owner-svn-src-all@freebsd.org Mon Aug 15 08:58:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6199EBBAAE2; Mon, 15 Aug 2016 08:58:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DB0113C6; Mon, 15 Aug 2016 08:58:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F8wtah057141; Mon, 15 Aug 2016 08:58:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F8wton057140; Mon, 15 Aug 2016 08:58:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608150858.u7F8wton057140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Aug 2016 08:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304124 - stable/11/sys/dev/usb/input X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 08:58:56 -0000 Author: hselasky Date: Mon Aug 15 08:58:55 2016 New Revision: 304124 URL: https://svnweb.freebsd.org/changeset/base/304124 Log: MFC r303765: Keep a reference count on USB keyboard polling to allow recursive cngrab() during a panic for example, similar to what the AT-keyboard driver is doing. Found by: Bruce Evans Modified: stable/11/sys/dev/usb/input/ukbd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/11/sys/dev/usb/input/ukbd.c Mon Aug 15 08:56:25 2016 (r304123) +++ stable/11/sys/dev/usb/input/ukbd.c Mon Aug 15 08:58:55 2016 (r304124) @@ -198,6 +198,7 @@ struct ukbd_softc { int sc_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ int sc_state; /* shift/lock key state */ int sc_accents; /* accent key index (> 0) */ + int sc_polling; /* polling recursion count */ int sc_led_size; int sc_kbd_size; @@ -1983,7 +1984,16 @@ ukbd_poll(keyboard_t *kbd, int on) struct ukbd_softc *sc = kbd->kb_data; UKBD_LOCK(); - if (on) { + /* + * Keep a reference count on polling to allow recursive + * cngrab() during a panic for example. + */ + if (on) + sc->sc_polling++; + else + sc->sc_polling--; + + if (sc->sc_polling != 0) { sc->sc_flags |= UKBD_FLAG_POLLING; sc->sc_poll_thread = curthread; } else { From owner-svn-src-all@freebsd.org Mon Aug 15 09:00:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82CF0BBADCB; Mon, 15 Aug 2016 09:00:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 525B515FC; Mon, 15 Aug 2016 09:00:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F90kft057320; Mon, 15 Aug 2016 09:00:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F90kn4057319; Mon, 15 Aug 2016 09:00:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608150900.u7F90kn4057319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Aug 2016 09:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304125 - stable/10/sys/dev/usb/input X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:00:47 -0000 Author: hselasky Date: Mon Aug 15 09:00:46 2016 New Revision: 304125 URL: https://svnweb.freebsd.org/changeset/base/304125 Log: MFC r303765: Keep a reference count on USB keyboard polling to allow recursive cngrab() during a panic for example, similar to what the AT-keyboard driver is doing. Found by: Bruce Evans Modified: stable/10/sys/dev/usb/input/ukbd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/10/sys/dev/usb/input/ukbd.c Mon Aug 15 08:58:55 2016 (r304124) +++ stable/10/sys/dev/usb/input/ukbd.c Mon Aug 15 09:00:46 2016 (r304125) @@ -201,6 +201,7 @@ struct ukbd_softc { int sc_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ int sc_state; /* shift/lock key state */ int sc_accents; /* accent key index (> 0) */ + int sc_polling; /* polling recursion count */ int sc_led_size; int sc_kbd_size; @@ -1986,7 +1987,16 @@ ukbd_poll(keyboard_t *kbd, int on) struct ukbd_softc *sc = kbd->kb_data; UKBD_LOCK(); - if (on) { + /* + * Keep a reference count on polling to allow recursive + * cngrab() during a panic for example. + */ + if (on) + sc->sc_polling++; + else + sc->sc_polling--; + + if (sc->sc_polling != 0) { sc->sc_flags |= UKBD_FLAG_POLLING; sc->sc_poll_thread = curthread; } else { From owner-svn-src-all@freebsd.org Mon Aug 15 09:01:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53092BBAE56; Mon, 15 Aug 2016 09:01:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B53A1982; Mon, 15 Aug 2016 09:01:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F91UJh060162; Mon, 15 Aug 2016 09:01:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F91Ugu060161; Mon, 15 Aug 2016 09:01:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150901.u7F91Ugu060161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 09:01:30 +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: r304126 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:01:31 -0000 Author: avg Date: Mon Aug 15 09:01:30 2016 New Revision: 304126 URL: https://svnweb.freebsd.org/changeset/base/304126 Log: MFC r302840: 6878 Add scrub completion info to "zpool history" Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Aug 15 09:00:46 2016 (r304125) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Aug 15 09:01:30 2016 (r304126) @@ -56,7 +56,8 @@ static scan_cb_t dsl_scan_defrag_cb; static scan_cb_t dsl_scan_scrub_cb; static scan_cb_t dsl_scan_remove_cb; static void dsl_scan_cancel_sync(void *, dmu_tx_t *); -static void dsl_scan_sync_state(dsl_scan_t *, dmu_tx_t *tx); +static void dsl_scan_sync_state(dsl_scan_t *, dmu_tx_t *); +static boolean_t dsl_scan_restarting(dsl_scan_t *, dmu_tx_t *); unsigned int zfs_top_maxinflight = 32; /* maximum I/Os per top-level */ unsigned int zfs_resilver_delay = 2; /* number of ticks to delay resilver */ @@ -316,8 +317,15 @@ dsl_scan_done(dsl_scan_t *scn, boolean_t else scn->scn_phys.scn_state = DSS_CANCELED; - spa_history_log_internal(spa, "scan done", tx, - "complete=%u", complete); + if (dsl_scan_restarting(scn, tx)) + spa_history_log_internal(spa, "scan aborted, restarting", tx, + "errors=%llu", spa_get_errlog_size(spa)); + else if (!complete) + spa_history_log_internal(spa, "scan cancelled", tx, + "errors=%llu", spa_get_errlog_size(spa)); + else + spa_history_log_internal(spa, "scan done", tx, + "errors=%llu", spa_get_errlog_size(spa)); if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) { mutex_enter(&spa->spa_scrub_lock); @@ -1411,8 +1419,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * * that we can restart an old-style scan while the pool is being * imported (see dsl_scan_init). */ - if (scn->scn_restart_txg != 0 && - scn->scn_restart_txg <= tx->tx_txg) { + if (dsl_scan_restarting(scn, tx)) { pool_scan_func_t func = POOL_SCAN_SCRUB; dsl_scan_done(scn, B_FALSE, tx); if (vdev_resilver_needed(spa->spa_root_vdev, NULL, NULL)) @@ -1764,3 +1771,10 @@ dsl_scan(dsl_pool_t *dp, pool_scan_func_ return (dsl_sync_task(spa_name(spa), dsl_scan_setup_check, dsl_scan_setup_sync, &func, 0)); } + +static boolean_t +dsl_scan_restarting(dsl_scan_t *scn, dmu_tx_t *tx) +{ + return (scn->scn_restart_txg != 0 && + scn->scn_restart_txg <= tx->tx_txg); +} From owner-svn-src-all@freebsd.org Mon Aug 15 09:02:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0123DBBAEC9; Mon, 15 Aug 2016 09:02:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABFB91B99; Mon, 15 Aug 2016 09:02:00 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F91xGJ060828; Mon, 15 Aug 2016 09:01:59 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F91xo2060827; Mon, 15 Aug 2016 09:01:59 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150901.u7F91xo2060827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 09:01:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304127 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:02:01 -0000 Author: avg Date: Mon Aug 15 09:01:59 2016 New Revision: 304127 URL: https://svnweb.freebsd.org/changeset/base/304127 Log: MFC r302840: 6878 Add scrub completion info to "zpool history" Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Aug 15 09:01:30 2016 (r304126) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Aug 15 09:01:59 2016 (r304127) @@ -56,7 +56,8 @@ typedef int (scan_cb_t)(dsl_pool_t *, co static scan_cb_t dsl_scan_scrub_cb; static void dsl_scan_cancel_sync(void *, dmu_tx_t *); -static void dsl_scan_sync_state(dsl_scan_t *, dmu_tx_t *tx); +static void dsl_scan_sync_state(dsl_scan_t *, dmu_tx_t *); +static boolean_t dsl_scan_restarting(dsl_scan_t *, dmu_tx_t *); unsigned int zfs_top_maxinflight = 32; /* maximum I/Os per top-level */ unsigned int zfs_resilver_delay = 2; /* number of ticks to delay resilver */ @@ -320,8 +321,15 @@ dsl_scan_done(dsl_scan_t *scn, boolean_t else scn->scn_phys.scn_state = DSS_CANCELED; - spa_history_log_internal(spa, "scan done", tx, - "complete=%u", complete); + if (dsl_scan_restarting(scn, tx)) + spa_history_log_internal(spa, "scan aborted, restarting", tx, + "errors=%llu", spa_get_errlog_size(spa)); + else if (!complete) + spa_history_log_internal(spa, "scan cancelled", tx, + "errors=%llu", spa_get_errlog_size(spa)); + else + spa_history_log_internal(spa, "scan done", tx, + "errors=%llu", spa_get_errlog_size(spa)); if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) { mutex_enter(&spa->spa_scrub_lock); @@ -1476,8 +1484,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * * that we can restart an old-style scan while the pool is being * imported (see dsl_scan_init). */ - if (scn->scn_restart_txg != 0 && - scn->scn_restart_txg <= tx->tx_txg) { + if (dsl_scan_restarting(scn, tx)) { pool_scan_func_t func = POOL_SCAN_SCRUB; dsl_scan_done(scn, B_FALSE, tx); if (vdev_resilver_needed(spa->spa_root_vdev, NULL, NULL)) @@ -1904,3 +1911,10 @@ dsl_scan(dsl_pool_t *dp, pool_scan_func_ return (dsl_sync_task(spa_name(spa), dsl_scan_setup_check, dsl_scan_setup_sync, &func, 0, ZFS_SPACE_CHECK_NONE)); } + +static boolean_t +dsl_scan_restarting(dsl_scan_t *scn, dmu_tx_t *tx) +{ + return (scn->scn_restart_txg != 0 && + scn->scn_restart_txg <= tx->tx_txg); +} From owner-svn-src-all@freebsd.org Mon Aug 15 09:02:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4263FBBAF10; Mon, 15 Aug 2016 09:02:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEBCF1CF0; Mon, 15 Aug 2016 09:02:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F92At5060882; Mon, 15 Aug 2016 09:02:10 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F92ALO060881; Mon, 15 Aug 2016 09:02:10 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150902.u7F92ALO060881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 09:02:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304128 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:02:11 -0000 Author: avg Date: Mon Aug 15 09:02:09 2016 New Revision: 304128 URL: https://svnweb.freebsd.org/changeset/base/304128 Log: MFC r302840: 6878 Add scrub completion info to "zpool history" Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Aug 15 09:01:59 2016 (r304127) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Aug 15 09:02:09 2016 (r304128) @@ -56,7 +56,8 @@ typedef int (scan_cb_t)(dsl_pool_t *, co static scan_cb_t dsl_scan_scrub_cb; static void dsl_scan_cancel_sync(void *, dmu_tx_t *); -static void dsl_scan_sync_state(dsl_scan_t *, dmu_tx_t *tx); +static void dsl_scan_sync_state(dsl_scan_t *, dmu_tx_t *); +static boolean_t dsl_scan_restarting(dsl_scan_t *, dmu_tx_t *); unsigned int zfs_top_maxinflight = 32; /* maximum I/Os per top-level */ unsigned int zfs_resilver_delay = 2; /* number of ticks to delay resilver */ @@ -329,8 +330,15 @@ dsl_scan_done(dsl_scan_t *scn, boolean_t else scn->scn_phys.scn_state = DSS_CANCELED; - spa_history_log_internal(spa, "scan done", tx, - "complete=%u", complete); + if (dsl_scan_restarting(scn, tx)) + spa_history_log_internal(spa, "scan aborted, restarting", tx, + "errors=%llu", spa_get_errlog_size(spa)); + else if (!complete) + spa_history_log_internal(spa, "scan cancelled", tx, + "errors=%llu", spa_get_errlog_size(spa)); + else + spa_history_log_internal(spa, "scan done", tx, + "errors=%llu", spa_get_errlog_size(spa)); if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) { mutex_enter(&spa->spa_scrub_lock); @@ -1485,8 +1493,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * * that we can restart an old-style scan while the pool is being * imported (see dsl_scan_init). */ - if (scn->scn_restart_txg != 0 && - scn->scn_restart_txg <= tx->tx_txg) { + if (dsl_scan_restarting(scn, tx)) { pool_scan_func_t func = POOL_SCAN_SCRUB; dsl_scan_done(scn, B_FALSE, tx); if (vdev_resilver_needed(spa->spa_root_vdev, NULL, NULL)) @@ -1913,3 +1920,10 @@ dsl_scan(dsl_pool_t *dp, pool_scan_func_ return (dsl_sync_task(spa_name(spa), dsl_scan_setup_check, dsl_scan_setup_sync, &func, 0, ZFS_SPACE_CHECK_NONE)); } + +static boolean_t +dsl_scan_restarting(dsl_scan_t *scn, dmu_tx_t *tx) +{ + return (scn->scn_restart_txg != 0 && + scn->scn_restart_txg <= tx->tx_txg); +} From owner-svn-src-all@freebsd.org Mon Aug 15 09:03:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6128BBA075; Mon, 15 Aug 2016 09:03:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 986931EAD; Mon, 15 Aug 2016 09:03:06 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F935UK060995; Mon, 15 Aug 2016 09:03:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F935UF060994; Mon, 15 Aug 2016 09:03:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608150903.u7F935UF060994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Aug 2016 09:03: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: r304129 - stable/9/sys/dev/usb/input 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:03:06 -0000 Author: hselasky Date: Mon Aug 15 09:03:05 2016 New Revision: 304129 URL: https://svnweb.freebsd.org/changeset/base/304129 Log: MFC r303765: Keep a reference count on USB keyboard polling to allow recursive cngrab() during a panic for example, similar to what the AT-keyboard driver is doing. Found by: Bruce Evans Modified: stable/9/sys/dev/usb/input/ukbd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/input/ukbd.c ============================================================================== --- stable/9/sys/dev/usb/input/ukbd.c Mon Aug 15 09:02:09 2016 (r304128) +++ stable/9/sys/dev/usb/input/ukbd.c Mon Aug 15 09:03:05 2016 (r304129) @@ -197,6 +197,7 @@ struct ukbd_softc { int sc_mode; /* input mode (K_XLATE,K_RAW,K_CODE) */ int sc_state; /* shift/lock key state */ int sc_accents; /* accent key index (> 0) */ + int sc_polling; /* polling recursion count */ int sc_led_size; int sc_kbd_size; @@ -1967,7 +1968,16 @@ ukbd_poll(keyboard_t *kbd, int on) struct ukbd_softc *sc = kbd->kb_data; UKBD_LOCK(); - if (on) { + /* + * Keep a reference count on polling to allow recursive + * cngrab() during a panic for example. + */ + if (on) + sc->sc_polling++; + else + sc->sc_polling--; + + if (sc->sc_polling != 0) { sc->sc_flags |= UKBD_FLAG_POLLING; sc->sc_poll_thread = curthread; } else { From owner-svn-src-all@freebsd.org Mon Aug 15 09:04:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B29B6BBA1AC; Mon, 15 Aug 2016 09:04:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 809E511B2; Mon, 15 Aug 2016 09:04:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F94DIL061121; Mon, 15 Aug 2016 09:04:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F94DSK061120; Mon, 15 Aug 2016 09:04:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150904.u7F94DSK061120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 09:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304130 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:04:14 -0000 Author: avg Date: Mon Aug 15 09:04:13 2016 New Revision: 304130 URL: https://svnweb.freebsd.org/changeset/base/304130 Log: MFC r302835: fix-up for configuration of AMD Family 10h processors borrowed from Linux Modified: stable/11/sys/amd64/amd64/initcpu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/11/sys/amd64/amd64/initcpu.c Mon Aug 15 09:03:05 2016 (r304129) +++ stable/11/sys/amd64/amd64/initcpu.c Mon Aug 15 09:04:13 2016 (r304130) @@ -94,6 +94,20 @@ init_amd(void) wrmsr(MSR_NB_CFG1, msr); } } + + /* + * BIOS may configure Family 10h processors to convert WC+ cache type + * to CD. That can hurt performance of guest VMs using nested paging. + * The relevant MSR bit is not documented in the BKDG, + * the fix is borrowed from Linux. + */ + if (CPUID_TO_FAMILY(cpu_id) == 0x10) { + if ((cpu_feature2 & CPUID2_HV) == 0) { + msr = rdmsr(0xc001102a); + msr &= ~((uint64_t)1 << 24); + wrmsr(0xc001102a, msr); + } + } } /* From owner-svn-src-all@freebsd.org Mon Aug 15 09:04:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40E6EBBA1F0; Mon, 15 Aug 2016 09:04:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1394D1311; Mon, 15 Aug 2016 09:04:32 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F94VnU061179; Mon, 15 Aug 2016 09:04:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F94VdC061178; Mon, 15 Aug 2016 09:04:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150904.u7F94VdC061178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 09:04:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304131 - stable/10/sys/amd64/amd64 X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:04:32 -0000 Author: avg Date: Mon Aug 15 09:04:31 2016 New Revision: 304131 URL: https://svnweb.freebsd.org/changeset/base/304131 Log: MFC r302835: fix-up for configuration of AMD Family 10h processors borrowed from Linux Modified: stable/10/sys/amd64/amd64/initcpu.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/10/sys/amd64/amd64/initcpu.c Mon Aug 15 09:04:13 2016 (r304130) +++ stable/10/sys/amd64/amd64/initcpu.c Mon Aug 15 09:04:31 2016 (r304131) @@ -125,6 +125,20 @@ init_amd(void) wrmsr(MSR_NB_CFG1, msr); } } + + /* + * BIOS may configure Family 10h processors to convert WC+ cache type + * to CD. That can hurt performance of guest VMs using nested paging. + * The relevant MSR bit is not documented in the BKDG, + * the fix is borrowed from Linux. + */ + if (CPUID_TO_FAMILY(cpu_id) == 0x10) { + if ((cpu_feature2 & CPUID2_HV) == 0) { + msr = rdmsr(0xc001102a); + msr &= ~((uint64_t)1 << 24); + wrmsr(0xc001102a, msr); + } + } } /* From owner-svn-src-all@freebsd.org Mon Aug 15 09:06:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0E72BBA286; Mon, 15 Aug 2016 09:06:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71AAE14E4; Mon, 15 Aug 2016 09:06:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F96XsF061340; Mon, 15 Aug 2016 09:06:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F96Xht061339; Mon, 15 Aug 2016 09:06:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150906.u7F96Xht061339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 09:06:33 +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: r304132 - stable/9/sys/amd64/amd64 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:06:34 -0000 Author: avg Date: Mon Aug 15 09:06:33 2016 New Revision: 304132 URL: https://svnweb.freebsd.org/changeset/base/304132 Log: MFC r302835: fix-up for configuration of AMD Family 10h processors borrowed from Linux Modified: stable/9/sys/amd64/amd64/initcpu.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/initcpu.c ============================================================================== --- stable/9/sys/amd64/amd64/initcpu.c Mon Aug 15 09:04:31 2016 (r304131) +++ stable/9/sys/amd64/amd64/initcpu.c Mon Aug 15 09:06:33 2016 (r304132) @@ -120,6 +120,20 @@ init_amd(void) wrmsr(MSR_NB_CFG1, msr); } } + + /* + * BIOS may configure Family 10h processors to convert WC+ cache type + * to CD. That can hurt performance of guest VMs using nested paging. + * The relevant MSR bit is not documented in the BKDG, + * the fix is borrowed from Linux. + */ + if (CPUID_TO_FAMILY(cpu_id) == 0x10) { + if ((cpu_feature2 & CPUID2_HV) == 0) { + msr = rdmsr(0xc001102a); + msr &= ~((uint64_t)1 << 24); + wrmsr(0xc001102a, msr); + } + } } /* From owner-svn-src-all@freebsd.org Mon Aug 15 09:07:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FCD4BBA3BC; Mon, 15 Aug 2016 09:07:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F6021690; Mon, 15 Aug 2016 09:07:27 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F97Qgg061423; Mon, 15 Aug 2016 09:07:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F97Q5E061422; Mon, 15 Aug 2016 09:07:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608150907.u7F97Q5E061422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Aug 2016 09:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304133 - stable/11/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:07:27 -0000 Author: hselasky Date: Mon Aug 15 09:07:26 2016 New Revision: 304133 URL: https://svnweb.freebsd.org/changeset/base/304133 Log: MFC r303870: Fix for use after free. Clear the device description to avoid use after free because the bsddev is not destroyed when the mlx5en module is unloaded. Only when the parent mlx5 module is unloaded the bsddev is destroyed. This fixes a panic on listing sysctls which refer strings in the bsddev after the mlx5en module has been unloaded. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Aug 15 09:06:33 2016 (r304132) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Aug 15 09:07:26 2016 (r304133) @@ -3108,6 +3108,13 @@ mlx5e_destroy_ifp(struct mlx5_core_dev * /* don't allow more IOCTLs */ priv->gone = 1; + /* + * Clear the device description to avoid use after free, + * because the bsddev is not destroyed when this module is + * unloaded: + */ + device_set_desc(mdev->pdev->dev.bsddev, NULL); + /* XXX wait a bit to allow IOCTL handlers to complete */ pause("W", hz); From owner-svn-src-all@freebsd.org Mon Aug 15 09:09:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E29B2BBA43B; Mon, 15 Aug 2016 09:09:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B23D41833; Mon, 15 Aug 2016 09:09:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F991uw061547; Mon, 15 Aug 2016 09:09:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F991Yk061546; Mon, 15 Aug 2016 09:09:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608150909.u7F991Yk061546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 15 Aug 2016 09:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304134 - stable/10/sys/dev/mlx5/mlx5_en X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:09:03 -0000 Author: hselasky Date: Mon Aug 15 09:09:01 2016 New Revision: 304134 URL: https://svnweb.freebsd.org/changeset/base/304134 Log: MFC r303870: Fix for use after free. Clear the device description to avoid use after free because the bsddev is not destroyed when the mlx5en module is unloaded. Only when the parent mlx5 module is unloaded the bsddev is destroyed. This fixes a panic on listing sysctls which refer strings in the bsddev after the mlx5en module has been unloaded. Sponsored by: Mellanox Technologies Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Aug 15 09:07:26 2016 (r304133) +++ stable/10/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Aug 15 09:09:01 2016 (r304134) @@ -3114,6 +3114,13 @@ mlx5e_destroy_ifp(struct mlx5_core_dev * /* don't allow more IOCTLs */ priv->gone = 1; + /* + * Clear the device description to avoid use after free, + * because the bsddev is not destroyed when this module is + * unloaded: + */ + device_set_desc(mdev->pdev->dev.bsddev, NULL); + /* XXX wait a bit to allow IOCTL handlers to complete */ pause("W", hz); From owner-svn-src-all@freebsd.org Mon Aug 15 09:12:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8D39BBA75E; Mon, 15 Aug 2016 09:12:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 840D91C7F; Mon, 15 Aug 2016 09:12:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F9CsW4065186; Mon, 15 Aug 2016 09:12:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F9Csos065185; Mon, 15 Aug 2016 09:12:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150912.u7F9Csos065185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 09:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304135 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:12:55 -0000 Author: avg Date: Mon Aug 15 09:12:54 2016 New Revision: 304135 URL: https://svnweb.freebsd.org/changeset/base/304135 Log: MFC r302836: 6874 rollback and receive need to reset ZPL state to what's on disk Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Aug 15 09:09:01 2016 (r304134) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Mon Aug 15 09:12:54 2016 (r304135) @@ -22,7 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . * All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -847,72 +847,46 @@ zfs_owner_overquota(zfsvfs_t *zfsvfs, zn return (zfs_fuid_overquota(zfsvfs, isgroup, fuid)); } -int -zfsvfs_create(const char *osname, zfsvfs_t **zfvp) +/* + * Associate this zfsvfs with the given objset, which must be owned. + * This will cache a bunch of on-disk state from the objset in the + * zfsvfs. + */ +static int +zfsvfs_init(zfsvfs_t *zfsvfs, objset_t *os) { - objset_t *os; - zfsvfs_t *zfsvfs; - uint64_t zval; - int i, error; - uint64_t sa_obj; - - /* - * XXX: Fix struct statfs so this isn't necessary! - * - * The 'osname' is used as the filesystem's special node, which means - * it must fit in statfs.f_mntfromname, or else it can't be - * enumerated, so libzfs_mnttab_find() returns NULL, which causes - * 'zfs unmount' to think it's not mounted when it is. - */ - if (strlen(osname) >= MNAMELEN) - return (SET_ERROR(ENAMETOOLONG)); - - zfsvfs = kmem_zalloc(sizeof (zfsvfs_t), KM_SLEEP); - - /* - * We claim to always be readonly so we can open snapshots; - * other ZPL code will prevent us from writing to snapshots. - */ - error = dmu_objset_own(osname, DMU_OST_ZFS, B_TRUE, zfsvfs, &os); - if (error) { - kmem_free(zfsvfs, sizeof (zfsvfs_t)); - return (error); - } + int error; + uint64_t val; - /* - * Initialize the zfs-specific filesystem structure. - * Should probably make this a kmem cache, shuffle fields, - * and just bzero up to z_hold_mtx[]. - */ - zfsvfs->z_vfs = NULL; - zfsvfs->z_parent = zfsvfs; zfsvfs->z_max_blksz = SPA_OLD_MAXBLOCKSIZE; zfsvfs->z_show_ctldir = ZFS_SNAPDIR_VISIBLE; zfsvfs->z_os = os; error = zfs_get_zplprop(os, ZFS_PROP_VERSION, &zfsvfs->z_version); - if (error) { - goto out; - } else if (zfsvfs->z_version > + if (error != 0) + return (error); + if (zfsvfs->z_version > zfs_zpl_version_map(spa_version(dmu_objset_spa(os)))) { (void) printf("Can't mount a version %lld file system " "on a version %lld pool\n. Pool must be upgraded to mount " "this file system.", (u_longlong_t)zfsvfs->z_version, (u_longlong_t)spa_version(dmu_objset_spa(os))); - error = SET_ERROR(ENOTSUP); - goto out; + return (SET_ERROR(ENOTSUP)); } - if ((error = zfs_get_zplprop(os, ZFS_PROP_NORMALIZE, &zval)) != 0) - goto out; - zfsvfs->z_norm = (int)zval; + error = zfs_get_zplprop(os, ZFS_PROP_NORMALIZE, &val); + if (error != 0) + return (error); + zfsvfs->z_norm = (int)val; - if ((error = zfs_get_zplprop(os, ZFS_PROP_UTF8ONLY, &zval)) != 0) - goto out; - zfsvfs->z_utf8 = (zval != 0); + error = zfs_get_zplprop(os, ZFS_PROP_UTF8ONLY, &val); + if (error != 0) + return (error); + zfsvfs->z_utf8 = (val != 0); - if ((error = zfs_get_zplprop(os, ZFS_PROP_CASE, &zval)) != 0) - goto out; - zfsvfs->z_case = (uint_t)zval; + error = zfs_get_zplprop(os, ZFS_PROP_CASE, &val); + if (error != 0) + return (error); + zfsvfs->z_case = (uint_t)val; /* * Fold case on file systems that are always or sometimes case @@ -925,60 +899,99 @@ zfsvfs_create(const char *osname, zfsvfs zfsvfs->z_use_fuids = USE_FUIDS(zfsvfs->z_version, zfsvfs->z_os); zfsvfs->z_use_sa = USE_SA(zfsvfs->z_version, zfsvfs->z_os); + uint64_t sa_obj = 0; if (zfsvfs->z_use_sa) { /* should either have both of these objects or none */ error = zap_lookup(os, MASTER_NODE_OBJ, ZFS_SA_ATTRS, 8, 1, &sa_obj); - if (error) - goto out; - } else { - /* - * Pre SA versions file systems should never touch - * either the attribute registration or layout objects. - */ - sa_obj = 0; + if (error != 0) + return (error); } error = sa_setup(os, sa_obj, zfs_attr_table, ZPL_END, &zfsvfs->z_attr_table); - if (error) - goto out; + if (error != 0) + return (error); if (zfsvfs->z_version >= ZPL_VERSION_SA) sa_register_update_callback(os, zfs_sa_upgrade); error = zap_lookup(os, MASTER_NODE_OBJ, ZFS_ROOT_OBJ, 8, 1, &zfsvfs->z_root); - if (error) - goto out; + if (error != 0) + return (error); ASSERT(zfsvfs->z_root != 0); error = zap_lookup(os, MASTER_NODE_OBJ, ZFS_UNLINKED_SET, 8, 1, &zfsvfs->z_unlinkedobj); - if (error) - goto out; + if (error != 0) + return (error); error = zap_lookup(os, MASTER_NODE_OBJ, zfs_userquota_prop_prefixes[ZFS_PROP_USERQUOTA], 8, 1, &zfsvfs->z_userquota_obj); - if (error && error != ENOENT) - goto out; + if (error == ENOENT) + zfsvfs->z_userquota_obj = 0; + else if (error != 0) + return (error); error = zap_lookup(os, MASTER_NODE_OBJ, zfs_userquota_prop_prefixes[ZFS_PROP_GROUPQUOTA], 8, 1, &zfsvfs->z_groupquota_obj); - if (error && error != ENOENT) - goto out; + if (error == ENOENT) + zfsvfs->z_groupquota_obj = 0; + else if (error != 0) + return (error); error = zap_lookup(os, MASTER_NODE_OBJ, ZFS_FUID_TABLES, 8, 1, &zfsvfs->z_fuid_obj); - if (error && error != ENOENT) - goto out; + if (error == ENOENT) + zfsvfs->z_fuid_obj = 0; + else if (error != 0) + return (error); error = zap_lookup(os, MASTER_NODE_OBJ, ZFS_SHARES_DIR, 8, 1, &zfsvfs->z_shares_dir); - if (error && error != ENOENT) - goto out; + if (error == ENOENT) + zfsvfs->z_shares_dir = 0; + else if (error != 0) + return (error); + + return (0); +} + +int +zfsvfs_create(const char *osname, zfsvfs_t **zfvp) +{ + objset_t *os; + zfsvfs_t *zfsvfs; + int error; + + /* + * XXX: Fix struct statfs so this isn't necessary! + * + * The 'osname' is used as the filesystem's special node, which means + * it must fit in statfs.f_mntfromname, or else it can't be + * enumerated, so libzfs_mnttab_find() returns NULL, which causes + * 'zfs unmount' to think it's not mounted when it is. + */ + if (strlen(osname) >= MNAMELEN) + return (SET_ERROR(ENAMETOOLONG)); + + zfsvfs = kmem_zalloc(sizeof (zfsvfs_t), KM_SLEEP); + + /* + * We claim to always be readonly so we can open snapshots; + * other ZPL code will prevent us from writing to snapshots. + */ + error = dmu_objset_own(osname, DMU_OST_ZFS, B_TRUE, zfsvfs, &os); + if (error) { + kmem_free(zfsvfs, sizeof (zfsvfs_t)); + return (error); + } + + zfsvfs->z_vfs = NULL; + zfsvfs->z_parent = zfsvfs; mutex_init(&zfsvfs->z_znodes_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&zfsvfs->z_lock, NULL, MUTEX_DEFAULT, NULL); @@ -987,17 +1000,19 @@ zfsvfs_create(const char *osname, zfsvfs rrm_init(&zfsvfs->z_teardown_lock, B_FALSE); rw_init(&zfsvfs->z_teardown_inactive_lock, NULL, RW_DEFAULT, NULL); rw_init(&zfsvfs->z_fuid_lock, NULL, RW_DEFAULT, NULL); - for (i = 0; i != ZFS_OBJ_MTX_SZ; i++) + for (int i = 0; i != ZFS_OBJ_MTX_SZ; i++) mutex_init(&zfsvfs->z_hold_mtx[i], NULL, MUTEX_DEFAULT, NULL); + error = zfsvfs_init(zfsvfs, os); + if (error != 0) { + dmu_objset_disown(os, zfsvfs); + *zfvp = NULL; + kmem_free(zfsvfs, sizeof (zfsvfs_t)); + return (error); + } + *zfvp = zfsvfs; return (0); - -out: - dmu_objset_disown(os, zfsvfs); - *zfvp = NULL; - kmem_free(zfsvfs, sizeof (zfsvfs_t)); - return (error); } static int @@ -2199,7 +2214,6 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, const ch { int err; znode_t *zp; - uint64_t sa_obj = 0; ASSERT(RRM_WRITE_HELD(&zfsvfs->z_teardown_lock)); ASSERT(RW_WRITE_HELD(&zfsvfs->z_teardown_inactive_lock)); @@ -2208,35 +2222,16 @@ zfs_resume_fs(zfsvfs_t *zfsvfs, const ch * We already own this, so just hold and rele it to update the * objset_t, as the one we had before may have been evicted. */ - VERIFY0(dmu_objset_hold(osname, zfsvfs, &zfsvfs->z_os)); - VERIFY3P(zfsvfs->z_os->os_dsl_dataset->ds_owner, ==, zfsvfs); - VERIFY(dsl_dataset_long_held(zfsvfs->z_os->os_dsl_dataset)); - dmu_objset_rele(zfsvfs->z_os, zfsvfs); - - /* - * Make sure version hasn't changed - */ - - err = zfs_get_zplprop(zfsvfs->z_os, ZFS_PROP_VERSION, - &zfsvfs->z_version); - - if (err) - goto bail; - - err = zap_lookup(zfsvfs->z_os, MASTER_NODE_OBJ, - ZFS_SA_ATTRS, 8, 1, &sa_obj); - - if (err && zfsvfs->z_version >= ZPL_VERSION_SA) - goto bail; + objset_t *os; + VERIFY0(dmu_objset_hold(osname, zfsvfs, &os)); + VERIFY3P(os->os_dsl_dataset->ds_owner, ==, zfsvfs); + VERIFY(dsl_dataset_long_held(os->os_dsl_dataset)); + dmu_objset_rele(os, zfsvfs); - if ((err = sa_setup(zfsvfs->z_os, sa_obj, - zfs_attr_table, ZPL_END, &zfsvfs->z_attr_table)) != 0) + err = zfsvfs_init(zfsvfs, os); + if (err != 0) goto bail; - if (zfsvfs->z_version >= ZPL_VERSION_SA) - sa_register_update_callback(zfsvfs->z_os, - zfs_sa_upgrade); - VERIFY(zfsvfs_setup(zfsvfs, B_FALSE) == 0); zfs_set_fuid_feature(zfsvfs); From owner-svn-src-all@freebsd.org Mon Aug 15 09:16:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B4FDBBA92E; Mon, 15 Aug 2016 09:16:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E67991E3F; Mon, 15 Aug 2016 09:16:09 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F9G9Z8065380; Mon, 15 Aug 2016 09:16:09 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F9G8wU065377; Mon, 15 Aug 2016 09:16:08 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150916.u7F9G8wU065377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 09:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304136 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:16:10 -0000 Author: avg Date: Mon Aug 15 09:16:08 2016 New Revision: 304136 URL: https://svnweb.freebsd.org/changeset/base/304136 Log: MFC r302837: 6844 dnode_next_offset can detect fictional holes Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Aug 15 09:12:54 2016 (r304135) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Aug 15 09:16:08 2016 (r304136) @@ -2876,7 +2876,8 @@ dbuf_write_ready(zio_t *zio, arc_buf_t * uint64_t fill = 0; int i; - ASSERT3P(db->db_blkptr, ==, bp); + ASSERT3P(db->db_blkptr, !=, NULL); + ASSERT3P(&db->db_data_pending->dr_bp_copy, ==, bp); DB_DNODE_ENTER(db); dn = DB_DNODE(db); @@ -2898,7 +2899,7 @@ dbuf_write_ready(zio_t *zio, arc_buf_t * #ifdef ZFS_DEBUG if (db->db_blkid == DMU_SPILL_BLKID) { ASSERT(dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR); - ASSERT(!(BP_IS_HOLE(db->db_blkptr)) && + ASSERT(!(BP_IS_HOLE(bp)) && db->db_blkptr == &dn->dn_phys->dn_spill); } #endif @@ -2939,6 +2940,10 @@ dbuf_write_ready(zio_t *zio, arc_buf_t * bp->blk_fill = fill; mutex_exit(&db->db_mtx); + + rw_enter(&dn->dn_struct_rwlock, RW_WRITER); + *db->db_blkptr = *bp; + rw_exit(&dn->dn_struct_rwlock); } /* @@ -3117,6 +3122,8 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ zio_t *zio; int wp_flag = 0; + ASSERT(dmu_tx_is_syncing(tx)); + DB_DNODE_ENTER(db); dn = DB_DNODE(db); os = dn->dn_objset; @@ -3175,6 +3182,14 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ dmu_write_policy(os, dn, db->db_level, wp_flag, &zp); DB_DNODE_EXIT(db); + /* + * We copy the blkptr now (rather than when we instantiate the dirty + * record), because its value can change between open context and + * syncing context. We do not need to hold dn_struct_rwlock to read + * db_blkptr because we are in syncing context. + */ + dr->dr_bp_copy = *db->db_blkptr; + if (db->db_level == 0 && dr->dt.dl.dr_override_state == DR_OVERRIDDEN) { /* @@ -3184,7 +3199,7 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ void *contents = (data != NULL) ? data->b_data : NULL; dr->dr_zio = zio_write(zio, os->os_spa, txg, - db->db_blkptr, contents, db->db.db_size, &zp, + &dr->dr_bp_copy, contents, db->db.db_size, &zp, dbuf_write_override_ready, NULL, dbuf_write_override_done, dr, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb); mutex_enter(&db->db_mtx); @@ -3196,14 +3211,14 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF || zp.zp_checksum == ZIO_CHECKSUM_NOPARITY); dr->dr_zio = zio_write(zio, os->os_spa, txg, - db->db_blkptr, NULL, db->db.db_size, &zp, + &dr->dr_bp_copy, NULL, db->db.db_size, &zp, dbuf_write_nofill_ready, NULL, dbuf_write_nofill_done, db, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED | ZIO_FLAG_NODATA, &zb); } else { ASSERT(arc_released(data)); dr->dr_zio = arc_write(zio, os->os_spa, txg, - db->db_blkptr, data, DBUF_IS_L2CACHEABLE(db), + &dr->dr_bp_copy, data, DBUF_IS_L2CACHEABLE(db), DBUF_IS_L2COMPRESSIBLE(db), &zp, dbuf_write_ready, dbuf_write_physdone, dbuf_write_done, db, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Mon Aug 15 09:12:54 2016 (r304135) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Mon Aug 15 09:16:08 2016 (r304136) @@ -121,6 +121,9 @@ typedef struct dbuf_dirty_record { /* How much space was changed to dsl_pool_dirty_space() for this? */ unsigned int dr_accounted; + /* A copy of the bp that points to us */ + blkptr_t dr_bp_copy; + union dirty_types { struct dirty_indirect { From owner-svn-src-all@freebsd.org Mon Aug 15 09:16:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 191E5BBA9AB; Mon, 15 Aug 2016 09:16:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E8C0D113A; Mon, 15 Aug 2016 09:16:43 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F9Ghlb065460; Mon, 15 Aug 2016 09:16:43 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F9Ghsq065458; Mon, 15 Aug 2016 09:16:43 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150916.u7F9Ghsq065458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 09:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304137 - in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:16:44 -0000 Author: avg Date: Mon Aug 15 09:16:42 2016 New Revision: 304137 URL: https://svnweb.freebsd.org/changeset/base/304137 Log: MFC r302837: 6844 dnode_next_offset can detect fictional holes Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Aug 15 09:16:08 2016 (r304136) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Aug 15 09:16:42 2016 (r304137) @@ -2883,7 +2883,8 @@ dbuf_write_ready(zio_t *zio, arc_buf_t * uint64_t fill = 0; int i; - ASSERT3P(db->db_blkptr, ==, bp); + ASSERT3P(db->db_blkptr, !=, NULL); + ASSERT3P(&db->db_data_pending->dr_bp_copy, ==, bp); DB_DNODE_ENTER(db); dn = DB_DNODE(db); @@ -2905,7 +2906,7 @@ dbuf_write_ready(zio_t *zio, arc_buf_t * #ifdef ZFS_DEBUG if (db->db_blkid == DMU_SPILL_BLKID) { ASSERT(dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR); - ASSERT(!(BP_IS_HOLE(db->db_blkptr)) && + ASSERT(!(BP_IS_HOLE(bp)) && db->db_blkptr == &dn->dn_phys->dn_spill); } #endif @@ -2946,6 +2947,10 @@ dbuf_write_ready(zio_t *zio, arc_buf_t * bp->blk_fill = fill; mutex_exit(&db->db_mtx); + + rw_enter(&dn->dn_struct_rwlock, RW_WRITER); + *db->db_blkptr = *bp; + rw_exit(&dn->dn_struct_rwlock); } /* @@ -3124,6 +3129,8 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ zio_t *zio; int wp_flag = 0; + ASSERT(dmu_tx_is_syncing(tx)); + DB_DNODE_ENTER(db); dn = DB_DNODE(db); os = dn->dn_objset; @@ -3182,6 +3189,14 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ dmu_write_policy(os, dn, db->db_level, wp_flag, &zp); DB_DNODE_EXIT(db); + /* + * We copy the blkptr now (rather than when we instantiate the dirty + * record), because its value can change between open context and + * syncing context. We do not need to hold dn_struct_rwlock to read + * db_blkptr because we are in syncing context. + */ + dr->dr_bp_copy = *db->db_blkptr; + if (db->db_level == 0 && dr->dt.dl.dr_override_state == DR_OVERRIDDEN) { /* @@ -3191,7 +3206,7 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ void *contents = (data != NULL) ? data->b_data : NULL; dr->dr_zio = zio_write(zio, os->os_spa, txg, - db->db_blkptr, contents, db->db.db_size, &zp, + &dr->dr_bp_copy, contents, db->db.db_size, &zp, dbuf_write_override_ready, NULL, dbuf_write_override_done, dr, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb); mutex_enter(&db->db_mtx); @@ -3203,14 +3218,14 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF || zp.zp_checksum == ZIO_CHECKSUM_NOPARITY); dr->dr_zio = zio_write(zio, os->os_spa, txg, - db->db_blkptr, NULL, db->db.db_size, &zp, + &dr->dr_bp_copy, NULL, db->db.db_size, &zp, dbuf_write_nofill_ready, NULL, dbuf_write_nofill_done, db, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED | ZIO_FLAG_NODATA, &zb); } else { ASSERT(arc_released(data)); dr->dr_zio = arc_write(zio, os->os_spa, txg, - db->db_blkptr, data, DBUF_IS_L2CACHEABLE(db), + &dr->dr_bp_copy, data, DBUF_IS_L2CACHEABLE(db), DBUF_IS_L2COMPRESSIBLE(db), &zp, dbuf_write_ready, dbuf_write_physdone, dbuf_write_done, db, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb); Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Mon Aug 15 09:16:08 2016 (r304136) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h Mon Aug 15 09:16:42 2016 (r304137) @@ -121,6 +121,9 @@ typedef struct dbuf_dirty_record { /* How much space was changed to dsl_pool_dirty_space() for this? */ unsigned int dr_accounted; + /* A copy of the bp that points to us */ + blkptr_t dr_bp_copy; + union dirty_types { struct dirty_indirect { From owner-svn-src-all@freebsd.org Mon Aug 15 09:19:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5387BBBAAD0; Mon, 15 Aug 2016 09:19:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F29312E3; Mon, 15 Aug 2016 09:19:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F9JMFQ065631; Mon, 15 Aug 2016 09:19:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F9JLxn065621; Mon, 15 Aug 2016 09:19:21 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150919.u7F9JLxn065621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 09:19:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304138 - in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:19:23 -0000 Author: avg Date: Mon Aug 15 09:19:21 2016 New Revision: 304138 URL: https://svnweb.freebsd.org/changeset/base/304138 Log: MFC r302838: 6513 partially filled holes lose birth time Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Aug 15 09:16:42 2016 (r304137) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Aug 15 09:19:21 2016 (r304138) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 by Saso Kiselkov. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. */ @@ -784,6 +784,7 @@ typedef struct arc_write_callback arc_wr struct arc_write_callback { void *awcb_private; arc_done_func_t *awcb_ready; + arc_done_func_t *awcb_children_ready; arc_done_func_t *awcb_physdone; arc_done_func_t *awcb_done; arc_buf_t *awcb_buf; @@ -5106,6 +5107,15 @@ arc_write_ready(zio_t *zio) hdr->b_flags |= ARC_FLAG_IO_IN_PROGRESS; } +static void +arc_write_children_ready(zio_t *zio) +{ + arc_write_callback_t *callback = zio->io_private; + arc_buf_t *buf = callback->awcb_buf; + + callback->awcb_children_ready(zio, buf, callback->awcb_private); +} + /* * The SPA calls this callback for each physical write that happens on behalf * of a logical write. See the comment in dbuf_write_physdone() for details. @@ -5202,7 +5212,8 @@ arc_write_done(zio_t *zio) zio_t * arc_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, boolean_t l2arc_compress, - const zio_prop_t *zp, arc_done_func_t *ready, arc_done_func_t *physdone, + const zio_prop_t *zp, arc_done_func_t *ready, + arc_done_func_t *children_ready, arc_done_func_t *physdone, arc_done_func_t *done, void *private, zio_priority_t priority, int zio_flags, const zbookmark_phys_t *zb) { @@ -5222,13 +5233,16 @@ arc_write(zio_t *pio, spa_t *spa, uint64 hdr->b_flags |= ARC_FLAG_L2COMPRESS; callback = kmem_zalloc(sizeof (arc_write_callback_t), KM_SLEEP); callback->awcb_ready = ready; + callback->awcb_children_ready = children_ready; callback->awcb_physdone = physdone; callback->awcb_done = done; callback->awcb_private = private; callback->awcb_buf = buf; zio = zio_write(pio, spa, txg, bp, buf->b_data, hdr->b_size, zp, - arc_write_ready, arc_write_physdone, arc_write_done, callback, + arc_write_ready, + (children_ready != NULL) ? arc_write_children_ready : NULL, + arc_write_physdone, arc_write_done, callback, priority, zio_flags, zb); return (zio); Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Aug 15 09:16:42 2016 (r304137) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Aug 15 09:19:21 2016 (r304138) @@ -486,13 +486,49 @@ dbuf_verify(dmu_buf_impl_t *db) * If the blkptr isn't set but they have nonzero data, * it had better be dirty, otherwise we'll lose that * data when we evict this buffer. + * + * There is an exception to this rule for indirect blocks; in + * this case, if the indirect block is a hole, we fill in a few + * fields on each of the child blocks (importantly, birth time) + * to prevent hole birth times from being lost when you + * partially fill in a hole. */ if (db->db_dirtycnt == 0) { - uint64_t *buf = db->db.db_data; - int i; + if (db->db_level == 0) { + uint64_t *buf = db->db.db_data; + int i; - for (i = 0; i < db->db.db_size >> 3; i++) { - ASSERT(buf[i] == 0); + for (i = 0; i < db->db.db_size >> 3; i++) { + ASSERT(buf[i] == 0); + } + } else { + blkptr_t *bps = db->db.db_data; + ASSERT3U(1 << DB_DNODE(db)->dn_indblkshift, ==, + db->db.db_size); + /* + * We want to verify that all the blkptrs in the + * indirect block are holes, but we may have + * automatically set up a few fields for them. + * We iterate through each blkptr and verify + * they only have those fields set. + */ + for (int i = 0; + i < db->db.db_size / sizeof (blkptr_t); + i++) { + blkptr_t *bp = &bps[i]; + ASSERT(ZIO_CHECKSUM_IS_ZERO( + &bp->blk_cksum)); + ASSERT( + DVA_IS_EMPTY(&bp->blk_dva[0]) && + DVA_IS_EMPTY(&bp->blk_dva[1]) && + DVA_IS_EMPTY(&bp->blk_dva[2])); + ASSERT0(bp->blk_fill); + ASSERT0(bp->blk_pad[0]); + ASSERT0(bp->blk_pad[1]); + ASSERT(!BP_IS_EMBEDDED(bp)); + ASSERT(BP_IS_HOLE(bp)); + ASSERT0(bp->blk_phys_birth); + } } } } @@ -660,10 +696,31 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t BP_IS_HOLE(db->db_blkptr)))) { arc_buf_contents_t type = DBUF_GET_BUFC_TYPE(db); - DB_DNODE_EXIT(db); dbuf_set_data(db, arc_buf_alloc(db->db_objset->os_spa, db->db.db_size, db, type)); bzero(db->db.db_data, db->db.db_size); + + if (db->db_blkptr != NULL && db->db_level > 0 && + BP_IS_HOLE(db->db_blkptr) && + db->db_blkptr->blk_birth != 0) { + blkptr_t *bps = db->db.db_data; + for (int i = 0; i < ((1 << + DB_DNODE(db)->dn_indblkshift) / sizeof (blkptr_t)); + i++) { + blkptr_t *bp = &bps[i]; + ASSERT3U(BP_GET_LSIZE(db->db_blkptr), ==, + 1 << dn->dn_indblkshift); + BP_SET_LSIZE(bp, + BP_GET_LEVEL(db->db_blkptr) == 1 ? + dn->dn_datablksz : + BP_GET_LSIZE(db->db_blkptr)); + BP_SET_TYPE(bp, BP_GET_TYPE(db->db_blkptr)); + BP_SET_LEVEL(bp, + BP_GET_LEVEL(db->db_blkptr) - 1); + BP_SET_BIRTH(bp, db->db_blkptr->blk_birth, 0); + } + } + DB_DNODE_EXIT(db); db->db_state = DB_CACHED; mutex_exit(&db->db_mtx); return; @@ -2953,6 +3010,45 @@ dbuf_write_ready(zio_t *zio, arc_buf_t * rw_exit(&dn->dn_struct_rwlock); } +/* ARGSUSED */ +/* + * This function gets called just prior to running through the compression + * stage of the zio pipeline. If we're an indirect block comprised of only + * holes, then we want this indirect to be compressed away to a hole. In + * order to do that we must zero out any information about the holes that + * this indirect points to prior to before we try to compress it. + */ +static void +dbuf_write_children_ready(zio_t *zio, arc_buf_t *buf, void *vdb) +{ + dmu_buf_impl_t *db = vdb; + dnode_t *dn; + blkptr_t *bp; + uint64_t i; + int epbs; + + ASSERT3U(db->db_level, >, 0); + DB_DNODE_ENTER(db); + dn = DB_DNODE(db); + epbs = dn->dn_phys->dn_indblkshift - SPA_BLKPTRSHIFT; + + /* Determine if all our children are holes */ + for (i = 0, bp = db->db.db_data; i < 1 << epbs; i++, bp++) { + if (!BP_IS_HOLE(bp)) + break; + } + + /* + * If all the children are holes, then zero them all out so that + * we may get compressed away. + */ + if (i == 1 << epbs) { + /* didn't find any non-holes */ + bzero(db->db.db_data, db->db.db_size); + } + DB_DNODE_EXIT(db); +} + /* * The SPA will call this callback several times for each zio - once * for every physical child i/o (zio->io_phys_children times). This @@ -3207,7 +3303,8 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ dr->dr_zio = zio_write(zio, os->os_spa, txg, &dr->dr_bp_copy, contents, db->db.db_size, &zp, - dbuf_write_override_ready, NULL, dbuf_write_override_done, + dbuf_write_override_ready, NULL, NULL, + dbuf_write_override_done, dr, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb); mutex_enter(&db->db_mtx); dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; @@ -3219,14 +3316,26 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ zp.zp_checksum == ZIO_CHECKSUM_NOPARITY); dr->dr_zio = zio_write(zio, os->os_spa, txg, &dr->dr_bp_copy, NULL, db->db.db_size, &zp, - dbuf_write_nofill_ready, NULL, dbuf_write_nofill_done, db, + dbuf_write_nofill_ready, NULL, NULL, + dbuf_write_nofill_done, db, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED | ZIO_FLAG_NODATA, &zb); } else { ASSERT(arc_released(data)); + + /* + * For indirect blocks, we want to setup the children + * ready callback so that we can properly handle an indirect + * block that only contains holes. + */ + arc_done_func_t *children_ready_cb = NULL; + if (db->db_level != 0) + children_ready_cb = dbuf_write_children_ready; + dr->dr_zio = arc_write(zio, os->os_spa, txg, &dr->dr_bp_copy, data, DBUF_IS_L2CACHEABLE(db), DBUF_IS_L2COMPRESSIBLE(db), &zp, dbuf_write_ready, + children_ready_cb, dbuf_write_physdone, dbuf_write_done, db, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb); } Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Aug 15 09:16:42 2016 (r304137) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Aug 15 09:19:21 2016 (r304138) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. */ /* Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ /* Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -1607,10 +1607,11 @@ dmu_sync_late_arrival(zio_t *pio, objset dsa->dsa_zgd = zgd; dsa->dsa_tx = tx; - zio_nowait(zio_write(pio, os->os_spa, dmu_tx_get_txg(tx), zgd->zgd_bp, - zgd->zgd_db->db_data, zgd->zgd_db->db_size, zp, - dmu_sync_late_arrival_ready, NULL, dmu_sync_late_arrival_done, dsa, - ZIO_PRIORITY_SYNC_WRITE, ZIO_FLAG_CANFAIL, zb)); + zio_nowait(zio_write(pio, os->os_spa, dmu_tx_get_txg(tx), + zgd->zgd_bp, zgd->zgd_db->db_data, zgd->zgd_db->db_size, + zp, dmu_sync_late_arrival_ready, NULL, + NULL, dmu_sync_late_arrival_done, dsa, ZIO_PRIORITY_SYNC_WRITE, + ZIO_FLAG_CANFAIL, zb)); return (0); } @@ -1763,8 +1764,8 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s zio_nowait(arc_write(pio, os->os_spa, txg, bp, dr->dt.dl.dr_data, DBUF_IS_L2CACHEABLE(db), DBUF_IS_L2COMPRESSIBLE(db), &zp, dmu_sync_ready, - NULL, dmu_sync_done, dsa, ZIO_PRIORITY_SYNC_WRITE, - ZIO_FLAG_CANFAIL, &zb)); + NULL, NULL, dmu_sync_done, dsa, + ZIO_PRIORITY_SYNC_WRITE, ZIO_FLAG_CANFAIL, &zb)); return (0); } Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Mon Aug 15 09:16:42 2016 (r304137) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Mon Aug 15 09:19:21 2016 (r304138) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. @@ -1116,9 +1116,9 @@ dmu_objset_sync(objset_t *os, zio_t *pio zio = arc_write(pio, os->os_spa, tx->tx_txg, os->os_rootbp, os->os_phys_buf, DMU_OS_IS_L2CACHEABLE(os), - DMU_OS_IS_L2COMPRESSIBLE(os), &zp, dmu_objset_write_ready, - NULL, dmu_objset_write_done, os, ZIO_PRIORITY_ASYNC_WRITE, - ZIO_FLAG_MUSTSUCCEED, &zb); + DMU_OS_IS_L2COMPRESSIBLE(os), + &zp, dmu_objset_write_ready, NULL, NULL, dmu_objset_write_done, + os, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb); /* * Sync special dnodes - the parent IO for the sync is the root block Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Mon Aug 15 09:16:42 2016 (r304137) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Mon Aug 15 09:19:21 2016 (r304138) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2015 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ @@ -60,20 +60,14 @@ dnode_increase_indirection(dnode_t *dn, dprintf("os=%p obj=%llu, increase to %d\n", dn->dn_objset, dn->dn_object, dn->dn_phys->dn_nlevels); - /* check for existing blkptrs in the dnode */ - for (i = 0; i < nblkptr; i++) - if (!BP_IS_HOLE(&dn->dn_phys->dn_blkptr[i])) - break; - if (i != nblkptr) { - /* transfer dnode's block pointers to new indirect block */ - (void) dbuf_read(db, NULL, DB_RF_MUST_SUCCEED|DB_RF_HAVESTRUCT); - ASSERT(db->db.db_data); - ASSERT(arc_released(db->db_buf)); - ASSERT3U(sizeof (blkptr_t) * nblkptr, <=, db->db.db_size); - bcopy(dn->dn_phys->dn_blkptr, db->db.db_data, - sizeof (blkptr_t) * nblkptr); - arc_buf_freeze(db->db_buf); - } + /* transfer dnode's block pointers to new indirect block */ + (void) dbuf_read(db, NULL, DB_RF_MUST_SUCCEED|DB_RF_HAVESTRUCT); + ASSERT(db->db.db_data); + ASSERT(arc_released(db->db_buf)); + ASSERT3U(sizeof (blkptr_t) * nblkptr, <=, db->db.db_size); + bcopy(dn->dn_phys->dn_blkptr, db->db.db_data, + sizeof (blkptr_t) * nblkptr); + arc_buf_freeze(db->db_buf); /* set dbuf's parent pointers to new indirect buf */ for (i = 0; i < nblkptr; i++) { Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Mon Aug 15 09:16:42 2016 (r304137) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Mon Aug 15 09:19:21 2016 (r304138) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ @@ -141,9 +141,11 @@ int arc_read(zio_t *pio, spa_t *spa, con arc_flags_t *arc_flags, const zbookmark_phys_t *zb); zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, boolean_t l2arc_compress, - const zio_prop_t *zp, arc_done_func_t *ready, arc_done_func_t *physdone, - arc_done_func_t *done, void *priv, zio_priority_t priority, - int zio_flags, const zbookmark_phys_t *zb); + const zio_prop_t *zp, + arc_done_func_t *ready, arc_done_func_t *child_ready, + arc_done_func_t *physdone, arc_done_func_t *done, + void *priv, zio_priority_t priority, int zio_flags, + const zbookmark_phys_t *zb); void arc_freed(spa_t *spa, const blkptr_t *bp); void arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *priv); Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Aug 15 09:16:42 2016 (r304137) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Aug 15 09:19:21 2016 (r304138) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ @@ -436,6 +436,7 @@ struct zio { /* Callback info */ zio_done_func_t *io_ready; + zio_done_func_t *io_children_ready; zio_done_func_t *io_physdone; zio_done_func_t *io_done; void *io_private; @@ -503,9 +504,10 @@ extern zio_t *zio_read(zio_t *pio, spa_t extern zio_t *zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, void *data, uint64_t size, const zio_prop_t *zp, - zio_done_func_t *ready, zio_done_func_t *physdone, zio_done_func_t *done, - void *priv, - zio_priority_t priority, enum zio_flag flags, const zbookmark_phys_t *zb); + zio_done_func_t *ready, zio_done_func_t *children_ready, + zio_done_func_t *physdone, zio_done_func_t *done, + void *priv, zio_priority_t priority, enum zio_flag flags, + const zbookmark_phys_t *zb); extern zio_t *zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, void *data, uint64_t size, zio_done_func_t *done, void *priv, Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Aug 15 09:16:42 2016 (r304137) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Aug 15 09:19:21 2016 (r304138) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -766,9 +766,10 @@ zio_read(zio_t *pio, spa_t *spa, const b zio_t * zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, void *data, uint64_t size, const zio_prop_t *zp, - zio_done_func_t *ready, zio_done_func_t *physdone, zio_done_func_t *done, - void *private, - zio_priority_t priority, enum zio_flag flags, const zbookmark_phys_t *zb) + zio_done_func_t *ready, zio_done_func_t *children_ready, + zio_done_func_t *physdone, zio_done_func_t *done, + void *private, zio_priority_t priority, enum zio_flag flags, + const zbookmark_phys_t *zb) { zio_t *zio; @@ -787,6 +788,7 @@ zio_write(zio_t *pio, spa_t *spa, uint64 ZIO_DDT_CHILD_WRITE_PIPELINE : ZIO_WRITE_PIPELINE); zio->io_ready = ready; + zio->io_children_ready = children_ready; zio->io_physdone = physdone; zio->io_prop = *zp; @@ -1184,6 +1186,16 @@ zio_write_bp_init(zio_t *zio) if (!IO_IS_ALLOCATING(zio)) return (ZIO_PIPELINE_CONTINUE); + if (zio->io_children_ready != NULL) { + /* + * Now that all our children are ready, run the callback + * associated with this zio in case it wants to modify the + * data to be written. + */ + ASSERT3U(zp->zp_level, >, 0); + zio->io_children_ready(zio); + } + ASSERT(zio->io_child_type != ZIO_CHILD_DDT); if (zio->io_bp_override) { @@ -2113,9 +2125,9 @@ zio_write_gang_block(zio_t *pio) zio_nowait(zio_write(zio, spa, txg, &gbh->zg_blkptr[g], (char *)pio->io_data + (pio->io_size - resid), lsize, &zp, - zio_write_gang_member_ready, NULL, NULL, &gn->gn_child[g], - pio->io_priority, ZIO_GANG_CHILD_FLAGS(pio), - &pio->io_bookmark)); + zio_write_gang_member_ready, NULL, NULL, NULL, + &gn->gn_child[g], pio->io_priority, + ZIO_GANG_CHILD_FLAGS(pio), &pio->io_bookmark)); } /* @@ -2504,7 +2516,7 @@ zio_ddt_write(zio_t *zio) dio = zio_write(zio, spa, txg, bp, zio->io_orig_data, zio->io_orig_size, &czp, NULL, NULL, - zio_ddt_ditto_write_done, dde, zio->io_priority, + NULL, zio_ddt_ditto_write_done, dde, zio->io_priority, ZIO_DDT_CHILD_FLAGS(zio), &zio->io_bookmark); zio_push_transform(dio, zio->io_data, zio->io_size, 0, NULL); @@ -2525,7 +2537,8 @@ zio_ddt_write(zio_t *zio) ddt_phys_addref(ddp); } else { cio = zio_write(zio, spa, txg, bp, zio->io_orig_data, - zio->io_orig_size, zp, zio_ddt_child_write_ready, NULL, + zio->io_orig_size, zp, + zio_ddt_child_write_ready, NULL, NULL, zio_ddt_child_write_done, dde, zio->io_priority, ZIO_DDT_CHILD_FLAGS(zio), &zio->io_bookmark); From owner-svn-src-all@freebsd.org Mon Aug 15 09:19:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20493BBAB01; Mon, 15 Aug 2016 09:19:28 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E400A12F2; Mon, 15 Aug 2016 09:19:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F9JR29065686; Mon, 15 Aug 2016 09:19:27 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F9JQ67065678; Mon, 15 Aug 2016 09:19:26 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150919.u7F9JQ67065678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 09:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304139 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:19:28 -0000 Author: avg Date: Mon Aug 15 09:19:26 2016 New Revision: 304139 URL: https://svnweb.freebsd.org/changeset/base/304139 Log: MFC r302838: 6513 partially filled holes lose birth time Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Aug 15 09:19:21 2016 (r304138) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Aug 15 09:19:26 2016 (r304139) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 by Saso Kiselkov. All rights reserved. * Copyright 2015 Nexenta Systems, Inc. All rights reserved. */ @@ -782,6 +782,7 @@ typedef struct arc_write_callback arc_wr struct arc_write_callback { void *awcb_private; arc_done_func_t *awcb_ready; + arc_done_func_t *awcb_children_ready; arc_done_func_t *awcb_physdone; arc_done_func_t *awcb_done; arc_buf_t *awcb_buf; @@ -5045,6 +5046,15 @@ arc_write_ready(zio_t *zio) hdr->b_flags |= ARC_FLAG_IO_IN_PROGRESS; } +static void +arc_write_children_ready(zio_t *zio) +{ + arc_write_callback_t *callback = zio->io_private; + arc_buf_t *buf = callback->awcb_buf; + + callback->awcb_children_ready(zio, buf, callback->awcb_private); +} + /* * The SPA calls this callback for each physical write that happens on behalf * of a logical write. See the comment in dbuf_write_physdone() for details. @@ -5141,7 +5151,8 @@ arc_write_done(zio_t *zio) zio_t * arc_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, boolean_t l2arc_compress, - const zio_prop_t *zp, arc_done_func_t *ready, arc_done_func_t *physdone, + const zio_prop_t *zp, arc_done_func_t *ready, + arc_done_func_t *children_ready, arc_done_func_t *physdone, arc_done_func_t *done, void *private, zio_priority_t priority, int zio_flags, const zbookmark_phys_t *zb) { @@ -5161,13 +5172,16 @@ arc_write(zio_t *pio, spa_t *spa, uint64 hdr->b_flags |= ARC_FLAG_L2COMPRESS; callback = kmem_zalloc(sizeof (arc_write_callback_t), KM_SLEEP); callback->awcb_ready = ready; + callback->awcb_children_ready = children_ready; callback->awcb_physdone = physdone; callback->awcb_done = done; callback->awcb_private = private; callback->awcb_buf = buf; zio = zio_write(pio, spa, txg, bp, buf->b_data, hdr->b_size, zp, - arc_write_ready, arc_write_physdone, arc_write_done, callback, + arc_write_ready, + (children_ready != NULL) ? arc_write_children_ready : NULL, + arc_write_physdone, arc_write_done, callback, priority, zio_flags, zb); return (zio); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Aug 15 09:19:21 2016 (r304138) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Aug 15 09:19:26 2016 (r304139) @@ -481,13 +481,49 @@ dbuf_verify(dmu_buf_impl_t *db) * If the blkptr isn't set but they have nonzero data, * it had better be dirty, otherwise we'll lose that * data when we evict this buffer. + * + * There is an exception to this rule for indirect blocks; in + * this case, if the indirect block is a hole, we fill in a few + * fields on each of the child blocks (importantly, birth time) + * to prevent hole birth times from being lost when you + * partially fill in a hole. */ if (db->db_dirtycnt == 0) { - uint64_t *buf = db->db.db_data; - int i; + if (db->db_level == 0) { + uint64_t *buf = db->db.db_data; + int i; - for (i = 0; i < db->db.db_size >> 3; i++) { - ASSERT(buf[i] == 0); + for (i = 0; i < db->db.db_size >> 3; i++) { + ASSERT(buf[i] == 0); + } + } else { + blkptr_t *bps = db->db.db_data; + ASSERT3U(1 << DB_DNODE(db)->dn_indblkshift, ==, + db->db.db_size); + /* + * We want to verify that all the blkptrs in the + * indirect block are holes, but we may have + * automatically set up a few fields for them. + * We iterate through each blkptr and verify + * they only have those fields set. + */ + for (int i = 0; + i < db->db.db_size / sizeof (blkptr_t); + i++) { + blkptr_t *bp = &bps[i]; + ASSERT(ZIO_CHECKSUM_IS_ZERO( + &bp->blk_cksum)); + ASSERT( + DVA_IS_EMPTY(&bp->blk_dva[0]) && + DVA_IS_EMPTY(&bp->blk_dva[1]) && + DVA_IS_EMPTY(&bp->blk_dva[2])); + ASSERT0(bp->blk_fill); + ASSERT0(bp->blk_pad[0]); + ASSERT0(bp->blk_pad[1]); + ASSERT(!BP_IS_EMBEDDED(bp)); + ASSERT(BP_IS_HOLE(bp)); + ASSERT0(bp->blk_phys_birth); + } } } } @@ -655,10 +691,31 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t BP_IS_HOLE(db->db_blkptr)))) { arc_buf_contents_t type = DBUF_GET_BUFC_TYPE(db); - DB_DNODE_EXIT(db); dbuf_set_data(db, arc_buf_alloc(db->db_objset->os_spa, db->db.db_size, db, type)); bzero(db->db.db_data, db->db.db_size); + + if (db->db_blkptr != NULL && db->db_level > 0 && + BP_IS_HOLE(db->db_blkptr) && + db->db_blkptr->blk_birth != 0) { + blkptr_t *bps = db->db.db_data; + for (int i = 0; i < ((1 << + DB_DNODE(db)->dn_indblkshift) / sizeof (blkptr_t)); + i++) { + blkptr_t *bp = &bps[i]; + ASSERT3U(BP_GET_LSIZE(db->db_blkptr), ==, + 1 << dn->dn_indblkshift); + BP_SET_LSIZE(bp, + BP_GET_LEVEL(db->db_blkptr) == 1 ? + dn->dn_datablksz : + BP_GET_LSIZE(db->db_blkptr)); + BP_SET_TYPE(bp, BP_GET_TYPE(db->db_blkptr)); + BP_SET_LEVEL(bp, + BP_GET_LEVEL(db->db_blkptr) - 1); + BP_SET_BIRTH(bp, db->db_blkptr->blk_birth, 0); + } + } + DB_DNODE_EXIT(db); db->db_state = DB_CACHED; mutex_exit(&db->db_mtx); return; @@ -2946,6 +3003,45 @@ dbuf_write_ready(zio_t *zio, arc_buf_t * rw_exit(&dn->dn_struct_rwlock); } +/* ARGSUSED */ +/* + * This function gets called just prior to running through the compression + * stage of the zio pipeline. If we're an indirect block comprised of only + * holes, then we want this indirect to be compressed away to a hole. In + * order to do that we must zero out any information about the holes that + * this indirect points to prior to before we try to compress it. + */ +static void +dbuf_write_children_ready(zio_t *zio, arc_buf_t *buf, void *vdb) +{ + dmu_buf_impl_t *db = vdb; + dnode_t *dn; + blkptr_t *bp; + uint64_t i; + int epbs; + + ASSERT3U(db->db_level, >, 0); + DB_DNODE_ENTER(db); + dn = DB_DNODE(db); + epbs = dn->dn_phys->dn_indblkshift - SPA_BLKPTRSHIFT; + + /* Determine if all our children are holes */ + for (i = 0, bp = db->db.db_data; i < 1 << epbs; i++, bp++) { + if (!BP_IS_HOLE(bp)) + break; + } + + /* + * If all the children are holes, then zero them all out so that + * we may get compressed away. + */ + if (i == 1 << epbs) { + /* didn't find any non-holes */ + bzero(db->db.db_data, db->db.db_size); + } + DB_DNODE_EXIT(db); +} + /* * The SPA will call this callback several times for each zio - once * for every physical child i/o (zio->io_phys_children times). This @@ -3200,7 +3296,8 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ dr->dr_zio = zio_write(zio, os->os_spa, txg, &dr->dr_bp_copy, contents, db->db.db_size, &zp, - dbuf_write_override_ready, NULL, dbuf_write_override_done, + dbuf_write_override_ready, NULL, NULL, + dbuf_write_override_done, dr, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb); mutex_enter(&db->db_mtx); dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; @@ -3212,14 +3309,26 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ zp.zp_checksum == ZIO_CHECKSUM_NOPARITY); dr->dr_zio = zio_write(zio, os->os_spa, txg, &dr->dr_bp_copy, NULL, db->db.db_size, &zp, - dbuf_write_nofill_ready, NULL, dbuf_write_nofill_done, db, + dbuf_write_nofill_ready, NULL, NULL, + dbuf_write_nofill_done, db, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED | ZIO_FLAG_NODATA, &zb); } else { ASSERT(arc_released(data)); + + /* + * For indirect blocks, we want to setup the children + * ready callback so that we can properly handle an indirect + * block that only contains holes. + */ + arc_done_func_t *children_ready_cb = NULL; + if (db->db_level != 0) + children_ready_cb = dbuf_write_children_ready; + dr->dr_zio = arc_write(zio, os->os_spa, txg, &dr->dr_bp_copy, data, DBUF_IS_L2CACHEABLE(db), DBUF_IS_L2COMPRESSIBLE(db), &zp, dbuf_write_ready, + children_ready_cb, dbuf_write_physdone, dbuf_write_done, db, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Aug 15 09:19:21 2016 (r304138) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Aug 15 09:19:26 2016 (r304139) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. */ /* Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ /* Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -1590,10 +1590,11 @@ dmu_sync_late_arrival(zio_t *pio, objset dsa->dsa_zgd = zgd; dsa->dsa_tx = tx; - zio_nowait(zio_write(pio, os->os_spa, dmu_tx_get_txg(tx), zgd->zgd_bp, - zgd->zgd_db->db_data, zgd->zgd_db->db_size, zp, - dmu_sync_late_arrival_ready, NULL, dmu_sync_late_arrival_done, dsa, - ZIO_PRIORITY_SYNC_WRITE, ZIO_FLAG_CANFAIL, zb)); + zio_nowait(zio_write(pio, os->os_spa, dmu_tx_get_txg(tx), + zgd->zgd_bp, zgd->zgd_db->db_data, zgd->zgd_db->db_size, + zp, dmu_sync_late_arrival_ready, NULL, + NULL, dmu_sync_late_arrival_done, dsa, ZIO_PRIORITY_SYNC_WRITE, + ZIO_FLAG_CANFAIL, zb)); return (0); } @@ -1746,8 +1747,8 @@ dmu_sync(zio_t *pio, uint64_t txg, dmu_s zio_nowait(arc_write(pio, os->os_spa, txg, bp, dr->dt.dl.dr_data, DBUF_IS_L2CACHEABLE(db), DBUF_IS_L2COMPRESSIBLE(db), &zp, dmu_sync_ready, - NULL, dmu_sync_done, dsa, ZIO_PRIORITY_SYNC_WRITE, - ZIO_FLAG_CANFAIL, &zb)); + NULL, NULL, dmu_sync_done, dsa, + ZIO_PRIORITY_SYNC_WRITE, ZIO_FLAG_CANFAIL, &zb)); return (0); } Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Mon Aug 15 09:19:21 2016 (r304138) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c Mon Aug 15 09:19:26 2016 (r304139) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. @@ -1116,9 +1116,9 @@ dmu_objset_sync(objset_t *os, zio_t *pio zio = arc_write(pio, os->os_spa, tx->tx_txg, os->os_rootbp, os->os_phys_buf, DMU_OS_IS_L2CACHEABLE(os), - DMU_OS_IS_L2COMPRESSIBLE(os), &zp, dmu_objset_write_ready, - NULL, dmu_objset_write_done, os, ZIO_PRIORITY_ASYNC_WRITE, - ZIO_FLAG_MUSTSUCCEED, &zb); + DMU_OS_IS_L2COMPRESSIBLE(os), + &zp, dmu_objset_write_ready, NULL, NULL, dmu_objset_write_done, + os, ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb); /* * Sync special dnodes - the parent IO for the sync is the root block Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Mon Aug 15 09:19:21 2016 (r304138) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Mon Aug 15 09:19:26 2016 (r304139) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2015 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved. */ @@ -60,20 +60,14 @@ dnode_increase_indirection(dnode_t *dn, dprintf("os=%p obj=%llu, increase to %d\n", dn->dn_objset, dn->dn_object, dn->dn_phys->dn_nlevels); - /* check for existing blkptrs in the dnode */ - for (i = 0; i < nblkptr; i++) - if (!BP_IS_HOLE(&dn->dn_phys->dn_blkptr[i])) - break; - if (i != nblkptr) { - /* transfer dnode's block pointers to new indirect block */ - (void) dbuf_read(db, NULL, DB_RF_MUST_SUCCEED|DB_RF_HAVESTRUCT); - ASSERT(db->db.db_data); - ASSERT(arc_released(db->db_buf)); - ASSERT3U(sizeof (blkptr_t) * nblkptr, <=, db->db.db_size); - bcopy(dn->dn_phys->dn_blkptr, db->db.db_data, - sizeof (blkptr_t) * nblkptr); - arc_buf_freeze(db->db_buf); - } + /* transfer dnode's block pointers to new indirect block */ + (void) dbuf_read(db, NULL, DB_RF_MUST_SUCCEED|DB_RF_HAVESTRUCT); + ASSERT(db->db.db_data); + ASSERT(arc_released(db->db_buf)); + ASSERT3U(sizeof (blkptr_t) * nblkptr, <=, db->db.db_size); + bcopy(dn->dn_phys->dn_blkptr, db->db.db_data, + sizeof (blkptr_t) * nblkptr); + arc_buf_freeze(db->db_buf); /* set dbuf's parent pointers to new indirect buf */ for (i = 0; i < nblkptr; i++) { Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Mon Aug 15 09:19:21 2016 (r304138) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Mon Aug 15 09:19:26 2016 (r304139) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ @@ -141,9 +141,11 @@ int arc_read(zio_t *pio, spa_t *spa, con arc_flags_t *arc_flags, const zbookmark_phys_t *zb); zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, boolean_t l2arc_compress, - const zio_prop_t *zp, arc_done_func_t *ready, arc_done_func_t *physdone, - arc_done_func_t *done, void *priv, zio_priority_t priority, - int zio_flags, const zbookmark_phys_t *zb); + const zio_prop_t *zp, + arc_done_func_t *ready, arc_done_func_t *child_ready, + arc_done_func_t *physdone, arc_done_func_t *done, + void *priv, zio_priority_t priority, int zio_flags, + const zbookmark_phys_t *zb); void arc_freed(spa_t *spa, const blkptr_t *bp); void arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *priv); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Aug 15 09:19:21 2016 (r304138) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Aug 15 09:19:26 2016 (r304139) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012, 2014 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ @@ -436,6 +436,7 @@ struct zio { /* Callback info */ zio_done_func_t *io_ready; + zio_done_func_t *io_children_ready; zio_done_func_t *io_physdone; zio_done_func_t *io_done; void *io_private; @@ -503,9 +504,10 @@ extern zio_t *zio_read(zio_t *pio, spa_t extern zio_t *zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, void *data, uint64_t size, const zio_prop_t *zp, - zio_done_func_t *ready, zio_done_func_t *physdone, zio_done_func_t *done, - void *priv, - zio_priority_t priority, enum zio_flag flags, const zbookmark_phys_t *zb); + zio_done_func_t *ready, zio_done_func_t *children_ready, + zio_done_func_t *physdone, zio_done_func_t *done, + void *priv, zio_priority_t priority, enum zio_flag flags, + const zbookmark_phys_t *zb); extern zio_t *zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, void *data, uint64_t size, zio_done_func_t *done, void *priv, Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Aug 15 09:19:21 2016 (r304138) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Aug 15 09:19:26 2016 (r304139) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -771,9 +771,10 @@ zio_read(zio_t *pio, spa_t *spa, const b zio_t * zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, void *data, uint64_t size, const zio_prop_t *zp, - zio_done_func_t *ready, zio_done_func_t *physdone, zio_done_func_t *done, - void *private, - zio_priority_t priority, enum zio_flag flags, const zbookmark_phys_t *zb) + zio_done_func_t *ready, zio_done_func_t *children_ready, + zio_done_func_t *physdone, zio_done_func_t *done, + void *private, zio_priority_t priority, enum zio_flag flags, + const zbookmark_phys_t *zb) { zio_t *zio; @@ -792,6 +793,7 @@ zio_write(zio_t *pio, spa_t *spa, uint64 ZIO_DDT_CHILD_WRITE_PIPELINE : ZIO_WRITE_PIPELINE); zio->io_ready = ready; + zio->io_children_ready = children_ready; zio->io_physdone = physdone; zio->io_prop = *zp; @@ -1189,6 +1191,16 @@ zio_write_bp_init(zio_t *zio) if (!IO_IS_ALLOCATING(zio)) return (ZIO_PIPELINE_CONTINUE); + if (zio->io_children_ready != NULL) { + /* + * Now that all our children are ready, run the callback + * associated with this zio in case it wants to modify the + * data to be written. + */ + ASSERT3U(zp->zp_level, >, 0); + zio->io_children_ready(zio); + } + ASSERT(zio->io_child_type != ZIO_CHILD_DDT); if (zio->io_bp_override) { @@ -2118,9 +2130,9 @@ zio_write_gang_block(zio_t *pio) zio_nowait(zio_write(zio, spa, txg, &gbh->zg_blkptr[g], (char *)pio->io_data + (pio->io_size - resid), lsize, &zp, - zio_write_gang_member_ready, NULL, NULL, &gn->gn_child[g], - pio->io_priority, ZIO_GANG_CHILD_FLAGS(pio), - &pio->io_bookmark)); + zio_write_gang_member_ready, NULL, NULL, NULL, + &gn->gn_child[g], pio->io_priority, + ZIO_GANG_CHILD_FLAGS(pio), &pio->io_bookmark)); } /* @@ -2509,7 +2521,7 @@ zio_ddt_write(zio_t *zio) dio = zio_write(zio, spa, txg, bp, zio->io_orig_data, zio->io_orig_size, &czp, NULL, NULL, - zio_ddt_ditto_write_done, dde, zio->io_priority, + NULL, zio_ddt_ditto_write_done, dde, zio->io_priority, ZIO_DDT_CHILD_FLAGS(zio), &zio->io_bookmark); zio_push_transform(dio, zio->io_data, zio->io_size, 0, NULL); @@ -2530,7 +2542,8 @@ zio_ddt_write(zio_t *zio) ddt_phys_addref(ddp); } else { cio = zio_write(zio, spa, txg, bp, zio->io_orig_data, - zio->io_orig_size, zp, zio_ddt_child_write_ready, NULL, + zio->io_orig_size, zp, + zio_ddt_child_write_ready, NULL, NULL, zio_ddt_child_write_done, dde, zio->io_priority, ZIO_DDT_CHILD_FLAGS(zio), &zio->io_bookmark); From owner-svn-src-all@freebsd.org Mon Aug 15 09:23:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D323BBAD6D; Mon, 15 Aug 2016 09:23:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F5F01890; Mon, 15 Aug 2016 09:23:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F9N9Cr069127; Mon, 15 Aug 2016 09:23:09 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F9N9AA069125; Mon, 15 Aug 2016 09:23:09 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201608150923.u7F9N9AA069125@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 15 Aug 2016 09:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304140 - in head/sys/arm64: arm64 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:23:10 -0000 Author: andrew Date: Mon Aug 15 09:23:08 2016 New Revision: 304140 URL: https://svnweb.freebsd.org/changeset/base/304140 Log: Add the ARMv8.1 identification registers to the list we print when booting. MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/arm64/identcpu.c head/sys/arm64/include/armreg.h Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Mon Aug 15 09:19:26 2016 (r304139) +++ head/sys/arm64/arm64/identcpu.c Mon Aug 15 09:23:08 2016 (r304140) @@ -188,6 +188,27 @@ print_cpu_features(u_int cpu) if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_ISAR0) != 0) { printed = 0; printf(" Instruction Set Attributes 0 = <"); + + switch (ID_AA64ISAR0_RDM(cpu_desc[cpu].id_aa64isar0)) { + case ID_AA64ISAR0_RDM_NONE: + break; + case ID_AA64ISAR0_RDM_IMPL: + printf("%sRDM", SEP_STR); + break; + default: + printf("%sUnknown RDM", SEP_STR); + } + + switch (ID_AA64ISAR0_ATOMIC(cpu_desc[cpu].id_aa64isar0)) { + case ID_AA64ISAR0_ATOMIC_NONE: + break; + case ID_AA64ISAR0_ATOMIC_IMPL: + printf("%sAtomic", SEP_STR); + break; + default: + printf("%sUnknown Atomic", SEP_STR); + } + switch (ID_AA64ISAR0_AES(cpu_desc[cpu].id_aa64isar0)) { case ID_AA64ISAR0_AES_NONE: break; @@ -466,8 +487,82 @@ print_cpu_features(u_int cpu) /* AArch64 Memory Model Feature Register 1 */ if (cpu == 0 || (cpu_print_regs & PRINT_ID_AA64_MMFR1) != 0) { - printf(" Memory Model Features 1 = <%#lx>\n", - cpu_desc[cpu].id_aa64mmfr1); + printed = 0; + printf(" Memory Model Features 1 = <"); + + switch (ID_AA64MMFR1_PAN(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_PAN_NONE: + break; + case ID_AA64MMFR1_PAN_IMPL: + printf("%sPAN", SEP_STR); + break; + default: + printf("%sUnknown PAN", SEP_STR); + break; + } + + switch (ID_AA64MMFR1_LO(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_LO_NONE: + break; + case ID_AA64MMFR1_LO_IMPL: + printf("%sLO", SEP_STR); + break; + default: + printf("%sUnknown LO", SEP_STR); + break; + } + + switch (ID_AA64MMFR1_HPDS(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_HPDS_NONE: + break; + case ID_AA64MMFR1_HPDS_IMPL: + printf("%sHPDS", SEP_STR); + break; + default: + printf("%sUnknown HPDS", SEP_STR); + break; + } + + switch (ID_AA64MMFR1_VH(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_VH_NONE: + break; + case ID_AA64MMFR1_VH_IMPL: + printf("%sVHE", SEP_STR); + break; + default: + printf("%sUnknown VHE", SEP_STR); + break; + } + + switch (ID_AA64MMFR1_VMIDBITS(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_VMIDBITS_8: + break; + case ID_AA64MMFR1_VMIDBITS_16: + printf("%s16 VMID bits", SEP_STR); + break; + default: + printf("%sUnknown VMID bits", SEP_STR); + break; + } + + switch (ID_AA64MMFR1_HAFDBS(cpu_desc[cpu].id_aa64mmfr1)) { + case ID_AA64MMFR1_HAFDBS_NONE: + break; + case ID_AA64MMFR1_HAFDBS_AF: + printf("%sAF", SEP_STR); + break; + case ID_AA64MMFR1_HAFDBS_AF_DBS: + printf("%sAF+DBS", SEP_STR); + break; + default: + printf("%sUnknown Hardware update AF/DBS", SEP_STR); + break; + } + + if ((cpu_desc[cpu].id_aa64mmfr1 & ~ID_AA64MMFR1_MASK) != 0) + printf("%s%#lx", SEP_STR, + cpu_desc[cpu].id_aa64mmfr1 & ~ID_AA64MMFR1_MASK); + printf(">\n"); } /* AArch64 Debug Feature Register 0 */ @@ -489,6 +584,9 @@ print_cpu_features(u_int cpu) case ID_AA64DFR0_PMU_VER_3: printf("%sPMUv3", SEP_STR); break; + case ID_AA64DFR0_PMU_VER_3_1: + printf("%sPMUv3+16 bit evtCount", SEP_STR); + break; case ID_AA64DFR0_PMU_VER_IMPL: printf("%sImplementation defined PMU", SEP_STR); break; @@ -512,6 +610,9 @@ print_cpu_features(u_int cpu) case ID_AA64DFR0_DEBUG_VER_8: printf("%sDebug v8", SEP_STR); break; + case ID_AA64DFR0_DEBUG_VER_8_VHE: + printf("%sDebug v8+VHE", SEP_STR); + break; default: printf("%sUnknown Debug", SEP_STR); break; Modified: head/sys/arm64/include/armreg.h ============================================================================== --- head/sys/arm64/include/armreg.h Mon Aug 15 09:19:26 2016 (r304139) +++ head/sys/arm64/include/armreg.h Mon Aug 15 09:23:08 2016 (r304140) @@ -172,6 +172,7 @@ #define ID_AA64DFR0_DEBUG_VER_MASK (0xf << ID_AA64DFR0_DEBUG_VER_SHIFT) #define ID_AA64DFR0_DEBUG_VER(x) ((x) & ID_AA64DFR0_DEBUG_VER_MASK) #define ID_AA64DFR0_DEBUG_VER_8 (0x6 << ID_AA64DFR0_DEBUG_VER_SHIFT) +#define ID_AA64DFR0_DEBUG_VER_8_VHE (0x7 << ID_AA64DFR0_DEBUG_VER_SHIFT) #define ID_AA64DFR0_TRACE_VER_SHIFT 4 #define ID_AA64DFR0_TRACE_VER_MASK (0xf << ID_AA64DFR0_TRACE_VER_SHIFT) #define ID_AA64DFR0_TRACE_VER(x) ((x) & ID_AA64DFR0_TRACE_VER_MASK) @@ -182,6 +183,7 @@ #define ID_AA64DFR0_PMU_VER(x) ((x) & ID_AA64DFR0_PMU_VER_MASK) #define ID_AA64DFR0_PMU_VER_NONE (0x0 << ID_AA64DFR0_PMU_VER_SHIFT) #define ID_AA64DFR0_PMU_VER_3 (0x1 << ID_AA64DFR0_PMU_VER_SHIFT) +#define ID_AA64DFR0_PMU_VER_3_1 (0x4 << ID_AA64DFR0_PMU_VER_SHIFT) #define ID_AA64DFR0_PMU_VER_IMPL (0xf << ID_AA64DFR0_PMU_VER_SHIFT) #define ID_AA64DFR0_BRPS_SHIFT 12 #define ID_AA64DFR0_BRPS_MASK (0xf << ID_AA64DFR0_BRPS_SHIFT) @@ -197,7 +199,7 @@ ((((x) >> ID_AA64DFR0_CTX_CMPS_SHIFT) & 0xf) + 1) /* ID_AA64ISAR0_EL1 */ -#define ID_AA64ISAR0_MASK 0x000ffff0 +#define ID_AA64ISAR0_MASK 0xf0fffff0 #define ID_AA64ISAR0_AES_SHIFT 4 #define ID_AA64ISAR0_AES_MASK (0xf << ID_AA64ISAR0_AES_SHIFT) #define ID_AA64ISAR0_AES(x) ((x) & ID_AA64ISAR0_AES_MASK) @@ -219,6 +221,16 @@ #define ID_AA64ISAR0_CRC32(x) ((x) & ID_AA64ISAR0_CRC32_MASK) #define ID_AA64ISAR0_CRC32_NONE (0x0 << ID_AA64ISAR0_CRC32_SHIFT) #define ID_AA64ISAR0_CRC32_BASE (0x1 << ID_AA64ISAR0_CRC32_SHIFT) +#define ID_AA64ISAR0_ATOMIC_SHIFT 20 +#define ID_AA64ISAR0_ATOMIC_MASK (0xf << ID_AA64ISAR0_ATOMIC_SHIFT) +#define ID_AA64ISAR0_ATOMIC(x) ((x) & ID_AA64ISAR0_ATOMIC_MASK) +#define ID_AA64ISAR0_ATOMIC_NONE (0x0 << ID_AA64ISAR0_ATOMIC_SHIFT) +#define ID_AA64ISAR0_ATOMIC_IMPL (0x2 << ID_AA64ISAR0_ATOMIC_SHIFT) +#define ID_AA64ISAR0_RDM_SHIFT 28 +#define ID_AA64ISAR0_RDM_MASK (0xf << ID_AA64ISAR0_RDM_SHIFT) +#define ID_AA64ISAR0_RDM(x) ((x) & ID_AA64ISAR0_RDM_MASK) +#define ID_AA64ISAR0_RDM_NONE (0x0 << ID_AA64ISAR0_RDM_SHIFT) +#define ID_AA64ISAR0_RDM_IMPL (0x1 << ID_AA64ISAR0_RDM_SHIFT) /* ID_AA64MMFR0_EL1 */ #define ID_AA64MMFR0_MASK 0xffffffff @@ -267,6 +279,40 @@ #define ID_AA64MMFR0_TGRAN4_IMPL (0x0 << ID_AA64MMFR0_TGRAN4_SHIFT) #define ID_AA64MMFR0_TGRAN4_NONE (0xf << ID_AA64MMFR0_TGRAN4_SHIFT) +/* ID_AA64MMFR1_EL1 */ +#define ID_AA64MMFR1_MASK 0x00ffffff +#define ID_AA64MMFR1_HAFDBS_SHIFT 0 +#define ID_AA64MMFR1_HAFDBS_MASK (0xf << ID_AA64MMFR1_HAFDBS_SHIFT) +#define ID_AA64MMFR1_HAFDBS(x) ((x) & ID_AA64MMFR1_HAFDBS_MASK) +#define ID_AA64MMFR1_HAFDBS_NONE (0x0 << ID_AA64MMFR1_HAFDBS_SHIFT) +#define ID_AA64MMFR1_HAFDBS_AF (0x1 << ID_AA64MMFR1_HAFDBS_SHIFT) +#define ID_AA64MMFR1_HAFDBS_AF_DBS (0x2 << ID_AA64MMFR1_HAFDBS_SHIFT) +#define ID_AA64MMFR1_VMIDBITS_SHIFT 4 +#define ID_AA64MMFR1_VMIDBITS_MASK (0xf << ID_AA64MMFR1_VMIDBITS_SHIFT) +#define ID_AA64MMFR1_VMIDBITS(x) ((x) & ID_AA64MMFR1_VMIDBITS_MASK) +#define ID_AA64MMFR1_VMIDBITS_8 (0x0 << ID_AA64MMFR1_VMIDBITS_SHIFT) +#define ID_AA64MMFR1_VMIDBITS_16 (0x2 << ID_AA64MMFR1_VMIDBITS_SHIFT) +#define ID_AA64MMFR1_VH_SHIFT 8 +#define ID_AA64MMFR1_VH_MASK (0xf << ID_AA64MMFR1_VH_SHIFT) +#define ID_AA64MMFR1_VH(x) ((x) & ID_AA64MMFR1_VH_MASK) +#define ID_AA64MMFR1_VH_NONE (0x0 << ID_AA64MMFR1_VH_SHIFT) +#define ID_AA64MMFR1_VH_IMPL (0x1 << ID_AA64MMFR1_VH_SHIFT) +#define ID_AA64MMFR1_HPDS_SHIFT 12 +#define ID_AA64MMFR1_HPDS_MASK (0xf << ID_AA64MMFR1_HPDS_SHIFT) +#define ID_AA64MMFR1_HPDS(x) ((x) & ID_AA64MMFR1_HPDS_MASK) +#define ID_AA64MMFR1_HPDS_NONE (0x0 << ID_AA64MMFR1_HPDS_SHIFT) +#define ID_AA64MMFR1_HPDS_IMPL (0x1 << ID_AA64MMFR1_HPDS_SHIFT) +#define ID_AA64MMFR1_LO_SHIFT 16 +#define ID_AA64MMFR1_LO_MASK (0xf << ID_AA64MMFR1_LO_SHIFT) +#define ID_AA64MMFR1_LO(x) ((x) & ID_AA64MMFR1_LO_MASK) +#define ID_AA64MMFR1_LO_NONE (0x0 << ID_AA64MMFR1_LO_SHIFT) +#define ID_AA64MMFR1_LO_IMPL (0x1 << ID_AA64MMFR1_LO_SHIFT) +#define ID_AA64MMFR1_PAN_SHIFT 20 +#define ID_AA64MMFR1_PAN_MASK (0xf << ID_AA64MMFR1_PAN_SHIFT) +#define ID_AA64MMFR1_PAN(x) ((x) & ID_AA64MMFR1_PAN_MASK) +#define ID_AA64MMFR1_PAN_NONE (0x0 << ID_AA64MMFR1_PAN_SHIFT) +#define ID_AA64MMFR1_PAN_IMPL (0x1 << ID_AA64MMFR1_PAN_SHIFT) + /* ID_AA64PFR0_EL1 */ #define ID_AA64PFR0_MASK 0x0fffffff #define ID_AA64PFR0_EL0_SHIFT 0 From owner-svn-src-all@freebsd.org Mon Aug 15 09:24:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7342FBBAE1A; Mon, 15 Aug 2016 09:24:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 4CF081A28; Mon, 15 Aug 2016 09:24:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 3911118BA; Mon, 15 Aug 2016 09:24:47 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id E5D951A848; Mon, 15 Aug 2016 09:24:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id mOq0gK9RogEG; Mon, 15 Aug 2016 09:24:44 +0000 (UTC) Subject: Re: svn commit: r303019 - head/sys/geom DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com A961F1A843 To: Warner Losh , Ngie Cooper References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> <7372bf93-69a2-f5f5-1d07-204fd31f252c@FreeBSD.org> <20160812151117.GA52309@mithlond.kdm.org> <20160812151745.GA52527@mithlond.kdm.org> Cc: "Kenneth D. Merry" , "Andrey V. Elsukov" , Peter Wemm , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , src-committers From: Bryan Drewery Organization: FreeBSD Message-ID: <8c39aecd-d9b5-615e-455f-7f35c0616470@FreeBSD.org> Date: Mon, 15 Aug 2016 10:24:40 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="JKuIoU9JciIhoC98rqA0Ip4rxHc4R5f7F" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:24:47 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --JKuIoU9JciIhoC98rqA0Ip4rxHc4R5f7F Content-Type: multipart/mixed; boundary="xLPgIbPwd4waUXgBw3KtR912TJLqhBUkq" From: Bryan Drewery To: Warner Losh , Ngie Cooper Cc: "Kenneth D. Merry" , "Andrey V. Elsukov" , Peter Wemm , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , src-committers Message-ID: <8c39aecd-d9b5-615e-455f-7f35c0616470@FreeBSD.org> Subject: Re: svn commit: r303019 - head/sys/geom References: <201607190536.u6J5aLl7015268@repo.freebsd.org> <3277576.dFZ2EGo2Fh@overcee.wemm.org> <6198652.UmU69kS6Zt@overcee.wemm.org> <181fcc35-3a5d-043f-7dc4-7a01a53eebae@FreeBSD.org> <7372bf93-69a2-f5f5-1d07-204fd31f252c@FreeBSD.org> <20160812151117.GA52309@mithlond.kdm.org> <20160812151745.GA52527@mithlond.kdm.org> In-Reply-To: --xLPgIbPwd4waUXgBw3KtR912TJLqhBUkq Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/13/16 5:45 AM, Warner Losh wrote: > On Fri, Aug 12, 2016 at 3:06 PM, Ngie Cooper wr= ote: >> On Fri, Aug 12, 2016 at 8:23 AM, Bryan Drewery = wrote: >> >> ... >> >>> No, I was missing r303637. Hard to say if it is related... Andrey sa= ys >>> it's not. I haven't dived into it yet and it's so far only happened >>> once (out of a few tests). We do have various customizations but I'm= >>> inclined to think it's the stock code having problems. >> >> I hit it again on our internal vendor tree (what bdrewery was noting >> previously). I can provide some details about the panic if need be. >=20 > Ideally, you'd reproduce it on an unmodified -current. In a vendor tree= there's > many chances that something else is odd or off that would make it hard = for > the community to help. >=20 > Warner >=20 #4 0xffffffff80477b82 in g_resize_provider_event (arg=3D0xfffff80007f8d3a0, flag=3D) at /b/mnt/src/sys/geom/geom_subr.c:668 668 KASSERT(!(pp->flags & G_PF_WITHER), (gdb) p pp->mediasize $2 =3D 0 It seems that r303637 really does cover the panic we're hitting since the g_resize_provider_event was posted with mediasize=3D=3D0 which r30363= 7 avoids. --=20 Regards, Bryan Drewery --xLPgIbPwd4waUXgBw3KtR912TJLqhBUkq-- --JKuIoU9JciIhoC98rqA0Ip4rxHc4R5f7F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXsYpZAAoJEDXXcbtuRpfPtzsIAM1iTnWgen4l5t6XEvtktGwg S23dRkhmnjyDzqDQJQNhL44wZEjeHdLGsGGg9CHIkkh7yf5p8YHJC3TTTk5cOm7E rGxnKt+EmbQ0O1g5IS9Qtp6RG4nWI0/+vOe542L+Sd4V+/xTxSNjSSck5lBbMczP XSktR6SPlLszqUgq1iQTd4CxkLrG7nCn7YqPTqvuxJ7yPkVJfj9LsOvW9f0Qnk5F URVVNJmX2UzNdEgYpYsv12lYRLLZ16Jj2LRogyt3b2V+i/rvV5R9s1wQHdY0EhyD XMkIMSBCeT1VSt51FOnKl2E4O4+4dR+mBK26I9qL/z7fSoprZmrrfBSPNzt1q7Y= =g8vW -----END PGP SIGNATURE----- --JKuIoU9JciIhoC98rqA0Ip4rxHc4R5f7F-- From owner-svn-src-all@freebsd.org Mon Aug 15 09:27:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8D71BBAF42; Mon, 15 Aug 2016 09:27:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB07B1D13; Mon, 15 Aug 2016 09:27:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F9RFmT069415; Mon, 15 Aug 2016 09:27:15 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F9RFJg069414; Mon, 15 Aug 2016 09:27:15 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608150927.u7F9RFJg069414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 09:27: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: r304141 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:27:17 -0000 Author: avg Date: Mon Aug 15 09:27:15 2016 New Revision: 304141 URL: https://svnweb.freebsd.org/changeset/base/304141 Log: Revert r304120: MFC r302839: 6940 Cannot unlink directories when over quota There is no dmu_tx_mark_netfree() function in this branch. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 15 09:23:08 2016 (r304140) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Aug 15 09:27:15 2016 (r304141) @@ -2360,7 +2360,6 @@ top: dmu_tx_hold_zap(tx, zfsvfs->z_unlinkedobj, FALSE, NULL); zfs_sa_upgrade_txholds(tx, zp); zfs_sa_upgrade_txholds(tx, dzp); - dmu_tx_mark_netfree(tx); error = dmu_tx_assign(tx, waited ? TXG_WAITED : TXG_NOWAIT); if (error) { rw_exit(&zp->z_parent_lock); From owner-svn-src-all@freebsd.org Mon Aug 15 09:30:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17327BBA01B; Mon, 15 Aug 2016 09:30:23 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9CB61EB1; Mon, 15 Aug 2016 09:30:22 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F9ULud069577; Mon, 15 Aug 2016 09:30:21 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F9UL1V069576; Mon, 15 Aug 2016 09:30:21 GMT (envelope-from des@FreeBSD.org) Message-Id: <201608150930.u7F9UL1V069576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Mon, 15 Aug 2016 09:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:30:23 -0000 Author: des Date: Mon Aug 15 09:30:21 2016 New Revision: 304142 URL: https://svnweb.freebsd.org/changeset/base/304142 Log: Ensure that the sector size is a multiple of 4096 to avoid creating unaligned partitions when the actual sector size is hidden from us. PR: 211361 MFC after: 3 days Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Aug 15 09:27:15 2016 (r304141) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Aug 15 09:30:21 2016 (r304142) @@ -795,6 +795,7 @@ gpart_max_free(struct ggeom *geom, intma { struct gconfig *gc; struct gprovider *pp, **providers; + intmax_t sectorsize, stripesize, offset; intmax_t lastend; intmax_t start, end; intmax_t maxsize, maxstart; @@ -845,12 +846,25 @@ gpart_max_free(struct ggeom *geom, intma pp = LIST_FIRST(&geom->lg_consumer)->lg_provider; - /* Compute beginning of new partition and maximum available space */ - if (pp->lg_stripesize > 0 && - (maxstart*pp->lg_sectorsize % pp->lg_stripesize) != 0) { - intmax_t offset = (pp->lg_stripesize - - ((maxstart*pp->lg_sectorsize) % pp->lg_stripesize)) / - pp->lg_sectorsize; + /* + * Round the start and size of the largest available space up to + * the nearest multiple of the adjusted stripe size. + * + * The adjusted stripe size is the least common multiple of the + * actual stripe size, or the sector size if no stripe size was + * reported, and 4096. The reason for this is that contemporary + * disks often have 4096-byte physical sectors but report 512 + * bytes instead for compatibility with older / broken operating + * systems and BIOSes. For the same reasons, virtualized storage + * may also report a 512-byte stripe size, or none at all. + */ + sectorsize = pp->lg_sectorsize; + if ((stripesize = pp->lg_stripesize) == 0) + stripesize = sectorsize; + while (stripesize % 4096 != 0) + stripesize *= 2; + if ((offset = maxstart * sectorsize % stripesize) != 0) { + offset = (stripesize - offset) / sectorsize; maxstart += offset; maxsize -= offset; } From owner-svn-src-all@freebsd.org Mon Aug 15 09:36:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E987FBBA35A; Mon, 15 Aug 2016 09:36:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB32D1648; Mon, 15 Aug 2016 09:36:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F9ahxN073497; Mon, 15 Aug 2016 09:36:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F9ahwi073496; Mon, 15 Aug 2016 09:36:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608150936.u7F9ahwi073496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 15 Aug 2016 09:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304143 - stable/11/usr.bin/truss X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:36:45 -0000 Author: bdrewery Date: Mon Aug 15 09:36:43 2016 New Revision: 304143 URL: https://svnweb.freebsd.org/changeset/base/304143 Log: MFC r303934,r303937,r303942: r303934: Support rmdir(2). r303937: Use proper argument length for rmdir(2) for r303934. r303942: Fix sorting in r303934. Modified: stable/11/usr.bin/truss/syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/truss/syscalls.c ============================================================================== --- stable/11/usr.bin/truss/syscalls.c Mon Aug 15 09:30:21 2016 (r304142) +++ stable/11/usr.bin/truss/syscalls.c Mon Aug 15 09:36:43 2016 (r304143) @@ -281,6 +281,8 @@ static struct syscall decoded_syscalls[] .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 } } }, { .name = "rfork", .ret_type = 1, .nargs = 1, .args = { { Rforkflags, 0 } } }, + { .name = "rmdir", .ret_type = 1, .nargs = 1, + .args = { { Name, 0 } } }, { .name = "select", .ret_type = 1, .nargs = 5, .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 }, { Timeval, 4 } } }, From owner-svn-src-all@freebsd.org Mon Aug 15 09:37:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8125ABBA3CF; Mon, 15 Aug 2016 09:37:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D76517B4; Mon, 15 Aug 2016 09:37:59 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F9bwEE073623; Mon, 15 Aug 2016 09:37:58 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F9bwIK073620; Mon, 15 Aug 2016 09:37:58 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608150937.u7F9bwIK073620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 15 Aug 2016 09:37:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304144 - stable/11/share/mk X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:37:59 -0000 Author: bdrewery Date: Mon Aug 15 09:37:58 2016 New Revision: 304144 URL: https://svnweb.freebsd.org/changeset/base/304144 Log: MFC r303964: PROGS: Support INTERNALPROG.prog=yes to not install it. Modified: stable/11/share/mk/bsd.README stable/11/share/mk/bsd.progs.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/bsd.README ============================================================================== --- stable/11/share/mk/bsd.README Mon Aug 15 09:36:43 2016 (r304143) +++ stable/11/share/mk/bsd.README Mon Aug 15 09:37:58 2016 (r304144) @@ -331,6 +331,7 @@ PROGS_CXX PROG and PROGS_CXX in one Make - DEBUG_FLAGS - DPADD - DPSRCS + - INTERNALPROG (no installation) - LDADD - LDFLAGS - LIBADD Modified: stable/11/share/mk/bsd.progs.mk ============================================================================== --- stable/11/share/mk/bsd.progs.mk Mon Aug 15 09:36:43 2016 (r304143) +++ stable/11/share/mk/bsd.progs.mk Mon Aug 15 09:37:58 2016 (r304144) @@ -24,8 +24,8 @@ PROGS += ${PROGS_CXX} # just one of many PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ PROGNAME SRCS STRIP WARNS -PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD LDADD LIBADD LINKS \ - LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} +PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD INTERNALPROG LDADD LIBADD \ + LINKS LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} .if empty(${PROG_OVERRIDE_VARS:M$v}) .if defined(${v}.${PROG}) From owner-svn-src-all@freebsd.org Mon Aug 15 09:39:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58E24BBA484; Mon, 15 Aug 2016 09:39:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 294F91A23; Mon, 15 Aug 2016 09:39:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F9dQa6073878; Mon, 15 Aug 2016 09:39:26 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7F9dQ68073876; Mon, 15 Aug 2016 09:39:26 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608150939.u7F9dQ68073876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 15 Aug 2016 09:39:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304145 - stable/10/share/mk X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 09:39:27 -0000 Author: bdrewery Date: Mon Aug 15 09:39:26 2016 New Revision: 304145 URL: https://svnweb.freebsd.org/changeset/base/304145 Log: MFC r303964: PROGS: Support INTERNALPROG.prog=yes to not install it. Modified: stable/10/share/mk/bsd.README stable/10/share/mk/bsd.progs.mk Directory Properties: stable/10/ (props changed) Modified: stable/10/share/mk/bsd.README ============================================================================== --- stable/10/share/mk/bsd.README Mon Aug 15 09:37:58 2016 (r304144) +++ stable/10/share/mk/bsd.README Mon Aug 15 09:39:26 2016 (r304145) @@ -272,6 +272,7 @@ PROGS_CXX PROG and PROGS_CXX in one Make - DEBUG_FLAGS - DPADD - DPSRCS + - INTERNALPROG (no installation) - LDADD - LDFLAGS - LINKS Modified: stable/10/share/mk/bsd.progs.mk ============================================================================== --- stable/10/share/mk/bsd.progs.mk Mon Aug 15 09:37:58 2016 (r304144) +++ stable/10/share/mk/bsd.progs.mk Mon Aug 15 09:39:26 2016 (r304145) @@ -35,8 +35,8 @@ UPDATE_DEPENDFILE_PROG?= no # just one of many PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ PROGNAME SRCS STRIP WARNS -PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD LDADD LIBADD LINKS \ - LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} +PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD INTERNALPROG LDADD LIBADD \ + LINKS LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} .if empty(${PROG_OVERRIDE_VARS:M$v}) .if defined(${v}.${PROG}) From owner-svn-src-all@freebsd.org Mon Aug 15 10:16:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32D7EBB9218; Mon, 15 Aug 2016 10:16:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05A121F40; Mon, 15 Aug 2016 10:16:08 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FAG8W5088722; Mon, 15 Aug 2016 10:16:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FAG8RF088721; Mon, 15 Aug 2016 10:16:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608151016.u7FAG8RF088721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 15 Aug 2016 10:16:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304146 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 10:16:09 -0000 Author: tuexen Date: Mon Aug 15 10:16:08 2016 New Revision: 304146 URL: https://svnweb.freebsd.org/changeset/base/304146 Log: Ensure that sctp_it_ctl.cur_it does not point to a free object (during a small time window). Thanks to Byron Campen for reporting the issue and suggesting a fix. MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon Aug 15 09:39:26 2016 (r304145) +++ head/sys/netinet/sctputil.c Mon Aug 15 10:16:08 2016 (r304146) @@ -1280,6 +1280,7 @@ sctp_iterator_work(struct sctp_iterator SCTP_INP_INFO_RLOCK(); SCTP_ITERATOR_LOCK(); + sctp_it_ctl.cur_it = it; if (it->inp) { SCTP_INP_RLOCK(it->inp); SCTP_INP_DECR_REF(it->inp); @@ -1287,6 +1288,7 @@ sctp_iterator_work(struct sctp_iterator if (it->inp == NULL) { /* iterator is complete */ done_with_iterator: + sctp_it_ctl.cur_it = NULL; SCTP_ITERATOR_UNLOCK(); SCTP_INP_INFO_RUNLOCK(); if (it->function_atend != NULL) { @@ -1427,13 +1429,11 @@ sctp_iterator_worker(void) sctp_it_ctl.iterator_running = 1; TAILQ_FOREACH_SAFE(it, &sctp_it_ctl.iteratorhead, sctp_nxt_itr, nit) { - sctp_it_ctl.cur_it = it; /* now lets work on this one */ TAILQ_REMOVE(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); SCTP_IPI_ITERATOR_WQ_UNLOCK(); CURVNET_SET(it->vn); sctp_iterator_work(it); - sctp_it_ctl.cur_it = NULL; CURVNET_RESTORE(); SCTP_IPI_ITERATOR_WQ_LOCK(); /* sa_ignore FREED_MEMORY */ From owner-svn-src-all@freebsd.org Mon Aug 15 10:46:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89E4EBB9B44; Mon, 15 Aug 2016 10:46:34 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D1DF1E64; Mon, 15 Aug 2016 10:46:34 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FAkXr8099608; Mon, 15 Aug 2016 10:46:33 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FAkX5g099607; Mon, 15 Aug 2016 10:46:33 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151046.u7FAkX5g099607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 10:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304147 - head/sys/i386/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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 10:46:34 -0000 Author: bde Date: Mon Aug 15 10:46:33 2016 New Revision: 304147 URL: https://svnweb.freebsd.org/changeset/base/304147 Log: Remove duplicate definition of get_pcb_td(). gcc works for detecting this error. Modified: head/sys/i386/include/md_var.h Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Mon Aug 15 10:16:08 2016 (r304146) +++ head/sys/i386/include/md_var.h Mon Aug 15 10:46:33 2016 (r304147) @@ -69,6 +69,5 @@ void ppro_reenable_apic(void); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); union savefpu *get_pcb_user_save_td(struct thread *td); union savefpu *get_pcb_user_save_pcb(struct pcb *pcb); -struct pcb *get_pcb_td(struct thread *td); #endif /* !_MACHINE_MD_VAR_H_ */ From owner-svn-src-all@freebsd.org Mon Aug 15 11:16:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24AEEBBA538; Mon, 15 Aug 2016 11:16:45 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E90911F4C; Mon, 15 Aug 2016 11:16:44 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FBGidO011277; Mon, 15 Aug 2016 11:16:44 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FBGiqY011276; Mon, 15 Aug 2016 11:16:44 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608151116.u7FBGiqY011276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 15 Aug 2016 11:16:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304148 - stable/11/sys/arm64/arm64 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 11:16:45 -0000 Author: ed Date: Mon Aug 15 11:16:43 2016 New Revision: 304148 URL: https://svnweb.freebsd.org/changeset/base/304148 Log: MFC r303923: Make cpu_set_user_tls() work when called on the running thread. On all the other architectures, this function can also be called on the currently running thread. In this case, we shouldn't fix up the address in the PCB, but also patch up the register itself. Otherwise it will not become active and will simply become overwritten by the next switch. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D7437 Modified: stable/11/sys/arm64/arm64/vm_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm64/arm64/vm_machdep.c ============================================================================== --- stable/11/sys/arm64/arm64/vm_machdep.c Mon Aug 15 10:46:33 2016 (r304147) +++ stable/11/sys/arm64/arm64/vm_machdep.c Mon Aug 15 11:16:43 2016 (r304148) @@ -201,6 +201,8 @@ cpu_set_user_tls(struct thread *td, void pcb = td->td_pcb; pcb->pcb_tpidr_el0 = (register_t)tls_base; + if (td == curthread) + WRITE_SPECIALREG(tpidr_el0, tls_base); return (0); } From owner-svn-src-all@freebsd.org Mon Aug 15 11:24:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54EC4BBA78E; Mon, 15 Aug 2016 11:24:32 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 241F5160D; Mon, 15 Aug 2016 11:24:32 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FBOVa3015074; Mon, 15 Aug 2016 11:24:31 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FBOUlp015068; Mon, 15 Aug 2016 11:24:30 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201608151124.u7FBOUlp015068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 15 Aug 2016 11:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304149 - head/sys/dev/e1000 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 11:24:32 -0000 Author: sbruno Date: Mon Aug 15 11:24:30 2016 New Revision: 304149 URL: https://svnweb.freebsd.org/changeset/base/304149 Log: e1000: Add support for Kaby Lake IDs Fixup some errors when transitioning to/from low power states. Submitted by: erj Reviewed by: Jeffery Piper (jeffrey.e.piper@intel.com) MFC after: 3 days Relnotes: yes Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D7478 Modified: head/sys/dev/e1000/e1000_api.c head/sys/dev/e1000/e1000_hw.h head/sys/dev/e1000/e1000_ich8lan.c head/sys/dev/e1000/e1000_ich8lan.h head/sys/dev/e1000/e1000_phy.c head/sys/dev/e1000/if_em.c Modified: head/sys/dev/e1000/e1000_api.c ============================================================================== --- head/sys/dev/e1000/e1000_api.c Mon Aug 15 11:16:43 2016 (r304148) +++ head/sys/dev/e1000/e1000_api.c Mon Aug 15 11:24:30 2016 (r304149) @@ -304,6 +304,10 @@ s32 e1000_set_mac_type(struct e1000_hw * case E1000_DEV_ID_PCH_SPT_I219_LM2: case E1000_DEV_ID_PCH_SPT_I219_V2: case E1000_DEV_ID_PCH_LBG_I219_LM3: + case E1000_DEV_ID_PCH_SPT_I219_LM4: + case E1000_DEV_ID_PCH_SPT_I219_V4: + case E1000_DEV_ID_PCH_SPT_I219_LM5: + case E1000_DEV_ID_PCH_SPT_I219_V5: mac->type = e1000_pch_spt; break; case E1000_DEV_ID_82575EB_COPPER: Modified: head/sys/dev/e1000/e1000_hw.h ============================================================================== --- head/sys/dev/e1000/e1000_hw.h Mon Aug 15 11:16:43 2016 (r304148) +++ head/sys/dev/e1000/e1000_hw.h Mon Aug 15 11:24:30 2016 (r304149) @@ -142,6 +142,10 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_SPT_I219_LM2 0x15B7 /* Sunrise Point-H PCH */ #define E1000_DEV_ID_PCH_SPT_I219_V2 0x15B8 /* Sunrise Point-H PCH */ #define E1000_DEV_ID_PCH_LBG_I219_LM3 0x15B9 /* LEWISBURG PCH */ +#define E1000_DEV_ID_PCH_SPT_I219_LM4 0x15D7 +#define E1000_DEV_ID_PCH_SPT_I219_V4 0x15D8 +#define E1000_DEV_ID_PCH_SPT_I219_LM5 0x15E3 +#define E1000_DEV_ID_PCH_SPT_I219_V5 0x15D6 #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 @@ -957,9 +961,13 @@ struct e1000_dev_spec_ich8lan { E1000_MUTEX nvm_mutex; E1000_MUTEX swflag_mutex; bool nvm_k1_enabled; + bool disable_k1_off; bool eee_disable; u16 eee_lp_ability; enum e1000_ulp_state ulp_state; + bool ulp_capability_disabled; + bool during_suspend_flow; + bool during_dpg_exit; }; struct e1000_dev_spec_82575 { Modified: head/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.c Mon Aug 15 11:16:43 2016 (r304148) +++ head/sys/dev/e1000/e1000_ich8lan.c Mon Aug 15 11:24:30 2016 (r304149) @@ -288,7 +288,7 @@ static void e1000_toggle_lanphypc_pch_lp mac_reg &= ~E1000_CTRL_LANPHYPC_VALUE; E1000_WRITE_REG(hw, E1000_CTRL, mac_reg); E1000_WRITE_FLUSH(hw); - usec_delay(10); + msec_delay(1); mac_reg &= ~E1000_CTRL_LANPHYPC_OVERRIDE; E1000_WRITE_REG(hw, E1000_CTRL, mac_reg); E1000_WRITE_FLUSH(hw); @@ -1625,7 +1625,17 @@ static s32 e1000_check_for_copper_link_i hw->phy.ops.write_reg_locked(hw, I217_PLL_CLOCK_GATE_REG, phy_reg); - } + + if (speed == SPEED_1000) { + hw->phy.ops.read_reg_locked(hw, HV_PM_CTRL, + &phy_reg); + + phy_reg |= HV_PM_CTRL_K1_CLK_REQ; + + hw->phy.ops.write_reg_locked(hw, HV_PM_CTRL, + phy_reg); + } + } hw->phy.ops.release(hw); if (ret_val) @@ -1718,7 +1728,8 @@ static s32 e1000_check_for_copper_link_i u32 pcieanacfg = E1000_READ_REG(hw, E1000_PCIEANACFG); u32 fextnvm6 = E1000_READ_REG(hw, E1000_FEXTNVM6); - if (pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE) + if ((pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE) && + (hw->dev_spec.ich8lan.disable_k1_off == FALSE)) fextnvm6 |= E1000_FEXTNVM6_K1_OFF_ENABLE; else fextnvm6 &= ~E1000_FEXTNVM6_K1_OFF_ENABLE; Modified: head/sys/dev/e1000/e1000_ich8lan.h ============================================================================== --- head/sys/dev/e1000/e1000_ich8lan.h Mon Aug 15 11:16:43 2016 (r304148) +++ head/sys/dev/e1000/e1000_ich8lan.h Mon Aug 15 11:24:30 2016 (r304149) @@ -239,7 +239,7 @@ /* PHY Power Management Control */ #define HV_PM_CTRL PHY_REG(770, 17) -#define HV_PM_CTRL_PLL_STOP_IN_K1_GIGA 0x100 +#define HV_PM_CTRL_K1_CLK_REQ 0x200 #define HV_PM_CTRL_K1_ENABLE 0x4000 #define I217_PLL_CLOCK_GATE_REG PHY_REG(772, 28) Modified: head/sys/dev/e1000/e1000_phy.c ============================================================================== --- head/sys/dev/e1000/e1000_phy.c Mon Aug 15 11:16:43 2016 (r304148) +++ head/sys/dev/e1000/e1000_phy.c Mon Aug 15 11:24:30 2016 (r304149) @@ -4146,12 +4146,13 @@ s32 e1000_read_phy_reg_mphy(struct e1000 *data = E1000_READ_REG(hw, E1000_MPHY_DATA); /* Disable access to mPHY if it was originally disabled */ - if (locked) { + if (locked) ready = e1000_is_mphy_ready(hw); - if (!ready) - return -E1000_ERR_PHY; - } - E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS); + if (!ready) + return -E1000_ERR_PHY; + E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, + E1000_MPHY_DIS_ACCESS); + return E1000_SUCCESS; } @@ -4210,12 +4211,13 @@ s32 e1000_write_phy_reg_mphy(struct e100 E1000_WRITE_REG(hw, E1000_MPHY_DATA, data); /* Disable access to mPHY if it was originally disabled */ - if (locked) { + if (locked) ready = e1000_is_mphy_ready(hw); - if (!ready) - return -E1000_ERR_PHY; - } - E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS); + if (!ready) + return -E1000_ERR_PHY; + E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, + E1000_MPHY_DIS_ACCESS); + return E1000_SUCCESS; } Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon Aug 15 11:16:43 2016 (r304148) +++ head/sys/dev/e1000/if_em.c Mon Aug 15 11:24:30 2016 (r304149) @@ -193,6 +193,12 @@ static em_vendor_info_t em_vendor_info_a { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V2, PCI_ANY_ID, PCI_ANY_ID, 0}, { 0x8086, E1000_DEV_ID_PCH_LBG_I219_LM3, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_LM4, + PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V4, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_LM5, + PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V5, PCI_ANY_ID, PCI_ANY_ID, 0}, /* required last entry */ { 0, 0, 0, 0, 0} }; From owner-svn-src-all@freebsd.org Mon Aug 15 11:54:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA803BBAD48; Mon, 15 Aug 2016 11:54:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CBC31376; Mon, 15 Aug 2016 11:54:30 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FBsT9m026017; Mon, 15 Aug 2016 11:54:29 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FBsTvk026016; Mon, 15 Aug 2016 11:54:29 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608151154.u7FBsTvk026016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 15 Aug 2016 11:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304150 - stable/10/usr.bin/truss X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 11:54:30 -0000 Author: bdrewery Date: Mon Aug 15 11:54:29 2016 New Revision: 304150 URL: https://svnweb.freebsd.org/changeset/base/304150 Log: MFC r303934,r303937,r303942: r303934: Support rmdir(2). r303937: Use proper argument length for rmdir(2) for r303934. r303942: Fix sorting in r303934. Modified: stable/10/usr.bin/truss/syscalls.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/truss/syscalls.c ============================================================================== --- stable/10/usr.bin/truss/syscalls.c Mon Aug 15 11:24:30 2016 (r304149) +++ stable/10/usr.bin/truss/syscalls.c Mon Aug 15 11:54:29 2016 (r304150) @@ -283,6 +283,8 @@ static struct syscall decoded_syscalls[] .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 } } }, { .name = "rfork", .ret_type = 1, .nargs = 1, .args = { { Rforkflags, 0 } } }, + { .name = "rmdir", .ret_type = 1, .nargs = 1, + .args = { { Name, 0 } } }, { .name = "select", .ret_type = 1, .nargs = 5, .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 }, { Timeval, 4 } } }, From owner-svn-src-all@freebsd.org Mon Aug 15 11:54:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D067BBBAD79; Mon, 15 Aug 2016 11:54:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D0951525; Mon, 15 Aug 2016 11:54:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FBsdNQ026070; Mon, 15 Aug 2016 11:54:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FBsd14026069; Mon, 15 Aug 2016 11:54:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608151154.u7FBsd14026069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Aug 2016 11:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304151 - head/contrib/elftoolchain/elfcopy 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 11:54:40 -0000 Author: emaste Date: Mon Aug 15 11:54:39 2016 New Revision: 304151 URL: https://svnweb.freebsd.org/changeset/base/304151 Log: elfcopy: silence GCC 5.3 unitialized variable warning Although it's a false positive there is little cost to initializing it always. Submitted by: adrian Modified: head/contrib/elftoolchain/elfcopy/ascii.c Modified: head/contrib/elftoolchain/elfcopy/ascii.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/ascii.c Mon Aug 15 11:54:29 2016 (r304150) +++ head/contrib/elftoolchain/elfcopy/ascii.c Mon Aug 15 11:54:39 2016 (r304151) @@ -251,6 +251,7 @@ create_elf_from_srec(struct elfcopy *ecp sec_index = 1; sec_addr = entry = 0; while (fgets(line, _LINE_BUFSZ, ifp) != NULL) { + sz = 0; /* Silence GCC 5.3 unintialized variable warning */ if (line[0] == '\r' || line[0] == '\n') continue; if (line[0] == '$' && line[1] == '$') { From owner-svn-src-all@freebsd.org Mon Aug 15 12:13:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32AB4BBBDAB; Mon, 15 Aug 2016 12:13:15 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02BCF180E; Mon, 15 Aug 2016 12:13:14 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FCDE25033807; Mon, 15 Aug 2016 12:13:14 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FCDExP033806; Mon, 15 Aug 2016 12:13:14 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201608151213.u7FCDExP033806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 15 Aug 2016 12:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304152 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 12:13:15 -0000 Author: kp Date: Mon Aug 15 12:13:14 2016 New Revision: 304152 URL: https://svnweb.freebsd.org/changeset/base/304152 Log: pf: Add missing byte-order swap to pf_match_addr_range Without this, rules using address ranges (e.g. "10.1.1.1 - 10.1.1.5") did not match addresses correctly on little-endian systems. PR: 211796 Obtained from: OpenBSD (sthen) MFC after: 3 days Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Mon Aug 15 11:54:39 2016 (r304151) +++ head/sys/netpfil/pf/pf.c Mon Aug 15 12:13:14 2016 (r304152) @@ -2600,8 +2600,8 @@ pf_match_addr_range(struct pf_addr *b, s switch (af) { #ifdef INET case AF_INET: - if ((a->addr32[0] < b->addr32[0]) || - (a->addr32[0] > e->addr32[0])) + if ((ntohl(a->addr32[0]) < ntohl(b->addr32[0])) || + (ntohl(a->addr32[0]) > ntohl(e->addr32[0]))) return (0); break; #endif /* INET */ @@ -2611,15 +2611,15 @@ pf_match_addr_range(struct pf_addr *b, s /* check a >= b */ for (i = 0; i < 4; ++i) - if (a->addr32[i] > b->addr32[i]) + if (ntohl(a->addr32[i]) > ntohl(b->addr32[i])) break; - else if (a->addr32[i] < b->addr32[i]) + else if (ntohl(a->addr32[i]) < ntohl(b->addr32[i])) return (0); /* check a <= e */ for (i = 0; i < 4; ++i) - if (a->addr32[i] < e->addr32[i]) + if (ntohl(a->addr32[i]) < ntohl(e->addr32[i])) break; - else if (a->addr32[i] > e->addr32[i]) + else if (ntohl(a->addr32[i]) > ntohl(e->addr32[i])) return (0); break; } From owner-svn-src-all@freebsd.org Mon Aug 15 12:56:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87B25BB97E8; Mon, 15 Aug 2016 12:56:46 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 511261C56; Mon, 15 Aug 2016 12:56:46 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FCujWE048834; Mon, 15 Aug 2016 12:56:45 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FCujHw048832; Mon, 15 Aug 2016 12:56:45 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151256.u7FCujHw048832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 12:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304153 - head/sys/dev/syscons 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 12:56:46 -0000 Author: bde Date: Mon Aug 15 12:56:45 2016 New Revision: 304153 URL: https://svnweb.freebsd.org/changeset/base/304153 Log: Quick fix for locking fixes in r172250. The lock added there was per- virtual-device, but needs to be per-physical-device so that it protects shared data. Usually, scp->sc->write_in_progress got corrupted first and further corruption was limited when this variable was left at nonzero with no write in progress. Attempt to fix missing lock destruction in r162285. Put it with the lock destruction for r172250 after moving the latter. Both might be unreachable. To demonstrate the bug, find a buggy syscall or sysctl that calls printf(9) and run this often. Run hd /dev/zero >/dev/ttyvN for any N != 0. The console spam goes to ttyv0 and the non-console spam goes to ttyvN, so the lock provided no protection (but it helped for N == 0). Modified: head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 12:13:14 2016 (r304152) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 12:56:45 2016 (r304153) @@ -2688,13 +2688,13 @@ sc_puts(scr_stat *scp, u_char *buf, int #endif if (scp->tsw) { - if (!kdb_active && !mtx_owned(&scp->scr_lock)) { + if (!kdb_active && !mtx_owned(&scp->sc->scr_lock)) { need_unlock = 1; - mtx_lock_spin(&scp->scr_lock); + mtx_lock_spin(&scp->sc->scr_lock); } (*scp->tsw->te_puts)(scp, buf, len, kernel); if (need_unlock) - mtx_unlock_spin(&scp->scr_lock); + mtx_unlock_spin(&scp->sc->scr_lock); } if (scp->sc->delayed_next_scr) @@ -2859,8 +2859,10 @@ scinit(int unit, int flags) * disappeared... */ sc = sc_get_softc(unit, flags & SC_KERNEL_CONSOLE); - if ((sc->flags & SC_INIT_DONE) == 0) + if ((sc->flags & SC_INIT_DONE) == 0) { + mtx_init(&sc->scr_lock, "scrlock", NULL, MTX_SPIN); SC_VIDEO_LOCKINIT(sc); + } adp = NULL; if (sc->adapter >= 0) { @@ -3077,7 +3079,8 @@ scterm(int unit, int flags) (*scp->tsw->te_term)(scp, &scp->ts); if (scp->ts != NULL) free(scp->ts, M_DEVBUF); - mtx_destroy(&scp->scr_lock); + mtx_destroy(&sc->scr_lock); + mtx_destroy(&sc->video_mtx); /* clear the structure */ if (!(flags & SC_KERNEL_CONSOLE)) { @@ -3302,8 +3305,6 @@ init_scp(sc_softc_t *sc, int vty, scr_st scp->history = NULL; scp->history_pos = 0; scp->history_size = 0; - - mtx_init(&scp->scr_lock, "scrlock", NULL, MTX_SPIN); } int Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Mon Aug 15 12:13:14 2016 (r304152) +++ head/sys/dev/syscons/syscons.h Mon Aug 15 12:56:45 2016 (r304153) @@ -230,6 +230,7 @@ typedef struct sc_softc { char switch_in_progress; char write_in_progress; char blink_in_progress; + struct mtx scr_lock; /* mutex for sc_puts() */ struct mtx video_mtx; long scrn_time_stamp; @@ -344,7 +345,6 @@ typedef struct scr_stat { int splash_save_mode; /* saved mode for splash screen */ int splash_save_status; /* saved status for splash screen */ - struct mtx scr_lock; /* mutex for sc_puts() */ #ifdef _SCR_MD_STAT_DECLARED_ scr_md_stat_t md; /* machine dependent vars */ #endif From owner-svn-src-all@freebsd.org Mon Aug 15 13:06:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19E12BB9D16; Mon, 15 Aug 2016 13:06:31 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE6E71635; Mon, 15 Aug 2016 13:06:30 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FD6USx052655; Mon, 15 Aug 2016 13:06:30 GMT (envelope-from oleg@FreeBSD.org) Received: (from oleg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FD6UUQ052654; Mon, 15 Aug 2016 13:06:30 GMT (envelope-from oleg@FreeBSD.org) Message-Id: <201608151306.u7FD6UUQ052654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oleg set sender to oleg@FreeBSD.org using -f From: Oleg Bulyzhin Date: Mon, 15 Aug 2016 13:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304154 - head/sys/netpfil/ipfw 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 13:06:31 -0000 Author: oleg Date: Mon Aug 15 13:06:29 2016 New Revision: 304154 URL: https://svnweb.freebsd.org/changeset/base/304154 Log: Fix command: ipfw set (enable|disable) N (where N > 4). enable_sets() expects set bitmasks, not set numbers. MFC after: 3 days Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Mon Aug 15 12:56:45 2016 (r304153) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Mon Aug 15 13:06:29 2016 (r304154) @@ -1420,8 +1420,10 @@ manage_sets(struct ip_fw_chain *chain, i if (rh->range.head.length != sizeof(ipfw_range_tlv)) return (1); - if (rh->range.set >= IPFW_MAX_SETS || - rh->range.new_set >= IPFW_MAX_SETS) + /* enable_sets() expects bitmasks. */ + if (op3->opcode != IP_FW_SET_ENABLE && + (rh->range.set >= IPFW_MAX_SETS || + rh->range.new_set >= IPFW_MAX_SETS)) return (EINVAL); ret = 0; From owner-svn-src-all@freebsd.org Mon Aug 15 13:16:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FAFCBB9F74 for ; Mon, 15 Aug 2016 13:16:05 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qt0-x22f.google.com (mail-qt0-x22f.google.com [IPv6:2607:f8b0:400d:c0d::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DBDF41B8D for ; Mon, 15 Aug 2016 13:16:04 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qt0-x22f.google.com with SMTP id x25so20756931qtx.2 for ; Mon, 15 Aug 2016 06:16:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rTotQyaQ+ZvGaAJ60OJ8mn9rowvJG+3s20l8E/eXMec=; b=hRhpntNWeSv9mlYz2ptbe4b44j1cOiLS1IjsLlCFtCfNwvhceWSqHwS5ApeGJ5U0Zm cyCBqjarE6hPqFIEJw5xND6rBKmRFO+SShhdQyDH36PzMhFbmWIWbRWSlSxbFLdveAt7 seFOGMiI21JcrygOWBcpKCLOxwQEJ+UWD3mD4alxMTiEnCOKxYZJTIRjBmCOV54rV3/I RDQGjIlcXJRtcx9FfNal3+l06AOWSGVjZEqE+ltkJRDmDDXiL1sNiiEmz0bVM10OwN/o ZFRA3cAolc9mNnX0nuXB4ep4E+vViw4hfRpqfhf1xfynGaDyHltC3frK6i7PPuyScUSA gdYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rTotQyaQ+ZvGaAJ60OJ8mn9rowvJG+3s20l8E/eXMec=; b=FP+fjBMeOyjuxZvk+H1BbDhpVQroAUkvNGh+Vwq9Ic9fhYhUqWxKwwb0UfK5KHyF0u wJBODJAJpKv+jYHidW0j+UxPD3nOVTwha5DpjEb/xUumEGD/dg6T7SO5TKF+Hp1Qg3NJ mvwKoYD5SURpCrV2o3XTXrIQRJddb5yxObXwfylG1sl6t+YpbHkmzGmKlh5fbhpnY0yb 5u7ZTyhAVg5DOg/W4n5AKspWC1dX8c1ffGuw9XCHqGLzqiwfEwHLOzhYjh7EzP7EkwQa sWNh8bhpEOX+MZ47wcSFo21V46bZ34jnPWlfQJcXUP+GF1ASWjiqYAZTV+fkZRzn555m 3bjg== X-Gm-Message-State: AEkooutd7qft6VFt9cYr3HWV2A/aCULgQtedGO6boK0u+SL8/BvlD56FP7LIQGmUUzAfRxJ9 X-Received: by 10.200.43.105 with SMTP id 38mr32459868qtv.73.1471266963940; Mon, 15 Aug 2016 06:16:03 -0700 (PDT) Received: from mutt-hardenedbsd (pool-100-16-219-226.bltmmd.fios.verizon.net. [100.16.219.226]) by smtp.gmail.com with ESMTPSA id w184sm11013537qkw.38.2016.08.15.06.16.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Aug 2016 06:16:02 -0700 (PDT) Date: Mon, 15 Aug 2016 09:16:00 -0400 From: Shawn Webb To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304153 - head/sys/dev/syscons Message-ID: <20160815131600.GA86798@mutt-hardenedbsd> References: <201608151256.u7FCujHw048832@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jRHKVT23PllUwdXP" Content-Disposition: inline In-Reply-To: <201608151256.u7FCujHw048832@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 12.0-CURRENT-HBSD FreeBSD 12.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 13:16:05 -0000 --jRHKVT23PllUwdXP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 15, 2016 at 12:56:45PM +0000, Bruce Evans wrote: > Author: bde > Date: Mon Aug 15 12:56:45 2016 > New Revision: 304153 > URL: https://svnweb.freebsd.org/changeset/base/304153 >=20 > Log: > Quick fix for locking fixes in r172250. The lock added there was per- > virtual-device, but needs to be per-physical-device so that it protects > shared data. Usually, scp->sc->write_in_progress got corrupted first > and further corruption was limited when this variable was left at nonze= ro > with no write in progress. > =20 > Attempt to fix missing lock destruction in r162285. Put it with the > lock destruction for r172250 after moving the latter. Both might be > unreachable. > =20 > To demonstrate the bug, find a buggy syscall or sysctl that calls > printf(9) and run this often. Run hd /dev/zero >/dev/ttyvN for any > N !=3D 0. The console spam goes to ttyv0 and the non-console spam goes > to ttyvN, so the lock provided no protection (but it helped for > N =3D=3D 0). >=20 Hey Bruce, Should this be MFC'd after some point? Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --jRHKVT23PllUwdXP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXscCMAAoJEGqEZY9SRW7uxugP/iMpq3pF0akMPnu0Jf/WyuHw CGNCn2bCde1OP0PHUG0u+zkD5ri0N5r2wPanQtbKpw4fS+5SZB0iSnus21BhzUb0 vGkUrfe8TRv0IWwDW5JRa6dFqs5mW7WA+4YpVxH8huarJ00GGyKVpFuSUEPmURHR kCXswD8bx9J4b16myW/wpBv5nvRwtJ5bGoRszDnG/Stk3DMnSRlTYiHr6Wfgi7dz jbHrH4OzdOz9WXzN+JsQ3SOnyX1ruCVzsidLflzdB8O4PXtdB5khewQnSTUiltY4 P5nPpx6drQKCaZeCI+ZnIzc4VScxRaP67YOIgES4EZAtQ310+HoWqWkhIUDcdC6D qDnG71nHiuhhzEyJBKVY2FO+9pLr6e1q0ecDrouv9D2J6O3s2fh8Tmnds+ONRMe/ pNZr5r2QukATM+0NSZSQtF9yVpO+dcFda9neDI6wIWj3Dfx2Tyh3K5LNiioUC3hJ MvYmpYwcwi3dj1GPJXVlDxEusk0n+4w3uOMwXihfwSlK23soVourL1SyvlaEazUd +knWqHKaWQxaytBr/f9KPXEuJ9GsSLu/jv4NdbekocrDFNv1Zv7YyAEkRBj2RsQD 9EzCmbBbqiUNha8Bv9GKPBxOLVTEywwU57my4nznqqpUTT2NtqUDAKATOchvM0zM RHdM/geV/5MhW7IkizzJ =s/uo -----END PGP SIGNATURE----- --jRHKVT23PllUwdXP-- From owner-svn-src-all@freebsd.org Mon Aug 15 14:00:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D25E9BBB35A; Mon, 15 Aug 2016 14:00:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 9D8841BAF; Mon, 15 Aug 2016 14:00:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 4499E785D5B; Mon, 15 Aug 2016 23:40:50 +1000 (AEST) Date: Mon, 15 Aug 2016 23:40:49 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Shawn Webb cc: Bruce Evans , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r304153 - head/sys/dev/syscons In-Reply-To: <20160815131600.GA86798@mutt-hardenedbsd> Message-ID: <20160815231956.X2752@besplex.bde.org> References: <201608151256.u7FCujHw048832@repo.freebsd.org> <20160815131600.GA86798@mutt-hardenedbsd> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=Pl7VVdGIrsZcu9rEHXcA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 14:00:37 -0000 On Mon, 15 Aug 2016, Shawn Webb wrote: > On Mon, Aug 15, 2016 at 12:56:45PM +0000, Bruce Evans wrote: >> >> Log: >> Quick fix for locking fixes in r172250. The lock added there was per- >> virtual-device, but needs to be per-physical-device so that it protects >> shared data. Usually, scp->sc->write_in_progress got corrupted first >> and further corruption was limited when this variable was left at nonzero >> with no write in progress. > ... > > Should this be MFC'd after some point? Possibly. This is a small part of ~60K of patches for locking bugs in console drivers (only ones that I use, syscons and sio) and subr_prf.c and subr_msgbuf.c. It is meant to be safe and easy to merge by itself, but I have too many little patches to merge one at a time. Bruce From owner-svn-src-all@freebsd.org Mon Aug 15 14:21:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BCD1BBB879; Mon, 15 Aug 2016 14:21:12 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B4FF19E0; Mon, 15 Aug 2016 14:21:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FELBd4083079; Mon, 15 Aug 2016 14:21:11 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FELAFT083068; Mon, 15 Aug 2016 14:21:10 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608151421.u7FELAFT083068@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 14:21:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304155 - in vendor-sys/illumos/dist/uts/common: fs/zfs fs/zfs/sys sys/fs X-SVN-Group: vendor-sys 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 14:21:12 -0000 Author: avg Date: Mon Aug 15 14:21:10 2016 New Revision: 304155 URL: https://svnweb.freebsd.org/changeset/base/304155 Log: 7090 zfs should improve allocation order and throttle allocations illumos/illumos-gate@0f7643c7376dd69a08acbfc9d1d7d548b10c846a https://github.com/illumos/illumos-gate/commit/0f7643c7376dd69a08acbfc9d1d7d548b10c846a https://www.illumos.org/issues/7090 When write I/Os are issued, they are issued in block order but the ZIO pipeline will drive them asynchronously through the allocation stage which can result in blocks being allocated out-of-order. It would be nice to preserve as much of the logical order as possible. In addition, the allocations are equally scattered across all top-level VDEVs but not all top-level VDEVs are created equally. The pipeline should be able to detect devices that are more capable of handling allocations and should allocate more blocks to those devices. This allows for dynamic allocation distribution when devices are imbalanced as fuller devices will tend to be slower than empty devices. The change includes a new pool-wide allocation queue which would throttle and order allocations in the ZIO pipeline. The queue would be ordered by issued time and offset and would provide an initial amount of allocation of work to each top-level vdev. The allocation logic utilizes a reservation system to reserve allocations that will be performed by the allocator. Once an allocation is successfully completed it's scheduled on a given top-level vdev. Each top- level vdev maintains a maximum number of allocations that it can handle (mg_alloc_queue_depth). The pool-wide reserved allocations (top-levels * mg_alloc_queue_depth) are distributed across the top-level vdevs metaslab groups and round robin across all eligible metaslab groups to distribute the work. As top-levels complete their work, they receive additional work from the pool-wide allocation queue until the allocation queue is emptied. Reviewed by: Adam Leventhal Reviewed by: Alex Reece Reviewed by: Christopher Siden Reviewed by: Dan Kimmel Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Prakash Surya Reviewed by: Sebastien Roy Approved by: Robert Mustacchi Author: George Wilson Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c vendor-sys/illumos/dist/uts/common/fs/zfs/refcount.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_cache.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_mirror.c vendor-sys/illumos/dist/uts/common/fs/zfs/vdev_queue.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c vendor-sys/illumos/dist/uts/common/sys/fs/zfs.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Mon Aug 15 13:06:29 2016 (r304154) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Mon Aug 15 14:21:10 2016 (r304155) @@ -35,17 +35,8 @@ #include #include -/* - * Allow allocations to switch to gang blocks quickly. We do this to - * avoid having to load lots of space_maps in a given txg. There are, - * however, some cases where we want to avoid "fast" ganging and instead - * we want to do an exhaustive search of all metaslabs on this device. - * Currently we don't allow any gang, slog, or dump device related allocations - * to "fast" gang. - */ -#define CAN_FASTGANG(flags) \ - (!((flags) & (METASLAB_GANG_CHILD | METASLAB_GANG_HEADER | \ - METASLAB_GANG_AVOID))) +#define GANG_ALLOCATION(flags) \ + ((flags) & (METASLAB_GANG_CHILD | METASLAB_GANG_HEADER)) #define METASLAB_WEIGHT_PRIMARY (1ULL << 63) #define METASLAB_WEIGHT_SECONDARY (1ULL << 62) @@ -196,6 +187,8 @@ metaslab_class_create(spa_t *spa, metasl mc->mc_spa = spa; mc->mc_rotor = NULL; mc->mc_ops = ops; + mutex_init(&mc->mc_lock, NULL, MUTEX_DEFAULT, NULL); + refcount_create_tracked(&mc->mc_alloc_slots); return (mc); } @@ -209,6 +202,8 @@ metaslab_class_destroy(metaslab_class_t ASSERT(mc->mc_space == 0); ASSERT(mc->mc_dspace == 0); + refcount_destroy(&mc->mc_alloc_slots); + mutex_destroy(&mc->mc_lock); kmem_free(mc, sizeof (metaslab_class_t)); } @@ -425,9 +420,10 @@ metaslab_compare(const void *x1, const v /* * Update the allocatable flag and the metaslab group's capacity. * The allocatable flag is set to true if the capacity is below - * the zfs_mg_noalloc_threshold. If a metaslab group transitions - * from allocatable to non-allocatable or vice versa then the metaslab - * group's class is updated to reflect the transition. + * the zfs_mg_noalloc_threshold or has a fragmentation value that is + * greater than zfs_mg_fragmentation_threshold. If a metaslab group + * transitions from allocatable to non-allocatable or vice versa then the + * metaslab group's class is updated to reflect the transition. */ static void metaslab_group_alloc_update(metaslab_group_t *mg) @@ -436,22 +432,45 @@ metaslab_group_alloc_update(metaslab_gro metaslab_class_t *mc = mg->mg_class; vdev_stat_t *vs = &vd->vdev_stat; boolean_t was_allocatable; + boolean_t was_initialized; ASSERT(vd == vd->vdev_top); mutex_enter(&mg->mg_lock); was_allocatable = mg->mg_allocatable; + was_initialized = mg->mg_initialized; mg->mg_free_capacity = ((vs->vs_space - vs->vs_alloc) * 100) / (vs->vs_space + 1); + mutex_enter(&mc->mc_lock); + + /* + * If the metaslab group was just added then it won't + * have any space until we finish syncing out this txg. + * At that point we will consider it initialized and available + * for allocations. We also don't consider non-activated + * metaslab groups (e.g. vdevs that are in the middle of being removed) + * to be initialized, because they can't be used for allocation. + */ + mg->mg_initialized = metaslab_group_initialized(mg); + if (!was_initialized && mg->mg_initialized) { + mc->mc_groups++; + } else if (was_initialized && !mg->mg_initialized) { + ASSERT3U(mc->mc_groups, >, 0); + mc->mc_groups--; + } + if (mg->mg_initialized) + mg->mg_no_free_space = B_FALSE; + /* * A metaslab group is considered allocatable if it has plenty * of free space or is not heavily fragmented. We only take * fragmentation into account if the metaslab group has a valid * fragmentation metric (i.e. a value between 0 and 100). */ - mg->mg_allocatable = (mg->mg_free_capacity > zfs_mg_noalloc_threshold && + mg->mg_allocatable = (mg->mg_activation_count > 0 && + mg->mg_free_capacity > zfs_mg_noalloc_threshold && (mg->mg_fragmentation == ZFS_FRAG_INVALID || mg->mg_fragmentation <= zfs_mg_fragmentation_threshold)); @@ -474,6 +493,7 @@ metaslab_group_alloc_update(metaslab_gro mc->mc_alloc_groups--; else if (!was_allocatable && mg->mg_allocatable) mc->mc_alloc_groups++; + mutex_exit(&mc->mc_lock); mutex_exit(&mg->mg_lock); } @@ -490,6 +510,9 @@ metaslab_group_create(metaslab_class_t * mg->mg_vd = vd; mg->mg_class = mc; mg->mg_activation_count = 0; + mg->mg_initialized = B_FALSE; + mg->mg_no_free_space = B_TRUE; + refcount_create_tracked(&mg->mg_alloc_queue_depth); mg->mg_taskq = taskq_create("metaslab_group_taskq", metaslab_load_pct, minclsyspri, 10, INT_MAX, TASKQ_THREADS_CPU_PCT); @@ -512,6 +535,7 @@ metaslab_group_destroy(metaslab_group_t taskq_destroy(mg->mg_taskq); avl_destroy(&mg->mg_metaslab_tree); mutex_destroy(&mg->mg_lock); + refcount_destroy(&mg->mg_alloc_queue_depth); kmem_free(mg, sizeof (metaslab_group_t)); } @@ -581,6 +605,15 @@ metaslab_group_passivate(metaslab_group_ mg->mg_next = NULL; } +boolean_t +metaslab_group_initialized(metaslab_group_t *mg) +{ + vdev_t *vd = mg->mg_vd; + vdev_stat_t *vs = &vd->vdev_stat; + + return (vs->vs_space != 0 && mg->mg_activation_count > 0); +} + uint64_t metaslab_group_get_space(metaslab_group_t *mg) { @@ -750,30 +783,97 @@ metaslab_group_fragmentation(metaslab_gr * group should avoid allocations if its free capacity is less than the * zfs_mg_noalloc_threshold or its fragmentation metric is greater than * zfs_mg_fragmentation_threshold and there is at least one metaslab group - * that can still handle allocations. + * that can still handle allocations. If the allocation throttle is enabled + * then we skip allocations to devices that have reached their maximum + * allocation queue depth unless the selected metaslab group is the only + * eligible group remaining. */ static boolean_t -metaslab_group_allocatable(metaslab_group_t *mg) +metaslab_group_allocatable(metaslab_group_t *mg, metaslab_group_t *rotor, + uint64_t psize) { - vdev_t *vd = mg->mg_vd; - spa_t *spa = vd->vdev_spa; + spa_t *spa = mg->mg_vd->vdev_spa; metaslab_class_t *mc = mg->mg_class; /* - * We use two key metrics to determine if a metaslab group is - * considered allocatable -- free space and fragmentation. If - * the free space is greater than the free space threshold and - * the fragmentation is less than the fragmentation threshold then - * consider the group allocatable. There are two case when we will - * not consider these key metrics. The first is if the group is - * associated with a slog device and the second is if all groups - * in this metaslab class have already been consider ineligible + * We can only consider skipping this metaslab group if it's + * in the normal metaslab class and there are other metaslab + * groups to select from. Otherwise, we always consider it eligible * for allocations. */ - return ((mg->mg_free_capacity > zfs_mg_noalloc_threshold && - (mg->mg_fragmentation == ZFS_FRAG_INVALID || - mg->mg_fragmentation <= zfs_mg_fragmentation_threshold)) || - mc != spa_normal_class(spa) || mc->mc_alloc_groups == 0); + if (mc != spa_normal_class(spa) || mc->mc_groups <= 1) + return (B_TRUE); + + /* + * If the metaslab group's mg_allocatable flag is set (see comments + * in metaslab_group_alloc_update() for more information) and + * the allocation throttle is disabled then allow allocations to this + * device. However, if the allocation throttle is enabled then + * check if we have reached our allocation limit (mg_alloc_queue_depth) + * to determine if we should allow allocations to this metaslab group. + * If all metaslab groups are no longer considered allocatable + * (mc_alloc_groups == 0) or we're trying to allocate the smallest + * gang block size then we allow allocations on this metaslab group + * regardless of the mg_allocatable or throttle settings. + */ + if (mg->mg_allocatable) { + metaslab_group_t *mgp; + int64_t qdepth; + uint64_t qmax = mg->mg_max_alloc_queue_depth; + + if (!mc->mc_alloc_throttle_enabled) + return (B_TRUE); + + /* + * If this metaslab group does not have any free space, then + * there is no point in looking further. + */ + if (mg->mg_no_free_space) + return (B_FALSE); + + qdepth = refcount_count(&mg->mg_alloc_queue_depth); + + /* + * If this metaslab group is below its qmax or it's + * the only allocatable metasable group, then attempt + * to allocate from it. + */ + if (qdepth < qmax || mc->mc_alloc_groups == 1) + return (B_TRUE); + ASSERT3U(mc->mc_alloc_groups, >, 1); + + /* + * Since this metaslab group is at or over its qmax, we + * need to determine if there are metaslab groups after this + * one that might be able to handle this allocation. This is + * racy since we can't hold the locks for all metaslab + * groups at the same time when we make this check. + */ + for (mgp = mg->mg_next; mgp != rotor; mgp = mgp->mg_next) { + qmax = mgp->mg_max_alloc_queue_depth; + + qdepth = refcount_count(&mgp->mg_alloc_queue_depth); + + /* + * If there is another metaslab group that + * might be able to handle the allocation, then + * we return false so that we skip this group. + */ + if (qdepth < qmax && !mgp->mg_no_free_space) + return (B_FALSE); + } + + /* + * We didn't find another group to handle the allocation + * so we can't skip this metaslab group even though + * we are at or over our qmax. + */ + return (B_TRUE); + + } else if (mc->mc_alloc_groups == 0 || psize == SPA_MINBLOCKSIZE) { + return (B_TRUE); + } + return (B_FALSE); } /* @@ -2041,8 +2141,57 @@ metaslab_distance(metaslab_t *msp, dva_t return (0); } +/* + * ========================================================================== + * Metaslab block operations + * ========================================================================== + */ + +static void +metaslab_group_alloc_increment(spa_t *spa, uint64_t vdev, void *tag, int flags) +{ + if (!(flags & METASLAB_ASYNC_ALLOC) || + flags & METASLAB_DONT_THROTTLE) + return; + + metaslab_group_t *mg = vdev_lookup_top(spa, vdev)->vdev_mg; + if (!mg->mg_class->mc_alloc_throttle_enabled) + return; + + (void) refcount_add(&mg->mg_alloc_queue_depth, tag); +} + +void +metaslab_group_alloc_decrement(spa_t *spa, uint64_t vdev, void *tag, int flags) +{ + if (!(flags & METASLAB_ASYNC_ALLOC) || + flags & METASLAB_DONT_THROTTLE) + return; + + metaslab_group_t *mg = vdev_lookup_top(spa, vdev)->vdev_mg; + if (!mg->mg_class->mc_alloc_throttle_enabled) + return; + + (void) refcount_remove(&mg->mg_alloc_queue_depth, tag); +} + +void +metaslab_group_alloc_verify(spa_t *spa, const blkptr_t *bp, void *tag) +{ +#ifdef ZFS_DEBUG + const dva_t *dva = bp->blk_dva; + int ndvas = BP_GET_NDVAS(bp); + + for (int d = 0; d < ndvas; d++) { + uint64_t vdev = DVA_GET_VDEV(&dva[d]); + metaslab_group_t *mg = vdev_lookup_top(spa, vdev)->vdev_mg; + VERIFY(refcount_not_held(&mg->mg_alloc_queue_depth, tag)); + } +#endif +} + static uint64_t -metaslab_group_alloc(metaslab_group_t *mg, uint64_t psize, uint64_t asize, +metaslab_group_alloc(metaslab_group_t *mg, uint64_t asize, uint64_t txg, uint64_t min_distance, dva_t *dva, int d) { spa_t *spa = mg->mg_vd->vdev_spa; @@ -2069,10 +2218,10 @@ metaslab_group_alloc(metaslab_group_t *m if (msp->ms_weight < asize) { spa_dbgmsg(spa, "%s: failed to meet weight " "requirement: vdev %llu, txg %llu, mg %p, " - "msp %p, psize %llu, asize %llu, " + "msp %p, asize %llu, " "weight %llu", spa_name(spa), mg->mg_vd->vdev_id, txg, - mg, msp, psize, asize, msp->ms_weight); + mg, msp, asize, msp->ms_weight); mutex_exit(&mg->mg_lock); return (-1ULL); } @@ -2154,7 +2303,6 @@ metaslab_group_alloc(metaslab_group_t *m msp->ms_access_txg = txg + metaslab_unload_delay; mutex_exit(&msp->ms_lock); - return (offset); } @@ -2171,7 +2319,6 @@ metaslab_alloc_dva(spa_t *spa, metaslab_ int all_zero; int zio_lock = B_FALSE; boolean_t allocatable; - uint64_t offset = -1ULL; uint64_t asize; uint64_t distance; @@ -2241,7 +2388,6 @@ top: all_zero = B_TRUE; do { ASSERT(mg->mg_activation_count == 1); - vd = mg->mg_vd; /* @@ -2257,24 +2403,23 @@ top: /* * Determine if the selected metaslab group is eligible - * for allocations. If we're ganging or have requested - * an allocation for the smallest gang block size - * then we don't want to avoid allocating to the this - * metaslab group. If we're in this condition we should - * try to allocate from any device possible so that we - * don't inadvertently return ENOSPC and suspend the pool + * for allocations. If we're ganging then don't allow + * this metaslab group to skip allocations since that would + * inadvertently return ENOSPC and suspend the pool * even though space is still available. */ - if (allocatable && CAN_FASTGANG(flags) && - psize > SPA_GANGBLOCKSIZE) - allocatable = metaslab_group_allocatable(mg); + if (allocatable && !GANG_ALLOCATION(flags) && !zio_lock) { + allocatable = metaslab_group_allocatable(mg, rotor, + psize); + } if (!allocatable) goto next; + ASSERT(mg->mg_initialized); + /* - * Avoid writing single-copy data to a failing vdev - * unless the user instructs us that it is okay. + * Avoid writing single-copy data to a failing vdev. */ if ((vd->vdev_stat.vs_write_errors > 0 || vd->vdev_state < VDEV_STATE_HEALTHY) && @@ -2294,8 +2439,32 @@ top: asize = vdev_psize_to_asize(vd, psize); ASSERT(P2PHASE(asize, 1ULL << vd->vdev_ashift) == 0); - offset = metaslab_group_alloc(mg, psize, asize, txg, distance, - dva, d); + uint64_t offset = metaslab_group_alloc(mg, asize, txg, + distance, dva, d); + + mutex_enter(&mg->mg_lock); + if (offset == -1ULL) { + mg->mg_failed_allocations++; + if (asize == SPA_GANGBLOCKSIZE) { + /* + * This metaslab group was unable to allocate + * the minimum gang block size so it must be + * out of space. We must notify the allocation + * throttle to start skipping allocation + * attempts to this metaslab group until more + * space becomes available. + * + * Note: this failure cannot be caused by the + * allocation throttle since the allocation + * throttle is only responsible for skipping + * devices and not failing block allocations. + */ + mg->mg_no_free_space = B_TRUE; + } + } + mg->mg_allocations++; + mutex_exit(&mg->mg_lock); + if (offset != -1ULL) { /* * If we've just selected this metaslab group, @@ -2476,9 +2645,57 @@ metaslab_claim_dva(spa_t *spa, const dva return (0); } +/* + * Reserve some allocation slots. The reservation system must be called + * before we call into the allocator. If there aren't any available slots + * then the I/O will be throttled until an I/O completes and its slots are + * freed up. The function returns true if it was successful in placing + * the reservation. + */ +boolean_t +metaslab_class_throttle_reserve(metaslab_class_t *mc, int slots, zio_t *zio, + int flags) +{ + uint64_t available_slots = 0; + boolean_t slot_reserved = B_FALSE; + + ASSERT(mc->mc_alloc_throttle_enabled); + mutex_enter(&mc->mc_lock); + + uint64_t reserved_slots = refcount_count(&mc->mc_alloc_slots); + if (reserved_slots < mc->mc_alloc_max_slots) + available_slots = mc->mc_alloc_max_slots - reserved_slots; + + if (slots <= available_slots || GANG_ALLOCATION(flags)) { + /* + * We reserve the slots individually so that we can unreserve + * them individually when an I/O completes. + */ + for (int d = 0; d < slots; d++) { + reserved_slots = refcount_add(&mc->mc_alloc_slots, zio); + } + zio->io_flags |= ZIO_FLAG_IO_ALLOCATING; + slot_reserved = B_TRUE; + } + + mutex_exit(&mc->mc_lock); + return (slot_reserved); +} + +void +metaslab_class_throttle_unreserve(metaslab_class_t *mc, int slots, zio_t *zio) +{ + ASSERT(mc->mc_alloc_throttle_enabled); + mutex_enter(&mc->mc_lock); + for (int d = 0; d < slots; d++) { + (void) refcount_remove(&mc->mc_alloc_slots, zio); + } + mutex_exit(&mc->mc_lock); +} + int metaslab_alloc(spa_t *spa, metaslab_class_t *mc, uint64_t psize, blkptr_t *bp, - int ndvas, uint64_t txg, blkptr_t *hintbp, int flags) + int ndvas, uint64_t txg, blkptr_t *hintbp, int flags, zio_t *zio) { dva_t *dva = bp->blk_dva; dva_t *hintdva = hintbp->blk_dva; @@ -2504,11 +2721,21 @@ metaslab_alloc(spa_t *spa, metaslab_clas if (error != 0) { for (d--; d >= 0; d--) { metaslab_free_dva(spa, &dva[d], txg, B_TRUE); + metaslab_group_alloc_decrement(spa, + DVA_GET_VDEV(&dva[d]), zio, flags); bzero(&dva[d], sizeof (dva_t)); } spa_config_exit(spa, SCL_ALLOC, FTAG); return (error); + } else { + /* + * Update the metaslab group's queue depth + * based on the newly allocated dva. + */ + metaslab_group_alloc_increment(spa, + DVA_GET_VDEV(&dva[d]), zio, flags); } + } ASSERT(error == 0); ASSERT(BP_GET_NDVAS(bp) == ndvas); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/refcount.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/refcount.c Mon Aug 15 13:06:29 2016 (r304154) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/refcount.c Mon Aug 15 14:21:10 2016 (r304155) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. */ #include @@ -69,6 +69,13 @@ refcount_create(refcount_t *rc) } void +refcount_create_tracked(refcount_t *rc) +{ + refcount_create(rc); + rc->rc_tracked = B_TRUE; +} + +void refcount_create_untracked(refcount_t *rc) { refcount_create(rc); @@ -251,4 +258,60 @@ refcount_transfer_ownership(refcount_t * ASSERT(found); mutex_exit(&rc->rc_mtx); } + +/* + * If tracking is enabled, return true if a reference exists that matches + * the "holder" tag. If tracking is disabled, then return true if a reference + * might be held. + */ +boolean_t +refcount_held(refcount_t *rc, void *holder) +{ + reference_t *ref; + + mutex_enter(&rc->rc_mtx); + + if (!rc->rc_tracked) { + mutex_exit(&rc->rc_mtx); + return (rc->rc_count > 0); + } + + for (ref = list_head(&rc->rc_list); ref; + ref = list_next(&rc->rc_list, ref)) { + if (ref->ref_holder == holder) { + mutex_exit(&rc->rc_mtx); + return (B_TRUE); + } + } + mutex_exit(&rc->rc_mtx); + return (B_FALSE); +} + +/* + * If tracking is enabled, return true if a reference does not exist that + * matches the "holder" tag. If tracking is disabled, always return true + * since the reference might not be held. + */ +boolean_t +refcount_not_held(refcount_t *rc, void *holder) +{ + reference_t *ref; + + mutex_enter(&rc->rc_mtx); + + if (!rc->rc_tracked) { + mutex_exit(&rc->rc_mtx); + return (B_TRUE); + } + + for (ref = list_head(&rc->rc_list); ref; + ref = list_next(&rc->rc_list, ref)) { + if (ref->ref_holder == holder) { + mutex_exit(&rc->rc_mtx); + return (B_FALSE); + } + } + mutex_exit(&rc->rc_mtx); + return (B_TRUE); +} #endif /* ZFS_DEBUG */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Aug 15 13:06:29 2016 (r304154) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Aug 15 14:21:10 2016 (r304155) @@ -1275,7 +1275,6 @@ spa_unload(spa_t *spa) ddt_unload(spa); - /* * Drop and purge level 2 cache */ @@ -3634,6 +3633,7 @@ spa_create(const char *pool, nvlist_t *n spa->spa_uberblock.ub_txg = txg - 1; spa->spa_uberblock.ub_version = version; spa->spa_ubsync = spa->spa_uberblock; + spa->spa_load_state = SPA_LOAD_CREATE; /* * Create "The Godfather" zio to hold all async IOs @@ -3818,6 +3818,7 @@ spa_create(const char *pool, nvlist_t *n */ spa_evicting_os_wait(spa); spa->spa_minref = refcount_count(&spa->spa_refcount); + spa->spa_load_state = SPA_LOAD_NONE; mutex_exit(&spa_namespace_lock); @@ -5321,7 +5322,7 @@ spa_nvlist_lookup_by_guid(nvlist_t **nvp static void spa_vdev_remove_aux(nvlist_t *config, char *name, nvlist_t **dev, int count, - nvlist_t *dev_to_remove) + nvlist_t *dev_to_remove) { nvlist_t **newdev = NULL; @@ -6483,6 +6484,8 @@ spa_sync(spa_t *spa, uint64_t txg) vdev_t *vd; dmu_tx_t *tx; int error; + uint32_t max_queue_depth = zfs_vdev_async_write_max_active * + zfs_vdev_queue_depth_pct / 100; VERIFY(spa_writeable(spa)); @@ -6494,6 +6497,10 @@ spa_sync(spa_t *spa, uint64_t txg) spa->spa_syncing_txg = txg; spa->spa_sync_pass = 0; + mutex_enter(&spa->spa_alloc_lock); + VERIFY0(avl_numnodes(&spa->spa_alloc_tree)); + mutex_exit(&spa->spa_alloc_lock); + /* * If there are any pending vdev state changes, convert them * into config changes that go out with this transaction group. @@ -6546,6 +6553,38 @@ spa_sync(spa_t *spa, uint64_t txg) } /* + * Set the top-level vdev's max queue depth. Evaluate each + * top-level's async write queue depth in case it changed. + * The max queue depth will not change in the middle of syncing + * out this txg. + */ + uint64_t queue_depth_total = 0; + for (int c = 0; c < rvd->vdev_children; c++) { + vdev_t *tvd = rvd->vdev_child[c]; + metaslab_group_t *mg = tvd->vdev_mg; + + if (mg == NULL || mg->mg_class != spa_normal_class(spa) || + !metaslab_group_initialized(mg)) + continue; + + /* + * It is safe to do a lock-free check here because only async + * allocations look at mg_max_alloc_queue_depth, and async + * allocations all happen from spa_sync(). + */ + ASSERT0(refcount_count(&mg->mg_alloc_queue_depth)); + mg->mg_max_alloc_queue_depth = max_queue_depth; + queue_depth_total += mg->mg_max_alloc_queue_depth; + } + metaslab_class_t *mc = spa_normal_class(spa); + ASSERT0(refcount_count(&mc->mc_alloc_slots)); + mc->mc_alloc_max_slots = queue_depth_total; + mc->mc_alloc_throttle_enabled = zio_dva_throttle_enabled; + + ASSERT3U(mc->mc_alloc_max_slots, <=, + max_queue_depth * rvd->vdev_children); + + /* * Iterate to convergence. */ do { @@ -6696,6 +6735,10 @@ spa_sync(spa_t *spa, uint64_t txg) dsl_pool_sync_done(dp, txg); + mutex_enter(&spa->spa_alloc_lock); + VERIFY0(avl_numnodes(&spa->spa_alloc_tree)); + mutex_exit(&spa->spa_alloc_lock); + /* * Update usable space statistics. */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Mon Aug 15 13:06:29 2016 (r304154) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa_misc.c Mon Aug 15 14:21:10 2016 (r304155) @@ -570,6 +570,7 @@ spa_add(const char *name, nvlist_t *conf mutex_init(&spa->spa_suspend_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_vdev_top_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&spa->spa_iokstat_lock, NULL, MUTEX_DEFAULT, NULL); + mutex_init(&spa->spa_alloc_lock, NULL, MUTEX_DEFAULT, NULL); cv_init(&spa->spa_async_cv, NULL, CV_DEFAULT, NULL); cv_init(&spa->spa_evicting_os_cv, NULL, CV_DEFAULT, NULL); @@ -619,6 +620,9 @@ spa_add(const char *name, nvlist_t *conf spa_active_count++; } + avl_create(&spa->spa_alloc_tree, zio_timestamp_compare, + sizeof (zio_t), offsetof(zio_t, io_alloc_node)); + /* * Every pool starts with the default cachefile */ @@ -704,6 +708,7 @@ spa_remove(spa_t *spa) kmem_free(dp, sizeof (spa_config_dirent_t)); } + avl_destroy(&spa->spa_alloc_tree); list_destroy(&spa->spa_config_list); nvlist_free(spa->spa_label_features); @@ -734,6 +739,7 @@ spa_remove(spa_t *spa) cv_destroy(&spa->spa_scrub_io_cv); cv_destroy(&spa->spa_suspend_cv); + mutex_destroy(&spa->spa_alloc_lock); mutex_destroy(&spa->spa_async_lock); mutex_destroy(&spa->spa_errlist_lock); mutex_destroy(&spa->spa_errlog_lock); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab.h Mon Aug 15 13:06:29 2016 (r304154) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab.h Mon Aug 15 14:21:10 2016 (r304155) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. */ #ifndef _SYS_METASLAB_H @@ -55,14 +55,15 @@ void metaslab_sync_done(metaslab_t *, ui void metaslab_sync_reassess(metaslab_group_t *); uint64_t metaslab_block_maxsize(metaslab_t *); -#define METASLAB_HINTBP_FAVOR 0x0 -#define METASLAB_HINTBP_AVOID 0x1 -#define METASLAB_GANG_HEADER 0x2 -#define METASLAB_GANG_CHILD 0x4 -#define METASLAB_GANG_AVOID 0x8 +#define METASLAB_HINTBP_FAVOR 0x0 +#define METASLAB_HINTBP_AVOID 0x1 +#define METASLAB_GANG_HEADER 0x2 +#define METASLAB_GANG_CHILD 0x4 +#define METASLAB_ASYNC_ALLOC 0x8 +#define METASLAB_DONT_THROTTLE 0x10 int metaslab_alloc(spa_t *, metaslab_class_t *, uint64_t, - blkptr_t *, int, uint64_t, blkptr_t *, int); + blkptr_t *, int, uint64_t, blkptr_t *, int, zio_t *); void metaslab_free(spa_t *, const blkptr_t *, uint64_t, boolean_t); int metaslab_claim(spa_t *, const blkptr_t *, uint64_t); void metaslab_check_free(spa_t *, const blkptr_t *); @@ -73,6 +74,9 @@ int metaslab_class_validate(metaslab_cla void metaslab_class_histogram_verify(metaslab_class_t *); uint64_t metaslab_class_fragmentation(metaslab_class_t *); uint64_t metaslab_class_expandable_space(metaslab_class_t *); +boolean_t metaslab_class_throttle_reserve(metaslab_class_t *, int, + zio_t *, int); +void metaslab_class_throttle_unreserve(metaslab_class_t *, int, zio_t *); void metaslab_class_space_update(metaslab_class_t *, int64_t, int64_t, int64_t, int64_t); @@ -85,10 +89,13 @@ metaslab_group_t *metaslab_group_create( void metaslab_group_destroy(metaslab_group_t *); void metaslab_group_activate(metaslab_group_t *); void metaslab_group_passivate(metaslab_group_t *); +boolean_t metaslab_group_initialized(metaslab_group_t *); uint64_t metaslab_group_get_space(metaslab_group_t *); void metaslab_group_histogram_verify(metaslab_group_t *); uint64_t metaslab_group_fragmentation(metaslab_group_t *); void metaslab_group_histogram_remove(metaslab_group_t *, metaslab_t *); +void metaslab_group_alloc_decrement(spa_t *, uint64_t, void *, int); +void metaslab_group_alloc_verify(spa_t *, const blkptr_t *, void *); #ifdef __cplusplus } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab_impl.h Mon Aug 15 13:06:29 2016 (r304154) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab_impl.h Mon Aug 15 14:21:10 2016 (r304155) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2011, 2014 by Delphix. All rights reserved. + * Copyright (c) 2011, 2015 by Delphix. All rights reserved. */ #ifndef _SYS_METASLAB_IMPL_H @@ -59,11 +59,42 @@ extern "C" { * to use a block allocator that best suits that class. */ struct metaslab_class { + kmutex_t mc_lock; spa_t *mc_spa; metaslab_group_t *mc_rotor; metaslab_ops_t *mc_ops; uint64_t mc_aliquot; + + /* + * Track the number of metaslab groups that have been initialized + * and can accept allocations. An initialized metaslab group is + * one has been completely added to the config (i.e. we have + * updated the MOS config and the space has been added to the pool). + */ + uint64_t mc_groups; + + /* + * Toggle to enable/disable the allocation throttle. + */ + boolean_t mc_alloc_throttle_enabled; + + /* + * The allocation throttle works on a reservation system. Whenever + * an asynchronous zio wants to perform an allocation it must + * first reserve the number of blocks that it wants to allocate. + * If there aren't sufficient slots available for the pending zio + * then that I/O is throttled until more slots free up. The current + * number of reserved allocations is maintained by the mc_alloc_slots + * refcount. The mc_alloc_max_slots value determines the maximum + * number of allocations that the system allows. Gang blocks are + * allowed to reserve slots even if we've reached the maximum + * number of allocations allowed. + */ + uint64_t mc_alloc_max_slots; + refcount_t mc_alloc_slots; + uint64_t mc_alloc_groups; /* # of allocatable groups */ + uint64_t mc_alloc; /* total allocated space */ uint64_t mc_deferred; /* total deferred frees */ uint64_t mc_space; /* total space (alloc + free) */ @@ -85,6 +116,15 @@ struct metaslab_group { avl_tree_t mg_metaslab_tree; uint64_t mg_aliquot; boolean_t mg_allocatable; /* can we allocate? */ + + /* + * A metaslab group is considered to be initialized only after + * we have updated the MOS config and added the space to the pool. + * We only allow allocation attempts to a metaslab group if it + * has been initialized. + */ + boolean_t mg_initialized; + uint64_t mg_free_capacity; /* percentage free */ int64_t mg_bias; int64_t mg_activation_count; @@ -93,6 +133,27 @@ struct metaslab_group { taskq_t *mg_taskq; metaslab_group_t *mg_prev; metaslab_group_t *mg_next; + + /* + * Each metaslab group can handle mg_max_alloc_queue_depth allocations + * which are tracked by mg_alloc_queue_depth. It's possible for a + * metaslab group to handle more allocations than its max. This + * can occur when gang blocks are required or when other groups + * are unable to handle their share of allocations. + */ + uint64_t mg_max_alloc_queue_depth; + refcount_t mg_alloc_queue_depth; + + /* + * A metalab group that can no longer allocate the minimum block + * size will set mg_no_free_space. Once a metaslab group is out + * of space then its share of work must be distributed to other + * groups. + */ + boolean_t mg_no_free_space; + + uint64_t mg_allocations; + uint64_t mg_failed_allocations; uint64_t mg_fragmentation; uint64_t mg_histogram[RANGE_TREE_HISTOGRAM_SIZE]; }; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h Mon Aug 15 13:06:29 2016 (r304154) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/refcount.h Mon Aug 15 14:21:10 2016 (r304155) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2015 by Delphix. All rights reserved. */ #ifndef _SYS_REFCOUNT_H @@ -62,6 +62,7 @@ typedef struct refcount { void refcount_create(refcount_t *rc); void refcount_create_untracked(refcount_t *rc); +void refcount_create_tracked(refcount_t *rc); void refcount_destroy(refcount_t *rc); void refcount_destroy_many(refcount_t *rc, uint64_t number); int refcount_is_zero(refcount_t *rc); @@ -72,6 +73,8 @@ int64_t refcount_add_many(refcount_t *rc int64_t refcount_remove_many(refcount_t *rc, uint64_t number, void *holder_tag); void refcount_transfer(refcount_t *dst, refcount_t *src); void refcount_transfer_ownership(refcount_t *, void *, void *); +boolean_t refcount_held(refcount_t *, void *); +boolean_t refcount_not_held(refcount_t *, void *); void refcount_init(void); void refcount_fini(void); @@ -84,6 +87,7 @@ typedef struct refcount { #define refcount_create(rc) ((rc)->rc_count = 0) #define refcount_create_untracked(rc) ((rc)->rc_count = 0) +#define refcount_create_tracked(rc) ((rc)->rc_count = 0) #define refcount_destroy(rc) ((rc)->rc_count = 0) #define refcount_destroy_many(rc, number) ((rc)->rc_count = 0) #define refcount_is_zero(rc) ((rc)->rc_count == 0) @@ -100,6 +104,8 @@ typedef struct refcount { atomic_add_64(&(dst)->rc_count, __tmp); \ } #define refcount_transfer_ownership(rc, current_holder, new_holder) +#define refcount_held(rc, holder) ((rc)->rc_count > 0) +#define refcount_not_held(rc, holder) (B_TRUE) #define refcount_init() #define refcount_fini() Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h Mon Aug 15 13:06:29 2016 (r304154) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_impl.h Mon Aug 15 14:21:10 2016 (r304155) @@ -164,6 +164,8 @@ struct spa { uint64_t spa_last_synced_guid; /* last synced guid */ list_t spa_config_dirty_list; /* vdevs with dirty config */ list_t spa_state_dirty_list; /* vdevs with dirty state */ + kmutex_t spa_alloc_lock; + avl_tree_t spa_alloc_tree; spa_aux_vdev_t spa_spares; /* hot spares */ spa_aux_vdev_t spa_l2cache; /* L2ARC cache devices */ nvlist_t *spa_label_features; /* Features for reading MOS */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h Mon Aug 15 13:06:29 2016 (r304154) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/vdev_impl.h Mon Aug 15 14:21:10 2016 (r304155) @@ -53,6 +53,9 @@ typedef struct vdev_queue vdev_queue_t; typedef struct vdev_cache vdev_cache_t; typedef struct vdev_cache_entry vdev_cache_entry_t; +extern int zfs_vdev_queue_depth_pct; +extern uint32_t zfs_vdev_async_write_max_active; + /* * Virtual device operations */ @@ -171,10 +174,21 @@ struct vdev { uint64_t vdev_deflate_ratio; /* deflation ratio (x512) */ uint64_t vdev_islog; /* is an intent log device */ uint64_t vdev_removing; /* device is being removed? */ - boolean_t vdev_ishole; /* is a hole in the namespace */ + boolean_t vdev_ishole; /* is a hole in the namespace */ + kmutex_t vdev_queue_lock; /* protects vdev_queue_depth */ uint64_t vdev_top_zap; /* + * The queue depth parameters determine how many async writes are + * still pending (i.e. allocated by net yet issued to disk) per + * top-level (vdev_async_write_queue_depth) and the maximum allowed + * (vdev_max_async_write_queue_depth). These values only apply to + * top-level vdevs. + */ + uint64_t vdev_async_write_queue_depth; + uint64_t vdev_max_async_write_queue_depth; + + /* * Leaf vdev state. */ range_tree_t *vdev_dtl[DTL_TYPES]; /* dirty time logs */ Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h Mon Aug 15 13:06:29 2016 (r304154) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zio.h Mon Aug 15 14:21:10 2016 (r304155) @@ -173,6 +173,7 @@ enum zio_flag { ZIO_FLAG_DONT_CACHE = 1 << 11, ZIO_FLAG_NODATA = 1 << 12, ZIO_FLAG_INDUCE_DAMAGE = 1 << 13, + ZIO_FLAG_IO_ALLOCATING = 1 << 14, #define ZIO_FLAG_DDT_INHERIT (ZIO_FLAG_IO_RETRY - 1) #define ZIO_FLAG_GANG_INHERIT (ZIO_FLAG_IO_RETRY - 1) @@ -180,27 +181,27 @@ enum zio_flag { /* * Flags inherited by vdev children. */ - ZIO_FLAG_IO_RETRY = 1 << 14, /* must be first for INHERIT */ - ZIO_FLAG_PROBE = 1 << 15, - ZIO_FLAG_TRYHARD = 1 << 16, - ZIO_FLAG_OPTIONAL = 1 << 17, + ZIO_FLAG_IO_RETRY = 1 << 15, /* must be first for INHERIT */ + ZIO_FLAG_PROBE = 1 << 16, + ZIO_FLAG_TRYHARD = 1 << 17, + ZIO_FLAG_OPTIONAL = 1 << 18, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Aug 15 14:21:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0C8DBBB8C3; Mon, 15 Aug 2016 14:21:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A7E3B1BF4; Mon, 15 Aug 2016 14:21:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FELkY9083796; Mon, 15 Aug 2016 14:21:46 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FELkRp083794; Mon, 15 Aug 2016 14:21:46 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608151421.u7FELkRp083794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 14:21:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304156 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 14:21:48 -0000 Author: avg Date: Mon Aug 15 14:21:46 2016 New Revision: 304156 URL: https://svnweb.freebsd.org/changeset/base/304156 Log: 7235 remove unused func dsl_dataset_set_blkptr illumos/illumos-gate@bd56f80007857b960e0981ed0797ad8ec844a96b https://github.com/illumos/illumos-gate/commit/bd56f80007857b960e0981ed0797ad8ec844a96b https://www.illumos.org/issues/7235 The function dsl_dataset_set_blkptr() is unused. We should remove it. Reviewed by: George Wilson Reviewed by: Alex Reece Reviewed by: Prakash Surya Reviewed by: Igor Kozhukhov Approved by: Robert Mustacchi Author: Matthew Ahrens Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Mon Aug 15 14:21:10 2016 (r304155) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Mon Aug 15 14:21:46 2016 (r304156) @@ -1007,19 +1007,6 @@ dsl_dataset_get_blkptr(dsl_dataset_t *ds return (&dsl_dataset_phys(ds)->ds_bp); } -void -dsl_dataset_set_blkptr(dsl_dataset_t *ds, blkptr_t *bp, dmu_tx_t *tx) -{ - ASSERT(dmu_tx_is_syncing(tx)); - /* If it's the meta-objset, set dp_meta_rootbp */ - if (ds == NULL) { - tx->tx_pool->dp_meta_rootbp = *bp; - } else { - dmu_buf_will_dirty(ds->ds_dbuf, tx); - dsl_dataset_phys(ds)->ds_bp = *bp; - } -} - spa_t * dsl_dataset_get_spa(dsl_dataset_t *ds) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h Mon Aug 15 14:21:10 2016 (r304155) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h Mon Aug 15 14:21:46 2016 (r304156) @@ -272,7 +272,6 @@ int dsl_dataset_snapshot_tmp(const char minor_t cleanup_minor, const char *htag); blkptr_t *dsl_dataset_get_blkptr(dsl_dataset_t *ds); -void dsl_dataset_set_blkptr(dsl_dataset_t *ds, blkptr_t *bp, dmu_tx_t *tx); spa_t *dsl_dataset_get_spa(dsl_dataset_t *ds); From owner-svn-src-all@freebsd.org Mon Aug 15 14:22:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BE7ABBB90B; Mon, 15 Aug 2016 14:22:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EEF01E5B; Mon, 15 Aug 2016 14:22:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FEMDXr083875; Mon, 15 Aug 2016 14:22:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FEMDLq083873; Mon, 15 Aug 2016 14:22:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608151422.u7FEMDLq083873@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 14:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304157 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 14:22:14 -0000 Author: avg Date: Mon Aug 15 14:22:12 2016 New Revision: 304157 URL: https://svnweb.freebsd.org/changeset/base/304157 Log: 7230 add assertions to dmu_send_impl() to verify that stream includes BEGIN and END records illumos/illumos-gate@12b90ee2d3b10689fc45f4930d2392f5fe1d9cfa https://github.com/illumos/illumos-gate/commit/12b90ee2d3b10689fc45f4930d2392f5fe1d9cfa https://www.illumos.org/issues/7230 A test failure occurred where a send stream had only a BEGIN record. This should not be possible if the send returns without error. Prevented this from happening in the future by adding an assertion to dmu_send_impl() to verify that if the function returns 0 (success) both a BEGIN and END record are present. Did this by adding flags to dmu_sendarg_t (indicating whether BEGIN or END records sent), having dump_record() set flags appropriately, adding VERIFY statement to dmu_send_impl(). Reviewed by: Matthew Ahrens Reviewed by: Paul Dagnelie Reviewed by: Igor Kozhukhov Approved by: Robert Mustacchi Author: Matt Krantz Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_impl.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Mon Aug 15 14:21:46 2016 (r304156) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Mon Aug 15 14:22:12 2016 (r304157) @@ -135,11 +135,16 @@ dump_record(dmu_sendarg_t *dsp, void *pa fletcher_4_incremental_native(dsp->dsa_drr, offsetof(dmu_replay_record_t, drr_u.drr_checksum.drr_checksum), &dsp->dsa_zc); - if (dsp->dsa_drr->drr_type != DRR_BEGIN) { + if (dsp->dsa_drr->drr_type == DRR_BEGIN) { + dsp->dsa_sent_begin = B_TRUE; + } else { ASSERT(ZIO_CHECKSUM_IS_ZERO(&dsp->dsa_drr->drr_u. drr_checksum.drr_checksum)); dsp->dsa_drr->drr_u.drr_checksum.drr_checksum = dsp->dsa_zc; } + if (dsp->dsa_drr->drr_type == DRR_END) { + dsp->dsa_sent_end = B_TRUE; + } fletcher_4_incremental_native(&dsp->dsa_drr-> drr_u.drr_checksum.drr_checksum, sizeof (zio_cksum_t), &dsp->dsa_zc); @@ -881,6 +886,8 @@ out: list_remove(&to_ds->ds_sendstreams, dsp); mutex_exit(&to_ds->ds_sendstream_lock); + VERIFY(err != 0 || (dsp->dsa_sent_begin && dsp->dsa_sent_end)); + kmem_free(drr, sizeof (dmu_replay_record_t)); kmem_free(dsp, sizeof (dmu_sendarg_t)); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_impl.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_impl.h Mon Aug 15 14:21:46 2016 (r304156) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu_impl.h Mon Aug 15 14:22:12 2016 (r304157) @@ -298,6 +298,8 @@ typedef struct dmu_sendarg { uint64_t dsa_last_data_offset; uint64_t dsa_resume_object; uint64_t dsa_resume_offset; + boolean_t dsa_sent_begin; + boolean_t dsa_sent_end; } dmu_sendarg_t; void dmu_object_zapify(objset_t *, uint64_t, dmu_object_type_t, dmu_tx_t *); From owner-svn-src-all@freebsd.org Mon Aug 15 14:23:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 932FABBB9C2; Mon, 15 Aug 2016 14:23:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 521A1117C; Mon, 15 Aug 2016 14:23:51 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FENoXt083967; Mon, 15 Aug 2016 14:23:50 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FENog9083966; Mon, 15 Aug 2016 14:23:50 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608151423.u7FENog9083966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 14:23:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304158 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 14:23:51 -0000 Author: avg Date: Mon Aug 15 14:23:50 2016 New Revision: 304158 URL: https://svnweb.freebsd.org/changeset/base/304158 Log: 7136 ESC_VDEV_REMOVE_AUX ought to always include vdev information 7115 6922 generates ESC_ZFS_VDEV_REMOVE_AUX a bit too often illumos/illumos-gate@b72b6bb10ad55121a1b352c6f68ebdc8e20c9086 https://github.com/illumos/illumos-gate/commit/b72b6bb10ad55121a1b352c6f68ebdc8e20c9086 https://www.illumos.org/issues/7136 6922 added ESC_ZFS_VDEV_REMOVE_AUX and ESC_ZFS_VDEV_REMOVE_DEV sysevents whenever an aux device gets removed from a pool. However, those sysevents will be created without the vdev_guid and vdev_path fields. It would be better to always populate those fields. https://www.illumos.org/issues/7115 The addition of spa_event_notify in vdev removal code (see #6922) causes events to be generated even if the spare failed to be removed with EBUSY. Reviewed by: George Wilson Reviewed by: Josef 'Jeff' Sipek Approved by: Robert Mustacchi Author: Alan Somers Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Aug 15 14:22:12 2016 (r304157) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Mon Aug 15 14:23:50 2016 (r304158) @@ -139,6 +139,8 @@ const zio_taskq_info_t zio_taskqs[ZIO_TY { ZTI_ONE, ZTI_NULL, ZTI_ONE, ZTI_NULL }, /* IOCTL */ }; +static sysevent_t *spa_event_create(spa_t *spa, vdev_t *vd, const char *name); +static void spa_event_post(sysevent_t *ev); static void spa_sync_version(void *arg, dmu_tx_t *tx); static void spa_sync_props(void *arg, dmu_tx_t *tx); static boolean_t spa_has_active_shared_spare(spa_t *spa); @@ -5447,6 +5449,7 @@ int spa_vdev_remove(spa_t *spa, uint64_t guid, boolean_t unspare) { vdev_t *vd; + sysevent_t *ev = NULL; metaslab_group_t *mg; nvlist_t **spares, **l2cache, *nv; uint64_t txg = 0; @@ -5470,6 +5473,9 @@ spa_vdev_remove(spa_t *spa, uint64_t gui * in this pool. */ if (vd == NULL || unspare) { + if (vd == NULL) + vd = spa_lookup_by_guid(spa, guid, B_TRUE); + ev = spa_event_create(spa, vd, ESC_ZFS_VDEV_REMOVE_AUX); spa_vdev_remove_aux(spa->spa_spares.sav_config, ZPOOL_CONFIG_SPARES, spares, nspares, nv); spa_load_spares(spa); @@ -5477,7 +5483,6 @@ spa_vdev_remove(spa_t *spa, uint64_t gui } else { error = SET_ERROR(EBUSY); } - spa_event_notify(spa, vd, ESC_ZFS_VDEV_REMOVE_AUX); } else if (spa->spa_l2cache.sav_vdevs != NULL && nvlist_lookup_nvlist_array(spa->spa_l2cache.sav_config, ZPOOL_CONFIG_L2CACHE, &l2cache, &nl2cache) == 0 && @@ -5485,11 +5490,12 @@ spa_vdev_remove(spa_t *spa, uint64_t gui /* * Cache devices can always be removed. */ + vd = spa_lookup_by_guid(spa, guid, B_TRUE); + ev = spa_event_create(spa, vd, ESC_ZFS_VDEV_REMOVE_AUX); spa_vdev_remove_aux(spa->spa_l2cache.sav_config, ZPOOL_CONFIG_L2CACHE, l2cache, nl2cache, nv); spa_load_l2cache(spa); spa->spa_l2cache.sav_sync = B_TRUE; - spa_event_notify(spa, vd, ESC_ZFS_VDEV_REMOVE_AUX); } else if (vd != NULL && vd->vdev_islog) { ASSERT(!locked); ASSERT(vd == vd->vdev_top); @@ -5526,9 +5532,9 @@ spa_vdev_remove(spa_t *spa, uint64_t gui /* * Clean up the vdev namespace. */ + ev = spa_event_create(spa, vd, ESC_ZFS_VDEV_REMOVE_DEV); spa_vdev_remove_from_namespace(spa, vd); - spa_event_notify(spa, vd, ESC_ZFS_VDEV_REMOVE_DEV); } else if (vd != NULL) { /* * Normal vdevs cannot be removed (yet). @@ -5544,6 +5550,9 @@ spa_vdev_remove(spa_t *spa, uint64_t gui if (!locked) error = spa_vdev_exit(spa, NULL, txg, error); + if (ev) + spa_event_post(ev); + return (error); } @@ -6920,24 +6929,17 @@ spa_has_active_shared_spare(spa_t *spa) return (B_FALSE); } -/* - * Post a sysevent corresponding to the given event. The 'name' must be one of - * the event definitions in sys/sysevent/eventdefs.h. The payload will be - * filled in from the spa and (optionally) the vdev. This doesn't do anything - * in the userland libzpool, as we don't want consumers to misinterpret ztest - * or zdb as real changes. - */ -void -spa_event_notify(spa_t *spa, vdev_t *vd, const char *name) +static sysevent_t * +spa_event_create(spa_t *spa, vdev_t *vd, const char *name) { + sysevent_t *ev = NULL; #ifdef _KERNEL - sysevent_t *ev; sysevent_attr_list_t *attr = NULL; sysevent_value_t value; - sysevent_id_t eid; ev = sysevent_alloc(EC_ZFS, (char *)name, SUNW_KERN_PUB "zfs", SE_SLEEP); + ASSERT(ev != NULL); value.value_type = SE_DATA_TYPE_STRING; value.value.sv_string = spa_name(spa); @@ -6969,11 +6971,34 @@ spa_event_notify(spa_t *spa, vdev_t *vd, goto done; attr = NULL; - (void) log_sysevent(ev, SE_SLEEP, &eid); - done: if (attr) sysevent_free_attr(attr); + +#endif + return (ev); +} + +static void +spa_event_post(sysevent_t *ev) +{ +#ifdef _KERNEL + sysevent_id_t eid; + + (void) log_sysevent(ev, SE_SLEEP, &eid); sysevent_free(ev); #endif } + +/* + * Post a sysevent corresponding to the given event. The 'name' must be one of + * the event definitions in sys/sysevent/eventdefs.h. The payload will be + * filled in from the spa and (optionally) the vdev. This doesn't do anything + * in the userland libzpool, as we don't want consumers to misinterpret ztest + * or zdb as real changes. + */ +void +spa_event_notify(spa_t *spa, vdev_t *vd, const char *name) +{ + spa_event_post(spa_event_create(spa, vd, name)); +} From owner-svn-src-all@freebsd.org Mon Aug 15 14:24:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5B1CBBBA15; Mon, 15 Aug 2016 14:24:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 884B312F7; Mon, 15 Aug 2016 14:24:48 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FEOls5084040; Mon, 15 Aug 2016 14:24:47 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FEOlaA084038; Mon, 15 Aug 2016 14:24:47 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608151424.u7FEOlaA084038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Mon, 15 Aug 2016 14:24:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304159 - in vendor/illumos/dist: cmd/zdb man/man1m X-SVN-Group: vendor 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 14:24:48 -0000 Author: avg Date: Mon Aug 15 14:24:47 2016 New Revision: 304159 URL: https://svnweb.freebsd.org/changeset/base/304159 Log: 7277 zdb should be able to print zfs_dbgmsg's illumos/illumos-gate@29bdd2f916366ece37c4748bca6b3d61f57a223b https://github.com/illumos/illumos-gate/commit/29bdd2f916366ece37c4748bca6b3d61f57a223b https://www.illumos.org/issues/7277 ztest always prints the debug messages (zfs_dbgmsg()) by calling zfs_dbgmsg_print(). We should add a flag to zdb to make it do this as well before exiting. Reviewed by: George Wilson Reviewed by: Matthew Ahrens Reviewed by: Igor Kozhukhov Approved by: Dan McDonald Author: Pavel Zakharov Modified: vendor/illumos/dist/cmd/zdb/zdb.c vendor/illumos/dist/man/man1m/zdb.1m Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Mon Aug 15 14:23:50 2016 (r304158) +++ vendor/illumos/dist/cmd/zdb/zdb.c Mon Aug 15 14:24:47 2016 (r304159) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011, 2015 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2014 Integros [integros.com] */ @@ -117,7 +117,7 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-CumMdibcsDvhLXFPA] [-t txg] [-e [-p path...]] " + "Usage: %s [-CumMdibcsDvhLXFPAG] [-t txg] [-e [-p path...]] " "[-U config] [-I inflight I/Os] [-x dumpdir] poolname [object...]\n" " %s [-divPA] [-e -p path...] [-U config] dataset " "[object...]\n" @@ -178,12 +178,23 @@ usage(void) (void) fprintf(stderr, " -I -- " "specify the maximum number of " "checksumming I/Os [default is 200]\n"); + (void) fprintf(stderr, " -G dump zfs_dbgmsg buffer before " + "exiting\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); (void) fprintf(stderr, "Default is to dump everything non-verbosely\n"); exit(1); } +static void +dump_debug_buffer() +{ + if (dump_opt['G']) { + (void) printf("\n"); + zfs_dbgmsg_print("zdb"); + } +} + /* * Called for usage errors that are discovered after a call to spa_open(), * dmu_bonus_hold(), or pool_match(). abort() is called for other errors. @@ -200,6 +211,8 @@ fatal(const char *fmt, ...) va_end(ap); (void) fprintf(stderr, "\n"); + dump_debug_buffer(); + exit(1); } @@ -3076,8 +3089,10 @@ dump_zpool(spa_t *spa) if (dump_opt['h']) dump_history(spa); - if (rc != 0) + if (rc != 0) { + dump_debug_buffer(); exit(rc); + } } #define ZDB_FLAG_CHECKSUM 0x0001 @@ -3547,7 +3562,7 @@ main(int argc, char **argv) spa_config_path = spa_config_path_env; while ((c = getopt(argc, argv, - "bcdhilmMI:suCDRSAFLXx:evp:t:U:P")) != -1) { + "bcdhilmMI:suCDRSAFLXx:evp:t:U:PG")) != -1) { switch (c) { case 'b': case 'c': @@ -3563,6 +3578,7 @@ main(int argc, char **argv) case 'M': case 'R': case 'S': + case 'G': dump_opt[c]++; dump_all = 0; break; @@ -3797,6 +3813,8 @@ main(int argc, char **argv) fuid_table_destroy(); sa_loaded = B_FALSE; + dump_debug_buffer(); + libzfs_fini(g_zfs); kernel_fini(); Modified: vendor/illumos/dist/man/man1m/zdb.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zdb.1m Mon Aug 15 14:23:50 2016 (r304158) +++ vendor/illumos/dist/man/man1m/zdb.1m Mon Aug 15 14:24:47 2016 (r304159) @@ -11,15 +11,15 @@ .\" .\" .\" Copyright 2012, Richard Lowe. -.\" Copyright (c) 2012, 2014 by Delphix. All rights reserved. +.\" Copyright (c) 2012, 2016 by Delphix. All rights reserved. .\" -.TH "ZDB" "1M" "March 6, 2014" "" "" +.TH "ZDB" "1M" "Feb 4, 2016" "" "" .SH "NAME" \fBzdb\fR - Display zpool debugging and consistency information .SH "SYNOPSIS" -\fBzdb\fR [-CumdibcsDvhLMXFPA] [-e [-p \fIpath\fR...]] [-t \fItxg\fR] +\fBzdb\fR [-CumdibcsDvhLMXFPAG] [-e [-p \fIpath\fR...]] [-t \fItxg\fR] [-U \fIcache\fR] [-I \fIinflight I/Os\fR] [-x \fIdumpdir\fR] [\fIpoolname\fR [\fIobject\fR ...]] @@ -400,6 +400,17 @@ transactions. .sp .ne 2 .na +\fB-G\fR +.ad +.sp .6 +.RS 4n +Dump the contents of the zfs_dbgmsg buffer before exiting zdb. zfs_dbgmsg is +a buffer used by ZFS to dump advanced debug information. +.RE + +.sp +.ne 2 +.na \fB-I \fIinflight I/Os\fR \fR .ad .sp .6 From owner-svn-src-all@freebsd.org Mon Aug 15 14:28:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8ECABBBBDE7; Mon, 15 Aug 2016 14:28:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61676170C; Mon, 15 Aug 2016 14:28:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FES8Zu084254; Mon, 15 Aug 2016 14:28:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FES8cR084252; Mon, 15 Aug 2016 14:28:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608151428.u7FES8cR084252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Aug 2016 14:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304160 - head/contrib/elftoolchain/libelftc 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 14:28:09 -0000 Author: emaste Date: Mon Aug 15 14:28:08 2016 New Revision: 304160 URL: https://svnweb.freebsd.org/changeset/base/304160 Log: elfcopy: add elf64-littleaarch64 output target support Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Modified: head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 ============================================================================== --- head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Mon Aug 15 14:24:47 2016 (r304159) +++ head/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Mon Aug 15 14:28:08 2016 (r304160) @@ -89,6 +89,7 @@ Known descriptor names and their propert .It Li elf64-ia64-big Ta ELF Ta MSB Ta 64 .It Li elf64-ia64-little Ta ELF Ta LSB Ta 64 .It Li elf64-little Ta ELF Ta LSB Ta 64 +.It Li elf64-littleaarch64 Ta ELF Ta LSB Ta 64 .It Li elf64-littlemips Ta ELF Ta LSB Ta 64 .It Li elf64-powerpc Ta ELF Ta MSB Ta 64 .It Li elf64-powerpcle Ta ELF Ta LSB Ta 64 Modified: head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Mon Aug 15 14:24:47 2016 (r304159) +++ head/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Mon Aug 15 14:28:08 2016 (r304160) @@ -250,6 +250,14 @@ struct _Elftc_Bfd_Target _libelftc_targe }, { + .bt_name = "elf64-littleaarch64", + .bt_type = ETF_ELF, + .bt_byteorder = ELFDATA2LSB, + .bt_elfclass = ELFCLASS64, + .bt_machine = EM_AARCH64, + }, + + { .bt_name = "elf64-littlemips", .bt_type = ETF_ELF, .bt_byteorder = ELFDATA2LSB, From owner-svn-src-all@freebsd.org Mon Aug 15 14:28:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09EF1BBBE25; Mon, 15 Aug 2016 14:28:18 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D866218C5; Mon, 15 Aug 2016 14:28:17 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FESHC1084305; Mon, 15 Aug 2016 14:28:17 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FESH7F084304; Mon, 15 Aug 2016 14:28:17 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151428.u7FESH7F084304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 14:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304161 - head/sys/dev/syscons 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 14:28:18 -0000 Author: bde Date: Mon Aug 15 14:28:16 2016 New Revision: 304161 URL: https://svnweb.freebsd.org/changeset/base/304161 Log: Change all uses of 'debugger' to kdb_active and remove this variable. This restores avoidance of doing dangerous things like calling wakeup() and callouts while in ddb. Initialization of 'debugger' was broken by removing the cndbctl() console method that was used mainly in this driver to initialize 'debugger' and switch to the console screen on entry to ddb. The screen switch was restored using the cngrab() method, but cngrab() is more general so it should not initialize 'debugger' and never did. 'debugger' was just an over-engineered alias for kdb_active anyway. It existed because kdb_active (when it was named ddb_active) was considered as a private kdb variable, and there are ordering problems initializing the variables atomically with the state that they represent, but an extra variable and method to set it increased these problems. The bug caused LORs, but WITNESS is normally misconfigured with WITNESS_SKIPSIN so it doesn't check the spinlocks used by wakeup() and callouts. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 14:28:08 2016 (r304160) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 14:28:16 2016 (r304161) @@ -172,8 +172,6 @@ SYSCTL_INT(_machdep, OID_AUTO, enable_pa #define VTY_WCHAN(sc, vty) (&SC_DEV(sc, vty)) -static int debugger; - /* prototypes */ static int sc_allocate_keyboard(sc_softc_t *sc, int unit); static int scvidprobe(int unit, int flags, int cons); @@ -1815,7 +1813,7 @@ sccnupdate(scr_stat *scp) if (suspend_in_progress || scp->sc->font_loading_in_progress) return; - if (debugger > 0 || panicstr || shutdown_in_progress) { + if (kdb_active || panicstr || shutdown_in_progress) { sc_touch_scrn_saver(); } else if (scp != scp->sc->cur_scp) { return; @@ -1884,7 +1882,7 @@ scrn_timer(void *arg) #endif /* PC98 */ /* should we stop the screen saver? */ - if (debugger > 0 || panicstr || shutdown_in_progress) + if (kdb_active || panicstr || shutdown_in_progress) sc_touch_scrn_saver(); if (run_scrn_saver) { if (time_uptime > sc->scrn_time_stamp + scrn_blank_time) @@ -2279,7 +2277,7 @@ stop_scrn_saver(sc_softc_t *sc, void (*s mark_all(sc->cur_scp); if (sc->delayed_next_scr) sc_switch_scr(sc, sc->delayed_next_scr - 1); - if (debugger == 0) + if (!kdb_active) wakeup(&scrn_blanked); } @@ -2474,7 +2472,7 @@ sc_switch_scr(sc_softc_t *sc, u_int next DPRINTF(5, ("error 2, requested vty isn't open!\n")); return EINVAL; } - if ((debugger > 0) && (SC_STAT(tp)->smode.mode == VT_PROCESS)) { + if (kdb_active && SC_STAT(tp)->smode.mode == VT_PROCESS) { splx(s); DPRINTF(5, ("error 3, requested vty is in the VT_PROCESS mode\n")); return EINVAL; @@ -2495,7 +2493,7 @@ sc_switch_scr(sc_softc_t *sc, u_int next * is supposed to be locked by splhigh(), but the debugger may * be invoked at splhigh(). */ - if (debugger == 0) + if (!kdb_active) wakeup(VTY_WCHAN(sc,next_scr)); splx(s); DPRINTF(5, ("switch done (new == old)\n")); @@ -2518,7 +2516,7 @@ sc_switch_scr(sc_softc_t *sc, u_int next s = spltty(); /* wake up processes waiting for this vty */ - if (debugger == 0) + if (!kdb_active) wakeup(VTY_WCHAN(sc,next_scr)); /* wait for the controlling process to acknowledge, if necessary */ From owner-svn-src-all@freebsd.org Mon Aug 15 14:58:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE631BB9831; Mon, 15 Aug 2016 14:58:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF5211C2F; Mon, 15 Aug 2016 14:58:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FEwP5c095538; Mon, 15 Aug 2016 14:58:25 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FEwPjt095537; Mon, 15 Aug 2016 14:58:25 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201608151458.u7FEwPjt095537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 15 Aug 2016 14:58:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304162 - head/etc/periodic/daily 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 14:58:27 -0000 Author: asomers Date: Mon Aug 15 14:58:25 2016 New Revision: 304162 URL: https://svnweb.freebsd.org/changeset/base/304162 Log: Decrease the anti-congestion sleep in 480.leapfile-ntpd to 1 hour 24 hours is too long. Periodic scripts are executed serially, so when combined with the sleep in 410.pkg-audit periodic could actually take more than 24 hours and block the next invocation. Reviewed by: cy MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D7481 Modified: head/etc/periodic/daily/480.leapfile-ntpd Modified: head/etc/periodic/daily/480.leapfile-ntpd ============================================================================== --- head/etc/periodic/daily/480.leapfile-ntpd Mon Aug 15 14:28:16 2016 (r304161) +++ head/etc/periodic/daily/480.leapfile-ntpd Mon Aug 15 14:58:25 2016 (r304162) @@ -16,7 +16,7 @@ case "$daily_ntpd_leapfile_enable" in case "$daily_ntpd_avoid_congestion" in [Yy][Ee][Ss]) # Avoid dogpiling - (sleep $(jot -r 1 0 86400); service ntpd onefetch) & + (sleep $(jot -r 1 0 3600); service ntpd onefetch) & ;; *) service ntpd onefetch From owner-svn-src-all@freebsd.org Mon Aug 15 15:04:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B2F8BB9ABD; Mon, 15 Aug 2016 15:04:35 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3FF311F4; Mon, 15 Aug 2016 15:04:34 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7FF4QsD010802 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Mon, 15 Aug 2016 08:04:26 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608150930.u7F9UL1V069576@repo.freebsd.org> From: Nathan Whitehorn Message-ID: Date: Mon, 15 Aug 2016 08:04:26 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <201608150930.u7F9UL1V069576@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVb1e6vFjtl//K5a9p8n/04csfrrJgbdILv/jOPBoIVnE7PDyDxFA6m2+zCbrWZpkexRPiif6eI+MLiJERfd5iuTHtm8rUBUCuM= X-Sonic-ID: C;pJyvjvli5hG3j6Dx2xNB0g== M;5rcBj/li5hG3j6Dx2xNB0g== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 15:04:35 -0000 As a note for people who weren't paying attention to the bug, we need to fix this in a better way outside of the constraints of getting 11.0 out the door. The system (gpart, the installer, ZFS, etc.) uses the reported GEOM stripesize for partition alignment and IO block size selection. If that is wrong, we should identify devices on which it is wrong and fix them, and maybe also add some global tunable that sets a floor on the numbers reported by GEOM_DISK. Hacking the installer like this is triage, which is fine, but not viable as a permanent solution to anything. -Nathan On 08/15/16 02:30, Dag-Erling Smørgrav wrote: > Author: des > Date: Mon Aug 15 09:30:21 2016 > New Revision: 304142 > URL: https://svnweb.freebsd.org/changeset/base/304142 > > Log: > Ensure that the sector size is a multiple of 4096 to avoid creating > unaligned partitions when the actual sector size is hidden from us. > > PR: 211361 > MFC after: 3 days > > Modified: > head/usr.sbin/bsdinstall/partedit/gpart_ops.c > > Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c > ============================================================================== > --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Aug 15 09:27:15 2016 (r304141) > +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Aug 15 09:30:21 2016 (r304142) > @@ -795,6 +795,7 @@ gpart_max_free(struct ggeom *geom, intma > { > struct gconfig *gc; > struct gprovider *pp, **providers; > + intmax_t sectorsize, stripesize, offset; > intmax_t lastend; > intmax_t start, end; > intmax_t maxsize, maxstart; > @@ -845,12 +846,25 @@ gpart_max_free(struct ggeom *geom, intma > > pp = LIST_FIRST(&geom->lg_consumer)->lg_provider; > > - /* Compute beginning of new partition and maximum available space */ > - if (pp->lg_stripesize > 0 && > - (maxstart*pp->lg_sectorsize % pp->lg_stripesize) != 0) { > - intmax_t offset = (pp->lg_stripesize - > - ((maxstart*pp->lg_sectorsize) % pp->lg_stripesize)) / > - pp->lg_sectorsize; > + /* > + * Round the start and size of the largest available space up to > + * the nearest multiple of the adjusted stripe size. > + * > + * The adjusted stripe size is the least common multiple of the > + * actual stripe size, or the sector size if no stripe size was > + * reported, and 4096. The reason for this is that contemporary > + * disks often have 4096-byte physical sectors but report 512 > + * bytes instead for compatibility with older / broken operating > + * systems and BIOSes. For the same reasons, virtualized storage > + * may also report a 512-byte stripe size, or none at all. > + */ > + sectorsize = pp->lg_sectorsize; > + if ((stripesize = pp->lg_stripesize) == 0) > + stripesize = sectorsize; > + while (stripesize % 4096 != 0) > + stripesize *= 2; > + if ((offset = maxstart * sectorsize % stripesize) != 0) { > + offset = (stripesize - offset) / sectorsize; > maxstart += offset; > maxsize -= offset; > } > From owner-svn-src-all@freebsd.org Mon Aug 15 15:23:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B303BB9F5F; Mon, 15 Aug 2016 15:23:46 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37B601D6D; Mon, 15 Aug 2016 15:23:46 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FFNjXY006877; Mon, 15 Aug 2016 15:23:45 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FFNjdh006876; Mon, 15 Aug 2016 15:23:45 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201608151523.u7FFNjdh006876@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Mon, 15 Aug 2016 15:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304163 - stable/11/sys/dev/bxe X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 15:23:46 -0000 Author: rstone Date: Mon Aug 15 15:23:45 2016 New Revision: 304163 URL: https://svnweb.freebsd.org/changeset/base/304163 Log: MFC r303836 Don't enqueue NULL on a drbr In one corner case in the bxe TX path, a NULL mbuf could be enqueued onto a drbr queue. This could case a KASSERT to fire with INVARIANTS enabled, or the processing of packets from the queue to be prematurely ended later on. Submitted by: Matt Joras (matt.joras AT isilon.com) Reviewed by: davidcs Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7041 Modified: stable/11/sys/dev/bxe/bxe.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/bxe/bxe.c ============================================================================== --- stable/11/sys/dev/bxe/bxe.c Mon Aug 15 14:58:25 2016 (r304162) +++ stable/11/sys/dev/bxe/bxe.c Mon Aug 15 15:23:45 2016 (r304163) @@ -5624,7 +5624,8 @@ bxe_tx_mq_start_locked(struct bxe_softc if (!sc->link_vars.link_up || (if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { - rc = drbr_enqueue(ifp, tx_br, m); + if (m != NULL) + rc = drbr_enqueue(ifp, tx_br, m); goto bxe_tx_mq_start_locked_exit; } From owner-svn-src-all@freebsd.org Mon Aug 15 15:34:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8D8EBBA29F; Mon, 15 Aug 2016 15:34:54 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 810CD17B1; Mon, 15 Aug 2016 15:34:54 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FFYrvK011506; Mon, 15 Aug 2016 15:34:53 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FFYrwj011505; Mon, 15 Aug 2016 15:34:53 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151534.u7FFYrwj011505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 15:34:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304164 - head/sys/dev/syscons 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 15:34:54 -0000 Author: bde Date: Mon Aug 15 15:34:53 2016 New Revision: 304164 URL: https://svnweb.freebsd.org/changeset/base/304164 Log: Disable some more unsafe things in (low level) console mode: - never call up to the tty layer to restart output for keyboard input in console mode. This was already disallowed in kdb mode. Other cases are rarely reached. - disable the reboot, halt and powerdown keys in console mode. The suspend, standby and panic keys are still allowed, and aren't even conditonal on excessive configuration options. Some of these actions are still available in ddb mode as ddb commands which are equally unsafe. Some are useful at input prompts and should be restored when the locking is fixed. - disallow bells in kdb mode (should be in console mode, but the flag for that is not available). Visual bell gives very alarming behaviour by trying to use callouts which don't work in kdb mode. Audio bell uses timeouts and hardware resources with mutexes that can deadlock in reasonable use of ddb. Screen switches in kdb mode are not very safe, but they are important functionality and there is a lot of code to make them sort of work. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 15:23:45 2016 (r304163) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 15:34:53 2016 (r304164) @@ -3505,8 +3505,9 @@ next_code: scp->status |= CURSOR_ENABLED; sc_draw_cursor_image(scp); } + /* Only safe in Giant-locked context. */ tp = SC_DEV(sc, scp->index); - if (!kdb_active && tty_opened_ns(tp)) + if (!(flags & SCGETC_CN) && tty_opened_ns(tp)) sctty_outwakeup(tp); #endif } @@ -3557,21 +3558,21 @@ next_code: case RBT: #ifndef SC_DISABLE_REBOOT - if (enable_reboot) + if (enable_reboot && !(flags & SCGETC_CN)) shutdown_nice(0); #endif break; case HALT: #ifndef SC_DISABLE_REBOOT - if (enable_reboot) + if (enable_reboot && !(flags & SCGETC_CN)) shutdown_nice(RB_HALT); #endif break; case PDWN: #ifndef SC_DISABLE_REBOOT - if (enable_reboot) + if (enable_reboot && !(flags & SCGETC_CN)) shutdown_nice(RB_HALT|RB_POWEROFF); #endif break; @@ -3842,7 +3843,7 @@ sc_respond(scr_stat *scp, const u_char * void sc_bell(scr_stat *scp, int pitch, int duration) { - if (cold || shutdown_in_progress || !enable_bell) + if (cold || kdb_active || shutdown_in_progress || !enable_bell) return; if (scp != scp->sc->cur_scp && (scp->sc->flags & SC_QUIET_BELL)) From owner-svn-src-all@freebsd.org Mon Aug 15 17:08:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75544BBBF43; Mon, 15 Aug 2016 17:08:26 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45D3D1F0E; Mon, 15 Aug 2016 17:08:26 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FH8PRc046275; Mon, 15 Aug 2016 17:08:25 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FH8Pfp046274; Mon, 15 Aug 2016 17:08:25 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151708.u7FH8Pfp046274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 17:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304165 - head/sys/dev/syscons 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 17:08:26 -0000 Author: bde Date: Mon Aug 15 17:08:25 2016 New Revision: 304165 URL: https://svnweb.freebsd.org/changeset/base/304165 Log: Like scr_lock, the grab count needs to be per-physical-device to work. This bug corrupted the grab count on both vtys if the ungrabbed vty is different from the console, and failed to restore the keyboard state on the ungrabbed vty, but not restoring the latter usually left the keyboard mode part of it uncorrupted at 1 (K_XLATE), while after this fix the keyboard mode part is usually corrupted to 0 (K_RAW). While here, rename the grab count from 'grabbed' to grab_level. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 15:34:53 2016 (r304164) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 17:08:25 2016 (r304165) @@ -1661,7 +1661,7 @@ sc_cngrab(struct consdev *cp) if (scp->sc->kbd == NULL) return; - if (scp->grabbed++ > 0) + if (scp->sc->grab_level++ > 0) return; /* @@ -1687,7 +1687,7 @@ sc_cnungrab(struct consdev *cp) if (scp->sc->kbd == NULL) return; - if (--scp->grabbed > 0) + if (--scp->sc->grab_level > 0) return; kbdd_poll(scp->sc->kbd, FALSE); From owner-svn-src-all@freebsd.org Mon Aug 15 17:11:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F6B5BBA051; Mon, 15 Aug 2016 17:11:07 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E309612F2; Mon, 15 Aug 2016 17:11:06 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FHB6Kn046460; Mon, 15 Aug 2016 17:11:06 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FHB6n9046459; Mon, 15 Aug 2016 17:11:06 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151711.u7FHB6n9046459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 17:11:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304166 - head/sys/dev/syscons 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 17:11:07 -0000 Author: bde Date: Mon Aug 15 17:11:05 2016 New Revision: 304166 URL: https://svnweb.freebsd.org/changeset/base/304166 Log: [Oops, the previous commit was missing the update to syscons.h.] Like scr_lock, the grab count needs to be per-physical-device to work. This bug corrupted the grab count on both vtys if the ungrabbed vty is different from the console, and failed to restore the keyboard state on the ungrabbed vty, but not restoring it usually left the keyboard mode part of the keyboard state uncorrupted at 1 (K_XLATE), while after this fix the keyboard mode part is usually corrupted to 0 (K_RAW). While here, rename the grab count from grabbed to grab_level. Modified: head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Mon Aug 15 17:08:25 2016 (r304165) +++ head/sys/dev/syscons/syscons.h Mon Aug 15 17:11:05 2016 (r304166) @@ -230,6 +230,7 @@ typedef struct sc_softc { char switch_in_progress; char write_in_progress; char blink_in_progress; + int grab_level; struct mtx scr_lock; /* mutex for sc_puts() */ struct mtx video_mtx; @@ -304,7 +305,6 @@ typedef struct scr_stat { void *ts; int status; /* status (bitfield) */ - int grabbed; int kbd_mode; /* keyboard I/O mode */ int kbd_prev_mode; /* keyboard I/O mode */ From owner-svn-src-all@freebsd.org Mon Aug 15 17:40:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4A71BBAA66; Mon, 15 Aug 2016 17:40:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACB8A1921; Mon, 15 Aug 2016 17:40:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FHe5BL057957; Mon, 15 Aug 2016 17:40:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FHe5vh057953; Mon, 15 Aug 2016 17:40:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608151740.u7FHe5vh057953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Aug 2016 17:40:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304168 - in head/sys/dev/cxgbe: . common 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 17:40:06 -0000 Author: jhb Date: Mon Aug 15 17:40:05 2016 New Revision: 304168 URL: https://svnweb.freebsd.org/changeset/base/304168 Log: Make SGE parameter handling more VF-friendly. Add fields to hold the SGE control register and free list buffer sizes to the sge_params structure. Populate these new fields in t4_init_sge_params() for PF devices and change t4_read_chip_settings() to pull these values out of the params structure instead of reading registers directly. This will permit t4_read_chip_settings() to be reused for VF devices which cannot read SGE registers directly. While here, move the call to t4_init_sge_params() to get_params__post_init(). The VF driver will populate the SGE parameters structure via a different method before calling t4_read_chip_settings(). Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7476 Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Mon Aug 15 17:37:28 2016 (r304167) +++ head/sys/dev/cxgbe/common/common.h Mon Aug 15 17:40:05 2016 (r304168) @@ -215,6 +215,8 @@ struct sge_params { int pad_boundary; int pack_boundary; int fl_pktshift; + u32 sge_control; + u32 sge_fl_buffer_size[SGE_FLBUF_SIZES]; }; struct tp_params { Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 15 17:37:28 2016 (r304167) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 15 17:40:05 2016 (r304168) @@ -7644,6 +7644,7 @@ int t4_init_sge_params(struct adapter *a { u32 r; struct sge_params *sp = &adapter->params.sge; + unsigned i; r = t4_read_reg(adapter, A_SGE_INGRESS_RX_THRESHOLD); sp->counter_val[0] = G_THRESHOLD_0(r); @@ -7686,6 +7687,7 @@ int t4_init_sge_params(struct adapter *a sp->page_shift = (r & M_HOSTPAGESIZEPF0) + 10; r = t4_read_reg(adapter, A_SGE_CONTROL); + sp->sge_control = r; sp->spg_len = r & F_EGRSTATUSPAGESIZE ? 128 : 64; sp->fl_pktshift = G_PKTSHIFT(r); sp->pad_boundary = 1 << (G_INGPADBOUNDARY(r) + 5); @@ -7698,6 +7700,9 @@ int t4_init_sge_params(struct adapter *a else sp->pack_boundary = 1 << (G_INGPACKBOUNDARY(r) + 5); } + for (i = 0; i < SGE_FLBUF_SIZES; i++) + sp->sge_fl_buffer_size[i] = t4_read_reg(adapter, + A_SGE_FL_BUFFER_SIZE0 + (4 * i)); return 0; } Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Aug 15 17:37:28 2016 (r304167) +++ head/sys/dev/cxgbe/t4_main.c Mon Aug 15 17:40:05 2016 (r304168) @@ -3332,6 +3332,8 @@ get_params__post_init(struct adapter *sc sc->vres.iscsi.size = val[1] - val[0] + 1; } + t4_init_sge_params(sc); + /* * We've got the params we wanted to query via the firmware. Now grab * some others directly from the chip. Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Aug 15 17:37:28 2016 (r304167) +++ head/sys/dev/cxgbe/t4_sge.c Mon Aug 15 17:40:05 2016 (r304168) @@ -625,11 +625,9 @@ t4_read_chip_settings(struct adapter *sc struct sw_zone_info *swz, *safe_swz; struct hw_buf_info *hwb; - t4_init_sge_params(sc); - m = F_RXPKTCPLMODE; v = F_RXPKTCPLMODE; - r = t4_read_reg(sc, A_SGE_CONTROL); + r = sc->params.sge.sge_control; if ((r & m) != v) { device_printf(sc->dev, "invalid SGE_CONTROL(0x%x)\n", r); rc = EINVAL; @@ -647,7 +645,7 @@ t4_read_chip_settings(struct adapter *sc /* Filter out unusable hw buffer sizes entirely (mark with -2). */ hwb = &s->hw_buf_info[0]; for (i = 0; i < nitems(s->hw_buf_info); i++, hwb++) { - r = t4_read_reg(sc, A_SGE_FL_BUFFER_SIZE0 + (4 * i)); + r = sc->params.sge.sge_fl_buffer_size[i]; hwb->size = r; hwb->zidx = hwsz_ok(sc, r) ? -1 : -2; hwb->next = -1; From owner-svn-src-all@freebsd.org Mon Aug 15 17:41:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82662BBACB9; Mon, 15 Aug 2016 17:41:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38EE61D04; Mon, 15 Aug 2016 17:41:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FHfYOW059280; Mon, 15 Aug 2016 17:41:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FHfY7a059279; Mon, 15 Aug 2016 17:41:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608151741.u7FHfY7a059279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Aug 2016 17:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304169 - head/sys/dev/cxgbe/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 17:41:35 -0000 Author: jhb Date: Mon Aug 15 17:41:34 2016 New Revision: 304169 URL: https://svnweb.freebsd.org/changeset/base/304169 Log: Update mailbox writes to work with VF devices. - Use alternate register locations for the data and control registers for VFs. - Do a dummy read to force the writes to the mailbox data registers to post before the write to the control register on VFs. - Do not check the PCI-e firmware register for errors on VFs. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7483 Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 15 17:40:05 2016 (r304168) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 15 17:41:34 2016 (r304169) @@ -289,6 +289,14 @@ int t4_wr_mbox_meat_timeout(struct adapt if ((size & 15) || size > MBOX_LEN) return -EINVAL; + if (adap->flags & IS_VF) { + if (is_t6(adap)) + data_reg = FW_T6VF_MBDATA_BASE_ADDR; + else + data_reg = FW_T4VF_MBDATA_BASE_ADDR; + ctl_reg = VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL); + } + /* * If we have a negative timeout, that implies that we can't sleep. */ @@ -343,6 +351,22 @@ int t4_wr_mbox_meat_timeout(struct adapt for (i = 0; i < size; i += 8, p++) t4_write_reg64(adap, data_reg + i, be64_to_cpu(*p)); + if (adap->flags & IS_VF) { + /* + * For the VFs, the Mailbox Data "registers" are + * actually backed by T4's "MA" interface rather than + * PL Registers (as is the case for the PFs). Because + * these are in different coherency domains, the write + * to the VF's PL-register-backed Mailbox Control can + * race in front of the writes to the MA-backed VF + * Mailbox Data "registers". So we need to do a + * read-back on at least one byte of the VF Mailbox + * Data registers before doing the write to the VF + * Mailbox Control register. + */ + t4_read_reg(adap, data_reg); + } + CH_DUMP_MBOX(adap, mbox, data_reg); t4_write_reg(adap, ctl_reg, F_MBMSGVALID | V_MBOWNER(X_MBOWNER_FW)); @@ -355,10 +379,13 @@ int t4_wr_mbox_meat_timeout(struct adapt * Loop waiting for the reply; bail out if we time out or the firmware * reports an error. */ - for (i = 0; - !((pcie_fw = t4_read_reg(adap, A_PCIE_FW)) & F_PCIE_FW_ERR) && - i < timeout; - i += ms) { + pcie_fw = 0; + for (i = 0; i < timeout; i += ms) { + if (!(adap->flags & IS_VF)) { + pcie_fw = t4_read_reg(adap, A_PCIE_FW); + if (pcie_fw & F_PCIE_FW_ERR) + break; + } if (sleep_ok) { ms = delay[delay_idx]; /* last element may repeat */ if (delay_idx < ARRAY_SIZE(delay) - 1) From owner-svn-src-all@freebsd.org Mon Aug 15 17:42:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEA1CBBAD41; Mon, 15 Aug 2016 17:42:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C9FE31147; Mon, 15 Aug 2016 17:42:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FHgttX061375; Mon, 15 Aug 2016 17:42:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FHgsXs061373; Mon, 15 Aug 2016 17:42:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608151742.u7FHgsXs061373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Aug 2016 17:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304170 - in head/sys/dev/cxgbe: . common 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 17:42:56 -0000 Author: jhb Date: Mon Aug 15 17:42:54 2016 New Revision: 304170 URL: https://svnweb.freebsd.org/changeset/base/304170 Log: Add support for register dumps on VF devices. - Add handling of VF register sets to t4_get_regs_len() and t4_get_regs(). - While here, use t4_get_regs_len() in the ioctl handler for regdump instead of inlining it. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7484 Modified: head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 15 17:41:34 2016 (r304169) +++ head/sys/dev/cxgbe/common/t4_hw.c Mon Aug 15 17:42:54 2016 (r304170) @@ -725,10 +725,14 @@ unsigned int t4_get_regs_len(struct adap switch (chip_version) { case CHELSIO_T4: + if (adapter->flags & IS_VF) + return FW_T4VF_REGMAP_SIZE; return T4_REGMAP_SIZE; case CHELSIO_T5: case CHELSIO_T6: + if (adapter->flags & IS_VF) + return FW_T4VF_REGMAP_SIZE; return T5_REGMAP_SIZE; } @@ -1207,6 +1211,18 @@ void t4_get_regs(struct adapter *adap, u 0x27e00, 0x27e04, }; + static const unsigned int t4vf_reg_ranges[] = { + VF_SGE_REG(A_SGE_VF_KDOORBELL), VF_SGE_REG(A_SGE_VF_GTS), + VF_MPS_REG(A_MPS_VF_CTL), + VF_MPS_REG(A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H), + VF_PL_REG(A_PL_VF_WHOAMI), VF_PL_REG(A_PL_VF_WHOAMI), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_STATUS), + FW_T4VF_MBDATA_BASE_ADDR, + FW_T4VF_MBDATA_BASE_ADDR + + ((NUM_CIM_PF_MAILBOX_DATA_INSTANCES - 1) * 4), + }; + static const unsigned int t5_reg_ranges[] = { 0x1008, 0x10c0, 0x10cc, 0x10f8, @@ -1982,6 +1998,18 @@ void t4_get_regs(struct adapter *adap, u 0x51300, 0x51308, }; + static const unsigned int t5vf_reg_ranges[] = { + VF_SGE_REG(A_SGE_VF_KDOORBELL), VF_SGE_REG(A_SGE_VF_GTS), + VF_MPS_REG(A_MPS_VF_CTL), + VF_MPS_REG(A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H), + VF_PL_REG(A_PL_VF_WHOAMI), VF_PL_REG(A_PL_VF_REVISION), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_STATUS), + FW_T4VF_MBDATA_BASE_ADDR, + FW_T4VF_MBDATA_BASE_ADDR + + ((NUM_CIM_PF_MAILBOX_DATA_INSTANCES - 1) * 4), + }; + static const unsigned int t6_reg_ranges[] = { 0x1008, 0x101c, 0x1024, 0x10a8, @@ -2559,6 +2587,18 @@ void t4_get_regs(struct adapter *adap, u 0x51300, 0x51324, }; + static const unsigned int t6vf_reg_ranges[] = { + VF_SGE_REG(A_SGE_VF_KDOORBELL), VF_SGE_REG(A_SGE_VF_GTS), + VF_MPS_REG(A_MPS_VF_CTL), + VF_MPS_REG(A_MPS_VF_STAT_RX_VF_ERR_FRAMES_H), + VF_PL_REG(A_PL_VF_WHOAMI), VF_PL_REG(A_PL_VF_REVISION), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_CTRL), + VF_CIM_REG(A_CIM_VF_EXT_MAILBOX_STATUS), + FW_T6VF_MBDATA_BASE_ADDR, + FW_T6VF_MBDATA_BASE_ADDR + + ((NUM_CIM_PF_MAILBOX_DATA_INSTANCES - 1) * 4), + }; + u32 *buf_end = (u32 *)(buf + buf_size); const unsigned int *reg_ranges; int reg_ranges_size, range; @@ -2570,18 +2610,33 @@ void t4_get_regs(struct adapter *adap, u */ switch (chip_version) { case CHELSIO_T4: - reg_ranges = t4_reg_ranges; - reg_ranges_size = ARRAY_SIZE(t4_reg_ranges); + if (adap->flags & IS_VF) { + reg_ranges = t4vf_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t4vf_reg_ranges); + } else { + reg_ranges = t4_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t4_reg_ranges); + } break; case CHELSIO_T5: - reg_ranges = t5_reg_ranges; - reg_ranges_size = ARRAY_SIZE(t5_reg_ranges); + if (adap->flags & IS_VF) { + reg_ranges = t5vf_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t5vf_reg_ranges); + } else { + reg_ranges = t5_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t5_reg_ranges); + } break; case CHELSIO_T6: - reg_ranges = t6_reg_ranges; - reg_ranges_size = ARRAY_SIZE(t6_reg_ranges); + if (adap->flags & IS_VF) { + reg_ranges = t6vf_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t6vf_reg_ranges); + } else { + reg_ranges = t6_reg_ranges; + reg_ranges_size = ARRAY_SIZE(t6_reg_ranges); + } break; default: Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Aug 15 17:41:34 2016 (r304169) +++ head/sys/dev/cxgbe/t4_main.c Mon Aug 15 17:42:54 2016 (r304170) @@ -8765,7 +8765,7 @@ t4_ioctl(struct cdev *dev, unsigned long } case CHELSIO_T4_REGDUMP: { struct t4_regdump *regs = (struct t4_regdump *)data; - int reglen = is_t4(sc) ? T4_REGDUMP_SIZE : T5_REGDUMP_SIZE; + int reglen = t4_get_regs_len(sc); uint8_t *buf; if (regs->len < reglen) { From owner-svn-src-all@freebsd.org Mon Aug 15 17:58:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9AF5BBB4F2; Mon, 15 Aug 2016 17:58:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A92251DBE; Mon, 15 Aug 2016 17:58:13 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FHwCmK065807; Mon, 15 Aug 2016 17:58:12 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FHwCMG065806; Mon, 15 Aug 2016 17:58:12 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608151758.u7FHwCMG065806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 15 Aug 2016 17:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304172 - releng/11.0/sys/arm64/arm64 X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 17:58:14 -0000 Author: ed Date: Mon Aug 15 17:58:12 2016 New Revision: 304172 URL: https://svnweb.freebsd.org/changeset/base/304172 Log: MFC r303923: Make cpu_set_user_tls() work when called on the running thread. On all the other architectures, this function can also be called on the currently running thread. In this case, we shouldn't fix up the address in the PCB, but also patch up the register itself. Otherwise it will not become active and will simply become overwritten by the next switch. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D7437 Approved by: re Modified: releng/11.0/sys/arm64/arm64/vm_machdep.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/sys/arm64/arm64/vm_machdep.c ============================================================================== --- releng/11.0/sys/arm64/arm64/vm_machdep.c Mon Aug 15 17:55:56 2016 (r304171) +++ releng/11.0/sys/arm64/arm64/vm_machdep.c Mon Aug 15 17:58:12 2016 (r304172) @@ -201,6 +201,8 @@ cpu_set_user_tls(struct thread *td, void pcb = td->td_pcb; pcb->pcb_tpidr_el0 = (register_t)tls_base; + if (td == curthread) + WRITE_SPECIALREG(tpidr_el0, tls_base); return (0); } From owner-svn-src-all@freebsd.org Mon Aug 15 18:02:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E195BBB6CD; Mon, 15 Aug 2016 18:02:38 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63B2D136A; Mon, 15 Aug 2016 18:02:38 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FI2blC069370; Mon, 15 Aug 2016 18:02:37 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FI2bBf069368; Mon, 15 Aug 2016 18:02:37 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151802.u7FI2bBf069368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 18:02:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304173 - head/sys/dev/syscons 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 18:02:38 -0000 Author: bde Date: Mon Aug 15 18:02:37 2016 New Revision: 304173 URL: https://svnweb.freebsd.org/changeset/base/304173 Log: Fix restoring the kbd_mode part of the keyboard state in grab/ungrab. Simply change the mode to K_XLATE using a local variable and use the grab level as a flag to tell screen switches not to change it again, so that we don't need to switch scp->kbd_mode. We did the latter, but didn't have the complications to update the keyboard mode switch for every screen switch. sc->kbd_mode remains at its user setting for all scp's and ungrabbing restores to it. Modified: head/sys/dev/syscons/syscons.c head/sys/dev/syscons/syscons.h Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 17:58:12 2016 (r304172) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 18:02:37 2016 (r304173) @@ -1649,6 +1649,7 @@ static void sc_cngrab(struct consdev *cp) { scr_stat *scp; + int kbd_mode; if (!cold && sc_console->sc->cur_scp->index != sc_console->index && @@ -1670,11 +1671,9 @@ sc_cngrab(struct consdev *cp) */ kbdd_enable(scp->sc->kbd); - /* we shall always use the keyboard in the XLATE mode here */ - scp->kbd_prev_mode = scp->kbd_mode; - scp->kbd_mode = K_XLATE; - (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); - + /* Switch the keyboard to console mode (K_XLATE, polled) on all scp's. */ + kbd_mode = K_XLATE; + (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&kbd_mode); kbdd_poll(scp->sc->kbd, TRUE); } @@ -1690,10 +1689,10 @@ sc_cnungrab(struct consdev *cp) if (--scp->sc->grab_level > 0) return; + /* Restore keyboard mode (for the current, possibly-changed scp). */ kbdd_poll(scp->sc->kbd, FALSE); - - scp->kbd_mode = scp->kbd_prev_mode; (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + kbdd_disable(scp->sc->kbd); } @@ -2667,7 +2666,7 @@ exchange_scr(sc_softc_t *sc) sc_set_border(scp, scp->border); /* set up the keyboard for the new screen */ - if (sc->old_scp->kbd_mode != scp->kbd_mode) + if (sc->grab_level == 0 && sc->old_scp->kbd_mode != scp->kbd_mode) (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); update_kbd_state(scp, scp->status, LOCK_MASK); @@ -3412,7 +3411,7 @@ next_code: if (!(flags & SCGETC_CN)) random_harvest_queue(&c, sizeof(c), 1, RANDOM_KEYBOARD); - if (scp->kbd_mode != K_XLATE) + if (sc->grab_level == 0 && scp->kbd_mode != K_XLATE) return KEYCHAR(c); /* if scroll-lock pressed allow history browsing */ Modified: head/sys/dev/syscons/syscons.h ============================================================================== --- head/sys/dev/syscons/syscons.h Mon Aug 15 17:58:12 2016 (r304172) +++ head/sys/dev/syscons/syscons.h Mon Aug 15 18:02:37 2016 (r304173) @@ -306,7 +306,6 @@ typedef struct scr_stat { int status; /* status (bitfield) */ int kbd_mode; /* keyboard I/O mode */ - int kbd_prev_mode; /* keyboard I/O mode */ int cursor_pos; /* cursor buffer position */ int cursor_oldpos; /* cursor old buffer position */ From owner-svn-src-all@freebsd.org Mon Aug 15 18:15:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F9A0BBBA2A; Mon, 15 Aug 2016 18:15:52 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB07C1B7B; Mon, 15 Aug 2016 18:15:51 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0F2B81FE022; Mon, 15 Aug 2016 20:15:47 +0200 (CEST) Subject: Re: svn commit: r303848 - head/sys/netgraph To: "Ngie Cooper (yaneurabeya)" , Gleb Smirnoff References: <201608081931.u78JV1Ve026577@repo.freebsd.org> <20160812183845.GJ1076@FreeBSD.org> <96EEC230-97EA-4686-9AFC-D5D6F98E70E8@gmail.com> Cc: Sean Bruno , Michael Zhilin , Garrett Cooper , sergey.dyatko@gmail.com, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <9055748a-51c1-c6d7-b22d-52abde4d01f7@selasky.org> Date: Mon, 15 Aug 2016 20:20:15 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <96EEC230-97EA-4686-9AFC-D5D6F98E70E8@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 18:15:52 -0000 On 08/13/16 00:23, Ngie Cooper (yaneurabeya) wrote: > >> On Aug 12, 2016, at 11:38, Gleb Smirnoff wrote: >> >> Hi! >> >> Sorry, I'm afraid this isn't a correct fix. Simply adding checks >> against NULL to avoid panics at race conditions isn't a solution. >> >> I can provide help with this problem. It must be related to my >> callout changes, in case if this is a very recent problem. >> >> Is it a recent problem or an old one? > > I should have requested that the change be revised or further qualified first… as I said in the CR: > > “â€â€ > In D7209#150056, @bz wrote: > Is this sudden problem possibly related to glebius' callout changes? I am not properly tracking things but if invariants changed and weren't reflected in the callers, that might explain. > I don't know to be honest. > > I'll add glebius (I should have done that in the first place). > “â€â€ > Hi Ngie, Is this problem reproducable with projects/hps_head? --HPS From owner-svn-src-all@freebsd.org Mon Aug 15 18:49:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 778F0BBBF0D; Mon, 15 Aug 2016 18:49:01 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pa0-x22f.google.com (mail-pa0-x22f.google.com [IPv6:2607:f8b0:400e:c03::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4620419BD; Mon, 15 Aug 2016 18:49:01 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pa0-x22f.google.com with SMTP id pp5so18292124pac.3; Mon, 15 Aug 2016 11:49:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=9kXm3y3lUyP1rygkDzpm4lf/INCaGxNu8b4WtOhmvU8=; b=mKFqAOza48FwG6T1B2Jmx8QQTkF+cfsxG6/u7JUAB72rG6CYogYTFFsyWNwWKvL770 T8MQN61GsdqHfawWivLZve+kWrn5j+gnwECBBgIeoVi2H5hEBxX2PTvdReUn3q0lrXg2 H2Oo65M+ChCeG/sd/XFYUz405P9IgSjA8LYk79Y8I7FG3YL/u+CULkGjaByuS8m72Y2H IzRF90PkpOk5RZhScrDdLHiAOeBObeVrC9+srCzSoergGqQYaQ1gd3im7TkRp0HUtGBY o0jpSQtsF0gV1T4vS5pG7gJDVu6VsS5dKoRiIBbwAQNIMMzSAk8Raw2O+VHUKBg8JYME vaag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=9kXm3y3lUyP1rygkDzpm4lf/INCaGxNu8b4WtOhmvU8=; b=kFkpRDiuo6aEI9Wlz5SQQ0xG9IVH6GuaOQWDIINgm8+c3owoOsCQyvH4/eBTcI2TlV Cu+yhhx1Ad18SLH9lPD3HXRjD1sptV5YPtWfSf4X6P+F4NJRoB9EZ7aprDfv7V8NDdrE dSf/u2E82XJGcNB+wyw7PWiK+ViP8jHc8qnzdT3P1spE0k7kYDsRj3VNFvyE8gLZQd0N pQCwahsUzeJzP1pfj4t7PAPdtXErNGBdM3opCIm26nL2is+XcCacvvIUCRyTfHhygnF9 t/rrdh9lx51j3CZyCKcS74BtKqiiZhLYu9dCe2hPBh1PawlvTeWwCddlBDyKxRVEyGzd ZH8Q== X-Gm-Message-State: AEkoousbmb4nxRpBaMzx2BtVtxp+gF7SXAhEqBu2LgKPCd0RdRPlW4OqrChktOrJYdcnAA== X-Received: by 10.67.1.35 with SMTP id bd3mr56400238pad.16.1471286940729; Mon, 15 Aug 2016 11:49:00 -0700 (PDT) Received: from [21.177.19.242] ([172.56.42.172]) by smtp.gmail.com with ESMTPSA id fe8sm33321749pad.2.2016.08.15.11.48.59 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 15 Aug 2016 11:49:00 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r303848 - head/sys/netgraph From: Ngie Cooper X-Mailer: iPhone Mail (13G35) In-Reply-To: <9055748a-51c1-c6d7-b22d-52abde4d01f7@selasky.org> Date: Mon, 15 Aug 2016 11:48:58 -0700 Cc: Gleb Smirnoff , Sean Bruno , Michael Zhilin , Garrett Cooper , sergey.dyatko@gmail.com, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <94EC323B-F059-43F4-8775-4FEDAB6C17B1@gmail.com> References: <201608081931.u78JV1Ve026577@repo.freebsd.org> <20160812183845.GJ1076@FreeBSD.org> <96EEC230-97EA-4686-9AFC-D5D6F98E70E8@gmail.com> <9055748a-51c1-c6d7-b22d-52abde4d01f7@selasky.org> To: Hans Petter Selasky X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 18:49:01 -0000 Hi Hans, > On Aug 15, 2016, at 11:20, Hans Petter Selasky wrote: ...=20 > Hi Ngie, >=20 > Is this problem reproducable with projects/hps_head? I never reproed the issue before.. I'd have to look at the suggested repro f= rom the CR poster. Thanks! -Ngie= From owner-svn-src-all@freebsd.org Mon Aug 15 18:55:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72DFDBBA1AC; Mon, 15 Aug 2016 18:55:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 433A61F47; Mon, 15 Aug 2016 18:55:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FItXc0088164; Mon, 15 Aug 2016 18:55:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FItX6L088163; Mon, 15 Aug 2016 18:55:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608151855.u7FItX6L088163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Aug 2016 18:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304174 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 18:55:34 -0000 Author: kib Date: Mon Aug 15 18:55:33 2016 New Revision: 304174 URL: https://svnweb.freebsd.org/changeset/base/304174 Log: VOP_FSYNC() does not take cred as an argument. Correct comment. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/kern/vfs_default.c Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Mon Aug 15 18:02:37 2016 (r304173) +++ head/sys/kern/vfs_default.c Mon Aug 15 18:55:33 2016 (r304174) @@ -640,7 +640,6 @@ int vop_stdfsync(ap) struct vop_fsync_args /* { struct vnode *a_vp; - struct ucred *a_cred; int a_waitfor; struct thread *a_td; } */ *ap; From owner-svn-src-all@freebsd.org Mon Aug 15 19:05:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15B1DBBA493; Mon, 15 Aug 2016 19:05:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6CDE1732; Mon, 15 Aug 2016 19:05:42 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FJ5foP091783; Mon, 15 Aug 2016 19:05:41 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJ5fch091782; Mon, 15 Aug 2016 19:05:41 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608151905.u7FJ5fch091782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 15 Aug 2016 19:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304175 - head/contrib/netbsd-tests/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 19:05:43 -0000 Author: ed Date: Mon Aug 15 19:05:41 2016 New Revision: 304175 URL: https://svnweb.freebsd.org/changeset/base/304175 Log: Disable tests for non-standard behaviour of dirname(3)/basename(3). The NetBSD ATF tests explicitly check that these functions do not modify their input. These tests are NetBSD-specific. They test for something that is not part of POSIX. PR: 211873 Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D7506 Modified: head/contrib/netbsd-tests/lib/libc/gen/t_basedirname.c Modified: head/contrib/netbsd-tests/lib/libc/gen/t_basedirname.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/gen/t_basedirname.c Mon Aug 15 18:55:33 2016 (r304174) +++ head/contrib/netbsd-tests/lib/libc/gen/t_basedirname.c Mon Aug 15 19:05:41 2016 (r304175) @@ -111,6 +111,7 @@ ATF_TC_BODY(basename_posix, tc) } else base = basename(NULL); +#ifdef __NetBSD__ /* * basename(3) is allowed to modify the input buffer. * However, that is considered hostile by some programs, @@ -127,6 +128,7 @@ ATF_TC_BODY(basename_posix, tc) test_basename_table[i].input); atf_tc_fail("Input buffer was modified."); } +#endif /* Make sure the result is correct. */ if (strcmp(test_basename_table[i].output, base) != 0) { @@ -162,6 +164,7 @@ ATF_TC_BODY(dirname_posix, tc) } else base = dirname(NULL); +#ifdef __NetBSD__ /* * dirname(3) is allowed to modify the input buffer. * However, that is considered hostile by some programs, @@ -178,6 +181,7 @@ ATF_TC_BODY(dirname_posix, tc) test_dirname_table[i].input); atf_tc_fail("Input buffer was modified."); } +#endif /* Make sure the result is correct. */ if (strcmp(test_dirname_table[i].output, base) != 0) { From owner-svn-src-all@freebsd.org Mon Aug 15 19:08:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54544BBA814; Mon, 15 Aug 2016 19:08:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3081B1A37; Mon, 15 Aug 2016 19:08:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FJ8qtp091946; Mon, 15 Aug 2016 19:08:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJ8phh091939; Mon, 15 Aug 2016 19:08:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608151908.u7FJ8phh091939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Aug 2016 19:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304176 - in head: include lib/libc/sys sys/compat/freebsd32 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 19:08:53 -0000 Author: kib Date: Mon Aug 15 19:08:51 2016 New Revision: 304176 URL: https://svnweb.freebsd.org/changeset/base/304176 Log: Add an implementation of fdatasync(2). The syscall is a trivial wrapper around new VOP_FDATASYNC(), sharing code with fsync(2). For all filesystems, this commit provides the implementation which delegates the work of VOP_FDATASYNC() to VOP_FSYNC(). This is functionally correct but not efficient. This is not yet POSIX-compliant implementation, because it does not ensure that queued AIO requests are completed before returning. Reviewed by: mckusick Discussed with: avg (ZFS), jhb (AIO part) Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D7471 Modified: head/include/unistd.h head/lib/libc/sys/Symbol.map head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master head/sys/kern/vfs_default.c head/sys/kern/vfs_syscalls.c head/sys/kern/vnode_if.src Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Mon Aug 15 19:05:41 2016 (r304175) +++ head/include/unistd.h Mon Aug 15 19:08:51 2016 (r304176) @@ -384,6 +384,7 @@ extern int optind, opterr, optopt; /* ISO/IEC 9945-1: 1996 */ #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE int fsync(int); +int fdatasync(int); /* * ftruncate() was in the POSIX Realtime Extension (it's used for shared Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Mon Aug 15 19:05:41 2016 (r304175) +++ head/lib/libc/sys/Symbol.map Mon Aug 15 19:08:51 2016 (r304176) @@ -400,6 +400,10 @@ FBSD_1.4 { recvmmsg; }; +FBSD_1.5 { + fdatasync; +}; + FBSDprivate_1.0 { ___acl_aclcheck_fd; __sys___acl_aclcheck_fd; @@ -594,6 +598,8 @@ FBSDprivate_1.0 { __sys_fstatfs; _fsync; __sys_fsync; + _fdatasync; + __sys_fdatasync; _futimes; __sys_futimes; _getaudit; Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Mon Aug 15 19:05:41 2016 (r304175) +++ head/sys/compat/freebsd32/syscalls.master Mon Aug 15 19:08:51 2016 (r304176) @@ -1081,3 +1081,4 @@ 549 AUE_NULL NOPROTO { int numa_setaffinity(cpuwhich_t which, \ id_t id, \ const struct vm_domain_policy *policy); } +550 AUE_FSYNC NOPROTO { int fdatasync(int fd); } Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Mon Aug 15 19:05:41 2016 (r304175) +++ head/sys/kern/syscalls.master Mon Aug 15 19:08:51 2016 (r304176) @@ -993,8 +993,9 @@ id_t id, \ struct vm_domain_policy_entry *policy); } 549 AUE_NULL STD { int numa_setaffinity(cpuwhich_t which, \ - id_t id, \ - const struct vm_domain_policy_entry *policy); } + id_t id, const struct \ + vm_domain_policy_entry *policy); } +550 AUE_FSYNC STD { int fdatasync(int fd); } ; Please copy any additions and changes to the following compatability tables: ; sys/compat/freebsd32/syscalls.master Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Mon Aug 15 19:05:41 2016 (r304175) +++ head/sys/kern/vfs_default.c Mon Aug 15 19:08:51 2016 (r304176) @@ -83,6 +83,7 @@ static int vop_stdset_text(struct vop_se static int vop_stdunset_text(struct vop_unset_text_args *ap); static int vop_stdget_writecount(struct vop_get_writecount_args *ap); static int vop_stdadd_writecount(struct vop_add_writecount_args *ap); +static int vop_stdfdatasync(struct vop_fdatasync_args *ap); static int vop_stdgetpages_async(struct vop_getpages_async_args *ap); /* @@ -111,6 +112,7 @@ struct vop_vector default_vnodeops = { .vop_bmap = vop_stdbmap, .vop_close = VOP_NULL, .vop_fsync = VOP_NULL, + .vop_fdatasync = vop_stdfdatasync, .vop_getpages = vop_stdgetpages, .vop_getpages_async = vop_stdgetpages_async, .vop_getwritemount = vop_stdgetwritemount, @@ -726,6 +728,13 @@ loop2: return (error); } +static int +vop_stdfdatasync(struct vop_fdatasync_args *ap) +{ + + return (VOP_FSYNC(ap->a_vp, MNT_WAIT, ap->a_td)); +} + /* XXX Needs good comment and more info in the manpage (VOP_GETPAGES(9)). */ int vop_stdgetpages(ap) Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Aug 15 19:05:41 2016 (r304175) +++ head/sys/kern/vfs_syscalls.c Mon Aug 15 19:08:51 2016 (r304176) @@ -3354,20 +3354,8 @@ freebsd6_ftruncate(struct thread *td, st } #endif -/* - * Sync an open file. - */ -#ifndef _SYS_SYSPROTO_H_ -struct fsync_args { - int fd; -}; -#endif -int -sys_fsync(td, uap) - struct thread *td; - struct fsync_args /* { - int fd; - } */ *uap; +static int +kern_fsync(struct thread *td, int fd, bool fullsync) { struct vnode *vp; struct mount *mp; @@ -3375,11 +3363,15 @@ sys_fsync(td, uap) cap_rights_t rights; int error, lock_flags; - AUDIT_ARG_FD(uap->fd); - error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_FSYNC), &fp); + AUDIT_ARG_FD(fd); + error = getvnode(td, fd, cap_rights_init(&rights, CAP_FSYNC), &fp); if (error != 0) return (error); vp = fp->f_vnode; +#if 0 + if (!fullsync) + /* XXXKIB: compete outstanding aio writes */; +#endif error = vn_start_write(vp, &mp, V_WAIT | PCATCH); if (error != 0) goto drop; @@ -3396,8 +3388,7 @@ sys_fsync(td, uap) vm_object_page_clean(vp->v_object, 0, 0, 0); VM_OBJECT_WUNLOCK(vp->v_object); } - error = VOP_FSYNC(vp, MNT_WAIT, td); - + error = fullsync ? VOP_FSYNC(vp, MNT_WAIT, td) : VOP_FDATASYNC(vp, td); VOP_UNLOCK(vp, 0); vn_finished_write(mp); drop: @@ -3406,6 +3397,28 @@ drop: } /* + * Sync an open file. + */ +#ifndef _SYS_SYSPROTO_H_ +struct fsync_args { + int fd; +}; +#endif +int +sys_fsync(struct thread *td, struct fsync_args *uap) +{ + + return (kern_fsync(td, uap->fd, true)); +} + +int +sys_fdatasync(struct thread *td, struct fdatasync_args *uap) +{ + + return (kern_fsync(td, uap->fd, false)); +} + +/* * Rename files. Source and destination must either both be directories, or * both not be directories. If target is a directory, it must be empty. */ Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Mon Aug 15 19:05:41 2016 (r304175) +++ head/sys/kern/vnode_if.src Mon Aug 15 19:08:51 2016 (r304176) @@ -703,6 +703,14 @@ vop_add_writecount { IN int inc; }; +%% fdatasync vp L L L + +vop_fdatasync { + IN struct vnode *vp; + IN struct thread *td; +}; + + # The VOPs below are spares at the end of the table to allow new VOPs to be # added in stable branches without breaking the KBI. New VOPs in HEAD should # be added above these spares. When merging a new VOP to a stable branch, From owner-svn-src-all@freebsd.org Mon Aug 15 19:15:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EDD7BBAA7D; Mon, 15 Aug 2016 19:15:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D73F61F70; Mon, 15 Aug 2016 19:15:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FJFm4W095566; Mon, 15 Aug 2016 19:15:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJFlfc095555; Mon, 15 Aug 2016 19:15:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608151915.u7FJFlfc095555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Aug 2016 19:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304177 - in head/sys: compat/freebsd32 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 19:15:49 -0000 Author: kib Date: Mon Aug 15 19:15:46 2016 New Revision: 304177 URL: https://svnweb.freebsd.org/changeset/base/304177 Log: Regen after r304176, fdatasync(2) addition. Modified: head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/compat/freebsd32/freebsd32_proto.h Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 303699 2016-08-03 06:33:04Z ed + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 303699 2016-08-03 06:33:04Z ed + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -457,4 +457,5 @@ #define FREEBSD32_SYS_freebsd32_utimensat 547 #define FREEBSD32_SYS_numa_getaffinity 548 #define FREEBSD32_SYS_numa_setaffinity 549 -#define FREEBSD32_SYS_MAXSYSCALL 550 +#define FREEBSD32_SYS_fdatasync 550 +#define FREEBSD32_SYS_MAXSYSCALL 551 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 303699 2016-08-03 06:33:04Z ed + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib */ const char *freebsd32_syscallnames[] = { @@ -583,4 +583,5 @@ const char *freebsd32_syscallnames[] = { "freebsd32_utimensat", /* 547 = freebsd32_utimensat */ "numa_getaffinity", /* 548 = numa_getaffinity */ "numa_setaffinity", /* 549 = numa_setaffinity */ + "fdatasync", /* 550 = fdatasync */ }; Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 303699 2016-08-03 06:33:04Z ed + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib */ #include "opt_compat.h" @@ -626,4 +626,5 @@ struct sysent freebsd32_sysent[] = { { AS(freebsd32_utimensat_args), (sy_call_t *)freebsd32_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 547 = freebsd32_utimensat */ { AS(numa_getaffinity_args), (sy_call_t *)sys_numa_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 548 = numa_getaffinity */ { AS(numa_setaffinity_args), (sy_call_t *)sys_numa_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 549 = numa_setaffinity */ + { AS(fdatasync_args), (sy_call_t *)sys_fdatasync, AUE_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 550 = fdatasync */ }; Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Mon Aug 15 19:15:46 2016 (r304177) @@ -3316,6 +3316,13 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } + /* fdatasync */ + case 550: { + struct fdatasync_args *p = params; + iarg[0] = p->fd; /* int */ + *n_args = 1; + break; + } default: *n_args = 0; break; @@ -8902,6 +8909,16 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* fdatasync */ + case 550: + switch(ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10783,6 +10800,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* fdatasync */ + case 550: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/kern/init_sysent.c Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 303729 2016-08-03 18:48:56Z bdrewery + * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib */ #include "opt_compat.h" @@ -596,4 +596,5 @@ struct sysent sysent[] = { { AS(utimensat_args), (sy_call_t *)sys_utimensat, AUE_FUTIMESAT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 547 = utimensat */ { AS(numa_getaffinity_args), (sy_call_t *)sys_numa_getaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 548 = numa_getaffinity */ { AS(numa_setaffinity_args), (sy_call_t *)sys_numa_setaffinity, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 549 = numa_setaffinity */ + { AS(fdatasync_args), (sy_call_t *)sys_fdatasync, AUE_FSYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 550 = fdatasync */ }; Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/kern/syscalls.c Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 303729 2016-08-03 18:48:56Z bdrewery + * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib */ const char *syscallnames[] = { @@ -557,4 +557,5 @@ const char *syscallnames[] = { "utimensat", /* 547 = utimensat */ "numa_getaffinity", /* 548 = numa_getaffinity */ "numa_setaffinity", /* 549 = numa_setaffinity */ + "fdatasync", /* 550 = fdatasync */ }; Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/kern/systrace_args.c Mon Aug 15 19:15:46 2016 (r304177) @@ -3326,6 +3326,13 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } + /* fdatasync */ + case 550: { + struct fdatasync_args *p = params; + iarg[0] = p->fd; /* int */ + *n_args = 1; + break; + } default: *n_args = 0; break; @@ -8862,6 +8869,16 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* fdatasync */ + case 550: + switch(ndx) { + case 0: + p = "int"; + break; + default: + break; + }; + break; default: break; }; @@ -10778,6 +10795,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* fdatasync */ + case 550: + if (ndx == 0 || ndx == 1) + p = "int"; + break; default: break; }; Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/sys/syscall.h Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 303729 2016-08-03 18:48:56Z bdrewery + * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib */ #define SYS_syscall 0 @@ -467,4 +467,5 @@ #define SYS_utimensat 547 #define SYS_numa_getaffinity 548 #define SYS_numa_setaffinity 549 -#define SYS_MAXSYSCALL 550 +#define SYS_fdatasync 550 +#define SYS_MAXSYSCALL 551 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/sys/syscall.mk Mon Aug 15 19:15:46 2016 (r304177) @@ -1,7 +1,7 @@ # FreeBSD system call object files. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 303729 2016-08-03 18:48:56Z bdrewery +# created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib MIASM = \ syscall.o \ exit.o \ @@ -395,4 +395,5 @@ MIASM = \ futimens.o \ utimensat.o \ numa_getaffinity.o \ - numa_setaffinity.o + numa_setaffinity.o \ + fdatasync.o Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Mon Aug 15 19:08:51 2016 (r304176) +++ head/sys/sys/sysproto.h Mon Aug 15 19:15:46 2016 (r304177) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 303729 2016-08-03 18:48:56Z bdrewery + * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib */ #ifndef _SYS_SYSPROTO_H_ @@ -1788,6 +1788,9 @@ struct numa_setaffinity_args { char id_l_[PADL_(id_t)]; id_t id; char id_r_[PADR_(id_t)]; char policy_l_[PADL_(const struct vm_domain_policy_entry *)]; const struct vm_domain_policy_entry * policy; char policy_r_[PADR_(const struct vm_domain_policy_entry *)]; }; +struct fdatasync_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; +}; int nosys(struct thread *, struct nosys_args *); void sys_sys_exit(struct thread *, struct sys_exit_args *); int sys_fork(struct thread *, struct fork_args *); @@ -2174,6 +2177,7 @@ int sys_futimens(struct thread *, struct int sys_utimensat(struct thread *, struct utimensat_args *); int sys_numa_getaffinity(struct thread *, struct numa_getaffinity_args *); int sys_numa_setaffinity(struct thread *, struct numa_setaffinity_args *); +int sys_fdatasync(struct thread *, struct fdatasync_args *); #ifdef COMPAT_43 @@ -2951,6 +2955,7 @@ int freebsd10_pipe(struct thread *, stru #define SYS_AUE_utimensat AUE_FUTIMESAT #define SYS_AUE_numa_getaffinity AUE_NULL #define SYS_AUE_numa_setaffinity AUE_NULL +#define SYS_AUE_fdatasync AUE_FSYNC #undef PAD_ #undef PADL_ From owner-svn-src-all@freebsd.org Mon Aug 15 19:17:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87440BBAB9D; Mon, 15 Aug 2016 19:17:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A4A012D2; Mon, 15 Aug 2016 19:17:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FJH1Se095668; Mon, 15 Aug 2016 19:17:01 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJH1d3095665; Mon, 15 Aug 2016 19:17:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608151917.u7FJH1d3095665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Aug 2016 19:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304178 - in head/sys: fs/msdosfs 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 19:17:02 -0000 Author: kib Date: Mon Aug 15 19:17:00 2016 New Revision: 304178 URL: https://svnweb.freebsd.org/changeset/base/304178 Log: Implement VOP_FDATASYNC() for msdosfs. Standard VOP_FSYNC() implementation just syncs data buffers, and due to this, is the correct and efficient implementation for msdosfs or any other filesystem which uses bufer cache trivially. Provide globally visible wrapper vop_stdfdatasync_buf() for future consumption by other filesystems. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D7471 Modified: head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/kern/vfs_default.c head/sys/sys/vnode.h Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Mon Aug 15 19:15:46 2016 (r304177) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Mon Aug 15 19:17:00 2016 (r304178) @@ -1897,6 +1897,7 @@ struct vop_vector msdosfs_vnodeops = { .vop_close = msdosfs_close, .vop_create = msdosfs_create, .vop_fsync = msdosfs_fsync, + .vop_fdatasync = vop_stdfdatasync_buf, .vop_getattr = msdosfs_getattr, .vop_inactive = msdosfs_inactive, .vop_link = msdosfs_link, Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Mon Aug 15 19:15:46 2016 (r304177) +++ head/sys/kern/vfs_default.c Mon Aug 15 19:17:00 2016 (r304178) @@ -735,6 +735,17 @@ vop_stdfdatasync(struct vop_fdatasync_ar return (VOP_FSYNC(ap->a_vp, MNT_WAIT, ap->a_td)); } +int +vop_stdfdatasync_buf(struct vop_fdatasync_args *ap) +{ + struct vop_fsync_args apf; + + apf.a_vp = ap->a_vp; + apf.a_waitfor = MNT_WAIT; + apf.a_td = ap->a_td; + return (vop_stdfsync(&apf)); +} + /* XXX Needs good comment and more info in the manpage (VOP_GETPAGES(9)). */ int vop_stdgetpages(ap) Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Mon Aug 15 19:15:46 2016 (r304177) +++ head/sys/sys/vnode.h Mon Aug 15 19:17:00 2016 (r304178) @@ -720,6 +720,7 @@ int vfs_write_suspend(struct mount *mp, int vfs_write_suspend_umnt(struct mount *mp); void vnlru_free(int, struct vfsops *); int vop_stdbmap(struct vop_bmap_args *); +int vop_stdfdatasync_buf(struct vop_fdatasync_args *); int vop_stdfsync(struct vop_fsync_args *); int vop_stdgetwritemount(struct vop_getwritemount_args *); int vop_stdgetpages(struct vop_getpages_args *); From owner-svn-src-all@freebsd.org Mon Aug 15 19:18:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98B5EBBAC6A; Mon, 15 Aug 2016 19:18:11 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68C9114A2; Mon, 15 Aug 2016 19:18:11 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FJIACZ095746; Mon, 15 Aug 2016 19:18:10 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJIA5A095745; Mon, 15 Aug 2016 19:18:10 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201608151918.u7FJIA5A095745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Mon, 15 Aug 2016 19:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304179 - releng/11.0/sys/dev/bxe X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 19:18:11 -0000 Author: rstone Date: Mon Aug 15 19:18:10 2016 New Revision: 304179 URL: https://svnweb.freebsd.org/changeset/base/304179 Log: MFC r304163 Don't enqueue NULL on a drbr In one corner case in the bxe TX path, a NULL mbuf could be enqueued onto a drbr queue. This could cause a KASSERT to fire with INVARIANTS enabled, or the processing of packets from the queue to be prematurely ended later on. Submitted by: Matt Joras (matt.joras AT isilon.com) Reviewed by: davidcs Sponsored by: EMC / Isilon Storage Division Approved by: re (kib) Differential Revision: https://reviews.freebsd.org/D7041 Modified: releng/11.0/sys/dev/bxe/bxe.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/sys/dev/bxe/bxe.c ============================================================================== --- releng/11.0/sys/dev/bxe/bxe.c Mon Aug 15 19:17:00 2016 (r304178) +++ releng/11.0/sys/dev/bxe/bxe.c Mon Aug 15 19:18:10 2016 (r304179) @@ -5624,7 +5624,8 @@ bxe_tx_mq_start_locked(struct bxe_softc if (!sc->link_vars.link_up || (if_getdrvflags(ifp) & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != IFF_DRV_RUNNING) { - rc = drbr_enqueue(ifp, tx_br, m); + if (m != NULL) + rc = drbr_enqueue(ifp, tx_br, m); goto bxe_tx_mq_start_locked_exit; } From owner-svn-src-all@freebsd.org Mon Aug 15 19:22:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FD64BBAF15; Mon, 15 Aug 2016 19:22:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18C48198C; Mon, 15 Aug 2016 19:22:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FJMOe1099412; Mon, 15 Aug 2016 19:22:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJMOmT099410; Mon, 15 Aug 2016 19:22:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608151922.u7FJMOmT099410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Aug 2016 19:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304180 - head/sys/ufs/ffs 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 19:22:25 -0000 Author: kib Date: Mon Aug 15 19:22:23 2016 New Revision: 304180 URL: https://svnweb.freebsd.org/changeset/base/304180 Log: Implement VOP_FDATASYNC() for UFS. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D7471 Modified: head/sys/ufs/ffs/ffs_extern.h head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_extern.h ============================================================================== --- head/sys/ufs/ffs/ffs_extern.h Mon Aug 15 19:18:10 2016 (r304179) +++ head/sys/ufs/ffs/ffs_extern.h Mon Aug 15 19:22:23 2016 (r304180) @@ -174,6 +174,11 @@ void softdep_freework(struct workhead *) * deadlock when flushing snapshot inodes while holding snaplk. */ #define NO_INO_UPDT 0x00000001 +/* + * Request data sync only from ffs_syncvnode(), not touching even more + * metadata than NO_INO_UPDT. + */ +#define DATA_ONLY 0x00000002 int ffs_rdonly(struct inode *); Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Mon Aug 15 19:18:10 2016 (r304179) +++ head/sys/ufs/ffs/ffs_vnops.c Mon Aug 15 19:22:23 2016 (r304180) @@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$"); extern int ffs_rawread(struct vnode *vp, struct uio *uio, int *workdone); #endif static vop_fsync_t ffs_fsync; +static vop_fdatasync_t ffs_fdatasync; static vop_lock1_t ffs_lock; static vop_read_t ffs_read; static vop_write_t ffs_write; @@ -123,6 +124,7 @@ static vop_vptofh_t ffs_vptofh; struct vop_vector ffs_vnodeops1 = { .vop_default = &ufs_vnodeops, .vop_fsync = ffs_fsync, + .vop_fdatasync = ffs_fdatasync, .vop_getpages = vnode_pager_local_getpages, .vop_getpages_async = vnode_pager_local_getpages_async, .vop_lock1 = ffs_lock, @@ -135,6 +137,7 @@ struct vop_vector ffs_vnodeops1 = { struct vop_vector ffs_fifoops1 = { .vop_default = &ufs_fifoops, .vop_fsync = ffs_fsync, + .vop_fdatasync = ffs_fdatasync, .vop_reallocblks = ffs_reallocblks, /* XXX: really ??? */ .vop_vptofh = ffs_vptofh, }; @@ -143,6 +146,7 @@ struct vop_vector ffs_fifoops1 = { struct vop_vector ffs_vnodeops2 = { .vop_default = &ufs_vnodeops, .vop_fsync = ffs_fsync, + .vop_fdatasync = ffs_fdatasync, .vop_getpages = vnode_pager_local_getpages, .vop_getpages_async = vnode_pager_local_getpages_async, .vop_lock1 = ffs_lock, @@ -161,6 +165,7 @@ struct vop_vector ffs_vnodeops2 = { struct vop_vector ffs_fifoops2 = { .vop_default = &ufs_fifoops, .vop_fsync = ffs_fsync, + .vop_fdatasync = ffs_fdatasync, .vop_lock1 = ffs_lock, .vop_reallocblks = ffs_reallocblks, .vop_strategy = ffsext_strategy, @@ -216,10 +221,10 @@ ffs_syncvnode(struct vnode *vp, int wait { struct inode *ip; struct bufobj *bo; - struct buf *bp; - struct buf *nbp; + struct buf *bp, *nbp; ufs_lbn_t lbn; - int error, wait, passes; + int error, passes; + bool still_dirty, wait; ip = VTOI(vp); ip->i_flag &= ~IN_NEEDSYNC; @@ -238,7 +243,7 @@ ffs_syncvnode(struct vnode *vp, int wait */ error = 0; passes = 0; - wait = 0; /* Always do an async pass first. */ + wait = false; /* Always do an async pass first. */ lbn = lblkno(ip->i_fs, (ip->i_size + ip->i_fs->fs_bsize - 1)); BO_LOCK(bo); loop: @@ -254,15 +259,23 @@ loop: if ((bp->b_vflags & BV_SCANNED) != 0) continue; bp->b_vflags |= BV_SCANNED; - /* Flush indirects in order. */ + /* + * Flush indirects in order, if requested. + * + * Note that if only datasync is requested, we can + * skip indirect blocks when softupdates are not + * active. Otherwise we must flush them with data, + * since dependencies prevent data block writes. + */ if (waitfor == MNT_WAIT && bp->b_lblkno <= -NDADDR && - lbn_level(bp->b_lblkno) >= passes) + (lbn_level(bp->b_lblkno) >= passes || + ((flags & DATA_ONLY) != 0 && !DOINGSOFTDEP(vp)))) continue; if (bp->b_lblkno > lbn) panic("ffs_syncvnode: syncing truncated data."); if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) == 0) { BO_UNLOCK(bo); - } else if (wait != 0) { + } else if (wait) { if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, BO_LOCKPTR(bo)) != 0) { @@ -330,31 +343,59 @@ next: * these will be done with one sync and one async pass. */ if (bo->bo_dirty.bv_cnt > 0) { - /* Write the inode after sync passes to flush deps. */ - if (wait && DOINGSOFTDEP(vp) && (flags & NO_INO_UPDT) == 0) { - BO_UNLOCK(bo); - ffs_update(vp, 1); - BO_LOCK(bo); + if ((flags & DATA_ONLY) == 0) { + still_dirty = true; + } else { + /* + * For data-only sync, dirty indirect buffers + * are ignored. + */ + still_dirty = false; + TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) { + if (bp->b_lblkno > -NDADDR) { + still_dirty = true; + break; + } + } } - /* switch between sync/async. */ - wait = !wait; - if (wait == 1 || ++passes < NIADDR + 2) - goto loop; + + if (still_dirty) { + /* Write the inode after sync passes to flush deps. */ + if (wait && DOINGSOFTDEP(vp) && + (flags & NO_INO_UPDT) == 0) { + BO_UNLOCK(bo); + ffs_update(vp, 1); + BO_LOCK(bo); + } + /* switch between sync/async. */ + wait = !wait; + if (wait || ++passes < NIADDR + 2) + goto loop; #ifdef INVARIANTS - if (!vn_isdisk(vp, NULL)) - vn_printf(vp, "ffs_fsync: dirty "); + if (!vn_isdisk(vp, NULL)) + vn_printf(vp, "ffs_fsync: dirty "); #endif + } } BO_UNLOCK(bo); error = 0; - if ((flags & NO_INO_UPDT) == 0) - error = ffs_update(vp, 1); - if (DOINGSUJ(vp)) - softdep_journal_fsync(VTOI(vp)); + if ((flags & DATA_ONLY) == 0) { + if ((flags & NO_INO_UPDT) == 0) + error = ffs_update(vp, 1); + if (DOINGSUJ(vp)) + softdep_journal_fsync(VTOI(vp)); + } return (error); } static int +ffs_fdatasync(struct vop_fdatasync_args *ap) +{ + + return (ffs_syncvnode(ap->a_vp, MNT_WAIT, DATA_ONLY)); +} + +static int ffs_lock(ap) struct vop_lock1_args /* { struct vnode *a_vp; From owner-svn-src-all@freebsd.org Mon Aug 15 19:37:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B75DBBB21A; Mon, 15 Aug 2016 19:37:20 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA1AF114C; Mon, 15 Aug 2016 19:37:19 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FJbIln003512; Mon, 15 Aug 2016 19:37:18 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJbINn003511; Mon, 15 Aug 2016 19:37:18 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151937.u7FJbINn003511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 19:37:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304181 - head/sys/dev/syscons 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 19:37:20 -0000 Author: bde Date: Mon Aug 15 19:37:18 2016 New Revision: 304181 URL: https://svnweb.freebsd.org/changeset/base/304181 Log: Restructure the grabbing functions into mere wrappers of new open and close functions. Scattered calls to sc_cnputc() and sc_cngetc() were broken by turning the semi-reentrant inline context-switching code in these functions into the grabbing functions. cncheckc() calls for panic dumps are the main broken case. The grabbing functions have special behaviour (mainly screen switching in sc_cngrab()) which makes them unsuitable as replacements for the inline code. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 19:22:23 2016 (r304180) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 19:37:18 2016 (r304181) @@ -1645,8 +1645,12 @@ sc_cnterm(struct consdev *cp) sc_console = NULL; } +struct sc_cnstate; /* not used yet */ +static void sccnclose(sc_softc_t *sc, struct sc_cnstate *sp); +static void sccnopen(sc_softc_t *sc, struct sc_cnstate *sp, int flags); + static void -sc_cngrab(struct consdev *cp) +sccnopen(sc_softc_t *sc, struct sc_cnstate *sp, int flags) { scr_stat *scp; int kbd_mode; @@ -1662,9 +1666,6 @@ sc_cngrab(struct consdev *cp) if (scp->sc->kbd == NULL) return; - if (scp->sc->grab_level++ > 0) - return; - /* * Make sure the keyboard is accessible even when the kbd device * driver is disabled. @@ -1678,7 +1679,7 @@ sc_cngrab(struct consdev *cp) } static void -sc_cnungrab(struct consdev *cp) +sccnclose(sc_softc_t *sc, struct sc_cnstate *sp) { scr_stat *scp; @@ -1686,9 +1687,6 @@ sc_cnungrab(struct consdev *cp) if (scp->sc->kbd == NULL) return; - if (--scp->sc->grab_level > 0) - return; - /* Restore keyboard mode (for the current, possibly-changed scp). */ kbdd_poll(scp->sc->kbd, FALSE); (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); @@ -1697,6 +1695,26 @@ sc_cnungrab(struct consdev *cp) } static void +sc_cngrab(struct consdev *cp) +{ + sc_softc_t *sc; + + sc = sc_console->sc; + if (sc->grab_level++ == 0) + sccnopen(sc, NULL, 0); +} + +static void +sc_cnungrab(struct consdev *cp) +{ + sc_softc_t *sc; + + sc = sc_console->sc; + if (--sc->grab_level == 0) + sccnclose(sc, NULL); +} + +static void sc_cnputc(struct consdev *cd, int c) { u_char buf[1]; From owner-svn-src-all@freebsd.org Mon Aug 15 19:42:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69778BBB411; Mon, 15 Aug 2016 19:42:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 367831661; Mon, 15 Aug 2016 19:42:22 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FJgL3k007374; Mon, 15 Aug 2016 19:42:21 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJgL99007373; Mon, 15 Aug 2016 19:42:21 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608151942.u7FJgL99007373@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 15 Aug 2016 19:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304182 - head/sys/compat/cloudabi 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 19:42:22 -0000 Author: ed Date: Mon Aug 15 19:42:21 2016 New Revision: 304182 URL: https://svnweb.freebsd.org/changeset/base/304182 Log: Let CloudABI use fdatasync() as well. Now that FreeBSD supports fdatasync() natively, we can tidy up CloudABI's equivalent system call to use that instead. Modified: head/sys/compat/cloudabi/cloudabi_fd.c Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 15 19:37:18 2016 (r304181) +++ head/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 15 19:42:21 2016 (r304182) @@ -172,12 +172,11 @@ int cloudabi_sys_fd_datasync(struct thread *td, struct cloudabi_sys_fd_datasync_args *uap) { - struct fsync_args fsync_args = { + struct fdatasync_args fdatasync_args = { .fd = uap->fd }; - /* Call into fsync(), as FreeBSD lacks fdatasync(). */ - return (sys_fsync(td, &fsync_args)); + return (sys_fdatasync(td, &fdatasync_args)); } int From owner-svn-src-all@freebsd.org Mon Aug 15 19:47:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD0E3BBB58B; Mon, 15 Aug 2016 19:47:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FBEF1942; Mon, 15 Aug 2016 19:47:05 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FJl4Si007584; Mon, 15 Aug 2016 19:47:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FJl4PS007583; Mon, 15 Aug 2016 19:47:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608151947.u7FJl4PS007583@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 15 Aug 2016 19:47:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304183 - head/cddl/usr.sbin/dtrace/tests/tools 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 19:47:05 -0000 Author: markj Date: Mon Aug 15 19:47:04 2016 New Revision: 304183 URL: https://svnweb.freebsd.org/changeset/base/304183 Log: dtraceUtil/tst.DataModel32.d.ksh passes on amd64. Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Modified: head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Mon Aug 15 19:42:21 2016 (r304182) +++ head/cddl/usr.sbin/dtrace/tests/tools/exclude.sh Mon Aug 15 19:47:04 2016 (r304183) @@ -27,7 +27,6 @@ exclude() } exclude EXFAIL common/aggs/tst.subr.d -exclude EXFAIL common/dtraceUtil/tst.DataModel32.d.ksh exclude EXFAIL common/dtraceUtil/tst.ELFGenerationOut.d.ksh exclude EXFAIL common/dtraceUtil/tst.ELFGenerationWithO.d.ksh exclude EXFAIL common/funcs/tst.copyin.d From owner-svn-src-all@freebsd.org Mon Aug 15 19:56:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C583BBB72B; Mon, 15 Aug 2016 19:56:49 +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-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D80E1DCE; Mon, 15 Aug 2016 19:56:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7FJuiZm062107 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 15 Aug 2016 22:56:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7FJuiZm062107 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7FJuiPI062106; Mon, 15 Aug 2016 22:56:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 Aug 2016 22:56:44 +0300 From: Konstantin Belousov To: Ed Schouten Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304182 - head/sys/compat/cloudabi Message-ID: <20160815195644.GC83214@kib.kiev.ua> References: <201608151942.u7FJgL99007373@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608151942.u7FJgL99007373@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 19:56:49 -0000 On Mon, Aug 15, 2016 at 07:42:21PM +0000, Ed Schouten wrote: > Author: ed > Date: Mon Aug 15 19:42:21 2016 > New Revision: 304182 > URL: https://svnweb.freebsd.org/changeset/base/304182 > > Log: > Let CloudABI use fdatasync() as well. > > Now that FreeBSD supports fdatasync() natively, we can tidy up > CloudABI's equivalent system call to use that instead. > > Modified: > head/sys/compat/cloudabi/cloudabi_fd.c > > Modified: head/sys/compat/cloudabi/cloudabi_fd.c > ============================================================================== > --- head/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 15 19:37:18 2016 (r304181) > +++ head/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 15 19:42:21 2016 (r304182) > @@ -172,12 +172,11 @@ int > cloudabi_sys_fd_datasync(struct thread *td, > struct cloudabi_sys_fd_datasync_args *uap) > { > - struct fsync_args fsync_args = { > + struct fdatasync_args fdatasync_args = { > .fd = uap->fd > }; > > - /* Call into fsync(), as FreeBSD lacks fdatasync(). */ > - return (sys_fsync(td, &fsync_args)); > + return (sys_fdatasync(td, &fdatasync_args)); > } > Please make kern_fsync() non-static and use it instead of providing fake fdatasync_args structure. From owner-svn-src-all@freebsd.org Mon Aug 15 20:09:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87C5BBBBA93; Mon, 15 Aug 2016 20:09:10 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E3611641; Mon, 15 Aug 2016 20:09:10 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FK99lj014847; Mon, 15 Aug 2016 20:09:09 GMT (envelope-from badger@FreeBSD.org) Received: (from badger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FK99Yj014846; Mon, 15 Aug 2016 20:09:09 GMT (envelope-from badger@FreeBSD.org) Message-Id: <201608152009.u7FK99Yj014846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: badger set sender to badger@FreeBSD.org using -f From: Eric Badger Date: Mon, 15 Aug 2016 20:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304184 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 20:09:10 -0000 Author: badger Date: Mon Aug 15 20:09:09 2016 New Revision: 304184 URL: https://svnweb.freebsd.org/changeset/base/304184 Log: sem_post(): wake up the sleeper only after adjusting has_waiters If the caller of sem_post() wakes up a thread sleeping via sem_wait() before it clears the has_waiters flag, the caller of sem_wait() has no way of knowing when it is safe to destroy the semaphore and reuse the memory. This is because the caller of sem_post() may be interrupted between the wake step and the clearing of has_waiters. It will then write into the has_waiters flag in userspace after being preempted for some unknown amount of time. Reviewed by: jhb, kib, vangyzen Approved by: kib (mentor), vangyzen (mentor) MFC after: 2 weeks Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D7505 Modified: head/sys/kern/kern_umtx.c Modified: head/sys/kern/kern_umtx.c ============================================================================== --- head/sys/kern/kern_umtx.c Mon Aug 15 19:47:04 2016 (r304183) +++ head/sys/kern/kern_umtx.c Mon Aug 15 20:09:09 2016 (r304184) @@ -3123,7 +3123,6 @@ do_sem_wake(struct thread *td, struct _u umtxq_busy(&key); cnt = umtxq_count(&key); if (cnt > 0) { - umtxq_signal(&key, 1); /* * Check if count is greater than 0, this means the memory is * still being referenced by user code, so we can safely @@ -3136,6 +3135,7 @@ do_sem_wake(struct thread *td, struct _u if (error == -1) error = EFAULT; } + umtxq_signal(&key, 1); } umtxq_unbusy(&key); umtxq_unlock(&key); @@ -3235,8 +3235,6 @@ do_sem2_wake(struct thread *td, struct _ umtxq_busy(&key); cnt = umtxq_count(&key); if (cnt > 0) { - umtxq_signal(&key, 1); - /* * If this was the last sleeping thread, clear the waiters * flag in _count. @@ -3251,6 +3249,8 @@ do_sem2_wake(struct thread *td, struct _ error = EFAULT; umtxq_lock(&key); } + + umtxq_signal(&key, 1); } umtxq_unbusy(&key); umtxq_unlock(&key); From owner-svn-src-all@freebsd.org Mon Aug 15 20:11:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E068EBBBBFC; Mon, 15 Aug 2016 20:11:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A368C1A08; Mon, 15 Aug 2016 20:11:53 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FKBqH9017724; Mon, 15 Aug 2016 20:11:52 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FKBq8h017720; Mon, 15 Aug 2016 20:11:52 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608152011.u7FKBq8h017720@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 15 Aug 2016 20:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304185 - in head/sys: compat/cloudabi compat/linux 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 20:11:54 -0000 Author: ed Date: Mon Aug 15 20:11:52 2016 New Revision: 304185 URL: https://svnweb.freebsd.org/changeset/base/304185 Log: Eliminate use of sys_fsync() and sys_fdatasync(). Make the kern_fsync() function public, so that it can be used by other parts of the kernel. Fix up existing consumers to make use of it. Requested by: kib Modified: head/sys/compat/cloudabi/cloudabi_fd.c head/sys/compat/linux/linux_file.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h Modified: head/sys/compat/cloudabi/cloudabi_fd.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 15 20:09:09 2016 (r304184) +++ head/sys/compat/cloudabi/cloudabi_fd.c Mon Aug 15 20:11:52 2016 (r304185) @@ -172,11 +172,8 @@ int cloudabi_sys_fd_datasync(struct thread *td, struct cloudabi_sys_fd_datasync_args *uap) { - struct fdatasync_args fdatasync_args = { - .fd = uap->fd - }; - return (sys_fdatasync(td, &fdatasync_args)); + return (kern_fsync(td, uap->fd, false)); } int @@ -556,9 +553,6 @@ cloudabi_sys_fd_stat_put(struct thread * int cloudabi_sys_fd_sync(struct thread *td, struct cloudabi_sys_fd_sync_args *uap) { - struct fsync_args fsync_args = { - .fd = uap->fd - }; - return (sys_fsync(td, &fsync_args)); + return (kern_fsync(td, uap->fd, true)); } Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Mon Aug 15 20:09:09 2016 (r304184) +++ head/sys/compat/linux/linux_file.c Mon Aug 15 20:11:52 2016 (r304185) @@ -1013,10 +1013,8 @@ linux_fdatasync(td, uap) struct thread *td; struct linux_fdatasync_args *uap; { - struct fsync_args bsd; - bsd.fd = uap->fd; - return (sys_fsync(td, &bsd)); + return (kern_fsync(td, uap->fd, false)); } int Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Aug 15 20:09:09 2016 (r304184) +++ head/sys/kern/vfs_syscalls.c Mon Aug 15 20:11:52 2016 (r304185) @@ -3354,7 +3354,7 @@ freebsd6_ftruncate(struct thread *td, st } #endif -static int +int kern_fsync(struct thread *td, int fd, bool fullsync) { struct vnode *vp; Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Mon Aug 15 20:09:09 2016 (r304184) +++ head/sys/sys/syscallsubr.h Mon Aug 15 20:11:52 2016 (r304185) @@ -100,6 +100,7 @@ int kern_fhstat(struct thread *td, fhand int kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf); int kern_fstat(struct thread *td, int fd, struct stat *sbp); int kern_fstatfs(struct thread *td, int fd, struct statfs *buf); +int kern_fsync(struct thread *td, int fd, bool fullsync); int kern_ftruncate(struct thread *td, int fd, off_t length); int kern_futimes(struct thread *td, int fd, struct timeval *tptr, enum uio_seg tptrseg); From owner-svn-src-all@freebsd.org Mon Aug 15 20:14:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D34CBBBC7F; Mon, 15 Aug 2016 20:14:02 +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-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24F771CA5; Mon, 15 Aug 2016 20:14:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7FKDvi1065831 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 15 Aug 2016 23:13:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7FKDvi1065831 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7FKDvUs065830; Mon, 15 Aug 2016 23:13:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 15 Aug 2016 23:13:57 +0300 From: Konstantin Belousov To: Ed Schouten Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304185 - in head/sys: compat/cloudabi compat/linux kern sys Message-ID: <20160815201357.GE83214@kib.kiev.ua> References: <201608152011.u7FKBq8h017720@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608152011.u7FKBq8h017720@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 20:14:02 -0000 On Mon, Aug 15, 2016 at 08:11:52PM +0000, Ed Schouten wrote: > Author: ed > Date: Mon Aug 15 20:11:52 2016 > New Revision: 304185 > URL: https://svnweb.freebsd.org/changeset/base/304185 > > Log: > Eliminate use of sys_fsync() and sys_fdatasync(). > > Make the kern_fsync() function public, so that it can be used by other > parts of the kernel. Fix up existing consumers to make use of it. > > Requested by: kib > > Modified: > head/sys/compat/cloudabi/cloudabi_fd.c > head/sys/compat/linux/linux_file.c > head/sys/kern/vfs_syscalls.c > head/sys/sys/syscallsubr.h Thank you, and esp. thank you for handling of linux.ko. From owner-svn-src-all@freebsd.org Mon Aug 15 20:15:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2505BBBBCFC for ; Mon, 15 Aug 2016 20:15:18 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yw0-x229.google.com (mail-yw0-x229.google.com [IPv6:2607:f8b0:4002:c05::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8AEC1E48 for ; Mon, 15 Aug 2016 20:15:17 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yw0-x229.google.com with SMTP id u134so32256830ywg.3 for ; Mon, 15 Aug 2016 13:15:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=aUIczATfb8agAtP2ugWP1UtVkdQKjsjKcAuzsj+oJKM=; b=TSBvJ2n7S4vC0ZMbjdaYuq36syNc3ezCo9By9sIsXUFY4uXK/9keBxiWVzr5XduEuN PxWJSljB8SvxWVBkkFi785hyjY4VknjODR91YSRiInq/qZVi9c0oCBBdhoSiNJJsMA9C NFZcq8djNNgcYE8Qzm/NGu175XioB9fXzLIuO8+9vFGBJbHEbwYDjhDbLF1RDkaoes0Q Zh0JbLzMbHhnYTp9/MM1BQqsbQH8e9ucs02aqnaGm3z7uoR2Y7rbUl7bizOUSTZiU6es cDCRM2nqP57plWUgtfh1g3IV7NEOTOAs1WlZiwxxHN7XiU1cwt4L3XTmyLTbUjZWZx00 PdXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=aUIczATfb8agAtP2ugWP1UtVkdQKjsjKcAuzsj+oJKM=; b=f8qqxtZyapDmZQvW++hFoe1C4NLTkMkYWrxT37Qu0UifA7Zc3c9/4LaCOIi7uXOs5o upUoinAARLJOiHZtdIHtOzxiVnI8sygye3lWkx1LFBFwy0MKhOEXWJhVXsHgePLXeShr lJ3FazwbyrD3qtdMqTdPxy+CviWX0PnjFKlITuqGbD+nmbDF/3xj+0c/OyncXGXkK4I0 /rT8n4SNGkloP0HmF8tGESp2A73mwsh6PDhbpuJREdTzGhNLe1f+YHGmFDAUXGWqH3kz b+CxmA7gxikkatwgFNZzypVVcipwfy16pZ+81+4vRavgtfc0ZRJzsKNG3fO3AGbUw7yk a3vA== X-Gm-Message-State: AEkoouuutdtM7o6kunboe3dlEoRVGcYd0mRtE8Yr2buTKgdKuU/Nk3Smj41uaxuqagyA8jFN9qintHBk1ZVDtA== X-Received: by 10.13.253.134 with SMTP id n128mr20980604ywf.20.1471292117075; Mon, 15 Aug 2016 13:15:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Mon, 15 Aug 2016 13:15:16 -0700 (PDT) In-Reply-To: <20160815201357.GE83214@kib.kiev.ua> References: <201608152011.u7FKBq8h017720@repo.freebsd.org> <20160815201357.GE83214@kib.kiev.ua> From: Ed Schouten Date: Mon, 15 Aug 2016 22:15:16 +0200 Message-ID: Subject: Re: svn commit: r304185 - in head/sys: compat/cloudabi compat/linux kern sys To: Konstantin Belousov Cc: Ed Schouten , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 20:15:18 -0000 2016-08-15 22:13 GMT+02:00 Konstantin Belousov : > Thank you, and esp. thank you for handling of linux.ko. And thank you for adding fdatasync() support in the first place. \o/ -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-all@freebsd.org Mon Aug 15 20:17:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FDA4BBA0C1; Mon, 15 Aug 2016 20:17:49 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 574491434; Mon, 15 Aug 2016 20:17:49 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FKHmdW018813; Mon, 15 Aug 2016 20:17:48 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FKHmwG018812; Mon, 15 Aug 2016 20:17:48 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608152017.u7FKHmwG018812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 20:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304186 - head/sys/dev/syscons 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 20:17:49 -0000 Author: bde Date: Mon Aug 15 20:17:48 2016 New Revision: 304186 URL: https://svnweb.freebsd.org/changeset/base/304186 Log: Clean up the new sc cn open and close functions (old sc cn grab and ungrab functions). Mainly, spell sc as itself instead of as scp->sc. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 20:11:52 2016 (r304185) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 20:17:48 2016 (r304186) @@ -1652,46 +1652,40 @@ static void sccnopen(sc_softc_t *sc, str static void sccnopen(sc_softc_t *sc, struct sc_cnstate *sp, int flags) { - scr_stat *scp; int kbd_mode; if (!cold && - sc_console->sc->cur_scp->index != sc_console->index && - sc_console->sc->cur_scp->smode.mode == VT_AUTO && + sc->cur_scp->index != sc_console->index && + sc->cur_scp->smode.mode == VT_AUTO && sc_console->smode.mode == VT_AUTO) - sc_switch_scr(sc_console->sc, sc_console->index); - - scp = sc_console->sc->cur_scp; + sc_switch_scr(sc, sc_console->index); - if (scp->sc->kbd == NULL) + if (sc->kbd == NULL) return; /* * Make sure the keyboard is accessible even when the kbd device * driver is disabled. */ - kbdd_enable(scp->sc->kbd); + kbdd_enable(sc->kbd); /* Switch the keyboard to console mode (K_XLATE, polled) on all scp's. */ kbd_mode = K_XLATE; - (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&kbd_mode); - kbdd_poll(scp->sc->kbd, TRUE); + (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&kbd_mode); + kbdd_poll(sc->kbd, TRUE); } static void sccnclose(sc_softc_t *sc, struct sc_cnstate *sp) { - scr_stat *scp; - - scp = sc_console->sc->cur_scp; /* XXX */ - if (scp->sc->kbd == NULL) + if (sc->kbd == NULL) return; /* Restore keyboard mode (for the current, possibly-changed scp). */ - kbdd_poll(scp->sc->kbd, FALSE); - (void)kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + kbdd_poll(sc->kbd, FALSE); + (void)kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&sc->cur_scp->kbd_mode); - kbdd_disable(scp->sc->kbd); + kbdd_disable(sc->kbd); } static void From owner-svn-src-all@freebsd.org Mon Aug 15 20:38:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE14DBBA59B; Mon, 15 Aug 2016 20:38:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 919E91DBA; Mon, 15 Aug 2016 20:38:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FKc2q1026335; Mon, 15 Aug 2016 20:38:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FKc2NL026330; Mon, 15 Aug 2016 20:38:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608152038.u7FKc2NL026330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Aug 2016 20:38:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 20:38:03 -0000 Author: jhb Date: Mon Aug 15 20:38:02 2016 New Revision: 304187 URL: https://svnweb.freebsd.org/changeset/base/304187 Log: Remove the mcd(4) driver for Mitsumi CD-ROM players. This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in the manpage, this driver is only useful as a backend to cdcontrol to play audio CDs since it doesn't use DMA, so its data performance is "abysmal" (and that was true in the mid 90's). Deleted: head/share/man/man4/mcd.4 head/sys/dev/mcd/ head/sys/modules/mcd/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon Aug 15 20:17:48 2016 (r304186) +++ head/ObsoleteFiles.inc Mon Aug 15 20:38:02 2016 (r304187) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160815: Remove mcd(4) +OLD_FILES+=usr/share/man/man4/mcd.4.gz # 20160703: POSIXify locales with variants OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_COLLATE OLD_FILES+=usr/share/locale/zh_Hant_TW.UTF-8/LC_CTYPE Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon Aug 15 20:17:48 2016 (r304186) +++ head/share/man/man4/Makefile Mon Aug 15 20:38:02 2016 (r304187) @@ -269,7 +269,6 @@ MAN= aac.4 \ mac_stub.4 \ mac_test.4 \ malo.4 \ - mcd.4 \ md.4 \ mdio.4 \ me.4 \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon Aug 15 20:17:48 2016 (r304186) +++ head/sys/conf/NOTES Mon Aug 15 20:38:02 2016 (r304187) @@ -2412,15 +2412,10 @@ options SND_OLDSTEREO # Miscellaneous hardware: # # scd: Sony CD-ROM using proprietary (non-ATAPI) interface -# mcd: Mitsumi CD-ROM using proprietary (non-ATAPI) interface # bktr: Brooktree bt848/848a/849a/878/879 video capture and TV Tuner board # joy: joystick (including IO DATA PCJOY PC Card joystick) # cmx: OmniKey CardMan 4040 pccard smartcard reader -# Mitsumi CD-ROM -device mcd -hint.mcd.0.at="isa" -hint.mcd.0.port="0x300" # for the Sony CDU31/33A CDROM device scd hint.scd.0.at="isa" Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon Aug 15 20:17:48 2016 (r304186) +++ head/sys/conf/files Mon Aug 15 20:38:02 2016 (r304187) @@ -2018,8 +2018,6 @@ dev/malo/if_malohal.c optional malo dev/malo/if_malo_pci.c optional malo pci dev/mc146818/mc146818.c optional mc146818 dev/mca/mca_bus.c optional mca -dev/mcd/mcd.c optional mcd isa nowerror -dev/mcd/mcd_isa.c optional mcd isa nowerror dev/md/md.c optional md dev/mdio/mdio_if.m optional miiproxy | mdio dev/mdio/mdio.c optional miiproxy | mdio Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Aug 15 20:17:48 2016 (r304186) +++ head/sys/modules/Makefile Mon Aug 15 20:38:02 2016 (r304187) @@ -224,7 +224,6 @@ SUBDIR= \ mac_stub \ mac_test \ malo \ - mcd \ md \ mdio \ mem \ From owner-svn-src-all@freebsd.org Mon Aug 15 20:54:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0474BBAF1A; Mon, 15 Aug 2016 20:54:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D0761D2C; Mon, 15 Aug 2016 20:54:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 68B2FB98E; Mon, 15 Aug 2016 16:54:51 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd Date: Mon, 15 Aug 2016 13:54:48 -0700 Message-ID: <2065331.KaGOSftJhd@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201608152038.u7FKc2NL026330@repo.freebsd.org> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 15 Aug 2016 16:54:51 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 20:54:52 -0000 On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: > Author: jhb > Date: Mon Aug 15 20:38:02 2016 > New Revision: 304187 > URL: https://svnweb.freebsd.org/changeset/base/304187 > > Log: > Remove the mcd(4) driver for Mitsumi CD-ROM players. > > This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in > the manpage, this driver is only useful as a backend to cdcontrol to > play audio CDs since it doesn't use DMA, so its data performance is > "abysmal" (and that was true in the mid 90's). No one stepped up to test patches for it either when I last posted patches to convert it from timeout(9) to callout(9). I have a few more drivers that are both very old and that people have no business using in 12 (think ISA adapters that don't do DMA and can't be used with pccard) that I will be removing over the next little while. I brought up a list of drivers on arch@ a couple of years ago and the conversation drifted off into the weeds about trimming GENERIC, etc. No one objected to the specific drivers I listed though (and I got a few pleas of "please remove"). If someone shows up desperately clutching an ISA adapter they can always dig up the source from svn and deal with forward porting it for whatever API changes have happened since it was removed. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Aug 15 21:10:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B081BBBB255; Mon, 15 Aug 2016 21:10:17 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 2E430153F; Mon, 15 Aug 2016 21:10:17 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd To: John Baldwin , src-committers@freebsd.org References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Jung-uk Kim Message-ID: Date: Mon, 15 Aug 2016 17:10:12 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <2065331.KaGOSftJhd@ralph.baldwin.cx> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xjwi2KCDAbSGiIuWpMMrA29e9ssG53fJh" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 21:10:17 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xjwi2KCDAbSGiIuWpMMrA29e9ssG53fJh Content-Type: multipart/mixed; boundary="TovMIslaq2J9Qv5MAorjAKVuCHj1PlIsS" From: Jung-uk Kim To: John Baldwin , src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> In-Reply-To: <2065331.KaGOSftJhd@ralph.baldwin.cx> --TovMIslaq2J9Qv5MAorjAKVuCHj1PlIsS Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 08/15/2016 16:54, John Baldwin wrote: > On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >> Author: jhb >> Date: Mon Aug 15 20:38:02 2016 >> New Revision: 304187 >> URL: https://svnweb.freebsd.org/changeset/base/304187 >> >> Log: >> Remove the mcd(4) driver for Mitsumi CD-ROM players. >> =20 >> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in >> the manpage, this driver is only useful as a backend to cdcontrol to= >> play audio CDs since it doesn't use DMA, so its data performance is >> "abysmal" (and that was true in the mid 90's). >=20 > No one stepped up to test patches for it either when I last posted patc= hes to > convert it from timeout(9) to callout(9). I have a few more drivers th= at are > both very old and that people have no business using in 12 (think ISA > adapters that don't do DMA and can't be used with pccard) that I will b= e > removing over the next little while. I brought up a list of drivers on= arch@ > a couple of years ago and the conversation drifted off into the weeds a= bout > trimming GENERIC, etc. No one objected to the specific drivers I liste= d > though (and I got a few pleas of "please remove"). If someone shows up= > desperately clutching an ISA adapter they can always dig up the source = from > svn and deal with forward porting it for whatever API changes have happ= ened > since it was removed. I have one of these Mitsumi CD-ROM drives somewhere in my basement but I haven't used it for many years. I think I only used it with "PAO", thoug= h. http://www.jp.freebsd.org/PAO/index.html Maybe we should kill APM, too! ;-) Jung-uk Kim --TovMIslaq2J9Qv5MAorjAKVuCHj1PlIsS-- --xjwi2KCDAbSGiIuWpMMrA29e9ssG53fJh 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 iQEcBAEBCAAGBQJXsi+0AAoJEHyflib82/FGEpgH/2hKMen6wtd1S8KiJXHq6n7e N503KLULuG6ZR8+nYMh5WapeSGKiET9Vg9VQ3nMFOsBcliw9N+Z4S9Yx2qb07760 rP6q/aKjExSULFH7+WHZfyGbwQiwl8a11P6ECV0NWG3cGp61SLs/0pSB0hN4pI8J SHW7WOYsHPkIC9zfRW90P6h1sxffUeSe5/jkuFzEbIow17HkYoDuxZT3rZ0BmJ+D oE5Yz9y3FsuOsGMhWgw/zfqcJNYe35DTuOVXVvULE9hPLfnhH7OBkwV5xjEQk9+w eV9M+BPk4V+A8KPcnPU5XGjddcBiC1DIxGCYSbLfo8fapP7oOYlEaX0d0VrA50Q= =gFZq -----END PGP SIGNATURE----- --xjwi2KCDAbSGiIuWpMMrA29e9ssG53fJh-- From owner-svn-src-all@freebsd.org Mon Aug 15 21:10:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28F1ABBB2C4; Mon, 15 Aug 2016 21:10:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCCFA16E7; Mon, 15 Aug 2016 21:10:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FLAhrJ037321; Mon, 15 Aug 2016 21:10:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FLAgDu037308; Mon, 15 Aug 2016 21:10:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608152110.u7FLAgDu037308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Aug 2016 21:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304188 - in stable: 10/bin/ps 10/lib/libc/sys 10/sys/i386/linux 10/sys/kern 10/sys/sys 10/tests/sys/kern 11/bin/ps 11/lib/libc/sys 11/sys/i386/linux 11/sys/kern 11/sys/sys 11/tests/sys... X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 21:10:44 -0000 Author: jhb Date: Mon Aug 15 21:10:41 2016 New Revision: 304188 URL: https://svnweb.freebsd.org/changeset/base/304188 Log: MFC 302900,302902,302921,303461,304009: Add a mask of optional ptrace() events. 302900: Add a test for user signal delivery. This test verifies we get the correct ptrace event details when a signal is posted to a traced process from userland. 302902: Add a mask of optional ptrace() events. ptrace() now stores a mask of optional events in p_ptevents. Currently this mask is a single integer, but it can be expanded into an array of integers in the future. Two new ptrace requests can be used to manipulate the event mask: PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK sets the current event mask. The current set of events include: - PTRACE_EXEC: trace calls to execve(). - PTRACE_SCE: trace system call entries. - PTRACE_SCX: trace syscam call exits. - PTRACE_FORK: trace forks and auto-attach to new child processes. - PTRACE_LWP: trace LWP events. The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have been replaced by PTRACE_SCE and PTRACE_SCX. PTRACE_FORK replaces P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS. The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for compatibility but now simply toggle corresponding flags in the event mask. While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both modify the event mask and continue the traced process. 302921: Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL. 303461: Note that not all optional ptrace events use SIGTRAP. New child processes attached due to PTRACE_FORK use SIGSTOP instead of SIGTRAP. All other ptrace events use SIGTRAP. 304009: Remove description of P_FOLLOWFORK as this flag was removed. Modified: stable/10/bin/ps/ps.1 stable/10/lib/libc/sys/ptrace.2 stable/10/sys/i386/linux/linux_ptrace.c stable/10/sys/kern/kern_exec.c stable/10/sys/kern/kern_exit.c stable/10/sys/kern/kern_fork.c stable/10/sys/kern/kern_sig.c stable/10/sys/kern/kern_thr.c stable/10/sys/kern/subr_syscall.c stable/10/sys/kern/sys_process.c stable/10/sys/sys/proc.h stable/10/sys/sys/ptrace.h stable/10/tests/sys/kern/ptrace_test.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/bin/ps/ps.1 stable/11/lib/libc/sys/ptrace.2 stable/11/sys/i386/linux/linux_ptrace.c stable/11/sys/kern/kern_exec.c stable/11/sys/kern/kern_exit.c stable/11/sys/kern/kern_fork.c stable/11/sys/kern/kern_sig.c stable/11/sys/kern/kern_thr.c stable/11/sys/kern/subr_syscall.c stable/11/sys/kern/sys_process.c stable/11/sys/sys/proc.h stable/11/sys/sys/ptrace.h stable/11/tests/sys/kern/ptrace_test.c Directory Properties: stable/11/ (props changed) Modified: stable/10/bin/ps/ps.1 ============================================================================== --- stable/10/bin/ps/ps.1 Mon Aug 15 20:38:02 2016 (r304187) +++ stable/10/bin/ps/ps.1 Mon Aug 15 21:10:41 2016 (r304188) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd December 9, 2014 +.Dd August 12, 2016 .Dt PS 1 .Os .Sh NAME @@ -310,7 +310,6 @@ the include file .It Dv "P_ADVLOCK" Ta No "0x00001" Ta "Process may hold a POSIX advisory lock" .It Dv "P_CONTROLT" Ta No "0x00002" Ta "Has a controlling terminal" .It Dv "P_KTHREAD" Ta No "0x00004" Ta "Kernel thread" -.It Dv "P_FOLLOWFORK" Ta No "0x00008" Ta "Attach debugger to new children" .It Dv "P_PPWAIT" Ta No "0x00010" Ta "Parent is waiting for child to exec/exit" .It Dv "P_PROFIL" Ta No "0x00020" Ta "Has started profiling" .It Dv "P_STOPPROF" Ta No "0x00040" Ta "Has thread in requesting to stop prof" Modified: stable/10/lib/libc/sys/ptrace.2 ============================================================================== --- stable/10/lib/libc/sys/ptrace.2 Mon Aug 15 20:38:02 2016 (r304187) +++ stable/10/lib/libc/sys/ptrace.2 Mon Aug 15 21:10:41 2016 (r304188) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd December 29, 2015 +.Dd July 28, 2016 .Dt PTRACE 2 .Os .Sh NAME @@ -58,8 +58,9 @@ The signal may be a normal process signa traced process behavior, or use of the .Xr kill 2 system call; alternatively, it may be generated by the tracing facility -as a result of attaching, system calls, or stepping by the tracing -process. +as a result of attaching, stepping by the tracing +process, +or an event in the traced process. The tracing process may choose to intercept the signal, using it to observe process behavior (such as .Dv SIGTRAP ) , @@ -69,6 +70,121 @@ The system call is the mechanism by which all this happens. .Pp +A traced process may report additional signal stops corresponding to +events in the traced process. +These additional signal stops are reported as +.Dv SIGTRAP +or +.Dv SIGSTOP +signals. +The tracing process can use the +.Dv PT_LWPINFO +request to determine which events are associated with a +.Dv SIGTRAP +or +.Dv SIGSTOP +signal. +Note that multiple events may be associated with a single signal. +For example, events indicated by the +.Dv PL_FLAG_BORN , +.Dv PL_FLAG_FORKED , +and +.Dv PL_FLAG_EXEC +flags are also reported as a system call exit event +.Pq Dv PL_FLAG_SCX . +The signal stop for a new child process enabled via +.Dv PTRACE_FORK +will report a +.Dv SIGSTOP +signal. +All other additional signal stops use +.Dv SIGTRAP . +.Pp +Each traced process has a tracing event mask. +An event in the traced process only reports a +signal stop if the corresponding flag is set in the tracing event mask. +The current set of tracing event flags include: +.Bl -tag -width ".Dv PTRACE_SYSCALL" +.It Dv PTRACE_EXEC +Report a stop for a successful invocation of +.Xr execve 2 . +This event is indicated by the +.Dv PL_FLAG_EXEC +flag in the +.Va pl_flags +member of +.Vt "struct ptrace_lwpinfo" . +.It Dv PTRACE_SCE +Report a stop on each system call entry. +This event is indicated by the +.Dv PL_FLAG_SCE +flag in the +.Va pl_flags +member of +.Vt "struct ptrace_lwpinfo" . +.It Dv PTRACE_SCX +Report a stop on each system call exit. +This event is indicated by the +.Dv PL_FLAG_SCX +flag in the +.Va pl_flags +member of +.Vt "struct ptrace_lwpinfo" . +.It Dv PTRACE_SYSCALL +Report stops for both system call entry and exit. +.It Dv PTRACE_FORK +This event flag controls tracing for new child processes of a traced process. +.Pp +When this event flag is enabled, +new child processes will enable tracing and stop before executing their +first instruction. +The new child process will include the +.Dv PL_FLAG_CHILD +flag in the +.Va pl_flags +member of +.Vt "struct ptrace_lwpinfo" . +The traced process will report a stop that includes the +.Dv PL_FLAG_FORKED +flag. +The process ID of the new child process will also be present in the +.Va pl_child_pid +member of +.Vt "struct ptrace_lwpinfo" . +Note that new child processes will be attached with the default +tracing event mask; +they do not inherit the event mask of the traced process. +.Pp +When this event flag is not enabled, +new child processes will execute without tracing enabled. +.It Dv PTRACE_LWP +This event flag controls tracing of LWP +.Pq kernel thread +creation and destruction. +When this event is enabled, +new LWPs will stop and report an event with +.Dv PL_FLAG_BORN +set before executing their first instruction, +and exiting LWPs will stop and report an event with +.Dv PL_FLAG_EXITED +set before completing their termination. +.Pp +Note that new processes do not report an event for the creation of their +initial thread, +and exiting processes do not report an event for the termination of the +last thread. +.El +.Pp +The default tracing event mask when attaching to a process via +.Dv PT_ATTACH , +.Dv PT_TRACE_ME , +or +.Dv PTRACE_FORK +includes only +.Dv PTRACE_EXEC +events. +All other event flags are disabled. +.Pp The .Fa request argument specifies what operation is being performed; the meaning of @@ -368,21 +484,20 @@ The process identifier of the new proces member of .Vt "struct ptrace_lwpinfo" . .It PL_FLAG_CHILD -The flag is set for first event reported from a new child, which is -automatically attached due to -.Dv PT_FOLLOW_FORK -enabled. +The flag is set for first event reported from a new child which is +automatically attached when +.Dv PTRACE_FORK +is enabled. .It PL_FLAG_BORN -This flag is set for the first event reported from a new LWP when LWP -events are enabled via -.Dv PT_LWP_EVENTS . +This flag is set for the first event reported from a new LWP when +.Dv PTRACE_LWP +is enabled. It is reported along with -.Dv PL_FLAG_SCX -and is always reported if LWP events are enabled. +.Dv PL_FLAG_SCX . .It PL_FLAG_EXITED This flag is set for the last event reported by an exiting LWP when -LWP events are enabled via -.Dv PT_LWP_EVENTS . +.Dv PTRACE_LWP +is enabled. Note that this event is not reported when the last LWP in a process exits. The termination of the last thread is reported via a normal process exit event. @@ -456,50 +571,72 @@ This request will suspend the specified .It PT_RESUME This request will resume the specified thread. .It PT_TO_SCE -This request will trace the specified process on each system call entry. +This request will set the +.Dv PTRACE_SCE +event flag to trace all future system call entries and continue the process. +The +.Fa addr +and +.Fa data +arguments are used the same as for +.Dv PT_CONTINUE. .It PT_TO_SCX -This request will trace the specified process on each system call exit. +This request will set the +.Dv PTRACE_SCX +event flag to trace all future system call exits and continue the process. +The +.Fa addr +and +.Fa data +arguments are used the same as for +.Dv PT_CONTINUE. .It PT_SYSCALL -This request will trace the specified process -on each system call entry and exit. +This request will set the +.Dv PTRACE_SYSCALL +event flag to trace all future system call entries and exits and continue +the process. +The +.Fa addr +and +.Fa data +arguments are used the same as for +.Dv PT_CONTINUE. .It PT_FOLLOW_FORK This request controls tracing for new child processes of a traced process. If .Fa data is non-zero, -then new child processes will enable tracing and stop before executing their -first instruction. +.Dv PTRACE_FORK +is set in the traced process's event tracing mask. If .Fa data -is zero, then new child processes will execute without tracing enabled. -By default, tracing is not enabled for new child processes. -Child processes do not inherit this property. -The traced process will set the -.Dv PL_FLAG_FORKED -flag upon exit from a system call that creates a new process. +is zero, +.Dv PTRACE_FORK +is cleared from the traced process's event tracing mask. .It PT_LWP_EVENTS This request controls tracing of LWP creation and destruction. If .Fa data is non-zero, -then LWPs will stop to report creation and destruction events. +.Dv PTRACE_LWP +is set in the traced process's event tracing mask. If .Fa data is zero, -then LWP creation and destruction events will not be reported. -By default, tracing is not enabled for LWP events. -Child processes do not inherit this property. -New LWPs will stop to report an event with -.Dv PL_FLAG_BORN -set before executing their first instruction. -Exiting LWPs will stop to report an event with -.Dv PL_FLAG_EXITED -set before completing their termination. -.Pp -Note that new processes do not report an event for the creation of their -initial thread, -and exiting processes do not report an event for the termination of the -last thread. +.Dv PTRACE_LWP +is cleared from the traced process's event tracing mask. +.It PT_GET_EVENT_MASK +This request reads the traced process's event tracing mask into the +integer pointed to by +.Fa addr . +The size of the integer must be passed in +.Fa data . +.It PT_SET_EVENT_MASK +This request sets the traced process's event tracing mask from the +integer pointed to by +.Fa addr . +The size of the integer must be passed in +.Fa data . .It PT_VM_TIMESTAMP This request returns the generation number or timestamp of the memory map of the traced process as the return value from Modified: stable/10/sys/i386/linux/linux_ptrace.c ============================================================================== --- stable/10/sys/i386/linux/linux_ptrace.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/10/sys/i386/linux/linux_ptrace.c Mon Aug 15 21:10:41 2016 (r304188) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #define PTRACE_ATTACH 16 #define PTRACE_DETACH 17 -#define PTRACE_SYSCALL 24 +#define LINUX_PTRACE_SYSCALL 24 #define PTRACE_GETREGS 12 #define PTRACE_SETREGS 13 @@ -473,7 +473,7 @@ linux_ptrace(struct thread *td, struct l break; } - case PTRACE_SYSCALL: + case LINUX_PTRACE_SYSCALL: /* fall through */ default: printf("linux: ptrace(%u, ...) not implemented\n", Modified: stable/10/sys/kern/kern_exec.c ============================================================================== --- stable/10/sys/kern/kern_exec.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/10/sys/kern/kern_exec.c Mon Aug 15 21:10:41 2016 (r304188) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -899,7 +900,8 @@ exec_fail_dealloc: if (error == 0) { PROC_LOCK(p); - td->td_dbgflags |= TDB_EXEC; + if (p->p_ptevents & PTRACE_EXEC) + td->td_dbgflags |= TDB_EXEC; PROC_UNLOCK(p); /* Modified: stable/10/sys/kern/kern_exit.c ============================================================================== --- stable/10/sys/kern/kern_exit.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/10/sys/kern/kern_exit.c Mon Aug 15 21:10:41 2016 (r304188) @@ -336,6 +336,7 @@ exit1(struct thread *td, int rv) rv = p->p_xstat; /* Event handler could change exit status */ stopprofclock(p); p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE); + p->p_ptevents = 0; /* * Stop the real interval timer. If the handler is currently @@ -519,6 +520,7 @@ exit1(struct thread *td, int rv) */ clear_orphan(q); q->p_flag &= ~(P_TRACED | P_STOPPED_TRACE); + q->p_ptevents = 0; FOREACH_THREAD_IN_PROC(q, tdt) tdt->td_dbgflags &= ~TDB_SUSPEND; kern_psignal(q, SIGKILL); Modified: stable/10/sys/kern/kern_fork.c ============================================================================== --- stable/10/sys/kern/kern_fork.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/10/sys/kern/kern_fork.c Mon Aug 15 21:10:41 2016 (r304188) @@ -411,6 +411,7 @@ do_fork(struct thread *td, int flags, st __rangeof(struct proc, p_startzero, p_endzero)); p2->p_treeflag = 0; p2->p_filemon = NULL; + p2->p_ptevents = 0; /* Tell the prison that we exist. */ prison_proc_hold(p2->p_ucred->cr_prison); @@ -710,8 +711,7 @@ do_fork(struct thread *td, int flags, st if ((flags & RFMEM) == 0 && dtrace_fasttrap_fork) dtrace_fasttrap_fork(p1, p2); #endif - if ((p1->p_flag & (P_TRACED | P_FOLLOWFORK)) == (P_TRACED | - P_FOLLOWFORK)) { + if (p1->p_ptevents & PTRACE_FORK) { /* * Arrange for debugger to receive the fork event. * @@ -1057,14 +1057,14 @@ fork_return(struct thread *td, struct tr if (td->td_dbgflags & TDB_STOPATFORK) { sx_xlock(&proctree_lock); PROC_LOCK(p); - if ((p->p_pptr->p_flag & (P_TRACED | P_FOLLOWFORK)) == - (P_TRACED | P_FOLLOWFORK)) { + if (p->p_pptr->p_ptevents & PTRACE_FORK) { /* * If debugger still wants auto-attach for the * parent's children, do it now. */ dbg = p->p_pptr->p_pptr; p->p_flag |= P_TRACED; + p->p_ptevents = PTRACE_DEFAULT; p->p_oppid = p->p_pptr->p_pid; CTR2(KTR_PTRACE, "fork_return: attaching to new child pid %d: oppid %d", @@ -1091,7 +1091,7 @@ fork_return(struct thread *td, struct tr PROC_LOCK(p); td->td_dbgflags |= TDB_SCX; _STOPEVENT(p, S_SCX, td->td_dbg_sc_code); - if ((p->p_stops & S_PT_SCX) != 0 || + if ((p->p_ptevents & PTRACE_SCX) != 0 || (td->td_dbgflags & TDB_BORN) != 0) ptracestop(td, SIGTRAP); td->td_dbgflags &= ~(TDB_SCX | TDB_BORN); Modified: stable/10/sys/kern/kern_sig.c ============================================================================== --- stable/10/sys/kern/kern_sig.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/10/sys/kern/kern_sig.c Mon Aug 15 21:10:41 2016 (r304188) @@ -2175,9 +2175,10 @@ tdsendsignal(struct proc *p, struct thre !((prop & SA_CONT) && (p->p_flag & P_STOPPED_SIG))) return (ret); /* - * SIGKILL: Remove procfs STOPEVENTs. + * SIGKILL: Remove procfs STOPEVENTs and ptrace events. */ if (sig == SIGKILL) { + p->p_ptevents = 0; /* from procfs_ioctl.c: PIOCBIC */ p->p_stops = 0; /* from procfs_ioctl.c: PIOCCONT */ Modified: stable/10/sys/kern/kern_thr.c ============================================================================== --- stable/10/sys/kern/kern_thr.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/10/sys/kern/kern_thr.c Mon Aug 15 21:10:41 2016 (r304188) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -252,7 +253,7 @@ thread_create(struct thread *td, struct thread_unlock(td); if (P_SHOULDSTOP(p)) newtd->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK; - if (p->p_flag2 & P2_LWP_EVENTS) + if (p->p_ptevents & PTRACE_LWP) newtd->td_dbgflags |= TDB_BORN; PROC_UNLOCK(p); @@ -343,7 +344,7 @@ kern_thr_exit(struct thread *td) p->p_pendingexits++; td->td_dbgflags |= TDB_EXIT; - if (p->p_flag & P_TRACED && p->p_flag2 & P2_LWP_EVENTS) + if (p->p_ptevents & PTRACE_LWP) ptracestop(td, SIGTRAP); PROC_UNLOCK(p); tidhash_remove(td); Modified: stable/10/sys/kern/subr_syscall.c ============================================================================== --- stable/10/sys/kern/subr_syscall.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/10/sys/kern/subr_syscall.c Mon Aug 15 21:10:41 2016 (r304188) @@ -88,7 +88,7 @@ syscallenter(struct thread *td, struct s PROC_LOCK(p); td->td_dbg_sc_code = sa->code; td->td_dbg_sc_narg = sa->narg; - if (p->p_stops & S_PT_SCE) + if (p->p_ptevents & PTRACE_SCE) ptracestop((td), SIGTRAP); PROC_UNLOCK(p); } @@ -215,7 +215,7 @@ syscallret(struct thread *td, int error, */ if (traced && ((td->td_dbgflags & (TDB_FORK | TDB_EXEC)) != 0 || - (p->p_stops & S_PT_SCX) != 0)) + (p->p_ptevents & PTRACE_SCX) != 0)) ptracestop(td, SIGTRAP); td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); PROC_UNLOCK(p); Modified: stable/10/sys/kern/sys_process.c ============================================================================== --- stable/10/sys/kern/sys_process.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/10/sys/kern/sys_process.c Mon Aug 15 21:10:41 2016 (r304188) @@ -542,6 +542,7 @@ sys_ptrace(struct thread *td, struct ptr struct ptrace_lwpinfo32 pl32; struct ptrace_vm_entry32 pve32; #endif + int ptevents; } r; void *addr; int error = 0; @@ -556,6 +557,7 @@ sys_ptrace(struct thread *td, struct ptr AUDIT_ARG_VALUE(uap->data); addr = &r; switch (uap->req) { + case PT_GET_EVENT_MASK: case PT_GETREGS: case PT_GETFPREGS: case PT_GETDBREGS: @@ -570,6 +572,12 @@ sys_ptrace(struct thread *td, struct ptr case PT_SETDBREGS: error = COPYIN(uap->addr, &r.dbreg, sizeof r.dbreg); break; + case PT_SET_EVENT_MASK: + if (uap->data != sizeof(r.ptevents)) + error = EINVAL; + else + error = copyin(uap->addr, &r.ptevents, uap->data); + break; case PT_IO: error = COPYIN(uap->addr, &r.piod, sizeof r.piod); break; @@ -603,7 +611,12 @@ sys_ptrace(struct thread *td, struct ptr case PT_GETDBREGS: error = COPYOUT(&r.dbreg, uap->addr, sizeof r.dbreg); break; + case PT_GET_EVENT_MASK: + /* NB: The size in uap->data is validated in kern_ptrace(). */ + error = copyout(&r.ptevents, uap->addr, uap->data); + break; case PT_LWPINFO: + /* NB: The size in uap->data is validated in kern_ptrace(). */ error = copyout(&r.pl, uap->addr, uap->data); break; } @@ -667,6 +680,8 @@ kern_ptrace(struct thread *td, int req, case PT_SYSCALL: case PT_FOLLOW_FORK: case PT_LWP_EVENTS: + case PT_GET_EVENT_MASK: + case PT_SET_EVENT_MASK: case PT_DETACH: sx_xlock(&proctree_lock); proctree_locked = 1; @@ -842,6 +857,7 @@ kern_ptrace(struct thread *td, int req, case PT_TRACE_ME: /* set my trace flag and "owner" so it can read/write me */ p->p_flag |= P_TRACED; + p->p_ptevents = PTRACE_DEFAULT; if (p->p_flag & P_PPWAIT) p->p_flag |= P_PPTRACE; p->p_oppid = p->p_pptr->p_pid; @@ -860,6 +876,7 @@ kern_ptrace(struct thread *td, int req, * on a "detach". */ p->p_flag |= P_TRACED; + p->p_ptevents = PTRACE_DEFAULT; p->p_oppid = p->p_pptr->p_pid; if (p->p_pptr != td->td_proc) { proc_reparent(p, td->td_proc); @@ -898,24 +915,50 @@ kern_ptrace(struct thread *td, int req, case PT_FOLLOW_FORK: CTR3(KTR_PTRACE, "PT_FOLLOW_FORK: pid %d %s -> %s", p->p_pid, - p->p_flag & P_FOLLOWFORK ? "enabled" : "disabled", + p->p_ptevents & PTRACE_FORK ? "enabled" : "disabled", data ? "enabled" : "disabled"); if (data) - p->p_flag |= P_FOLLOWFORK; + p->p_ptevents |= PTRACE_FORK; else - p->p_flag &= ~P_FOLLOWFORK; + p->p_ptevents &= ~PTRACE_FORK; break; case PT_LWP_EVENTS: CTR3(KTR_PTRACE, "PT_LWP_EVENTS: pid %d %s -> %s", p->p_pid, - p->p_flag2 & P2_LWP_EVENTS ? "enabled" : "disabled", + p->p_ptevents & PTRACE_LWP ? "enabled" : "disabled", data ? "enabled" : "disabled"); if (data) - p->p_flag2 |= P2_LWP_EVENTS; + p->p_ptevents |= PTRACE_LWP; else - p->p_flag2 &= ~P2_LWP_EVENTS; + p->p_ptevents &= ~PTRACE_LWP; + break; + + case PT_GET_EVENT_MASK: + if (data != sizeof(p->p_ptevents)) { + error = EINVAL; + break; + } + CTR2(KTR_PTRACE, "PT_GET_EVENT_MASK: pid %d mask %#x", p->p_pid, + p->p_ptevents); + *(int *)addr = p->p_ptevents; break; + case PT_SET_EVENT_MASK: + if (data != sizeof(p->p_ptevents)) { + error = EINVAL; + break; + } + tmp = *(int *)addr; + if ((tmp & ~(PTRACE_EXEC | PTRACE_SCE | PTRACE_SCX | + PTRACE_FORK | PTRACE_LWP)) != 0) { + error = EINVAL; + break; + } + CTR3(KTR_PTRACE, "PT_SET_EVENT_MASK: pid %d mask %#x -> %#x", + p->p_pid, p->p_ptevents, tmp); + p->p_ptevents = tmp; + break; + case PT_STEP: case PT_CONTINUE: case PT_TO_SCE: @@ -948,24 +991,24 @@ kern_ptrace(struct thread *td, int req, } switch (req) { case PT_TO_SCE: - p->p_stops |= S_PT_SCE; + p->p_ptevents |= PTRACE_SCE; CTR4(KTR_PTRACE, - "PT_TO_SCE: pid %d, stops = %#x, PC = %#lx, sig = %d", - p->p_pid, p->p_stops, + "PT_TO_SCE: pid %d, events = %#x, PC = %#lx, sig = %d", + p->p_pid, p->p_ptevents, (u_long)(uintfptr_t)addr, data); break; case PT_TO_SCX: - p->p_stops |= S_PT_SCX; + p->p_ptevents |= PTRACE_SCX; CTR4(KTR_PTRACE, - "PT_TO_SCX: pid %d, stops = %#x, PC = %#lx, sig = %d", - p->p_pid, p->p_stops, + "PT_TO_SCX: pid %d, events = %#x, PC = %#lx, sig = %d", + p->p_pid, p->p_ptevents, (u_long)(uintfptr_t)addr, data); break; case PT_SYSCALL: - p->p_stops |= S_PT_SCE | S_PT_SCX; + p->p_ptevents |= PTRACE_SYSCALL; CTR4(KTR_PTRACE, - "PT_SYSCALL: pid %d, stops = %#x, PC = %#lx, sig = %d", - p->p_pid, p->p_stops, + "PT_SYSCALL: pid %d, events = %#x, PC = %#lx, sig = %d", + p->p_pid, p->p_ptevents, (u_long)(uintfptr_t)addr, data); break; case PT_CONTINUE: @@ -984,7 +1027,7 @@ kern_ptrace(struct thread *td, int req, * parent. Otherwise the debugee will be set * as an orphan of the debugger. */ - p->p_flag &= ~(P_TRACED | P_WAITED | P_FOLLOWFORK); + p->p_flag &= ~(P_TRACED | P_WAITED); if (p->p_oppid != p->p_pptr->p_pid) { PROC_LOCK(p->p_pptr); sigqueue_take(p->p_ksi); @@ -1001,7 +1044,7 @@ kern_ptrace(struct thread *td, int req, CTR2(KTR_PTRACE, "PT_DETACH: pid %d, sig %d", p->p_pid, data); p->p_oppid = 0; - p->p_stops = 0; + p->p_ptevents = 0; /* should we send SIGCHLD? */ /* childproc_continued(p); */ Modified: stable/10/sys/sys/proc.h ============================================================================== --- stable/10/sys/sys/proc.h Mon Aug 15 20:38:02 2016 (r304187) +++ stable/10/sys/sys/proc.h Mon Aug 15 21:10:41 2016 (r304188) @@ -611,6 +611,7 @@ struct proc { our subtree. */ struct pgrp *p_pgrp; /* (c + e) Pointer to process group. */ struct filemon *p_filemon; /* (c) filemon-specific data. */ + u_int p_ptevents; /* (c) ptrace() event mask. */ }; #define p_session p_pgrp->pg_session @@ -638,7 +639,7 @@ struct proc { #define P_ADVLOCK 0x00001 /* Process may hold a POSIX advisory lock. */ #define P_CONTROLT 0x00002 /* Has a controlling terminal. */ #define P_KTHREAD 0x00004 /* Kernel thread (*). */ -#define P_FOLLOWFORK 0x00008 /* Attach parent debugger to children. */ +#define P_UNUSED3 0x00008 /* --available-- */ #define P_PPWAIT 0x00010 /* Parent is waiting for child to exec/exit. */ #define P_PROFIL 0x00020 /* Has started profiling. */ #define P_STOPPROF 0x00040 /* Has thread requesting to stop profiling. */ @@ -677,7 +678,6 @@ struct proc { #define P2_NOTRACE 0x00000002 /* No ptrace(2) attach or coredumps. */ #define P2_NOTRACE_EXEC 0x00000004 /* Keep P2_NOPTRACE on exec(2). */ #define P2_AST_SU 0x00000008 /* Handles SU ast for kthreads. */ -#define P2_LWP_EVENTS 0x00000010 /* Report LWP events via ptrace(2). */ /* Flags protected by proctree_lock, kept in p_treeflags. */ #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ Modified: stable/10/sys/sys/ptrace.h ============================================================================== --- stable/10/sys/sys/ptrace.h Mon Aug 15 20:38:02 2016 (r304187) +++ stable/10/sys/sys/ptrace.h Mon Aug 15 21:10:41 2016 (r304188) @@ -66,6 +66,9 @@ #define PT_FOLLOW_FORK 23 #define PT_LWP_EVENTS 24 /* report LWP birth and exit */ +#define PT_GET_EVENT_MASK 25 /* get mask of optional events */ +#define PT_SET_EVENT_MASK 26 /* set mask of optional events */ + #define PT_GETREGS 33 /* get general-purpose registers */ #define PT_SETREGS 34 /* set general-purpose registers */ #define PT_GETFPREGS 35 /* get floating-point registers */ @@ -79,6 +82,16 @@ #define PT_FIRSTMACH 64 /* for machine-specific requests */ #include /* machine-specific requests, if any */ +/* Events used with PT_GET_EVENT_MASK and PT_SET_EVENT_MASK */ +#define PTRACE_EXEC 0x0001 +#define PTRACE_SCE 0x0002 +#define PTRACE_SCX 0x0004 +#define PTRACE_SYSCALL (PTRACE_SCE | PTRACE_SCX) +#define PTRACE_FORK 0x0008 +#define PTRACE_LWP 0x0010 + +#define PTRACE_DEFAULT (PTRACE_EXEC) + struct ptrace_io_desc { int piod_op; /* I/O operation */ void *piod_offs; /* child offset */ @@ -136,13 +149,6 @@ struct ptrace_vm_entry { #ifdef _KERNEL -/* - * The flags below are used for ptrace(2) tracing and have no relation - * to procfs. They are stored in struct proc's p_stops member. - */ -#define S_PT_SCE 0x000010000 -#define S_PT_SCX 0x000020000 - int ptrace_set_pc(struct thread *_td, unsigned long _addr); int ptrace_single_step(struct thread *_td); int ptrace_clear_single_step(struct thread *_td); Modified: stable/10/tests/sys/kern/ptrace_test.c ============================================================================== --- stable/10/tests/sys/kern/ptrace_test.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/10/tests/sys/kern/ptrace_test.c Mon Aug 15 21:10:41 2016 (r304188) @@ -1269,6 +1269,200 @@ ATF_TC_BODY(ptrace__lwp_events_exec, tc) ATF_REQUIRE(errno == ECHILD); } +static void +handler(int sig __unused) +{ +} + +static void +signal_main(void) +{ + + signal(SIGINFO, handler); + raise(SIGINFO); + exit(0); +} + +/* + * Verify that the expected ptrace event is reported for a signal. + */ +ATF_TC_WITHOUT_HEAD(ptrace__siginfo); +ATF_TC_BODY(ptrace__siginfo, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + int status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + signal_main(); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The next event should be for the SIGINFO. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGINFO); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_event == PL_EVENT_SIGNAL); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SI); + ATF_REQUIRE(pl.pl_siginfo.si_code == SI_LWP); + ATF_REQUIRE(pl.pl_siginfo.si_pid == wpid); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The last event should be for the child process's exit. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + +/* + * Verify that the expected ptrace events are reported for PTRACE_EXEC. + */ +ATF_TC_WITHOUT_HEAD(ptrace__ptrace_exec_disable); +ATF_TC_BODY(ptrace__ptrace_exec_disable, tc) +{ + pid_t fpid, wpid; + int events, status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + exec_thread(NULL); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + events = 0; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* Should get one event at exit. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + +ATF_TC_WITHOUT_HEAD(ptrace__ptrace_exec_enable); +ATF_TC_BODY(ptrace__ptrace_exec_enable, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + int events, status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + exec_thread(NULL); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + events = PTRACE_EXEC; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The next event should be for the child process's exec. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE((pl.pl_flags & (PL_FLAG_EXEC | PL_FLAG_SCX)) == + (PL_FLAG_EXEC | PL_FLAG_SCX)); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The last event should be for the child process's exit. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + +ATF_TC_WITHOUT_HEAD(ptrace__event_mask); +ATF_TC_BODY(ptrace__event_mask, tc) +{ + pid_t fpid, wpid; + int events, status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + exit(0); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + /* PT_FOLLOW_FORK should toggle the state of PTRACE_FORK. */ + ATF_REQUIRE(ptrace(PT_FOLLOW_FORK, fpid, NULL, 1) != -1); + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + ATF_REQUIRE(events & PTRACE_FORK); + ATF_REQUIRE(ptrace(PT_FOLLOW_FORK, fpid, NULL, 0) != -1); + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + ATF_REQUIRE(!(events & PTRACE_FORK)); + + /* PT_LWP_EVENTS should toggle the state of PTRACE_LWP. */ + ATF_REQUIRE(ptrace(PT_LWP_EVENTS, fpid, NULL, 1) != -1); + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + ATF_REQUIRE(events & PTRACE_LWP); + ATF_REQUIRE(ptrace(PT_LWP_EVENTS, fpid, NULL, 0) != -1); + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + ATF_REQUIRE(!(events & PTRACE_LWP)); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* Should get one event at exit. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + ATF_TP_ADD_TCS(tp) { @@ -1289,6 +1483,10 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ptrace__new_child_pl_syscall_code_thread); ATF_TP_ADD_TC(tp, ptrace__lwp_events); ATF_TP_ADD_TC(tp, ptrace__lwp_events_exec); + ATF_TP_ADD_TC(tp, ptrace__siginfo); + ATF_TP_ADD_TC(tp, ptrace__ptrace_exec_disable); + ATF_TP_ADD_TC(tp, ptrace__ptrace_exec_enable); + ATF_TP_ADD_TC(tp, ptrace__event_mask); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Mon Aug 15 21:10:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B0CFBBB2CC; Mon, 15 Aug 2016 21:10:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E53E16EB; Mon, 15 Aug 2016 21:10:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FLAi2O037340; Mon, 15 Aug 2016 21:10:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FLAhBc037326; Mon, 15 Aug 2016 21:10:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608152110.u7FLAhBc037326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 15 Aug 2016 21:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304188 - in stable: 10/bin/ps 10/lib/libc/sys 10/sys/i386/linux 10/sys/kern 10/sys/sys 10/tests/sys/kern 11/bin/ps 11/lib/libc/sys 11/sys/i386/linux 11/sys/kern 11/sys/sys 11/tests/sys... X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 21:10:45 -0000 Author: jhb Date: Mon Aug 15 21:10:41 2016 New Revision: 304188 URL: https://svnweb.freebsd.org/changeset/base/304188 Log: MFC 302900,302902,302921,303461,304009: Add a mask of optional ptrace() events. 302900: Add a test for user signal delivery. This test verifies we get the correct ptrace event details when a signal is posted to a traced process from userland. 302902: Add a mask of optional ptrace() events. ptrace() now stores a mask of optional events in p_ptevents. Currently this mask is a single integer, but it can be expanded into an array of integers in the future. Two new ptrace requests can be used to manipulate the event mask: PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK sets the current event mask. The current set of events include: - PTRACE_EXEC: trace calls to execve(). - PTRACE_SCE: trace system call entries. - PTRACE_SCX: trace syscam call exits. - PTRACE_FORK: trace forks and auto-attach to new child processes. - PTRACE_LWP: trace LWP events. The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have been replaced by PTRACE_SCE and PTRACE_SCX. PTRACE_FORK replaces P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS. The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for compatibility but now simply toggle corresponding flags in the event mask. While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both modify the event mask and continue the traced process. 302921: Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL. 303461: Note that not all optional ptrace events use SIGTRAP. New child processes attached due to PTRACE_FORK use SIGSTOP instead of SIGTRAP. All other ptrace events use SIGTRAP. 304009: Remove description of P_FOLLOWFORK as this flag was removed. Modified: stable/11/bin/ps/ps.1 stable/11/lib/libc/sys/ptrace.2 stable/11/sys/i386/linux/linux_ptrace.c stable/11/sys/kern/kern_exec.c stable/11/sys/kern/kern_exit.c stable/11/sys/kern/kern_fork.c stable/11/sys/kern/kern_sig.c stable/11/sys/kern/kern_thr.c stable/11/sys/kern/subr_syscall.c stable/11/sys/kern/sys_process.c stable/11/sys/sys/proc.h stable/11/sys/sys/ptrace.h stable/11/tests/sys/kern/ptrace_test.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/bin/ps/ps.1 stable/10/lib/libc/sys/ptrace.2 stable/10/sys/i386/linux/linux_ptrace.c stable/10/sys/kern/kern_exec.c stable/10/sys/kern/kern_exit.c stable/10/sys/kern/kern_fork.c stable/10/sys/kern/kern_sig.c stable/10/sys/kern/kern_thr.c stable/10/sys/kern/subr_syscall.c stable/10/sys/kern/sys_process.c stable/10/sys/sys/proc.h stable/10/sys/sys/ptrace.h stable/10/tests/sys/kern/ptrace_test.c Directory Properties: stable/10/ (props changed) Modified: stable/11/bin/ps/ps.1 ============================================================================== --- stable/11/bin/ps/ps.1 Mon Aug 15 20:38:02 2016 (r304187) +++ stable/11/bin/ps/ps.1 Mon Aug 15 21:10:41 2016 (r304188) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd December 1, 2015 +.Dd August 12, 2016 .Dt PS 1 .Os .Sh NAME @@ -319,7 +319,6 @@ the include file .It Dv "P_ADVLOCK" Ta No "0x00001" Ta "Process may hold a POSIX advisory lock" .It Dv "P_CONTROLT" Ta No "0x00002" Ta "Has a controlling terminal" .It Dv "P_KPROC" Ta No "0x00004" Ta "Kernel process" -.It Dv "P_FOLLOWFORK" Ta No "0x00008" Ta "Attach debugger to new children" .It Dv "P_PPWAIT" Ta No "0x00010" Ta "Parent is waiting for child to exec/exit" .It Dv "P_PROFIL" Ta No "0x00020" Ta "Has started profiling" .It Dv "P_STOPPROF" Ta No "0x00040" Ta "Has thread in requesting to stop prof" Modified: stable/11/lib/libc/sys/ptrace.2 ============================================================================== --- stable/11/lib/libc/sys/ptrace.2 Mon Aug 15 20:38:02 2016 (r304187) +++ stable/11/lib/libc/sys/ptrace.2 Mon Aug 15 21:10:41 2016 (r304188) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd December 29, 2015 +.Dd July 28, 2016 .Dt PTRACE 2 .Os .Sh NAME @@ -58,8 +58,9 @@ The signal may be a normal process signa traced process behavior, or use of the .Xr kill 2 system call; alternatively, it may be generated by the tracing facility -as a result of attaching, system calls, or stepping by the tracing -process. +as a result of attaching, stepping by the tracing +process, +or an event in the traced process. The tracing process may choose to intercept the signal, using it to observe process behavior (such as .Dv SIGTRAP ) , @@ -69,6 +70,121 @@ The system call is the mechanism by which all this happens. .Pp +A traced process may report additional signal stops corresponding to +events in the traced process. +These additional signal stops are reported as +.Dv SIGTRAP +or +.Dv SIGSTOP +signals. +The tracing process can use the +.Dv PT_LWPINFO +request to determine which events are associated with a +.Dv SIGTRAP +or +.Dv SIGSTOP +signal. +Note that multiple events may be associated with a single signal. +For example, events indicated by the +.Dv PL_FLAG_BORN , +.Dv PL_FLAG_FORKED , +and +.Dv PL_FLAG_EXEC +flags are also reported as a system call exit event +.Pq Dv PL_FLAG_SCX . +The signal stop for a new child process enabled via +.Dv PTRACE_FORK +will report a +.Dv SIGSTOP +signal. +All other additional signal stops use +.Dv SIGTRAP . +.Pp +Each traced process has a tracing event mask. +An event in the traced process only reports a +signal stop if the corresponding flag is set in the tracing event mask. +The current set of tracing event flags include: +.Bl -tag -width ".Dv PTRACE_SYSCALL" +.It Dv PTRACE_EXEC +Report a stop for a successful invocation of +.Xr execve 2 . +This event is indicated by the +.Dv PL_FLAG_EXEC +flag in the +.Va pl_flags +member of +.Vt "struct ptrace_lwpinfo" . +.It Dv PTRACE_SCE +Report a stop on each system call entry. +This event is indicated by the +.Dv PL_FLAG_SCE +flag in the +.Va pl_flags +member of +.Vt "struct ptrace_lwpinfo" . +.It Dv PTRACE_SCX +Report a stop on each system call exit. +This event is indicated by the +.Dv PL_FLAG_SCX +flag in the +.Va pl_flags +member of +.Vt "struct ptrace_lwpinfo" . +.It Dv PTRACE_SYSCALL +Report stops for both system call entry and exit. +.It Dv PTRACE_FORK +This event flag controls tracing for new child processes of a traced process. +.Pp +When this event flag is enabled, +new child processes will enable tracing and stop before executing their +first instruction. +The new child process will include the +.Dv PL_FLAG_CHILD +flag in the +.Va pl_flags +member of +.Vt "struct ptrace_lwpinfo" . +The traced process will report a stop that includes the +.Dv PL_FLAG_FORKED +flag. +The process ID of the new child process will also be present in the +.Va pl_child_pid +member of +.Vt "struct ptrace_lwpinfo" . +Note that new child processes will be attached with the default +tracing event mask; +they do not inherit the event mask of the traced process. +.Pp +When this event flag is not enabled, +new child processes will execute without tracing enabled. +.It Dv PTRACE_LWP +This event flag controls tracing of LWP +.Pq kernel thread +creation and destruction. +When this event is enabled, +new LWPs will stop and report an event with +.Dv PL_FLAG_BORN +set before executing their first instruction, +and exiting LWPs will stop and report an event with +.Dv PL_FLAG_EXITED +set before completing their termination. +.Pp +Note that new processes do not report an event for the creation of their +initial thread, +and exiting processes do not report an event for the termination of the +last thread. +.El +.Pp +The default tracing event mask when attaching to a process via +.Dv PT_ATTACH , +.Dv PT_TRACE_ME , +or +.Dv PTRACE_FORK +includes only +.Dv PTRACE_EXEC +events. +All other event flags are disabled. +.Pp The .Fa request argument specifies what operation is being performed; the meaning of @@ -368,21 +484,20 @@ The process identifier of the new proces member of .Vt "struct ptrace_lwpinfo" . .It PL_FLAG_CHILD -The flag is set for first event reported from a new child, which is -automatically attached due to -.Dv PT_FOLLOW_FORK -enabled. +The flag is set for first event reported from a new child which is +automatically attached when +.Dv PTRACE_FORK +is enabled. .It PL_FLAG_BORN -This flag is set for the first event reported from a new LWP when LWP -events are enabled via -.Dv PT_LWP_EVENTS . +This flag is set for the first event reported from a new LWP when +.Dv PTRACE_LWP +is enabled. It is reported along with -.Dv PL_FLAG_SCX -and is always reported if LWP events are enabled. +.Dv PL_FLAG_SCX . .It PL_FLAG_EXITED This flag is set for the last event reported by an exiting LWP when -LWP events are enabled via -.Dv PT_LWP_EVENTS . +.Dv PTRACE_LWP +is enabled. Note that this event is not reported when the last LWP in a process exits. The termination of the last thread is reported via a normal process exit event. @@ -456,50 +571,72 @@ This request will suspend the specified .It PT_RESUME This request will resume the specified thread. .It PT_TO_SCE -This request will trace the specified process on each system call entry. +This request will set the +.Dv PTRACE_SCE +event flag to trace all future system call entries and continue the process. +The +.Fa addr +and +.Fa data +arguments are used the same as for +.Dv PT_CONTINUE. .It PT_TO_SCX -This request will trace the specified process on each system call exit. +This request will set the +.Dv PTRACE_SCX +event flag to trace all future system call exits and continue the process. +The +.Fa addr +and +.Fa data +arguments are used the same as for +.Dv PT_CONTINUE. .It PT_SYSCALL -This request will trace the specified process -on each system call entry and exit. +This request will set the +.Dv PTRACE_SYSCALL +event flag to trace all future system call entries and exits and continue +the process. +The +.Fa addr +and +.Fa data +arguments are used the same as for +.Dv PT_CONTINUE. .It PT_FOLLOW_FORK This request controls tracing for new child processes of a traced process. If .Fa data is non-zero, -then new child processes will enable tracing and stop before executing their -first instruction. +.Dv PTRACE_FORK +is set in the traced process's event tracing mask. If .Fa data -is zero, then new child processes will execute without tracing enabled. -By default, tracing is not enabled for new child processes. -Child processes do not inherit this property. -The traced process will set the -.Dv PL_FLAG_FORKED -flag upon exit from a system call that creates a new process. +is zero, +.Dv PTRACE_FORK +is cleared from the traced process's event tracing mask. .It PT_LWP_EVENTS This request controls tracing of LWP creation and destruction. If .Fa data is non-zero, -then LWPs will stop to report creation and destruction events. +.Dv PTRACE_LWP +is set in the traced process's event tracing mask. If .Fa data is zero, -then LWP creation and destruction events will not be reported. -By default, tracing is not enabled for LWP events. -Child processes do not inherit this property. -New LWPs will stop to report an event with -.Dv PL_FLAG_BORN -set before executing their first instruction. -Exiting LWPs will stop to report an event with -.Dv PL_FLAG_EXITED -set before completing their termination. -.Pp -Note that new processes do not report an event for the creation of their -initial thread, -and exiting processes do not report an event for the termination of the -last thread. +.Dv PTRACE_LWP +is cleared from the traced process's event tracing mask. +.It PT_GET_EVENT_MASK +This request reads the traced process's event tracing mask into the +integer pointed to by +.Fa addr . +The size of the integer must be passed in +.Fa data . +.It PT_SET_EVENT_MASK +This request sets the traced process's event tracing mask from the +integer pointed to by +.Fa addr . +The size of the integer must be passed in +.Fa data . .It PT_VM_TIMESTAMP This request returns the generation number or timestamp of the memory map of the traced process as the return value from Modified: stable/11/sys/i386/linux/linux_ptrace.c ============================================================================== --- stable/11/sys/i386/linux/linux_ptrace.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/11/sys/i386/linux/linux_ptrace.c Mon Aug 15 21:10:41 2016 (r304188) @@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$"); #define PTRACE_ATTACH 16 #define PTRACE_DETACH 17 -#define PTRACE_SYSCALL 24 +#define LINUX_PTRACE_SYSCALL 24 #define PTRACE_GETREGS 12 #define PTRACE_SETREGS 13 @@ -473,7 +473,7 @@ linux_ptrace(struct thread *td, struct l break; } - case PTRACE_SYSCALL: + case LINUX_PTRACE_SYSCALL: /* fall through */ default: printf("linux: ptrace(%u, ...) not implemented\n", Modified: stable/11/sys/kern/kern_exec.c ============================================================================== --- stable/11/sys/kern/kern_exec.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/11/sys/kern/kern_exec.c Mon Aug 15 21:10:41 2016 (r304188) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -905,7 +906,8 @@ exec_fail_dealloc: if (error == 0) { PROC_LOCK(p); - td->td_dbgflags |= TDB_EXEC; + if (p->p_ptevents & PTRACE_EXEC) + td->td_dbgflags |= TDB_EXEC; PROC_UNLOCK(p); /* Modified: stable/11/sys/kern/kern_exit.c ============================================================================== --- stable/11/sys/kern/kern_exit.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/11/sys/kern/kern_exit.c Mon Aug 15 21:10:41 2016 (r304188) @@ -338,6 +338,7 @@ exit1(struct thread *td, int rval, int s PROC_LOCK(p); stopprofclock(p); p->p_flag &= ~(P_TRACED | P_PPWAIT | P_PPTRACE); + p->p_ptevents = 0; /* * Stop the real interval timer. If the handler is currently @@ -475,6 +476,7 @@ exit1(struct thread *td, int rval, int s */ clear_orphan(q); q->p_flag &= ~(P_TRACED | P_STOPPED_TRACE); + q->p_ptevents = 0; FOREACH_THREAD_IN_PROC(q, tdt) tdt->td_dbgflags &= ~TDB_SUSPEND; kern_psignal(q, SIGKILL); Modified: stable/11/sys/kern/kern_fork.c ============================================================================== --- stable/11/sys/kern/kern_fork.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/11/sys/kern/kern_fork.c Mon Aug 15 21:10:41 2016 (r304188) @@ -414,6 +414,7 @@ do_fork(struct thread *td, struct fork_r bzero(&p2->p_startzero, __rangeof(struct proc, p_startzero, p_endzero)); + p2->p_ptevents = 0; /* Tell the prison that we exist. */ prison_proc_hold(p2->p_ucred->cr_prison); @@ -720,8 +721,7 @@ do_fork(struct thread *td, struct fork_r * but before we wait for the debugger. */ _PHOLD(p2); - if ((p1->p_flag & (P_TRACED | P_FOLLOWFORK)) == (P_TRACED | - P_FOLLOWFORK)) { + if (p1->p_ptevents & PTRACE_FORK) { /* * Arrange for debugger to receive the fork event. * @@ -1068,14 +1068,14 @@ fork_return(struct thread *td, struct tr if (td->td_dbgflags & TDB_STOPATFORK) { sx_xlock(&proctree_lock); PROC_LOCK(p); - if ((p->p_pptr->p_flag & (P_TRACED | P_FOLLOWFORK)) == - (P_TRACED | P_FOLLOWFORK)) { + if (p->p_pptr->p_ptevents & PTRACE_FORK) { /* * If debugger still wants auto-attach for the * parent's children, do it now. */ dbg = p->p_pptr->p_pptr; p->p_flag |= P_TRACED; + p->p_ptevents = PTRACE_DEFAULT; p->p_oppid = p->p_pptr->p_pid; CTR2(KTR_PTRACE, "fork_return: attaching to new child pid %d: oppid %d", @@ -1102,7 +1102,7 @@ fork_return(struct thread *td, struct tr PROC_LOCK(p); td->td_dbgflags |= TDB_SCX; _STOPEVENT(p, S_SCX, td->td_dbg_sc_code); - if ((p->p_stops & S_PT_SCX) != 0 || + if ((p->p_ptevents & PTRACE_SCX) != 0 || (td->td_dbgflags & TDB_BORN) != 0) ptracestop(td, SIGTRAP); td->td_dbgflags &= ~(TDB_SCX | TDB_BORN); Modified: stable/11/sys/kern/kern_sig.c ============================================================================== --- stable/11/sys/kern/kern_sig.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/11/sys/kern/kern_sig.c Mon Aug 15 21:10:41 2016 (r304188) @@ -2191,9 +2191,10 @@ tdsendsignal(struct proc *p, struct thre !((prop & SA_CONT) && (p->p_flag & P_STOPPED_SIG))) return (ret); /* - * SIGKILL: Remove procfs STOPEVENTs. + * SIGKILL: Remove procfs STOPEVENTs and ptrace events. */ if (sig == SIGKILL) { + p->p_ptevents = 0; /* from procfs_ioctl.c: PIOCBIC */ p->p_stops = 0; /* from procfs_ioctl.c: PIOCCONT */ Modified: stable/11/sys/kern/kern_thr.c ============================================================================== --- stable/11/sys/kern/kern_thr.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/11/sys/kern/kern_thr.c Mon Aug 15 21:10:41 2016 (r304188) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -254,7 +255,7 @@ thread_create(struct thread *td, struct thread_unlock(td); if (P_SHOULDSTOP(p)) newtd->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK; - if (p->p_flag2 & P2_LWP_EVENTS) + if (p->p_ptevents & PTRACE_LWP) newtd->td_dbgflags |= TDB_BORN; /* @@ -354,7 +355,7 @@ kern_thr_exit(struct thread *td) p->p_pendingexits++; td->td_dbgflags |= TDB_EXIT; - if (p->p_flag & P_TRACED && p->p_flag2 & P2_LWP_EVENTS) + if (p->p_ptevents & PTRACE_LWP) ptracestop(td, SIGTRAP); PROC_UNLOCK(p); tidhash_remove(td); Modified: stable/11/sys/kern/subr_syscall.c ============================================================================== --- stable/11/sys/kern/subr_syscall.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/11/sys/kern/subr_syscall.c Mon Aug 15 21:10:41 2016 (r304188) @@ -87,7 +87,7 @@ syscallenter(struct thread *td, struct s PROC_LOCK(p); td->td_dbg_sc_code = sa->code; td->td_dbg_sc_narg = sa->narg; - if (p->p_stops & S_PT_SCE) + if (p->p_ptevents & PTRACE_SCE) ptracestop((td), SIGTRAP); PROC_UNLOCK(p); } @@ -208,7 +208,7 @@ syscallret(struct thread *td, int error, */ if (traced && ((td->td_dbgflags & (TDB_FORK | TDB_EXEC)) != 0 || - (p->p_stops & S_PT_SCX) != 0)) + (p->p_ptevents & PTRACE_SCX) != 0)) ptracestop(td, SIGTRAP); td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); PROC_UNLOCK(p); Modified: stable/11/sys/kern/sys_process.c ============================================================================== --- stable/11/sys/kern/sys_process.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/11/sys/kern/sys_process.c Mon Aug 15 21:10:41 2016 (r304188) @@ -586,6 +586,7 @@ sys_ptrace(struct thread *td, struct ptr struct ptrace_lwpinfo32 pl32; struct ptrace_vm_entry32 pve32; #endif + int ptevents; } r; void *addr; int error = 0; @@ -600,6 +601,7 @@ sys_ptrace(struct thread *td, struct ptr AUDIT_ARG_VALUE(uap->data); addr = &r; switch (uap->req) { + case PT_GET_EVENT_MASK: case PT_GETREGS: case PT_GETFPREGS: case PT_GETDBREGS: @@ -614,6 +616,12 @@ sys_ptrace(struct thread *td, struct ptr case PT_SETDBREGS: error = COPYIN(uap->addr, &r.dbreg, sizeof r.dbreg); break; + case PT_SET_EVENT_MASK: + if (uap->data != sizeof(r.ptevents)) + error = EINVAL; + else + error = copyin(uap->addr, &r.ptevents, uap->data); + break; case PT_IO: error = COPYIN(uap->addr, &r.piod, sizeof r.piod); break; @@ -647,7 +655,12 @@ sys_ptrace(struct thread *td, struct ptr case PT_GETDBREGS: error = COPYOUT(&r.dbreg, uap->addr, sizeof r.dbreg); break; + case PT_GET_EVENT_MASK: + /* NB: The size in uap->data is validated in kern_ptrace(). */ + error = copyout(&r.ptevents, uap->addr, uap->data); + break; case PT_LWPINFO: + /* NB: The size in uap->data is validated in kern_ptrace(). */ error = copyout(&r.pl, uap->addr, uap->data); break; } @@ -711,6 +724,8 @@ kern_ptrace(struct thread *td, int req, case PT_SYSCALL: case PT_FOLLOW_FORK: case PT_LWP_EVENTS: + case PT_GET_EVENT_MASK: + case PT_SET_EVENT_MASK: case PT_DETACH: sx_xlock(&proctree_lock); proctree_locked = 1; @@ -885,6 +900,7 @@ kern_ptrace(struct thread *td, int req, case PT_TRACE_ME: /* set my trace flag and "owner" so it can read/write me */ p->p_flag |= P_TRACED; + p->p_ptevents = PTRACE_DEFAULT; if (p->p_flag & P_PPWAIT) p->p_flag |= P_PPTRACE; p->p_oppid = p->p_pptr->p_pid; @@ -903,6 +919,7 @@ kern_ptrace(struct thread *td, int req, * on a "detach". */ p->p_flag |= P_TRACED; + p->p_ptevents = PTRACE_DEFAULT; p->p_oppid = p->p_pptr->p_pid; if (p->p_pptr != td->td_proc) { proc_reparent(p, td->td_proc); @@ -941,24 +958,50 @@ kern_ptrace(struct thread *td, int req, case PT_FOLLOW_FORK: CTR3(KTR_PTRACE, "PT_FOLLOW_FORK: pid %d %s -> %s", p->p_pid, - p->p_flag & P_FOLLOWFORK ? "enabled" : "disabled", + p->p_ptevents & PTRACE_FORK ? "enabled" : "disabled", data ? "enabled" : "disabled"); if (data) - p->p_flag |= P_FOLLOWFORK; + p->p_ptevents |= PTRACE_FORK; else - p->p_flag &= ~P_FOLLOWFORK; + p->p_ptevents &= ~PTRACE_FORK; break; case PT_LWP_EVENTS: CTR3(KTR_PTRACE, "PT_LWP_EVENTS: pid %d %s -> %s", p->p_pid, - p->p_flag2 & P2_LWP_EVENTS ? "enabled" : "disabled", + p->p_ptevents & PTRACE_LWP ? "enabled" : "disabled", data ? "enabled" : "disabled"); if (data) - p->p_flag2 |= P2_LWP_EVENTS; + p->p_ptevents |= PTRACE_LWP; else - p->p_flag2 &= ~P2_LWP_EVENTS; + p->p_ptevents &= ~PTRACE_LWP; + break; + + case PT_GET_EVENT_MASK: + if (data != sizeof(p->p_ptevents)) { + error = EINVAL; + break; + } + CTR2(KTR_PTRACE, "PT_GET_EVENT_MASK: pid %d mask %#x", p->p_pid, + p->p_ptevents); + *(int *)addr = p->p_ptevents; break; + case PT_SET_EVENT_MASK: + if (data != sizeof(p->p_ptevents)) { + error = EINVAL; + break; + } + tmp = *(int *)addr; + if ((tmp & ~(PTRACE_EXEC | PTRACE_SCE | PTRACE_SCX | + PTRACE_FORK | PTRACE_LWP)) != 0) { + error = EINVAL; + break; + } + CTR3(KTR_PTRACE, "PT_SET_EVENT_MASK: pid %d mask %#x -> %#x", + p->p_pid, p->p_ptevents, tmp); + p->p_ptevents = tmp; + break; + case PT_STEP: case PT_CONTINUE: case PT_TO_SCE: @@ -991,24 +1034,24 @@ kern_ptrace(struct thread *td, int req, } switch (req) { case PT_TO_SCE: - p->p_stops |= S_PT_SCE; + p->p_ptevents |= PTRACE_SCE; CTR4(KTR_PTRACE, - "PT_TO_SCE: pid %d, stops = %#x, PC = %#lx, sig = %d", - p->p_pid, p->p_stops, + "PT_TO_SCE: pid %d, events = %#x, PC = %#lx, sig = %d", + p->p_pid, p->p_ptevents, (u_long)(uintfptr_t)addr, data); break; case PT_TO_SCX: - p->p_stops |= S_PT_SCX; + p->p_ptevents |= PTRACE_SCX; CTR4(KTR_PTRACE, - "PT_TO_SCX: pid %d, stops = %#x, PC = %#lx, sig = %d", - p->p_pid, p->p_stops, + "PT_TO_SCX: pid %d, events = %#x, PC = %#lx, sig = %d", + p->p_pid, p->p_ptevents, (u_long)(uintfptr_t)addr, data); break; case PT_SYSCALL: - p->p_stops |= S_PT_SCE | S_PT_SCX; + p->p_ptevents |= PTRACE_SYSCALL; CTR4(KTR_PTRACE, - "PT_SYSCALL: pid %d, stops = %#x, PC = %#lx, sig = %d", - p->p_pid, p->p_stops, + "PT_SYSCALL: pid %d, events = %#x, PC = %#lx, sig = %d", + p->p_pid, p->p_ptevents, (u_long)(uintfptr_t)addr, data); break; case PT_CONTINUE: @@ -1027,7 +1070,7 @@ kern_ptrace(struct thread *td, int req, * parent. Otherwise the debugee will be set * as an orphan of the debugger. */ - p->p_flag &= ~(P_TRACED | P_WAITED | P_FOLLOWFORK); + p->p_flag &= ~(P_TRACED | P_WAITED); if (p->p_oppid != p->p_pptr->p_pid) { PROC_LOCK(p->p_pptr); sigqueue_take(p->p_ksi); @@ -1044,7 +1087,7 @@ kern_ptrace(struct thread *td, int req, CTR2(KTR_PTRACE, "PT_DETACH: pid %d, sig %d", p->p_pid, data); p->p_oppid = 0; - p->p_stops = 0; + p->p_ptevents = 0; /* should we send SIGCHLD? */ /* childproc_continued(p); */ Modified: stable/11/sys/sys/proc.h ============================================================================== --- stable/11/sys/sys/proc.h Mon Aug 15 20:38:02 2016 (r304187) +++ stable/11/sys/sys/proc.h Mon Aug 15 21:10:41 2016 (r304188) @@ -643,6 +643,7 @@ struct proc { */ LIST_ENTRY(proc) p_orphan; /* (e) List of orphan processes. */ LIST_HEAD(, proc) p_orphans; /* (e) Pointer to list of orphans. */ + u_int p_ptevents; /* (c) ptrace() event mask. */ }; #define p_session p_pgrp->pg_session @@ -672,7 +673,7 @@ struct proc { #define P_ADVLOCK 0x00001 /* Process may hold a POSIX advisory lock. */ #define P_CONTROLT 0x00002 /* Has a controlling terminal. */ #define P_KPROC 0x00004 /* Kernel process. */ -#define P_FOLLOWFORK 0x00008 /* Attach parent debugger to children. */ +#define P_UNUSED3 0x00008 /* --available-- */ #define P_PPWAIT 0x00010 /* Parent is waiting for child to exec/exit. */ #define P_PROFIL 0x00020 /* Has started profiling. */ #define P_STOPPROF 0x00040 /* Has thread requesting to stop profiling. */ @@ -711,7 +712,6 @@ struct proc { #define P2_NOTRACE 0x00000002 /* No ptrace(2) attach or coredumps. */ #define P2_NOTRACE_EXEC 0x00000004 /* Keep P2_NOPTRACE on exec(2). */ #define P2_AST_SU 0x00000008 /* Handles SU ast for kthreads. */ -#define P2_LWP_EVENTS 0x00000010 /* Report LWP events via ptrace(2). */ /* Flags protected by proctree_lock, kept in p_treeflags. */ #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ Modified: stable/11/sys/sys/ptrace.h ============================================================================== --- stable/11/sys/sys/ptrace.h Mon Aug 15 20:38:02 2016 (r304187) +++ stable/11/sys/sys/ptrace.h Mon Aug 15 21:10:41 2016 (r304188) @@ -66,6 +66,9 @@ #define PT_FOLLOW_FORK 23 #define PT_LWP_EVENTS 24 /* report LWP birth and exit */ +#define PT_GET_EVENT_MASK 25 /* get mask of optional events */ +#define PT_SET_EVENT_MASK 26 /* set mask of optional events */ + #define PT_GETREGS 33 /* get general-purpose registers */ #define PT_SETREGS 34 /* set general-purpose registers */ #define PT_GETFPREGS 35 /* get floating-point registers */ @@ -79,6 +82,16 @@ #define PT_FIRSTMACH 64 /* for machine-specific requests */ #include /* machine-specific requests, if any */ +/* Events used with PT_GET_EVENT_MASK and PT_SET_EVENT_MASK */ +#define PTRACE_EXEC 0x0001 +#define PTRACE_SCE 0x0002 +#define PTRACE_SCX 0x0004 +#define PTRACE_SYSCALL (PTRACE_SCE | PTRACE_SCX) +#define PTRACE_FORK 0x0008 +#define PTRACE_LWP 0x0010 + +#define PTRACE_DEFAULT (PTRACE_EXEC) + struct ptrace_io_desc { int piod_op; /* I/O operation */ void *piod_offs; /* child offset */ @@ -136,13 +149,6 @@ struct ptrace_vm_entry { #ifdef _KERNEL -/* - * The flags below are used for ptrace(2) tracing and have no relation - * to procfs. They are stored in struct proc's p_stops member. - */ -#define S_PT_SCE 0x000010000 -#define S_PT_SCX 0x000020000 - int ptrace_set_pc(struct thread *_td, unsigned long _addr); int ptrace_single_step(struct thread *_td); int ptrace_clear_single_step(struct thread *_td); Modified: stable/11/tests/sys/kern/ptrace_test.c ============================================================================== --- stable/11/tests/sys/kern/ptrace_test.c Mon Aug 15 20:38:02 2016 (r304187) +++ stable/11/tests/sys/kern/ptrace_test.c Mon Aug 15 21:10:41 2016 (r304188) @@ -1355,6 +1355,200 @@ ATF_TC_BODY(ptrace__lwp_events_exec, tc) ATF_REQUIRE(errno == ECHILD); } +static void +handler(int sig __unused) +{ +} + +static void +signal_main(void) +{ + + signal(SIGINFO, handler); + raise(SIGINFO); + exit(0); +} + +/* + * Verify that the expected ptrace event is reported for a signal. + */ +ATF_TC_WITHOUT_HEAD(ptrace__siginfo); +ATF_TC_BODY(ptrace__siginfo, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + int status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + signal_main(); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The next event should be for the SIGINFO. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGINFO); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE(pl.pl_event == PL_EVENT_SIGNAL); + ATF_REQUIRE(pl.pl_flags & PL_FLAG_SI); + ATF_REQUIRE(pl.pl_siginfo.si_code == SI_LWP); + ATF_REQUIRE(pl.pl_siginfo.si_pid == wpid); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The last event should be for the child process's exit. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + +/* + * Verify that the expected ptrace events are reported for PTRACE_EXEC. + */ +ATF_TC_WITHOUT_HEAD(ptrace__ptrace_exec_disable); +ATF_TC_BODY(ptrace__ptrace_exec_disable, tc) +{ + pid_t fpid, wpid; + int events, status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + exec_thread(NULL); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + events = 0; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* Should get one event at exit. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + +ATF_TC_WITHOUT_HEAD(ptrace__ptrace_exec_enable); +ATF_TC_BODY(ptrace__ptrace_exec_enable, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + int events, status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + exec_thread(NULL); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + events = PTRACE_EXEC; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The next event should be for the child process's exec. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE((pl.pl_flags & (PL_FLAG_EXEC | PL_FLAG_SCX)) == + (PL_FLAG_EXEC | PL_FLAG_SCX)); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* The last event should be for the child process's exit. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + +ATF_TC_WITHOUT_HEAD(ptrace__event_mask); +ATF_TC_BODY(ptrace__event_mask, tc) +{ + pid_t fpid, wpid; + int events, status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + exit(0); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + /* PT_FOLLOW_FORK should toggle the state of PTRACE_FORK. */ + ATF_REQUIRE(ptrace(PT_FOLLOW_FORK, fpid, NULL, 1) != -1); + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + ATF_REQUIRE(events & PTRACE_FORK); + ATF_REQUIRE(ptrace(PT_FOLLOW_FORK, fpid, NULL, 0) != -1); + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + ATF_REQUIRE(!(events & PTRACE_FORK)); + + /* PT_LWP_EVENTS should toggle the state of PTRACE_LWP. */ + ATF_REQUIRE(ptrace(PT_LWP_EVENTS, fpid, NULL, 1) != -1); + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + ATF_REQUIRE(events & PTRACE_LWP); + ATF_REQUIRE(ptrace(PT_LWP_EVENTS, fpid, NULL, 0) != -1); + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + ATF_REQUIRE(!(events & PTRACE_LWP)); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) == 0); + + /* Should get one event at exit. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 0); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + ATF_TP_ADD_TCS(tp) { @@ -1376,6 +1570,10 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ptrace__new_child_pl_syscall_code_thread); ATF_TP_ADD_TC(tp, ptrace__lwp_events); ATF_TP_ADD_TC(tp, ptrace__lwp_events_exec); + ATF_TP_ADD_TC(tp, ptrace__siginfo); + ATF_TP_ADD_TC(tp, ptrace__ptrace_exec_disable); + ATF_TP_ADD_TC(tp, ptrace__ptrace_exec_enable); + ATF_TP_ADD_TC(tp, ptrace__event_mask); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Mon Aug 15 21:33:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0064BBB7FD; Mon, 15 Aug 2016 21:33:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7DA551468; Mon, 15 Aug 2016 21:33:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FLXKZG048366; Mon, 15 Aug 2016 21:33:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FLXKXx048360; Mon, 15 Aug 2016 21:33:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608152133.u7FLXKXx048360@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Aug 2016 21:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304189 - in stable/11: bin/ps sys/kern sys/sys X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 21:33:21 -0000 Author: kib Date: Mon Aug 15 21:33:20 2016 New Revision: 304189 URL: https://svnweb.freebsd.org/changeset/base/304189 Log: MFC r303423: Force SIGSTOP to be the first signal reported after the attach. Modified: stable/11/bin/ps/ps.1 stable/11/sys/kern/kern_exit.c stable/11/sys/kern/kern_fork.c stable/11/sys/kern/kern_sig.c stable/11/sys/kern/sys_process.c stable/11/sys/sys/proc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ps/ps.1 ============================================================================== --- stable/11/bin/ps/ps.1 Mon Aug 15 21:10:41 2016 (r304188) +++ stable/11/bin/ps/ps.1 Mon Aug 15 21:33:20 2016 (r304189) @@ -359,6 +359,7 @@ the include file .It Dv "P2_NOTRACE" Ta No "0x00000002" Ta "No ptrace(2) attach or coredumps" .It Dv "P2_NOTRACE_EXEC" Ta No "0x00000004" Ta "Keep P2_NOPTRACE on exec(2)" .It Dv "P2_AST_SU" Ta No "0x00000008" Ta "Handles SU ast for kthreads" +.It Dv "P2_PTRACE_FSTP" Ta No "0x00000010" Ta "SIGSTOP from PT_ATTACH not yet handled" .El .It Cm label The MAC label of the process. Modified: stable/11/sys/kern/kern_exit.c ============================================================================== --- stable/11/sys/kern/kern_exit.c Mon Aug 15 21:10:41 2016 (r304188) +++ stable/11/sys/kern/kern_exit.c Mon Aug 15 21:33:20 2016 (r304189) @@ -476,9 +476,12 @@ exit1(struct thread *td, int rval, int s */ clear_orphan(q); q->p_flag &= ~(P_TRACED | P_STOPPED_TRACE); + q->p_flag2 &= ~P2_PTRACE_FSTP; q->p_ptevents = 0; - FOREACH_THREAD_IN_PROC(q, tdt) - tdt->td_dbgflags &= ~TDB_SUSPEND; + FOREACH_THREAD_IN_PROC(q, tdt) { + tdt->td_dbgflags &= ~(TDB_SUSPEND | TDB_XSIG | + TDB_FSTP); + } kern_psignal(q, SIGKILL); } PROC_UNLOCK(q); Modified: stable/11/sys/kern/kern_fork.c ============================================================================== --- stable/11/sys/kern/kern_fork.c Mon Aug 15 21:10:41 2016 (r304188) +++ stable/11/sys/kern/kern_fork.c Mon Aug 15 21:33:20 2016 (r304189) @@ -1074,15 +1074,13 @@ fork_return(struct thread *td, struct tr * parent's children, do it now. */ dbg = p->p_pptr->p_pptr; - p->p_flag |= P_TRACED; - p->p_ptevents = PTRACE_DEFAULT; - p->p_oppid = p->p_pptr->p_pid; + proc_set_traced(p); CTR2(KTR_PTRACE, "fork_return: attaching to new child pid %d: oppid %d", p->p_pid, p->p_oppid); proc_reparent(p, dbg); sx_xunlock(&proctree_lock); - td->td_dbgflags |= TDB_CHILD | TDB_SCX; + td->td_dbgflags |= TDB_CHILD | TDB_SCX | TDB_FSTP; ptracestop(td, SIGSTOP); td->td_dbgflags &= ~(TDB_CHILD | TDB_SCX); } else { Modified: stable/11/sys/kern/kern_sig.c ============================================================================== --- stable/11/sys/kern/kern_sig.c Mon Aug 15 21:10:41 2016 (r304188) +++ stable/11/sys/kern/kern_sig.c Mon Aug 15 21:33:20 2016 (r304189) @@ -2526,14 +2526,26 @@ ptracestop(struct thread *td, int sig) PROC_SUNLOCK(p); return (sig); } + /* - * Just make wait() to work, the last stopped thread - * will win. + * Make wait(2) work. Ensure that right after the + * attach, the thread which was decided to become the + * leader of attach gets reported to the waiter. + * Otherwise, just avoid overwriting another thread's + * assignment to p_xthread. If another thread has + * already set p_xthread, the current thread will get + * a chance to report itself upon the next iteration. */ - p->p_xsig = sig; - p->p_xthread = td; - p->p_flag |= (P_STOPPED_SIG|P_STOPPED_TRACE); - sig_suspend_threads(td, p, 0); + if ((td->td_dbgflags & TDB_FSTP) != 0 || + ((p->p_flag & P2_PTRACE_FSTP) == 0 && + p->p_xthread == NULL)) { + p->p_xsig = sig; + p->p_xthread = td; + td->td_dbgflags &= ~TDB_FSTP; + p->p_flag2 &= ~P2_PTRACE_FSTP; + p->p_flag |= P_STOPPED_SIG | P_STOPPED_TRACE; + sig_suspend_threads(td, p, 0); + } if ((td->td_dbgflags & TDB_STOPATFORK) != 0) { td->td_dbgflags &= ~TDB_STOPATFORK; cv_broadcast(&p->p_dbgwait); @@ -2726,7 +2738,20 @@ issignal(struct thread *td) SIG_STOPSIGMASK(sigpending); if (SIGISEMPTY(sigpending)) /* no signal to send */ return (0); - sig = sig_ffs(&sigpending); + if ((p->p_flag & (P_TRACED | P_PPTRACE)) == P_TRACED && + (p->p_flag2 & P2_PTRACE_FSTP) != 0 && + SIGISMEMBER(sigpending, SIGSTOP)) { + /* + * If debugger just attached, always consume + * SIGSTOP from ptrace(PT_ATTACH) first, to + * execute the debugger attach ritual in + * order. + */ + sig = SIGSTOP; + td->td_dbgflags |= TDB_FSTP; + } else { + sig = sig_ffs(&sigpending); + } if (p->p_stops & S_SIG) { mtx_unlock(&ps->ps_mtx); @@ -2743,7 +2768,7 @@ issignal(struct thread *td) sigqueue_delete(&p->p_sigqueue, sig); continue; } - if (p->p_flag & P_TRACED && (p->p_flag & P_PPTRACE) == 0) { + if ((p->p_flag & (P_TRACED | P_PPTRACE)) == P_TRACED) { /* * If traced, always stop. * Remove old signal from queue before the stop. @@ -2846,6 +2871,8 @@ issignal(struct thread *td) mtx_unlock(&ps->ps_mtx); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, &p->p_mtx.lock_object, "Catching SIGSTOP"); + sigqueue_delete(&td->td_sigqueue, sig); + sigqueue_delete(&p->p_sigqueue, sig); p->p_flag |= P_STOPPED_SIG; p->p_xsig = sig; PROC_SLOCK(p); @@ -2853,7 +2880,7 @@ issignal(struct thread *td) thread_suspend_switch(td, p); PROC_SUNLOCK(p); mtx_lock(&ps->ps_mtx); - break; + goto next; } else if (prop & SA_IGNORE) { /* * Except for SIGCONT, shouldn't get here. @@ -2884,6 +2911,7 @@ issignal(struct thread *td) } sigqueue_delete(&td->td_sigqueue, sig); /* take the signal! */ sigqueue_delete(&p->p_sigqueue, sig); +next:; } /* NOTREACHED */ } Modified: stable/11/sys/kern/sys_process.c ============================================================================== --- stable/11/sys/kern/sys_process.c Mon Aug 15 21:10:41 2016 (r304188) +++ stable/11/sys/kern/sys_process.c Mon Aug 15 21:33:20 2016 (r304189) @@ -692,6 +692,17 @@ sys_ptrace(struct thread *td, struct ptr #define PROC_WRITE(w, t, a) proc_write_ ## w (t, a) #endif +void +proc_set_traced(struct proc *p) +{ + + PROC_LOCK_ASSERT(p, MA_OWNED); + p->p_flag |= P_TRACED; + p->p_flag2 |= P2_PTRACE_FSTP; + p->p_ptevents = PTRACE_DEFAULT; + p->p_oppid = p->p_pptr->p_pid; +} + int kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) { @@ -899,11 +910,9 @@ kern_ptrace(struct thread *td, int req, switch (req) { case PT_TRACE_ME: /* set my trace flag and "owner" so it can read/write me */ - p->p_flag |= P_TRACED; - p->p_ptevents = PTRACE_DEFAULT; + proc_set_traced(p); if (p->p_flag & P_PPWAIT) p->p_flag |= P_PPTRACE; - p->p_oppid = p->p_pptr->p_pid; CTR1(KTR_PTRACE, "PT_TRACE_ME: pid %d", p->p_pid); break; @@ -918,9 +927,7 @@ kern_ptrace(struct thread *td, int req, * The old parent is remembered so we can put things back * on a "detach". */ - p->p_flag |= P_TRACED; - p->p_ptevents = PTRACE_DEFAULT; - p->p_oppid = p->p_pptr->p_pid; + proc_set_traced(p); if (p->p_pptr != td->td_proc) { proc_reparent(p, td->td_proc); } @@ -1088,6 +1095,17 @@ kern_ptrace(struct thread *td, int req, p->p_pid, data); p->p_oppid = 0; p->p_ptevents = 0; + FOREACH_THREAD_IN_PROC(p, td3) { + if ((td3->td_dbgflags & TDB_FSTP) != 0) { + sigqueue_delete(&td3->td_sigqueue, + SIGSTOP); + } + td3->td_dbgflags &= ~(TDB_XSIG | TDB_FSTP); + } + if ((p->p_flag2 & P2_PTRACE_FSTP) != 0) { + sigqueue_delete(&p->p_sigqueue, SIGSTOP); + p->p_flag2 &= ~P2_PTRACE_FSTP; + } /* should we send SIGCHLD? */ /* childproc_continued(p); */ @@ -1108,7 +1126,7 @@ kern_ptrace(struct thread *td, int req, if (req == PT_DETACH) { FOREACH_THREAD_IN_PROC(p, td3) - td3->td_dbgflags &= ~TDB_SUSPEND; + td3->td_dbgflags &= ~TDB_SUSPEND; } /* * unsuspend all threads, to not let a thread run, Modified: stable/11/sys/sys/proc.h ============================================================================== --- stable/11/sys/sys/proc.h Mon Aug 15 21:10:41 2016 (r304188) +++ stable/11/sys/sys/proc.h Mon Aug 15 21:33:20 2016 (r304189) @@ -422,6 +422,7 @@ do { \ #define TDB_CHILD 0x00000100 /* New child indicator for ptrace() */ #define TDB_BORN 0x00000200 /* New LWP indicator for ptrace() */ #define TDB_EXIT 0x00000400 /* Exiting LWP indicator for ptrace() */ +#define TDB_FSTP 0x00001000 /* The thread is PT_ATTACH leader */ /* * "Private" flags kept in td_pflags: @@ -712,6 +713,7 @@ struct proc { #define P2_NOTRACE 0x00000002 /* No ptrace(2) attach or coredumps. */ #define P2_NOTRACE_EXEC 0x00000004 /* Keep P2_NOPTRACE on exec(2). */ #define P2_AST_SU 0x00000008 /* Handles SU ast for kthreads. */ +#define P2_PTRACE_FSTP 0x00000010 /* SIGSTOP from PT_ATTACH not yet handled. */ /* Flags protected by proctree_lock, kept in p_treeflags. */ #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ @@ -1002,6 +1004,7 @@ void proc_linkup(struct proc *p, struct struct proc *proc_realparent(struct proc *child); void proc_reap(struct thread *td, struct proc *p, int *status, int options); void proc_reparent(struct proc *child, struct proc *newparent); +void proc_set_traced(struct proc *p); struct pstats *pstats_alloc(void); void pstats_fork(struct pstats *src, struct pstats *dst); void pstats_free(struct pstats *ps); From owner-svn-src-all@freebsd.org Mon Aug 15 21:44:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E7DEBBB9F4; Mon, 15 Aug 2016 21:44:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7A7A1946; Mon, 15 Aug 2016 21:44:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FLi7nh052022; Mon, 15 Aug 2016 21:44:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FLi6um052016; Mon, 15 Aug 2016 21:44:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608152144.u7FLi6um052016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 15 Aug 2016 21:44:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304190 - in stable/10: bin/ps sys/kern sys/sys X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 21:44:08 -0000 Author: kib Date: Mon Aug 15 21:44:06 2016 New Revision: 304190 URL: https://svnweb.freebsd.org/changeset/base/304190 Log: MFC r303423: Force SIGSTOP to be the first signal reported after the attach. Modified: stable/10/bin/ps/ps.1 stable/10/sys/kern/kern_exit.c stable/10/sys/kern/kern_fork.c stable/10/sys/kern/kern_sig.c stable/10/sys/kern/sys_process.c stable/10/sys/sys/proc.h Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ps/ps.1 ============================================================================== --- stable/10/bin/ps/ps.1 Mon Aug 15 21:33:20 2016 (r304189) +++ stable/10/bin/ps/ps.1 Mon Aug 15 21:44:06 2016 (r304190) @@ -347,6 +347,7 @@ the include file .In sys/proc.h : .Bl -column P2_INHERIT_PROTECTED 0x00000001 .It Dv "P2_INHERIT_PROTECTED" Ta No "0x00000001" Ta "New children get P_PROTECTED" +.It Dv "P2_PTRACE_FSTP" Ta No "0x00000010" Ta "SIGSTOP from PT_ATTACH not yet handled" .El .It Cm label The MAC label of the process. Modified: stable/10/sys/kern/kern_exit.c ============================================================================== --- stable/10/sys/kern/kern_exit.c Mon Aug 15 21:33:20 2016 (r304189) +++ stable/10/sys/kern/kern_exit.c Mon Aug 15 21:44:06 2016 (r304190) @@ -520,9 +520,12 @@ exit1(struct thread *td, int rv) */ clear_orphan(q); q->p_flag &= ~(P_TRACED | P_STOPPED_TRACE); + q->p_flag2 &= ~P2_PTRACE_FSTP; q->p_ptevents = 0; - FOREACH_THREAD_IN_PROC(q, tdt) - tdt->td_dbgflags &= ~TDB_SUSPEND; + FOREACH_THREAD_IN_PROC(q, tdt) { + tdt->td_dbgflags &= ~(TDB_SUSPEND | TDB_XSIG | + TDB_FSTP); + } kern_psignal(q, SIGKILL); } PROC_UNLOCK(q); Modified: stable/10/sys/kern/kern_fork.c ============================================================================== --- stable/10/sys/kern/kern_fork.c Mon Aug 15 21:33:20 2016 (r304189) +++ stable/10/sys/kern/kern_fork.c Mon Aug 15 21:44:06 2016 (r304190) @@ -1063,15 +1063,13 @@ fork_return(struct thread *td, struct tr * parent's children, do it now. */ dbg = p->p_pptr->p_pptr; - p->p_flag |= P_TRACED; - p->p_ptevents = PTRACE_DEFAULT; - p->p_oppid = p->p_pptr->p_pid; + proc_set_traced(p); CTR2(KTR_PTRACE, "fork_return: attaching to new child pid %d: oppid %d", p->p_pid, p->p_oppid); proc_reparent(p, dbg); sx_xunlock(&proctree_lock); - td->td_dbgflags |= TDB_CHILD | TDB_SCX; + td->td_dbgflags |= TDB_CHILD | TDB_SCX | TDB_FSTP; ptracestop(td, SIGSTOP); td->td_dbgflags &= ~(TDB_CHILD | TDB_SCX); } else { Modified: stable/10/sys/kern/kern_sig.c ============================================================================== --- stable/10/sys/kern/kern_sig.c Mon Aug 15 21:33:20 2016 (r304189) +++ stable/10/sys/kern/kern_sig.c Mon Aug 15 21:44:06 2016 (r304190) @@ -2499,14 +2499,26 @@ ptracestop(struct thread *td, int sig) PROC_SUNLOCK(p); return (sig); } + /* - * Just make wait() to work, the last stopped thread - * will win. + * Make wait(2) work. Ensure that right after the + * attach, the thread which was decided to become the + * leader of attach gets reported to the waiter. + * Otherwise, just avoid overwriting another thread's + * assignment to p_xthread. If another thread has + * already set p_xthread, the current thread will get + * a chance to report itself upon the next iteration. */ - p->p_xstat = sig; - p->p_xthread = td; - p->p_flag |= (P_STOPPED_SIG|P_STOPPED_TRACE); - sig_suspend_threads(td, p, 0); + if ((td->td_dbgflags & TDB_FSTP) != 0 || + ((p->p_flag & P2_PTRACE_FSTP) == 0 && + p->p_xthread == NULL)) { + p->p_xstat = sig; + p->p_xthread = td; + td->td_dbgflags &= ~TDB_FSTP; + p->p_flag2 &= ~P2_PTRACE_FSTP; + p->p_flag |= P_STOPPED_SIG | P_STOPPED_TRACE; + sig_suspend_threads(td, p, 0); + } if ((td->td_dbgflags & TDB_STOPATFORK) != 0) { td->td_dbgflags &= ~TDB_STOPATFORK; cv_broadcast(&p->p_dbgwait); @@ -2657,7 +2669,20 @@ issignal(struct thread *td) SIG_STOPSIGMASK(sigpending); if (SIGISEMPTY(sigpending)) /* no signal to send */ return (0); - sig = sig_ffs(&sigpending); + if ((p->p_flag & (P_TRACED | P_PPTRACE)) == P_TRACED && + (p->p_flag2 & P2_PTRACE_FSTP) != 0 && + SIGISMEMBER(sigpending, SIGSTOP)) { + /* + * If debugger just attached, always consume + * SIGSTOP from ptrace(PT_ATTACH) first, to + * execute the debugger attach ritual in + * order. + */ + sig = SIGSTOP; + td->td_dbgflags |= TDB_FSTP; + } else { + sig = sig_ffs(&sigpending); + } if (p->p_stops & S_SIG) { mtx_unlock(&ps->ps_mtx); @@ -2674,7 +2699,7 @@ issignal(struct thread *td) sigqueue_delete(&p->p_sigqueue, sig); continue; } - if (p->p_flag & P_TRACED && (p->p_flag & P_PPTRACE) == 0) { + if ((p->p_flag & (P_TRACED | P_PPTRACE)) == P_TRACED) { /* * If traced, always stop. * Remove old signal from queue before the stop. @@ -2772,6 +2797,8 @@ issignal(struct thread *td) mtx_unlock(&ps->ps_mtx); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, &p->p_mtx.lock_object, "Catching SIGSTOP"); + sigqueue_delete(&td->td_sigqueue, sig); + sigqueue_delete(&p->p_sigqueue, sig); p->p_flag |= P_STOPPED_SIG; p->p_xstat = sig; PROC_SLOCK(p); @@ -2779,7 +2806,7 @@ issignal(struct thread *td) thread_suspend_switch(td, p); PROC_SUNLOCK(p); mtx_lock(&ps->ps_mtx); - break; + goto next; } else if (prop & SA_IGNORE) { /* * Except for SIGCONT, shouldn't get here. @@ -2810,6 +2837,7 @@ issignal(struct thread *td) } sigqueue_delete(&td->td_sigqueue, sig); /* take the signal! */ sigqueue_delete(&p->p_sigqueue, sig); +next:; } /* NOTREACHED */ } Modified: stable/10/sys/kern/sys_process.c ============================================================================== --- stable/10/sys/kern/sys_process.c Mon Aug 15 21:33:20 2016 (r304189) +++ stable/10/sys/kern/sys_process.c Mon Aug 15 21:44:06 2016 (r304190) @@ -648,6 +648,17 @@ sys_ptrace(struct thread *td, struct ptr #define PROC_WRITE(w, t, a) proc_write_ ## w (t, a) #endif +void +proc_set_traced(struct proc *p) +{ + + PROC_LOCK_ASSERT(p, MA_OWNED); + p->p_flag |= P_TRACED; + p->p_flag2 |= P2_PTRACE_FSTP; + p->p_ptevents = PTRACE_DEFAULT; + p->p_oppid = p->p_pptr->p_pid; +} + int kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) { @@ -856,11 +867,9 @@ kern_ptrace(struct thread *td, int req, switch (req) { case PT_TRACE_ME: /* set my trace flag and "owner" so it can read/write me */ - p->p_flag |= P_TRACED; - p->p_ptevents = PTRACE_DEFAULT; + proc_set_traced(p); if (p->p_flag & P_PPWAIT) p->p_flag |= P_PPTRACE; - p->p_oppid = p->p_pptr->p_pid; CTR1(KTR_PTRACE, "PT_TRACE_ME: pid %d", p->p_pid); break; @@ -875,9 +884,7 @@ kern_ptrace(struct thread *td, int req, * The old parent is remembered so we can put things back * on a "detach". */ - p->p_flag |= P_TRACED; - p->p_ptevents = PTRACE_DEFAULT; - p->p_oppid = p->p_pptr->p_pid; + proc_set_traced(p); if (p->p_pptr != td->td_proc) { proc_reparent(p, td->td_proc); } @@ -1045,6 +1052,17 @@ kern_ptrace(struct thread *td, int req, p->p_pid, data); p->p_oppid = 0; p->p_ptevents = 0; + FOREACH_THREAD_IN_PROC(p, td3) { + if ((td3->td_dbgflags & TDB_FSTP) != 0) { + sigqueue_delete(&td3->td_sigqueue, + SIGSTOP); + } + td3->td_dbgflags &= ~(TDB_XSIG | TDB_FSTP); + } + if ((p->p_flag2 & P2_PTRACE_FSTP) != 0) { + sigqueue_delete(&p->p_sigqueue, SIGSTOP); + p->p_flag2 &= ~P2_PTRACE_FSTP; + } /* should we send SIGCHLD? */ /* childproc_continued(p); */ @@ -1065,7 +1083,7 @@ kern_ptrace(struct thread *td, int req, if (req == PT_DETACH) { FOREACH_THREAD_IN_PROC(p, td3) - td3->td_dbgflags &= ~TDB_SUSPEND; + td3->td_dbgflags &= ~TDB_SUSPEND; } /* * unsuspend all threads, to not let a thread run, Modified: stable/10/sys/sys/proc.h ============================================================================== --- stable/10/sys/sys/proc.h Mon Aug 15 21:33:20 2016 (r304189) +++ stable/10/sys/sys/proc.h Mon Aug 15 21:44:06 2016 (r304190) @@ -398,6 +398,7 @@ do { \ #define TDB_CHILD 0x00000100 /* New child indicator for ptrace() */ #define TDB_BORN 0x00000200 /* New LWP indicator for ptrace() */ #define TDB_EXIT 0x00000400 /* Exiting LWP indicator for ptrace() */ +#define TDB_FSTP 0x00001000 /* The thread is PT_ATTACH leader */ /* * "Private" flags kept in td_pflags: @@ -678,6 +679,7 @@ struct proc { #define P2_NOTRACE 0x00000002 /* No ptrace(2) attach or coredumps. */ #define P2_NOTRACE_EXEC 0x00000004 /* Keep P2_NOPTRACE on exec(2). */ #define P2_AST_SU 0x00000008 /* Handles SU ast for kthreads. */ +#define P2_PTRACE_FSTP 0x00000010 /* SIGSTOP from PT_ATTACH not yet handled. */ /* Flags protected by proctree_lock, kept in p_treeflags. */ #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ @@ -930,6 +932,7 @@ void proc_linkup(struct proc *p, struct struct proc *proc_realparent(struct proc *child); void proc_reap(struct thread *td, struct proc *p, int *status, int options); void proc_reparent(struct proc *child, struct proc *newparent); +void proc_set_traced(struct proc *p); struct pstats *pstats_alloc(void); void pstats_fork(struct pstats *src, struct pstats *dst); void pstats_free(struct pstats *ps); From owner-svn-src-all@freebsd.org Mon Aug 15 22:48:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85D4CBB9B53; Mon, 15 Aug 2016 22:48:17 +0000 (UTC) (envelope-from jkim@niksun.com) Received: from APC01-SG2-obe.outbound.protection.outlook.com (mail-sg2apc01on0136.outbound.protection.outlook.com [104.47.125.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "Microsoft IT SSL SHA2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAC021CDD; Mon, 15 Aug 2016 22:48:16 +0000 (UTC) (envelope-from jkim@niksun.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niksunipl.onmicrosoft.com; s=selector1-niksun-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=GoDVM2xz1vBy/iO3ayUq+VyvlByzYQNeCx+tTxAzJYU=; b=QFR25Zc/xcfzboXW1pbs0ArPE5JJeXEmaPiiDtLC/7EP0DyxMvU6BvpwSbsI0VZIQ5ETD6Fu3FRXV8/7MsVNDns5zHru1al8uJzbtHTpJU8fDeU9gohCpcOf8LRF+M6z8WhbIFf6Rr+gkmJ7fcHENo95DF0YEMGbPVJIuIFY7KI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=jkim@niksun.com; Received: from hammer.pct.niksun.com (24.104.71.38) by PS1PR0301MB2012.apcprd03.prod.outlook.com (10.167.50.146) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21; Mon, 15 Aug 2016 22:14:09 +0000 From: Jung-uk Kim Subject: Re: svn commit: r304045 - head/share/timedef To: Baptiste Daroussin , , , References: <201608131559.u7DFxI68040959@repo.freebsd.org> Organization: NIKSUN, Inc. Message-ID: <36f052d3-7cbd-eaad-29b2-b647b35603a5@niksun.com> Date: Mon, 15 Aug 2016 18:13:51 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608131559.u7DFxI68040959@repo.freebsd.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [24.104.71.38] X-ClientProxiedBy: CY1PR0101CA0001.prod.exchangelabs.com (10.162.170.11) To PS1PR0301MB2012.apcprd03.prod.outlook.com (10.167.50.146) X-MS-Office365-Filtering-Correlation-Id: 787927ef-a74c-4aaf-cb57-08d3c5597be7 X-Microsoft-Exchange-Diagnostics: 1; PS1PR0301MB2012; 2:oQIXiLcz5IqfsnOVM4jF7g1vFtcMLrJTh2+BdhH3vhExODjJQTOhW2Mry6DrrAsWsKDl4BDnjVTItHgNjUWGEEF+Csbwbf/eiYLxEzWmWV1CVhvCFO3GfqCwOP8mZ1pU0TQoeama73iWgnf+ASWZevE99Fa9gdJiOMqueanWb0Zsooy6eavDSJxJvETNXxze; 3:UE+yPKHdye4Xon54/NjGuxxnmV/i2FRWLYdRXliSnHHMMD2UewNGB0Q4p8aNacSh68wUu9XZ9Zasu1M0WgJQKgG+i26odyWWE+Cac/PJiMDFCBRvGEgu1xFbaQN8sUGo X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:PS1PR0301MB2012; X-Microsoft-Exchange-Diagnostics: 1; PS1PR0301MB2012; 25:WChy5LXTob489a+l5lquYq34Q3t80CGKBGP9Mjlt3HtTUku/am9WV6Pf36Eeb2DH2C/QxMZm+yRyEZqU9wa9CIz8E7duPIkdniJX3My5CK0ap/aKIdoM9XwYNSaImQmYfXY7s8NYmMvIcXrs5mka4xmWRvozablxNLADi0JI4CWFq1Fz2yWUwrs9UL1lZ2gUnLU1wESyZljfsGiSmJYKLK1Bdw3jDS94gXRsgerrf1fskf0RC5DIx/bW10BVxJeRQM8ZxC+QCs0WQKTouJJGl37XhfuBWKBZxKGeH4w5XtAQgnft7BPY7khmqkfRr6Z69UrdQ9uEEazL2oSuGvO4W3zQteTGsmklr8jeRhZdK4WZ1aZDnBf3hcptmo8+TBJIKxzecxdgxokd8jT55qUwWRvbcghGa+Yvi8+FICBpUy5yScUI3PLDGMD6bYNowtP1oK8hrUCbB1lfR3WYYPoKvskX9BaIWCVszoo5qiKDZTjcWvqkpUwXX1cy159ob1fv+XpUgjt2Aqt5RO4NtjU2Ngf5qNqvkCtjCtlT4RjGTqMRyJdHlf71i0dDanCarRO2XF69oYFYrjJjj44lPN5Q1Ybda9/2UbTYkARLY4AFzB/nATcZFVkaF8Cad77PIk7hK1ycgq6AdMFV2C/IExMLB6eRsrefiHY7OpLQ2uij2JL71fxzlHxCmXJgM8kqIg663KeYq/msWZhlorqrluQdGYKtlvez4AMzkN46kY5IdR/BqK3uHcPZnrQakbtcX3v92Fylm3EZc/Q0KtgcRABjYkcKQAuP0C8x/4bQRPU6ZXstHIRFX5lDaoeSoBnavSAG X-Microsoft-Exchange-Diagnostics: 1; PS1PR0301MB2012; 31:U2CjbDy7w2RgmyXlZO0lnuOGFeRh/U8QhbFBJFZbO44yRDZMSfyOElzm9htNwnRRk5HEmweDIJm8bxPHKC8mwuGr4dD7OJskJmmG07oFo+n+BBFtaKT5NbIlVYgk/1DXWKWNkTDeduQWMS1Bse6+CLEloM+CqpPUdWOeBglWnixxA756U95ixLyOYGbdtGmGWID9Ae8k0bJfga8v+/aMWHMnWvrs13LXKCTsNmK98og=; 20:atpZjDxziFcQpLERcgERrO5OlGZPDx1TQ2/0z1RHVvN4R8h3WaYvOHk3oW3C9f1javQ+n3QEX7BMIR/xE3Qyey9+ef+Qp3/Gvr8i5e5/ZTB6mtDvB89xeJTLZ+LBNS8gFpsNXeLQseXf+rgRNkzK7xPkccbl4eyRLtAP3LU2XUaSL94lc0rNGeLGX3anX9twl6wzXsrht4yUV2n3mYWjBeUdpqj4wOTMNCVmmRbGGgIUN8tTq1RbLK8rgHJ28YJjd8w4SOoBe1vPeLVI46ufB4rfVwM27BBYWk5/B4mFkeE7NqU+e7+tEXyoXSWl+2LMuEh0mMVQlAlUeFANJ/Ph6OLr5EPVF79HOk0ytKEcQUBqyxET0Vs0f659GfRK6n29/V9UZEYqOEWxwA1HFx8f/ArnP+UKnvr3tqMYSLyrZ85AsYy8aRr1wFUDlLXjEfwA5CGcHIiPXyqUVTwjQIBrd73clHIA/x8uu6BBLGfS4kLS8xgnLXs7U1Xd3PaHGPPO X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(56005881305849); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6043046)(6042046); SRVR:PS1PR0301MB2012; BCL:0; PCL:0; RULEID:; SRVR:PS1PR0301MB2012; X-Microsoft-Exchange-Diagnostics: 1; PS1PR0301MB2012; 4:i9ZGscwoDR+EI++iIKR0Sy8FJmiv6jqhdcnLHUclpuOX0QPHi9MAhcmcBltDH2PxEMBrPX/1QTFYUyH6gjbxyRMH4Jq9nsKhrE4o6NFJhfGfE3CV5Q3qsri+AF0BHGY3upODVZbDd0x7JGku/X4luJ1WN5YLZ4JmyfYLSsH/oPJNlRnZAQWAHp9/JetL53n2gXRbcbJSJQ6b7HBnzPbqS5xBrSrz77C0Qk3LqfT5JRbwLrlcrn4oK96kWPpmMBgFMQeJTaBRvtRUvJasqNxjTubyBRzTZQLTUIeQjM67RZ+CoGGkevIV2k3e2IbPxVi0sQdUvGTB9OOOHn32z86KQCbhR1R/iS8924jfbGL3I+7AqO8KcVmLeRyh9JkZWA6Sejgm3xOzXiy9tVOrV2hxwM7aNdOWe2LJl5V7DFhqkpROBkKhb+AgffA7+PYfknL7gHgwZ/FCdkIIBDH+bKn7QQzh65Q7Ht5VrOW+X2G9yE8= X-Forefront-PRVS: 0035B15214 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(24454002)(199003)(189002)(31696002)(450100001)(189998001)(92566002)(83506001)(36756003)(65806001)(47776003)(4001350100001)(23676002)(107886002)(33646002)(105586002)(5001770100001)(65956001)(106356001)(66066001)(97736004)(76176999)(50986999)(230700001)(77096005)(5820100001)(305945005)(2906002)(19580395003)(586003)(7846002)(68736007)(31686004)(101416001)(3846002)(50466002)(54356999)(7736002)(64126003)(6116002)(42186005)(2201001)(81156014)(81166006)(2950100001)(15975445007)(86362001)(8676002)(65826006); DIR:OUT; SFP:1102; SCL:1; SRVR:PS1PR0301MB2012; H:hammer.pct.niksun.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: niksun.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtQUzFQUjAzMDFNQjIwMTI7MjM6Ny8vMWVOS1pPR2xzeHl6aGdzTjhmSVk3?= =?utf-8?B?R1c4ZmRrQktXUjFvUGFjcE5mYU8raHJGNWZIOVRXUXdpS1JhS2RUdk0xdFBF?= =?utf-8?B?M1ZLaXdBNmtkNzVVc1RoYTFMMzR5enBseXRjdi9GWEw5dk4ybWVkbUI2aVNw?= =?utf-8?B?TVJKeE5MbjNJeE16RUM0NXpDTjhxUGNKcWI1Ui9nTE5qRzhaWjYvUERLRGEw?= =?utf-8?B?TmxOQzBlWUdnSFJIUlg1anNueE1EZnI0R2FabEVCaDZ2QUhneTNOaTZ6aXRF?= =?utf-8?B?VndqZGJTdHQ5UXg3ejhBMjNmOGgvOGFtWXd0c0xCbEsreHhvdWRkRXVqU1Fu?= =?utf-8?B?NzBSN0J3RmZzQXhNQ3dpWlVLVnFKWi9keXRtK0FuWkZwd0xMR0Y5RUZIeUJP?= =?utf-8?B?blI1bysvT3dhSEVmU0N2Nm03d2J5bDBBUXV3N0ZMRng3U0NCMGlWbEN4T01K?= =?utf-8?B?aXBjbktxaitoVFhJVUhtWTF0cXpKeXYyK2RqYVhNT2E4M200cTcreTk5MTRE?= =?utf-8?B?eHpMQmhjK0xMZ1l1a2Q5QlIyTG5MQ2k1cjZlVkNHRlRqbThhV0syTkoraWx1?= =?utf-8?B?THlHQWVEZGs1Tk9qZ1I0TDJxSUZMcnpuZGxSbzBURVJGN0dyN0dHL2IyU09v?= =?utf-8?B?ZmQ5M0I4eGo4NU9kMUhZeFp1enhlaVZ6UU1PN25lQVBHeTBJbU5uUVJMZStu?= =?utf-8?B?a3IxOVJxVTdxN0xFbXBkQ2kwT2tzOE90eFRadXJ2T05xVHdubW1yN1M1M0Y0?= =?utf-8?B?QTlCdUpVdXErWndidWdFZ1F4ZThjWCt2THpPZWxudVRvaDdlNldZdFQzaU9u?= =?utf-8?B?VkpSQk1Xc0RLKy9ZYkFaVE9Jd0tHWGhicVgxR1hieVVueWFGbjY1RmhpTHBX?= =?utf-8?B?eE82aSttMnE2bHpZZEoya3lYSHlpb044cVVXb0V1NEQ5cjdEc1A3a2twOE8y?= =?utf-8?B?MGdtZzhaZG5iTU1XQUN5NE1mYXpMSW5HTC9KM2Ftc1FCQXNMd3FPYTlzMmpP?= =?utf-8?B?dFNyNVB4S0xYLzRZd1lWY3g5VWR0VjJVN01TRmxEeXJZM2pSeGRkc0M3RXdi?= =?utf-8?B?M3RmZFpMK25aTllyb0JJUU1HcXMwejFBVkZ5ZW03K0p4YzR6UHZUd1QyYjNu?= =?utf-8?B?VFlIRzVMOHlDS0tJL3ZXTWYrdVNxZVVWTnMvTVM1QTVxeVJzVWtYN25FOEQ3?= =?utf-8?B?VjhkT1Juc3BuK1dxWXQ3SHh0UjQ4eVBYS2dYaExVelNkMXBZYkl6UXl6VTVO?= =?utf-8?B?Q1VaQWxGRUY3bjk4UUZhOWl0RFFNM2JzTmNhaE9CZDdjVnM4MHU4TW1aU2lu?= =?utf-8?B?djlnMTZtcm5id2tqWmxWa1pScDMwYnYxZFdLRGxUYzRrVDFzc0lUcDBhWHl2?= =?utf-8?B?LzZrUXg4VVpSMGNjcTNvZHJ6a2VDOG1zWVdkVnoxUXIzVUl4Z3pJZlpHcjFp?= =?utf-8?B?a0k2R0M0WG0vczQzR3Boc0VraTZ6T0cyRTlqZUF0Qit1S1N1Ny9WdTZHb1Y0?= =?utf-8?B?c1FXcHRHTkoyYlg2M3JYaXh0YXdBOFNNdkNHSXhOb1EzSHJiQks3QVdZdnFC?= =?utf-8?B?cU9IYWFCY1A1OXl6a3J6c1hOM1lXRjV5cmJxRlZiU3I5TmoxZDZuUE1uQkl6?= =?utf-8?B?Y3JFV1hiMGtPcW56RWRnTDFBK0l1cWluQWpBb2dFc1pxK1Y1aTRGMnpWSFdD?= =?utf-8?B?NjVMZWxMSG5IbFhjcXpsenNUSjFsSS9paFNpVFlDbU10eVBtRXU5UXNkOW5M?= =?utf-8?Q?l674/x2nbioamhkak4WSLSRMdSMyW11V5LQkxRQ=3D?= X-Microsoft-Exchange-Diagnostics: 1; PS1PR0301MB2012; 6:v+xAyO8L/58GzZqhRdx6gs3wlCHWGh+zpSeNXN0gDopacQwYNUJ9q1AfBDbQncXbuUboea+bYBHGJDqoxP/HB+PtWU7qQMTA5frYjYxHvSgLhmr+ZWVarQ1wiMDgVsrqutb0xslchiLT51TXevTGzPGX0VqtnDCV8rl46dcNXmieaC8j5ArrB8XVgDzLbburPfPAujYh96rwJUA5SnI53vJ9b+BxjOjjq9dxFBQmiisxDv3aINXBEILt3M0frERg1mD8ldLmP5bHplvqnFyI/8whyrUYVVkVmPixKLbFXb31kignRYGZW9GbDW3P8rOw; 5:lwWGvgdN5EpIlGgvhyRC5n8ZNWFHDAMqkaT121BcERyY5kIogGMxvxCVMtQV+hZU/8xGuoSYsgqInobNZE+F4hI40smfhlSnOv8forPzMu3bo37i6egD6imLz/LZrCAk8UBIfYdczJY9fPJpYHCptg==; 24:i89xbpsfZgXkZkGLDQ3IL9YXS6kNe9/pNVFqaq0HO1QA2BZRYX/4NVQIRuNfrilXc/d6xEOSxLaKUXSH0CUrnGGElVY5R5fO3okKpZ2bQw8=; 7:Po61cz3JkrLFjtwN0sFhvia2cb7fTn/M3VKpuigO1givQ7AzsoBWrTIWhmW8eD0YRHaQK4F8BhMtSHADb/8/2hsLRNxG09XUOuXt9d69pvA0C5+BQjc2QEvyGDRzXNaLAeK4eAnU2jkJcG/i/f6N4H6r9MQgHKS94lOMnPtXb7YXg2zddXVhUvDIJVBPsOH0E6qNmb33F9/AB7xFq4p1Eu4YWZVoczw5B8t9I2lKlkZUXRcir34ZXscgR6ABtS6B SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: niksun.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2016 22:14:09.7890 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: PS1PR0301MB2012 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 22:48:17 -0000 On 08/13/2016 11:59, Baptiste Daroussin wrote: > Author: bapt > Date: Sat Aug 13 15:59:18 2016 > New Revision: 304045 > URL: https://svnweb.freebsd.org/changeset/base/304045 > > Log: > Set date and time formats back to what they were before CLDR ... This broke ko_KR.* and zh_* date formats. Try env LANG=ko_KR.UTF-8 date env LANG=zh_CN.UTF-8 date You'll see "" is repeated. Jung-uk Kim From owner-svn-src-all@freebsd.org Mon Aug 15 23:20:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B5BABBB15B; Mon, 15 Aug 2016 23:20:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CA501AAA; Mon, 15 Aug 2016 23:20:56 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FNKt5l085212; Mon, 15 Aug 2016 23:20:55 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FNKt2C085210; Mon, 15 Aug 2016 23:20:55 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608152320.u7FNKt2C085210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 15 Aug 2016 23:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304191 - head/contrib/elftoolchain/elfcopy 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.22 Precedence: list List-Id: "SVN commit messages 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, 15 Aug 2016 23:20:56 -0000 Author: emaste Date: Mon Aug 15 23:20:55 2016 New Revision: 304191 URL: https://svnweb.freebsd.org/changeset/base/304191 Log: elfcopy: correct comment typo in r304151 Modified: head/contrib/elftoolchain/elfcopy/ascii.c Modified: head/contrib/elftoolchain/elfcopy/ascii.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/ascii.c Mon Aug 15 21:44:06 2016 (r304190) +++ head/contrib/elftoolchain/elfcopy/ascii.c Mon Aug 15 23:20:55 2016 (r304191) @@ -251,7 +251,7 @@ create_elf_from_srec(struct elfcopy *ecp sec_index = 1; sec_addr = entry = 0; while (fgets(line, _LINE_BUFSZ, ifp) != NULL) { - sz = 0; /* Silence GCC 5.3 unintialized variable warning */ + sz = 0; /* Silence GCC 5.3 uninitialized variable warning */ if (line[0] == '\r' || line[0] == '\n') continue; if (line[0] == '$' && line[1] == '$') { From owner-svn-src-all@freebsd.org Tue Aug 16 00:15:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11403BBBF24; Tue, 16 Aug 2016 00:15:17 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC7A81227; Tue, 16 Aug 2016 00:15:16 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G0FGv4007175; Tue, 16 Aug 2016 00:15:16 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G0FF5M007167; Tue, 16 Aug 2016 00:15:15 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201608160015.u7G0FF5M007167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 16 Aug 2016 00:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304192 - head/share/timedef 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 00:15:17 -0000 Author: jkim Date: Tue Aug 16 00:15:15 2016 New Revision: 304192 URL: https://svnweb.freebsd.org/changeset/base/304192 Log: Fix ko_KR, zh_CN, zh_HK, and zh_TW locales. r304045 did not fully revert date/time formats for these locales. Modified: head/share/timedef/ko_KR.UTF-8.src head/share/timedef/ko_KR.eucKR.src (contents, props changed) head/share/timedef/zh_CN.GB2312.src (contents, props changed) head/share/timedef/zh_CN.GBK.src (contents, props changed) head/share/timedef/zh_CN.UTF-8.src head/share/timedef/zh_CN.eucCN.src (contents, props changed) head/share/timedef/zh_HK.UTF-8.src (contents, props changed) head/share/timedef/zh_TW.Big5.src (contents, props changed) head/share/timedef/zh_TW.UTF-8.src (contents, props changed) Modified: head/share/timedef/ko_KR.UTF-8.src ============================================================================== --- head/share/timedef/ko_KR.UTF-8.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/ko_KR.UTF-8.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names - 1ì›” - 2ì›” - 3ì›” - 4ì›” - 5ì›” - 6ì›” - 7ì›” - 8ì›” - 9ì›” -10ì›” -11ì›” -12ì›” + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) 1ì›” Modified: head/share/timedef/ko_KR.eucKR.src ============================================================================== --- head/share/timedef/ko_KR.eucKR.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/ko_KR.eucKR.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names - 1¿ù - 2¿ù - 3¿ù - 4¿ù - 5¿ù - 6¿ù - 7¿ù - 8¿ù - 9¿ù -10¿ù -11¿ù -12¿ù + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) 1¿ù Modified: head/share/timedef/zh_CN.GB2312.src ============================================================================== --- head/share/timedef/zh_CN.GB2312.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/zh_CN.GB2312.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,53 +4,53 @@ # ----------------------------------------------------------------------------- # # Short month names -!!#1TB -!!#2TB -!!#3TB -!!#4TB -!!#5TB -!!#6TB -!!#7TB -!!#8TB -!!#9TB -#1#0TB -#1#1TB -#1#2TB + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) -R;TB -6~TB -H}TB -KDTB -NeTB -AyTB -F_TB -0KTB ->ETB -J.TB -J.R;TB -J.6~TB +Ò»Ô +¶þÔ +ÈýÔ +ËÄÔ +ÎåÔ +ÁùÔ +ÆßÔ +°ËÔ +¾ÅÔ +ʮԠ+ʮһÔ +Ê®¶þÔ # # Short weekday names -V\HU -V\R; -V\6~ -V\H} -V\KD -V\Ne -V\Ay +ÖÜÈÕ +ÖÜÒ» +Öܶþ +ÖÜÈý +ÖÜËÄ +ÖÜÎå +ÖÜÁù # # Long weekday names -PGFZHU -PGFZR; -PGFZ6~ -PGFZH} -PGFZKD -PGFZNe -PGFZAy +ÐÇÆÚÈÕ +ÐÇÆÚÒ» +ÐÇÆÚ¶þ +ÐÇÆÚÈý +ÐÇÆÚËÄ +ÐÇÆÚÎå +ÐÇÆÚÁù # # X_fmt -%Hʱ%M·Ö%SÃë +%Hʱ%M·Ö%SÃë # # x_fmt %Y/%m/%d @@ -59,25 +59,25 @@ PGFZAy %a %b/%e %T %Y # # AM/PM -IONg -OBNg +ÉÏÎç +ÏÂÎç # # date_fmt -%YÄê%bÔÂ%eÈÕ %A %X %Z +%YÄê%bÔÂ%eÈÕ %A %X %Z # # Long month names (without case ending) -R;TB -6~TB -H}TB -KDTB -NeTB -AyTB -F_TB -0KTB ->ETB -J.TB -J.R;TB -J.6~TB +Ò»Ô +¶þÔ +ÈýÔ +ËÄÔ +ÎåÔ +ÁùÔ +ÆßÔ +°ËÔ +¾ÅÔ +ʮԠ+ʮһÔ +Ê®¶þÔ # # md_order md Modified: head/share/timedef/zh_CN.GBK.src ============================================================================== --- head/share/timedef/zh_CN.GBK.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/zh_CN.GBK.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names - 1Ô - 2Ô - 3Ô - 4Ô - 5Ô - 6Ô - 7Ô - 8Ô - 9Ô -10Ô -11Ô -12Ô + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) Ò»Ô Modified: head/share/timedef/zh_CN.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/zh_CN.eucCN.src ============================================================================== --- head/share/timedef/zh_CN.eucCN.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/zh_CN.eucCN.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names -¡¡£±Ô -¡¡£²Ô -¡¡£³Ô -¡¡£´Ô -¡¡£µÔ -¡¡£¶Ô -¡¡£·Ô -¡¡£¸Ô -¡¡£¹Ô -£±£°Ô -£±£±Ô -£±£²Ô + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) Ò»Ô Modified: head/share/timedef/zh_HK.UTF-8.src ============================================================================== --- head/share/timedef/zh_HK.UTF-8.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/zh_HK.UTF-8.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names - 1月 - 2月 - 3月 - 4月 - 5月 - 6月 - 7月 - 8月 - 9月 -10月 -11月 -12月 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) 1月 Modified: head/share/timedef/zh_TW.Big5.src ============================================================================== --- head/share/timedef/zh_TW.Big5.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/zh_TW.Big5.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,32 +4,32 @@ # ----------------------------------------------------------------------------- # # Short month names -¡@¢°¤ë -¡@¢±¤ë -¡@¢²¤ë -¡@¢³¤ë -¡@¢´¤ë -¡@¢µ¤ë -¡@¢¶¤ë -¡@¢·¤ë -¡@¢¸¤ë -¢°¢¯¤ë -¢°¢°¤ë -¢°¢±¤ë + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) -¢°¤ë -¢±¤ë -¢²¤ë -¢³¤ë -¢´¤ë -¢µ¤ë -¢¶¤ë -¢·¤ë -¢¸¤ë -¢°¢¯¤ë -¢°¢°¤ë -¢°¢±¤ë +1¤ë +2¤ë +3¤ë +4¤ë +5¤ë +6¤ë +7¤ë +8¤ë +9¤ë +10¤ë +11¤ë +12¤ë # # Short weekday names ¶g¤é @@ -62,21 +62,22 @@ ¤W¤È ¤U¤È # +# date_fmt %Y¦~%b¤ë%e¤é %A %X %Z # # Long month names (without case ending) -¢°¤ë -¢±¤ë -¢²¤ë -¢³¤ë -¢´¤ë -¢µ¤ë -¢¶¤ë -¢·¤ë -¢¸¤ë -¢°¢¯¤ë -¢°¢°¤ë -¢°¢±¤ë +1¤ë +2¤ë +3¤ë +4¤ë +5¤ë +6¤ë +7¤ë +8¤ë +9¤ë +10¤ë +11¤ë +12¤ë # # md_order md Modified: head/share/timedef/zh_TW.UTF-8.src ============================================================================== --- head/share/timedef/zh_TW.UTF-8.src Mon Aug 15 23:20:55 2016 (r304191) +++ head/share/timedef/zh_TW.UTF-8.src Tue Aug 16 00:15:15 2016 (r304192) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names - 1月 - 2月 - 3月 - 4月 - 5月 - 6月 - 7月 - 8月 - 9月 -10月 -11月 -12月 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 +10 +11 +12 # # Long month names (as in a date) 1月 From owner-svn-src-all@freebsd.org Tue Aug 16 00:48:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9DD2BBA698; Tue, 16 Aug 2016 00:48:14 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A95091FA1; Tue, 16 Aug 2016 00:48:14 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G0mDLr018205; Tue, 16 Aug 2016 00:48:13 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G0mDMl018204; Tue, 16 Aug 2016 00:48:13 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201608160048.u7G0mDMl018204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Tue, 16 Aug 2016 00:48:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304194 - head/usr.bin/nfsstat 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 00:48:15 -0000 Author: rmacklem Date: Tue Aug 16 00:48:13 2016 New Revision: 304194 URL: https://svnweb.freebsd.org/changeset/base/304194 Log: Fix r304026 so that it builds for gcc. Reported by: np Tested by: np MFC after: 1 month Modified: head/usr.bin/nfsstat/nfsstat.c Modified: head/usr.bin/nfsstat/nfsstat.c ============================================================================== --- head/usr.bin/nfsstat/nfsstat.c Tue Aug 16 00:40:38 2016 (r304193) +++ head/usr.bin/nfsstat/nfsstat.c Tue Aug 16 00:48:13 2016 (r304194) @@ -130,7 +130,8 @@ static void compute_new_stats(struct nfs struct stattypes { int stat_type; int nfs_type; -} static statstruct[] = { +}; +static struct stattypes statstruct[] = { {STAT_TYPE_READ, NFSV4OP_READ}, {STAT_TYPE_WRITE, NFSV4OP_WRITE}, {STAT_TYPE_COMMIT, NFSV4OP_COMMIT} From owner-svn-src-all@freebsd.org Tue Aug 16 02:14:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51016BBBE5F; Tue, 16 Aug 2016 02:14:39 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA2B91610; Tue, 16 Aug 2016 02:14:38 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G2Ebib051095; Tue, 16 Aug 2016 02:14:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G2EbAp051094; Tue, 16 Aug 2016 02:14:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608160214.u7G2EbAp051094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 02:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304195 - head/cddl/contrib/opensolaris/lib/libdtrace/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 02:14:39 -0000 Author: markj Date: Tue Aug 16 02:14:36 2016 New Revision: 304195 URL: https://svnweb.freebsd.org/changeset/base/304195 Log: MFV r304056: 5396 fix longjmp clobbering errors illumos/illumos-gate@67a4bb8f9ad4c49e9aa9e21e2114a7c093c3a73a Reviewed by: Josef 'Jeff' Sipek Reviewed by: Igor Kozhukhov Approved by: Richard Lowe Author: Gary Mills Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Tue Aug 16 00:48:13 2016 (r304194) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Tue Aug 16 02:14:36 2016 (r304195) @@ -23,6 +23,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright 2015 Gary Mills */ /* @@ -2435,7 +2436,7 @@ dt_compile(dtrace_hdl_t *dtp, int contex dt_node_t *dnp; dt_decl_t *ddp; dt_pcb_t pcb; - void *rv; + void *volatile rv; int err; if ((fp == NULL && s == NULL) || (cflags & ~DTRACE_C_MASK) != 0) { From owner-svn-src-all@freebsd.org Tue Aug 16 02:16:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4FDCBBBF16; Tue, 16 Aug 2016 02:16:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98C6F1877; Tue, 16 Aug 2016 02:16:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G2GsB3051248; Tue, 16 Aug 2016 02:16:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G2GsUV051244; Tue, 16 Aug 2016 02:16:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608160216.u7G2GsUV051244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 02:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304196 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars sys/cddl/contrib/opensolaris/uts/common/dtrace 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 02:16:55 -0000 Author: markj Date: Tue Aug 16 02:16:54 2016 New Revision: 304196 URL: https://svnweb.freebsd.org/changeset/base/304196 Log: MFV r296989: 6734 dtrace_canstore_statvar() fails for some valid static variables Reviewed by: Dan McDonald Approved by: Richard Lowe Author: Bryan Cantrill illumos/illumos-gate@d65f2bb4e50559c6c375a2aa9f728cbc34379015 MFC after: 2 weeks Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d - copied unchanged from r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d - copied unchanged from r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d (from r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d Tue Aug 16 02:16:54 2016 (r304196, copy of r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16kglobal.d) @@ -0,0 +1,32 @@ +/* + * 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. + */ + +/* + * Copyright (c) 2016, Joyent, Inc. All rights reserved. + */ + +#pragma D option strsize=16k + +char *k; + +BEGIN +{ + j = probeprov; + k = j; + k[0] = 'D'; + k[1] = 'T'; +} + +BEGIN +{ + trace(stringof(k)); + exit(k == "DTrace" ? 0 : 1); +} Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d (from r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d Tue Aug 16 02:16:54 2016 (r304196, copy of r296989, vendor/illumos/dist/cmd/dtrace/test/tst/common/scalars/tst.16klocal.d) @@ -0,0 +1,29 @@ +/* + * 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. + */ + +/* + * Copyright (c) 2016, Joyent, Inc. All rights reserved. + */ + +#pragma D option strsize=16k + +BEGIN +{ + this->j = probeprov; + this->j[0] = 'D'; + this->j[1] = 'T'; +} + +BEGIN +{ + trace(this->j); + exit(this->j == "DTrace" ? 0 : 1); +} Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:14:36 2016 (r304195) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:16:54 2016 (r304196) @@ -707,8 +707,8 @@ dtrace_canstore_statvar(uint64_t addr, s if (nsvars == 0) return (0); - maxglobalsize = dtrace_statvar_maxsize; - maxlocalsize = (maxglobalsize + sizeof (uint64_t)) * NCPU; + maxglobalsize = dtrace_statvar_maxsize + sizeof (uint64_t); + maxlocalsize = maxglobalsize * NCPU; for (i = 0; i < nsvars; i++) { dtrace_statvar_t *svar = svars[i]; @@ -726,8 +726,8 @@ dtrace_canstore_statvar(uint64_t addr, s * DTrace to escalate an orthogonal kernel heap corruption bug * into the ability to store to arbitrary locations in memory. */ - VERIFY((scope == DIFV_SCOPE_GLOBAL && size < maxglobalsize) || - (scope == DIFV_SCOPE_LOCAL && size < maxlocalsize)); + VERIFY((scope == DIFV_SCOPE_GLOBAL && size <= maxglobalsize) || + (scope == DIFV_SCOPE_LOCAL && size <= maxlocalsize)); if (DTRACE_INRANGE(addr, sz, svar->dtsv_data, svar->dtsv_size)) return (1); From owner-svn-src-all@freebsd.org Tue Aug 16 02:18:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65958BBBFD7; Tue, 16 Aug 2016 02:18:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D42E19FE; Tue, 16 Aug 2016 02:18:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G2IYwJ051358; Tue, 16 Aug 2016 02:18:34 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G2IYDj051357; Tue, 16 Aug 2016 02:18:34 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608160218.u7G2IYDj051357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 02:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304197 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 02:18:35 -0000 Author: markj Date: Tue Aug 16 02:18:34 2016 New Revision: 304197 URL: https://svnweb.freebsd.org/changeset/base/304197 Log: MFV r301524: 7034 negative record sizes should be rejected Reviewed by: Patrick Mooney Reviewed by: Bryan Cantrill Approved by: Matthew Ahrens Author: Alex Wilson illumos/illumos-gate@0b8049bfb0e291160e960697b554596289d7f0bc MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:16:54 2016 (r304196) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:18:34 2016 (r304197) @@ -11017,7 +11017,7 @@ dtrace_ecb_enable(dtrace_ecb_t *ecb) } } -static void +static int dtrace_ecb_resize(dtrace_ecb_t *ecb) { dtrace_action_t *act; @@ -11051,6 +11051,8 @@ dtrace_ecb_resize(dtrace_ecb_t *ecb) curneeded = P2ROUNDUP(curneeded, rec->dtrd_alignment); rec->dtrd_offset = curneeded; + if (curneeded + rec->dtrd_size < curneeded) + return (EINVAL); curneeded += rec->dtrd_size; ecb->dte_needed = MAX(ecb->dte_needed, curneeded); @@ -11075,6 +11077,8 @@ dtrace_ecb_resize(dtrace_ecb_t *ecb) } curneeded = P2ROUNDUP(curneeded, rec->dtrd_alignment); rec->dtrd_offset = curneeded; + if (curneeded + rec->dtrd_size < curneeded) + return (EINVAL); curneeded += rec->dtrd_size; } else { /* tuples must be followed by an aggregation */ @@ -11084,6 +11088,8 @@ dtrace_ecb_resize(dtrace_ecb_t *ecb) ecb->dte_size = P2ROUNDUP(ecb->dte_size, rec->dtrd_alignment); rec->dtrd_offset = ecb->dte_size; + if (ecb->dte_size + rec->dtrd_size < ecb->dte_size) + return (EINVAL); ecb->dte_size += rec->dtrd_size; ecb->dte_needed = MAX(ecb->dte_needed, ecb->dte_size); } @@ -11103,6 +11109,7 @@ dtrace_ecb_resize(dtrace_ecb_t *ecb) ecb->dte_needed = P2ROUNDUP(ecb->dte_needed, (sizeof (dtrace_epid_t))); ecb->dte_state->dts_needed = MAX(ecb->dte_state->dts_needed, ecb->dte_needed); + return (0); } static dtrace_action_t * @@ -11788,7 +11795,10 @@ dtrace_ecb_create(dtrace_state_t *state, } } - dtrace_ecb_resize(ecb); + if ((enab->dten_error = dtrace_ecb_resize(ecb)) != 0) { + dtrace_ecb_destroy(ecb); + return (NULL); + } return (dtrace_ecb_create_cache = ecb); } From owner-svn-src-all@freebsd.org Tue Aug 16 02:20:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A57FBBA04F; Tue, 16 Aug 2016 02:20:03 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 093701BCB; Tue, 16 Aug 2016 02:20:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G2K2gU051483; Tue, 16 Aug 2016 02:20:02 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G2K2Yu051482; Tue, 16 Aug 2016 02:20:02 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608160220.u7G2K2Yu051482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 02:20:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304198 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 02:20:03 -0000 Author: markj Date: Tue Aug 16 02:20:02 2016 New Revision: 304198 URL: https://svnweb.freebsd.org/changeset/base/304198 Log: MFV r301525: 7033 ustack helper should fault on bad return values Reviewed by: Patrick Mooney Reviewed by: Bryan Cantrill Approved by: Matthew Ahrens Author: Alex Wilson illumos/illumos-gate@a2f72b65ebc430aaf277ad797e554bb4deba9b95 MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:18:34 2016 (r304197) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:20:02 2016 (r304198) @@ -6929,6 +6929,7 @@ dtrace_action_ustack(dtrace_mstate_t *ms uint64_t *pcs = &buf[1], *fps; char *str = (char *)&pcs[nframes]; int size, offs = 0, i, j; + size_t rem; uintptr_t old = mstate->dtms_scratch_ptr, saved; uint16_t *flags = &cpu_core[curcpu].cpuc_dtrace_flags; char *sym; @@ -7000,12 +7001,18 @@ dtrace_action_ustack(dtrace_mstate_t *ms continue; } + if (!dtrace_strcanload((uintptr_t)sym, strsize, &rem, mstate, + &(state->dts_vstate))) { + str[offs++] = '\0'; + continue; + } + DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); /* * Now copy in the string that the helper returned to us. */ - for (j = 0; offs + j < strsize; j++) { + for (j = 0; offs + j < strsize && j < rem; j++) { if ((str[offs + j] = sym[j]) == '\0') break; } From owner-svn-src-all@freebsd.org Tue Aug 16 02:25:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C59BBA215; Tue, 16 Aug 2016 02:25:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E03811F9A; Tue, 16 Aug 2016 02:25:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G2PKh3054941; Tue, 16 Aug 2016 02:25:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G2PKZI054939; Tue, 16 Aug 2016 02:25:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608160225.u7G2PKZI054939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 02:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304199 - in head/sys/cddl/contrib/opensolaris/uts/common: dtrace 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 02:25:21 -0000 Author: markj Date: Tue Aug 16 02:25:19 2016 New Revision: 304199 URL: https://svnweb.freebsd.org/changeset/base/304199 Log: MFV r301526: 7035 string-related subroutines should validate input earlier Reviewed by: Alex Wilson Reviewed by: Bryan Cantrill Approved by: Matthew Ahrens Author: Patrick Mooney illumos/illumos-gate@771e39c3b1d6e2e0ba230442d782d83c60098296 MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:20:02 2016 (r304198) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Tue Aug 16 02:25:19 2016 (r304199) @@ -480,6 +480,14 @@ static kmutex_t dtrace_errlock; (testaddr) + (testsz) - (uintptr_t)(baseaddr) <= (basesz) && \ (testaddr) + (testsz) >= (testaddr)) +#define DTRACE_RANGE_REMAIN(remp, addr, baseaddr, basesz) \ +do { \ + if ((remp) != NULL) { \ + *(remp) = (uintptr_t)(baseaddr) + (basesz) - (addr); \ + } \ +_NOTE(CONSTCOND) } while (0) + + /* * Test whether alloc_sz bytes will fit in the scratch region. We isolate * alloc_sz on the righthand side of the comparison in order to avoid overflow @@ -588,6 +596,10 @@ dtrace_dynvar_t *dtrace_dynvar(dtrace_ds uintptr_t dtrace_dif_varstr(uintptr_t, dtrace_state_t *, dtrace_mstate_t *); static int dtrace_priv_proc(dtrace_state_t *); static void dtrace_getf_barrier(void); +static int dtrace_canload_remains(uint64_t, size_t, size_t *, + dtrace_mstate_t *, dtrace_vstate_t *); +static int dtrace_canstore_remains(uint64_t, size_t, size_t *, + dtrace_mstate_t *, dtrace_vstate_t *); /* * DTrace Probe Context Functions @@ -698,7 +710,7 @@ dtrace_inscratch(uintptr_t dest, size_t } static int -dtrace_canstore_statvar(uint64_t addr, size_t sz, +dtrace_canstore_statvar(uint64_t addr, size_t sz, size_t *remain, dtrace_statvar_t **svars, int nsvars) { int i; @@ -729,8 +741,12 @@ dtrace_canstore_statvar(uint64_t addr, s VERIFY((scope == DIFV_SCOPE_GLOBAL && size <= maxglobalsize) || (scope == DIFV_SCOPE_LOCAL && size <= maxlocalsize)); - if (DTRACE_INRANGE(addr, sz, svar->dtsv_data, svar->dtsv_size)) + if (DTRACE_INRANGE(addr, sz, svar->dtsv_data, + svar->dtsv_size)) { + DTRACE_RANGE_REMAIN(remain, addr, svar->dtsv_data, + svar->dtsv_size); return (1); + } } return (0); @@ -746,12 +762,26 @@ static int dtrace_canstore(uint64_t addr, size_t sz, dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) { + return (dtrace_canstore_remains(addr, sz, NULL, mstate, vstate)); +} + +/* + * Implementation of dtrace_canstore which communicates the upper bound of the + * allowed memory region. + */ +static int +dtrace_canstore_remains(uint64_t addr, size_t sz, size_t *remain, + dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) +{ /* * First, check to see if the address is in scratch space... */ if (DTRACE_INRANGE(addr, sz, mstate->dtms_scratch_base, - mstate->dtms_scratch_size)) + mstate->dtms_scratch_size)) { + DTRACE_RANGE_REMAIN(remain, addr, mstate->dtms_scratch_base, + mstate->dtms_scratch_size); return (1); + } /* * Now check to see if it's a dynamic variable. This check will pick @@ -804,6 +834,7 @@ dtrace_canstore(uint64_t addr, size_t sz ((dvar->dtdv_tuple.dtt_nkeys - 1) * sizeof (dtrace_key_t))) return (0); + DTRACE_RANGE_REMAIN(remain, addr, dvar, dstate->dtds_chunksize); return (1); } @@ -811,11 +842,11 @@ dtrace_canstore(uint64_t addr, size_t sz * Finally, check the static local and global variables. These checks * take the longest, so we perform them last. */ - if (dtrace_canstore_statvar(addr, sz, + if (dtrace_canstore_statvar(addr, sz, remain, vstate->dtvs_locals, vstate->dtvs_nlocals)) return (1); - if (dtrace_canstore_statvar(addr, sz, + if (dtrace_canstore_statvar(addr, sz, remain, vstate->dtvs_globals, vstate->dtvs_nglobals)) return (1); @@ -836,6 +867,17 @@ static int dtrace_canload(uint64_t addr, size_t sz, dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) { + return (dtrace_canload_remains(addr, sz, NULL, mstate, vstate)); +} + +/* + * Implementation of dtrace_canload which communicates the uppoer bound of the + * allowed memory region. + */ +static int +dtrace_canload_remains(uint64_t addr, size_t sz, size_t *remain, + dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) +{ volatile uintptr_t *illval = &cpu_core[curcpu].cpuc_dtrace_illval; file_t *fp; @@ -843,21 +885,27 @@ dtrace_canload(uint64_t addr, size_t sz, * If we hold the privilege to read from kernel memory, then * everything is readable. */ - if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) + if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) { + DTRACE_RANGE_REMAIN(remain, addr, addr, sz); return (1); + } /* * You can obviously read that which you can store. */ - if (dtrace_canstore(addr, sz, mstate, vstate)) + if (dtrace_canstore_remains(addr, sz, remain, mstate, vstate)) return (1); /* * We're allowed to read from our own string table. */ if (DTRACE_INRANGE(addr, sz, mstate->dtms_difo->dtdo_strtab, - mstate->dtms_difo->dtdo_strlen)) + mstate->dtms_difo->dtdo_strlen)) { + DTRACE_RANGE_REMAIN(remain, addr, + mstate->dtms_difo->dtdo_strtab, + mstate->dtms_difo->dtdo_strlen); return (1); + } if (vstate->dtvs_state != NULL && dtrace_priv_proc(vstate->dtvs_state)) { @@ -879,27 +927,38 @@ dtrace_canload(uint64_t addr, size_t sz, * deallocated and reallocated as something else while it's * being operated upon. */ - if (DTRACE_INRANGE(addr, sz, curthread, sizeof (kthread_t))) + if (DTRACE_INRANGE(addr, sz, curthread, sizeof (kthread_t))) { + DTRACE_RANGE_REMAIN(remain, addr, curthread, + sizeof (kthread_t)); return (1); + } if ((p = curthread->t_procp) != NULL && DTRACE_INRANGE(addr, sz, curthread->t_procp, sizeof (proc_t))) { + DTRACE_RANGE_REMAIN(remain, addr, curthread->t_procp, + sizeof (proc_t)); return (1); } if (curthread->t_cred != NULL && DTRACE_INRANGE(addr, sz, curthread->t_cred, sizeof (cred_t))) { + DTRACE_RANGE_REMAIN(remain, addr, curthread->t_cred, + sizeof (cred_t)); return (1); } #ifdef illumos if (p != NULL && p->p_pidp != NULL && DTRACE_INRANGE(addr, sz, &(p->p_pidp->pid_id), sizeof (pid_t))) { + DTRACE_RANGE_REMAIN(remain, addr, &(p->p_pidp->pid_id), + sizeof (pid_t)); return (1); } if (curthread->t_cpu != NULL && DTRACE_INRANGE(addr, sz, curthread->t_cpu, offsetof(cpu_t, cpu_pause_thread))) { + DTRACE_RANGE_REMAIN(remain, addr, curthread->t_cpu, + offsetof(cpu_t, cpu_pause_thread)); return (1); } #endif @@ -922,31 +981,46 @@ dtrace_canload(uint64_t addr, size_t sz, * either dtms_getf itself or its f_vnode member to reference * freed memory). */ - if (DTRACE_INRANGE(addr, sz, fp, sizeof (file_t))) + if (DTRACE_INRANGE(addr, sz, fp, sizeof (file_t))) { + DTRACE_RANGE_REMAIN(remain, addr, fp, sizeof (file_t)); return (1); + } if ((vp = fp->f_vnode) != NULL) { + size_t slen; #ifdef illumos - if (DTRACE_INRANGE(addr, sz, &vp->v_path, psz)) + if (DTRACE_INRANGE(addr, sz, &vp->v_path, psz)) { + DTRACE_RANGE_REMAIN(remain, addr, &vp->v_path, + psz); return (1); - if (vp->v_path != NULL && DTRACE_INRANGE(addr, sz, - vp->v_path, strlen(vp->v_path) + 1)) { + } + slen = strlen(vp->v_path) + 1; + if (DTRACE_INRANGE(addr, sz, vp->v_path, slen)) { + DTRACE_RANGE_REMAIN(remain, addr, vp->v_path, + slen); return (1); } #endif - if (DTRACE_INRANGE(addr, sz, &vp->v_op, psz)) + if (DTRACE_INRANGE(addr, sz, &vp->v_op, psz)) { + DTRACE_RANGE_REMAIN(remain, addr, &vp->v_op, + psz); return (1); + } #ifdef illumos if ((op = vp->v_op) != NULL && DTRACE_INRANGE(addr, sz, &op->vnop_name, psz)) { + DTRACE_RANGE_REMAIN(remain, addr, + &op->vnop_name, psz); return (1); } if (op != NULL && op->vnop_name != NULL && DTRACE_INRANGE(addr, sz, op->vnop_name, - strlen(op->vnop_name) + 1)) { + (slen = strlen(op->vnop_name) + 1))) { + DTRACE_RANGE_REMAIN(remain, addr, + op->vnop_name, slen); return (1); } #endif @@ -965,21 +1039,41 @@ dtrace_canload(uint64_t addr, size_t sz, * calls in the event that the user has all privileges. */ static int -dtrace_strcanload(uint64_t addr, size_t sz, dtrace_mstate_t *mstate, - dtrace_vstate_t *vstate) +dtrace_strcanload(uint64_t addr, size_t sz, size_t *remain, + dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) { - size_t strsz; + size_t rsize; /* * If we hold the privilege to read from kernel memory, then * everything is readable. */ - if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) + if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) { + DTRACE_RANGE_REMAIN(remain, addr, addr, sz); return (1); + } - strsz = 1 + dtrace_strlen((char *)(uintptr_t)addr, sz); - if (dtrace_canload(addr, strsz, mstate, vstate)) - return (1); + /* + * Even if the caller is uninterested in querying the remaining valid + * range, it is required to ensure that the access is allowed. + */ + if (remain == NULL) { + remain = &rsize; + } + if (dtrace_canload_remains(addr, 0, remain, mstate, vstate)) { + size_t strsz; + /* + * Perform the strlen after determining the length of the + * memory region which is accessible. This prevents timing + * information from being used to find NULs in memory which is + * not accessible to the caller. + */ + strsz = 1 + dtrace_strlen((char *)(uintptr_t)addr, + MIN(sz, *remain)); + if (strsz <= *remain) { + return (1); + } + } return (0); } @@ -989,26 +1083,49 @@ dtrace_strcanload(uint64_t addr, size_t * region in which a load may be issued given the user's privilege level. */ static int -dtrace_vcanload(void *src, dtrace_diftype_t *type, dtrace_mstate_t *mstate, - dtrace_vstate_t *vstate) +dtrace_vcanload(void *src, dtrace_diftype_t *type, size_t *remain, + dtrace_mstate_t *mstate, dtrace_vstate_t *vstate) { size_t sz; ASSERT(type->dtdt_flags & DIF_TF_BYREF); /* + * Calculate the max size before performing any checks since even + * DTRACE_ACCESS_KERNEL-credentialed callers expect that this function + * return the max length via 'remain'. + */ + if (type->dtdt_kind == DIF_TYPE_STRING) { + dtrace_state_t *state = vstate->dtvs_state; + + if (state != NULL) { + sz = state->dts_options[DTRACEOPT_STRSIZE]; + } else { + /* + * In helper context, we have a NULL state; fall back + * to using the system-wide default for the string size + * in this case. + */ + sz = dtrace_strsize_default; + } + } else { + sz = type->dtdt_size; + } + + /* * If we hold the privilege to read from kernel memory, then * everything is readable. */ - if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) + if ((mstate->dtms_access & DTRACE_ACCESS_KERNEL) != 0) { + DTRACE_RANGE_REMAIN(remain, (uintptr_t)src, src, sz); return (1); + } - if (type->dtdt_kind == DIF_TYPE_STRING) - sz = dtrace_strlen(src, - vstate->dtvs_state->dts_options[DTRACEOPT_STRSIZE]) + 1; - else - sz = type->dtdt_size; - - return (dtrace_canload((uintptr_t)src, sz, mstate, vstate)); + if (type->dtdt_kind == DIF_TYPE_STRING) { + return (dtrace_strcanload((uintptr_t)src, sz, remain, mstate, + vstate)); + } + return (dtrace_canload_remains((uintptr_t)src, sz, remain, mstate, + vstate)); } /* @@ -1198,14 +1315,14 @@ dtrace_strcpy(const void *src, void *dst * specified type; we assume that we can store to directly. */ static void -dtrace_vcopy(void *src, void *dst, dtrace_diftype_t *type) +dtrace_vcopy(void *src, void *dst, dtrace_diftype_t *type, size_t limit) { ASSERT(type->dtdt_flags & DIF_TF_BYREF); if (type->dtdt_kind == DIF_TYPE_STRING) { - dtrace_strcpy(src, dst, type->dtdt_size); + dtrace_strcpy(src, dst, MIN(type->dtdt_size, limit)); } else { - dtrace_bcopy(src, dst, type->dtdt_size); + dtrace_bcopy(src, dst, MIN(type->dtdt_size, limit)); } } @@ -4503,31 +4620,30 @@ dtrace_dif_subr(uint_t subr, uint_t rd, uintptr_t kaddr = tupregs[0].dttk_value; uintptr_t uaddr = tupregs[1].dttk_value; uint64_t size = tupregs[2].dttk_value; + size_t lim; if (!dtrace_destructive_disallow && dtrace_priv_proc_control(state) && !dtrace_istoxic(kaddr, size) && - dtrace_strcanload(kaddr, size, mstate, vstate)) { + dtrace_strcanload(kaddr, size, &lim, mstate, vstate)) { DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); - dtrace_copyoutstr(kaddr, uaddr, size, flags); + dtrace_copyoutstr(kaddr, uaddr, lim, flags); DTRACE_CPUFLAG_CLEAR(CPU_DTRACE_NOFAULT); } break; } case DIF_SUBR_STRLEN: { - size_t sz; + size_t size = state->dts_options[DTRACEOPT_STRSIZE]; uintptr_t addr = (uintptr_t)tupregs[0].dttk_value; - sz = dtrace_strlen((char *)addr, - state->dts_options[DTRACEOPT_STRSIZE]); + size_t lim; - if (!dtrace_canload(addr, sz + 1, mstate, vstate)) { + if (!dtrace_strcanload(addr, size, &lim, mstate, vstate)) { regs[rd] = 0; break; } - regs[rd] = sz; - + regs[rd] = dtrace_strlen((char *)addr, lim); break; } @@ -4540,12 +4656,19 @@ dtrace_dif_subr(uint_t subr, uint_t rd, * is DIF_SUBR_STRRCHR, we will look for the last occurrence * of the specified character instead of the first. */ - uintptr_t saddr = tupregs[0].dttk_value; uintptr_t addr = tupregs[0].dttk_value; - uintptr_t limit = addr + state->dts_options[DTRACEOPT_STRSIZE]; + uintptr_t addr_limit; + uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; + size_t lim; char c, target = (char)tupregs[1].dttk_value; - for (regs[rd] = 0; addr < limit; addr++) { + if (!dtrace_strcanload(addr, size, &lim, mstate, vstate)) { + regs[rd] = 0; + break; + } + addr_limit = addr + lim; + + for (regs[rd] = 0; addr < addr_limit; addr++) { if ((c = dtrace_load8(addr)) == target) { regs[rd] = addr; @@ -4556,12 +4679,6 @@ dtrace_dif_subr(uint_t subr, uint_t rd, if (c == '\0') break; } - - if (!dtrace_canload(saddr, addr - saddr, mstate, vstate)) { - regs[rd] = 0; - break; - } - break; } @@ -4719,7 +4836,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, uintptr_t addr = tupregs[0].dttk_value; uintptr_t tokaddr = tupregs[1].dttk_value; uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; - uintptr_t limit, toklimit = tokaddr + size; + uintptr_t limit, toklimit; + size_t clim; uint8_t c = 0, tokmap[32]; /* 256 / 8 */ char *dest = (char *)mstate->dtms_scratch_ptr; int i; @@ -4728,10 +4846,11 @@ dtrace_dif_subr(uint_t subr, uint_t rd, * Check both the token buffer and (later) the input buffer, * since both could be non-scratch addresses. */ - if (!dtrace_strcanload(tokaddr, size, mstate, vstate)) { + if (!dtrace_strcanload(tokaddr, size, &clim, mstate, vstate)) { regs[rd] = 0; break; } + toklimit = tokaddr + clim; if (!DTRACE_INSCRATCH(mstate, size)) { DTRACE_CPUFLAG_SET(CPU_DTRACE_NOSCRATCH); @@ -4748,6 +4867,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, * it behaves like an implicit clause-local variable. */ addr = mstate->dtms_strtok; + limit = mstate->dtms_strtok_limit; } else { /* * If the user-specified address is non-NULL we must @@ -4757,10 +4877,12 @@ dtrace_dif_subr(uint_t subr, uint_t rd, * (when we fetch addr from mstate->dtms_strtok) * would fail this access check. */ - if (!dtrace_strcanload(addr, size, mstate, vstate)) { + if (!dtrace_strcanload(addr, size, &clim, mstate, + vstate)) { regs[rd] = 0; break; } + limit = addr + clim; } /* @@ -4779,10 +4901,10 @@ dtrace_dif_subr(uint_t subr, uint_t rd, tokmap[c >> 3] |= (1 << (c & 0x7)); } - for (limit = addr + size; addr < limit; addr++) { + for (; addr < limit; addr++) { /* - * We're looking for a character that is _not_ contained - * in the token string. + * We're looking for a character that is _not_ + * contained in the token string. */ if ((c = dtrace_load8(addr)) == '\0') break; @@ -4800,6 +4922,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, */ regs[rd] = 0; mstate->dtms_strtok = 0; + mstate->dtms_strtok_limit = 0; break; } @@ -4822,6 +4945,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, regs[rd] = (uintptr_t)dest; mstate->dtms_scratch_ptr += size; mstate->dtms_strtok = addr; + mstate->dtms_strtok_limit = limit; break; } @@ -5199,10 +5323,12 @@ dtrace_dif_subr(uint_t subr, uint_t rd, uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; uintptr_t s1 = tupregs[0].dttk_value; uintptr_t s2 = tupregs[1].dttk_value; - int i = 0; + int i = 0, j = 0; + size_t lim1, lim2; + char c; - if (!dtrace_strcanload(s1, size, mstate, vstate) || - !dtrace_strcanload(s2, size, mstate, vstate)) { + if (!dtrace_strcanload(s1, size, &lim1, mstate, vstate) || + !dtrace_strcanload(s2, size, &lim2, mstate, vstate)) { regs[rd] = 0; break; } @@ -5219,8 +5345,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, regs[rd] = 0; break; } - - if ((d[i++] = dtrace_load8(s1++)) == '\0') { + c = (i >= lim1) ? '\0' : dtrace_load8(s1++); + if ((d[i++] = c) == '\0') { i--; break; } @@ -5233,7 +5359,8 @@ dtrace_dif_subr(uint_t subr, uint_t rd, break; } - if ((d[i++] = dtrace_load8(s2++)) == '\0') + c = (j++ >= lim2) ? '\0' : dtrace_load8(s2++); + if ((d[i++] = c) == '\0') break; } @@ -5248,6 +5375,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, case DIF_SUBR_STRTOLL: { uintptr_t s = tupregs[0].dttk_value; uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; + size_t lim; int base = 10; if (nargs > 1) { @@ -5258,12 +5386,12 @@ dtrace_dif_subr(uint_t subr, uint_t rd, } } - if (!dtrace_strcanload(s, size, mstate, vstate)) { + if (!dtrace_strcanload(s, size, &lim, mstate, vstate)) { regs[rd] = INT64_MIN; break; } - regs[rd] = dtrace_strtoll((char *)s, base, size); + regs[rd] = dtrace_strtoll((char *)s, base, lim); break; } @@ -5498,12 +5626,13 @@ dtrace_dif_subr(uint_t subr, uint_t rd, char *dest = (char *)mstate->dtms_scratch_ptr, c; uint64_t size = state->dts_options[DTRACEOPT_STRSIZE]; uintptr_t src = tupregs[0].dttk_value; + size_t lim; int i = 0, j = 0; #ifdef illumos zone_t *z; #endif - if (!dtrace_strcanload(src, size, mstate, vstate)) { + if (!dtrace_strcanload(src, size, &lim, mstate, vstate)) { regs[rd] = 0; break; } @@ -5518,7 +5647,7 @@ dtrace_dif_subr(uint_t subr, uint_t rd, * Move forward, loading each character. */ do { - c = dtrace_load8(src + i++); + c = (i >= lim) ? '\0' : dtrace_load8(src + i++); next: if (j + 5 >= size) /* 5 = strlen("/..c\0") */ break; @@ -5528,7 +5657,7 @@ next: continue; } - c = dtrace_load8(src + i++); + c = (i >= lim) ? '\0' : dtrace_load8(src + i++); if (c == '/') { /* @@ -5549,7 +5678,7 @@ next: continue; } - c = dtrace_load8(src + i++); + c = (i >= lim) ? '\0' : dtrace_load8(src + i++); if (c == '/') { /* @@ -5572,7 +5701,7 @@ next: continue; } - c = dtrace_load8(src + i++); + c = (i >= lim) ? '\0' : dtrace_load8(src + i++); if (c != '/' && c != '\0') { /* @@ -6211,15 +6340,17 @@ dtrace_dif_emulate(dtrace_difo_t *difo, size_t sz = state->dts_options[DTRACEOPT_STRSIZE]; uintptr_t s1 = regs[r1]; uintptr_t s2 = regs[r2]; + size_t lim1, lim2; if (s1 != 0 && - !dtrace_strcanload(s1, sz, mstate, vstate)) + !dtrace_strcanload(s1, sz, &lim1, mstate, vstate)) break; if (s2 != 0 && - !dtrace_strcanload(s2, sz, mstate, vstate)) + !dtrace_strcanload(s2, sz, &lim2, mstate, vstate)) break; - cc_r = dtrace_strncmp((char *)s1, (char *)s2, sz); + cc_r = dtrace_strncmp((char *)s1, (char *)s2, + MIN(lim1, lim2)); cc_n = cc_r < 0; cc_z = cc_r == 0; @@ -6278,6 +6409,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) { uintptr_t a = (uintptr_t)svar->dtsv_data; + size_t lim; ASSERT(a != 0); ASSERT(svar->dtsv_size != 0); @@ -6291,11 +6423,11 @@ dtrace_dif_emulate(dtrace_difo_t *difo, } if (!dtrace_vcanload( (void *)(uintptr_t)regs[rd], &v->dtdv_type, - mstate, vstate)) + &lim, mstate, vstate)) break; dtrace_vcopy((void *)(uintptr_t)regs[rd], - (void *)a, &v->dtdv_type); + (void *)a, &v->dtdv_type, lim); break; } @@ -6334,6 +6466,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) { uintptr_t a = (uintptr_t)svar->dtsv_data; size_t sz = v->dtdv_type.dtdt_size; + size_t lim; sz += sizeof (uint64_t); ASSERT(svar->dtsv_size == NCPU * sz); @@ -6373,6 +6506,7 @@ dtrace_dif_emulate(dtrace_difo_t *difo, if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) { uintptr_t a = (uintptr_t)svar->dtsv_data; size_t sz = v->dtdv_type.dtdt_size; + size_t lim; sz += sizeof (uint64_t); ASSERT(svar->dtsv_size == NCPU * sz); @@ -6388,11 +6522,11 @@ dtrace_dif_emulate(dtrace_difo_t *difo, if (!dtrace_vcanload( (void *)(uintptr_t)regs[rd], &v->dtdv_type, - mstate, vstate)) + &lim, mstate, vstate)) break; dtrace_vcopy((void *)(uintptr_t)regs[rd], - (void *)a, &v->dtdv_type); + (void *)a, &v->dtdv_type, lim); break; } @@ -6466,13 +6600,15 @@ dtrace_dif_emulate(dtrace_difo_t *difo, break; if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) { + size_t lim; + if (!dtrace_vcanload( (void *)(uintptr_t)regs[rd], - &v->dtdv_type, mstate, vstate)) + &v->dtdv_type, &lim, mstate, vstate)) break; dtrace_vcopy((void *)(uintptr_t)regs[rd], - dvar->dtdv_data, &v->dtdv_type); + dvar->dtdv_data, &v->dtdv_type, lim); } else { *((uint64_t *)dvar->dtdv_data) = regs[rd]; } @@ -6614,13 +6750,15 @@ dtrace_dif_emulate(dtrace_difo_t *difo, break; if (v->dtdv_type.dtdt_flags & DIF_TF_BYREF) { + size_t lim; + if (!dtrace_vcanload( (void *)(uintptr_t)regs[rd], &v->dtdv_type, - mstate, vstate)) + &lim, mstate, vstate)) break; dtrace_vcopy((void *)(uintptr_t)regs[rd], - dvar->dtdv_data, &v->dtdv_type); + dvar->dtdv_data, &v->dtdv_type, lim); } else { *((uint64_t *)dvar->dtdv_data) = regs[rd]; } @@ -7747,7 +7885,7 @@ dtrace_probe(dtrace_id_t id, uintptr_t a if (dp->dtdo_rtype.dtdt_flags & DIF_TF_BYREF && !dtrace_vcanload((void *)(uintptr_t)val, - &dp->dtdo_rtype, &mstate, vstate)) + &dp->dtdo_rtype, NULL, &mstate, vstate)) continue; dtrace_store_by_ref(dp, tomax, size, &valoffs, Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h Tue Aug 16 02:20:02 2016 (r304198) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace_impl.h Tue Aug 16 02:25:19 2016 (r304199) @@ -23,12 +23,12 @@ /* * Copyright 2007 Sun Microsystems, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. * Use is subject to license terms. */ /* - * Copyright (c) 2011, Joyent, Inc. All rights reserved. + * Copyright 2016 Joyent, Inc. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_DTRACE_IMPL_H @@ -932,6 +932,7 @@ typedef struct dtrace_mstate { int dtms_ipl; /* cached interrupt pri lev */ int dtms_fltoffs; /* faulting DIFO offset */ uintptr_t dtms_strtok; /* saved strtok() pointer */ + uintptr_t dtms_strtok_limit; /* upper bound of strtok ptr */ uint32_t dtms_access; /* memory access rights */ dtrace_difo_t *dtms_difo; /* current dif object */ file_t *dtms_getf; /* cached rval of getf() */ From owner-svn-src-all@freebsd.org Tue Aug 16 02:30:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3570BBA2CC; Tue, 16 Aug 2016 02:30:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DF511304; Tue, 16 Aug 2016 02:30:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G2UKBY055175; Tue, 16 Aug 2016 02:30:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G2UKBQ055166; Tue, 16 Aug 2016 02:30:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608160230.u7G2UKBQ055166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 02:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304200 - in head/cddl: contrib/opensolaris/cmd/dtrace/test/cmd/scripts contrib/opensolaris/cmd/dtrace/test/tst/common/sugar contrib/opensolaris/lib/libdtrace/common lib/libdtrace 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 02:30:21 -0000 Author: markj Date: Tue Aug 16 02:30:19 2016 New Revision: 304200 URL: https://svnweb.freebsd.org/changeset/base/304200 Log: MFV r304057: 7085 add support for "if" and "else" statements in dtrace illumos/illumos-gate@c3bd3abd8856e8e75d820f65c58031cd6cbac818 Add syntactic sugar to dtrace: "if" and "else" statements. The sugar is baked down to standard dtrace features by adding additional clauses with the appropriate predicates. Reviewed by: Adam Leventhal Reviewed by: Sebastien Roy Reviewed by: Paul Dagnelie Reviewed by: Bryan Cantrill Approved by: Richard Lowe Author: Matthew Ahrens MFC after: 2 weeks Relnotes: yes Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/sugar/ - copied from r304057, vendor/illumos/dist/cmd/dtrace/test/tst/common/sugar/ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c - copied unchanged from r304057, vendor/illumos/dist/lib/libdtrace/common/dt_sugar.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h head/cddl/contrib/opensolaris/lib/libdtrace/common/dtrace.h head/cddl/lib/libdtrace/Makefile Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl Tue Aug 16 02:25:19 2016 (r304199) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/cmd/scripts/dstyle.pl Tue Aug 16 02:30:19 2016 (r304200) @@ -25,6 +25,10 @@ # Use is subject to license terms. # +# +# Copyright (c) 2014, 2016 by Delphix. All rights reserved. +# + require 5.8.4; $PNAME = $0; @@ -131,7 +135,8 @@ sub dstyle } if (!/^enum/ && !/^\t*struct/ && !/^\t*union/ && !/^typedef/ && - !/^translator/ && !/^provider/) { + !/^translator/ && !/^provider/ && !/\tif / && + !/ else /) { if (/[\w\s]+{/) { err "left brace not on its own line"; } @@ -141,7 +146,7 @@ sub dstyle } } - if (!/;$/) { + if (!/;$/ && !/\t*}$/ && !/ else /) { if (/[\w\s]+}/) { err "right brace not on its own line"; } Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Tue Aug 16 02:25:19 2016 (r304199) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_cc.c Tue Aug 16 02:30:19 2016 (r304200) @@ -21,8 +21,8 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright 2015 Gary Mills */ @@ -120,7 +120,6 @@ static const dtrace_diftype_t dt_int_rty static void *dt_compile(dtrace_hdl_t *, int, dtrace_probespec_t, void *, uint_t, int, char *const[], FILE *, const char *); - /*ARGSUSED*/ static int dt_idreset(dt_idhash_t *dhp, dt_ident_t *idp, void *ignored) @@ -2519,6 +2518,28 @@ dt_compile(dtrace_hdl_t *dtp, int contex } /* + * Perform sugar transformations (for "if" / "else") and replace the + * existing clause chain with the new one. + */ + if (context == DT_CTX_DPROG) { + dt_node_t *dnp, *next_dnp; + dt_node_t *new_list = NULL; + + for (dnp = yypcb->pcb_root->dn_list; + dnp != NULL; dnp = next_dnp) { + /* remove this node from the list */ + next_dnp = dnp->dn_list; + dnp->dn_list = NULL; + + if (dnp->dn_kind == DT_NODE_CLAUSE) + dnp = dt_compile_sugar(dtp, dnp); + /* append node to the new list */ + new_list = dt_node_link(new_list, dnp); + } + yypcb->pcb_root->dn_list = new_list; + } + + /* * If we have successfully created a parse tree for a D program, loop * over the clauses and actions and instantiate the corresponding * libdtrace program. If we are parsing a D expression, then we @@ -2538,6 +2559,8 @@ dt_compile(dtrace_hdl_t *dtp, int contex for (; dnp != NULL; dnp = dnp->dn_list) { switch (dnp->dn_kind) { case DT_NODE_CLAUSE: + if (DT_TREEDUMP_PASS(dtp, 4)) + dt_printd(dnp, stderr, 0); dt_compile_clause(dtp, dnp); break; case DT_NODE_XLATOR: Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y Tue Aug 16 02:25:19 2016 (r304199) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_grammar.y Tue Aug 16 02:30:19 2016 (r304200) @@ -23,8 +23,9 @@ * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ + /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2014, 2016 by Delphix. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -155,6 +156,8 @@ %type probe_specifier_list %type probe_specifier %type statement_list +%type statement_list_impl +%type statement_or_block %type statement %type declaration %type init_declarator_list @@ -319,9 +322,11 @@ probe_definition: "or actions following probe description\n"); } $$ = dt_node_clause($1, NULL, NULL); + yybegin(YYS_CLAUSE); } | probe_specifiers '{' statement_list '}' { $$ = dt_node_clause($1, NULL, $3); + yybegin(YYS_CLAUSE); } | probe_specifiers DT_TOK_DIV expression DT_TOK_EPRED { dnerror($3, D_SYNTAX, "expected actions { } following " @@ -330,6 +335,7 @@ probe_definition: | probe_specifiers DT_TOK_DIV expression DT_TOK_EPRED '{' statement_list '}' { $$ = dt_node_clause($1, $3, $6); + yybegin(YYS_CLAUSE); } ; @@ -349,12 +355,30 @@ probe_specifier: | DT_TOK_INT { $$ = dt_node_pdesc_by_id($1); } ; -statement_list: statement { $$ = $1; } - | statement_list ';' statement { $$ = LINK($1, $3); } +statement_list_impl: /* empty */ { $$ = NULL; } + | statement_list_impl statement { $$ = LINK($1, $2); } + ; + +statement_list: + statement_list_impl { $$ = $1; } + | statement_list_impl expression { + $$ = LINK($1, dt_node_statement($2)); + } ; -statement: /* empty */ { $$ = NULL; } - | expression { $$ = dt_node_statement($1); } +statement_or_block: + statement + | '{' statement_list '}' { $$ = $2; } + +statement: ';' { $$ = NULL; } + | expression ';' { $$ = dt_node_statement($1); } + | DT_KEY_IF DT_TOK_LPAR expression DT_TOK_RPAR statement_or_block { + $$ = dt_node_if($3, $5, NULL); + } + | DT_KEY_IF DT_TOK_LPAR expression DT_TOK_RPAR + statement_or_block DT_KEY_ELSE statement_or_block { + $$ = dt_node_if($3, $5, $7); + } ; argument_expression_list: Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Tue Aug 16 02:25:19 2016 (r304199) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_impl.h Tue Aug 16 02:30:19 2016 (r304200) @@ -26,7 +26,7 @@ /* * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2011, 2016 by Delphix. All rights reserved. */ #ifndef _DT_IMPL_H @@ -362,6 +362,7 @@ struct dtrace_hdl { int dt_indent; /* recommended flow indent */ dtrace_epid_t dt_last_epid; /* most recently consumed EPID */ uint64_t dt_last_timestamp; /* most recently consumed timestamp */ + boolean_t dt_has_sugar; /* syntactic sugar used? */ }; /* Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Tue Aug 16 02:25:19 2016 (r304199) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c Tue Aug 16 02:30:19 2016 (r304200) @@ -22,7 +22,7 @@ /* * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. */ #include @@ -130,8 +130,9 @@ #define DT_VERS_1_11 DT_VERSION_NUMBER(1, 11, 0) #define DT_VERS_1_12 DT_VERSION_NUMBER(1, 12, 0) #define DT_VERS_1_12_1 DT_VERSION_NUMBER(1, 12, 1) -#define DT_VERS_LATEST DT_VERS_1_12_1 -#define DT_VERS_STRING "Sun D 1.12.1" +#define DT_VERS_1_13 DT_VERSION_NUMBER(1, 13, 0) +#define DT_VERS_LATEST DT_VERS_1_13 +#define DT_VERS_STRING "Sun D 1.13" const dt_version_t _dtrace_versions[] = { DT_VERS_1_0, /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */ @@ -157,6 +158,7 @@ const dt_version_t _dtrace_versions[] = DT_VERS_1_11, /* D API 1.11 */ DT_VERS_1_12, /* D API 1.12 */ DT_VERS_1_12_1, /* D API 1.12.1 */ + DT_VERS_1_13, /* D API 1.13 */ 0 }; Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Tue Aug 16 02:25:19 2016 (r304199) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.c Tue Aug 16 02:30:19 2016 (r304200) @@ -23,7 +23,7 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Copyright (c) 2013, Joyent Inc. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -2143,6 +2143,17 @@ dt_node_statement(dt_node_t *expr) } dt_node_t * +dt_node_if(dt_node_t *pred, dt_node_t *acts, dt_node_t *else_acts) +{ + dt_node_t *dnp = dt_node_alloc(DT_NODE_IF); + dnp->dn_conditional = pred; + dnp->dn_body = acts; + dnp->dn_alternate_body = else_acts; + + return (dnp); +} + +dt_node_t * dt_node_pdesc_by_name(char *spec) { dtrace_hdl_t *dtp = yypcb->pcb_hdl; @@ -2211,7 +2222,6 @@ dt_node_clause(dt_node_t *pdescs, dt_nod dnp->dn_pred = pred; dnp->dn_acts = acts; - yybegin(YYS_CLAUSE); return (dnp); } @@ -3203,8 +3213,9 @@ dt_cook_op2(dt_node_t *dnp, uint_t idfla dt_xcook_ident(lp, dhp, idkind, B_TRUE); else dt_xcook_ident(lp, dhp, idp->di_kind, B_FALSE); - } else + } else { lp = dnp->dn_left = dt_node_cook(lp, 0); + } /* * Switch op to '+' for *(E1 + E2) array mode in these cases: @@ -3218,10 +3229,12 @@ dt_cook_op2(dt_node_t *dnp, uint_t idfla if (lp->dn_ident->di_kind == DT_IDENT_ARRAY) { if (lp->dn_args != NULL) op = DT_TOK_ADD; - } else if (!dt_ident_unref(lp->dn_ident)) + } else if (!dt_ident_unref(lp->dn_ident)) { op = DT_TOK_ADD; - } else if (lp->dn_kind != DT_NODE_AGG) + } + } else if (lp->dn_kind != DT_NODE_AGG) { op = DT_TOK_ADD; + } } switch (op) { @@ -3645,45 +3658,34 @@ asgn_common: case DT_TOK_PTR: /* - * If the left-hand side of operator -> is the name "self", - * then we permit a TLS variable to be created or referenced. + * If the left-hand side of operator -> is one of the scoping + * keywords, permit a local or thread variable to be created or + * referenced. */ - if (lp->dn_kind == DT_NODE_IDENT && - strcmp(lp->dn_string, "self") == 0) { - if (rp->dn_kind != DT_NODE_VAR) { - dt_xcook_ident(rp, dtp->dt_tls, - DT_IDENT_SCALAR, B_TRUE); - } - - if (idflags != 0) - rp = dt_node_cook(rp, idflags); - - dnp->dn_right = dnp->dn_left; /* avoid freeing rp */ - dt_node_free(dnp); - return (rp); - } + if (lp->dn_kind == DT_NODE_IDENT) { + dt_idhash_t *dhp = NULL; - /* - * If the left-hand side of operator -> is the name "this", - * then we permit a local variable to be created or referenced. - */ - if (lp->dn_kind == DT_NODE_IDENT && - strcmp(lp->dn_string, "this") == 0) { - if (rp->dn_kind != DT_NODE_VAR) { - dt_xcook_ident(rp, yypcb->pcb_locals, - DT_IDENT_SCALAR, B_TRUE); + if (strcmp(lp->dn_string, "self") == 0) { + dhp = dtp->dt_tls; + } else if (strcmp(lp->dn_string, "this") == 0) { + dhp = yypcb->pcb_locals; } + if (dhp != NULL) { + if (rp->dn_kind != DT_NODE_VAR) { + dt_xcook_ident(rp, dhp, + DT_IDENT_SCALAR, B_TRUE); + } - if (idflags != 0) - rp = dt_node_cook(rp, idflags); + if (idflags != 0) + rp = dt_node_cook(rp, idflags); - dnp->dn_right = dnp->dn_left; /* avoid freeing rp */ - dt_node_free(dnp); - return (rp); + /* avoid freeing rp */ + dnp->dn_right = dnp->dn_left; + dt_node_free(dnp); + return (rp); + } } - /*FALLTHRU*/ - case DT_TOK_DOT: lp = dnp->dn_left = dt_node_cook(lp, DT_IDFLG_REF); @@ -4502,7 +4504,8 @@ static dt_node_t *(*dt_cook_funcs[])(dt_ dt_cook_xlator, /* DT_NODE_XLATOR */ dt_cook_none, /* DT_NODE_PROBE */ dt_cook_provider, /* DT_NODE_PROVIDER */ - dt_cook_none /* DT_NODE_PROG */ + dt_cook_none, /* DT_NODE_PROG */ + dt_cook_none, /* DT_NODE_IF */ }; /* @@ -4517,6 +4520,8 @@ dt_node_cook(dt_node_t *dnp, uint_t idfl yylineno = dnp->dn_line; + assert(dnp->dn_kind < + sizeof (dt_cook_funcs) / sizeof (dt_cook_funcs[0])); dnp = dt_cook_funcs[dnp->dn_kind](dnp, idflags); dnp->dn_flags |= DT_NF_COOKED; @@ -4619,6 +4624,181 @@ dt_node_diftype(dtrace_hdl_t *dtp, const tp->dtdt_size = ctf_type_size(dnp->dn_ctfp, dnp->dn_type); } +/* + * Output the parse tree as D. The "-xtree=8" argument will call this + * function to print out the program after any syntactic sugar + * transformations have been applied (e.g. to implement "if"). The + * resulting output can be used to understand the transformations + * applied by these features, or to run such a script on a system that + * does not support these features + * + * Note that the output does not express precisely the same program as + * the input. In particular: + * - Only the clauses are output. #pragma options, variable + * declarations, etc. are excluded. + * - Command argument substitution has already been done, so the output + * will not contain e.g. $$1, but rather the substituted string. + */ +void +dt_printd(dt_node_t *dnp, FILE *fp, int depth) +{ + dt_node_t *arg; + + switch (dnp->dn_kind) { + case DT_NODE_INT: + (void) fprintf(fp, "0x%llx", (u_longlong_t)dnp->dn_value); + if (!(dnp->dn_flags & DT_NF_SIGNED)) + (void) fprintf(fp, "u"); + break; + + case DT_NODE_STRING: { + char *escd = strchr2esc(dnp->dn_string, strlen(dnp->dn_string)); + (void) fprintf(fp, "\"%s\"", escd); + free(escd); + break; + } + + case DT_NODE_IDENT: + (void) fprintf(fp, "%s", dnp->dn_string); + break; + + case DT_NODE_VAR: + (void) fprintf(fp, "%s%s", + (dnp->dn_ident->di_flags & DT_IDFLG_LOCAL) ? "this->" : + (dnp->dn_ident->di_flags & DT_IDFLG_TLS) ? "self->" : "", + dnp->dn_ident->di_name); + + if (dnp->dn_args != NULL) { + (void) fprintf(fp, "["); + + for (arg = dnp->dn_args; arg != NULL; + arg = arg->dn_list) { + dt_printd(arg, fp, 0); + if (arg->dn_list != NULL) + (void) fprintf(fp, ", "); + } + + (void) fprintf(fp, "]"); + } + break; + + case DT_NODE_SYM: { + const dtrace_syminfo_t *dts = dnp->dn_ident->di_data; + (void) fprintf(fp, "%s`%s", dts->dts_object, dts->dts_name); + break; + } + case DT_NODE_FUNC: + (void) fprintf(fp, "%s(", dnp->dn_ident->di_name); + + for (arg = dnp->dn_args; arg != NULL; arg = arg->dn_list) { + dt_printd(arg, fp, 0); + if (arg->dn_list != NULL) + (void) fprintf(fp, ", "); + } + (void) fprintf(fp, ")"); + break; + + case DT_NODE_OP1: + (void) fprintf(fp, "%s(", opstr(dnp->dn_op)); + dt_printd(dnp->dn_child, fp, 0); + (void) fprintf(fp, ")"); + break; + + case DT_NODE_OP2: + (void) fprintf(fp, "("); + dt_printd(dnp->dn_left, fp, 0); + if (dnp->dn_op == DT_TOK_LPAR) { + (void) fprintf(fp, ")"); + dt_printd(dnp->dn_right, fp, 0); + break; + } + if (dnp->dn_op == DT_TOK_PTR || dnp->dn_op == DT_TOK_DOT || + dnp->dn_op == DT_TOK_LBRAC) + (void) fprintf(fp, "%s", opstr(dnp->dn_op)); + else + (void) fprintf(fp, " %s ", opstr(dnp->dn_op)); + dt_printd(dnp->dn_right, fp, 0); + if (dnp->dn_op == DT_TOK_LBRAC) { + dt_node_t *ln = dnp->dn_right; + while (ln->dn_list != NULL) { + (void) fprintf(fp, ", "); + dt_printd(ln->dn_list, fp, depth); + ln = ln->dn_list; + } + (void) fprintf(fp, "]"); + } + (void) fprintf(fp, ")"); + break; + + case DT_NODE_OP3: + (void) fprintf(fp, "("); + dt_printd(dnp->dn_expr, fp, 0); + (void) fprintf(fp, " ? "); + dt_printd(dnp->dn_left, fp, 0); + (void) fprintf(fp, " : "); + dt_printd(dnp->dn_right, fp, 0); + (void) fprintf(fp, ")"); + break; + + case DT_NODE_DEXPR: + case DT_NODE_DFUNC: + (void) fprintf(fp, "%*s", depth * 8, ""); + dt_printd(dnp->dn_expr, fp, depth + 1); + (void) fprintf(fp, ";\n"); + break; + + case DT_NODE_PDESC: + (void) fprintf(fp, "%s:%s:%s:%s", + dnp->dn_desc->dtpd_provider, dnp->dn_desc->dtpd_mod, + dnp->dn_desc->dtpd_func, dnp->dn_desc->dtpd_name); + break; + + case DT_NODE_CLAUSE: + for (arg = dnp->dn_pdescs; arg != NULL; arg = arg->dn_list) { + dt_printd(arg, fp, 0); + if (arg->dn_list != NULL) + (void) fprintf(fp, ","); + (void) fprintf(fp, "\n"); + } + + if (dnp->dn_pred != NULL) { + (void) fprintf(fp, "/"); + dt_printd(dnp->dn_pred, fp, 0); + (void) fprintf(fp, "/\n"); + } + (void) fprintf(fp, "{\n"); + + for (arg = dnp->dn_acts; arg != NULL; arg = arg->dn_list) + dt_printd(arg, fp, depth + 1); + (void) fprintf(fp, "}\n"); + (void) fprintf(fp, "\n"); + break; + + case DT_NODE_IF: + (void) fprintf(fp, "%*sif (", depth * 8, ""); + dt_printd(dnp->dn_conditional, fp, 0); + (void) fprintf(fp, ") {\n"); + + for (arg = dnp->dn_body; arg != NULL; arg = arg->dn_list) + dt_printd(arg, fp, depth + 1); + if (dnp->dn_alternate_body == NULL) { + (void) fprintf(fp, "%*s}\n", depth * 8, ""); + } else { + (void) fprintf(fp, "%*s} else {\n", depth * 8, ""); + for (arg = dnp->dn_alternate_body; arg != NULL; + arg = arg->dn_list) + dt_printd(arg, fp, depth + 1); + (void) fprintf(fp, "%*s}\n", depth * 8, ""); + } + + break; + + default: + (void) fprintf(fp, "/* bad node %p, kind %d */\n", + (void *)dnp, dnp->dn_kind); + } +} + void dt_node_printr(dt_node_t *dnp, FILE *fp, int depth) { @@ -4729,6 +4909,13 @@ dt_node_printr(dt_node_t *dnp, FILE *fp, (void) fprintf(fp, "OP2 %s (%s)\n", opstr(dnp->dn_op), buf); dt_node_printr(dnp->dn_left, fp, depth + 1); dt_node_printr(dnp->dn_right, fp, depth + 1); + if (dnp->dn_op == DT_TOK_LBRAC) { + dt_node_t *ln = dnp->dn_right; + while (ln->dn_list != NULL) { + dt_node_printr(ln->dn_list, fp, depth + 1); + ln = ln->dn_list; + } + } break; case DT_NODE_OP3: @@ -4790,6 +4977,7 @@ dt_node_printr(dt_node_t *dnp, FILE *fp, for (arg = dnp->dn_acts; arg != NULL; arg = arg->dn_list) dt_node_printr(arg, fp, depth + 1); + (void) fprintf(fp, "\n"); break; case DT_NODE_INLINE: @@ -4840,6 +5028,24 @@ dt_node_printr(dt_node_t *dnp, FILE *fp, dt_node_printr(arg, fp, depth + 1); break; + case DT_NODE_IF: + (void) fprintf(fp, "IF attr=%s CONDITION:\n", a); + + dt_node_printr(dnp->dn_conditional, fp, depth + 1); + + (void) fprintf(fp, "%*sIF BODY: \n", depth * 2, ""); + for (arg = dnp->dn_body; arg != NULL; arg = arg->dn_list) + dt_node_printr(arg, fp, depth + 1); + + if (dnp->dn_alternate_body != NULL) { + (void) fprintf(fp, "%*sIF ELSE: \n", depth * 2, ""); + for (arg = dnp->dn_alternate_body; arg != NULL; + arg = arg->dn_list) + dt_node_printr(arg, fp, depth + 1); + } + + break; + default: (void) fprintf(fp, "\n", (void *)dnp, dnp->dn_kind); Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h Tue Aug 16 02:25:19 2016 (r304199) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_parser.h Tue Aug 16 02:30:19 2016 (r304200) @@ -23,7 +23,7 @@ * Use is subject to license terms. */ /* - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2016 by Delphix. All rights reserved. * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ @@ -105,6 +105,12 @@ typedef struct dt_node { struct dt_node *_probes; /* list of probe nodes */ int _redecl; /* provider redeclared */ } _provider; + + struct { + struct dt_node *_conditional; + struct dt_node *_body; + struct dt_node *_alternate_body; + } _conditional; } dn_u; struct dt_node *dn_list; /* parse tree list link */ @@ -140,6 +146,11 @@ typedef struct dt_node { #define dn_provred dn_u._provider._redecl /* DT_NODE_PROVIDER */ #define dn_probes dn_u._provider._probes /* DT_NODE_PROVIDER */ +/* DT_NODE_IF: */ +#define dn_conditional dn_u._conditional._conditional +#define dn_body dn_u._conditional._body +#define dn_alternate_body dn_u._conditional._alternate_body + #define DT_NODE_FREE 0 /* unused node (waiting to be freed) */ #define DT_NODE_INT 1 /* integer value */ #define DT_NODE_STRING 2 /* string value */ @@ -162,6 +173,7 @@ typedef struct dt_node { #define DT_NODE_PROBE 19 /* probe definition */ #define DT_NODE_PROVIDER 20 /* provider definition */ #define DT_NODE_PROG 21 /* program translation unit */ +#define DT_NODE_IF 22 /* if statement */ #define DT_NF_SIGNED 0x01 /* data is a signed quantity (else unsigned) */ #define DT_NF_COOKED 0x02 /* data is a known type (else still cooking) */ @@ -213,6 +225,7 @@ extern dt_node_t *dt_node_xlator(dt_decl extern dt_node_t *dt_node_probe(char *, int, dt_node_t *, dt_node_t *); extern dt_node_t *dt_node_provider(char *, dt_node_t *); extern dt_node_t *dt_node_program(dt_node_t *); +extern dt_node_t *dt_node_if(dt_node_t *, dt_node_t *, dt_node_t *); extern dt_node_t *dt_node_link(dt_node_t *, dt_node_t *); extern dt_node_t *dt_node_cook(dt_node_t *, uint_t); @@ -237,6 +250,7 @@ extern void dt_node_promote(dt_node_t *, extern void dt_node_diftype(dtrace_hdl_t *, const dt_node_t *, dtrace_diftype_t *); extern void dt_node_printr(dt_node_t *, FILE *, int); +extern void dt_printd(dt_node_t *, FILE *, int); extern const char *dt_node_name(const dt_node_t *, char *, size_t); extern int dt_node_root(dt_node_t *); Copied: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c (from r304057, vendor/illumos/dist/lib/libdtrace/common/dt_sugar.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_sugar.c Tue Aug 16 02:30:19 2016 (r304200, copy of r304057, vendor/illumos/dist/lib/libdtrace/common/dt_sugar.c) @@ -0,0 +1,516 @@ +/* + * 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, 2016 by Delphix. All rights reserved. + */ + +/* + * Syntactic sugar features are implemented by transforming the D parse tree + * such that it only uses the subset of D that is supported by the rest of the + * compiler / the kernel. A clause containing these language features is + * referred to as a "super-clause", and its transformation typically entails + * creating several "sub-clauses" to implement it. For diagnosability, the + * sub-clauses will be printed if the "-xtree=8" flag is specified. + * + * Currently, the only syntactic sugar feature is "if/else" statements. Each + * basic block (e.g. the body of the "if" and "else" statements, and the + * statements before and after) is turned into its own sub-clause, with a + * predicate that causes it to be executed only if the code flows to this point. + * Nested if/else statements are supported. + * + * This infrastructure is designed to accommodate other syntactic sugar features + * in the future. + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct dt_sugar_parse { + dtrace_hdl_t *dtsp_dtp; /* dtrace handle */ + dt_node_t *dtsp_pdescs; /* probe descriptions */ + int dtsp_num_conditions; /* number of condition variables */ + int dtsp_num_ifs; /* number of "if" statements */ + dt_node_t *dtsp_clause_list; /* list of clauses */ +} dt_sugar_parse_t; + +static void dt_sugar_visit_stmts(dt_sugar_parse_t *, dt_node_t *, int); + +/* + * Return a node for "self->%error". + * + * Note that the "%" is part of the variable name, and is included so that + * this variable name can not collide with any user-specified variable. + * + * This error variable is used to keep track of if there has been an error + * in any of the sub-clauses, and is used to prevent execution of subsequent + * sub-clauses following an error. + */ +static dt_node_t * +dt_sugar_new_error_var(void) +{ + return (dt_node_op2(DT_TOK_PTR, dt_node_ident(strdup("self")), + dt_node_ident(strdup("%error")))); +} + +/* + * Append this clause to the clause list. + */ +static void +dt_sugar_append_clause(dt_sugar_parse_t *dp, dt_node_t *clause) +{ + dp->dtsp_clause_list = dt_node_link(dp->dtsp_clause_list, clause); +} + +/* + * Prepend this clause to the clause list. + */ +static void +dt_sugar_prepend_clause(dt_sugar_parse_t *dp, dt_node_t *clause) +{ + dp->dtsp_clause_list = dt_node_link(clause, dp->dtsp_clause_list); +} + +/* + * Return a node for "this->%condition_", or NULL if condid==0. + * + * Note that the "%" is part of the variable name, and is included so that + * this variable name can not collide with any user-specified variable. + */ +static dt_node_t * +dt_sugar_new_condition_var(int condid) +{ + char *str; + + if (condid == 0) + return (NULL); + assert(condid > 0); + + (void) asprintf(&str, "%%condition_%d", ABS(condid)); + return (dt_node_op2(DT_TOK_PTR, dt_node_ident(strdup("this")), + dt_node_ident(str))); +} + +/* + * Return new clause to evaluate predicate and set newcond. condid is + * the condition that we are already under, or 0 if none. + * The new clause will be of the form: + * + * dp_pdescs + * /!self->%error/ + * { + * this->%condition_ = + * (this->%condition_ && pred); + * } + * + * Note: if condid==0, we will instead do "... = (1 && pred)", to effectively + * convert the pred to a boolean. + * + * Note: Unless an error has been encountered, we always set the condition + * variable (either to 0 or 1). This lets us avoid resetting the condition + * variables back to 0 when the super-clause completes. + */ +static dt_node_t * +dt_sugar_new_condition_impl(dt_sugar_parse_t *dp, + dt_node_t *pred, int condid, int newcond) +{ + dt_node_t *value, *body, *newpred; + + /* predicate is !self->%error */ + newpred = dt_node_op1(DT_TOK_LNEG, dt_sugar_new_error_var()); + + if (condid == 0) { + /* + * value is (1 && pred) + * + * Note, D doesn't allow a probe-local "this" variable to + * be reused as a different type, even from a different probe. + * Therefore, value can't simply be , because then + * its type could be different when we reuse this condid + * in a different meta-clause. + */ + value = dt_node_op2(DT_TOK_LAND, dt_node_int(1), pred); + } else { + /* value is (this->%condition_ && pred) */ + value = dt_node_op2(DT_TOK_LAND, + dt_sugar_new_condition_var(condid), pred); + } + + /* body is "this->%condition_ = ;" */ + body = dt_node_statement(dt_node_op2(DT_TOK_ASGN, + dt_sugar_new_condition_var(newcond), value)); + + return (dt_node_clause(dp->dtsp_pdescs, newpred, body)); +} + +/* + * Generate a new clause to evaluate predicate and set a new condition variable, + * whose ID will be returned. The new clause will be appended to + * dp_first_new_clause. + */ +static int +dt_sugar_new_condition(dt_sugar_parse_t *dp, dt_node_t *pred, int condid) +{ + dp->dtsp_num_conditions++; + dt_sugar_append_clause(dp, dt_sugar_new_condition_impl(dp, + pred, condid, dp->dtsp_num_conditions)); + return (dp->dtsp_num_conditions); +} + +/* + * Visit the specified node and all of its descendants. Currently this is only + * used to count the number of "if" statements (dtsp_num_ifs). + */ +static void +dt_sugar_visit_all(dt_sugar_parse_t *dp, dt_node_t *dnp) +{ + dt_node_t *arg; + + switch (dnp->dn_kind) { + case DT_NODE_FREE: + case DT_NODE_INT: + case DT_NODE_STRING: + case DT_NODE_SYM: + case DT_NODE_TYPE: + case DT_NODE_PROBE: + case DT_NODE_PDESC: + case DT_NODE_IDENT: + break; + + case DT_NODE_FUNC: + for (arg = dnp->dn_args; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + break; + + case DT_NODE_OP1: + dt_sugar_visit_all(dp, dnp->dn_child); + break; + + case DT_NODE_OP2: + dt_sugar_visit_all(dp, dnp->dn_left); + dt_sugar_visit_all(dp, dnp->dn_right); + if (dnp->dn_op == DT_TOK_LBRAC) { + dt_node_t *ln = dnp->dn_right; + while (ln->dn_list != NULL) { + dt_sugar_visit_all(dp, ln->dn_list); + ln = ln->dn_list; + } + } + break; + + case DT_NODE_OP3: + dt_sugar_visit_all(dp, dnp->dn_expr); + dt_sugar_visit_all(dp, dnp->dn_left); + dt_sugar_visit_all(dp, dnp->dn_right); + break; + + case DT_NODE_DEXPR: + case DT_NODE_DFUNC: + dt_sugar_visit_all(dp, dnp->dn_expr); + break; + + case DT_NODE_AGG: + for (arg = dnp->dn_aggtup; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + + if (dnp->dn_aggfun) + dt_sugar_visit_all(dp, dnp->dn_aggfun); + break; + + case DT_NODE_CLAUSE: + for (arg = dnp->dn_pdescs; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + + if (dnp->dn_pred != NULL) + dt_sugar_visit_all(dp, dnp->dn_pred); + + for (arg = dnp->dn_acts; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + break; + + case DT_NODE_INLINE: { + const dt_idnode_t *inp = dnp->dn_ident->di_iarg; + + dt_sugar_visit_all(dp, inp->din_root); + break; + } + case DT_NODE_MEMBER: + if (dnp->dn_membexpr) + dt_sugar_visit_all(dp, dnp->dn_membexpr); + break; + + case DT_NODE_XLATOR: + for (arg = dnp->dn_members; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + break; + + case DT_NODE_PROVIDER: + for (arg = dnp->dn_probes; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + break; + + case DT_NODE_PROG: + for (arg = dnp->dn_list; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + break; + + case DT_NODE_IF: + dp->dtsp_num_ifs++; + dt_sugar_visit_all(dp, dnp->dn_conditional); + + for (arg = dnp->dn_body; arg != NULL; arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + for (arg = dnp->dn_alternate_body; arg != NULL; + arg = arg->dn_list) + dt_sugar_visit_all(dp, arg); + + break; + + default: + (void) dnerror(dnp, D_UNKNOWN, "bad node %p, kind %d\n", + (void *)dnp, dnp->dn_kind); + } +} + +/* + * Return a new clause which resets the error variable to zero: + * + * dp_pdescs{ self->%error = 0; } + * + * This clause will be executed at the beginning of each meta-clause, to + * ensure the error variable is unset (in case the previous meta-clause + * failed). + */ +static dt_node_t * +dt_sugar_new_clearerror_clause(dt_sugar_parse_t *dp) +{ + dt_node_t *stmt = dt_node_statement(dt_node_op2(DT_TOK_ASGN, + dt_sugar_new_error_var(), dt_node_int(0))); + return (dt_node_clause(dp->dtsp_pdescs, NULL, stmt)); +} + +/* + * Evaluate the conditional, and recursively visit the body of the "if" + * statement (and the "else", if present). + */ +static void +dt_sugar_do_if(dt_sugar_parse_t *dp, dt_node_t *if_stmt, int precondition) +{ + int newid; + + assert(if_stmt->dn_kind == DT_NODE_IF); + + /* condition */ + newid = dt_sugar_new_condition(dp, + if_stmt->dn_conditional, precondition); + + /* body of if */ + dt_sugar_visit_stmts(dp, if_stmt->dn_body, newid); + + /* + * Visit the body of the "else" statement, if present. Note that we + * generate a new condition which is the inverse of the previous + * condition. + */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Aug 16 02:34:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D220BBA53C; Tue, 16 Aug 2016 02:34:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 523BE1859; Tue, 16 Aug 2016 02:34:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G2YP1P058583; Tue, 16 Aug 2016 02:34:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G2YPet058579; Tue, 16 Aug 2016 02:34:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608160234.u7G2YPet058579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 02:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304201 - in head: cddl/usr.sbin/dtrace/tests/common cddl/usr.sbin/dtrace/tests/common/scalars cddl/usr.sbin/dtrace/tests/common/sugar 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 02:34:26 -0000 Author: markj Date: Tue Aug 16 02:34:25 2016 New Revision: 304201 URL: https://svnweb.freebsd.org/changeset/base/304201 Log: Regenerate DTrace tests. Added: head/cddl/usr.sbin/dtrace/tests/common/sugar/ head/cddl/usr.sbin/dtrace/tests/common/sugar/Makefile (contents, props changed) Modified: head/cddl/usr.sbin/dtrace/tests/common/Makefile head/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile head/etc/mtree/BSD.tests.dist Modified: head/cddl/usr.sbin/dtrace/tests/common/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/Makefile Tue Aug 16 02:30:19 2016 (r304200) +++ head/cddl/usr.sbin/dtrace/tests/common/Makefile Tue Aug 16 02:34:25 2016 (r304201) @@ -69,6 +69,7 @@ TESTS_SUBDIRS+= aggs \ strlen \ strtoll \ struct \ + sugar \ syscall \ tick-n \ trace \ Modified: head/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile Tue Aug 16 02:30:19 2016 (r304200) +++ head/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile Tue Aug 16 02:34:25 2016 (r304201) @@ -18,6 +18,8 @@ ${PACKAGE}FILES= \ err.D_SYNTAX.declare.d \ err.bigglobal.d \ err.biglocal.d \ + tst.16kglobal.d \ + tst.16klocal.d \ tst.basicvar.d \ tst.basicvar.d.out \ tst.localvar.d \ Added: head/cddl/usr.sbin/dtrace/tests/common/sugar/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/usr.sbin/dtrace/tests/common/sugar/Makefile Tue Aug 16 02:34:25 2016 (r304201) @@ -0,0 +1,25 @@ +# $FreeBSD$ + +# +# This Makefile was generated by $srcdir/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh. +# + +PACKAGE= tests + +${PACKAGE}FILES= \ + tst.else.d \ + tst.if.d \ + tst.if2.d \ + tst.if_before_after.d \ + tst.if_nested.d \ + tst.if_trailing_semicolon.d \ + tst.if_trailing_semicolon2.d \ + +TESTEXES= \ + + +CFILES= \ + + + +.include "../../dtrace.test.mk" Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Tue Aug 16 02:30:19 2016 (r304200) +++ head/etc/mtree/BSD.tests.dist Tue Aug 16 02:34:25 2016 (r304201) @@ -183,6 +183,8 @@ .. struct .. + sugar + .. syscall .. sysevent From owner-svn-src-all@freebsd.org Tue Aug 16 06:40:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81292BBBB44; Tue, 16 Aug 2016 06:40:28 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5244917AA; Tue, 16 Aug 2016 06:40:28 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G6eRIj047551; Tue, 16 Aug 2016 06:40:27 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G6eRGg047550; Tue, 16 Aug 2016 06:40:27 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608160640.u7G6eRGg047550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 16 Aug 2016 06:40:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304202 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 06:40:28 -0000 Author: sephe Date: Tue Aug 16 06:40:27 2016 New Revision: 304202 URL: https://svnweb.freebsd.org/changeset/base/304202 Log: tcp/lro: Make # of LRO entries tunable Reviewed by: hps, gallatin Obtained from: rrs, gallatin MFC after: 2 weeks Sponsored by: Netflix (rrs, gallatin), Microsoft (sephe) Differential Revision: https://reviews.freebsd.org/D7499 Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Tue Aug 16 02:34:25 2016 (r304201) +++ head/sys/netinet/tcp_lro.c Tue Aug 16 06:40:27 2016 (r304202) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -55,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -71,6 +73,14 @@ static void tcp_lro_rx_done(struct lro_c static int tcp_lro_rx2(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum, int use_hash); +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, lro, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, + "TCP LRO"); + +static unsigned tcp_lro_entries = TCP_LRO_ENTRIES; +SYSCTL_UINT(_net_inet_tcp_lro, OID_AUTO, entries, + CTLFLAG_RDTUN | CTLFLAG_MPSAFE, &tcp_lro_entries, 0, + "default number of LRO entries"); + static __inline void tcp_lro_active_insert(struct lro_ctrl *lc, struct lro_head *bucket, struct lro_entry *le) @@ -91,7 +101,7 @@ tcp_lro_active_remove(struct lro_entry * int tcp_lro_init(struct lro_ctrl *lc) { - return (tcp_lro_init_args(lc, NULL, TCP_LRO_ENTRIES, 0)); + return (tcp_lro_init_args(lc, NULL, tcp_lro_entries, 0)); } int From owner-svn-src-all@freebsd.org Tue Aug 16 07:14:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43A34BBB66D; Tue, 16 Aug 2016 07:14:11 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E89ED1B21; Tue, 16 Aug 2016 07:14:10 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G7EAQl061721; Tue, 16 Aug 2016 07:14:10 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G7EAUQ061719; Tue, 16 Aug 2016 07:14:10 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608160714.u7G7EAUQ061719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Tue, 16 Aug 2016 07:14:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304203 - stable/10/lib/libc/gen X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 07:14:11 -0000 Author: ache Date: Tue Aug 16 07:14:09 2016 New Revision: 304203 URL: https://svnweb.freebsd.org/changeset/base/304203 Log: MFC r302943,r302944,r303004,r303010,r303011,r303013,r303014,r303074, r303088,r303142,r303208,r303210,r303530,r303536,r303564,r303565, r303706 In short: 1) All situations with glob(3) error return codes are well defined by POSIX, so rewrite old sporadic errors processing to match those definitions. Including subcases: Both C99 and POSIX directly prohibits any standard function to set errno to 0. Breaking this rule in 2001 NetBSD hack was imported which attempts to workaround very limited glob(3) return codes amount. Use POSIX-compatible workaround now with E2BIG which can't comes from other functions used instead of prohibited 0. Process errors happpens in (*readdirfunc)() too, as POSIX requires. Per POSIX GLOB_NOCHECK should return original pattern, unmodified, if no matches found. But our code strips all '\' returning it. Rewrite the code to allow to return original pattern. GLOB_ERR and gl_errfunc are supposed to work only for real directories per POSIX, so don't act on missing or plain files for ENOENT or ENOTDIR (as TODO in the code suggested). Remove the hack in the manpage describing how to skip ENOENT and ENOTDIR in gl_errfunc, it is unneeded now. Per POSIX GLOB_ERR must be considered even if gl_errfunc is not set, old code skips it in that case. 2) For near MAXPATHLEN long pathes old glob(3) code can operate on truncated results, prevent it in several places. 3) Results was not sorted according to collate as POSIX requires. 4) globtilde() forget to convert expanded user home dir from multibyte to wide chars. Moreover, those chars are addded as not protected, so can be treated as special chars. 5) Backward hack for EILSEQ in g_Ctoc() was not implemented, so all pathes with illegal byte sequences are skipped as result, implement it now. 6) GLOB_BRACE was somehow broken. First it repeatedly calls glob0() in globexp1() recursive calls, but glob0() was not supposed to be called repeatedly in the original code. It finalize results by possible adding original pattern for no match case, may return GLOB_NOMATCH error and by sorting all things. Original pattern adding or GLOB_NOMATCH error can happens each time glob0() called repeatedly, and sorting happens for one item only, all things are never sorted. Second, f.e. "a{a" pattern does not match "a{a" file but match "a" file instead. Third, some errors (f.e. for limits or overflow) can be ignored by GLOB_BRACE code because it forces return (0). Add non-finalizing flag to glob0() and make globexp0() wrapper around recursively called globexp1() to finalize things like glob0() does. Reorganize braces code to work correctly. 7) Don't allow MB_CUR_MAX * strlen overallocation hits GLOB_LIMIT_STRING (ARG_MAX) limit, use final string length, not malloced space for it. Modified: stable/10/lib/libc/gen/glob.3 stable/10/lib/libc/gen/glob.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/glob.3 ============================================================================== --- stable/10/lib/libc/gen/glob.3 Tue Aug 16 06:40:27 2016 (r304202) +++ stable/10/lib/libc/gen/glob.3 Tue Aug 16 07:14:09 2016 (r304203) @@ -275,24 +275,10 @@ is .Pf non- Dv NULL , .Fn glob calls -.Fa \*(lp*errfunc\*(rp Ns ( Fa path , errno ) . -This may be unintuitive: a pattern like -.Ql */Makefile -will try to -.Xr stat 2 -.Ql foo/Makefile -even if -.Ql foo -is not a directory, resulting in a -call to -.Fa errfunc . -The error routine can suppress this action by testing for -.Er ENOENT -and -.Er ENOTDIR ; +.Fa \*(lp*errfunc\*(rp Ns ( Fa path , errno ) , however, the .Dv GLOB_ERR -flag will still cause an immediate +flag will cause an immediate return when this happens. .Pp If @@ -377,7 +363,7 @@ file .It Dv GLOB_NOSPACE An attempt to allocate memory failed, or if .Fa errno -was 0 +was E2BIG, .Dv GLOB_LIMIT was specified in the flags and .Fa pglob\->gl_matchc Modified: stable/10/lib/libc/gen/glob.c ============================================================================== --- stable/10/lib/libc/gen/glob.c Tue Aug 16 06:40:27 2016 (r304202) +++ stable/10/lib/libc/gen/glob.c Tue Aug 16 07:14:09 2016 (r304203) @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); * 1. Patterns with illegal byte sequences match nothing - even if * GLOB_NOCHECK is specified. * 2. Illegal byte sequences in filenames are handled by treating them as - * single-byte characters with a value of the first byte of the sequence + * single-byte characters with a values of such bytes of the sequence * cast to wchar_t. * 3. State-dependent encodings are not currently supported. */ @@ -113,25 +113,20 @@ struct glob_limit { size_t l_string_cnt; }; -#define DOLLAR '$' -#define DOT '.' -#define EOS '\0' -#define LBRACKET '[' -#define NOT '!' -#define QUESTION '?' -#define QUOTE '\\' -#define RANGE '-' -#define RBRACKET ']' -#define SEP '/' -#define STAR '*' -#define TILDE '~' -#define UNDERSCORE '_' -#define LBRACE '{' -#define RBRACE '}' -#define SLASH '/' -#define COMMA ',' - -#ifndef DEBUG +#define DOT L'.' +#define EOS L'\0' +#define LBRACKET L'[' +#define NOT L'!' +#define QUESTION L'?' +#define QUOTE L'\\' +#define RANGE L'-' +#define RBRACKET L']' +#define SEP L'/' +#define STAR L'*' +#define TILDE L'~' +#define LBRACE L'{' +#define RBRACE L'}' +#define COMMA L',' #define M_QUOTE 0x8000000000ULL #define M_PROTECT 0x4000000000ULL @@ -140,28 +135,19 @@ struct glob_limit { typedef uint_fast64_t Char; -#else - -#define M_QUOTE 0x80 -#define M_PROTECT 0x40 -#define M_MASK 0xff -#define M_CHAR 0x7f - -typedef char Char; - -#endif - - #define CHAR(c) ((Char)((c)&M_CHAR)) #define META(c) ((Char)((c)|M_QUOTE)) -#define M_ALL META('*') -#define M_END META(']') -#define M_NOT META('!') -#define M_ONE META('?') -#define M_RNG META('-') -#define M_SET META('[') +#define UNPROT(c) ((c) & ~M_PROTECT) +#define M_ALL META(L'*') +#define M_END META(L']') +#define M_NOT META(L'!') +#define M_ONE META(L'?') +#define M_RNG META(L'-') +#define M_SET META(L'[') #define ismeta(c) (((c)&M_QUOTE) != 0) - +#ifdef DEBUG +#define isprot(c) (((c)&M_PROTECT) != 0) +#endif static int compare(const void *, const void *); static int g_Ctoc(const Char *, char *, size_t); @@ -172,19 +158,27 @@ static const Char *g_strchr(const Char * static Char *g_strcat(Char *, const Char *); #endif static int g_stat(Char *, struct stat *, glob_t *); -static int glob0(const Char *, glob_t *, struct glob_limit *); +static int glob0(const Char *, glob_t *, struct glob_limit *, + const char *); static int glob1(Char *, glob_t *, struct glob_limit *); static int glob2(Char *, Char *, Char *, Char *, glob_t *, struct glob_limit *); static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, struct glob_limit *); -static int globextend(const Char *, glob_t *, struct glob_limit *); +static int globextend(const Char *, glob_t *, struct glob_limit *, + const char *); static const Char * globtilde(const Char *, Char *, size_t, glob_t *); +static int globexp0(const Char *, glob_t *, struct glob_limit *, + const char *); static int globexp1(const Char *, glob_t *, struct glob_limit *); -static int globexp2(const Char *, const Char *, glob_t *, int *, +static int globexp2(const Char *, const Char *, glob_t *, struct glob_limit *); +static int globfinal(glob_t *, struct glob_limit *, size_t, + const char *); static int match(Char *, Char *, Char *); +static int err_nomatch(glob_t *, struct glob_limit *, const char *); +static int err_aborted(glob_t *, int, char *); #ifdef DEBUG static void qprintf(const char *, Char *); #endif @@ -199,6 +193,7 @@ glob(const char * __restrict pattern, in mbstate_t mbs; wchar_t wc; size_t clen; + int too_long; patnext = pattern; if (!(flags & GLOB_APPEND)) { @@ -218,24 +213,27 @@ glob(const char * __restrict pattern, in bufnext = patbuf; bufend = bufnext + MAXPATHLEN - 1; + too_long = 1; if (flags & GLOB_NOESCAPE) { memset(&mbs, 0, sizeof(mbs)); - while (bufend - bufnext >= MB_CUR_MAX) { + while (bufnext <= bufend) { clen = mbrtowc(&wc, patnext, MB_LEN_MAX, &mbs); if (clen == (size_t)-1 || clen == (size_t)-2) - return (GLOB_NOMATCH); - else if (clen == 0) + return (err_nomatch(pglob, &limit, pattern)); + else if (clen == 0) { + too_long = 0; break; + } *bufnext++ = wc; patnext += clen; } } else { /* Protect the quoted characters. */ memset(&mbs, 0, sizeof(mbs)); - while (bufend - bufnext >= MB_CUR_MAX) { - if (*patnext == QUOTE) { - if (*++patnext == EOS) { - *bufnext++ = QUOTE | M_PROTECT; + while (bufnext <= bufend) { + if (*patnext == '\\') { + if (*++patnext == '\0') { + *bufnext++ = QUOTE; continue; } prot = M_PROTECT; @@ -243,19 +241,47 @@ glob(const char * __restrict pattern, in prot = 0; clen = mbrtowc(&wc, patnext, MB_LEN_MAX, &mbs); if (clen == (size_t)-1 || clen == (size_t)-2) - return (GLOB_NOMATCH); - else if (clen == 0) + return (err_nomatch(pglob, &limit, pattern)); + else if (clen == 0) { + too_long = 0; break; + } *bufnext++ = wc | prot; patnext += clen; } } + if (too_long) + return (err_nomatch(pglob, &limit, pattern)); *bufnext = EOS; if (flags & GLOB_BRACE) - return (globexp1(patbuf, pglob, &limit)); + return (globexp0(patbuf, pglob, &limit, pattern)); else - return (glob0(patbuf, pglob, &limit)); + return (glob0(patbuf, pglob, &limit, pattern)); +} + +static int +globexp0(const Char *pattern, glob_t *pglob, struct glob_limit *limit, + const char *origpat) { + int rv; + size_t oldpathc; + + /* Protect a single {}, for find(1), like csh */ + if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) { + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + return (glob0(pattern, pglob, limit, origpat)); + } + + oldpathc = pglob->gl_pathc; + + if ((rv = globexp1(pattern, pglob, limit)) != 0) + return rv; + + return (globfinal(pglob, limit, oldpathc, origpat)); } /* @@ -266,24 +292,18 @@ glob(const char * __restrict pattern, in static int globexp1(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { - const Char* ptr = pattern; - int rv; + const Char* ptr; - if ((pglob->gl_flags & GLOB_LIMIT) && - limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { - errno = 0; - return (GLOB_NOSPACE); + if ((ptr = g_strchr(pattern, LBRACE)) != NULL) { + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + return (globexp2(ptr, pattern, pglob, limit)); } - /* Protect a single {}, for find(1), like csh */ - if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) - return glob0(pattern, pglob, limit); - - while ((ptr = g_strchr(ptr, LBRACE)) != NULL) - if (!globexp2(ptr, pattern, pglob, &rv, limit)) - return rv; - - return glob0(pattern, pglob, limit); + return (glob0(pattern, pglob, limit, NULL)); } @@ -293,10 +313,10 @@ globexp1(const Char *pattern, glob_t *pg * If it fails then it tries to glob the rest of the pattern and returns. */ static int -globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, +globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, struct glob_limit *limit) { - int i; + int i, rv; Char *lm, *ls; const Char *pe, *pm, *pm1, *pl; Char patbuf[MAXPATHLEN]; @@ -308,7 +328,7 @@ globexp2(const Char *ptr, const Char *pa ls = lm; /* Find the balanced brace */ - for (i = 0, pe = ++ptr; *pe; pe++) + for (i = 0, pe = ++ptr; *pe != EOS; pe++) if (*pe == LBRACKET) { /* Ignore everything between [] */ for (pm = pe++; *pe != RBRACKET && *pe != EOS; pe++) @@ -330,10 +350,8 @@ globexp2(const Char *ptr, const Char *pa } /* Non matching braces; just glob the pattern */ - if (i != 0 || *pe == EOS) { - *rv = glob0(patbuf, pglob, limit); - return (0); - } + if (i != 0 || *pe == EOS) + return (glob0(pattern, pglob, limit, NULL)); for (i = 0, pl = pm = ptr; pm <= pe; pm++) switch (*pm) { @@ -378,7 +396,9 @@ globexp2(const Char *ptr, const Char *pa #ifdef DEBUG qprintf("globexp2:", patbuf); #endif - *rv = globexp1(patbuf, pglob, limit); + rv = globexp1(patbuf, pglob, limit); + if (rv) + return (rv); /* move after the comma, to the next string */ pl = pm + 1; @@ -388,7 +408,6 @@ globexp2(const Char *ptr, const Char *pa default: break; } - *rv = 0; return (0); } @@ -401,9 +420,15 @@ static const Char * globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob) { struct passwd *pwd; - char *h; + char *h, *sc; const Char *p; Char *b, *eb; + wchar_t wc; + wchar_t wbuf[MAXPATHLEN]; + wchar_t *wbufend, *dc; + size_t clen; + mbstate_t mbs; + int too_long; if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE)) return (pattern); @@ -412,13 +437,17 @@ globtilde(const Char *pattern, Char *pat * Copy up to the end of the string or / */ eb = &patbuf[patbuf_len - 1]; - for (p = pattern + 1, h = (char *) patbuf; - h < (char *)eb && *p && *p != SLASH; *h++ = *p++) + for (p = pattern + 1, b = patbuf; + b < eb && *p != EOS && UNPROT(*p) != SEP; *b++ = *p++) continue; - *h = EOS; + if (*p != EOS && UNPROT(*p) != SEP) + return (NULL); + + *b = EOS; + h = NULL; - if (((char *) patbuf)[0] == EOS) { + if (patbuf[0] == EOS) { /* * handle a plain ~ or ~/ by expanding $HOME first (iff * we're not running setuid or setgid) and then trying @@ -438,20 +467,56 @@ globtilde(const Char *pattern, Char *pat /* * Expand a ~user */ - if ((pwd = getpwnam((char*) patbuf)) == NULL) + if (g_Ctoc(patbuf, (char *)wbuf, sizeof(wbuf))) + return (NULL); + if ((pwd = getpwnam((char *)wbuf)) == NULL) return (pattern); else h = pwd->pw_dir; } /* Copy the home directory */ - for (b = patbuf; b < eb && *h; *b++ = *h++) + dc = wbuf; + sc = h; + wbufend = wbuf + MAXPATHLEN - 1; + too_long = 1; + memset(&mbs, 0, sizeof(mbs)); + while (dc <= wbufend) { + clen = mbrtowc(&wc, sc, MB_LEN_MAX, &mbs); + if (clen == (size_t)-1 || clen == (size_t)-2) { + /* XXX See initial comment #2. */ + wc = (unsigned char)*sc; + clen = 1; + memset(&mbs, 0, sizeof(mbs)); + } + if ((*dc++ = wc) == EOS) { + too_long = 0; + break; + } + sc += clen; + } + if (too_long) + return (NULL); + + dc = wbuf; + for (b = patbuf; b < eb && *dc != EOS; *b++ = *dc++ | M_PROTECT) continue; + if (*dc != EOS) + return (NULL); /* Append the rest of the pattern */ - while (b < eb && (*b++ = *p++) != EOS) - continue; - *b = EOS; + if (*p != EOS) { + too_long = 1; + while (b <= eb) { + if ((*b++ = *p++) == EOS) { + too_long = 0; + break; + } + } + if (too_long) + return (NULL); + } else + *b = EOS; return (patbuf); } @@ -464,14 +529,18 @@ globtilde(const Char *pattern, Char *pat * if things went well, nonzero if errors occurred. */ static int -glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit) -{ +glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit, + const char *origpat) { const Char *qpatnext; int err; size_t oldpathc; Char *bufnext, c, patbuf[MAXPATHLEN]; qpatnext = globtilde(pattern, patbuf, MAXPATHLEN, pglob); + if (qpatnext == NULL) { + errno = E2BIG; + return (GLOB_NOSPACE); + } oldpathc = pglob->gl_pathc; bufnext = patbuf; @@ -530,30 +599,29 @@ glob0(const Char *pattern, glob_t *pglob if ((err = glob1(patbuf, pglob, limit)) != 0) return(err); - /* - * If there was no match we are going to append the pattern - * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified - * and the pattern did not contain any magic characters - * GLOB_NOMAGIC is there just for compatibility with csh. - */ - if (pglob->gl_pathc == oldpathc) { - if (((pglob->gl_flags & GLOB_NOCHECK) || - ((pglob->gl_flags & GLOB_NOMAGIC) && - !(pglob->gl_flags & GLOB_MAGCHAR)))) - return (globextend(pattern, pglob, limit)); - else - return (GLOB_NOMATCH); - } + if (origpat != NULL) + return (globfinal(pglob, limit, oldpathc, origpat)); + + return (0); +} + +static int +globfinal(glob_t *pglob, struct glob_limit *limit, size_t oldpathc, + const char *origpat) { + if (pglob->gl_pathc == oldpathc) + return (err_nomatch(pglob, limit, origpat)); + if (!(pglob->gl_flags & GLOB_NOSORT)) qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc, pglob->gl_pathc - oldpathc, sizeof(char *), compare); + return (0); } static int compare(const void *p, const void *q) { - return (strcmp(*(char **)p, *(char **)q)); + return (strcoll(*(char **)p, *(char **)q)); } static int @@ -593,44 +661,47 @@ glob2(Char *pathbuf, Char *pathend, Char if ((pglob->gl_flags & GLOB_LIMIT) && limit->l_stat_cnt++ >= GLOB_LIMIT_STAT) { - errno = 0; - if (pathend + 1 > pathend_last) - return (GLOB_ABORTED); - *pathend++ = SEP; - *pathend = EOS; + errno = E2BIG; return (GLOB_NOSPACE); } - if (((pglob->gl_flags & GLOB_MARK) && - pathend[-1] != SEP) && (S_ISDIR(sb.st_mode) - || (S_ISLNK(sb.st_mode) && - (g_stat(pathbuf, &sb, pglob) == 0) && + if ((pglob->gl_flags & GLOB_MARK) && + UNPROT(pathend[-1]) != SEP && + (S_ISDIR(sb.st_mode) || + (S_ISLNK(sb.st_mode) && + g_stat(pathbuf, &sb, pglob) == 0 && S_ISDIR(sb.st_mode)))) { - if (pathend + 1 > pathend_last) - return (GLOB_ABORTED); + if (pathend + 1 > pathend_last) { + errno = E2BIG; + return (GLOB_NOSPACE); + } *pathend++ = SEP; *pathend = EOS; } ++pglob->gl_matchc; - return (globextend(pathbuf, pglob, limit)); + return (globextend(pathbuf, pglob, limit, NULL)); } /* Find end of next segment, copy tentatively to pathend. */ q = pathend; p = pattern; - while (*p != EOS && *p != SEP) { + while (*p != EOS && UNPROT(*p) != SEP) { if (ismeta(*p)) anymeta = 1; - if (q + 1 > pathend_last) - return (GLOB_ABORTED); + if (q + 1 > pathend_last) { + errno = E2BIG; + return (GLOB_NOSPACE); + } *q++ = *p++; } if (!anymeta) { /* No expansion, do next segment. */ pathend = q; pattern = p; - while (*pattern == SEP) { - if (pathend + 1 > pathend_last) - return (GLOB_ABORTED); + while (UNPROT(*pattern) == SEP) { + if (pathend + 1 > pathend_last) { + errno = E2BIG; + return (GLOB_NOSPACE); + } *pathend++ = *pattern++; } } else /* Need expansion, recurse. */ @@ -647,42 +718,44 @@ glob3(Char *pathbuf, Char *pathend, Char { struct dirent *dp; DIR *dirp; - int err; - char buf[MAXPATHLEN]; + int err, too_long, saverrno, saverrno2; + char buf[MAXPATHLEN + MB_LEN_MAX - 1]; - /* - * The readdirfunc declaration can't be prototyped, because it is - * assigned, below, to two functions which are prototyped in glob.h - * and dirent.h as taking pointers to differently typed opaque - * structures. - */ - struct dirent *(*readdirfunc)(); + struct dirent *(*readdirfunc)(DIR *); - if (pathend > pathend_last) - return (GLOB_ABORTED); + if (pathend > pathend_last) { + errno = E2BIG; + return (GLOB_NOSPACE); + } *pathend = EOS; - errno = 0; + if (pglob->gl_errfunc != NULL && + g_Ctoc(pathbuf, buf, sizeof(buf))) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + saverrno = errno; + errno = 0; if ((dirp = g_opendir(pathbuf, pglob)) == NULL) { - /* TODO: don't call for ENOENT or ENOTDIR? */ - if (pglob->gl_errfunc) { - if (g_Ctoc(pathbuf, buf, sizeof(buf))) - return (GLOB_ABORTED); - if (pglob->gl_errfunc(buf, errno) || - pglob->gl_flags & GLOB_ERR) - return (GLOB_ABORTED); - } - return (0); + if (errno == ENOENT || errno == ENOTDIR) + return (0); + err = err_aborted(pglob, errno, buf); + if (errno == 0) + errno = saverrno; + return (err); } err = 0; - /* Search directory for matching names. */ + /* pglob->gl_readdir takes a void *, fix this manually */ if (pglob->gl_flags & GLOB_ALTDIRFUNC) - readdirfunc = pglob->gl_readdir; + readdirfunc = (struct dirent *(*)(DIR *))pglob->gl_readdir; else readdirfunc = readdir; - while ((dp = (*readdirfunc)(dirp))) { + + errno = 0; + /* Search directory for matching names. */ + while ((dp = (*readdirfunc)(dirp)) != NULL) { char *sc; Char *dc; wchar_t wc; @@ -691,49 +764,70 @@ glob3(Char *pathbuf, Char *pathend, Char if ((pglob->gl_flags & GLOB_LIMIT) && limit->l_readdir_cnt++ >= GLOB_LIMIT_READDIR) { - errno = 0; - if (pathend + 1 > pathend_last) - err = GLOB_ABORTED; - else { - *pathend++ = SEP; - *pathend = EOS; - err = GLOB_NOSPACE; - } + errno = E2BIG; + err = GLOB_NOSPACE; break; } /* Initial DOT must be matched literally. */ - if (dp->d_name[0] == DOT && *pattern != DOT) + if (dp->d_name[0] == '.' && UNPROT(*pattern) != DOT) { + errno = 0; continue; + } memset(&mbs, 0, sizeof(mbs)); dc = pathend; sc = dp->d_name; - while (dc < pathend_last) { + too_long = 1; + while (dc <= pathend_last) { clen = mbrtowc(&wc, sc, MB_LEN_MAX, &mbs); if (clen == (size_t)-1 || clen == (size_t)-2) { - wc = *sc; + /* XXX See initial comment #2. */ + wc = (unsigned char)*sc; clen = 1; memset(&mbs, 0, sizeof(mbs)); } - if ((*dc++ = wc) == EOS) + if ((*dc++ = wc) == EOS) { + too_long = 0; break; + } sc += clen; } - if (!match(pathend, pattern, restpattern)) { + if (too_long && (err = err_aborted(pglob, ENAMETOOLONG, + buf))) { + errno = ENAMETOOLONG; + break; + } + if (too_long || !match(pathend, pattern, restpattern)) { *pathend = EOS; + errno = 0; continue; } + if (errno == 0) + errno = saverrno; err = glob2(pathbuf, --dc, pathend_last, restpattern, pglob, limit); if (err) break; + errno = 0; } + saverrno2 = errno; if (pglob->gl_flags & GLOB_ALTDIRFUNC) (*pglob->gl_closedir)(dirp); else closedir(dirp); - return (err); + errno = saverrno2; + + if (err) + return (err); + + if (dp == NULL && errno != 0 && + (err = err_aborted(pglob, errno, buf))) + return (err); + + if (errno == 0) + errno = saverrno; + return (0); } @@ -752,7 +846,8 @@ glob3(Char *pathbuf, Char *pathend, Char * gl_pathv points to (gl_offs + gl_pathc + 1) items. */ static int -globextend(const Char *path, glob_t *pglob, struct glob_limit *limit) +globextend(const Char *path, glob_t *pglob, struct glob_limit *limit, + const char *origpat) { char **pathv; size_t i, newsize, len; @@ -761,7 +856,7 @@ globextend(const Char *path, glob_t *pgl if ((pglob->gl_flags & GLOB_LIMIT) && pglob->gl_matchc > limit->l_path_lim) { - errno = 0; + errno = E2BIG; return (GLOB_NOSPACE); } @@ -779,18 +874,26 @@ globextend(const Char *path, glob_t *pgl } pglob->gl_pathv = pathv; - for (p = path; *p++;) - continue; - len = MB_CUR_MAX * (size_t)(p - path); /* XXX overallocation */ - limit->l_string_cnt += len; - if ((pglob->gl_flags & GLOB_LIMIT) && - limit->l_string_cnt >= GLOB_LIMIT_STRING) { - errno = 0; - return (GLOB_NOSPACE); + if (origpat != NULL) + copy = strdup(origpat); + else { + for (p = path; *p++ != EOS;) + continue; + len = MB_CUR_MAX * (size_t)(p - path); /* XXX overallocation */ + if ((copy = malloc(len)) != NULL) { + if (g_Ctoc(path, copy, len)) { + free(copy); + errno = E2BIG; + return (GLOB_NOSPACE); + } + } } - if ((copy = malloc(len)) != NULL) { - if (g_Ctoc(path, copy, len)) { + if (copy != NULL) { + limit->l_string_cnt += strlen(copy) + 1; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_string_cnt >= GLOB_LIMIT_STRING) { free(copy); + errno = E2BIG; return (GLOB_NOSPACE); } pathv[pglob->gl_offs + pglob->gl_pathc++] = copy; @@ -830,15 +933,17 @@ match(Char *name, Char *pat, Char *paten ok = 0; if ((k = *name++) == EOS) return (0); - if ((negate_range = ((*pat & M_MASK) == M_NOT)) != EOS) + if ((negate_range = ((*pat & M_MASK) == M_NOT)) != 0) ++pat; while (((c = *pat++) & M_MASK) != M_END) if ((*pat & M_MASK) == M_RNG) { if (table->__collate_load_error ? - CHAR(c) <= CHAR(k) && CHAR(k) <= CHAR(pat[1]) : - __wcollate_range_cmp(CHAR(c), CHAR(k)) <= 0 - && __wcollate_range_cmp(CHAR(k), CHAR(pat[1])) <= 0 - ) + CHAR(c) <= CHAR(k) && + CHAR(k) <= CHAR(pat[1]) : + __wcollate_range_cmp(CHAR(c), + CHAR(k)) <= 0 && + __wcollate_range_cmp(CHAR(k), + CHAR(pat[1])) <= 0) ok = 1; pat += 2; } else if (c == k) @@ -875,13 +980,15 @@ globfree(glob_t *pglob) static DIR * g_opendir(Char *str, glob_t *pglob) { - char buf[MAXPATHLEN]; + char buf[MAXPATHLEN + MB_LEN_MAX - 1]; - if (!*str) + if (*str == EOS) strcpy(buf, "."); else { - if (g_Ctoc(str, buf, sizeof(buf))) + if (g_Ctoc(str, buf, sizeof(buf))) { + errno = ENAMETOOLONG; return (NULL); + } } if (pglob->gl_flags & GLOB_ALTDIRFUNC) @@ -893,7 +1000,7 @@ g_opendir(Char *str, glob_t *pglob) static int g_lstat(Char *fn, struct stat *sb, glob_t *pglob) { - char buf[MAXPATHLEN]; + char buf[MAXPATHLEN + MB_LEN_MAX - 1]; if (g_Ctoc(fn, buf, sizeof(buf))) { errno = ENAMETOOLONG; @@ -907,7 +1014,7 @@ g_lstat(Char *fn, struct stat *sb, glob_ static int g_stat(Char *fn, struct stat *sb, glob_t *pglob) { - char buf[MAXPATHLEN]; + char buf[MAXPATHLEN + MB_LEN_MAX - 1]; if (g_Ctoc(fn, buf, sizeof(buf))) { errno = ENAMETOOLONG; @@ -937,10 +1044,14 @@ g_Ctoc(const Char *str, char *buf, size_ memset(&mbs, 0, sizeof(mbs)); while (len >= MB_CUR_MAX) { - clen = wcrtomb(buf, *str, &mbs); - if (clen == (size_t)-1) - return (1); - if (*str == L'\0') + clen = wcrtomb(buf, CHAR(*str), &mbs); + if (clen == (size_t)-1) { + /* XXX See initial comment #2. */ + *buf = (char)CHAR(*str); + clen = 1; + memset(&mbs, 0, sizeof(mbs)); + } + if (CHAR(*str) == EOS) return (0); str++; buf += clen; @@ -949,21 +1060,46 @@ g_Ctoc(const Char *str, char *buf, size_ return (1); } +static int +err_nomatch(glob_t *pglob, struct glob_limit *limit, const char *origpat) { + /* + * If there was no match we are going to append the origpat + * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified + * and the origpat did not contain any magic characters + * GLOB_NOMAGIC is there just for compatibility with csh. + */ + if ((pglob->gl_flags & GLOB_NOCHECK) || + ((pglob->gl_flags & GLOB_NOMAGIC) && + !(pglob->gl_flags & GLOB_MAGCHAR))) + return (globextend(NULL, pglob, limit, origpat)); + return (GLOB_NOMATCH); +} + +static int +err_aborted(glob_t *pglob, int err, char *buf) { + if ((pglob->gl_errfunc != NULL && pglob->gl_errfunc(buf, err)) || + (pglob->gl_flags & GLOB_ERR)) + return (GLOB_ABORTED); + return (0); +} + #ifdef DEBUG static void qprintf(const char *str, Char *s) { Char *p; - (void)printf("%s:\n", str); - for (p = s; *p; p++) - (void)printf("%c", CHAR(*p)); - (void)printf("\n"); - for (p = s; *p; p++) - (void)printf("%c", *p & M_PROTECT ? '"' : ' '); - (void)printf("\n"); - for (p = s; *p; p++) - (void)printf("%c", ismeta(*p) ? '_' : ' '); - (void)printf("\n"); + (void)printf("%s\n", str); + if (s != NULL) { + for (p = s; *p != EOS; p++) + (void)printf("%c", (char)CHAR(*p)); + (void)printf("\n"); + for (p = s; *p != EOS; p++) + (void)printf("%c", (isprot(*p) ? '\\' : ' ')); + (void)printf("\n"); + for (p = s; *p != EOS; p++) + (void)printf("%c", (ismeta(*p) ? '_' : ' ')); + (void)printf("\n"); + } } #endif From owner-svn-src-all@freebsd.org Tue Aug 16 07:26:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52033BBB8F2; Tue, 16 Aug 2016 07:26:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1467311FC; Tue, 16 Aug 2016 07:26:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G7QsIU065561; Tue, 16 Aug 2016 07:26:54 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G7Qr4T065557; Tue, 16 Aug 2016 07:26:53 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608160726.u7G7Qr4T065557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 16 Aug 2016 07:26:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304204 - in head/sys/dev/hyperv: include netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 07:26:55 -0000 Author: sephe Date: Tue Aug 16 07:26:53 2016 New Revision: 304204 URL: https://svnweb.freebsd.org/changeset/base/304204 Log: hyperv/hn: Factor out hn_nvs_send/hn_nvs_send_sglist Avoid unnecessary message type setting and centralize the send context to transaction id cast. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7500 Modified: head/sys/dev/hyperv/include/vmbus.h head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/include/vmbus.h ============================================================================== --- head/sys/dev/hyperv/include/vmbus.h Tue Aug 16 07:14:09 2016 (r304203) +++ head/sys/dev/hyperv/include/vmbus.h Tue Aug 16 07:26:53 2016 (r304204) @@ -83,6 +83,7 @@ struct vmbus_chanpkt_hdr { #define VMBUS_CHANPKT_TYPE_GPA 0x0009 #define VMBUS_CHANPKT_TYPE_COMP 0x000b +#define VMBUS_CHANPKT_FLAG_NONE 0 #define VMBUS_CHANPKT_FLAG_RC 0x0001 /* report completion */ #define VMBUS_CHANPKT_CONST_DATA(pkt) \ Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 16 07:14:09 2016 (r304203) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 16 07:26:53 2016 (r304204) @@ -206,9 +206,8 @@ hv_nv_init_rx_buffer_with_net_vsp(struct hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); vmbus_xact_activate(xact); - error = vmbus_chan_send(sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - conn, sizeof(*conn), (uint64_t)(uintptr_t)&sndc); + error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, + conn, sizeof(*conn), &sndc); if (error != 0) { if_printf(sc->hn_ifp, "send nvs rxbuf conn failed: %d\n", error); @@ -313,9 +312,8 @@ hv_nv_init_send_buffer_with_net_vsp(stru hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); vmbus_xact_activate(xact); - error = vmbus_chan_send(sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - chim, sizeof(*chim), (uint64_t)(uintptr_t)&sndc); + error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, + chim, sizeof(*chim), &sndc); if (error) { if_printf(sc->hn_ifp, "send nvs chim conn failed: %d\n", error); @@ -393,9 +391,10 @@ hv_nv_destroy_rx_buffer(netvsc_dev *net_ disconn.nvs_type = HN_NVS_TYPE_RXBUF_DISCONN; disconn.nvs_sig = HN_NVS_RXBUF_SIG; - ret = vmbus_chan_send(net_dev->sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, 0, &disconn, sizeof(disconn), - (uint64_t)(uintptr_t)&hn_send_ctx_none); + /* NOTE: No response. */ + ret = hn_nvs_send(net_dev->sc->hn_prichan, + VMBUS_CHANPKT_FLAG_NONE, &disconn, sizeof(disconn), + &hn_send_ctx_none); if (ret != 0) { if_printf(net_dev->sc->hn_ifp, "send rxbuf disconn failed: %d\n", ret); @@ -445,9 +444,10 @@ hv_nv_destroy_send_buffer(netvsc_dev *ne disconn.nvs_type = HN_NVS_TYPE_CHIM_DISCONN; disconn.nvs_sig = HN_NVS_CHIM_SIG; - ret = vmbus_chan_send(net_dev->sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, 0, &disconn, sizeof(disconn), - (uint64_t)(uintptr_t)&hn_send_ctx_none); + /* NOTE: No response. */ + ret = hn_nvs_send(net_dev->sc->hn_prichan, + VMBUS_CHANPKT_FLAG_NONE, &disconn, sizeof(disconn), + &hn_send_ctx_none); if (ret != 0) { if_printf(net_dev->sc->hn_ifp, "send chim disconn failed: %d\n", ret); @@ -509,9 +509,8 @@ hv_nv_negotiate_nvsp_protocol(struct hn_ vmbus_xact_activate(xact); hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); - error = vmbus_chan_send(sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - init, sizeof(*init), (uint64_t)(uintptr_t)&sndc); + error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, + init, sizeof(*init), &sndc); if (error) { if_printf(sc->hn_ifp, "send nvs init failed: %d\n", error); vmbus_xact_deactivate(xact); @@ -560,8 +559,9 @@ hv_nv_send_ndis_config(struct hn_softc * conf.nvs_mtu = mtu; conf.nvs_caps = HN_NVS_NDIS_CONF_VLAN; - error = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0, - &conf, sizeof(conf), (uint64_t)(uintptr_t)&hn_send_ctx_none); + /* NOTE: No response. */ + error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE, + &conf, sizeof(conf), &hn_send_ctx_none); if (error) if_printf(sc->hn_ifp, "send nvs ndis conf failed: %d\n", error); return (error); @@ -627,8 +627,9 @@ hv_nv_connect_to_vsp(struct hn_softc *sc else ndis.nvs_ndis_minor = NDIS_VERSION_MINOR_30; - ret = vmbus_chan_send(sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0, - &ndis, sizeof(ndis), (uint64_t)(uintptr_t)&hn_send_ctx_none); + /* NOTE: No response. */ + ret = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE, + &ndis, sizeof(ndis), &hn_send_ctx_none); if (ret != 0) { if_printf(sc->hn_ifp, "send nvs ndis init failed: %d\n", ret); goto cleanup; @@ -834,12 +835,11 @@ hv_nv_on_send(struct vmbus_channel *chan sndc->hn_chim_sz; if (gpa_cnt) { - ret = vmbus_chan_send_sglist(chan, gpa, gpa_cnt, - &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)sndc); + ret = hn_nvs_send_sglist(chan, gpa, gpa_cnt, + &send_msg, sizeof(nvsp_msg), sndc); } else { - ret = vmbus_chan_send(chan, - VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - &send_msg, sizeof(nvsp_msg), (uint64_t)(uintptr_t)sndc); + ret = hn_nvs_send(chan, VMBUS_CHANPKT_FLAG_RC, + &send_msg, sizeof(nvsp_msg), sndc); } return (ret); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 16 07:14:09 2016 (r304203) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 16 07:26:53 2016 (r304204) @@ -1177,9 +1177,8 @@ hv_rf_on_device_add(struct hn_softc *sc, hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); vmbus_xact_activate(xact); - ret = vmbus_chan_send(sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, VMBUS_CHANPKT_FLAG_RC, - req, sizeof(*req), (uint64_t)(uintptr_t)&sndc); + ret = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, + req, sizeof(*req), &sndc); if (ret != 0) { if_printf(sc->hn_ifp, "send nvs subch req failed: %d\n", ret); vmbus_xact_deactivate(xact); Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Aug 16 07:14:09 2016 (r304203) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Aug 16 07:26:53 2016 (r304204) @@ -30,6 +30,8 @@ #define _IF_HNVAR_H_ #include + +#include #include struct netvsc_dev_; @@ -61,6 +63,7 @@ static __inline void hn_send_ctx_init(struct hn_send_ctx *sndc, hn_sent_callback_t cb, void *cbarg, uint32_t chim_idx, int chim_sz) { + sndc->hn_cb = cb; sndc->hn_cbarg = cbarg; sndc->hn_chim_idx = chim_idx; @@ -71,10 +74,29 @@ static __inline void hn_send_ctx_init_simple(struct hn_send_ctx *sndc, hn_sent_callback_t cb, void *cbarg) { + hn_send_ctx_init(sndc, cb, cbarg, NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX, 0); } +static __inline int +hn_nvs_send(struct vmbus_channel *chan, uint16_t flags, + void *nvs_msg, int nvs_msglen, struct hn_send_ctx *sndc) +{ + + return (vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_INBAND, flags, + nvs_msg, nvs_msglen, (uint64_t)(uintptr_t)sndc)); +} + +static __inline int +hn_nvs_send_sglist(struct vmbus_channel *chan, struct vmbus_gpa sg[], int sglen, + void *nvs_msg, int nvs_msglen, struct hn_send_ctx *sndc) +{ + + return (vmbus_chan_send_sglist(chan, sg, sglen, nvs_msg, nvs_msglen, + (uint64_t)(uintptr_t)sndc)); +} + void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, const struct nvsp_msg_ *msg, int dlen); From owner-svn-src-all@freebsd.org Tue Aug 16 07:37:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CECFDBBBAF6; Tue, 16 Aug 2016 07:37:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA386172C; Tue, 16 Aug 2016 07:37:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G7b2ZG069172; Tue, 16 Aug 2016 07:37:02 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G7b2vm069166; Tue, 16 Aug 2016 07:37:02 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608160737.u7G7b2vm069166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 16 Aug 2016 07:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304205 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 07:37:03 -0000 Author: sephe Date: Tue Aug 16 07:37:02 2016 New Revision: 304205 URL: https://svnweb.freebsd.org/changeset/base/304205 Log: hyperv/hn: Simplify RNDIS NVS message sending. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7501 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnreg.h head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 16 07:26:53 2016 (r304204) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 16 07:37:02 2016 (r304205) @@ -118,7 +118,7 @@ hv_nv_get_next_send_section(netvsc_dev * unsigned long bitsmap_words = net_dev->bitsmap_words; unsigned long *bitsmap = net_dev->send_section_bitsmap; unsigned long idx; - int ret = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; + int ret = HN_NVS_CHIM_IDX_INVALID; int i; for (i = 0; i < bitsmap_words; i++) { @@ -814,32 +814,23 @@ hv_nv_on_send_completion(netvsc_dev *net * Returns 0 on success, non-zero on failure. */ int -hv_nv_on_send(struct vmbus_channel *chan, bool is_data_pkt, +hv_nv_on_send(struct vmbus_channel *chan, uint32_t rndis_mtype, struct hn_send_ctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt) { - nvsp_msg send_msg; + struct hn_nvs_rndis rndis; int ret; - send_msg.hdr.msg_type = nvsp_msg_1_type_send_rndis_pkt; - if (is_data_pkt) { - /* 0 is RMC_DATA */ - send_msg.msgs.vers_1_msgs.send_rndis_pkt.chan_type = 0; - } else { - /* 1 is RMC_CONTROL */ - send_msg.msgs.vers_1_msgs.send_rndis_pkt.chan_type = 1; - } - - send_msg.msgs.vers_1_msgs.send_rndis_pkt.send_buf_section_idx = - sndc->hn_chim_idx; - send_msg.msgs.vers_1_msgs.send_rndis_pkt.send_buf_section_size = - sndc->hn_chim_sz; + rndis.nvs_type = HN_NVS_TYPE_RNDIS; + rndis.nvs_rndis_mtype = rndis_mtype; + rndis.nvs_chim_idx = sndc->hn_chim_idx; + rndis.nvs_chim_sz = sndc->hn_chim_sz; if (gpa_cnt) { ret = hn_nvs_send_sglist(chan, gpa, gpa_cnt, - &send_msg, sizeof(nvsp_msg), sndc); + &rndis, sizeof(rndis), sndc); } else { ret = hn_nvs_send(chan, VMBUS_CHANPKT_FLAG_RC, - &send_msg, sizeof(nvsp_msg), sndc); + &rndis, sizeof(rndis), sndc); } return (ret); Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Aug 16 07:26:53 2016 (r304204) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Aug 16 07:37:02 2016 (r304205) @@ -1256,7 +1256,7 @@ netvsc_dev *hv_nv_on_device_add(struct h void *additional_info, struct hn_rx_ring *rxr); int hv_nv_on_device_remove(struct hn_softc *sc, boolean_t destroy_channel); -int hv_nv_on_send(struct vmbus_channel *chan, bool is_data_pkt, +int hv_nv_on_send(struct vmbus_channel *chan, uint32_t rndis_mtype, struct hn_send_ctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt); int hv_nv_get_next_send_section(netvsc_dev *net_dev); void hv_nv_subchan_attach(struct vmbus_channel *chan, Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Aug 16 07:26:53 2016 (r304204) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Aug 16 07:37:02 2016 (r304205) @@ -798,7 +798,7 @@ hn_tx_done(struct hn_send_ctx *sndc, str struct hn_txdesc *txd = sndc->hn_cbarg; struct hn_tx_ring *txr; - if (sndc->hn_chim_idx != NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) + if (sndc->hn_chim_idx != HN_NVS_CHIM_IDX_INVALID) hn_chim_free(net_dev, sndc->hn_chim_idx); txr = txd->txr; @@ -988,8 +988,7 @@ hn_encap(struct hn_tx_ring *txr, struct txr->hn_tx_chimney_tried++; send_buf_section_idx = hv_nv_get_next_send_section(net_dev); - if (send_buf_section_idx != - NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) { + if (send_buf_section_idx != HN_NVS_CHIM_IDX_INVALID) { uint8_t *dest = ((uint8_t *)net_dev->send_buf + (send_buf_section_idx * net_dev->send_section_size)); @@ -1045,7 +1044,7 @@ hn_encap(struct hn_tx_ring *txr, struct gpa->gpa_len = segs[i].ds_len; } - send_buf_section_idx = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; + send_buf_section_idx = HN_NVS_CHIM_IDX_INVALID; send_buf_section_size = 0; done: txd->m = m_head; @@ -1072,8 +1071,8 @@ again: * Make sure that txd is not freed before ETHER_BPF_MTAP. */ hn_txdesc_hold(txd); - error = hv_nv_on_send(txr->hn_chan, true, &txd->send_ctx, - txr->hn_gpa, txr->hn_gpa_cnt); + error = hv_nv_on_send(txr->hn_chan, HN_NVS_RNDIS_MTYPE_DATA, + &txd->send_ctx, txr->hn_gpa, txr->hn_gpa_cnt); if (!error) { ETHER_BPF_MTAP(ifp, txd->m); if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 16 07:26:53 2016 (r304204) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Tue Aug 16 07:37:02 2016 (r304205) @@ -277,8 +277,7 @@ hv_rf_send_request(rndis_device *device, if (tot_data_buf_len < net_dev->send_section_size) { send_buf_section_idx = hv_nv_get_next_send_section(net_dev); - if (send_buf_section_idx != - NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) { + if (send_buf_section_idx != HN_NVS_CHIM_IDX_INVALID) { char *dest = ((char *)net_dev->send_buf + send_buf_section_idx * net_dev->send_section_size); @@ -289,14 +288,14 @@ hv_rf_send_request(rndis_device *device, } /* Failed to allocate chimney send buffer; move on */ } - send_buf_section_idx = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX; + send_buf_section_idx = HN_NVS_CHIM_IDX_INVALID; send_buf_section_size = 0; sendit: hn_send_ctx_init(&request->send_ctx, cb, request, send_buf_section_idx, send_buf_section_size); - return hv_nv_on_send(device->net_dev->sc->hn_prichan, false, - &request->send_ctx, gpa, gpa_cnt); + return hv_nv_on_send(device->net_dev->sc->hn_prichan, + HN_NVS_RNDIS_MTYPE_CTRL, &request->send_ctx, gpa, gpa_cnt); } /* @@ -1276,7 +1275,7 @@ hn_rndis_sent_cb(struct hn_send_ctx *snd struct vmbus_channel *chan __unused, const struct nvsp_msg_ *msg __unused, int dlen __unused) { - if (sndc->hn_chim_idx != NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) + if (sndc->hn_chim_idx != HN_NVS_CHIM_IDX_INVALID) hn_chim_free(net_dev, sndc->hn_chim_idx); } @@ -1287,7 +1286,7 @@ hn_rndis_sent_halt(struct hn_send_ctx *s { rndis_request *request = sndc->hn_cbarg; - if (sndc->hn_chim_idx != NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) + if (sndc->hn_chim_idx != HN_NVS_CHIM_IDX_INVALID) hn_chim_free(net_dev, sndc->hn_chim_idx); /* Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Tue Aug 16 07:26:53 2016 (r304204) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Tue Aug 16 07:37:02 2016 (r304205) @@ -35,8 +35,19 @@ #define HN_NVS_RXBUF_SIG 0xcafe #define HN_NVS_CHIM_SIG 0xface +#define HN_NVS_CHIM_IDX_INVALID 0xffffffff + +#define HN_NVS_RNDIS_MTYPE_DATA 0 +#define HN_NVS_RNDIS_MTYPE_CTRL 1 + +/* + * NVS message transacion status codes. + */ #define HN_NVS_STATUS_OK 1 +/* + * NVS request/response message types. + */ #define HN_NVS_TYPE_INIT 1 #define HN_NVS_TYPE_INIT_RESP 2 #define HN_NVS_TYPE_NDIS_INIT 100 @@ -46,6 +57,7 @@ #define HN_NVS_TYPE_CHIM_CONN 104 #define HN_NVS_TYPE_CHIM_CONNRESP 105 #define HN_NVS_TYPE_CHIM_DISCONN 106 +#define HN_NVS_TYPE_RNDIS 107 #define HN_NVS_TYPE_NDIS_CONF 125 #define HN_NVS_TYPE_SUBCH_REQ 133 #define HN_NVS_TYPE_SUBCH_RESP 133 /* same as SUBCH_REQ */ @@ -162,4 +174,21 @@ struct hn_nvs_subch_resp { uint32_t nvs_nsubch; } __packed; +struct hn_nvs_rndis { + uint32_t nvs_type; /* HN_NVS_TYPE_RNDIS */ + uint32_t nvs_rndis_mtype;/* HN_NVS_RNDIS_MTYPE_ */ + /* + * Chimney sending buffer index and size. + * + * NOTE: + * If nvs_chim_idx is set to HN_NVS_CHIM_IDX_INVALID + * and nvs_chim_sz is set to 0, then chimney sending + * buffer is _not_ used by this RNDIS message. + */ + uint32_t nvs_chim_idx; + uint32_t nvs_chim_sz; + uint8_t nvs_rsvd[16]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_rndis) >= HN_NVS_REQSIZE_MIN); + #endif /* !_IF_HNREG_H_ */ Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Aug 16 07:26:53 2016 (r304204) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Tue Aug 16 07:37:02 2016 (r304205) @@ -32,7 +32,7 @@ #include #include -#include +#include struct netvsc_dev_; struct nvsp_msg_; @@ -51,12 +51,12 @@ struct hn_send_ctx { int hn_chim_sz; }; -#define HN_SEND_CTX_INITIALIZER(cb, cbarg) \ -{ \ - .hn_cb = cb, \ - .hn_cbarg = cbarg, \ - .hn_chim_idx = NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX, \ - .hn_chim_sz = 0 \ +#define HN_SEND_CTX_INITIALIZER(cb, cbarg) \ +{ \ + .hn_cb = cb, \ + .hn_cbarg = cbarg, \ + .hn_chim_idx = HN_NVS_CHIM_IDX_INVALID, \ + .hn_chim_sz = 0 \ } static __inline void @@ -75,8 +75,7 @@ hn_send_ctx_init_simple(struct hn_send_c void *cbarg) { - hn_send_ctx_init(sndc, cb, cbarg, - NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX, 0); + hn_send_ctx_init(sndc, cb, cbarg, HN_NVS_CHIM_IDX_INVALID, 0); } static __inline int From owner-svn-src-all@freebsd.org Tue Aug 16 07:45:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1CE0BBBEDA; Tue, 16 Aug 2016 07:45:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 598F31D60; Tue, 16 Aug 2016 07:45:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G7jZA9072851; Tue, 16 Aug 2016 07:45:35 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G7jZuC072849; Tue, 16 Aug 2016 07:45:35 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608160745.u7G7jZuC072849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 16 Aug 2016 07:45:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304206 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 07:45:36 -0000 Author: sephe Date: Tue Aug 16 07:45:35 2016 New Revision: 304206 URL: https://svnweb.freebsd.org/changeset/base/304206 Log: hyperv/hn: Simplify RNDIS message checks on RX path. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7502 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/if_hnreg.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 16 07:37:02 2016 (r304205) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Aug 16 07:45:35 2016 (r304206) @@ -847,19 +847,18 @@ hv_nv_on_receive(netvsc_dev *net_dev, st struct vmbus_channel *chan, const struct vmbus_chanpkt_hdr *pkthdr) { const struct vmbus_chanpkt_rxbuf *pkt; - const nvsp_msg *nvsp_msg_pkt; + const struct hn_nvs_hdr *nvs_hdr; netvsc_packet vsc_pkt; netvsc_packet *net_vsc_pkt = &vsc_pkt; int count = 0; int i = 0; int status = nvsp_status_success; - nvsp_msg_pkt = VMBUS_CHANPKT_CONST_DATA(pkthdr); - - /* Make sure this is a valid nvsp packet */ - if (nvsp_msg_pkt->hdr.msg_type != nvsp_msg_1_type_send_rndis_pkt) { - if_printf(rxr->hn_ifp, "packet hdr type %u is invalid!\n", - nvsp_msg_pkt->hdr.msg_type); + /* Make sure that this is a RNDIS message. */ + nvs_hdr = VMBUS_CHANPKT_CONST_DATA(pkthdr); + if (__predict_false(nvs_hdr->nvs_type != HN_NVS_TYPE_RNDIS)) { + if_printf(rxr->hn_ifp, "nvs type %u, not RNDIS\n", + nvs_hdr->nvs_type); return; } Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Tue Aug 16 07:37:02 2016 (r304205) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Tue Aug 16 07:45:35 2016 (r304206) @@ -69,6 +69,11 @@ */ #define HN_NVS_REQSIZE_MIN 32 +/* NVS message common header */ +struct hn_nvs_hdr { + uint32_t nvs_type; +} __packed; + struct hn_nvs_init { uint32_t nvs_type; /* HN_NVS_TYPE_INIT */ uint32_t nvs_ver_min; From owner-svn-src-all@freebsd.org Tue Aug 16 07:51:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C396BBB01B; Tue, 16 Aug 2016 07:51:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D6FF10FC; Tue, 16 Aug 2016 07:51:05 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G7p5ns073085; Tue, 16 Aug 2016 07:51:05 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G7p5GB073084; Tue, 16 Aug 2016 07:51:05 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608160751.u7G7p5GB073084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 16 Aug 2016 07:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304207 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 07:51:06 -0000 Author: adrian Date: Tue Aug 16 07:51:05 2016 New Revision: 304207 URL: https://svnweb.freebsd.org/changeset/base/304207 Log: [mips] fix use-before-initialised. Found by: gcc-5.3 Modified: head/sys/mips/mips/cpu.c Modified: head/sys/mips/mips/cpu.c ============================================================================== --- head/sys/mips/mips/cpu.c Tue Aug 16 07:45:35 2016 (r304206) +++ head/sys/mips/mips/cpu.c Tue Aug 16 07:51:05 2016 (r304207) @@ -164,6 +164,8 @@ mips_get_identity(struct mips_cpuinfo *c cfg1 = mips_rd_config1(); /* Get the Config2 and Config3 registers as well. */ + cfg2 = 0; + cfg3 = 0; if (cfg1 & MIPS_CONFIG1_M) { cfg2 = mips_rd_config2(); if (cfg2 & MIPS_CONFIG2_M) From owner-svn-src-all@freebsd.org Tue Aug 16 08:00:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 458FDBBB59C; Tue, 16 Aug 2016 08:00:44 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C22118C9; Tue, 16 Aug 2016 08:00:43 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id A1CA3206F8; Tue, 16 Aug 2016 04:00:42 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Tue, 16 Aug 2016 04:00:42 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=MIKhY3/2dP/h9R924J18/ZXRcpY=; b=CRcquC UGw/UagHMtBnH2GwEk5Uegoi6FXVrRAmG485xxFhJ35CLB2HgtC5cZy8A5o4JzmP NVHAJ3s/nUYDUGzTArkCBq/JRIMBpOkzTpTKhcYD0qZV0yuaJsBJibf2/fbUOzka IN9zhDoaoW6jJNvnP5s6OAmULxpAzitigbW88= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=MIKhY3/2dP/h9R9 24J18/ZXRcpY=; b=FEjEes/CiW+3yUuXz+N33Faqytrgmb85cLdom5XZoSgGp8N Ajs/ztfsuFBvp+K4cWWyyVvjIVkMZJNv79yuDLihH9qESaASzlJOBVmId+TVwEnc rDm2hc1bHTiMiVLg6/+QZ3RRnPspeJtjlv1d2MEl58RXIyFeEcncS4I5JwXQ= X-Sasl-enc: o9ejMMoyGaWST5bEOP0cBm2xQhPRO1iq0T3xAi5EAmrG 1471334442 Received: from pion.local (global-5-182.nat-2.net.cam.ac.uk [131.111.5.182]) by mail.messagingengine.com (Postfix) with ESMTPA id E14ABCCE69; Tue, 16 Aug 2016 04:00:41 -0400 (EDT) Subject: Re: svn commit: r304070 - svnadmin/conf To: Glen Barber , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org References: <201608140435.u7E4Z4Fm022554@repo.freebsd.org> From: Bruce Simpson Message-ID: <5a2ebac7-1909-75c2-2c10-502c735df1be@fastmail.net> Date: Tue, 16 Aug 2016 09:00:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608140435.u7E4Z4Fm022554@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 08:00:44 -0000 On 14/08/16 05:35, Glen Barber wrote: > Author: gjb > Date: Sun Aug 14 04:35:04 2016 > New Revision: 304070 > URL: https://svnweb.freebsd.org/changeset/base/304070 > > Log: > Do not include C function changes by default in svn commit > email. Please back out -- this makes the diff output much less useful. From owner-svn-src-all@freebsd.org Tue Aug 16 08:14:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C07ECBBB951; Tue, 16 Aug 2016 08:14:53 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id B11461199; Tue, 16 Aug 2016 08:14:53 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id AF4CD11E6; Tue, 16 Aug 2016 08:14:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Tue, 16 Aug 2016 08:14:51 +0000 From: Glen Barber To: Bruce Simpson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: Re: svn commit: r304070 - svnadmin/conf Message-ID: <20160816081451.GB46720@FreeBSD.org> References: <201608140435.u7E4Z4Fm022554@repo.freebsd.org> <5a2ebac7-1909-75c2-2c10-502c735df1be@fastmail.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Bn2rw/3z4jIqBvZU" Content-Disposition: inline In-Reply-To: <5a2ebac7-1909-75c2-2c10-502c735df1be@fastmail.net> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 08:14:53 -0000 --Bn2rw/3z4jIqBvZU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Aug 16, 2016 at 09:00:34AM +0100, Bruce Simpson wrote: > On 14/08/16 05:35, Glen Barber wrote: > >Author: gjb > >Date: Sun Aug 14 04:35:04 2016 > >New Revision: 304070 > >URL: https://svnweb.freebsd.org/changeset/base/304070 > > > >Log: > > Do not include C function changes by default in svn commit > > email. >=20 > Please back out -- this makes the diff output much less useful. >=20 https://svnweb.freebsd.org/changeset/base/304073 Glen --Bn2rw/3z4jIqBvZU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXsst2AAoJEAMUWKVHj+KTg/wP/2o1TWukuOWzjLYTjPCInZqb LtRUYzmOl5TdOfVbWzamHwjr4cG6L0MhwJiTzSA39rEAUuYL/AfSI4o35yN0U30E FpEQjG7M2okoh1rcoT6/LjiUZKREYxZ2sw7zpWrAF01TKBcDuQooJQzUU3bexwwS HnTkFGzxQ7nvD+8zN5ksihN3ywRxgv45ynGxzkAP/6c3boZCThvA3EQc/eaWxx3l tFeUVR4Ni1hGIWUP03DckU9Py01ElIlbF54RszZb7sEiI/D+rQNO32o/+UmbAElx 22zBPmWvhjp2e2L//nz+8XYr5LhT1unyuOgUm1vGOPB6hoZ1yP7GX3HyWJgzT/pF 0ce3FvRBeVE0bSSjk+qlPGg/TE/3WSTdYdk2aTwFYS9wuu82WB8thRIHN8LOfVd4 I4zQrylJhRoky1wMKVwURXeY5tampEpi+3AwScHFaJiPbVzLPBhWThbREClJa2gS /X2PAiq8IBrCzaiGpZqdLvBttMKHuwLX0dg/GWdKBeNGA6Gr5ejom+v44iHhAVLZ xKsQ3tkaRu3814AXNiMMVvsid5PDvkVEaalt7WVfgHZW9K2zxmdIWPOtm96UgnhM 7QgGCuSOGWQugZCglo+a2O+9BQ4VhCER/JdxySUEzCs4g/xvxPXOihmSx/LNncWR 2xj+JBYnf3OoZ0WfZqTy =ajDU -----END PGP SIGNATURE----- --Bn2rw/3z4jIqBvZU-- From owner-svn-src-all@freebsd.org Tue Aug 16 08:16:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BDCFBBB9CB; Tue, 16 Aug 2016 08:16:56 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFA631325; Tue, 16 Aug 2016 08:16:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G8GtUT084544; Tue, 16 Aug 2016 08:16:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G8GsG7084541; Tue, 16 Aug 2016 08:16:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608160816.u7G8GsG7084541@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 16 Aug 2016 08:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304208 - stable/11/usr.bin/getconf X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 08:16:56 -0000 Author: ngie Date: Tue Aug 16 08:16:54 2016 New Revision: 304208 URL: https://svnweb.freebsd.org/changeset/base/304208 Log: MFC r303830: Remove vestigal references to __alpha__ Replace alpha reference in getconf(1) with amd64 [*] PR: 211300 [*] Modified: stable/11/usr.bin/getconf/getconf.1 stable/11/usr.bin/getconf/progenv.gperf Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/getconf/getconf.1 ============================================================================== --- stable/11/usr.bin/getconf/getconf.1 Tue Aug 16 07:51:05 2016 (r304207) +++ stable/11/usr.bin/getconf/getconf.1 Tue Aug 16 08:16:54 2016 (r304208) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2002 +.Dd August 8, 2016 .Dt GETCONF 1 .Os .Sh NAME @@ -122,7 +122,7 @@ Exactly 32-bit integer, long, and pointe .It Li POSIX_V6_LP64_OFF64 Exactly 32-bit integer; exactly 64-bit long, pointer, and file offset. .Sy Supported platforms : -.Tn Alpha , +.Tn AMD64 , .Tn SPARC64 . .It Li POSIX_V6_LPBIG_OFFBIG At least 32-bit integer; at least 64-bit long, pointer, and file offset. Modified: stable/11/usr.bin/getconf/progenv.gperf ============================================================================== --- stable/11/usr.bin/getconf/progenv.gperf Tue Aug 16 07:51:05 2016 (r304207) +++ stable/11/usr.bin/getconf/progenv.gperf Tue Aug 16 08:16:54 2016 (r304208) @@ -30,7 +30,7 @@ static const struct map *in_word_set(con * be updated. (We cheat here and define the supported environments * statically.) */ -#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) +#if defined(__sparc64__) || defined(__amd64__) #define have_LP64_OFF64 NULL #endif From owner-svn-src-all@freebsd.org Tue Aug 16 08:27:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33888BBBBA6; Tue, 16 Aug 2016 08:27:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9E171812; Tue, 16 Aug 2016 08:27:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G8R4dG088311; Tue, 16 Aug 2016 08:27:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G8R3re088305; Tue, 16 Aug 2016 08:27:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608160827.u7G8R3re088305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Aug 2016 08:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304209 - in head: lib/libc/include lib/libc/sys lib/libthr/thread share/man/man3 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 08:27:05 -0000 Author: kib Date: Tue Aug 16 08:27:03 2016 New Revision: 304209 URL: https://svnweb.freebsd.org/changeset/base/304209 Log: The fdatasync(2) call must be cancellation point. Sponsored by: The FreeBSD Foundation MFC after: 13 days Added: head/lib/libc/sys/fdatasync.c (contents, props changed) Modified: head/lib/libc/include/libc_private.h head/lib/libc/sys/Makefile.inc head/lib/libc/sys/interposing_table.c head/lib/libthr/thread/thr_syscalls.c head/share/man/man3/pthread_testcancel.3 Modified: head/lib/libc/include/libc_private.h ============================================================================== --- head/lib/libc/include/libc_private.h Tue Aug 16 08:16:54 2016 (r304208) +++ head/lib/libc/include/libc_private.h Tue Aug 16 08:27:03 2016 (r304209) @@ -228,6 +228,7 @@ enum { INTERPOS_wait6, INTERPOS_ppoll, INTERPOS_map_stacks_exec, + INTERPOS_fdatasync, INTERPOS_MAX }; @@ -318,6 +319,7 @@ int __sys_clock_gettime(__clockid_t, st int __sys_close(int); int __sys_connect(int, const struct sockaddr *, __socklen_t); int __sys_fcntl(int, int, ...); +int __sys_fdatasync(int); int __sys_fsync(int); __pid_t __sys_fork(void); int __sys_ftruncate(int, __off_t); Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Tue Aug 16 08:16:54 2016 (r304208) +++ head/lib/libc/sys/Makefile.inc Tue Aug 16 08:27:03 2016 (r304209) @@ -37,6 +37,7 @@ INTERPOSED = \ close \ connect \ fcntl \ + fdatasync \ fsync \ fork \ kevent \ Added: head/lib/libc/sys/fdatasync.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/fdatasync.c Tue Aug 16 08:27:03 2016 (r304209) @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016 The FreeBSD Foundation. + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice(s), this list of conditions and the following disclaimer as + * the first lines of this file unmodified other than the possible + * addition of one or more copyright notices. + * 2. Redistributions in binary form must reproduce the above copyright + * notice(s), 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 COPYRIGHT HOLDER(S) ``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 COPYRIGHT HOLDER(S) BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include "libc_private.h" + +int +fdatasync(int fd) +{ + + return (((int (*)(int))__libc_interposing[INTERPOS_fdatasync])(fd)); +} Modified: head/lib/libc/sys/interposing_table.c ============================================================================== --- head/lib/libc/sys/interposing_table.c Tue Aug 16 08:16:54 2016 (r304208) +++ head/lib/libc/sys/interposing_table.c Tue Aug 16 08:27:03 2016 (r304209) @@ -79,6 +79,7 @@ interpos_func_t __libc_interposing[INTER SLOT(wait6, __sys_wait6), SLOT(ppoll, __sys_ppoll), SLOT(map_stacks_exec, __libc_map_stacks_exec), + SLOT(fdatasync, __sys_fdatasync), }; #undef SLOT Modified: head/lib/libthr/thread/thr_syscalls.c ============================================================================== --- head/lib/libthr/thread/thr_syscalls.c Tue Aug 16 08:16:54 2016 (r304208) +++ head/lib/libthr/thread/thr_syscalls.c Tue Aug 16 08:27:03 2016 (r304209) @@ -227,6 +227,20 @@ __thr_fsync(int fd) return (ret); } +static int +__thr_fdatasync(int fd) +{ + struct pthread *curthread; + int ret; + + curthread = _get_curthread(); + _thr_cancel_enter2(curthread, 0); + ret = __sys_fdatasync(fd); + _thr_cancel_leave(curthread, 1); + + return (ret); +} + /* * Cancellation behavior: * Thread may be canceled after system call. @@ -653,6 +667,7 @@ __thr_interpose_libc(void) SLOT(wait6); SLOT(ppoll); SLOT(map_stacks_exec); + SLOT(fdatasync); #undef SLOT *(__libc_interposing_slot( INTERPOS__pthread_mutex_init_calloc_cb)) = Modified: head/share/man/man3/pthread_testcancel.3 ============================================================================== --- head/share/man/man3/pthread_testcancel.3 Tue Aug 16 08:16:54 2016 (r304208) +++ head/share/man/man3/pthread_testcancel.3 Tue Aug 16 08:27:03 2016 (r304209) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd April 16, 2015 +.Dd August 16, 2016 .Dt PTHREAD_TESTCANCEL 3 .Os .Sh NAME @@ -114,6 +114,7 @@ function is a cancellation point if .Fa cmd is .Dv F_SETLKW . +.It Fn fdatasync .It Fn fsync .It Fn kevent The From owner-svn-src-all@freebsd.org Tue Aug 16 08:30:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46E46BBBC9E; Tue, 16 Aug 2016 08:30:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1953B1A37; Tue, 16 Aug 2016 08:30:29 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G8USMk088541; Tue, 16 Aug 2016 08:30:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G8USYH088539; Tue, 16 Aug 2016 08:30:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608160830.u7G8USYH088539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 16 Aug 2016 08:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304210 - stable/10/usr.bin/getconf X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 08:30:29 -0000 Author: ngie Date: Tue Aug 16 08:30:28 2016 New Revision: 304210 URL: https://svnweb.freebsd.org/changeset/base/304210 Log: MFstable/11 r304208: MFC r303830: Remove vestigal references to __alpha__ Replace alpha reference in getconf(1) with amd64 [*] PR: 211300 [*] Modified: stable/10/usr.bin/getconf/getconf.1 stable/10/usr.bin/getconf/progenv.gperf Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/getconf/getconf.1 ============================================================================== --- stable/10/usr.bin/getconf/getconf.1 Tue Aug 16 08:27:03 2016 (r304209) +++ stable/10/usr.bin/getconf/getconf.1 Tue Aug 16 08:30:28 2016 (r304210) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2002 +.Dd August 8, 2016 .Dt GETCONF 1 .Os .Sh NAME @@ -122,7 +122,7 @@ Exactly 32-bit integer, long, and pointe .It Li POSIX_V6_LP64_OFF64 Exactly 32-bit integer; exactly 64-bit long, pointer, and file offset. .Sy Supported platforms : -.Tn Alpha , +.Tn AMD64 , .Tn SPARC64 . .It Li POSIX_V6_LPBIG_OFFBIG At least 32-bit integer; at least 64-bit long, pointer, and file offset. Modified: stable/10/usr.bin/getconf/progenv.gperf ============================================================================== --- stable/10/usr.bin/getconf/progenv.gperf Tue Aug 16 08:27:03 2016 (r304209) +++ stable/10/usr.bin/getconf/progenv.gperf Tue Aug 16 08:30:28 2016 (r304210) @@ -30,7 +30,7 @@ static const struct map *in_word_set(con * be updated. (We cheat here and define the supported environments * statically.) */ -#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) +#if defined(__sparc64__) || defined(__amd64__) #define have_LP64_OFF64 NULL #endif From owner-svn-src-all@freebsd.org Tue Aug 16 08:48:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D62EFBBA0ED; Tue, 16 Aug 2016 08:48:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A892E1450; Tue, 16 Aug 2016 08:48:42 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G8mfu5096159; Tue, 16 Aug 2016 08:48:41 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G8mfbX096157; Tue, 16 Aug 2016 08:48:41 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608160848.u7G8mfbX096157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 16 Aug 2016 08:48:41 +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: r304211 - stable/9/usr.bin/getconf 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 08:48:42 -0000 Author: ngie Date: Tue Aug 16 08:48:41 2016 New Revision: 304211 URL: https://svnweb.freebsd.org/changeset/base/304211 Log: MFstable/10 r304210: MFstable/11 r304208: MFC r303830: Remove vestigal references to __alpha__ Replace alpha reference in getconf(1) with amd64 [*] PR: 211300 [*] Modified: stable/9/usr.bin/getconf/getconf.1 stable/9/usr.bin/getconf/progenv.gperf Directory Properties: stable/9/ (props changed) stable/9/usr.bin/ (props changed) Modified: stable/9/usr.bin/getconf/getconf.1 ============================================================================== --- stable/9/usr.bin/getconf/getconf.1 Tue Aug 16 08:30:28 2016 (r304210) +++ stable/9/usr.bin/getconf/getconf.1 Tue Aug 16 08:48:41 2016 (r304211) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2002 +.Dd August 8, 2016 .Dt GETCONF 1 .Os .Sh NAME @@ -122,7 +122,7 @@ Exactly 32-bit integer, long, and pointe .It Li POSIX_V6_LP64_OFF64 Exactly 32-bit integer; exactly 64-bit long, pointer, and file offset. .Sy Supported platforms : -.Tn Alpha , +.Tn AMD64 , .Tn SPARC64 . .It Li POSIX_V6_LPBIG_OFFBIG At least 32-bit integer; at least 64-bit long, pointer, and file offset. Modified: stable/9/usr.bin/getconf/progenv.gperf ============================================================================== --- stable/9/usr.bin/getconf/progenv.gperf Tue Aug 16 08:30:28 2016 (r304210) +++ stable/9/usr.bin/getconf/progenv.gperf Tue Aug 16 08:48:41 2016 (r304211) @@ -30,7 +30,7 @@ static const struct map *in_word_set(con * be updated. (We cheat here and define the supported environments * statically.) */ -#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__) +#if defined(__sparc64__) || defined(__amd64__) #define have_LP64_OFF64 NULL #endif From owner-svn-src-all@freebsd.org Tue Aug 16 09:06:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6238CBBAA83; Tue, 16 Aug 2016 09:06:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B95B1E23; Tue, 16 Aug 2016 09:06:24 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G96Niw003677; Tue, 16 Aug 2016 09:06:23 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G96NIG003676; Tue, 16 Aug 2016 09:06:23 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608160906.u7G96NIG003676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Aug 2016 09:06:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304212 - stable/11/sys/arm/allwinner X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 09:06:24 -0000 Author: manu Date: Tue Aug 16 09:06:23 2016 New Revision: 304212 URL: https://svnweb.freebsd.org/changeset/base/304212 Log: MFC r303144: We need the GIC to be attached so attach later at BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D7080 Modified: stable/11/sys/arm/allwinner/a10_gpio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/allwinner/a10_gpio.c ============================================================================== --- stable/11/sys/arm/allwinner/a10_gpio.c Tue Aug 16 08:48:41 2016 (r304211) +++ stable/11/sys/arm/allwinner/a10_gpio.c Tue Aug 16 09:06:23 2016 (r304212) @@ -708,4 +708,4 @@ static driver_t a10_gpio_driver = { }; EARLY_DRIVER_MODULE(a10_gpio, simplebus, a10_gpio_driver, a10_gpio_devclass, 0, 0, - BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); + BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); From owner-svn-src-all@freebsd.org Tue Aug 16 09:08:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2C41BBAB6D; Tue, 16 Aug 2016 09:08:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8538C11AD; Tue, 16 Aug 2016 09:08:45 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G98iwL003802; Tue, 16 Aug 2016 09:08:44 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G98in0003801; Tue, 16 Aug 2016 09:08:44 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608160908.u7G98in0003801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Aug 2016 09:08:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304213 - stable/11/sys/arm/allwinner X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 09:08:45 -0000 Author: manu Date: Tue Aug 16 09:08:44 2016 New Revision: 304213 URL: https://svnweb.freebsd.org/changeset/base/304213 Log: MFC r303145: axp209 needs aw_nmi so attach a bit earlier Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D7081 Modified: stable/11/sys/arm/allwinner/aw_nmi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/allwinner/aw_nmi.c ============================================================================== --- stable/11/sys/arm/allwinner/aw_nmi.c Tue Aug 16 09:06:23 2016 (r304212) +++ stable/11/sys/arm/allwinner/aw_nmi.c Tue Aug 16 09:08:44 2016 (r304213) @@ -400,4 +400,4 @@ static driver_t aw_nmi_driver = { static devclass_t aw_nmi_devclass; EARLY_DRIVER_MODULE(aw_nmi, simplebus, aw_nmi_driver, - aw_nmi_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); + aw_nmi_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); From owner-svn-src-all@freebsd.org Tue Aug 16 09:10:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1D19BBAC4D; Tue, 16 Aug 2016 09:10:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 741201399; Tue, 16 Aug 2016 09:10:19 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G9AI05003931; Tue, 16 Aug 2016 09:10:18 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G9AIER003930; Tue, 16 Aug 2016 09:10:18 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608160910.u7G9AIER003930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Aug 2016 09:10:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304214 - stable/11/sys/arm/allwinner X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 09:10:19 -0000 Author: manu Date: Tue Aug 16 09:10:18 2016 New Revision: 304214 URL: https://svnweb.freebsd.org/changeset/base/304214 Log: MFC r303728: We need aw_nmi to be attached which needs GIC so attach a bit later. Also the GPIOC doesn't need to be attach early Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D7082 Modified: stable/11/sys/arm/allwinner/axp209.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/allwinner/axp209.c ============================================================================== --- stable/11/sys/arm/allwinner/axp209.c Tue Aug 16 09:08:44 2016 (r304213) +++ stable/11/sys/arm/allwinner/axp209.c Tue Aug 16 09:10:18 2016 (r304214) @@ -707,10 +707,10 @@ extern devclass_t ofwgpiobus_devclass, g extern driver_t ofw_gpiobus_driver, gpioc_driver; EARLY_DRIVER_MODULE(axp209, iicbus, axp209_driver, axp209_devclass, - 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); + 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); EARLY_DRIVER_MODULE(ofw_gpiobus, axp209_pmu, ofw_gpiobus_driver, - ofwgpiobus_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); -EARLY_DRIVER_MODULE(gpioc, axp209_pmu, gpioc_driver, gpioc_devclass, - 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); + ofwgpiobus_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); +DRIVER_MODULE(gpioc, axp209_pmu, gpioc_driver, gpioc_devclass, + 0, 0); MODULE_VERSION(axp209, 1); MODULE_DEPEND(axp209, iicbus, 1, 1, 1); From owner-svn-src-all@freebsd.org Tue Aug 16 09:12:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EAE5BBAE10; Tue, 16 Aug 2016 09:12:47 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E44EB17B0; Tue, 16 Aug 2016 09:12:46 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7G9CkXb007487; Tue, 16 Aug 2016 09:12:46 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7G9Ckjf007485; Tue, 16 Aug 2016 09:12:46 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608160912.u7G9Ckjf007485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Aug 2016 09:12:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304215 - in stable/11/sys: boot/fdt/dts/arm modules/dtb/allwinner X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 09:12:47 -0000 Author: manu Date: Tue Aug 16 09:12:45 2016 New Revision: 304215 URL: https://svnweb.freebsd.org/changeset/base/304215 Log: MFC r303974: ename pcduino3b.dts to pcduino3.dts The only difference between 3 and 3B is the size of the RJ45 port. And now we have a uboot port that expect pcduino3.dts to be present. Reported by: imp Added: stable/11/sys/boot/fdt/dts/arm/pcduino3.dts - copied unchanged from r303974, head/sys/boot/fdt/dts/arm/pcduino3.dts Deleted: stable/11/sys/boot/fdt/dts/arm/pcduino3b.dts Modified: stable/11/sys/modules/dtb/allwinner/Makefile Directory Properties: stable/11/ (props changed) Copied: stable/11/sys/boot/fdt/dts/arm/pcduino3.dts (from r303974, head/sys/boot/fdt/dts/arm/pcduino3.dts) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/boot/fdt/dts/arm/pcduino3.dts Tue Aug 16 09:12:45 2016 (r304215, copy of r303974, head/sys/boot/fdt/dts/arm/pcduino3.dts) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include "sun7i-a20-pcduino3.dts" +#include "sun7i-a20-hdmi.dtsi" +#include "xpowers-axp209.dtsi" + +/ { + soc@01c00000 { + hdmi@01c16000 { + status = "okay"; + }; + + hdmiaudio { + status = "okay"; + }; + }; +}; + +&gmac { + pinctrl-0 = <&gmac_pins_rgmii_a>; + phy-mode = "rgmii"; +}; Modified: stable/11/sys/modules/dtb/allwinner/Makefile ============================================================================== --- stable/11/sys/modules/dtb/allwinner/Makefile Tue Aug 16 09:10:18 2016 (r304214) +++ stable/11/sys/modules/dtb/allwinner/Makefile Tue Aug 16 09:12:45 2016 (r304215) @@ -7,7 +7,7 @@ DTS= \ cubieboard2.dts \ olimex-a20-som-evb.dts \ olinuxino-lime.dts \ - pcduino3b.dts \ + pcduino3.dts \ sinovoip-bpi-m3.dts .include From owner-svn-src-all@freebsd.org Tue Aug 16 10:30:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C881FBBC8B1; Tue, 16 Aug 2016 10:30:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id AF7BC12CE; Tue, 16 Aug 2016 10:30:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id A8225147B; Tue, 16 Aug 2016 10:30:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 464891A659; Tue, 16 Aug 2016 10:30:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 5Y0Yr1KytyYa; Tue, 16 Aug 2016 10:30:09 +0000 (UTC) Subject: Re: svn commit: r304011 - head/libexec/rtld-elf DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com A60101A651 To: Ngie Cooper , Konstantin Belousov References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Tue, 16 Aug 2016 11:30:03 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="tOQ6TfqKtFFu5FG8N2MeohgvCKEl6Tn7s" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 10:30:12 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --tOQ6TfqKtFFu5FG8N2MeohgvCKEl6Tn7s Content-Type: multipart/mixed; boundary="1tmoJ9oFT615DRfQwj82gUPDVcj9t81C4" From: Bryan Drewery To: Ngie Cooper , Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r304011 - head/libexec/rtld-elf References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> In-Reply-To: <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> --1tmoJ9oFT615DRfQwj82gUPDVcj9t81C4 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 8/12/16 7:34 PM, Ngie Cooper wrote: >=20 >> On Aug 12, 2016, at 11:29, Konstantin Belousov wrote= : >> >> Author: kib >> Date: Fri Aug 12 18:29:11 2016 >> New Revision: 304011 >> URL: https://svnweb.freebsd.org/changeset/base/304011 >> >> Log: >> Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf. >=20 > Why? >=20 It's a somewhat error-prone and dangerous macro. See r302908. --=20 Regards, Bryan Drewery --1tmoJ9oFT615DRfQwj82gUPDVcj9t81C4-- --tOQ6TfqKtFFu5FG8N2MeohgvCKEl6Tn7s Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXsusrAAoJEDXXcbtuRpfPhqsIAOEMaM5PyHc/+6edkrGvsMWt MBxDEkU9gzaH93sfpulmbnc818WnwmteVGxlBzkeHXR7O1nS/YT/a8W1m/3WUKUg nqYJbf8r6qaGPq2aYslS1Y/uAA7iq43thxtkMDQ/hDRzxXUAgTDWTN8p21jaSXi9 6rRedwIEhKxJntTMSxE5D1F/92P1mODF+hGnc1yi/HX2tlLwKtNsEGvdJouX44Ht QBDioOEZcQt1a3LV2ScpXgEIi7hWR9OwEE6nADOvS6LKEQ3zFuol3mbGKsvQ9n5D JCzkRYRH0vGSqu1raXEXlvxnnmPpns6AoHPXTEIXCBzx6m4pde5euyX+osLWsVE= =9Oyc -----END PGP SIGNATURE----- --tOQ6TfqKtFFu5FG8N2MeohgvCKEl6Tn7s-- From owner-svn-src-all@freebsd.org Tue Aug 16 11:38:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0240BBC61F; Tue, 16 Aug 2016 11:38:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8268D1391; Tue, 16 Aug 2016 11:38:46 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GBcjxm059774; Tue, 16 Aug 2016 11:38:45 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GBcjAQ059773; Tue, 16 Aug 2016 11:38:45 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201608161138.u7GBcjAQ059773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 16 Aug 2016 11:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304216 - head/lib/libc/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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 11:38:46 -0000 Author: brooks Date: Tue Aug 16 11:38:45 2016 New Revision: 304216 URL: https://svnweb.freebsd.org/changeset/base/304216 Log: Don't conflate enum nss_status return values values with int (NS_SUCCESS, NS_RETURN) values. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D6046 Modified: head/lib/libc/net/nss_compat.c Modified: head/lib/libc/net/nss_compat.c ============================================================================== --- head/lib/libc/net/nss_compat.c Tue Aug 16 09:12:45 2016 (r304215) +++ head/lib/libc/net/nss_compat.c Tue Aug 16 11:38:45 2016 (r304216) @@ -97,9 +97,9 @@ __nss_compat_getgrnam_r(void *retval, vo const char *name; struct group *grp; char *buffer; - int *errnop; + int *errnop, ns_status; size_t bufsize; - enum nss_status status; + enum nss_status nss_status; fn = mdata; name = va_arg(ap, const char *); @@ -107,11 +107,11 @@ __nss_compat_getgrnam_r(void *retval, vo buffer = va_arg(ap, char *); bufsize = va_arg(ap, size_t); errnop = va_arg(ap, int *); - status = fn(name, grp, buffer, bufsize, errnop); - status = __nss_compat_result(status, *errnop); - if (status == NS_SUCCESS) + nss_status = fn(name, grp, buffer, bufsize, errnop); + ns_status = __nss_compat_result(nss_status, *errnop); + if (ns_status == NS_SUCCESS) *(struct group **)retval = grp; - return (status); + return (ns_status); } @@ -122,9 +122,9 @@ __nss_compat_getgrgid_r(void *retval, vo gid_t gid; struct group *grp; char *buffer; - int *errnop; + int *errnop, ns_status; size_t bufsize; - enum nss_status status; + enum nss_status nss_status; fn = mdata; gid = va_arg(ap, gid_t); @@ -132,11 +132,11 @@ __nss_compat_getgrgid_r(void *retval, vo buffer = va_arg(ap, char *); bufsize = va_arg(ap, size_t); errnop = va_arg(ap, int *); - status = fn(gid, grp, buffer, bufsize, errnop); - status = __nss_compat_result(status, *errnop); - if (status == NS_SUCCESS) + nss_status = fn(gid, grp, buffer, bufsize, errnop); + ns_status = __nss_compat_result(nss_status, *errnop); + if (ns_status == NS_SUCCESS) *(struct group **)retval = grp; - return (status); + return (ns_status); } @@ -146,9 +146,9 @@ __nss_compat_getgrent_r(void *retval, vo int (*fn)(struct group *, char *, size_t, int *); struct group *grp; char *buffer; - int *errnop; + int *errnop, ns_status; size_t bufsize; - enum nss_status status; + enum nss_status nss_status; if (CHECK_TERMINATOR(group)) return (NS_NOTFOUND); @@ -157,13 +157,13 @@ __nss_compat_getgrent_r(void *retval, vo buffer = va_arg(ap, char *); bufsize = va_arg(ap, size_t); errnop = va_arg(ap, int *); - status = fn(grp, buffer, bufsize, errnop); - status = __nss_compat_result(status, *errnop); - if (status == NS_SUCCESS) + nss_status = fn(grp, buffer, bufsize, errnop); + ns_status = __nss_compat_result(nss_status, *errnop); + if (ns_status == NS_SUCCESS) *(struct group **)retval = grp; - else if (status != NS_RETURN) + else if (ns_status != NS_RETURN) SET_TERMINATOR(group, &terminator); - return (status); + return (ns_status); } @@ -198,9 +198,9 @@ __nss_compat_getpwnam_r(void *retval, vo const char *name; struct passwd *pwd; char *buffer; - int *errnop; + int *errnop, ns_status; size_t bufsize; - enum nss_status status; + enum nss_status nss_status; fn = mdata; name = va_arg(ap, const char *); @@ -208,11 +208,11 @@ __nss_compat_getpwnam_r(void *retval, vo buffer = va_arg(ap, char *); bufsize = va_arg(ap, size_t); errnop = va_arg(ap, int *); - status = fn(name, pwd, buffer, bufsize, errnop); - status = __nss_compat_result(status, *errnop); - if (status == NS_SUCCESS) + nss_status = fn(name, pwd, buffer, bufsize, errnop); + ns_status = __nss_compat_result(nss_status, *errnop); + if (ns_status == NS_SUCCESS) *(struct passwd **)retval = pwd; - return (status); + return (ns_status); } @@ -223,9 +223,9 @@ __nss_compat_getpwuid_r(void *retval, vo uid_t uid; struct passwd *pwd; char *buffer; - int *errnop; + int *errnop, ns_status; size_t bufsize; - enum nss_status status; + enum nss_status nss_status; fn = mdata; uid = va_arg(ap, uid_t); @@ -233,11 +233,11 @@ __nss_compat_getpwuid_r(void *retval, vo buffer = va_arg(ap, char *); bufsize = va_arg(ap, size_t); errnop = va_arg(ap, int *); - status = fn(uid, pwd, buffer, bufsize, errnop); - status = __nss_compat_result(status, *errnop); - if (status == NS_SUCCESS) + nss_status = fn(uid, pwd, buffer, bufsize, errnop); + ns_status = __nss_compat_result(nss_status, *errnop); + if (ns_status == NS_SUCCESS) *(struct passwd **)retval = pwd; - return (status); + return (ns_status); } @@ -247,9 +247,9 @@ __nss_compat_getpwent_r(void *retval, vo int (*fn)(struct passwd *, char *, size_t, int *); struct passwd *pwd; char *buffer; - int *errnop; + int *errnop, ns_status; size_t bufsize; - enum nss_status status; + enum nss_status nss_status; if (CHECK_TERMINATOR(passwd)) return (NS_NOTFOUND); @@ -258,13 +258,13 @@ __nss_compat_getpwent_r(void *retval, vo buffer = va_arg(ap, char *); bufsize = va_arg(ap, size_t); errnop = va_arg(ap, int *); - status = fn(pwd, buffer, bufsize, errnop); - status = __nss_compat_result(status, *errnop); - if (status == NS_SUCCESS) + nss_status = fn(pwd, buffer, bufsize, errnop); + ns_status = __nss_compat_result(nss_status, *errnop); + if (ns_status == NS_SUCCESS) *(struct passwd **)retval = pwd; - else if (status != NS_RETURN) + else if (ns_status != NS_RETURN) SET_TERMINATOR(passwd, &terminator); - return (status); + return (ns_status); } From owner-svn-src-all@freebsd.org Tue Aug 16 12:13:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45A8BBBB6B8; Tue, 16 Aug 2016 12:13:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15F461BA8; Tue, 16 Aug 2016 12:13:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GCDCfS074156; Tue, 16 Aug 2016 12:13:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GCDCXJ074155; Tue, 16 Aug 2016 12:13:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608161213.u7GCDCXJ074155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 16 Aug 2016 12:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304217 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 12:13:13 -0000 Author: bdrewery Date: Tue Aug 16 12:13:12 2016 New Revision: 304217 URL: https://svnweb.freebsd.org/changeset/base/304217 Log: Trim unneeded bootstrap after r301470 made 9.1 the minimum supported release. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Aug 16 11:38:45 2016 (r304216) +++ head/Makefile.inc1 Tue Aug 16 12:13:12 2016 (r304217) @@ -1581,10 +1581,6 @@ _groff= gnu/usr.bin/groff \ _vtfontcvt= usr.bin/vtfontcvt .endif -.if ${BOOTSTRAPPING} < 900002 -_sed= usr.bin/sed -.endif - .if ${BOOTSTRAPPING} < 1000033 _libopenbsd= lib/libopenbsd _m4= usr.bin/m4 @@ -1623,10 +1619,6 @@ _crunchide= usr.sbin/crunch/crunchide _crunchgen= usr.sbin/crunch/crunchgen .endif -.if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 -_awk= usr.bin/awk -.endif - # r296926 -P keymap search path, MFC to stable/10 in r298297 .if ${BOOTSTRAPPING} < 1003501 || \ (${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103) @@ -1694,7 +1686,6 @@ bootstrap-tools: .PHONY ${_gperf} \ ${_groff} \ ${_dtc} \ - ${_awk} \ ${_cat} \ ${_dd} \ ${_kbdcontrol} \ @@ -1702,7 +1693,6 @@ bootstrap-tools: .PHONY ${_libopenbsd} \ ${_makewhatis} \ usr.bin/rpcgen \ - ${_sed} \ ${_yacc} \ ${_m4} \ ${_lex} \ From owner-svn-src-all@freebsd.org Tue Aug 16 12:40:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B48DBBB0B5; Tue, 16 Aug 2016 12:40:58 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B5491B1D; Tue, 16 Aug 2016 12:40:58 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GCevX2082120; Tue, 16 Aug 2016 12:40:57 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GCeuWS082118; Tue, 16 Aug 2016 12:40:56 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201608161240.u7GCeuWS082118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 16 Aug 2016 12:40:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304218 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 12:40:58 -0000 Author: rrs Date: Tue Aug 16 12:40:56 2016 New Revision: 304218 URL: https://svnweb.freebsd.org/changeset/base/304218 Log: This cleans up the timer code in TCP and also makes it so we do not take the INFO lock *unless* we are really going to delete the TCB. Differential Revision: D7136 Modified: head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Tue Aug 16 12:13:12 2016 (r304217) +++ head/sys/netinet/tcp_timer.c Tue Aug 16 12:40:56 2016 (r304218) @@ -294,11 +294,6 @@ tcp_timer_delack(void *xtp) CURVNET_RESTORE(); return; } - KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, - ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); - KASSERT((tp->t_timers->tt_flags & TT_DELACK) != 0, - ("%s: tp %p delack callout should be running", __func__, tp)); - tp->t_flags |= TF_ACKNOW; TCPSTAT_INC(tcps_delack); (void) tp->t_fb->tfb_tcp_output(tp); @@ -306,6 +301,39 @@ tcp_timer_delack(void *xtp) CURVNET_RESTORE(); } +int +tcp_inpinfo_lock_add(struct inpcb *inp) +{ + in_pcbref(inp); + INP_WUNLOCK(inp); + INP_INFO_RLOCK(&V_tcbinfo); + INP_WLOCK(inp); + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { + return(1); + } + return(0); + +} + +void +tcp_inpinfo_lock_del(struct inpcb *inp, struct tcpcb *tp) +{ + INP_INFO_RUNLOCK(&V_tcbinfo); + if (inp && (tp == NULL)) { + /* + * If tcp_close/drop() gets called and tp + * returns NULL, then the function dropped + * the inp lock, we hold a reference keeping + * this around, so we must re-aquire the + * INP_WLOCK() in order to proceed with + * our dropping the inp reference. + */ + INP_WLOCK(inp); + } + if (inp && in_pcbrele_wlocked(inp) == 0) + INP_WUNLOCK(inp); +} + void tcp_timer_2msl(void *xtp) { @@ -317,7 +345,6 @@ tcp_timer_2msl(void *xtp) ostate = tp->t_state; #endif - INP_INFO_RLOCK(&V_tcbinfo); inp = tp->t_inpcb; KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", __func__, tp)); INP_WLOCK(inp); @@ -325,21 +352,17 @@ tcp_timer_2msl(void *xtp) if (callout_pending(&tp->t_timers->tt_2msl) || !callout_active(&tp->t_timers->tt_2msl)) { INP_WUNLOCK(tp->t_inpcb); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_2msl); if ((inp->inp_flags & INP_DROPPED) != 0) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); - KASSERT((tp->t_timers->tt_flags & TT_2MSL) != 0, - ("%s: tp %p 2msl callout should be running", __func__, tp)); /* * 2 MSL timeout in shutdown went off. If we're closed but * still waiting for peer to close and connection has been idle @@ -355,7 +378,6 @@ tcp_timer_2msl(void *xtp) */ if ((inp->inp_flags & INP_TIMEWAIT) != 0) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } @@ -363,15 +385,26 @@ tcp_timer_2msl(void *xtp) tp->t_inpcb && tp->t_inpcb->inp_socket && (tp->t_inpcb->inp_socket->so_rcv.sb_state & SBS_CANTRCVMORE)) { TCPSTAT_INC(tcps_finwait2_drops); + if (tcp_inpinfo_lock_add(inp)) { + tcp_inpinfo_lock_del(inp, tp); + goto out; + } tp = tcp_close(tp); + tcp_inpinfo_lock_del(inp, tp); + goto out; } else { if (ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) { - if (!callout_reset(&tp->t_timers->tt_2msl, - TP_KEEPINTVL(tp), tcp_timer_2msl, tp)) { - tp->t_timers->tt_flags &= ~TT_2MSL_RST; + callout_reset(&tp->t_timers->tt_2msl, + TP_KEEPINTVL(tp), tcp_timer_2msl, tp); + } else { + if (tcp_inpinfo_lock_add(inp)) { + tcp_inpinfo_lock_del(inp, tp); + goto out; } - } else - tp = tcp_close(tp); + tp = tcp_close(tp); + tcp_inpinfo_lock_del(inp, tp); + goto out; + } } #ifdef TCPDEBUG @@ -383,7 +416,7 @@ tcp_timer_2msl(void *xtp) if (tp != NULL) INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); +out: CURVNET_RESTORE(); } @@ -399,28 +432,23 @@ tcp_timer_keep(void *xtp) ostate = tp->t_state; #endif - INP_INFO_RLOCK(&V_tcbinfo); inp = tp->t_inpcb; KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", __func__, tp)); INP_WLOCK(inp); if (callout_pending(&tp->t_timers->tt_keep) || !callout_active(&tp->t_timers->tt_keep)) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_keep); if ((inp->inp_flags & INP_DROPPED) != 0) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); - KASSERT((tp->t_timers->tt_flags & TT_KEEP) != 0, - ("%s: tp %p keep callout should be running", __func__, tp)); /* * Keep-alive timer went off; send something * or drop connection if idle for too long. @@ -452,14 +480,11 @@ tcp_timer_keep(void *xtp) tp->rcv_nxt, tp->snd_una - 1, 0); free(t_template, M_TEMP); } - if (!callout_reset(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp), - tcp_timer_keep, tp)) { - tp->t_timers->tt_flags &= ~TT_KEEP_RST; - } - } else if (!callout_reset(&tp->t_timers->tt_keep, TP_KEEPIDLE(tp), - tcp_timer_keep, tp)) { - tp->t_timers->tt_flags &= ~TT_KEEP_RST; - } + callout_reset(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp), + tcp_timer_keep, tp); + } else + callout_reset(&tp->t_timers->tt_keep, TP_KEEPIDLE(tp), + tcp_timer_keep, tp); #ifdef TCPDEBUG if (inp->inp_socket->so_options & SO_DEBUG) @@ -468,12 +493,16 @@ tcp_timer_keep(void *xtp) #endif TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; dropit: TCPSTAT_INC(tcps_keepdrops); + + if (tcp_inpinfo_lock_add(inp)) { + tcp_inpinfo_lock_del(inp, tp); + goto out; + } tp = tcp_drop(tp, ETIMEDOUT); #ifdef TCPDEBUG @@ -482,9 +511,8 @@ dropit: PRU_SLOWTIMO); #endif TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); - if (tp != NULL) - INP_WUNLOCK(tp->t_inpcb); - INP_INFO_RUNLOCK(&V_tcbinfo); + tcp_inpinfo_lock_del(inp, tp); +out: CURVNET_RESTORE(); } @@ -499,28 +527,23 @@ tcp_timer_persist(void *xtp) ostate = tp->t_state; #endif - INP_INFO_RLOCK(&V_tcbinfo); inp = tp->t_inpcb; KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", __func__, tp)); INP_WLOCK(inp); if (callout_pending(&tp->t_timers->tt_persist) || !callout_active(&tp->t_timers->tt_persist)) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_persist); if ((inp->inp_flags & INP_DROPPED) != 0) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); - KASSERT((tp->t_timers->tt_flags & TT_PERSIST) != 0, - ("%s: tp %p persist callout should be running", __func__, tp)); /* * Persistence timer into zero window. * Force a byte to be output, if possible. @@ -537,7 +560,12 @@ tcp_timer_persist(void *xtp) (ticks - tp->t_rcvtime >= tcp_maxpersistidle || ticks - tp->t_rcvtime >= TCP_REXMTVAL(tp) * tcp_totbackoff)) { TCPSTAT_INC(tcps_persistdrop); + if (tcp_inpinfo_lock_add(inp)) { + tcp_inpinfo_lock_del(inp, tp); + goto out; + } tp = tcp_drop(tp, ETIMEDOUT); + tcp_inpinfo_lock_del(inp, tp); goto out; } /* @@ -547,7 +575,12 @@ tcp_timer_persist(void *xtp) if (tp->t_state > TCPS_CLOSE_WAIT && (ticks - tp->t_rcvtime) >= TCPTV_PERSMAX) { TCPSTAT_INC(tcps_persistdrop); + if (tcp_inpinfo_lock_add(inp)) { + tcp_inpinfo_lock_del(inp, tp); + goto out; + } tp = tcp_drop(tp, ETIMEDOUT); + tcp_inpinfo_lock_del(inp, tp); goto out; } tcp_setpersist(tp); @@ -555,15 +588,13 @@ tcp_timer_persist(void *xtp) (void) tp->t_fb->tfb_tcp_output(tp); tp->t_flags &= ~TF_FORCEDATA; -out: #ifdef TCPDEBUG if (tp != NULL && tp->t_inpcb->inp_socket->so_options & SO_DEBUG) tcp_trace(TA_USER, ostate, tp, NULL, NULL, PRU_SLOWTIMO); #endif TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); - if (tp != NULL) - INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_WUNLOCK(inp); +out: CURVNET_RESTORE(); } @@ -573,36 +604,29 @@ tcp_timer_rexmt(void * xtp) struct tcpcb *tp = xtp; CURVNET_SET(tp->t_vnet); int rexmt; - int headlocked; struct inpcb *inp; #ifdef TCPDEBUG int ostate; ostate = tp->t_state; #endif - - INP_INFO_RLOCK(&V_tcbinfo); inp = tp->t_inpcb; KASSERT(inp != NULL, ("%s: tp %p tp->t_inpcb == NULL", __func__, tp)); INP_WLOCK(inp); if (callout_pending(&tp->t_timers->tt_rexmt) || !callout_active(&tp->t_timers->tt_rexmt)) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } callout_deactivate(&tp->t_timers->tt_rexmt); if ((inp->inp_flags & INP_DROPPED) != 0) { INP_WUNLOCK(inp); - INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); return; } KASSERT((tp->t_timers->tt_flags & TT_STOPPED) == 0, ("%s: tp %p tcpcb can't be stopped here", __func__, tp)); - KASSERT((tp->t_timers->tt_flags & TT_REXMT) != 0, - ("%s: tp %p rexmt callout should be running", __func__, tp)); tcp_free_sackholes(tp); if (tp->t_fb->tfb_tcp_rexmit_tmr) { /* The stack has a timer action too. */ @@ -616,14 +640,15 @@ tcp_timer_rexmt(void * xtp) if (++tp->t_rxtshift > TCP_MAXRXTSHIFT) { tp->t_rxtshift = TCP_MAXRXTSHIFT; TCPSTAT_INC(tcps_timeoutdrop); - + if (tcp_inpinfo_lock_add(inp)) { + tcp_inpinfo_lock_del(inp, tp); + goto out; + } tp = tcp_drop(tp, tp->t_softerror ? tp->t_softerror : ETIMEDOUT); - headlocked = 1; + tcp_inpinfo_lock_del(inp, tp); goto out; } - INP_INFO_RUNLOCK(&V_tcbinfo); - headlocked = 0; if (tp->t_state == TCPS_SYN_SENT) { /* * If the SYN was retransmitted, indicate CWND to be @@ -811,17 +836,14 @@ tcp_timer_rexmt(void * xtp) (void) tp->t_fb->tfb_tcp_output(tp); -out: #ifdef TCPDEBUG if (tp != NULL && (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)) tcp_trace(TA_USER, ostate, tp, (void *)0, (struct tcphdr *)0, PRU_SLOWTIMO); #endif TCP_PROBE2(debug__user, tp, PRU_SLOWTIMO); - if (tp != NULL) - INP_WUNLOCK(inp); - if (headlocked) - INP_INFO_RUNLOCK(&V_tcbinfo); + INP_WUNLOCK(inp); +out: CURVNET_RESTORE(); } @@ -832,7 +854,6 @@ tcp_timer_activate(struct tcpcb *tp, uin timeout_t *f_callout; struct inpcb *inp = tp->t_inpcb; int cpu = inp_to_cpuid(inp); - uint32_t f_reset; #ifdef TCP_OFFLOAD if (tp->t_flags & TF_TOE) @@ -846,27 +867,22 @@ tcp_timer_activate(struct tcpcb *tp, uin case TT_DELACK: t_callout = &tp->t_timers->tt_delack; f_callout = tcp_timer_delack; - f_reset = TT_DELACK_RST; break; case TT_REXMT: t_callout = &tp->t_timers->tt_rexmt; f_callout = tcp_timer_rexmt; - f_reset = TT_REXMT_RST; break; case TT_PERSIST: t_callout = &tp->t_timers->tt_persist; f_callout = tcp_timer_persist; - f_reset = TT_PERSIST_RST; break; case TT_KEEP: t_callout = &tp->t_timers->tt_keep; f_callout = tcp_timer_keep; - f_reset = TT_KEEP_RST; break; case TT_2MSL: t_callout = &tp->t_timers->tt_2msl; f_callout = tcp_timer_2msl; - f_reset = TT_2MSL_RST; break; default: if (tp->t_fb->tfb_tcp_timer_activate) { @@ -876,24 +892,9 @@ tcp_timer_activate(struct tcpcb *tp, uin panic("tp %p bad timer_type %#x", tp, timer_type); } if (delta == 0) { - if ((tp->t_timers->tt_flags & timer_type) && - (callout_stop(t_callout) > 0) && - (tp->t_timers->tt_flags & f_reset)) { - tp->t_timers->tt_flags &= ~(timer_type | f_reset); - } + callout_stop(t_callout); } else { - if ((tp->t_timers->tt_flags & timer_type) == 0) { - tp->t_timers->tt_flags |= (timer_type | f_reset); - callout_reset_on(t_callout, delta, f_callout, tp, cpu); - } else { - /* Reset already running callout on the same CPU. */ - if (!callout_reset(t_callout, delta, f_callout, tp)) { - /* - * Callout not cancelled, consider it as not - * properly restarted. */ - tp->t_timers->tt_flags &= ~f_reset; - } - } + callout_reset_on(t_callout, delta, f_callout, tp, cpu); } } @@ -931,30 +932,23 @@ void tcp_timer_stop(struct tcpcb *tp, uint32_t timer_type) { struct callout *t_callout; - uint32_t f_reset; tp->t_timers->tt_flags |= TT_STOPPED; - switch (timer_type) { case TT_DELACK: t_callout = &tp->t_timers->tt_delack; - f_reset = TT_DELACK_RST; break; case TT_REXMT: t_callout = &tp->t_timers->tt_rexmt; - f_reset = TT_REXMT_RST; break; case TT_PERSIST: t_callout = &tp->t_timers->tt_persist; - f_reset = TT_PERSIST_RST; break; case TT_KEEP: t_callout = &tp->t_timers->tt_keep; - f_reset = TT_KEEP_RST; break; case TT_2MSL: t_callout = &tp->t_timers->tt_2msl; - f_reset = TT_2MSL_RST; break; default: if (tp->t_fb->tfb_tcp_timer_stop) { @@ -968,15 +962,13 @@ tcp_timer_stop(struct tcpcb *tp, uint32_ panic("tp %p bad timer_type %#x", tp, timer_type); } - if (tp->t_timers->tt_flags & timer_type) { - if (callout_async_drain(t_callout, tcp_timer_discard) == 0) { - /* - * Can't stop the callout, defer tcpcb actual deletion - * to the last one. We do this using the async drain - * function and incrementing the count in - */ - tp->t_timers->tt_draincnt++; - } + if (callout_async_drain(t_callout, tcp_timer_discard) == 0) { + /* + * Can't stop the callout, defer tcpcb actual deletion + * to the last one. We do this using the async drain + * function and incrementing the count in + */ + tp->t_timers->tt_draincnt++; } } Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Tue Aug 16 12:13:12 2016 (r304217) +++ head/sys/netinet/tcp_timer.h Tue Aug 16 12:40:56 2016 (r304218) @@ -191,6 +191,9 @@ extern int tcp_syn_backoff[]; extern int tcp_finwait2_timeout; extern int tcp_fast_finwait2_recycle; +int tcp_inpinfo_lock_add(struct inpcb *inp); +void tcp_inpinfo_lock_del(struct inpcb *inp, struct tcpcb *tp); + void tcp_timer_init(void); void tcp_timer_2msl(void *xtp); void tcp_timer_discard(void *); From owner-svn-src-all@freebsd.org Tue Aug 16 12:54:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C64C8BBB951; Tue, 16 Aug 2016 12:54:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 916581A4C; Tue, 16 Aug 2016 12:54:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 83A781FE022; Tue, 16 Aug 2016 14:54:16 +0200 (CEST) Subject: Re: svn commit: r304218 - head/sys/netinet To: Randall Stewart , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608161240.u7GCeuWS082118@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <92a3cfc1-56bc-813f-dd12-ac19c66fd716@selasky.org> Date: Tue, 16 Aug 2016 14:58:45 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201608161240.u7GCeuWS082118@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 12:54:18 -0000 On 08/16/16 14:40, Randall Stewart wrote: > +int > +tcp_inpinfo_lock_add(struct inpcb *inp) > +{ > + in_pcbref(inp); > + INP_WUNLOCK(inp); > + INP_INFO_RLOCK(&V_tcbinfo); > + INP_WLOCK(inp); > + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { > + return(1); > + } > + return(0); > + > +} Hi, Could you add some comments describing how it is considered safe to drop the INP write-lock and then pick it up again? My first impression is that because you are dropping the inp lock, multiple threads can enter the code in question, leaving the window open to races? --HPS From owner-svn-src-all@freebsd.org Tue Aug 16 13:01:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6149EBBBCEC for ; Tue, 16 Aug 2016 13:01:59 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pf0-x236.google.com (mail-pf0-x236.google.com [IPv6:2607:f8b0:400e:c00::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3303B12D0 for ; Tue, 16 Aug 2016 13:01:59 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-pf0-x236.google.com with SMTP id y134so27575567pfg.0 for ; Tue, 16 Aug 2016 06:01:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=xAHEblL8eUsmHnnowv72BymcS7UGih1pp+NaTqJkMH0=; b=Cxp/KMkH5KAgt2Wi1KZCi/rQmjDvXuRfuhT9W22UBCqUZmAptACD5nL8y1kdsdiCs/ dkLSavJrPB9toMOT4dXhgOQ13mtBDlODylKbayXBRGnTr8vFxn2IPGkGxL/7xyXv+LgO z12fe+aOfJHg10TOnb8QTjv+fUiWZ+weSIoF8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=xAHEblL8eUsmHnnowv72BymcS7UGih1pp+NaTqJkMH0=; b=eSMod/Jyl7IcJfRf10XHrrRL7xk4C1HSeDE2YvReCZnlW9RMJ2YGHcFOVuVQIAee1O 03HZdmM/tV/akgiPGIcIzRSi1Wr5WtX3LQvcO4NmH+WBs7ztozIgnUtY8FZ6TPFqhE85 zznTEQm0ehDoKIX6AJBeOaOvv/ZLHv3G26FoY1ioY9wnHr68rSqGjScrflPSEvBzq3by ooZmxWQA4Fzi4Sg011jeD/bWRqMvhfeOJmXR1NaAuJ+QnqCmT9Bv2vFmESEaB4LwXYbR vQ24Ejipmb3+JJv+NRH5f3NZnMfFcGmJk4i/DQJpjoDmSs/RJp5VeNBgxjrLl2GKIi1D 0D7A== X-Gm-Message-State: AEkooutnePPKK6NiiduzX8+MOmi2Qf2/QuFDjqFI/Hhtvp2Tl+8SEOvxx2TO4sUjWBrC7se2 X-Received: by 10.98.35.145 with SMTP id q17mr64087317pfj.42.1471352518665; Tue, 16 Aug 2016 06:01:58 -0700 (PDT) Received: from [100.127.65.50] ([69.53.245.200]) by smtp.gmail.com with ESMTPSA id g13sm39322491pfb.7.2016.08.16.06.01.57 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Aug 2016 06:01:58 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304218 - head/sys/netinet From: Randall Stewart In-Reply-To: <92a3cfc1-56bc-813f-dd12-ac19c66fd716@selasky.org> Date: Tue, 16 Aug 2016 06:01:57 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <272AD783-2988-4EE7-89A5-EC6FA1313122@netflix.com> References: <201608161240.u7GCeuWS082118@repo.freebsd.org> <92a3cfc1-56bc-813f-dd12-ac19c66fd716@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 13:01:59 -0000 Sure Let me add some comments for you. The idea her is that you pick-up a = reference to the PCB.. so it can=E2=80=99t be removed. Thus when you re-lock the = INP you check the dropped flag (just in case someone did get in). Let me get that in comments.. (note thats also why when using this = function you have to use its companion function to drop the reference). > On Aug 16, 2016, at 5:58 AM, Hans Petter Selasky = wrote: >=20 > On 08/16/16 14:40, Randall Stewart wrote: >> +int >> +tcp_inpinfo_lock_add(struct inpcb *inp) >> +{ >> + in_pcbref(inp); >> + INP_WUNLOCK(inp); >> + INP_INFO_RLOCK(&V_tcbinfo); >> + INP_WLOCK(inp); >> + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { >> + return(1); >> + } >> + return(0); >> + >> +} >=20 > Hi, >=20 > Could you add some comments describing how it is considered safe to = drop the INP write-lock and then pick it up again? >=20 > My first impression is that because you are dropping the inp lock, = multiple threads can enter the code in question, leaving the window open = to races? >=20 > --HPS -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Tue Aug 16 13:08:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 056F2BBBDF8; Tue, 16 Aug 2016 13:08:05 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC42615F6; Tue, 16 Aug 2016 13:08:04 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GD833v093051; Tue, 16 Aug 2016 13:08:03 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GD83Nx093050; Tue, 16 Aug 2016 13:08:03 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201608161308.u7GD83Nx093050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 16 Aug 2016 13:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304219 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 13:08:05 -0000 Author: rrs Date: Tue Aug 16 13:08:03 2016 New Revision: 304219 URL: https://svnweb.freebsd.org/changeset/base/304219 Log: Comments describing how to properly use the new lock_add functions and its respective companion. Sponsored by: Netflix Inc. Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Tue Aug 16 12:40:56 2016 (r304218) +++ head/sys/netinet/tcp_timer.c Tue Aug 16 13:08:03 2016 (r304219) @@ -301,6 +301,25 @@ tcp_timer_delack(void *xtp) CURVNET_RESTORE(); } +/* + * When a timer wants to remove a TCB it must + * hold the INP_INFO_RLOCK(). The timer function + * should only have grabbed the INP_WLOCK() when + * it entered. To safely switch to holding both the + * INP_INFO_RLOCK() and the INP_WLOCK() we must first + * grab a reference on the inp, this will hold the inp + * so that it can't be removed. We then unlock and grab + * the info-read lock. Once we have the INP_INFO_RLOCK() we + * proceed again to get the INP_WLOCK() but after that + * we must check if someone else deleted the pcb i.e. + * the inp_flags check. If so we return 1 otherwise + * we return 0. + * + * No matter which the tcp_inpinfo_lock_add() function + * returns the caller must afterwards call tcp_inpinfo_lock_del() + * to drop the locks and reference properly. + */ + int tcp_inpinfo_lock_add(struct inpcb *inp) { From owner-svn-src-all@freebsd.org Tue Aug 16 13:09:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B70FCBBBE8B; Tue, 16 Aug 2016 13:09:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82B491771; Tue, 16 Aug 2016 13:09:42 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E55D51FE022; Tue, 16 Aug 2016 15:09:40 +0200 (CEST) Subject: Re: svn commit: r304218 - head/sys/netinet To: Randall Stewart References: <201608161240.u7GCeuWS082118@repo.freebsd.org> <92a3cfc1-56bc-813f-dd12-ac19c66fd716@selasky.org> <272AD783-2988-4EE7-89A5-EC6FA1313122@netflix.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <61c62080-1529-a717-fbfc-4f4baed56c3e@selasky.org> Date: Tue, 16 Aug 2016 15:14:09 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <272AD783-2988-4EE7-89A5-EC6FA1313122@netflix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 13:09:42 -0000 On 08/16/16 15:01, Randall Stewart wrote: > Sure > > Let me add some comments for you. The idea her is that you pick-up a reference > to the PCB.. so it can’t be removed. Thus when you re-lock the INP you check the > dropped flag (just in case someone did get in). And this code is only used before tcp_close() / tcp_drop(), so if others got in it is safe to assume that the inp is dead? --HPS From owner-svn-src-all@freebsd.org Tue Aug 16 13:14:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A22EBBB080 for ; Tue, 16 Aug 2016 13:14:47 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1ACFA1BE9 for ; Tue, 16 Aug 2016 13:14:47 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-pf0-x235.google.com with SMTP id x72so27732069pfd.2 for ; Tue, 16 Aug 2016 06:14:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=IZjI1JC58ckslmgn+ZQ9AmzqRpmCrBDhpjRRvgVkh8Y=; b=alfbdIoH7uHheqVaKgQ6mLM7GLT0VAG7omH/C8eHWdN36HexblTzYplAFxfzRU6siV 6e2caOYlX1CLwmjcay0oXUNNM/yMVw8WQBhvyP05gYhSe0TRw7zOXkpZtI7GWwuwp+ZY BZhpOoKMIb9pA2DPB40X0u1KymVY9DcXDwXzE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=IZjI1JC58ckslmgn+ZQ9AmzqRpmCrBDhpjRRvgVkh8Y=; b=L7g0r2vlJem/e03JEeYOO36yToQgOn3BQGcTcFPkWgon8+J0zVTSU5IptNaRybg4OE Vql3Oy6sl9XYVGeNcjkhGdE5gzSZR+hgUHNfXWD0f9Bepuifk+faGpVxQ2Qr3y9W2LCa o02MBzQGAxRfJhHhsHj5dOIxdi4l+bO+dnnhgV8+0J70lH4+ehX0xt3wH9dIMzJL5DNr dhGhktLXjmwTE16W2FQd8VBW1amE341XaPTuJ4ZzPfh3QMsGGJcMmJVYGxRm4Wney+rq jlEbK/g1EBzk/keglKL6xlG8wuaktBL+UVqpxrJxYJZxpDvhtNiDWgrdxk+95tQxWD4K CoXQ== X-Gm-Message-State: AEkooutrO31sg09WIwH1ISbP1E2yBobLePG1Ly/GZXsBXoxoNDd2VtIPGXwU0zEGgi7HCpLR X-Received: by 10.98.58.73 with SMTP id h70mr63305000pfa.125.1471353286521; Tue, 16 Aug 2016 06:14:46 -0700 (PDT) Received: from [100.127.65.50] ([69.53.245.200]) by smtp.gmail.com with ESMTPSA id s12sm39369097pfj.73.2016.08.16.06.14.45 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Aug 2016 06:14:45 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304218 - head/sys/netinet From: Randall Stewart In-Reply-To: <61c62080-1529-a717-fbfc-4f4baed56c3e@selasky.org> Date: Tue, 16 Aug 2016 06:14:44 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6BDE71C4-7C3C-4025-8D49-A87BF65CBFEE@netflix.com> References: <201608161240.u7GCeuWS082118@repo.freebsd.org> <92a3cfc1-56bc-813f-dd12-ac19c66fd716@selasky.org> <272AD783-2988-4EE7-89A5-EC6FA1313122@netflix.com> <61c62080-1529-a717-fbfc-4f4baed56c3e@selasky.org> To: Hans Petter Selasky X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 13:14:47 -0000 Hans: Take a look at the comments maybe they will help you understand whats = going on. The idea of it is that you *only* need the INFO_RLOCK when the timer = function wants to destroy the tcb (not all timers do this).. and yes usually the = timer function is going to call the drop/close path to purge the TCB. So in order to = pick-up the info lock you do the refcnt/lock-dance to get both locks in the proper lock = order. This means that someone could possibly come in and purge the tcb on you while you = are in the process of doing the lock-dance.=20 If that occurs (the return code is 1) all the caller has to do is call = the drop-lock function (the mate to the add_lock) and then return (since the pcb is in the state the = caller wants.. i.e. gone). If the return code is 0, the caller can proceed to purge the tcb.. and = then call the drop_lock function. Note that in theory this could be used outside of wanting to kill the = tcb.. but I am not sure why one would want to hold the INFO_RLOCK if one did not want to purge the tcb. R > On Aug 16, 2016, at 6:14 AM, Hans Petter Selasky = wrote: >=20 > On 08/16/16 15:01, Randall Stewart wrote: >> Sure >>=20 >> Let me add some comments for you. The idea her is that you pick-up a = reference >> to the PCB.. so it can=E2=80=99t be removed. Thus when you re-lock = the INP you check the >> dropped flag (just in case someone did get in). >=20 > And this code is only used before tcp_close() / tcp_drop(), so if = others got in it is safe to assume that the inp is dead? >=20 > --HPS -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Tue Aug 16 13:18:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F469BBB19F; Tue, 16 Aug 2016 13:18:15 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54A051E40; Tue, 16 Aug 2016 13:18:15 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bZeFp-000FvW-N7; Tue, 16 Aug 2016 16:18:05 +0300 Date: Tue, 16 Aug 2016 16:18:05 +0300 From: Slawa Olhovchenkov To: Randall Stewart Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304218 - head/sys/netinet Message-ID: <20160816131805.GK22212@zxy.spb.ru> References: <201608161240.u7GCeuWS082118@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608161240.u7GCeuWS082118@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 13:18:15 -0000 On Tue, Aug 16, 2016 at 12:40:56PM +0000, Randall Stewart wrote: > Author: rrs > Date: Tue Aug 16 12:40:56 2016 > New Revision: 304218 > URL: https://svnweb.freebsd.org/changeset/base/304218 > > Log: > This cleans up the timer code in TCP and also makes it so we do not > take the INFO lock *unless* we are really going to delete the TCB. > > Differential Revision: D7136 Is this related to stable/10? From owner-svn-src-all@freebsd.org Tue Aug 16 13:21:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F22FBBB3DF for ; Tue, 16 Aug 2016 13:21:17 +0000 (UTC) (envelope-from rrs@netflix.com) Received: from mail-pf0-x229.google.com (mail-pf0-x229.google.com [IPv6:2607:f8b0:400e:c00::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 315591314 for ; Tue, 16 Aug 2016 13:21:17 +0000 (UTC) (envelope-from rrs@netflix.com) Received: by mail-pf0-x229.google.com with SMTP id h186so27703832pfg.3 for ; Tue, 16 Aug 2016 06:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netflix.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FzuQxInis9r3AweyFKzHYKIwFcjL8baaQlEANO/H5CE=; b=hRe20XuzRCr+1OdJNjv7Ld5VEEI/bSDxwEE9bXO/eBHy4mQGn48FRVUJ+xhuyD6Dck HCqMGRSmKVYEHpUSHFzFOc/KdLw4eNjf9d8+v4HnYhyvdPA9Skp0u7Zz9mI1aIfSgRfM cpiYdwptszRCMTbfqAnaiSmcfcpWwMVyJKIeY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=FzuQxInis9r3AweyFKzHYKIwFcjL8baaQlEANO/H5CE=; b=Z4Seht+xEBtqdtf6Sx+zcY616DBRJUxby0FUSZgqz+sgZ6yRmA2FzNLrgwAO+s45vL VHcNyecql1PVCCM4E3rnrALdjk6zzdIf2RGGJTWknsM88iAlfZTLTlNV5rZ/fsf+0rC9 qiPgm4ye6QRUuXRektKdL9gpU+B6UpCMZ8H/KTwQpX/g5kyvxOYsZ87NZnh8DFqfIgu9 cSHvX9euIbBiqpd2CtndsQCnm33bqKYdJKUtRczltNJciWx3bd8iZ46XltK/dfnTUczz WCSuosrDLYmqXkUCmjtc/n6TUtfasgoTXaOXb4MECFrKmI5UFs6A7rb8vtQXQDC7ITW4 T1OA== X-Gm-Message-State: AEkoouvxFts3iFTE71oeJr/EGdcNqaIf6w6fxeS3eCl3ZuH7yFmhEEc3Lw4tGtXB6AvLFyIx X-Received: by 10.98.84.65 with SMTP id i62mr63584114pfb.72.1471353676616; Tue, 16 Aug 2016 06:21:16 -0700 (PDT) Received: from [100.127.65.50] ([69.53.245.200]) by smtp.gmail.com with ESMTPSA id q4sm39454475pfb.18.2016.08.16.06.21.15 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 16 Aug 2016 06:21:16 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304218 - head/sys/netinet From: Randall Stewart In-Reply-To: <20160816131805.GK22212@zxy.spb.ru> Date: Tue, 16 Aug 2016 06:21:14 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <16561701-B1C6-4BE3-B9BA-3535F564620F@netflix.com> References: <201608161240.u7GCeuWS082118@repo.freebsd.org> <20160816131805.GK22212@zxy.spb.ru> To: Slawa Olhovchenkov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 13:21:17 -0000 In theory it *could* be MFC=E2=80=99d to stable-10 and 11 but I am not = sure we want to do that. I am told by Drew that it does improve performance since in stable-10 you are = getting the INFO_WLOCK() but I am not sure if folks want it MFC=E2=80=99d=E2=80=A6 One thing that this code leads us towards is we *in theory* could move = the lock acquisition to the timer code itself (I think).. we would have to make sure that the = callout functions did do the unlock since thats part of the lock-dance with reference=E2=80=A6 but = its theoretically possible :-) R > On Aug 16, 2016, at 6:18 AM, Slawa Olhovchenkov = wrote: >=20 > On Tue, Aug 16, 2016 at 12:40:56PM +0000, Randall Stewart wrote: >=20 >> Author: rrs >> Date: Tue Aug 16 12:40:56 2016 >> New Revision: 304218 >> URL: https://svnweb.freebsd.org/changeset/base/304218 >>=20 >> Log: >> This cleans up the timer code in TCP and also makes it so we do not >> take the INFO lock *unless* we are really going to delete the TCB. >>=20 >> Differential Revision: D7136 >=20 > Is this related to stable/10? -------- Randall Stewart rrs@netflix.com 803-317-4952 From owner-svn-src-all@freebsd.org Tue Aug 16 13:37:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D2CFBBB955; Tue, 16 Aug 2016 13:37:12 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 102D21D24; Tue, 16 Aug 2016 13:37:12 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bZeYH-000GNm-Gn; Tue, 16 Aug 2016 16:37:09 +0300 Date: Tue, 16 Aug 2016 16:37:09 +0300 From: Slawa Olhovchenkov To: Randall Stewart Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r304218 - head/sys/netinet Message-ID: <20160816133709.GL22212@zxy.spb.ru> References: <201608161240.u7GCeuWS082118@repo.freebsd.org> <20160816131805.GK22212@zxy.spb.ru> <16561701-B1C6-4BE3-B9BA-3535F564620F@netflix.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <16561701-B1C6-4BE3-B9BA-3535F564620F@netflix.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 13:37:12 -0000 On Tue, Aug 16, 2016 at 06:21:14AM -0700, Randall Stewart via svn-src-all wrote: > > In theory it *could* be MFC’d to stable-10 and 11 but I am not sure we want to do that. I am > told by Drew that it does improve performance since in stable-10 you are getting the INFO_WLOCK() > but I am not sure if folks want it MFC’d… > > One thing that this code leads us towards is we *in theory* could move the lock acquisition to the > timer code itself (I think).. we would have to make sure that the callout functions did do the > unlock since thats part of the lock-dance with reference… but its theoretically possible :-) What reason to not MFC? I mean MFCed all don't break API/ABI. From owner-svn-src-all@freebsd.org Tue Aug 16 13:51:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E942CBBBD55; Tue, 16 Aug 2016 13:51:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id CFAF6197C; Tue, 16 Aug 2016 13:51:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id C66C01233; Tue, 16 Aug 2016 13:51:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 5882C1AA1E; Tue, 16 Aug 2016 13:51:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id P_7qDseGQTlN; Tue, 16 Aug 2016 13:51:36 +0000 (UTC) Subject: Re: svn commit: r304070 - svnadmin/conf DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 010561AA14 To: Glen Barber , Bruce Simpson References: <201608140435.u7E4Z4Fm022554@repo.freebsd.org> <5a2ebac7-1909-75c2-2c10-502c735df1be@fastmail.net> <20160816081451.GB46720@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Tue, 16 Aug 2016 14:51:31 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160816081451.GB46720@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="AgPGab3k8gT3FpO94sPnGNEFf8oTgvtwh" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 13:51:40 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --AgPGab3k8gT3FpO94sPnGNEFf8oTgvtwh Content-Type: multipart/mixed; boundary="cNjnQQondc6kX1BLnTCUrsX6NNmiBiaOd" From: Bryan Drewery To: Glen Barber , Bruce Simpson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Message-ID: Subject: Re: svn commit: r304070 - svnadmin/conf References: <201608140435.u7E4Z4Fm022554@repo.freebsd.org> <5a2ebac7-1909-75c2-2c10-502c735df1be@fastmail.net> <20160816081451.GB46720@FreeBSD.org> In-Reply-To: <20160816081451.GB46720@FreeBSD.org> --cNjnQQondc6kX1BLnTCUrsX6NNmiBiaOd Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 8/16/16 9:14 AM, Glen Barber wrote: > On Tue, Aug 16, 2016 at 09:00:34AM +0100, Bruce Simpson wrote: >> On 14/08/16 05:35, Glen Barber wrote: >>> Author: gjb >>> Date: Sun Aug 14 04:35:04 2016 >>> New Revision: 304070 >>> URL: https://svnweb.freebsd.org/changeset/base/304070 >>> >>> Log: >>> Do not include C function changes by default in svn commit >>> email. >> >> Please back out -- this makes the diff output much less useful. >> >=20 > https://svnweb.freebsd.org/changeset/base/304073 >=20 Thank you. This is incredibly useful, despite being wrong sometimes. We've recently made ports use this by default for 'make makepatch'. --=20 Regards, Bryan Drewery --cNjnQQondc6kX1BLnTCUrsX6NNmiBiaOd-- --AgPGab3k8gT3FpO94sPnGNEFf8oTgvtwh Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXsxpkAAoJEDXXcbtuRpfPtiYH/00bdJ6YSUbP0JyNg8Mu46J3 fBXMicsojUpBp+qRfTB+1X/amdodR2558erSp9iNsT6JPiEM0CYTVTPFc+N1mYDK jggHdYmbHrpeOOUDtRAswUO/AtBYykZ7Ebr1oLNefoSmrKsWv4k0MKGMMASmc3Lx 0JNKYUJRhu8i1ThuaTi01nb1J+zEu2Me5myIaTlwpakDsKUfqEf0tEURyBBJ5SxX pGApQEWxIY2kHlAk1n0XTK3YdFarwla8QUE2ZK7FD21OIYhQkEcegaW0cmGQUrYj XYw2hDGXvtrU6bQ71j4dLkGZhwG1s72AsE5T8f+vObk3l2l4FvTr+ULax97JzfY= =5T70 -----END PGP SIGNATURE----- --AgPGab3k8gT3FpO94sPnGNEFf8oTgvtwh-- From owner-svn-src-all@freebsd.org Tue Aug 16 14:15:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C86C0BBC443; Tue, 16 Aug 2016 14:15:10 +0000 (UTC) (envelope-from sbz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98BCE19B3; Tue, 16 Aug 2016 14:15:10 +0000 (UTC) (envelope-from sbz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GEF9Co018385; Tue, 16 Aug 2016 14:15:09 GMT (envelope-from sbz@FreeBSD.org) Received: (from sbz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GEF9A6018384; Tue, 16 Aug 2016 14:15:09 GMT (envelope-from sbz@FreeBSD.org) Message-Id: <201608161415.u7GEF9A6018384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbz set sender to sbz@FreeBSD.org using -f From: Sofian Brabez Date: Tue, 16 Aug 2016 14:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304220 - head/usr.bin/tty 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 14:15:10 -0000 Author: sbz (ports committer) Date: Tue Aug 16 14:15:09 2016 New Revision: 304220 URL: https://svnweb.freebsd.org/changeset/base/304220 Log: tty: Use proper definition of exit status code and stdin macro Reviewed by: bapt, bdrewery Differential Revision: https://reviews.freebsd.org/D6828 Modified: head/usr.bin/tty/tty.c Modified: head/usr.bin/tty/tty.c ============================================================================== --- head/usr.bin/tty/tty.c Tue Aug 16 13:08:03 2016 (r304219) +++ head/usr.bin/tty/tty.c Tue Aug 16 14:15:09 2016 (r304220) @@ -63,17 +63,18 @@ main(int argc, char *argv[]) case '?': default: usage(); + /* NOTREACHED */ } - t = ttyname(0); + t = ttyname(STDIN_FILENO); if (!sflag) puts(t ? t : "not a tty"); - exit(t ? 0 : 1); + exit(t ? EXIT_SUCCESS : EXIT_FAILURE); } static void usage(void) { - fprintf(stderr, "usage: tty [-s]\n"); + fprintf(stderr, "usage: %s [-s]\n", getprogname()); exit(2); } From owner-svn-src-all@freebsd.org Tue Aug 16 14:23:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1747EBBC6DB; Tue, 16 Aug 2016 14:23:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D76E11EDE; Tue, 16 Aug 2016 14:23:36 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GENZdJ021958; Tue, 16 Aug 2016 14:23:35 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GENZJi021956; Tue, 16 Aug 2016 14:23:35 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608161423.u7GENZJi021956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Aug 2016 14:23:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304221 - head/sys/boot/efi/boot1 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 14:23:37 -0000 Author: manu Date: Tue Aug 16 14:23:35 2016 New Revision: 304221 URL: https://svnweb.freebsd.org/changeset/base/304221 Log: Use %ju modifier for u_int64_t and %jd modifier for off_t. off_t is long long on arm32 and long on amd64 MFC after: 1 week Modified: head/sys/boot/efi/boot1/ufs_module.c head/sys/boot/efi/boot1/zfs_module.c Modified: head/sys/boot/efi/boot1/ufs_module.c ============================================================================== --- head/sys/boot/efi/boot1/ufs_module.c Tue Aug 16 14:15:09 2016 (r304220) +++ head/sys/boot/efi/boot1/ufs_module.c Tue Aug 16 14:23:35 2016 (r304221) @@ -56,7 +56,7 @@ dskread(void *buf, u_int64_t lba, int nb devinfo->dev->Media->MediaId, lba, size, buf); if (status != EFI_SUCCESS) { - DPRINTF("dskread: failed dev: %p, id: %u, lba: %lu, size: %d, " + DPRINTF("dskread: failed dev: %p, id: %u, lba: %zu, size: %d, " "status: %lu\n", devinfo->dev, devinfo->dev->Media->MediaId, lba, size, EFI_ERROR_CODE(status)); Modified: head/sys/boot/efi/boot1/zfs_module.c ============================================================================== --- head/sys/boot/efi/boot1/zfs_module.c Tue Aug 16 14:15:09 2016 (r304220) +++ head/sys/boot/efi/boot1/zfs_module.c Tue Aug 16 14:23:35 2016 (r304221) @@ -53,7 +53,7 @@ vdev_read(vdev_t *vdev, void *priv, off_ status = devinfo->dev->ReadBlocks(devinfo->dev, devinfo->dev->Media->MediaId, lba, bytes, buf); if (status != EFI_SUCCESS) { - DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %zu, size: %zu," + DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %jd, size: %zu," " status: %lu\n", devinfo->dev, devinfo->dev->Media->MediaId, lba, bytes, EFI_ERROR_CODE(status)); From owner-svn-src-all@freebsd.org Tue Aug 16 14:33:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E84C7BBC8F6; Tue, 16 Aug 2016 14:33:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B876115BE; Tue, 16 Aug 2016 14:33:26 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GEXPKF025657; Tue, 16 Aug 2016 14:33:25 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GEXPrP025656; Tue, 16 Aug 2016 14:33:25 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608161433.u7GEXPrP025656@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 16 Aug 2016 14:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304222 - head/sys/boot/efi/libefi 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 14:33:27 -0000 Author: manu Date: Tue Aug 16 14:33:25 2016 New Revision: 304222 URL: https://svnweb.freebsd.org/changeset/base/304222 Log: Only use WaitForKeys event if it exists, this is not the case in u-boot efi implementation. Reviewed by: jhb, emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6781 Modified: head/sys/boot/efi/libefi/efi_console.c Modified: head/sys/boot/efi/libefi/efi_console.c ============================================================================== --- head/sys/boot/efi/libefi/efi_console.c Tue Aug 16 14:23:35 2016 (r304221) +++ head/sys/boot/efi/libefi/efi_console.c Tue Aug 16 14:33:25 2016 (r304222) @@ -438,8 +438,10 @@ efi_cons_getchar() /* Try to read a key stroke. We wait for one if none is pending. */ status = conin->ReadKeyStroke(conin, &key); - if (status == EFI_NOT_READY) { - BS->WaitForEvent(1, &conin->WaitForKey, &junk); + while (status == EFI_NOT_READY) { + /* Some EFI implementation (u-boot for example) do not support WaitForKey */ + if (conin->WaitForKey != NULL) + BS->WaitForEvent(1, &conin->WaitForKey, &junk); status = conin->ReadKeyStroke(conin, &key); } switch (key.ScanCode) { @@ -454,6 +456,9 @@ efi_cons_getchar() int efi_cons_poll() { + + if (conin->WaitForKey == NULL) + return (1); /* This can clear the signaled state. */ return (BS->CheckEvent(conin->WaitForKey) == EFI_SUCCESS); } From owner-svn-src-all@freebsd.org Tue Aug 16 14:57:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77290BBCFF5 for ; Tue, 16 Aug 2016 14:57:07 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: from mail-yb0-x22b.google.com (mail-yb0-x22b.google.com [IPv6:2607:f8b0:4002:c09::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 40A4E11B5 for ; Tue, 16 Aug 2016 14:57:07 +0000 (UTC) (envelope-from ed@nuxi.nl) Received: by mail-yb0-x22b.google.com with SMTP id d10so24831919ybi.1 for ; Tue, 16 Aug 2016 07:57:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuxi-nl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=tqkcaX36QYOEALx41ugFpCOJXFRmtYPFxqx0EfjoXXE=; b=goj0qIBqhPItcjZ9rlGoKAR0tMc1mUMfBvdlW05AC6IZpRsox7tzROLT4WsYKUA+WX btPUNjQeh0vZtlTssQeePnwrJSpUOjdpLsVFXoX/Mz9q9HzKpv/5KjSnJJn1whpVN25r 3Q9qvCvY15aG9/c8eYzqLqfnHdEHJvdHXbF36pzgxofrdkXQ9tqJcT6E+wXHGZQTRryL mzA3Ee3Livt5VNFYMCQCfSchnfIQ4HhuZrOJAP7uX4mW4LJ5ISgsX8Qd/QEmu4x1miz4 JeKhAngSgBVk2tgS+/7tzv83w/BhsOsWh5i/Ijg6vSsM6ON3cfKmVn2797s9wd7ewyVv 7njQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=tqkcaX36QYOEALx41ugFpCOJXFRmtYPFxqx0EfjoXXE=; b=EcdGl3tTsgRqM0NwKmBNBejTpxnGv7Li/cZZlcfF2o4QWESJvvQjPbUa1DtfXV3pRN dQ/dMLzpF0Ncvl7LAVHJySPZr7QB2v8gOr9Hd8EQsN6EHfokgKVFOpu03K9EKevCH79S sZVydeGsclnfFBP0qX0KKG5SfB/BpvsB6/cim59G2JFsDCOmhUabeemw4lhDXR5ntE4B XjDEruJaymK36daUK0MpkuTq3liEMtrjBfdUK07t9Pn1U80bdLOgTElbe5DVAbROXxKD v0O8pJ+kZi5JkD7mHde3Jidd8Ix6qx1eSUgR2TErhr9PLsgXOTTzPUohwD1EmH/TgWb/ lXlg== X-Gm-Message-State: AEkoousVSPTgfeD4SuJyMM83qggYqf3xhR+SjrCc+aBGWB/kGXgM/sJ+Q/I5RioWLiQ8XqnS8Yuyz/nX9oD/sg== X-Received: by 10.37.57.85 with SMTP id g82mr23936800yba.163.1471359426210; Tue, 16 Aug 2016 07:57:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.13.201.71 with HTTP; Tue, 16 Aug 2016 07:57:05 -0700 (PDT) In-Reply-To: <201608161423.u7GENZJi021956@repo.freebsd.org> References: <201608161423.u7GENZJi021956@repo.freebsd.org> From: Ed Schouten Date: Tue, 16 Aug 2016 16:57:05 +0200 Message-ID: Subject: Re: svn commit: r304221 - head/sys/boot/efi/boot1 To: Emmanuel Vadot Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 14:57:07 -0000 Hi Emmanuel, 2016-08-16 16:23 GMT+02:00 Emmanuel Vadot : > Author: manu > Date: Tue Aug 16 14:23:35 2016 > New Revision: 304221 > URL: https://svnweb.freebsd.org/changeset/base/304221 > > Log: > Use %ju modifier for u_int64_t and %jd modifier for off_t. > off_t is long long on arm32 and long on amd64 I think both of these should be solved differently: - For uint64_t, you can use 's PRIu64 in the formatting string. In kernel space, I suspect you need to use something like . - For off_t, it's all right to print it with %jd, but then be sure to also add a cast to the argument itself. It may not necessarily be equal to an intmax_t. -- Ed Schouten Nuxi, 's-Hertogenbosch, the Netherlands KvK-nr.: 62051717 From owner-svn-src-all@freebsd.org Tue Aug 16 15:11:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CF00BBB3AA; Tue, 16 Aug 2016 15:11:48 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20CDC18D9; Tue, 16 Aug 2016 15:11:48 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GFBlSL037973; Tue, 16 Aug 2016 15:11:47 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GFBkJQ037962; Tue, 16 Aug 2016 15:11:46 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201608161511.u7GFBkJQ037962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 16 Aug 2016 15:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304223 - in head: share/man/man4 share/man/man9 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 15:11:48 -0000 Author: rrs Date: Tue Aug 16 15:11:46 2016 New Revision: 304223 URL: https://svnweb.freebsd.org/changeset/base/304223 Log: Here we update the modular tcp to be able to switch to an alternate TCP stack in other then the closed state (pre-listen/connect). The idea is that *if* that is supported by the alternate stack, it is asked if its ok to switch. If it approves the "handoff" then we allow the switch to happen. Also the fini() function now gets a flag to tell if you are switching away *or* the tcb is destroyed. The init() call into the alternate stack is moved to the end so the tcb is more fully formed before the init transpires. Sponsored by: Netflix Inc. Differential Revision: D6790 Modified: head/share/man/man4/tcp.4 head/share/man/man9/tcp_functions.9 head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Tue Aug 16 14:33:25 2016 (r304222) +++ head/share/man/man4/tcp.4 Tue Aug 16 15:11:46 2016 (r304223) @@ -633,7 +633,8 @@ when trying to use a TCP function block .Xr mod_cc 4 , .Xr siftr 4 , .Xr syncache 4 , -.Xr setkey 8 +.Xr setkey 8 , +.Xr tcp_functions 9 .Rs .%A "V. Jacobson" .%A "R. Braden" Modified: head/share/man/man9/tcp_functions.9 ============================================================================== --- head/share/man/man9/tcp_functions.9 Tue Aug 16 14:33:25 2016 (r304222) +++ head/share/man/man9/tcp_functions.9 Tue Aug 16 15:11:46 2016 (r304223) @@ -114,14 +114,17 @@ struct tcp_function_block { struct inpcb *inp, struct tcpcb *tp); /* Optional memory allocation/free routine */ void (*tfb_tcp_fb_init)(struct tcpcb *); - void (*tfb_tcp_fb_fini)(struct tcpcb *); + void (*tfb_tcp_fb_fini)(struct tcpcb *, int); /* Optional timers, must define all if you define one */ int (*tfb_tcp_timer_stop_all)(struct tcpcb *); void (*tfb_tcp_timer_activate)(struct tcpcb *, uint32_t, u_int); int (*tfb_tcp_timer_active)(struct tcpcb *, uint32_t); void (*tfb_tcp_timer_stop)(struct tcpcb *, uint32_t); + /* Optional functions */ void (*tfb_tcp_rexmit_tmr)(struct tcpcb *); + void (*tfb_tcp_handoff_ok)(struct tcpcb *); + /* System use */ volatile uint32_t tfb_refcnt; uint32_t tfb_flags; }; @@ -157,6 +160,16 @@ in the .Va tfb_tcp_fb_fini field. .Pp +If the +.Va tfb_tcp_fb_fini +argument is non-NULL, the function to which it points is called when the +kernel is destroying the TCP control block or when the socket is transitioning +to use a different TCP stack. +The function is called with arguments of the TCP control block and an integer +flag. +The flag will be zero if the socket is transitioning to use another TCP stack +or one if the TCP control block is being destroyed. +.Pp If the TCP stack implements additional timers, the TCP stack should set a non-NULL pointer in the .Va tfb_tcp_timer_stop_all , @@ -193,6 +206,37 @@ However, care must be taken to ensure th TCP control block in a valid state for the remainder of the retransmit timer logic. .Pp +A user may select a new TCP stack before calling +.Xr connect 2 +or +.Xr listen 2 . +Optionally, a TCP stack may also allow a user to begin using the TCP stack for +a connection that is in a later state by setting a non-NULL function pointer in +the +.Va tfb_tcp_handoff_ok +field. +If this field is non-NULL and a user attempts to select that TCP stack after +calling +.Xr connect 2 +or +.Xr listen 2 +for that socket, the kernel will call the function pointed to by the +.Va tfb_tcp_handoff_ok +field. +The function should return 0 if the user is allowed to switch the socket to use +the TCP stack. Otherwise, the function should return an error code, which will +be returned to the user. +If the +.Va tfb_tcp_handoff_ok +field is +.Dv NULL +and a user attempts to select the TCP stack after calling +.Xr connect 2 +or +.Xr listen 2 +for that socket, the operation will fail and the kernel will return +.Er EINVAL . +.Pp The .Va tfb_refcnt and @@ -269,8 +313,10 @@ The .Fa blk argument references a function block that is not currently registered. .Sh SEE ALSO -.Xr malloc 9 , -.Xr tcp 4 +.Xr connect 2 , +.Xr listen 2 , +.Xr tcp 4 , +.Xr malloc 9 .Sh HISTORY This framework first appeared in .Fx 11.0 . Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Aug 16 14:33:25 2016 (r304222) +++ head/sys/netinet/tcp_subr.c Tue Aug 16 15:11:46 2016 (r304223) @@ -1187,9 +1187,6 @@ tcp_newtcpcb(struct inpcb *inp) tp->t_fb = tcp_func_set_ptr; refcount_acquire(&tp->t_fb->tfb_refcnt); rw_runlock(&tcp_function_lock); - if (tp->t_fb->tfb_tcp_fb_init) { - (*tp->t_fb->tfb_tcp_fb_init)(tp); - } /* * Use the current system default CC algorithm. */ @@ -1201,7 +1198,7 @@ tcp_newtcpcb(struct inpcb *inp) if (CC_ALGO(tp)->cb_init != NULL) if (CC_ALGO(tp)->cb_init(tp->ccv) > 0) { if (tp->t_fb->tfb_tcp_fb_fini) - (*tp->t_fb->tfb_tcp_fb_fini)(tp); + (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); refcount_release(&tp->t_fb->tfb_refcnt); uma_zfree(V_tcpcb_zone, tm); return (NULL); @@ -1210,7 +1207,7 @@ tcp_newtcpcb(struct inpcb *inp) tp->osd = &tm->osd; if (khelp_init_osd(HELPER_CLASS_TCP, tp->osd)) { if (tp->t_fb->tfb_tcp_fb_fini) - (*tp->t_fb->tfb_tcp_fb_fini)(tp); + (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); refcount_release(&tp->t_fb->tfb_refcnt); uma_zfree(V_tcpcb_zone, tm); return (NULL); @@ -1271,6 +1268,9 @@ tcp_newtcpcb(struct inpcb *inp) */ tcp_pcap_tcpcb_init(tp); #endif + if (tp->t_fb->tfb_tcp_fb_init) { + (*tp->t_fb->tfb_tcp_fb_init)(tp); + } return (tp); /* XXX */ } @@ -1484,7 +1484,7 @@ tcp_discardcb(struct tcpcb *tp) if (tp->t_timers->tt_draincnt == 0) { /* We own the last reference on tcpcb, let's free it. */ if (tp->t_fb->tfb_tcp_fb_fini) - (*tp->t_fb->tfb_tcp_fb_fini)(tp); + (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); refcount_release(&tp->t_fb->tfb_refcnt); tp->t_inpcb = NULL; uma_zfree(V_tcpcb_zone, tp); @@ -1513,7 +1513,7 @@ tcp_timer_discard(void *ptp) if (tp->t_timers->tt_draincnt == 0) { /* We own the last reference on this tcpcb, let's free it. */ if (tp->t_fb->tfb_tcp_fb_fini) - (*tp->t_fb->tfb_tcp_fb_fini)(tp); + (*tp->t_fb->tfb_tcp_fb_fini)(tp, 1); refcount_release(&tp->t_fb->tfb_refcnt); tp->t_inpcb = NULL; uma_zfree(V_tcpcb_zone, tp); Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Tue Aug 16 14:33:25 2016 (r304222) +++ head/sys/netinet/tcp_syncache.c Tue Aug 16 15:11:46 2016 (r304223) @@ -842,7 +842,7 @@ syncache_socket(struct syncache *sc, str KASSERT(rblk != NULL, ("cannot find blk %p out of syncache?", blk)); if (tp->t_fb->tfb_tcp_fb_fini) - (*tp->t_fb->tfb_tcp_fb_fini)(tp); + (*tp->t_fb->tfb_tcp_fb_fini)(tp, 0); refcount_release(&tp->t_fb->tfb_refcnt); tp->t_fb = rblk; if (tp->t_fb->tfb_tcp_fb_init) { Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Tue Aug 16 14:33:25 2016 (r304222) +++ head/sys/netinet/tcp_usrreq.c Tue Aug 16 15:11:46 2016 (r304223) @@ -1420,40 +1420,59 @@ tcp_ctloutput(struct socket *so, struct if (error) return (error); INP_WLOCK_RECHECK(inp); - if (tp->t_state != TCPS_CLOSED) { - /* - * The user has advanced the state - * past the initial point, we can't - * switch since we are down the road - * and a new set of functions may - * not be compatibile. - */ - INP_WUNLOCK(inp); - return(EINVAL); - } blk = find_and_ref_tcp_functions(&fsn); if (blk == NULL) { INP_WUNLOCK(inp); return (ENOENT); } - if (tp->t_fb != blk) { - if (blk->tfb_flags & TCP_FUNC_BEING_REMOVED) { + if (tp->t_fb == blk) { + /* You already have this */ + refcount_release(&blk->tfb_refcnt); + INP_WUNLOCK(inp); + return (0); + } + if (tp->t_state != TCPS_CLOSED) { + int error=EINVAL; + /* + * The user has advanced the state + * past the initial point, we may not + * be able to switch. + */ + if (blk->tfb_tcp_handoff_ok != NULL) { + /* + * Does the stack provide a + * query mechanism, if so it may + * still be possible? + */ + error = (*blk->tfb_tcp_handoff_ok)(tp); + } + if (error) { refcount_release(&blk->tfb_refcnt); INP_WUNLOCK(inp); - return (ENOENT); + return(error); } + } + if (blk->tfb_flags & TCP_FUNC_BEING_REMOVED) { + refcount_release(&blk->tfb_refcnt); + INP_WUNLOCK(inp); + return (ENOENT); + } + /* + * Release the old refcnt, the + * lookup acquired a ref on the + * new one already. + */ + if (tp->t_fb->tfb_tcp_fb_fini) { /* - * Release the old refcnt, the - * lookup acquires a ref on the - * new one. + * Tell the stack to cleanup with 0 i.e. + * the tcb is not going away. */ - if (tp->t_fb->tfb_tcp_fb_fini) - (*tp->t_fb->tfb_tcp_fb_fini)(tp); - refcount_release(&tp->t_fb->tfb_refcnt); - tp->t_fb = blk; - if (tp->t_fb->tfb_tcp_fb_init) { - (*tp->t_fb->tfb_tcp_fb_init)(tp); - } + (*tp->t_fb->tfb_tcp_fb_fini)(tp, 0); + } + refcount_release(&tp->t_fb->tfb_refcnt); + tp->t_fb = blk; + if (tp->t_fb->tfb_tcp_fb_init) { + (*tp->t_fb->tfb_tcp_fb_init)(tp); } #ifdef TCP_OFFLOAD if (tp->t_flags & TF_TOE) { Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue Aug 16 14:33:25 2016 (r304222) +++ head/sys/netinet/tcp_var.h Tue Aug 16 15:11:46 2016 (r304223) @@ -116,6 +116,18 @@ struct socket; * does not know your callbacks you must provide a * stop_all function that loops through and calls * tcp_timer_stop() with each of your defined timers. + * Adding a tfb_tcp_handoff_ok function allows the socket + * option to change stacks to query you even if the + * connection is in a later stage. You return 0 to + * say you can take over and run your stack, you return + * non-zero (an error number) to say no you can't. + * If the function is undefined you can only change + * in the early states (before connect or listen). + * tfb_tcp_fb_fini is changed to add a flag to tell + * the old stack if the tcb is being destroyed or + * not. A one in the flag means the TCB is being + * destroyed, a zero indicates its transitioning to + * another stack (via socket option). */ struct tcp_function_block { char tfb_tcp_block_name[TCP_FUNCTION_NAME_LEN_MAX]; @@ -128,7 +140,7 @@ struct tcp_function_block { struct inpcb *inp, struct tcpcb *tp); /* Optional memory allocation/free routine */ void (*tfb_tcp_fb_init)(struct tcpcb *); - void (*tfb_tcp_fb_fini)(struct tcpcb *); + void (*tfb_tcp_fb_fini)(struct tcpcb *, int); /* Optional timers, must define all if you define one */ int (*tfb_tcp_timer_stop_all)(struct tcpcb *); void (*tfb_tcp_timer_activate)(struct tcpcb *, @@ -136,6 +148,7 @@ struct tcp_function_block { int (*tfb_tcp_timer_active)(struct tcpcb *, uint32_t); void (*tfb_tcp_timer_stop)(struct tcpcb *, uint32_t); void (*tfb_tcp_rexmit_tmr)(struct tcpcb *); + int (*tfb_tcp_handoff_ok)(struct tcpcb *); volatile uint32_t tfb_refcnt; uint32_t tfb_flags; }; From owner-svn-src-all@freebsd.org Tue Aug 16 15:17:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3439BBBB4CB; Tue, 16 Aug 2016 15:17:37 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 074231CD5; Tue, 16 Aug 2016 15:17:36 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GFHaHY040831; Tue, 16 Aug 2016 15:17:36 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GFHavn040830; Tue, 16 Aug 2016 15:17:36 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201608161517.u7GFHavn040830@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 16 Aug 2016 15:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304224 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 15:17:37 -0000 Author: rrs Date: Tue Aug 16 15:17:36 2016 New Revision: 304224 URL: https://svnweb.freebsd.org/changeset/base/304224 Log: A few more wording tweaks as suggested (with some modifications as well) by Ravi Pokala. Thanks for the comments :-) Sponsored by: Netflix Inc. Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Tue Aug 16 15:11:46 2016 (r304223) +++ head/sys/netinet/tcp_timer.c Tue Aug 16 15:17:36 2016 (r304224) @@ -307,15 +307,15 @@ tcp_timer_delack(void *xtp) * should only have grabbed the INP_WLOCK() when * it entered. To safely switch to holding both the * INP_INFO_RLOCK() and the INP_WLOCK() we must first - * grab a reference on the inp, this will hold the inp - * so that it can't be removed. We then unlock and grab - * the info-read lock. Once we have the INP_INFO_RLOCK() we - * proceed again to get the INP_WLOCK() but after that - * we must check if someone else deleted the pcb i.e. - * the inp_flags check. If so we return 1 otherwise - * we return 0. + * grab a reference on the inp, which will hold the inp + * so that it can't be removed. We then unlock the INP_WLOCK(), + * and grab the INP_INFO_RLOCK() lock. Once we have the INP_INFO_RLOCK() + * we proceed again to get the INP_WLOCK() (this preserves proper + * lock order). After acquiring the INP_WLOCK we must check if someone + * else deleted the pcb i.e. the inp_flags check. + * If so we return 1 otherwise we return 0. * - * No matter which the tcp_inpinfo_lock_add() function + * No matter what the tcp_inpinfo_lock_add() function * returns the caller must afterwards call tcp_inpinfo_lock_del() * to drop the locks and reference properly. */ From owner-svn-src-all@freebsd.org Tue Aug 16 15:32:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C61CBBB9F8; Tue, 16 Aug 2016 15:32:54 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp002.me.com (mr11p00im-asmtp002.me.com [17.110.69.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FAC116F8; Tue, 16 Aug 2016 15:32:54 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp002.me.com by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OC000F00DQWRI00@mr11p00im-asmtp002.me.com>; Tue, 16 Aug 2016 15:32:47 +0000 (GMT) Received: from [192.168.1.4] (c-67-188-225-23.hsd1.ca.comcast.net [67.188.225.23]) by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OC0007T9DUKUI30@mr11p00im-asmtp002.me.com>; Tue, 16 Aug 2016 15:32:46 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-16_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1608160183 User-Agent: Microsoft-MacOutlook/f.18.0.160709 Date: Tue, 16 Aug 2016 08:32:43 -0700 Subject: Re: svn commit: r304011 - head/libexec/rtld-elf From: Ravi Pokala Sender: "Pokala, Ravi" To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <457F4AE9-A909-44C9-A38B-CD8C28E3068F@panasas.com> Thread-topic: svn commit: r304011 - head/libexec/rtld-elf References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> In-reply-to: MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1471361567; bh=XexgUX0UrGHzAj/vu5sjK034zo15tnz7eVtJlIvyGH4=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=YmtdskqmKxyprT6s0I331hdktUiPkD8bfaMlqSk3znghpJ/c+mo9jlDY6geW3OARR iCOeu5qFbzEzS1qMR33tKOEHiZAb73pB5loTt5qY761QMrGqF7rUBIYhSd3hMJEQbn BKzZS2gifhwzuUDykeRPWxr1LAaw1wMXZbSqor4/ydtXcBIUtF/lTbJ2Vg6kiJW89G qM3y1BbEWl4y2tMG/81bkVCiKHMsNbPTAnKTpVx04UTLSdzh7X9gy+jMBpOyCqLgGC huqthU1rB39j3o7V9B7miG65V+npKj9YMo5sJG52EcHPZxs54NuvLEncfVIg4O66v9 0evmor50H+rww== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 15:32:54 -0000 -----Original Message----- From: on behalf of Bryan Drewery Organization: FreeBSD Date: 2016-08-16, Tuesday at 03:30 To: Ngie Cooper , Konstantin Belousov Cc: , , Subject: Re: svn commit: r304011 - head/libexec/rtld-elf >On 8/12/16 7:34 PM, Ngie Cooper wrote: >> >> ... >> >>> Log: >>> Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf. >> >> Why? >> > > It's a somewhat error-prone and dangerous macro. See r302908. I'll grant you "error-prone", but why do you consider it "dangerous"? It's inefficient to walk the whole list when passing NULL as the starting pointer, but I'm not sure what the danger is. And, if it really *is* dangerous, perhaps we should purge the TAILQ_FOREACH_FROM APIs entirely? It looks like rtld-elf was the last (in-tree) user: [freebsd/base/head] rpokala% grep -rl TAILQ_FOREACH_FROM . ./share/man/man3/Makefile ./share/man/man3/queue.3 ./sys/sys/queue.h I confirmed that queue.h just defines the (S)TAILQ_FOREACH_FROM(_SAFE) macros, but doesn't use them internally to define anything else. -Ravi (rpokala@) > -- > Regards, > Bryan Drewery From owner-svn-src-all@freebsd.org Tue Aug 16 15:35:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA81CBBBA88; Tue, 16 Aug 2016 15:35:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 99F8818BC; Tue, 16 Aug 2016 15:35:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 8D9911D7A; Tue, 16 Aug 2016 15:35:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 3EF011AC16; Tue, 16 Aug 2016 15:35:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id ou0fLNojrF5N; Tue, 16 Aug 2016 15:35:19 +0000 (UTC) Subject: Re: svn commit: r304011 - head/libexec/rtld-elf DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 55B8E1AC0C To: Ravi Pokala References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> <457F4AE9-A909-44C9-A38B-CD8C28E3068F@panasas.com> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Tue, 16 Aug 2016 16:35:16 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <457F4AE9-A909-44C9-A38B-CD8C28E3068F@panasas.com> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="EN5vBwOgnMHS8Hfm0mdDPF5U8AjCk0TPt" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 15:35:23 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --EN5vBwOgnMHS8Hfm0mdDPF5U8AjCk0TPt Content-Type: multipart/mixed; boundary="5Ccw6cSeC65aD447LNviEajGxCPnrV1gH" From: Bryan Drewery To: Ravi Pokala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r304011 - head/libexec/rtld-elf References: <201608121829.u7CITCIu059447@repo.freebsd.org> <35B0B56E-A536-4A07-B397-7E5ABAB4CB34@gmail.com> <457F4AE9-A909-44C9-A38B-CD8C28E3068F@panasas.com> In-Reply-To: <457F4AE9-A909-44C9-A38B-CD8C28E3068F@panasas.com> --5Ccw6cSeC65aD447LNviEajGxCPnrV1gH Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/16/16 4:32 PM, Ravi Pokala wrote: > -----Original Message----- > From: on behalf of Bryan Drewery > Organization: FreeBSD > Date: 2016-08-16, Tuesday at 03:30 > To: Ngie Cooper , Konstantin Belousov > Cc: , , > Subject: Re: svn commit: r304011 - head/libexec/rtld-elf >=20 >> On 8/12/16 7:34 PM, Ngie Cooper wrote: >>> >>> ... >>> >>>> Log: >>>> Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf. >>> >>> Why? >>> >> >> It's a somewhat error-prone and dangerous macro. See r302908. >=20 > I'll grant you "error-prone", but why do you consider it "dangerous"? I= t's inefficient to walk the whole list when passing NULL as the starting = pointer, but I'm not sure what the danger is. >=20 I don't mean "dangerous" here as in security, but as in "doing the right thing" or "doing what is expected", which it did not as seen in r302908. Granted, the original commit for _FROM noted this problem, but it is very much not obvious. > And, if it really *is* dangerous, perhaps we should purge the TAILQ_FOR= EACH_FROM APIs entirely? It looks like rtld-elf was the last (in-tree) us= er: >=20 I'm not a fan of having it with this behavior, but I understand why it was designed like this. > [freebsd/base/head] rpokala% grep -rl TAILQ_FOREACH_FROM . > ./share/man/man3/Makefile > ./share/man/man3/queue.3 > ./sys/sys/queue.h >=20 > I confirmed that queue.h just defines the (S)TAILQ_FOREACH_FROM(_SAFE) = macros, but doesn't use them internally to define anything else. >=20 > -Ravi (rpokala@) >=20 >> --=20 >> Regards, >> Bryan Drewery=20 >=20 >=20 >=20 --=20 Regards, Bryan Drewery --5Ccw6cSeC65aD447LNviEajGxCPnrV1gH-- --EN5vBwOgnMHS8Hfm0mdDPF5U8AjCk0TPt Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXszK0AAoJEDXXcbtuRpfPOeAH/0KMfBjmKxdRGDTm0IjZAkcc 7uvBZ3o4EqFnS85Pjzgqq9uOcB8p745fMAGj/pacwWKUlPwTBRSr7uPrXMYe9tEU DeG/xLQ2F9mIclqFbS0PGR9gQDVChhR4tlpbNzC863zWnUF6XM8oOOhw1fRNP9Zo F6ludxdCBsVLvvq6Ofhg0tM/HCeay/hBSjh+rRb3WPG/5IvBPNPuh8e7fDaWa5tY ur2BjYzLuEh2wHy/NJgyRn9QMxclDa0xgFJzycmf0Z3W5mEHvZTN1Yl2P2gIZLjh pexwhwlqg+R1IZP1YwjjsMq70yLM3CUtbEaubh73wzXRhopEd1K/gs8eglCJ01Q= =qTZe -----END PGP SIGNATURE----- --EN5vBwOgnMHS8Hfm0mdDPF5U8AjCk0TPt-- From owner-svn-src-all@freebsd.org Tue Aug 16 15:52:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D15BDBBC20B; Tue, 16 Aug 2016 15:52:11 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E2A818C4; Tue, 16 Aug 2016 15:52:11 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GFqA0L055556; Tue, 16 Aug 2016 15:52:10 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GFqAtE055555; Tue, 16 Aug 2016 15:52:10 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201608161552.u7GFqAtE055555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 16 Aug 2016 15:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304225 - head/usr.bin/systat 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 15:52:11 -0000 Author: araujo Date: Tue Aug 16 15:52:10 2016 New Revision: 304225 URL: https://svnweb.freebsd.org/changeset/base/304225 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Modified: head/usr.bin/systat/main.c Modified: head/usr.bin/systat/main.c ============================================================================== --- head/usr.bin/systat/main.c Tue Aug 16 15:17:36 2016 (r304224) +++ head/usr.bin/systat/main.c Tue Aug 16 15:52:10 2016 (r304225) @@ -261,7 +261,7 @@ display(void) int i, j; /* Get the load average over the last minute. */ - (void) getloadavg(avenrun, sizeof(avenrun) / sizeof(avenrun[0])); + (void) getloadavg(avenrun, nitems(avenrun)); (*curcmd->c_fetch)(); if (curcmd->c_flags & CF_LOADAV) { j = 5.0*avenrun[0] + 0.5; @@ -293,7 +293,7 @@ display(void) GETSYSCTL("kstat.zfs.misc.arcstats.l2_hdr_size", arc[5]); GETSYSCTL("kstat.zfs.misc.arcstats.other_size", arc[6]); wmove(wload, 0, 0); wclrtoeol(wload); - for (i = 0 ; i < sizeof(arc) / sizeof(arc[0]) ; i++) { + for (i = 0 ; i < nitems(arc); i++) { if (arc[i] > 10llu * 1024 * 1024 * 1024 ) { wprintw(wload, "%7lluG", arc[i] >> 30); } @@ -318,7 +318,7 @@ void load(void) { - (void) getloadavg(avenrun, sizeof(avenrun)/sizeof(avenrun[0])); + (void) getloadavg(avenrun, nitems(avenrun)); mvprintw(CMDLINE, 0, "%4.1f %4.1f %4.1f", avenrun[0], avenrun[1], avenrun[2]); clrtoeol(); From owner-svn-src-all@freebsd.org Tue Aug 16 15:53:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7448FBBC320; Tue, 16 Aug 2016 15:53:06 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 447771A8E; Tue, 16 Aug 2016 15:53:06 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GFr5tm055628; Tue, 16 Aug 2016 15:53:05 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GFr5LE055627; Tue, 16 Aug 2016 15:53:05 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201608161553.u7GFr5LE055627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 16 Aug 2016 15:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304226 - head/usr.bin/rpcgen 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 15:53:06 -0000 Author: araujo Date: Tue Aug 16 15:53:05 2016 New Revision: 304226 URL: https://svnweb.freebsd.org/changeset/base/304226 Log: Use nitems() from sys/param.h. MFC after: 2 weeks. Modified: head/usr.bin/rpcgen/rpc_main.c Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Tue Aug 16 15:52:10 2016 (r304225) +++ head/usr.bin/rpcgen/rpc_main.c Tue Aug 16 15:53:05 2016 (r304226) @@ -82,11 +82,11 @@ static char pathbuf[MAXPATHLEN + 1]; static const char *allv[] = { "rpcgen", "-s", "udp", "-s", "tcp", }; -static int allc = sizeof (allv)/sizeof (allv[0]); +static int allc = nitems(allv); static const char *allnv[] = { "rpcgen", "-s", "netpath", }; -static int allnc = sizeof (allnv)/sizeof (allnv[0]); +static int allnc = nitems(allnv); /* * machinations for handling expanding argument list From owner-svn-src-all@freebsd.org Tue Aug 16 15:58:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40C6FBBC3FD; Tue, 16 Aug 2016 15:58:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0A9661D6A; Tue, 16 Aug 2016 15:58:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id C90133C1F0B; Wed, 17 Aug 2016 01:29:49 +1000 (AEST) Date: Wed, 17 Aug 2016 01:29:49 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ed Schouten cc: Emmanuel Vadot , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304221 - head/sys/boot/efi/boot1 In-Reply-To: Message-ID: <20160817010752.S2142@besplex.bde.org> References: <201608161423.u7GENZJi021956@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=CoZCCSMD c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=4GrCeSYe2VWqUJf7sEoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 15:58:48 -0000 On Tue, 16 Aug 2016, Ed Schouten wrote: > Hi Emmanuel, >> >> Log: >> Use %ju modifier for u_int64_t and %jd modifier for off_t. >> off_t is long long on arm32 and long on amd64 > > I think both of these should be solved differently: > > - For uint64_t, you can use 's PRIu64 in the formatting > string. In kernel space, I suspect you need to use something like > . Ugh. > - For off_t, it's all right to print it with %jd, but then be sure to > also add a cast to the argument itself. It may not necessarily be > equal to an intmax_t. This shows how stupid the PRI* macros are. They might be available for 0.1% of typedefed types in a medium-sized source tree. But to use them, you have to know their exact type, and change all printfs using them whenever the typedef is changed. If it is changed to a non-fixed width type, then the printfs need lots of editing to change to a cast. Their only advantage is that they are more space and time efficient, especially on 16-bit systems. Extensive use of fixed-width type is another bug. It asks for a fixed ABI at any cost to efficiency or space. FreeBSD almost never uses "fast" or "least" integer types. However, if you use these types, there are PRI* mistakes for them too. The SCN* macros are not quite as stupid as PRI*, but they should never be used. scanf() is already unusable since it gives undefined behaviour on overflow. These macros are not quite as stupid as PRI* since casts don't work so well for input. The corrsponding thing is to scan input into variables of type [u]intmax_t and convert to the corresponding type, of course without any bounds checking so that you get similar undefined behaviour on overflow as when using SCN*. Bruce From owner-svn-src-all@freebsd.org Tue Aug 16 16:49:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC6DBBBCFF6; Tue, 16 Aug 2016 16:49:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95A041982; Tue, 16 Aug 2016 16:49:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GGnuUY074277; Tue, 16 Aug 2016 16:49:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GGnu6W074276; Tue, 16 Aug 2016 16:49:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608161649.u7GGnu6W074276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Aug 2016 16:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304227 - head/sys/ufs/ffs 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 16:49:58 -0000 Author: kib Date: Tue Aug 16 16:49:56 2016 New Revision: 304227 URL: https://svnweb.freebsd.org/changeset/base/304227 Log: In ffs_balloc_ufs{1,2} routines, assert that unwind records do not overflow local arrays. This is not immediately obvious from the static code inspection, due to retry logic. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_balloc.c Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 15:53:05 2016 (r304226) +++ head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 16:49:56 2016 (r304227) @@ -255,6 +255,8 @@ ffs_balloc_ufs1(struct vnode *vp, off_t } pref = newb + fs->fs_frag; nb = newb; + MPASS(allocblk < allociblk + nitems(allociblk)); + MPASS(lbns_remfree < lbns + nitems(lbns)); *allocblk++ = nb; *lbns_remfree++ = indirs[1].in_lbn; bp = getblk(vp, indirs[1].in_lbn, fs->fs_bsize, 0, 0, gbflags); @@ -325,6 +327,8 @@ retry: } pref = newb + fs->fs_frag; nb = newb; + MPASS(allocblk < allociblk + nitems(allociblk)); + MPASS(lbns_remfree < lbns + nitems(lbns)); *allocblk++ = nb; *lbns_remfree++ = indirs[i].in_lbn; nbp = getblk(vp, indirs[i].in_lbn, fs->fs_bsize, 0, 0, 0); @@ -401,6 +405,8 @@ retry: goto fail; } nb = newb; + MPASS(allocblk < allociblk + nitems(allociblk)); + MPASS(lbns_remfree < lbns + nitems(lbns)); *allocblk++ = nb; *lbns_remfree++ = lbn; nbp = getblk(vp, lbn, fs->fs_bsize, 0, 0, gbflags); @@ -818,6 +824,8 @@ ffs_balloc_ufs2(struct vnode *vp, off_t } pref = newb + fs->fs_frag; nb = newb; + MPASS(allocblk < allociblk + nitems(allociblk)); + MPASS(lbns_remfree < lbns + nitems(lbns)); *allocblk++ = nb; *lbns_remfree++ = indirs[1].in_lbn; bp = getblk(vp, indirs[1].in_lbn, fs->fs_bsize, 0, 0, @@ -889,6 +897,8 @@ retry: } pref = newb + fs->fs_frag; nb = newb; + MPASS(allocblk < allociblk + nitems(allociblk)); + MPASS(lbns_remfree < lbns + nitems(lbns)); *allocblk++ = nb; *lbns_remfree++ = indirs[i].in_lbn; nbp = getblk(vp, indirs[i].in_lbn, fs->fs_bsize, 0, 0, @@ -966,6 +976,8 @@ retry: goto fail; } nb = newb; + MPASS(allocblk < allociblk + nitems(allociblk)); + MPASS(lbns_remfree < lbns + nitems(lbns)); *allocblk++ = nb; *lbns_remfree++ = lbn; nbp = getblk(vp, lbn, fs->fs_bsize, 0, 0, gbflags); From owner-svn-src-all@freebsd.org Tue Aug 16 16:50:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68601BBC055; Tue, 16 Aug 2016 16:50:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FE911B89; Tue, 16 Aug 2016 16:50:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GGomDn074370; Tue, 16 Aug 2016 16:50:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GGomGx074369; Tue, 16 Aug 2016 16:50:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608161650.u7GGomGx074369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Aug 2016 16:50:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304228 - head/sys/ufs/ffs 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 16:50:49 -0000 Author: kib Date: Tue Aug 16 16:50:48 2016 New Revision: 304228 URL: https://svnweb.freebsd.org/changeset/base/304228 Log: When block allocation fails in UFS_BALLOC(), and the volume does not have SU enabled, there is no point in calling softdep_request_cleanup(). The call cannot produce free blocks, but we unecessarily lock ufsmount and do inode block write. Usual point of not doing optimizations for the corner case of the full volume is not applicable there, the work is easily avoidable, and the addition CPU and disk io load do not lead to succeeding retry. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_balloc.c Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 16:49:56 2016 (r304227) +++ head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 16:50:48 2016 (r304228) @@ -311,7 +311,7 @@ retry: if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, flags | IO_BUFLOCKED, cred, &newb)) != 0) { brelse(bp); - if (++reclaimed == 1) { + if (DOINGSOFTDEP(vp) && ++reclaimed == 1) { UFS_LOCK(ump); softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT); @@ -390,7 +390,7 @@ retry: flags | IO_BUFLOCKED, cred, &newb); if (error) { brelse(bp); - if (++reclaimed == 1) { + if (DOINGSOFTDEP(vp) && ++reclaimed == 1) { UFS_LOCK(ump); softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT); @@ -881,7 +881,7 @@ retry: if ((error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, flags | IO_BUFLOCKED, cred, &newb)) != 0) { brelse(bp); - if (++reclaimed == 1) { + if (DOINGSOFTDEP(vp) && ++reclaimed == 1) { UFS_LOCK(ump); softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT); @@ -961,7 +961,7 @@ retry: flags | IO_BUFLOCKED, cred, &newb); if (error) { brelse(bp); - if (++reclaimed == 1) { + if (DOINGSOFTDEP(vp) && ++reclaimed == 1) { UFS_LOCK(ump); softdep_request_cleanup(fs, vp, cred, FLUSH_BLOCKS_WAIT); From owner-svn-src-all@freebsd.org Tue Aug 16 17:05:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AAC8BBC662; Tue, 16 Aug 2016 17:05:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4AA1175F; Tue, 16 Aug 2016 17:05:16 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GH5FCY082260; Tue, 16 Aug 2016 17:05:15 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GH5FPg082259; Tue, 16 Aug 2016 17:05:15 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608161705.u7GH5FPg082259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Aug 2016 17:05:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304229 - head/sys/ufs/ffs 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 17:05:17 -0000 Author: kib Date: Tue Aug 16 17:05:15 2016 New Revision: 304229 URL: https://svnweb.freebsd.org/changeset/base/304229 Log: When looking up dandling buffers for unwing after failing block allocation in UFS_BALLOC(), there is no need to map them. Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_balloc.c Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 16:50:48 2016 (r304228) +++ head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 17:05:15 2016 (r304229) @@ -484,7 +484,8 @@ fail: * We shall not leave the freed blocks on the vnode * buffer object lists. */ - bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, GB_NOCREAT); + bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, + GB_NOCREAT | GB_UNMAPPED); if (bp != NULL) { bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~B_ASYNC; @@ -1061,7 +1062,8 @@ fail: * We shall not leave the freed blocks on the vnode * buffer object lists. */ - bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, GB_NOCREAT); + bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, + GB_NOCREAT | GB_UNMAPPED); if (bp != NULL) { bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~B_ASYNC; From owner-svn-src-all@freebsd.org Tue Aug 16 17:07:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48299BBC76F; Tue, 16 Aug 2016 17:07:49 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25D9E1A0E; Tue, 16 Aug 2016 17:07:49 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GH7mgM082436; Tue, 16 Aug 2016 17:07:48 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GH7mMK082434; Tue, 16 Aug 2016 17:07:48 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201608161707.u7GH7mMK082434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 16 Aug 2016 17:07:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304230 - in head: share/man/man3 sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 17:07:49 -0000 Author: mckusick Date: Tue Aug 16 17:07:48 2016 New Revision: 304230 URL: https://svnweb.freebsd.org/changeset/base/304230 Log: Add two new macros, SLIST_CONCAT and LIST_CONCAT. Note in both the queue.h header file and in the queue.3 manual page that they are O(n) so should be used only in low-usage paths with short lists (otherwise an STAILQ or TAILQ should be used). Reviewed by: kib Modified: head/share/man/man3/queue.3 head/sys/sys/queue.h Modified: head/share/man/man3/queue.3 ============================================================================== --- head/share/man/man3/queue.3 Tue Aug 16 17:05:15 2016 (r304229) +++ head/share/man/man3/queue.3 Tue Aug 16 17:07:48 2016 (r304230) @@ -28,12 +28,13 @@ .\" @(#)queue.3 8.2 (Berkeley) 1/24/94 .\" $FreeBSD$ .\" -.Dd June 24, 2015 +.Dd August 15, 2016 .Dt QUEUE 3 .Os .Sh NAME .Nm SLIST_CLASS_ENTRY , .Nm SLIST_CLASS_HEAD , +.Nm SLIST_CONCAT , .Nm SLIST_EMPTY , .Nm SLIST_ENTRY , .Nm SLIST_FIRST , @@ -75,6 +76,7 @@ .Nm STAILQ_SWAP , .Nm LIST_CLASS_ENTRY , .Nm LIST_CLASS_HEAD , +.Nm LIST_CONCAT , .Nm LIST_EMPTY , .Nm LIST_ENTRY , .Nm LIST_FIRST , @@ -125,6 +127,7 @@ lists and tail queues .\" .Fn SLIST_CLASS_ENTRY "CLASSTYPE" .Fn SLIST_CLASS_HEAD "HEADNAME" "CLASSTYPE" +.Fn SLIST_CONCAT "SLIST_HEAD *head1" "SLIST_HEAD *head2" "TYPE" "SLIST_ENTRY NAME" .Fn SLIST_EMPTY "SLIST_HEAD *head" .Fn SLIST_ENTRY "TYPE" .Fn SLIST_FIRST "SLIST_HEAD *head" @@ -168,6 +171,7 @@ lists and tail queues .\" .Fn LIST_CLASS_ENTRY "CLASSTYPE" .Fn LIST_CLASS_HEAD "HEADNAME" "CLASSTYPE" +.Fn LIST_CONCAT "LIST_HEAD *head1" "LIST_HEAD *head2" "TYPE" "LIST_ENTRY NAME" .Fn LIST_EMPTY "LIST_HEAD *head" .Fn LIST_ENTRY "TYPE" .Fn LIST_FIRST "LIST_HEAD *head" @@ -249,6 +253,8 @@ Singly-linked lists add the following fu .Bl -enum -compact -offset indent .It O(n) removal of any entry in the list. +.It +O(n) concatenation of two lists. .El .Pp Singly-linked tail queues add the following functionality: @@ -296,6 +302,8 @@ Linked lists are the simplest of the dou They add the following functionality over the above: .Bl -enum -compact -offset indent .It +O(n) concatenation of two lists. +.It They may be traversed backwards. .El However: @@ -401,6 +409,19 @@ evaluates to an initializer for the list .Fa head . .Pp The macro +.Nm SLIST_CONCAT +concatenates the list headed by +.Fa head2 +onto the end of the one headed by +.Fa head1 +removing all entries from the former. +Use of this macro should be avoided as it traverses the entirety of the +.Fa head1 +list. +A singly-linked tail queue should be used if this macro is needed in +high-usage code paths or to operate on long lists. +.Pp +The macro .Nm SLIST_EMPTY evaluates to true if there are no elements in the list. .Pp @@ -508,6 +529,9 @@ The macro removes the element .Fa elm from the list. +Use of this macro should be avoided as it traverses the entire list. +A doubly-linked list should be used if this macro is needed in +high-usage code paths or to operate on long lists. .Pp The macro .Nm SLIST_SWAP @@ -724,6 +748,9 @@ The macro removes the element .Fa elm from the tail queue. +Use of this macro should be avoided as it traverses the entire list. +A doubly-linked tail queue should be used if this macro is needed in +high-usage code paths or to operate on long tail queues. .Pp The macro .Nm STAILQ_SWAP @@ -823,6 +850,19 @@ evaluates to an initializer for the list .Fa head . .Pp The macro +.Nm LIST_CONCAT +concatenates the list headed by +.Fa head2 +onto the end of the one headed by +.Fa head1 +removing all entries from the former. +Use of this macro should be avoided as it traverses the entirety of the +.Fa head1 +list. +A tail queue should be used if this macro is needed in +high-usage code paths or to operate on long lists. +.Pp +The macro .Nm LIST_EMPTY evaluates to true if there are no elements in the list. .Pp Modified: head/sys/sys/queue.h ============================================================================== --- head/sys/sys/queue.h Tue Aug 16 17:05:15 2016 (r304229) +++ head/sys/sys/queue.h Tue Aug 16 17:07:48 2016 (r304230) @@ -76,6 +76,10 @@ * * For details on the use of these macros, see the queue(3) manual page. * + * Below is a summary of implemented functions where: + * + means the macro is available + * - means the macro is not available + * s means the macro is available but is slow (runs in O(n) time) * * SLIST LIST STAILQ TAILQ * _HEAD + + + + @@ -101,10 +105,10 @@ * _INSERT_BEFORE - + - + * _INSERT_AFTER + + + + * _INSERT_TAIL - - + + - * _CONCAT - - + + + * _CONCAT s s + + * _REMOVE_AFTER + - + - * _REMOVE_HEAD + - + - - * _REMOVE + + + + + * _REMOVE s + s + * _SWAP + + + + * */ @@ -183,6 +187,19 @@ struct { \ /* * Singly-linked List functions. */ +#define SLIST_CONCAT(head1, head2, type, field) do { \ + QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head1); \ + if (curelm == NULL) { \ + if ((SLIST_FIRST(head1) = SLIST_FIRST(head2)) != NULL) \ + SLIST_INIT(head2); \ + } else if (SLIST_FIRST(head2) != NULL) { \ + while (SLIST_NEXT(curelm, field) != NULL) \ + curelm = SLIST_NEXT(curelm, field); \ + SLIST_NEXT(curelm, field) = SLIST_FIRST(head2); \ + SLIST_INIT(head2); \ + } \ +} while (0) + #define SLIST_EMPTY(head) ((head)->slh_first == NULL) #define SLIST_FIRST(head) ((head)->slh_first) @@ -447,6 +464,23 @@ struct { \ #define QMD_LIST_CHECK_PREV(elm, field) #endif /* (_KERNEL && INVARIANTS) */ +#define LIST_CONCAT(head1, head2, type, field) do { \ + QUEUE_TYPEOF(type) *curelm = LIST_FIRST(head1); \ + if (curelm == NULL) { \ + if ((LIST_FIRST(head1) = LIST_FIRST(head2)) != NULL) { \ + LIST_FIRST(head2)->field.le_prev = \ + &LIST_FIRST((head1)); \ + LIST_INIT(head2); \ + } \ + } else if (LIST_FIRST(head2) != NULL) { \ + while (LIST_NEXT(curelm, field) != NULL) \ + curelm = LIST_NEXT(curelm, field); \ + LIST_NEXT(curelm, field) = LIST_FIRST(head2); \ + LIST_FIRST(head2)->field.le_prev = &LIST_NEXT(curelm, field); \ + LIST_INIT(head2); \ + } \ +} while (0) + #define LIST_EMPTY(head) ((head)->lh_first == NULL) #define LIST_FIRST(head) ((head)->lh_first) From owner-svn-src-all@freebsd.org Tue Aug 16 17:18:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72BAEBBCB79; Tue, 16 Aug 2016 17:18:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36B9F1506; Tue, 16 Aug 2016 17:18:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GHIcC9086477; Tue, 16 Aug 2016 17:18:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GHIc6f086476; Tue, 16 Aug 2016 17:18:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608161718.u7GHIc6f086476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Aug 2016 17:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304231 - head/sys/ufs/ffs 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 17:18:39 -0000 Author: kib Date: Tue Aug 16 17:18:38 2016 New Revision: 304231 URL: https://svnweb.freebsd.org/changeset/base/304231 Log: On unwind after failed block allocation in ffs_balloc_ufs{1,2}, assert that recorded allocated blocks numbers match the physical block numbers of dandling buffers which are released. When finally freeing the blocks during unwind, assert that dandling buffers where not re-allocated. They shouldn't, because the vnode lock is owned exclusive. Reviewed by: mckusick Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_balloc.c Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 17:07:48 2016 (r304230) +++ head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 17:18:38 2016 (r304231) @@ -487,6 +487,11 @@ fail: bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, GB_NOCREAT | GB_UNMAPPED); if (bp != NULL) { + KASSERT(bp->b_blkno == fsbtodb(fs, *blkp), + ("mismatch1 l %jd %jd b %ju %ju", + (intmax_t)bp->b_lblkno, (uintmax_t)*lbns_remfree, + (uintmax_t)bp->b_blkno, + (uintmax_t)fsbtodb(fs, *blkp))); bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~B_ASYNC; brelse(bp); @@ -531,6 +536,18 @@ fail: * cleared, free the blocks. */ for (blkp = allociblk; blkp < allocblk; blkp++) { +#ifdef INVARIANTS + if (blkp == allociblk) + lbns_remfree = lbns; + bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, + GB_NOCREAT | GB_UNMAPPED); + if (bp != NULL) { + panic("zombie1 %jd %ju %ju", + (intmax_t)bp->b_lblkno, (uintmax_t)bp->b_blkno, + (uintmax_t)fsbtodb(fs, *blkp)); + } + lbns_remfree++; +#endif ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize, ip->i_number, vp->v_type, NULL); } @@ -1065,6 +1082,11 @@ fail: bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, GB_NOCREAT | GB_UNMAPPED); if (bp != NULL) { + KASSERT(bp->b_blkno == fsbtodb(fs, *blkp), + ("mismatch2 l %jd %jd b %ju %ju", + (intmax_t)bp->b_lblkno, (uintmax_t)*lbns_remfree, + (uintmax_t)bp->b_blkno, + (uintmax_t)fsbtodb(fs, *blkp))); bp->b_flags |= (B_INVAL | B_RELBUF); bp->b_flags &= ~B_ASYNC; brelse(bp); @@ -1109,6 +1131,18 @@ fail: * cleared, free the blocks. */ for (blkp = allociblk; blkp < allocblk; blkp++) { +#ifdef INVARIANTS + if (blkp == allociblk) + lbns_remfree = lbns; + bp = getblk(vp, *lbns_remfree, fs->fs_bsize, 0, 0, + GB_NOCREAT | GB_UNMAPPED); + if (bp != NULL) { + panic("zombie2 %jd %ju %ju", + (intmax_t)bp->b_lblkno, (uintmax_t)bp->b_blkno, + (uintmax_t)fsbtodb(fs, *blkp)); + } + lbns_remfree++; +#endif ffs_blkfree(ump, fs, ip->i_devvp, *blkp, fs->fs_bsize, ip->i_number, vp->v_type, NULL); } From owner-svn-src-all@freebsd.org Tue Aug 16 17:31:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29462BBCEE1; Tue, 16 Aug 2016 17:31:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF23D1EAE; Tue, 16 Aug 2016 17:30:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GHUwZJ091528; Tue, 16 Aug 2016 17:30:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GHUwQG091527; Tue, 16 Aug 2016 17:30:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608161730.u7GHUwQG091527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 16 Aug 2016 17:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304232 - head/sys/ufs/ffs 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 17:31:00 -0000 Author: kib Date: Tue Aug 16 17:30:58 2016 New Revision: 304232 URL: https://svnweb.freebsd.org/changeset/base/304232 Log: In UFS_BALLOC(), invalidate pages of indirect buffers on failed block allocation unwinding. Dandling buffers are released on UFS_BALLOC() failure to ensure that later attempt to allocate blocks in close range do not find the blocks with invalid content, since possible partial block allocations are unwound. As such, it is not enough to just release the buffers, the pages must also invalidated and removed from the vnode vm_object queue. Otherwise the pages might be found later and used to reconstruct indirect buffers when doing allocations at offset close to the failure point, and their stale content compromise the filesystem integrity. Note that just marking the buffer as B_INVAL is not enough, B_NOCACHE is required. To be sure, clear the B_CACHE flag as well. This complements the r174973, which started releasing buffers. Reported and tested by: pho Reviewed by: mckusick Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_balloc.c Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 17:18:38 2016 (r304231) +++ head/sys/ufs/ffs/ffs_balloc.c Tue Aug 16 17:30:58 2016 (r304232) @@ -492,8 +492,8 @@ fail: (intmax_t)bp->b_lblkno, (uintmax_t)*lbns_remfree, (uintmax_t)bp->b_blkno, (uintmax_t)fsbtodb(fs, *blkp))); - bp->b_flags |= (B_INVAL | B_RELBUF); - bp->b_flags &= ~B_ASYNC; + bp->b_flags |= B_INVAL | B_RELBUF | B_NOCACHE; + bp->b_flags &= ~(B_ASYNC | B_CACHE); brelse(bp); } deallocated += fs->fs_bsize; @@ -1087,8 +1087,8 @@ fail: (intmax_t)bp->b_lblkno, (uintmax_t)*lbns_remfree, (uintmax_t)bp->b_blkno, (uintmax_t)fsbtodb(fs, *blkp))); - bp->b_flags |= (B_INVAL | B_RELBUF); - bp->b_flags &= ~B_ASYNC; + bp->b_flags |= B_INVAL | B_RELBUF | B_NOCACHE; + bp->b_flags &= ~(B_ASYNC | B_CACHE); brelse(bp); } deallocated += fs->fs_bsize; From owner-svn-src-all@freebsd.org Tue Aug 16 18:16:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A8B9BBCA20 for ; Tue, 16 Aug 2016 18:16:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3AB0815DE for ; Tue, 16 Aug 2016 18:16:31 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x242.google.com with SMTP id d65so6043984ith.0 for ; Tue, 16 Aug 2016 11:16:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=n0TQNVExKJPEOBzjY0Vm3z3vsr6k5lC+iO/PH3N5x+0=; b=VQK2G3HCuUERdAk9YEVt7IiMuKAyaRAP65vSCYDtR5NeztpZjudiJBXrkN8NY1vIGU VMuhk5B8dSOpT1gHiD/g3zkqs2S3MSTryU20lEyYfDxX7gCbiMhpwMazMyVaKgh1x0NZ 6OnAmFqaEsPAf7BEWvCQ4RSQtp9Ama+H5qaNRAt8Sp3/CHdTDAg3keOBapF8FSlSGabK n+O7CNEPMPV/Dbt6pGWwUqD2eDEEbTJapFwPeNrid0RXgpO37n43EwnQVFlhejJd0NWy DBDiysM0KVxGLR3kNuxsJqkW3eZL9x7Z1hJ9Ivlei/JRijiIhiB2dZsI9+dpYiHAONg9 OTIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=n0TQNVExKJPEOBzjY0Vm3z3vsr6k5lC+iO/PH3N5x+0=; b=QmCDZlmNQppLutauZRXZKge8Hef5+h0PAYmzvYQf4OnnKrzPf7MO0tnVOrTgy/Sf2p /dO3kbjx77NX1U8Cz2gc6elIn49v3KRt5mlvrL8wXUAddvLg12xe91PeXhj10Syjr75K gsN0/+cB4D5rOy9oeCWufFnFMCjvAbrbhZ126s/zFJXon2H0mk2XY/dgJyeGMPPbyH5x 42eZUKkqsE+ykNRwlq6TCt3gtl5ro7Q8pxIJ+AYufh0d3HrtB4IeLw9oAVqCNBI38X+l dfR/I7bSPqJThS3L4GDLhiun7lg4ARAtBk9LX9uBEeY5OaV9HExLdmVxwf5XX+/uXE8i DwIw== X-Gm-Message-State: AEkoousnBZSnuhR6fSySVNqxA0QM7N7MfeYVW/NcA34kjzvRBWtpznB1gsVRnNxVukVW+BkfAceCtRtEduLgOw== X-Received: by 10.36.84.147 with SMTP id t141mr11154023ita.14.1471371390529; Tue, 16 Aug 2016 11:16:30 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.96.202 with HTTP; Tue, 16 Aug 2016 11:16:30 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: References: <201608161423.u7GENZJi021956@repo.freebsd.org> From: Warner Losh Date: Tue, 16 Aug 2016 12:16:30 -0600 X-Google-Sender-Auth: K_zkFLPTxYAop3JYedALsXphzsQ Message-ID: Subject: Re: svn commit: r304221 - head/sys/boot/efi/boot1 To: Ed Schouten Cc: Emmanuel Vadot , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 18:16:31 -0000 On Tue, Aug 16, 2016 at 8:57 AM, Ed Schouten wrote: > Hi Emmanuel, > > 2016-08-16 16:23 GMT+02:00 Emmanuel Vadot : >> Author: manu >> Date: Tue Aug 16 14:23:35 2016 >> New Revision: 304221 >> URL: https://svnweb.freebsd.org/changeset/base/304221 >> >> Log: >> Use %ju modifier for u_int64_t and %jd modifier for off_t. >> off_t is long long on arm32 and long on amd64 > > I think both of these should be solved differently: > > - For uint64_t, you can use 's PRIu64 in the formatting > string. In kernel space, I suspect you need to use something like > . cast it to intmax_t and use %jd. We've shunned PRIu64 in the tree. It's existing practice, but I'm sure bruce will voice mild distaste. > - For off_t, it's all right to print it with %jd, but then be sure to > also add a cast to the argument itself. It may not necessarily be > equal to an intmax_t. The cast is important. Warner From owner-svn-src-all@freebsd.org Tue Aug 16 18:56:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DD95BBC16E; Tue, 16 Aug 2016 18:56:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F2711976; Tue, 16 Aug 2016 18:56:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GIuunZ023381; Tue, 16 Aug 2016 18:56:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GIuucT023379; Tue, 16 Aug 2016 18:56:56 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608161856.u7GIuucT023379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 16 Aug 2016 18:56:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304234 - stable/11/lib/clang X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 18:56:57 -0000 Author: dim Date: Tue Aug 16 18:56:56 2016 New Revision: 304234 URL: https://svnweb.freebsd.org/changeset/base/304234 Log: Similar to r256297, disable assertions in llvm and clang for the stable/11 branch. This reduces the size of the clang executable, and improves its performance. Also bump FREEBSD_CC_VERSION to make some version number room for the branch. Modified: stable/11/lib/clang/clang.build.mk stable/11/lib/clang/freebsd_cc_version.h Modified: stable/11/lib/clang/clang.build.mk ============================================================================== --- stable/11/lib/clang/clang.build.mk Tue Aug 16 18:32:01 2016 (r304233) +++ stable/11/lib/clang/clang.build.mk Tue Aug 16 18:56:56 2016 (r304234) @@ -8,7 +8,7 @@ CFLAGS+= -I${LLVM_SRCS}/include -I${CLAN -I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \ -I${LLVM_SRCS}/../../lib/clang/include \ -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ - -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG + -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG .if ${MK_CLANG_FULL} != "no" CFLAGS+= -DCLANG_ENABLE_ARCMT \ Modified: stable/11/lib/clang/freebsd_cc_version.h ============================================================================== --- stable/11/lib/clang/freebsd_cc_version.h Tue Aug 16 18:32:01 2016 (r304233) +++ stable/11/lib/clang/freebsd_cc_version.h Tue Aug 16 18:56:56 2016 (r304234) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1100004 +#define FREEBSD_CC_VERSION 1100500 From owner-svn-src-all@freebsd.org Tue Aug 16 19:43:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DC20BBC11A; Tue, 16 Aug 2016 19:43:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AAE116C7; Tue, 16 Aug 2016 19:43:18 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GJhHOh041813; Tue, 16 Aug 2016 19:43:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GJhHOq041812; Tue, 16 Aug 2016 19:43:17 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608161943.u7GJhHOq041812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 16 Aug 2016 19:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304235 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 19:43:18 -0000 Author: markj Date: Tue Aug 16 19:43:17 2016 New Revision: 304235 URL: https://svnweb.freebsd.org/changeset/base/304235 Log: Remove prototypes missed in r303951. Modified: head/sys/sys/buf.h Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Tue Aug 16 18:56:56 2016 (r304234) +++ head/sys/sys/buf.h Tue Aug 16 19:43:17 2016 (r304235) @@ -536,9 +536,6 @@ void reassignbuf(struct buf *); struct buf *trypbuf(int *); void bwait(struct buf *, u_char, const char *); void bdone(struct buf *); -void bpin(struct buf *); -void bunpin(struct buf *); -void bunpin_wait(struct buf *); #endif /* _KERNEL */ From owner-svn-src-all@freebsd.org Tue Aug 16 20:35:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE313BBB146; Tue, 16 Aug 2016 20:35:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE97017E9; Tue, 16 Aug 2016 20:35:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GKZaiT060855; Tue, 16 Aug 2016 20:35:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GKZaB9060854; Tue, 16 Aug 2016 20:35:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608162035.u7GKZaB9060854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 16 Aug 2016 20:35:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304238 - head/tests/sys/kern/acct 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 20:35:38 -0000 Author: ngie Date: Tue Aug 16 20:35:36 2016 New Revision: 304238 URL: https://svnweb.freebsd.org/changeset/base/304238 Log: Only expect :encode_tv_random_million to fail on 64-bit platforms It passes on i386 MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tests/sys/kern/acct/acct_test.c Directory Properties: head/ (props changed) Modified: head/tests/sys/kern/acct/acct_test.c ============================================================================== --- head/tests/sys/kern/acct/acct_test.c Tue Aug 16 20:32:08 2016 (r304237) +++ head/tests/sys/kern/acct/acct_test.c Tue Aug 16 20:35:36 2016 (r304238) @@ -204,7 +204,10 @@ ATF_TC_BODY(encode_tv_random_million, tc struct timeval tv; long k; - atf_tc_expect_fail("the testcase violates FLT_EPSILON"); +#ifdef __LP64__ + atf_tc_expect_fail("the testcase violates FLT_EPSILON on 64-bit " + "platforms, e.g. amd64"); +#endif ATF_REQUIRE_MSG(unsetenv("TZ") == 0, "unsetting TZ failed; errno=%d", errno); From owner-svn-src-all@freebsd.org Tue Aug 16 21:02:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C5F4BBB7E4; Tue, 16 Aug 2016 21:02:31 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48B6118CB; Tue, 16 Aug 2016 21:02:31 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GL2UJH072274; Tue, 16 Aug 2016 21:02:30 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GL2Uix072272; Tue, 16 Aug 2016 21:02:30 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201608162102.u7GL2Uix072272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Tue, 16 Aug 2016 21:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304239 - head/sys/ufs/ffs 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 21:02:31 -0000 Author: mckusick Date: Tue Aug 16 21:02:30 2016 New Revision: 304239 URL: https://svnweb.freebsd.org/changeset/base/304239 Log: Bug 211013 reports that a write error to a UFS filesystem running with softupdates panics the kernel. The problem that has been pointed out is that when there is a transient write error on certain metadata blocks, specifically directory blocks (PAGEDEP), inode blocks (INODEDEP), indirect pointer blocks (INDIRDEPS), and cylinder group (BMSAFEMAP, but only when journaling is enabled), we get a panic in one of the routines called by softdep_disk_io_initiation that the I/O is "already started" when we retry the write. These dependency types potentially need to do roll-backs when called by softdep_disk_io_initiation before doing a write and then a roll-forward when called by softdep_disk_write_complete after the I/O completes. The panic happens when there is a transient error. At the top of softdep_disk_write_complete we check to see if the write had an error and if an error occurred we just return. This return is correct most of the time because the main role of the routines called by softdep_disk_write_complete is to process the now-completed dependencies so that the next I/O steps can happen. But for the four types listed above, they do not get to do their rollback operations. This causes the panic when softdep_disk_io_initiation gets called on the second attempt to do the write and the roll-back routines find that the roll-backs have already been done. As an aside I note that there is also the problem that the buffer will have been unlocked and thus made visible to the filesystem and to user applications with the roll-backs in place. The way to resolve the problem is to add a flag to the routines called by softdep_disk_write_complete for the four dependency types noted that indicates whether the write was successful (WRITESUCCEEDED). If the write does not succeed, they do just the roll-backs and then return. If the write was successful they also do their usual processing of the now-completed dependencies. The fix was tested by selectively injecting write errors for buffers holding dependencies of each of the four types noted above and then verifying that the kernel no longer paniced and that following the successful retry of the write that the filesystem could be unmounted and successfully checked cleanly. PR: 211013 Reviewed by: kib Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/softdep.h Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Tue Aug 16 20:35:36 2016 (r304238) +++ head/sys/ufs/ffs/ffs_softdep.c Tue Aug 16 21:02:30 2016 (r304239) @@ -752,16 +752,16 @@ static int flush_newblk_dep(struct vnode static int flush_inodedep_deps(struct vnode *, struct mount *, ino_t); static int flush_deplist(struct allocdirectlst *, int, int *); static int sync_cgs(struct mount *, int); -static int handle_written_filepage(struct pagedep *, struct buf *); +static int handle_written_filepage(struct pagedep *, struct buf *, int); static int handle_written_sbdep(struct sbdep *, struct buf *); static void initiate_write_sbdep(struct sbdep *); static void diradd_inode_written(struct diradd *, struct inodedep *); static int handle_written_indirdep(struct indirdep *, struct buf *, - struct buf**); -static int handle_written_inodeblock(struct inodedep *, struct buf *); + struct buf**, int); +static int handle_written_inodeblock(struct inodedep *, struct buf *, int); static int jnewblk_rollforward(struct jnewblk *, struct fs *, struct cg *, uint8_t *); -static int handle_written_bmsafemap(struct bmsafemap *, struct buf *); +static int handle_written_bmsafemap(struct bmsafemap *, struct buf *, int); static void handle_written_jaddref(struct jaddref *); static void handle_written_jremref(struct jremref *); static void handle_written_jseg(struct jseg *, struct buf *); @@ -10874,6 +10874,10 @@ initiate_write_bmsafemap(bmsafemap, bp) struct fs *fs; ino_t ino; + /* + * If this is a background write, we did this at the time that + * the copy was made, so do not need to do it again. + */ if (bmsafemap->sm_state & IOSTARTED) return; bmsafemap->sm_state |= IOSTARTED; @@ -10947,10 +10951,39 @@ softdep_disk_write_complete(bp) /* * If an error occurred while doing the write, then the data - * has not hit the disk and the dependencies cannot be unrolled. + * has not hit the disk and the dependencies cannot be processed. + * But we do have to go through and roll forward any dependencies + * that were rolled back before the disk write. */ - if ((bp->b_ioflags & BIO_ERROR) != 0 && (bp->b_flags & B_INVAL) == 0) + if ((bp->b_ioflags & BIO_ERROR) != 0 && (bp->b_flags & B_INVAL) == 0) { + LIST_FOREACH(wk, &bp->b_dep, wk_list) { + switch (wk->wk_type) { + + case D_PAGEDEP: + handle_written_filepage(WK_PAGEDEP(wk), bp, 0); + continue; + + case D_INODEDEP: + handle_written_inodeblock(WK_INODEDEP(wk), + bp, 0); + continue; + + case D_BMSAFEMAP: + handle_written_bmsafemap(WK_BMSAFEMAP(wk), + bp, 0); + continue; + + case D_INDIRDEP: + handle_written_indirdep(WK_INDIRDEP(wk), + bp, &sbp, 0); + continue; + default: + /* nothing to roll forward */ + continue; + } + } return; + } if ((wk = LIST_FIRST(&bp->b_dep)) == NULL) return; ump = VFSTOUFS(wk->wk_mp); @@ -10970,17 +11003,20 @@ softdep_disk_write_complete(bp) switch (wk->wk_type) { case D_PAGEDEP: - if (handle_written_filepage(WK_PAGEDEP(wk), bp)) + if (handle_written_filepage(WK_PAGEDEP(wk), bp, + WRITESUCCEEDED)) WORKLIST_INSERT(&reattach, wk); continue; case D_INODEDEP: - if (handle_written_inodeblock(WK_INODEDEP(wk), bp)) + if (handle_written_inodeblock(WK_INODEDEP(wk), bp, + WRITESUCCEEDED)) WORKLIST_INSERT(&reattach, wk); continue; case D_BMSAFEMAP: - if (handle_written_bmsafemap(WK_BMSAFEMAP(wk), bp)) + if (handle_written_bmsafemap(WK_BMSAFEMAP(wk), bp, + WRITESUCCEEDED)) WORKLIST_INSERT(&reattach, wk); continue; @@ -10999,7 +11035,8 @@ softdep_disk_write_complete(bp) continue; case D_INDIRDEP: - if (handle_written_indirdep(WK_INDIRDEP(wk), bp, &sbp)) + if (handle_written_indirdep(WK_INDIRDEP(wk), bp, &sbp, + WRITESUCCEEDED)) WORKLIST_INSERT(&reattach, wk); continue; @@ -11299,12 +11336,17 @@ handle_bufwait(inodedep, refhd) * Called from within softdep_disk_write_complete above to restore * in-memory inode block contents to their most up-to-date state. Note * that this routine is always called from interrupt level with further - * splbio interrupts blocked. + * interrupts from this device blocked. + * + * If the write did not succeed, we will do all the roll-forward + * operations, but we will not take the actions that will allow its + * dependencies to be processed. */ static int -handle_written_inodeblock(inodedep, bp) +handle_written_inodeblock(inodedep, bp, flags) struct inodedep *inodedep; struct buf *bp; /* buffer containing the inode block */ + int flags; { struct freefile *freefile; struct allocdirect *adp, *nextadp; @@ -11334,7 +11376,8 @@ handle_written_inodeblock(inodedep, bp) /* * Leave this inodeblock dirty until it's in the list. */ - if ((inodedep->id_state & (UNLINKED | UNLINKONLIST)) == UNLINKED) { + if ((inodedep->id_state & (UNLINKED | UNLINKONLIST)) == UNLINKED && + (flags & WRITESUCCEEDED)) { struct inodedep *inon; inon = TAILQ_NEXT(inodedep, id_unlinked); @@ -11373,7 +11416,8 @@ handle_written_inodeblock(inodedep, bp) goto bufwait; return (1); } - inodedep->id_state |= COMPLETE; + if (flags & WRITESUCCEEDED) + inodedep->id_state |= COMPLETE; /* * Roll forward anything that had to be rolled back before * the inode could be updated. @@ -11488,6 +11532,13 @@ handle_written_inodeblock(inodedep, bp) bdirty(bp); bufwait: /* + * If the write did not succeed, we have done all the roll-forward + * operations, but we cannot take the actions that will allow its + * dependencies to be processed. + */ + if ((flags & WRITESUCCEEDED) == 0) + return (hadchanges); + /* * Process any allocdirects that completed during the update. */ if ((adp = TAILQ_FIRST(&inodedep->id_inoupdt)) != NULL) @@ -11544,11 +11595,20 @@ bufwait: return (hadchanges); } +/* + * Perform needed roll-forwards and kick off any dependencies that + * can now be processed. + * + * If the write did not succeed, we will do all the roll-forward + * operations, but we will not take the actions that will allow its + * dependencies to be processed. + */ static int -handle_written_indirdep(indirdep, bp, bpp) +handle_written_indirdep(indirdep, bp, bpp, flags) struct indirdep *indirdep; struct buf *bp; struct buf **bpp; + int flags; { struct allocindir *aip; struct buf *sbp; @@ -11573,6 +11633,16 @@ handle_written_indirdep(indirdep, bp, bp indirdep->ir_state &= ~(UNDONE | IOSTARTED); indirdep->ir_state |= ATTACHED; /* + * If the write did not succeed, we have done all the roll-forward + * operations, but we cannot take the actions that will allow its + * dependencies to be processed. + */ + if ((flags & WRITESUCCEEDED) == 0) { + stat_indir_blk_ptrs++; + bdirty(bp); + return (1); + } + /* * Move allocindirs with written pointers to the completehd if * the indirdep's pointer is not yet written. Otherwise * free them here. @@ -11726,11 +11796,16 @@ jnewblk_rollforward(jnewblk, fs, cgp, bl * Complete a write to a bmsafemap structure. Roll forward any bitmap * changes if it's not a background write. Set all written dependencies * to DEPCOMPLETE and free the structure if possible. + * + * If the write did not succeed, we will do all the roll-forward + * operations, but we will not take the actions that will allow its + * dependencies to be processed. */ static int -handle_written_bmsafemap(bmsafemap, bp) +handle_written_bmsafemap(bmsafemap, bp, flags) struct bmsafemap *bmsafemap; struct buf *bp; + int flags; { struct newblk *newblk; struct inodedep *inodedep; @@ -11746,15 +11821,20 @@ handle_written_bmsafemap(bmsafemap, bp) int chgs; if ((bmsafemap->sm_state & IOSTARTED) == 0) - panic("initiate_write_bmsafemap: Not started\n"); + panic("handle_written_bmsafemap: Not started\n"); ump = VFSTOUFS(bmsafemap->sm_list.wk_mp); chgs = 0; bmsafemap->sm_state &= ~IOSTARTED; foreground = (bp->b_xflags & BX_BKGRDMARKER) == 0; /* - * Release journal work that was waiting on the write. + * If write was successful, release journal work that was waiting + * on the write. Otherwise move the work back. */ - handle_jwork(&bmsafemap->sm_freewr); + if (flags & WRITESUCCEEDED) + handle_jwork(&bmsafemap->sm_freewr); + else + LIST_CONCAT(&bmsafemap->sm_freehd, &bmsafemap->sm_freewr, + worklist, wk_list); /* * Restore unwritten inode allocation pending jaddref writes. @@ -11804,6 +11884,20 @@ handle_written_bmsafemap(bmsafemap, bp) free_jnewblk(jnewblk); } } + /* + * If the write did not succeed, we have done all the roll-forward + * operations, but we cannot take the actions that will allow its + * dependencies to be processed. + */ + if ((flags & WRITESUCCEEDED) == 0) { + LIST_CONCAT(&bmsafemap->sm_newblkhd, &bmsafemap->sm_newblkwr, + newblk, nb_deps); + LIST_CONCAT(&bmsafemap->sm_freehd, &bmsafemap->sm_freewr, + worklist, wk_list); + if (foreground) + bdirty(bp); + return (1); + } while ((newblk = LIST_FIRST(&bmsafemap->sm_newblkwr))) { newblk->nb_state |= DEPCOMPLETE; newblk->nb_state &= ~ONDEPLIST; @@ -11907,12 +12001,17 @@ free_pagedep(pagedep) * A write operation was just completed. Removed inodes can * now be freed and associated block pointers may be committed. * Note that this routine is always called from interrupt level - * with further splbio interrupts blocked. + * with further interrupts from this device blocked. + * + * If the write did not succeed, we will do all the roll-forward + * operations, but we will not take the actions that will allow its + * dependencies to be processed. */ static int -handle_written_filepage(pagedep, bp) +handle_written_filepage(pagedep, bp, flags) struct pagedep *pagedep; struct buf *bp; /* buffer containing the written page */ + int flags; { struct dirrem *dirrem; struct diradd *dap, *nextdap; @@ -11922,6 +12021,8 @@ handle_written_filepage(pagedep, bp) if ((pagedep->pd_state & IOSTARTED) == 0) panic("handle_written_filepage: not started"); pagedep->pd_state &= ~IOSTARTED; + if ((flags & WRITESUCCEEDED) == 0) + goto rollforward; /* * Process any directory removals that have been committed. */ @@ -11941,6 +12042,7 @@ handle_written_filepage(pagedep, bp) if ((pagedep->pd_state & NEWBLOCK) == 0) while ((dap = LIST_FIRST(&pagedep->pd_pendinghd)) != NULL) free_diradd(dap, NULL); +rollforward: /* * Uncommitted directory entries must be restored. */ @@ -11973,7 +12075,7 @@ handle_written_filepage(pagedep, bp) * marked dirty so that its will eventually get written back in * its correct form. */ - if (chgs) { + if (chgs || (flags & WRITESUCCEEDED) == 0) { if ((bp->b_flags & B_DELWRI) == 0) stat_dir_entry++; bdirty(bp); Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Tue Aug 16 20:35:36 2016 (r304238) +++ head/sys/ufs/ffs/softdep.h Tue Aug 16 21:02:30 2016 (r304239) @@ -140,6 +140,7 @@ #define UNLINKPREV 0x100000 /* inodedep is pointed at in the unlink list */ #define UNLINKONLIST 0x200000 /* inodedep is in the unlinked list on disk */ #define UNLINKLINKS (UNLINKNEXT | UNLINKPREV) +#define WRITESUCCEEDED 0x400000 /* the disk write completed successfully */ #define ALLCOMPLETE (ATTACHED | COMPLETE | DEPCOMPLETE) From owner-svn-src-all@freebsd.org Tue Aug 16 21:20:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C3B2BBBDE9; Tue, 16 Aug 2016 21:20:06 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33FF21766; Tue, 16 Aug 2016 21:20:06 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GLK5xM076268; Tue, 16 Aug 2016 21:20:05 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GLK53I076266; Tue, 16 Aug 2016 21:20:05 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201608162120.u7GLK53I076266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Tue, 16 Aug 2016 21:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304242 - head/sys/dev/bhnd/bhndb 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 21:20:06 -0000 Author: landonf Date: Tue Aug 16 21:20:05 2016 New Revision: 304242 URL: https://svnweb.freebsd.org/changeset/base/304242 Log: bhndb(4): Drop MIPS-incompatible __builtin_ctz dependency. This replaces the bitfield representation of the bhndb register window freelist with the bitstring API, eliminating a dependency on (MIPS-unsupported) __builtin_ctz(). Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7495 Modified: head/sys/dev/bhnd/bhndb/bhndb_private.h head/sys/dev/bhnd/bhndb/bhndb_subr.c Modified: head/sys/dev/bhnd/bhndb/bhndb_private.h ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_private.h Tue Aug 16 21:17:51 2016 (r304241) +++ head/sys/dev/bhnd/bhndb/bhndb_private.h Tue Aug 16 21:20:05 2016 (r304242) @@ -33,6 +33,7 @@ #define _BHND_BHNDB_PRIVATE_H_ #include +#include #include #include @@ -184,21 +185,23 @@ struct bhndb_resources { struct bhndb_dw_alloc *dw_alloc; /**< dynamic window allocation records */ size_t dwa_count; /**< number of dynamic windows available. */ - uint32_t dwa_freelist; /**< dynamic window free list */ + bitstr_t *dwa_freelist; /**< dynamic window free list */ bhndb_priority_t min_prio; /**< minimum resource priority required to allocate a dynamic window */ }; /** - * Returns true if the all dynamic windows have been exhausted, false + * Returns true if the all dynamic windows are marked free, false * otherwise. * * @param br The resource state to check. */ static inline bool -bhndb_dw_exhausted(struct bhndb_resources *br) +bhndb_dw_all_free(struct bhndb_resources *br) { - return (br->dwa_freelist == 0); + int bit; + bit_ffs(br->dwa_freelist, br->dwa_count, &bit); + return (bit == -1); } /** @@ -209,12 +212,14 @@ bhndb_dw_exhausted(struct bhndb_resource static inline struct bhndb_dw_alloc * bhndb_dw_next_free(struct bhndb_resources *br) { - struct bhndb_dw_alloc *dw_free; + struct bhndb_dw_alloc *dw_free; + int bit; - if (bhndb_dw_exhausted(br)) + bit_ffc(br->dwa_freelist, br->dwa_count, &bit); + if (bit == -1) return (NULL); - dw_free = &br->dw_alloc[__builtin_ctz(br->dwa_freelist)]; + dw_free = &br->dw_alloc[bit]; KASSERT(LIST_EMPTY(&dw_free->refs), ("free list out of sync with refs")); @@ -233,7 +238,7 @@ bhndb_dw_is_free(struct bhndb_resources { bool is_free = LIST_EMPTY(&dwa->refs); - KASSERT(is_free == ((br->dwa_freelist & (1 << dwa->rnid)) != 0), + KASSERT(is_free == !bit_test(br->dwa_freelist, dwa->rnid), ("refs out of sync with free list")); return (is_free); Modified: head/sys/dev/bhnd/bhndb/bhndb_subr.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb_subr.c Tue Aug 16 21:17:51 2016 (r304241) +++ head/sys/dev/bhnd/bhndb/bhndb_subr.c Tue Aug 16 21:20:05 2016 (r304242) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "bhndb_private.h" #include "bhndbvar.h" @@ -264,7 +265,7 @@ bhndb_alloc_resources(device_t dev, devi const struct bhndb_regwin *win; bus_size_t last_window_size; size_t res_num; - u_int rnid; + int rnid; int error; bool free_parent_res; bool free_ht_mem, free_br_mem; @@ -371,10 +372,10 @@ bhndb_alloc_resources(device_t dev, devi } /* Fetch the dynamic regwin count and verify that it does not exceed - * what is representable via our freelist bitmask. */ + * what is representable via our freelist bitstring. */ r->dwa_count = bhndb_regwin_count(cfg->register_windows, BHNDB_REGWIN_T_DYN); - if (r->dwa_count >= (8 * sizeof(r->dwa_freelist))) { + if (r->dwa_count >= INT_MAX) { device_printf(r->dev, "max dynamic regwin count exceeded\n"); goto failed; } @@ -385,8 +386,12 @@ bhndb_alloc_resources(device_t dev, devi if (r->dw_alloc == NULL) goto failed; - /* Initialize the dynamic window table and freelist. */ - r->dwa_freelist = 0; + /* Allocate the dynamic window allocation freelist */ + r->dwa_freelist = bit_alloc(r->dwa_count, M_BHND, M_NOWAIT); + if (r->dwa_freelist == NULL) + goto failed; + + /* Initialize the dynamic window table */ rnid = 0; last_window_size = 0; for (win = cfg->register_windows; @@ -446,9 +451,6 @@ bhndb_alloc_resources(device_t dev, devi goto failed; } - /* Add to freelist */ - r->dwa_freelist |= (1 << rnid); - rnid++; } @@ -473,6 +475,9 @@ failed: if (r->dw_alloc != NULL) free(r->dw_alloc, M_BHND); + if (r->dwa_freelist != NULL) + free(r->dwa_freelist, M_BHND); + free (r, M_BHND); return (NULL); @@ -491,9 +496,17 @@ bhndb_free_resources(struct bhndb_resour struct bhndb_dw_rentry *dwr, *dwr_next; /* No window regions may still be held */ - if (__builtin_popcount(br->dwa_freelist) != br->dwa_count) { - device_printf(br->dev, "leaked %llu dynamic register regions\n", - (unsigned long long) br->dwa_count - br->dwa_freelist); + if (!bhndb_dw_all_free(br)) { + for (int i = 0; i < br->dwa_count; i++) { + dwa = &br->dw_alloc[i]; + + /* Skip free dynamic windows */ + if (bhndb_dw_is_free(br, dwa)) + continue; + + device_printf(br->dev, + "leaked dynamic register window %d\n", dwa->rnid); + } } /* Release resources allocated through our parent. */ @@ -523,6 +536,7 @@ bhndb_free_resources(struct bhndb_resour free(br->res, M_BHND); free(br->res_spec, M_BHND); free(br->dw_alloc, M_BHND); + free(br->dwa_freelist, M_BHND); } /** @@ -765,7 +779,7 @@ bhndb_dw_retain(struct bhndb_resources * LIST_INSERT_HEAD(&dwa->refs, rentry, dw_link); /* Update the free list */ - br->dwa_freelist &= ~(1 << (dwa->rnid)); + bit_set(br->dwa_freelist, dwa->rnid); return (0); } @@ -794,7 +808,7 @@ bhndb_dw_release(struct bhndb_resources /* If this was the last reference, update the free list */ if (LIST_EMPTY(&dwa->refs)) - br->dwa_freelist |= (1 << (dwa->rnid)); + bit_clear(br->dwa_freelist, dwa->rnid); } /** From owner-svn-src-all@freebsd.org Tue Aug 16 21:32:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DD6FBBC18A; Tue, 16 Aug 2016 21:32:07 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6FB71E65; Tue, 16 Aug 2016 21:32:06 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GLW6kB083497; Tue, 16 Aug 2016 21:32:06 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GLW5Q2083485; Tue, 16 Aug 2016 21:32:05 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201608162132.u7GLW5Q2083485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Tue, 16 Aug 2016 21:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304243 - in head/sys: conf dev/bhnd dev/bhnd/cores/chipc dev/bhnd/nvram dev/bhnd/tools dev/bwn mips/conf modules/bhnd 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 21:32:07 -0000 Author: landonf Date: Tue Aug 16 21:32:05 2016 New Revision: 304243 URL: https://svnweb.freebsd.org/changeset/base/304243 Log: bhnd(4): Implement NVRAM support required for PMU bring-up. - Added a generic bhnd_nvram_parser API, with support for the TLV format used on WGT634U devices, the standard BCM NVRAM format used on most modern devices, and the "board text file" format used on some hardware to supply external NVRAM data at runtime (e.g. via an EFI variable). - Extended the bhnd_bus_if and bhnd_nvram_if interfaces to support both string-based and primitive data type variable access, required for common behavior across both SPROM and NVRAM data sources. - Extended the existing SPROM implementation to support the new string-based NVRAM APIs. - Added an abstract bhnd_nvram driver, implementing the bhnd_nvram_if atop the bhnd_nvram_parser API. - Added a CFE-based bhnd_nvram driver to provide read-only access to NVRAM data on MIPS SoCs, pending implementation of a flash-aware bhnd_nvram driver. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7489 Added: head/sys/dev/bhnd/nvram/bhnd_nvram.c (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_nvram_cfe.c (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_nvram_common.c (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_nvram_common.h - copied, changed from r304242, head/sys/dev/bhnd/nvram/nvramvar.h head/sys/dev/bhnd/nvram/bhnd_nvram_parser.c (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_nvram_parser.h (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_nvram_parserreg.h (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_nvram_parservar.h (contents, props changed) head/sys/dev/bhnd/nvram/bhnd_nvramvar.h - copied, changed from r304242, head/sys/dev/bhnd/nvram/bhnd_spromreg.h head/sys/dev/bhnd/nvram/bhnd_sprom_parser.c - copied, changed from r304242, head/sys/dev/bhnd/nvram/bhnd_sprom_subr.c head/sys/dev/bhnd/nvram/bhnd_sprom_parser.h - copied, changed from r304242, head/sys/dev/bhnd/nvram/bhnd_spromvar.h head/sys/dev/bhnd/nvram/bhnd_sprom_parservar.h - copied, changed from r304242, head/sys/dev/bhnd/nvram/bhnd_spromreg.h Deleted: head/sys/dev/bhnd/nvram/bhnd_sprom_subr.c head/sys/dev/bhnd/nvram/bhnd_spromreg.h head/sys/dev/bhnd/nvram/nvram_subr.c head/sys/dev/bhnd/nvram/nvramvar.h Modified: head/sys/conf/files head/sys/dev/bhnd/bhnd.c head/sys/dev/bhnd/bhnd.h head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/bhnd_types.h head/sys/dev/bhnd/bhndvar.h head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/nvram/bhnd_nvram.h head/sys/dev/bhnd/nvram/bhnd_nvram_if.m head/sys/dev/bhnd/nvram/bhnd_sprom.c head/sys/dev/bhnd/nvram/bhnd_spromvar.h head/sys/dev/bhnd/tools/nvram_map_gen.awk head/sys/dev/bwn/bwn_mac.c head/sys/mips/conf/BCM head/sys/mips/conf/BCM.hints head/sys/mips/conf/SENTRY5 head/sys/mips/conf/SENTRY5.hints head/sys/modules/bhnd/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/conf/files Tue Aug 16 21:32:05 2016 (r304243) @@ -1163,10 +1163,14 @@ dev/bhnd/cores/pci/bhnd_pcib.c optional dev/bhnd/cores/pcie2/bhnd_pcie2.c optional bhnd pci dev/bhnd/cores/pcie2/bhnd_pcie2_hostb.c optional bhndb bhnd pci dev/bhnd/cores/pcie2/bhnd_pcie2b.c optional bhnd_pcie2b bhnd pci +dev/bhnd/nvram/bhnd_nvram.c optional bhnd +dev/bhnd/nvram/bhnd_nvram_common.c optional bhnd +dev/bhnd/nvram/bhnd_nvram_cfe.c optional bhnd siba_nexus cfe | \ + bhnd bcma_nexus cfe dev/bhnd/nvram/bhnd_nvram_if.m optional bhnd +dev/bhnd/nvram/bhnd_nvram_parser.c optional bhnd dev/bhnd/nvram/bhnd_sprom.c optional bhnd -dev/bhnd/nvram/bhnd_sprom_subr.c optional bhnd -dev/bhnd/nvram/nvram_subr.c optional bhnd +dev/bhnd/nvram/bhnd_sprom_parser.c optional bhnd dev/bhnd/siba/siba.c optional siba bhnd dev/bhnd/siba/siba_bhndb.c optional siba bhnd bhndb dev/bhnd/siba/siba_nexus.c optional siba_nexus siba bhnd Modified: head/sys/dev/bhnd/bhnd.c ============================================================================== --- head/sys/dev/bhnd/bhnd.c Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/bhnd.c Tue Aug 16 21:32:05 2016 (r304243) @@ -361,7 +361,7 @@ bhnd_finish_attach(struct bhnd_softc *sc if (ccaps->nvram_src != BHND_NVRAM_SRC_UNKNOWN) { if ((sc->nvram_dev = bhnd_find_nvram(sc)) == NULL) { device_printf(sc->dev, - "warning: %s NVRAM device not found\n", + "warning: NVRAM %s device not found\n", bhnd_nvram_src_name(ccaps->nvram_src)); } } @@ -459,6 +459,11 @@ bhnd_find_platform_dev(struct bhnd_softc } child = device_find_child(chipc, classname, -1); + if (child != NULL) + goto found; + + /* Look for a parent-attached device (e.g. nexus0 -> bhnd_nvram) */ + child = device_find_child(device_get_parent(sc->dev), classname, -1); if (child == NULL) return (NULL); @@ -651,7 +656,7 @@ bhnd_generic_is_region_valid(device_t de */ int bhnd_generic_get_nvram_var(device_t dev, device_t child, const char *name, - void *buf, size_t *size) + void *buf, size_t *size, bhnd_nvram_type type) { struct bhnd_softc *sc; device_t nvram, parent; @@ -660,14 +665,14 @@ bhnd_generic_get_nvram_var(device_t dev, /* If a NVRAM device is available, consult it first */ if ((nvram = bhnd_find_nvram(sc)) != NULL) - return BHND_NVRAM_GETVAR(nvram, name, buf, size); + return BHND_NVRAM_GETVAR(nvram, name, buf, size, type); /* Otherwise, try to delegate to parent */ if ((parent = device_get_parent(dev)) == NULL) return (ENODEV); return (BHND_BUS_GET_NVRAM_VAR(device_get_parent(dev), child, - name, buf, size)); + name, buf, size, type)); } /** Modified: head/sys/dev/bhnd/bhnd.h ============================================================================== --- head/sys/dev/bhnd/bhnd.h Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/bhnd.h Tue Aug 16 21:32:05 2016 (r304243) @@ -321,6 +321,31 @@ void bhnd_set_custom_core_desc(devic const char *name); void bhnd_set_default_core_desc(device_t dev); +int bhnd_nvram_getvar_str(device_t dev, + const char *name, char *buf, size_t len, + size_t *rlen); + +int bhnd_nvram_getvar_uint(device_t dev, + const char *name, void *value, int width); +int bhnd_nvram_getvar_uint8(device_t dev, + const char *name, uint8_t *value); +int bhnd_nvram_getvar_uint16(device_t dev, + const char *name, uint16_t *value); +int bhnd_nvram_getvar_uint32(device_t dev, + const char *name, uint32_t *value); + +int bhnd_nvram_getvar_int(device_t dev, + const char *name, void *value, int width); +int bhnd_nvram_getvar_int8(device_t dev, + const char *name, int8_t *value); +int bhnd_nvram_getvar_int16(device_t dev, + const char *name, int16_t *value); +int bhnd_nvram_getvar_int32(device_t dev, + const char *name, int32_t *value); + +int bhnd_nvram_getvar_array(device_t dev, + const char *name, void *buf, size_t count, + bhnd_nvram_type type); bool bhnd_bus_generic_is_hw_disabled(device_t dev, device_t child); @@ -329,7 +354,8 @@ bool bhnd_bus_generic_is_region_vali u_int port, u_int region); int bhnd_bus_generic_get_nvram_var(device_t dev, device_t child, const char *name, - void *buf, size_t *size); + void *buf, size_t *size, + bhnd_nvram_type type); const struct bhnd_chipid *bhnd_bus_generic_get_chipid(device_t dev, device_t child); int bhnd_bus_generic_read_board_info(device_t dev, @@ -428,55 +454,36 @@ bhnd_read_board_info(device_t dev, struc } /** - * Determine an NVRAM variable's expected size. - * - * @param dev A bhnd bus child device. - * @param name The variable name. - * @param[out] len On success, the variable's size, in bytes. - * - * @retval 0 success - * @retval ENOENT The requested variable was not found. - * @retval ENODEV No valid NVRAM source could be found. - * @retval non-zero If reading @p name otherwise fails, a regular unix - * error code will be returned. - */ -static inline int -bhnd_nvram_getvarlen(device_t dev, const char *name, size_t *len) -{ - return (BHND_BUS_GET_NVRAM_VAR(device_get_parent(dev), dev, name, NULL, - len)); -} - -/** - * Read an NVRAM variable. - * - * @param dev A bhnd bus child device. - * @param name The NVRAM variable name. - * @param buf A buffer large enough to hold @p len bytes. On success, - * the requested value will be written to this buffer. - * @param len The required variable length. + * Read an NVRAM variable, coerced to the requested @p type. * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] buf A buffer large enough to hold @p len bytes. On + * success, the requested value will be written to + * this buffer. This argment may be NULL if + * the value is not desired. + * @param[in,out] len The maximum capacity of @p buf. On success, + * will be set to the actual size of the requested + * value. + * @param type The desired data representation to be written + * to @p buf. + * * @retval 0 success * @retval ENOENT The requested variable was not found. - * @retval EINVAL If @p len does not match the actual variable size. * @retval ENODEV No valid NVRAM source could be found. + * @retval ENOMEM If a buffer of @p size is too small to hold the + * requested value. + * @retval EOPNOTSUPP If the value cannot be coerced to @p type. + * @retval ERANGE If value coercion would overflow @p type. * @retval non-zero If reading @p name otherwise fails, a regular unix * error code will be returned. */ static inline int -bhnd_nvram_getvar(device_t dev, const char *name, void *buf, size_t len) +bhnd_nvram_getvar(device_t dev, const char *name, void *buf, size_t *len, + bhnd_nvram_type type) { - size_t var_len; - int error; - - if ((error = bhnd_nvram_getvarlen(dev, name, &var_len))) - return (error); - - if (len != var_len) - return (EINVAL); - return (BHND_BUS_GET_NVRAM_VAR(device_get_parent(dev), dev, name, buf, - &len)); + len, type)); } /** Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/bhnd_bus_if.m Tue Aug 16 21:32:05 2016 (r304243) @@ -116,7 +116,7 @@ CODE { static int bhnd_bus_null_get_nvram_var(device_t dev, device_t child, - const char *name, void *buf, size_t *size) + const char *name, void *buf, size_t *size, bhnd_nvram_type type) { return (ENODEV); } @@ -492,12 +492,15 @@ METHOD int get_region_addr { * the value is not desired. * @param[in,out] size The capacity of @p buf. On success, will be set * to the actual size of the requested value. + * @param type The data type to be written to @p buf. * * @retval 0 success * @retval ENOENT The requested variable was not found. * @retval ENOMEM If @p buf is non-NULL and a buffer of @p size is too * small to hold the requested value. * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the @p name's data type cannot be coerced to @p type. + * @retval ERANGE If value coercion would overflow @p type. * @retval non-zero If reading @p name otherwise fails, a regular unix * error code will be returned. */ @@ -507,6 +510,7 @@ METHOD int get_nvram_var { const char *name; void *buf; size_t *size; + bhnd_nvram_type type; } DEFAULT bhnd_bus_null_get_nvram_var; Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/bhnd_subr.c Tue Aug 16 21:32:05 2016 (r304243) @@ -30,7 +30,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -881,6 +880,325 @@ cleanup: } /** + * Read an NVRAM variable's NUL-terminated string value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] buf A buffer large enough to hold @p len bytes. On + * success, the NUL-terminated string value will be + * written to this buffer. This argment may be NULL if + * the value is not desired. + * @param len The maximum capacity of @p buf. + * @param[out] rlen On success, will be set to the actual size of + * the requested value (including NUL termination). This + * argment may be NULL if the size is not desired. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval ENOMEM If @p buf is non-NULL and a buffer of @p len is too + * small to hold the requested value. + * @retval EFTYPE If the variable data cannot be coerced to a valid + * string representation. + * @retval ERANGE If value coercion would overflow @p type. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_str(device_t dev, const char *name, char *buf, size_t len, + size_t *rlen) +{ + size_t larg; + int error; + + larg = len; + error = bhnd_nvram_getvar(dev, name, buf, &larg, BHND_NVRAM_TYPE_CSTR); + if (rlen != NULL) + *rlen = larg; + + return (error); +} + +/** + * Read an NVRAM variable's unsigned integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * @param width The output integer type width (1, 2, or + * 4 bytes). + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid unsigned integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) an + * unsigned representation of the given @p width. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_uint(device_t dev, const char *name, void *value, int width) +{ + bhnd_nvram_type type; + size_t len; + + switch (width) { + case 1: + type = BHND_NVRAM_TYPE_UINT8; + break; + case 2: + type = BHND_NVRAM_TYPE_UINT16; + break; + case 4: + type = BHND_NVRAM_TYPE_UINT32; + break; + default: + device_printf(dev, "unsupported NVRAM integer width: %d\n", + width); + return (EINVAL); + } + + len = width; + return (bhnd_nvram_getvar(dev, name, value, &len, type)); +} + +/** + * Read an NVRAM variable's unsigned 8-bit integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid unsigned integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) uint8_t. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_uint8(device_t dev, const char *name, uint8_t *value) +{ + return (bhnd_nvram_getvar_uint(dev, name, value, sizeof(*value))); +} + +/** + * Read an NVRAM variable's unsigned 16-bit integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid unsigned integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) + * uint16_t. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_uint16(device_t dev, const char *name, uint16_t *value) +{ + return (bhnd_nvram_getvar_uint(dev, name, value, sizeof(*value))); +} + +/** + * Read an NVRAM variable's unsigned 32-bit integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid unsigned integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) + * uint32_t. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_uint32(device_t dev, const char *name, uint32_t *value) +{ + return (bhnd_nvram_getvar_uint(dev, name, value, sizeof(*value))); +} + +/** + * Read an NVRAM variable's signed integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * @param width The output integer type width (1, 2, or + * 4 bytes). + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) an + * signed representation of the given @p width. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_int(device_t dev, const char *name, void *value, int width) +{ + bhnd_nvram_type type; + size_t len; + + switch (width) { + case 1: + type = BHND_NVRAM_TYPE_INT8; + break; + case 2: + type = BHND_NVRAM_TYPE_INT16; + break; + case 4: + type = BHND_NVRAM_TYPE_INT32; + break; + default: + device_printf(dev, "unsupported NVRAM integer width: %d\n", + width); + return (EINVAL); + } + + len = width; + return (bhnd_nvram_getvar(dev, name, value, &len, type)); +} + +/** + * Read an NVRAM variable's signed 8-bit integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) int8_t. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_int8(device_t dev, const char *name, int8_t *value) +{ + return (bhnd_nvram_getvar_int(dev, name, value, sizeof(*value))); +} + +/** + * Read an NVRAM variable's signed 16-bit integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) + * int16_t. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_int16(device_t dev, const char *name, int16_t *value) +{ + return (bhnd_nvram_getvar_int(dev, name, value, sizeof(*value))); +} + +/** + * Read an NVRAM variable's signed 32-bit integer value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] value On success, the requested value will be written + * to this pointer. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid integer representation. + * @retval ERANGE If value coercion would overflow (or underflow) + * int32_t. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_int32(device_t dev, const char *name, int32_t *value) +{ + return (bhnd_nvram_getvar_int(dev, name, value, sizeof(*value))); +} + + +/** + * Read an NVRAM variable's array value. + * + * @param dev A bhnd bus child device. + * @param name The NVRAM variable name. + * @param[out] buf A buffer large enough to hold @p size bytes. + * On success, the requested value will be written + * to this buffer. + * @param[in,out] size The required number of bytes to write to + * @p buf. + * @param type The desired array element data representation. + * + * @retval 0 success + * @retval ENOENT The requested variable was not found. + * @retval ENODEV No valid NVRAM source could be found. + * @retval ENXIO If less than @p size bytes are available. + * @retval ENOMEM If a buffer of @p size is too small to hold the + * requested value. + * @retval EFTYPE If the variable data cannot be coerced to a + * a valid instance of @p type. + * @retval ERANGE If value coercion would overflow (or underflow) a + * representation of @p type. + * @retval non-zero If reading @p name otherwise fails, a regular unix + * error code will be returned. + */ +int +bhnd_nvram_getvar_array(device_t dev, const char *name, void *buf, size_t size, + bhnd_nvram_type type) +{ + size_t nbytes; + int error; + + /* Attempt read */ + nbytes = size; + if ((error = bhnd_nvram_getvar(dev, name, buf, &nbytes, type))) + return (error); + + /* Verify that the expected number of bytes were fetched */ + if (nbytes < size) + return (ENXIO); + + return (0); +} + +/** * Using the bhnd(4) bus-level core information and a custom core name, * populate @p dev's device description. * @@ -953,7 +1271,8 @@ bhnd_bus_generic_get_chipid(device_t dev /* nvram board_info population macros for bhnd_bus_generic_read_board_info() */ #define BHND_GV(_dest, _name) \ - bhnd_nvram_getvar(child, BHND_NVAR_ ## _name, &_dest, sizeof(_dest)) + bhnd_nvram_getvar_uint(child, BHND_NVAR_ ## _name, &_dest, \ + sizeof(_dest)) #define REQ_BHND_GV(_dest, _name) do { \ if ((error = BHND_GV(_dest, _name))) { \ @@ -1017,7 +1336,7 @@ bhnd_bus_generic_read_board_info(device_ */ int bhnd_bus_generic_get_nvram_var(device_t dev, device_t child, const char *name, - void *buf, size_t *size) + void *buf, size_t *size, bhnd_nvram_type type) { device_t nvram; device_t parent; @@ -1027,14 +1346,14 @@ bhnd_bus_generic_get_nvram_var(device_t /* Look for a directly-attached NVRAM child */ if ((nvram = device_find_child(dev, "bhnd_nvram", -1)) != NULL) - return BHND_NVRAM_GETVAR(nvram, name, buf, size); + return BHND_NVRAM_GETVAR(nvram, name, buf, size, type); /* Try to delegate to parent */ if ((parent = device_get_parent(dev)) == NULL) return (ENODEV); return (BHND_BUS_GET_NVRAM_VAR(device_get_parent(dev), child, - name, buf, size)); + name, buf, size, type)); } /** Modified: head/sys/dev/bhnd/bhnd_types.h ============================================================================== --- head/sys/dev/bhnd/bhnd_types.h Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/bhnd_types.h Tue Aug 16 21:32:05 2016 (r304243) @@ -34,6 +34,8 @@ #include +#include "nvram/bhnd_nvram.h" + /** bhnd(4) device classes. */ typedef enum { BHND_DEVCLASS_CC, /**< chipcommon i/o controller */ Modified: head/sys/dev/bhnd/bhndvar.h ============================================================================== --- head/sys/dev/bhnd/bhndvar.h Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/bhndvar.h Tue Aug 16 21:32:05 2016 (r304243) @@ -92,6 +92,6 @@ int bhnd_generic_resume_child(device_ int bhnd_generic_get_nvram_var(device_t dev, device_t child, const char *name, void *buf, - size_t *size); + size_t *size, bhnd_nvram_type type); #endif /* _BHND_BHNDVAR_H_ */ Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Tue Aug 16 21:32:05 2016 (r304243) @@ -369,19 +369,11 @@ chipc_find_nvram_src(struct chipc_softc { uint32_t otp_st, srom_ctrl; - /* Very early devices vend SPROM/OTP/CIS (if at all) via the - * host bridge interface instead of ChipCommon. */ - if (!CHIPC_QUIRK(sc, SUPPORTS_SPROM)) - return (BHND_NVRAM_SRC_UNKNOWN); - /* - * Later chipset revisions standardized the SPROM capability flags and - * register interfaces. - * * We check for hardware presence in order of precedence. For example, * SPROM is is always used in preference to internal OTP if found. */ - if (caps->sprom) { + if (CHIPC_QUIRK(sc, SUPPORTS_SPROM) && caps->sprom) { srom_ctrl = bhnd_bus_read_4(sc->core, CHIPC_SPROM_CTRL); if (srom_ctrl & CHIPC_SRC_PRESENT) return (BHND_NVRAM_SRC_SPROM); Added: head/sys/dev/bhnd/nvram/bhnd_nvram.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/nvram/bhnd_nvram.c Tue Aug 16 21:32:05 2016 (r304243) @@ -0,0 +1,189 @@ +/*- + * Copyright (c) 2016 Landon Fuller + * 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. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * BHND CFE NVRAM driver. + * + * Provides access to device NVRAM via CFE. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +#include "bhnd_nvram_if.h" + +#include "bhnd_nvramvar.h" + +/** + * Default bhnd_nvram driver implementation of DEVICE_PROBE(). + */ +int +bhnd_nvram_probe(device_t dev) +{ + device_set_desc(dev, "Broadcom NVRAM"); + + /* Refuse wildcard attachments */ + return (BUS_PROBE_NOWILDCARD); +} + +/** + * Call from subclass DEVICE_ATTACH() implementations to handle + * device attachment. + * + * @param dev BHND NVRAM device. + * @param data NVRAM data to be copied and parsed. No reference to data + * will be held after return. + * @param size Size of @p data, in bytes. + * @param fmt NVRAM format. + */ +int +bhnd_nvram_attach(device_t dev, void *data, size_t size, bhnd_nvram_format fmt) +{ + struct bhnd_nvram_softc *sc; + int error; + + sc = device_get_softc(dev); + sc->dev = dev; + + /* Initialize NVRAM parser */ + error = bhnd_nvram_parser_init(&sc->nvram, dev, data, size, fmt); + if (error) + return (error); + + /* Initialize mutex */ + BHND_NVRAM_LOCK_INIT(sc); + + return (0); +} + +/** + * Default bhnd_nvram driver implementation of DEVICE_RESUME(). + */ +int +bhnd_nvram_resume(device_t dev) +{ + return (0); +} + +/** + * Default bhnd_nvram driver implementation of DEVICE_SUSPEND(). + */ +int +bhnd_nvram_suspend(device_t dev) +{ + return (0); +} + +/** + * Default bhnd_nvram driver implementation of DEVICE_DETACH(). + */ +int +bhnd_nvram_detach(device_t dev) +{ + struct bhnd_nvram_softc *sc; + + sc = device_get_softc(dev); + + bhnd_nvram_parser_fini(&sc->nvram); + BHND_NVRAM_LOCK_DESTROY(sc); + + return (0); +} + +/** + * Default bhnd_nvram driver implementation of BHND_NVRAM_GETVAR(). + */ +static int +bhnd_nvram_getvar_method(device_t dev, const char *name, void *buf, size_t *len, + bhnd_nvram_type type) +{ + struct bhnd_nvram_softc *sc; + int error; + + sc = device_get_softc(dev); + + BHND_NVRAM_LOCK(sc); + error = bhnd_nvram_parser_getvar(&sc->nvram, name, buf, len, type); + BHND_NVRAM_UNLOCK(sc); + + return (error); +} + +/** + * Default bhnd_nvram driver implementation of BHND_NVRAM_SETVAR(). + */ +static int +bhnd_nvram_setvar_method(device_t dev, const char *name, const void *buf, + size_t len, bhnd_nvram_type type) +{ + struct bhnd_nvram_softc *sc; + int error; + + sc = device_get_softc(dev); + + BHND_NVRAM_LOCK(sc); + error = bhnd_nvram_parser_setvar(&sc->nvram, name, buf, len, type); + BHND_NVRAM_UNLOCK(sc); + + return (error); +} + +static device_method_t bhnd_nvram_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bhnd_nvram_probe), + DEVMETHOD(device_resume, bhnd_nvram_resume), + DEVMETHOD(device_suspend, bhnd_nvram_suspend), + DEVMETHOD(device_detach, bhnd_nvram_detach), + + /* NVRAM interface */ + DEVMETHOD(bhnd_nvram_getvar, bhnd_nvram_getvar_method), + DEVMETHOD(bhnd_nvram_setvar, bhnd_nvram_setvar_method), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(bhnd_nvram, bhnd_nvram_driver, bhnd_nvram_methods, sizeof(struct bhnd_nvram_softc)); Modified: head/sys/dev/bhnd/nvram/bhnd_nvram.h ============================================================================== --- head/sys/dev/bhnd/nvram/bhnd_nvram.h Tue Aug 16 21:20:05 2016 (r304242) +++ head/sys/dev/bhnd/nvram/bhnd_nvram.h Tue Aug 16 21:32:05 2016 (r304243) @@ -67,4 +67,50 @@ typedef enum { */ } bhnd_nvram_src; +/** Supported NVRAM formats. */ +typedef enum { + BHND_NVRAM_FMT_BCM = 0, /**< Broadcom NUL-delimited key=value pairs */ + BHND_NVRAM_FMT_TLV = 1, /**< CFE TLV encoding, as used on WGT634U */ + BHND_NVRAM_FMT_BTXT = 2, /**< Broadcom board text file. This is used + to provide external NVRAM data for some + fullmac WiFi devices. */ + BHND_NVRAM_FMT_SPROM = 3, /**< SPROM/OTP-specific encoding used by + Broadcom network adapters */ + BHND_NVRAM_FMT_CIS = 4, /**< A mostly CIS-compatible encoding used + on some Broadcom network adapters */ + BHND_NVRAM_FMT_UNKNOWN = 5 /**< Unknown or unrecognized format */ +} bhnd_nvram_format; + + +/** bhnd_nvram_type bit flags */ +enum { + BHND_NVRAM_TF_SIGNED = (1<<7), +}; + +#define BHND_NVRAM_TYPE_ID_MASK 0xF +#define BHND_NVRAM_TYPE_FLAGS_MASK 0x70 + +#define BHND_NVRAM_TYPE_ID(_id, _flags) \ + (((_id) & BHND_NVRAM_TYPE_ID_MASK) | \ + ((_flags) & BHND_NVRAM_TYPE_FLAGS_MASK)) + +/** Supported NVRAM data types */ +typedef enum { + BHND_NVRAM_TYPE_UINT8 = BHND_NVRAM_TYPE_ID(0, 0), /**< unsigned 8-bit integer */ + BHND_NVRAM_TYPE_UINT16 = BHND_NVRAM_TYPE_ID(1, 0), /**< unsigned 16-bit integer */ + BHND_NVRAM_TYPE_UINT32 = BHND_NVRAM_TYPE_ID(2, 0), /**< unsigned 32-bit integer */ + BHND_NVRAM_TYPE_INT8 = BHND_NVRAM_TYPE_ID(4, BHND_NVRAM_TF_SIGNED), /**< signed 8-bit integer */ + BHND_NVRAM_TYPE_INT16 = BHND_NVRAM_TYPE_ID(5, BHND_NVRAM_TF_SIGNED), /**< signed 16-bit integer */ + BHND_NVRAM_TYPE_INT32 = BHND_NVRAM_TYPE_ID(6, BHND_NVRAM_TF_SIGNED), /**< signed 32-bit integer */ + BHND_NVRAM_TYPE_CHAR = BHND_NVRAM_TYPE_ID(7, BHND_NVRAM_TF_SIGNED), /**< ASCII character */ + BHND_NVRAM_TYPE_CSTR = BHND_NVRAM_TYPE_ID(8, 0), /**< NUL-terminated C string */ +} bhnd_nvram_type; + +#undef BHND_NVRAM_TYPE_ID_MASK +#undef BHND_NVRAM_TYPE_FLAGS_MASK +#undef BHND_NVRAM_TYPE_ID + +#define BHND_NVRAM_SIGNED_TYPE(_type) \ + (((_type) & BHND_NVRAM_TF_SIGNED) == BHND_NVRAM_TF_SIGNED) + #endif /* _BHND_NVRAM_BHND_NVRAM_H_ */ Added: head/sys/dev/bhnd/nvram/bhnd_nvram_cfe.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/bhnd/nvram/bhnd_nvram_cfe.c Tue Aug 16 21:32:05 2016 (r304243) @@ -0,0 +1,373 @@ +/*- + * Copyright (c) 2016 Landon Fuller + * 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. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * BHND CFE NVRAM driver. + * + * Provides access to device NVRAM via CFE. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#include +#include +#include + +#include "bhnd_nvram_if.h" + +#include "bhnd_nvramvar.h" + +static int nvram_open_cfedev(device_t dev, char *devname, int fd, + int64_t *offset, uint32_t *size, bhnd_nvram_format fmt); +static char *nvram_find_cfedev(device_t dev, int *fd, int64_t *offset, + uint32_t *size, bhnd_nvram_format *fmt); + +/** Known CFE NVRAM device names, in probe order. */ +static char *nvram_cfe_devs[] = { + "nflash0.nvram", /* NAND */ + "nflash1.nvram", + "flash0.nvram", + "flash1.nvram", +}; + +/** Supported CFE NVRAM formats, in probe order. */ +bhnd_nvram_format nvram_cfe_fmts[] = { + BHND_NVRAM_FMT_BCM, + BHND_NVRAM_FMT_TLV +}; + + +static int +bhnd_nvram_cfe_probe(device_t dev) +{ + char *devname; + bhnd_nvram_format fmt; + int64_t offset; + uint32_t size; + int error; + int fd; + + /* Defer to default driver implementation */ + if ((error = bhnd_nvram_probe(dev)) > 0) + return (error); + + /* Locate a usable CFE device */ + devname = nvram_find_cfedev(dev, &fd, &offset, &size, &fmt); + if (devname == NULL) + return (ENXIO); + cfe_close(fd); + + switch (fmt) { + case BHND_NVRAM_FMT_BCM: + device_set_desc(dev, "Broadcom NVRAM"); + break; + case BHND_NVRAM_FMT_TLV: + device_set_desc(dev, "Broadcom WGT634U NVRAM"); + break; + default: + device_printf(dev, "unknown NVRAM format: %d\n", fmt); + return (ENXIO); + } + + /* Refuse wildcard attachments */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue Aug 16 21:53:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2C31BBC62C; Tue, 16 Aug 2016 21:53:58 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A61E11FA; Tue, 16 Aug 2016 21:53:58 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 32198B808A; Tue, 16 Aug 2016 23:53:54 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 91F8928494; Tue, 16 Aug 2016 23:53:55 +0200 (CEST) Date: Tue, 16 Aug 2016 23:53:55 +0200 From: Jilles Tjoelker To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304180 - head/sys/ufs/ffs Message-ID: <20160816215355.GB12199@stack.nl> References: <201608151922.u7FJMOmT099410@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608151922.u7FJMOmT099410@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 21:53:58 -0000 On Mon, Aug 15, 2016 at 07:22:24PM +0000, Konstantin Belousov wrote: > [snip] > @@ -254,15 +259,23 @@ loop: > if ((bp->b_vflags & BV_SCANNED) != 0) > continue; > bp->b_vflags |= BV_SCANNED; > - /* Flush indirects in order. */ > + /* > + * Flush indirects in order, if requested. > + * > + * Note that if only datasync is requested, we can > + * skip indirect blocks when softupdates are not > + * active. Otherwise we must flush them with data, > + * since dependencies prevent data block writes. > + */ > if (waitfor == MNT_WAIT && bp->b_lblkno <= -NDADDR && > - lbn_level(bp->b_lblkno) >= passes) > + (lbn_level(bp->b_lblkno) >= passes || > + ((flags & DATA_ONLY) != 0 && !DOINGSOFTDEP(vp)))) > continue; > if (bp->b_lblkno > lbn) > panic("ffs_syncvnode: syncing truncated data."); > if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT, NULL) == 0) { > BO_UNLOCK(bo); > - } else if (wait != 0) { > + } else if (wait) { > if (BUF_LOCK(bp, > LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, > BO_LOCKPTR(bo)) != 0) { Hmm, some people interpret POSIX differently than I do, but I think it is clear that XBD 3.384 Synchronized I/O Data Integrity Completion requires the indirect blocks to be written (because "all file system information required to retrieve the data is successfully transferred"). The Linux man page matches this interpretation except that an fsync of the parent directory may be required. If the whole file is being considered, then any change to indirect blocks is needed to access some data (because the file was extended, a hole was filled or snapshotted data was overwritten). For other overwrites, there is no change to indirect blocks and no conflict with fdatasync's performance objectives. > @@ -330,31 +343,59 @@ next: > * these will be done with one sync and one async pass. > */ > if (bo->bo_dirty.bv_cnt > 0) { > - /* Write the inode after sync passes to flush deps. */ > - if (wait && DOINGSOFTDEP(vp) && (flags & NO_INO_UPDT) == 0) { > - BO_UNLOCK(bo); > - ffs_update(vp, 1); > - BO_LOCK(bo); > + if ((flags & DATA_ONLY) == 0) { > + still_dirty = true; > + } else { > + /* > + * For data-only sync, dirty indirect buffers > + * are ignored. > + */ > + still_dirty = false; > + TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) { > + if (bp->b_lblkno > -NDADDR) { > + still_dirty = true; > + break; > + } > + } > } > - /* switch between sync/async. */ > - wait = !wait; > - if (wait == 1 || ++passes < NIADDR + 2) > - goto loop; > + > + if (still_dirty) { > + /* Write the inode after sync passes to flush deps. */ > + if (wait && DOINGSOFTDEP(vp) && > + (flags & NO_INO_UPDT) == 0) { > + BO_UNLOCK(bo); > + ffs_update(vp, 1); > + BO_LOCK(bo); > + } > + /* switch between sync/async. */ > + wait = !wait; > + if (wait || ++passes < NIADDR + 2) > + goto loop; > #ifdef INVARIANTS > - if (!vn_isdisk(vp, NULL)) > - vn_printf(vp, "ffs_fsync: dirty "); > + if (!vn_isdisk(vp, NULL)) > + vn_printf(vp, "ffs_fsync: dirty "); > #endif > + } > } > BO_UNLOCK(bo); > error = 0; > - if ((flags & NO_INO_UPDT) == 0) > - error = ffs_update(vp, 1); > - if (DOINGSUJ(vp)) > - softdep_journal_fsync(VTOI(vp)); > + if ((flags & DATA_ONLY) == 0) { > + if ((flags & NO_INO_UPDT) == 0) > + error = ffs_update(vp, 1); > + if (DOINGSUJ(vp)) > + softdep_journal_fsync(VTOI(vp)); > + } > return (error); > } Ideally, a changed i_size would also cause the inode to be written, but I don't know how to determine that (there is no i_flag for it). Always writing the inode would defeat the point of fdatasync. -- Jilles Tjoelker From owner-svn-src-all@freebsd.org Tue Aug 16 21:55:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A98FBBC6C6; Tue, 16 Aug 2016 21:55:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BAF71384; Tue, 16 Aug 2016 21:55:35 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GLtYRo091233; Tue, 16 Aug 2016 21:55:34 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GLtYp4091232; Tue, 16 Aug 2016 21:55:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201608162155.u7GLtYp4091232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 16 Aug 2016 21:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304244 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 21:55:35 -0000 Author: glebius Date: Tue Aug 16 21:55:34 2016 New Revision: 304244 URL: https://svnweb.freebsd.org/changeset/base/304244 Log: We should not be allowing a timeout to reset when a drain is in progress on it (either async or sync drain). At this moment the only user of drain is TCP, but TCP wouldn't reschedule a callout after it has drained it, since it drains only when a tcpcb is closed. This for now the problem isn't observed. Submitted by: rrs Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Tue Aug 16 21:32:05 2016 (r304243) +++ head/sys/kern/kern_timeout.c Tue Aug 16 21:55:34 2016 (r304244) @@ -1061,7 +1061,7 @@ callout_reset_sbt_on(struct callout *c, */ if (c->c_lock != NULL && !cc_exec_cancel(cc, direct)) cancelled = cc_exec_cancel(cc, direct) = true; - if (cc_exec_waiting(cc, direct)) { + if (cc_exec_waiting(cc, direct) || cc_exec_drain(cc, dir)) { /* * Someone has called callout_drain to kill this * callout. Don't reschedule. From owner-svn-src-all@freebsd.org Tue Aug 16 22:43:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6452BBBC18F; Tue, 16 Aug 2016 22:43:29 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B6501F66; Tue, 16 Aug 2016 22:43:29 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id i5so18934764wmg.2; Tue, 16 Aug 2016 15:43:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=lI0I1jHarMEp0rN9+RvuTZ2uhs6xkNeHvKVW2Zbo8/0=; b=dMXk2sMCJkjqFiXDshQIOpFASh9uSASY2OZEfVG/RTGv3pJYU/bzpK54cR4g4/iA3M tkxc/VpXfFEGcW2hbwKlhrNrllxYdzneJeFWxctYMFRxTobVXdAH2NOKn8eGzI8sOU0X Zj44UoKa7wJO2VdNOCSmtwFN4t4RFcmhlQdH7VIxp7sPM24UlqBFrYd5PotKhBjEBP3P BvayssdpCBlNBuMCWFlwDme/us1H/0PVij43M0tz4VpHMldoTVYkahxYBnyEQICuv9xd stQd8uQC4lhFtaGyx5s7/1tdYSTxPcEagYLSe4DQZ4pfM1df3jb3bP4IuemoLZ/P1Cae RKyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=lI0I1jHarMEp0rN9+RvuTZ2uhs6xkNeHvKVW2Zbo8/0=; b=euhCeXuEwdfxOzHMPNj73WG0lkEY1Re4WAoyeYDccFirnY84XvKeR+oGmPz1hpGaer QHw1m4Owpup+Ew120vW+c5WguPHZWzUlEf20ieqp5lJzPhDN4BEfY+E2AjCrqYvRERPK ucg4XUHmww3YhRNxfjAxWKC5nSAzeYBMh/YTaoe7TbCa67YCpM4XTzl+zqOrZbz6s9Ra s2r6LAeE476WETxcyemiCY3+jsSuXB81IC5VPaj2hRFaSRgzlyqCk3mzvNH/vjvyY5wq 38Cz0Au7U7J4m6oEG6UsBjRCADocSkst0+Oxgv0hMWb0kaWCbmS3YXj4ESKBAZ/sQ0Cn Y1kA== X-Gm-Message-State: AEkoout+Sk5xGbjTcE7c9bfGKp288eHPRlKKU8EzAd1ZIhDIaSOlY4980knqU6Iu2GHt3Q== X-Received: by 10.194.29.2 with SMTP id f2mr38633703wjh.161.1471387406323; Tue, 16 Aug 2016 15:43:26 -0700 (PDT) Received: from ernst.home (p578E3980.dip0.t-ipconnect.de. [87.142.57.128]) by smtp.gmail.com with ESMTPSA id i66sm23749285wmg.9.2016.08.16.15.43.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Aug 2016 15:43:25 -0700 (PDT) Date: Wed, 17 Aug 2016 00:43:23 +0200 From: Gary Jennejohn To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304244 - head/sys/kern Message-ID: <20160817004323.5383bf7f@ernst.home> In-Reply-To: <201608162155.u7GLtYp4091232@repo.freebsd.org> References: <201608162155.u7GLtYp4091232@repo.freebsd.org> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 22:43:29 -0000 On Tue, 16 Aug 2016 21:55:34 +0000 (UTC) Gleb Smirnoff wrote: > Author: glebius > Date: Tue Aug 16 21:55:34 2016 > New Revision: 304244 > URL: https://svnweb.freebsd.org/changeset/base/304244 > > Log: > We should not be allowing a timeout to reset when a drain is in progress on > it (either async or sync drain). > > At this moment the only user of drain is TCP, but TCP wouldn't reschedule a > callout after it has drained it, since it drains only when a tcpcb is closed. > This for now the problem isn't observed. > > Submitted by: rrs > > Modified: > head/sys/kern/kern_timeout.c > > Modified: head/sys/kern/kern_timeout.c > ============================================================================== > --- head/sys/kern/kern_timeout.c Tue Aug 16 21:32:05 2016 (r304243) > +++ head/sys/kern/kern_timeout.c Tue Aug 16 21:55:34 2016 (r304244) > @@ -1061,7 +1061,7 @@ callout_reset_sbt_on(struct callout *c, > */ > if (c->c_lock != NULL && !cc_exec_cancel(cc, direct)) > cancelled = cc_exec_cancel(cc, direct) = true; > - if (cc_exec_waiting(cc, direct)) { > + if (cc_exec_waiting(cc, direct) || cc_exec_drain(cc, dir)) { <== dir in this line should really be direct. > /* > * Someone has called callout_drain to kill this > * callout. Don't reschedule. -- Gary Jennejohn From owner-svn-src-all@freebsd.org Tue Aug 16 23:00:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72F55BBC699; Tue, 16 Aug 2016 23:00:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4422B1A46; Tue, 16 Aug 2016 23:00:24 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7GN0NrW013898; Tue, 16 Aug 2016 23:00:23 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7GN0NV1013897; Tue, 16 Aug 2016 23:00:23 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201608162300.u7GN0NV1013897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 16 Aug 2016 23:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304245 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 16 Aug 2016 23:00:24 -0000 Author: glebius Date: Tue Aug 16 23:00:22 2016 New Revision: 304245 URL: https://svnweb.freebsd.org/changeset/base/304245 Log: Fix a stupid typo (or copy/paste buffer malfunction). Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Tue Aug 16 21:55:34 2016 (r304244) +++ head/sys/kern/kern_timeout.c Tue Aug 16 23:00:22 2016 (r304245) @@ -1061,7 +1061,7 @@ callout_reset_sbt_on(struct callout *c, */ if (c->c_lock != NULL && !cc_exec_cancel(cc, direct)) cancelled = cc_exec_cancel(cc, direct) = true; - if (cc_exec_waiting(cc, direct) || cc_exec_drain(cc, dir)) { + if (cc_exec_waiting(cc, direct) || cc_exec_drain(cc, direct)) { /* * Someone has called callout_drain to kill this * callout. Don't reschedule. From owner-svn-src-all@freebsd.org Wed Aug 17 00:10:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C61FBBCE40; Wed, 17 Aug 2016 00:10:01 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 151AE1EB6; Wed, 17 Aug 2016 00:10:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u7H09r5E006541 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 16 Aug 2016 17:09:53 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u7H09rJR006540; Tue, 16 Aug 2016 17:09:53 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 16 Aug 2016 17:09:53 -0700 From: Gleb Smirnoff To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303646 - head/sys/ofed/drivers/infiniband/ulp/ipoib Message-ID: <20160817000953.GB1069@FreeBSD.org> References: <201608012222.u71MMB4E018482@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608012222.u71MMB4E018482@repo.freebsd.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 00:10:01 -0000 Mark, On Mon, Aug 01, 2016 at 10:22:11PM +0000, Mark Johnston wrote: M> Author: markj M> Date: Mon Aug 1 22:22:11 2016 M> New Revision: 303646 M> URL: https://svnweb.freebsd.org/changeset/base/303646 M> M> Log: M> ipoib: Bound the number of egress mbufs buffered during pathrec lookups. M> M> In pathological situations where the master subnet manager becomes M> unresponsive for an extended period, we may otherwise end up queuing all M> of the system's mbufs while waiting for a response to a path record lookup. M> M> This addresses the same issue as commit 1e85b806f9 in Linux. M> M> Reviewed by: cem, ngie M> MFC after: 2 weeks M> Sponsored by: EMC / Isilon Storage Division M> M> Modified: M> head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c M> M> Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c M> ============================================================================== M> --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 1 22:19:23 2016 (r303645) M> +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 1 22:22:11 2016 (r303646) M> @@ -660,7 +660,13 @@ ipoib_unicast_send(struct mbuf *mb, stru M> new_path = 1; M> } M> if (path) { M> - _IF_ENQUEUE(&path->queue, mb); M> + if (_IF_QLEN(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) M> + _IF_ENQUEUE(&path->queue, mb); M> + else { M> + if_inc_counter(priv->dev, IFCOUNTER_OERRORS, 1); M> + m_freem(mb); M> + } Shouldn't that be IFCOUNTER_ODROPS? -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Wed Aug 17 00:36:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F675BBA62D; Wed, 17 Aug 2016 00:36:56 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pf0-x235.google.com (mail-pf0-x235.google.com [IPv6:2607:f8b0:400e:c00::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74C2D1D57; Wed, 17 Aug 2016 00:36:56 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pf0-x235.google.com with SMTP id h186so32307519pfg.3; Tue, 16 Aug 2016 17:36:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EyvcQuKITxGeDJX45pDLL64gXT3PjBY5tFqIMT74s4U=; b=NKq+Gq5GzrcUg8/7JYbgP96Bz0/rkO4TTUAqRF1MYAy2EMNjwjAki1a6xBCf6bf5pg ok4rrw4LDU+j8YSkEEQbTkVbKNx+mwWxSrR5nDeqeTEXFoIJdh0PDHMBsVOYgBVNPwRq yAscGIWotvCefotawZaMer95/FOYUjYhVKZ3ljn2YWmKKwVnKYkAuR/+boSpuhyy80Aw pDeHnmz7lqY22kvM0U+E44ijRAIbe0Zd8r/AvBzQ/Lci6kTzz7cavFcmOEDn4DhxDgPI IsgvGYz7wNmygDlVFghGliC4YIoW5YKXoLt/YJOJegu7dcgnmh/p8SJCacfL/1NxWsI2 4lPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=EyvcQuKITxGeDJX45pDLL64gXT3PjBY5tFqIMT74s4U=; b=RGV3VD1gk9+N8A+WOMGR+kcpwvvVUB1IR9sMGR1UZWgSZiH7dTS/JE9dno+of48Pfq yb+1YhpY4+aAKFRSrhULtz8+yP/b5+wIuf6QAtJOYokkjXOlNEQlIPM+haK6qi2JRXa8 lRglkgRvyC+w1XFnES8bULPaAREj6jg3VJ/zgSd2Xxytq5MRqIeLxFgGZ62jxx6KZVzs kZEFe+yyD6aqPNrT/JScwUFKfzRZtpQjz18N+5MIOZofQjBX8mUQxcfCklkzM2A8mzDq E52Ky7tRRzFq+p9ufyEUl5oMo+VrzVDuOQcQ4Ep4EBAA9yI/HI9hGMRV9YkUp8PTA6ff pRfw== X-Gm-Message-State: AEkoouswwd/BszYHh4WIfcJtB8wN1nWTuOjua92Knb0IjLW42TF7clrMGT40wOJDdjhZAw== X-Received: by 10.98.103.214 with SMTP id t83mr69306515pfj.158.1471394215614; Tue, 16 Aug 2016 17:36:55 -0700 (PDT) Received: from wkstn-mjohnston.west.isilon.com (c-76-104-201-218.hsd1.wa.comcast.net. [76.104.201.218]) by smtp.gmail.com with ESMTPSA id q26sm42046071pfj.53.2016.08.16.17.36.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Aug 2016 17:36:55 -0700 (PDT) Sender: Mark Johnston Date: Tue, 16 Aug 2016 17:41:28 -0700 From: Mark Johnston To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303646 - head/sys/ofed/drivers/infiniband/ulp/ipoib Message-ID: <20160817004128.GB94062@wkstn-mjohnston.west.isilon.com> References: <201608012222.u71MMB4E018482@repo.freebsd.org> <20160817000953.GB1069@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160817000953.GB1069@FreeBSD.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 00:36:56 -0000 On Tue, Aug 16, 2016 at 05:09:53PM -0700, Gleb Smirnoff wrote: > Mark, > > On Mon, Aug 01, 2016 at 10:22:11PM +0000, Mark Johnston wrote: > M> Author: markj > M> Date: Mon Aug 1 22:22:11 2016 > M> New Revision: 303646 > M> URL: https://svnweb.freebsd.org/changeset/base/303646 > M> > M> Log: > M> ipoib: Bound the number of egress mbufs buffered during pathrec lookups. > M> > M> In pathological situations where the master subnet manager becomes > M> unresponsive for an extended period, we may otherwise end up queuing all > M> of the system's mbufs while waiting for a response to a path record lookup. > M> > M> This addresses the same issue as commit 1e85b806f9 in Linux. > M> > M> Reviewed by: cem, ngie > M> MFC after: 2 weeks > M> Sponsored by: EMC / Isilon Storage Division > M> > M> Modified: > M> head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c > M> > M> Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c > M> ============================================================================== > M> --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 1 22:19:23 2016 (r303645) > M> +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 1 22:22:11 2016 (r303646) > M> @@ -660,7 +660,13 @@ ipoib_unicast_send(struct mbuf *mb, stru > M> new_path = 1; > M> } > M> if (path) { > M> - _IF_ENQUEUE(&path->queue, mb); > M> + if (_IF_QLEN(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) > M> + _IF_ENQUEUE(&path->queue, mb); > M> + else { > M> + if_inc_counter(priv->dev, IFCOUNTER_OERRORS, 1); > M> + m_freem(mb); > M> + } > > Shouldn't that be IFCOUNTER_ODROPS? I'm not sure. I used IFCOUNTER_OERRORS to be consistent with other error cases in this function. This error case doesn't represent the normal source of outbound packet drops but rather indicates that a key routing agent on the network is not responding. OQDROPS seems like it's specifically for the case that we can't buffer packets because the transmitter isn't keeping up. From owner-svn-src-all@freebsd.org Wed Aug 17 01:24:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72316BBC589; Wed, 17 Aug 2016 01:24:35 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 357EA15C5; Wed, 17 Aug 2016 01:24:35 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H1OYjT070591; Wed, 17 Aug 2016 01:24:34 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H1OYXQ070590; Wed, 17 Aug 2016 01:24:34 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201608170124.u7H1OYXQ070590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Wed, 17 Aug 2016 01:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304246 - head/sys/dev/pci 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 01:24:35 -0000 Author: vangyzen Date: Wed Aug 17 01:24:34 2016 New Revision: 304246 URL: https://svnweb.freebsd.org/changeset/base/304246 Log: PCIe HotPlug: Detect bridges that are not really HotPlug capable Some devices report that they have an MRL when they actually do not. Since they always report that the MRL is open, child devices would be ignored. Try to detect these devices and ignore their claim of HotPlug support. Specifically, if there is an open MRL but the Data Link Layer is active, the MRL is not real. Revert r303645 to re-enable HotPlug support for slots with power controllers, since it works correctly in my testing. Start the DLL state-change timer if Presence /or/ MRL state changes, along with other conditions. Previously, we started the timer iff Presence changed. If there is an MRL, it must be closed for power to be turned on, so Presence is unlikely to change on an MRL-close event. Add a printf() of interesting registers on HotPlug interrupts and commands (one from erj@). These were very useful for debugging. Guard them with bootverbose, since they're spam in normal operation. In collaboration with: jhb Reviewed by: jhb MFC after: 1 day Relnotes: yes (re-enable HotPlug support for slots with power controllers) Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D7509 Modified: head/sys/dev/pci/pci_pci.c Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Tue Aug 16 23:00:22 2016 (r304245) +++ head/sys/dev/pci/pci_pci.c Wed Aug 17 01:24:34 2016 (r304246) @@ -918,6 +918,7 @@ static void pcib_probe_hotplug(struct pcib_softc *sc) { device_t dev; + uint16_t link_sta, slot_sta; if (!pci_enable_pcie_hp) return; @@ -932,15 +933,29 @@ pcib_probe_hotplug(struct pcib_softc *sc sc->pcie_link_cap = pcie_read_config(dev, PCIER_LINK_CAP, 4); sc->pcie_slot_cap = pcie_read_config(dev, PCIER_SLOT_CAP, 4); + if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC) == 0) + return; + /* - * XXX: Handling of slots with a power controller needs to be - * reexamined. Ignore hotplug on such slots for now. + * Some devices report that they have an MRL when they actually + * do not. Since they always report that the MRL is open, child + * devices would be ignored. Try to detect these devices and + * ignore their claim of HotPlug support. + * + * If there is an open MRL but the Data Link Layer is active, + * the MRL is not real. */ - if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_PCP) - return; - - if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC) - sc->flags |= PCIB_HOTPLUG; + if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_MRLSP) != 0 && + (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) != 0) { + link_sta = pcie_read_config(dev, PCIER_LINK_STA, 2); + slot_sta = pcie_read_config(dev, PCIER_SLOT_STA, 2); + if ((slot_sta & PCIEM_SLOT_STA_MRLSS) != 0 && + (link_sta & PCIEM_LINK_STA_DL_ACTIVE) != 0) { + return; + } + } + + sc->flags |= PCIB_HOTPLUG; } /* @@ -966,6 +981,8 @@ pcib_pcie_hotplug_command(struct pcib_so new = (ctl & ~mask) | val; if (new == ctl) return; + if (bootverbose) + device_printf(dev, "HotPlug command: %04x -> %04x\n", ctl, new); pcie_write_config(dev, PCIER_SLOT_CTL, new, 2); if (!(sc->pcie_slot_cap & PCIEM_SLOT_CAP_NCCS) && (ctl & new) & PCIEM_SLOT_CTL_CCIE) { @@ -1028,9 +1045,6 @@ pcib_hotplug_inserted(struct pcib_softc static int pcib_hotplug_present(struct pcib_softc *sc) { - device_t dev; - - dev = sc->dev; /* Card must be inserted. */ if (!pcib_hotplug_inserted(sc)) @@ -1059,7 +1073,7 @@ pcib_pcie_hotplug_update(struct pcib_sof { bool card_inserted, ei_engaged; - /* Clear DETACHING if Present Detect has cleared. */ + /* Clear DETACHING if Presence Detect has cleared. */ if ((sc->pcie_slot_sta & (PCIEM_SLOT_STA_PDC | PCIEM_SLOT_STA_PDS)) == PCIEM_SLOT_STA_PDC) sc->flags &= ~PCIB_DETACHING; @@ -1101,14 +1115,15 @@ pcib_pcie_hotplug_update(struct pcib_sof /* * Start a timer to see if the Data Link Layer times out. - * Note that we only start the timer if Presence Detect + * Note that we only start the timer if Presence Detect or MRL Sensor * changed on this interrupt. Stop any scheduled timer if * the Data Link Layer is active. */ if (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) { if (card_inserted && !(sc->pcie_link_sta & PCIEM_LINK_STA_DL_ACTIVE) && - sc->pcie_slot_sta & PCIEM_SLOT_STA_PDC) { + sc->pcie_slot_sta & + (PCIEM_SLOT_STA_MRLSC | PCIEM_SLOT_STA_PDC)) { if (cold) device_printf(sc->dev, "Data Link Layer inactive\n"); @@ -1144,6 +1159,10 @@ pcib_pcie_intr(void *arg) /* Clear the events just reported. */ pcie_write_config(dev, PCIER_SLOT_STA, sc->pcie_slot_sta, 2); + if (bootverbose) + device_printf(dev, "HotPlug interrupt: %#x\n", + sc->pcie_slot_sta); + if (sc->pcie_slot_sta & PCIEM_SLOT_STA_ABP) { if (sc->flags & PCIB_DETACH_PENDING) { device_printf(dev, @@ -1165,7 +1184,7 @@ pcib_pcie_intr(void *arg) sc->pcie_slot_sta & PCIEM_SLOT_STA_MRLSS ? "open" : "closed"); if (bootverbose && sc->pcie_slot_sta & PCIEM_SLOT_STA_PDC) - device_printf(dev, "Present Detect Changed to %s\n", + device_printf(dev, "Presence Detect Changed to %s\n", sc->pcie_slot_sta & PCIEM_SLOT_STA_PDS ? "card present" : "empty"); if (sc->pcie_slot_sta & PCIEM_SLOT_STA_CC) @@ -1234,7 +1253,7 @@ pcib_pcie_cc_timeout(void *arg) sta = pcie_read_config(dev, PCIER_SLOT_STA, 2); if (!(sta & PCIEM_SLOT_STA_CC)) { device_printf(dev, - "Hotplug Command Timed Out - forcing detach\n"); + "HotPlug Command Timed Out - forcing detach\n"); sc->flags &= ~(PCIB_HOTPLUG_CMD_PENDING | PCIB_DETACH_PENDING); sc->flags |= PCIB_DETACHING; pcib_pcie_hotplug_update(sc, 0, 0, true); From owner-svn-src-all@freebsd.org Wed Aug 17 01:56:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 836BEBBCD9F; Wed, 17 Aug 2016 01:56:39 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F1CDB133D; Wed, 17 Aug 2016 01:56:38 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H1ucK6081927; Wed, 17 Aug 2016 01:56:38 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H1ubw8081923; Wed, 17 Aug 2016 01:56:37 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201608170156.u7H1ubw8081923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 17 Aug 2016 01:56:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304247 - head/sys/dev/qlxgbe 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 01:56:39 -0000 Author: davidcs Date: Wed Aug 17 01:56:37 2016 New Revision: 304247 URL: https://svnweb.freebsd.org/changeset/base/304247 Log: Upgrade fw, bootloader and minidump template to version 5.4.58 Add minidump retrieval code MFC after: 5 days Modified: head/sys/dev/qlxgbe/ql_boot.c head/sys/dev/qlxgbe/ql_def.h head/sys/dev/qlxgbe/ql_fw.c head/sys/dev/qlxgbe/ql_glbl.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_ioctl.c head/sys/dev/qlxgbe/ql_ioctl.h head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_minidump.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_reset.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_boot.c ============================================================================== --- head/sys/dev/qlxgbe/ql_boot.c Wed Aug 17 01:24:34 2016 (r304246) +++ head/sys/dev/qlxgbe/ql_boot.c Wed Aug 17 01:56:37 2016 (r304247) @@ -34,14 +34,14 @@ __FBSDID("$FreeBSD$"); #include "ql_os.h" unsigned int ql83xx_bootloader_version_major = 5; -unsigned int ql83xx_bootloader_version_minor = 2; -unsigned int ql83xx_bootloader_version_sub = 7; +unsigned int ql83xx_bootloader_version_minor = 4; +unsigned int ql83xx_bootloader_version_sub = 58; unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x04, 0x00, 0x80, 0x82, 0x05, 0x1f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0xc0, 0x81, 0x05, 0x1f, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x1e, 0x02, 0x21, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x01, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, @@ -1384,7 +1384,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x81, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x14, 0xe0, 0x11, 0x20, 0xa2, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbb, 0x11, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x40, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x02, 0x00, 0x80, 0x40, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0b, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, @@ -1421,14 +1421,14 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xce, 0x11, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x02, 0x16, 0x04, 0x00, 0x00, 0x00, 0x60, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x49, 0x07, + 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x49, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa2, 0x07, 0x00, 0x00, 0x26, 0x00, 0xe0, 0x04, 0x00, 0xa0, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x80, 0x01, 0xa0, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x21, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x40, 0x00, 0x00, 0x0c, 0x1c, 0x00, 0x00, 0x00, 0x40, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x00, 0x5e, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xfe, 0x1f, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, @@ -1535,7 +1535,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x20, 0x50, 0x00, 0x02, 0x00, 0x00, 0x00, 0x60, 0x52, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xb8, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, + 0xb5, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0xa0, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1589,7 +1589,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb8, 0x14, 0x7c, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb5, 0x14, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x40, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0xa0, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, @@ -1624,7 +1624,7 @@ unsigned char ql83xx_bootloader[] = { 0x04, 0x00, 0x00, 0x00, 0x0e, 0x04, 0x00, 0x00, 0x00, 0xc0, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x08, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x38, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0x35, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x4c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x08, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x8d, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x4c, 0x01, @@ -1739,13 +1739,13 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x05, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x04, 0x00, 0x00, 0x40, 0x14, 0x00, 0x00, 0x00, 0xa8, 0x22, 0x00, 0x40, 0x02, 0x00, 0xa0, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0a, 0x17, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0a, 0x17, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x07, 0x17, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x07, 0x17, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x0d, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x08, 0x00, 0x00, 0x00, 0x04, 0x07, 0x00, 0x00, 0x00, 0x20, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x08, 0x00, 0x00, 0x40, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x17, 0x7c, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x17, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x20, 0x50, 0x04, 0x00, 0x00, 0x00, 0x40, 0x04, 0x00, 0x00, 0x00, 0xe0, 0x33, 0x00, 0x00, 0x02, 0x00, 0xa0, @@ -1803,8 +1803,8 @@ unsigned char ql83xx_bootloader[] = { 0x0e, 0x1e, 0x00, 0x00, 0x00, 0x80, 0x31, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x10, 0x00, 0x80, 0x40, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xb8, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0x38, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0xb5, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x80, 0x35, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0xf8, 0x0e, 0x00, 0xe0, 0x01, 0xa0, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x06, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x01, 0x00, @@ -1827,8 +1827,8 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x20, 0x50, 0x04, 0x01, 0x8d, 0x02, 0x32, 0x04, 0x1b, 0x08, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x80, 0x01, 0xa0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5f, 0x19, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5f, 0x19, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x5c, 0x19, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x5c, 0x19, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x92, 0x0d, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x08, 0x00, 0x85, 0x01, 0x40, 0x06, 0x00, 0x00, 0x00, 0x78, 0x38, 0x04, 0x00, 0x82, 0x01, 0xa0, 0x00, 0x00, 0x84, 0x02, @@ -1988,7 +1988,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x29, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xa5, 0x03, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc3, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0xc0, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0x00, 0x06, 0x03, 0x00, 0x00, 0x00, 0x18, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x80, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, @@ -2104,7 +2104,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x40, 0x00, 0x80, 0x40, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xd2, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0xcf, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, @@ -2119,7 +2119,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xd3, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, + 0xd0, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -2135,7 +2135,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x4d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x0a, 0x00, 0x80, 0x01, 0xa0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xd5, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc1, 0x01, + 0xd2, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x08, 0x05, 0x00, 0x40, 0x16, 0x00, 0x00, @@ -2196,7 +2196,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x02, 0x00, 0xe0, 0x01, 0xa0, 0x00, 0x10, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xd3, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x80, 0xd0, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, @@ -2209,7 +2209,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd7, 0x15, 0x7c, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd4, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x4c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, @@ -2903,7 +2903,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xd9, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc1, 0x02, + 0xd6, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x08, 0x05, 0x00, 0x40, 0x16, 0x00, 0x00, @@ -3097,7 +3097,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfa, 0x08, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x78, 0x00, 0x00, 0xe0, 0x01, 0xa0, - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xda, 0x15, 0x7c, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xd7, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x41, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x78, 0x00, 0x00, 0xe0, 0x01, 0xa0, @@ -3147,7 +3147,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdc, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, + 0xd9, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -3264,7 +3264,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x2d, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x40, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xde, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0xdb, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x08, 0x09, 0x00, @@ -3313,7 +3313,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x80, 0x01, 0xa0, 0x00, 0x0a, 0x0c, 0x03, 0x08, 0x92, 0x20, 0x0b, 0x00, 0x08, 0xf8, 0x08, 0x00, 0x82, 0x01, 0xa0, 0x80, 0x00, 0xcc, 0x02, 0x06, 0x0f, 0x00, 0x00, 0x00, 0x08, 0xf8, 0x09, 0x00, 0x82, 0x01, 0xa0, - 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x15, 0x7c, 0x00, + 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbd, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x8c, 0x00, 0x42, 0x03, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x0a, 0xe0, 0x82, 0x01, 0xa0, 0x0a, 0x94, 0xa0, 0x01, 0xa0, 0x7b, 0x10, 0x80, 0x01, 0x13, 0xe8, 0x00, 0xb0, 0x02, 0x40, 0x81, @@ -3329,7 +3329,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x02, 0x00, 0xa0, 0x00, 0x00, 0x7a, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x20, 0x50, 0x00, 0x01, 0x00, 0xc0, 0x41, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xc0, 0x15, 0x7c, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbd, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x40, 0x00, 0x00, 0x00, 0x1d, 0x00, 0x00, 0x00, 0x08, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x01, 0x00, 0xc0, 0x01, 0x00, 0xa0, @@ -3361,18 +3361,18 @@ unsigned char ql83xx_bootloader[] = { 0xe0, 0x04, 0x00, 0xa0, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0x15, 0x7c, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xdd, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x41, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x08, 0x09, 0x00, 0x40, 0x16, 0x00, 0x00, 0x00, 0xd8, 0x78, 0x00, 0x00, 0xe2, 0x01, 0xa0, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xe2, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x01, 0x01, + 0xdf, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9b, 0x0a, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x78, 0x00, 0x00, 0xe0, 0x01, 0xa0, 0x80, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0xe2, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x80, 0xdf, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x4c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, @@ -3683,7 +3683,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xe4, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x0c, 0x03, + 0xe1, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -3707,7 +3707,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xe6, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x81, 0x01, + 0xe3, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x08, 0x09, 0x00, 0x40, 0x16, 0x00, 0x00, @@ -3888,7 +3888,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x2a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x20, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xe8, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0xe5, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x4c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x41, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, @@ -4067,7 +4067,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0xcd, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x0a, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xea, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, + 0xe7, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x41, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -4143,7 +4143,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, - 0xeb, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc1, 0x00, + 0xe8, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x08, 0x09, 0x00, 0x40, 0x16, 0x00, 0x00, @@ -4373,7 +4373,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xed, 0x15, 0x7c, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xea, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x8c, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x09, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, @@ -4448,7 +4448,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xef, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x00, 0xec, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb2, 0x05, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x08, 0x05, 0x00, @@ -5093,17 +5093,17 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0xcd, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x08, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x0b, 0x20, 0x80, 0x01, 0xa0, - 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xd0, 0x15, 0x7c, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xcd, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, - 0xd4, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x20, 0x00, 0x0d, 0x01, + 0xd1, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x20, 0x00, 0x0d, 0x01, 0x40, 0x0a, 0x00, 0x00, 0x00, 0x08, 0xf8, 0x08, 0x00, 0x82, 0x01, 0xa0, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x8d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x08, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xfb, 0x0b, 0x00, 0x80, 0x01, 0xa0, - 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf9, 0x15, 0x7c, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xfd, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x08, + 0xfa, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x80, 0x08, 0x20, 0x0f, 0x07, 0x04, 0x00, 0x00, 0x00, 0x02, 0x88, 0xc3, 0x01, 0x81, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -5773,7 +5773,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x25, 0x10, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x16, 0x7c, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x10, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, @@ -5800,7 +5800,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x5a, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0e, 0x00, 0x00, 0x20, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0x02, 0x16, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x80, 0xff, 0x15, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x10, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x01, 0x00, @@ -5840,7 +5840,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x10, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x38, 0x00, 0x00, 0xe0, 0x01, 0xa0, 0x00, 0x02, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x80, 0x04, 0x16, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, + 0x00, 0x00, 0x00, 0x80, 0x01, 0x16, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x45, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x03, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x10, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x01, 0x00, @@ -7047,7 +7047,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x20, 0x50, 0x80, 0x00, 0xcd, 0x41, 0x40, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x07, 0x16, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x04, 0x00, 0x00, + 0x04, 0x16, 0x7c, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x85, 0x0a, 0x00, 0x00, 0x34, 0x00, 0x20, 0x04, 0x00, 0xa0, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x80, 0x01, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x60, 0x08, 0x00, 0x04, @@ -7103,11 +7103,7 @@ unsigned char ql83xx_bootloader[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x01, 0x00, 0x80, 0x01, 0xa0, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x80, 0x00, 0x00, 0x0e, 0x1e, 0x00, 0x00, - 0x00, 0x00, 0x31, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x80, 0x00, 0x00, - 0x2e, 0x1e, 0x00, 0x00, 0x00, 0x80, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, - 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x70, 0x00, 0x80, 0x00, 0x00, 0x0e, 0x1e, 0x00, 0x00, - 0x00, 0x80, 0x30, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x31, 0x00, 0x00, 0x02, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x96, 0x30, 0x07, 0x77, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x61, 0x0e, 0xee, 0x00, 0x00, 0x00, 0x00, @@ -10957,8 +10953,12 @@ unsigned char ql83xx_bootloader[] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, - 0x02, 0x00, 0x40, 0x40, 0x05, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x02, 0x00, 0x40, 0x40, 0x05, 0x04, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xc7, 0xf8, 0x13, 0xc6 + 0x00, 0x00, 0x00, 0x00, 0x93, 0x37, 0x14, 0x77 }; unsigned int ql83xx_bootloader_len = 131072; Modified: head/sys/dev/qlxgbe/ql_def.h ============================================================================== --- head/sys/dev/qlxgbe/ql_def.h Wed Aug 17 01:24:34 2016 (r304246) +++ head/sys/dev/qlxgbe/ql_def.h Wed Aug 17 01:56:37 2016 (r304247) @@ -119,11 +119,11 @@ typedef struct _qla_tx_ring { struct qla_host { volatile struct { volatile uint32_t + qla_interface_up :1, qla_callout_init :1, qla_watchdog_active :1, qla_watchdog_exit :1, qla_watchdog_pause :1, - lro_init :1, stop_rcv :1, parent_tag :1, lock_init :1; Modified: head/sys/dev/qlxgbe/ql_fw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_fw.c Wed Aug 17 01:24:34 2016 (r304246) +++ head/sys/dev/qlxgbe/ql_fw.c Wed Aug 17 01:56:37 2016 (r304247) @@ -35,32 +35,32 @@ __FBSDID("$FreeBSD$"); unsigned int ql83xx_firmware_version_major = 5; unsigned int ql83xx_firmware_version_minor = 4; -unsigned int ql83xx_firmware_version_sub = 56; +unsigned int ql83xx_firmware_version_sub = 58; unsigned char ql83xx_firmware[] = { - 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x60, 0x44, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x65, 0x29, 0xa5, 0xc3, 0x36, 0x3d, 0x7d, 0x98, + 0x03, 0x00, 0x40, 0x40, 0x05, 0x04, 0x3a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xa4, 0x58, 0x1b, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xa8, 0xde, 0x79, 0x42, 0x73, 0xa8, 0x26, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xea, 0x03, 0x00, + 0xe0, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0xef, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x20, 0x2c, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, 0x40, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xf3, 0x03, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xf7, 0x8e, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x2e, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x9b, 0x4e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, 0xf9, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x4a, 0x9a, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x42, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0xcf, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xe7, 0x82, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x77, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x65, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x83, 0x93, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x75, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -69,127 +69,127 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x5e, 0x8d, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7e, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x65, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xf8, 0x9d, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x7e, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xdc, 0xa2, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x04, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x76, 0xb3, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0xa7, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x92, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xf8, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x38, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0xb8, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x93, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x44, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x3e, 0xba, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x36, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x30, 0x66, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xd0, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xd5, 0xca, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf7, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x7c, 0x66, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x74, 0xd8, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0b, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xcc, 0xe9, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf1, 0x0b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5a, 0xe4, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xb7, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xb4, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xf5, 0x17, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xbb, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x11, 0xeb, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x77, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x66, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x78, 0xfc, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x71, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x6a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x88, 0x0e, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0b, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe9, 0x1f, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x94, 0x19, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x89, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x54, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x55, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x2a, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x86, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xa4, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x1d, 0x36, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x2a, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x67, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x76, 0x47, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x26, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x47, 0x3f, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x9c, 0x50, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5b, 0x47, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x52, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xe0, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x58, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x51, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x30, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xad, 0x4a, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x28, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe8, 0x67, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x5c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x26, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xd5, 0x4c, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x0a, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x27, 0x5e, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcb, 0x0a, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9f, 0x57, 0x18, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, 0x68, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb6, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x1c, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x6d, 0x00, 0x00, + 0x00, 0x6c, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x55, 0x78, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x81, 0x9e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xa8, 0x89, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2b, 0xa1, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xca, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xd6, 0x16, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xd3, 0x2a, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x90, 0x17, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x45, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xea, 0xd1, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x8d, 0x2b, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x4d, 0x25, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xd1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc1, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x0c, 0x8c, 0x02, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x8c, 0x8c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x04, 0x0c, 0x8c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xd5, 0x3c, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x8c, 0x8c, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xda, 0x50, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, 0x00, 0x00, 0x00, 0x58, 0xe0, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -232,9 +232,9 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x46, 0x1a, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x25, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0xcc, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xae, 0x05, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x5a, 0x1a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x63, 0xfd, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x14, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xb0, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -250,143091 +250,143498 @@ unsigned char ql83xx_firmware[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0xda, 0xec, 0x3d, 0x6d, 0x70, 0x5c, 0xd5, 0x75, 0xf7, 0x7d, 0xec, 0xee, 0xd3, 0x6a, 0x57, - 0x5a, 0x1b, 0xd9, 0x11, 0x42, 0xd4, 0xcf, 0xc6, 0xd8, 0xe2, 0x23, 0xcc, - 0xb3, 0x31, 0x8e, 0x31, 0x6e, 0x78, 0x92, 0x65, 0xc7, 0x36, 0x12, 0xa8, - 0xa1, 0x01, 0xf3, 0x11, 0x10, 0x69, 0x43, 0x04, 0x21, 0x58, 0x74, 0xa0, - 0x23, 0x13, 0x0f, 0x7e, 0xb2, 0x25, 0xd9, 0x80, 0x9c, 0xc8, 0xd8, 0x71, - 0x1c, 0x42, 0x61, 0x25, 0xdb, 0x94, 0xb4, 0xb4, 0x5d, 0x26, 0x1f, 0x65, - 0xda, 0xce, 0xb0, 0xb6, 0x33, 0xb1, 0x21, 0x78, 0xe2, 0xfc, 0xa0, 0x0d, - 0xe9, 0xd0, 0x6c, 0x27, 0x4d, 0x47, 0x25, 0x40, 0x37, 0xed, 0x94, 0xc8, - 0xa4, 0x86, 0xde, 0xef, 0xf7, 0xee, 0xdd, 0xf7, 0xde, 0xee, 0x95, 0x65, - 0x67, 0xd2, 0xb1, 0x32, 0x13, 0x74, 0x7c, 0xef, 0x39, 0xef, 0xdc, 0x73, - 0xcf, 0x3d, 0xe7, 0xdc, 0x73, 0xce, 0x7b, 0x02, 0x1a, 0x20, 0x3f, 0x26, - 0x30, 0x80, 0x0e, 0xee, 0x01, 0xe7, 0xe1, 0xdf, 0x4d, 0x98, 0xfc, 0xf4, - 0x52, 0xf8, 0xe4, 0xdb, 0x6f, 0xe1, 0xff, 0x7d, 0xa9, 0x02, 0x16, 0x7f, - 0x0a, 0x12, 0x9c, 0x57, 0x84, 0x3d, 0x1d, 0xd8, 0xf8, 0x97, 0x3d, 0x29, - 0xfc, 0x9f, 0xfe, 0x8a, 0xf9, 0x1a, 0xf0, 0xdc, 0x5c, 0x00, 0xa6, 0xbf, - 0xdb, 0xf9, 0x0c, 0xe1, 0x17, 0x14, 0x0d, 0xc6, 0x3a, 0x00, 0x75, 0x79, - 0x93, 0x00, 0x3d, 0xb7, 0x93, 0x9f, 0xfb, 0xa3, 0x9e, 0xb7, 0x0e, 0x44, - 0x3c, 0x4f, 0x11, 0x66, 0xf4, 0x4e, 0xcc, 0x30, 0xbd, 0x85, 0xda, 0xcc, - 0xd2, 0x5b, 0x3a, 0xc3, 0xf4, 0x36, 0xe9, 0xd3, 0xa3, 0xc7, 0xf0, 0xef, - 0x30, 0xa7, 0x85, 0x1f, 0xa2, 0x6f, 0x8e, 0x87, 0x48, 0x5d, 0xb6, 0xf4, - 0xae, 0xf5, 0xb3, 0xc0, 0xd0, 0xd7, 0x20, 0x49, 0x04, 0x9f, 0x6c, 0x1b, - 0x7a, 0xe3, 0xb5, 0x2e, 0x2d, 0xb7, 0x1b, 0xa2, 0x20, 0x38, 0xff, 0xc0, - 0xc5, 0xab, 0x56, 0x02, 0x3c, 0x5e, 0x66, 0xe3, 0xef, 0x3c, 0xa8, 0xe5, - 0xe1, 0xb8, 0x33, 0x88, 0xf0, 0xef, 0xbf, 0xf9, 0xd8, 0x55, 0x97, 0x10, - 0xfc, 0x41, 0x3a, 0xde, 0xb0, 0x5b, 0x73, 0x9e, 0x82, 0xf8, 0x83, 0x8c, - 0xfe, 0x8f, 0x09, 0xfe, 0xa0, 0x48, 0xdf, 0xd9, 0x06, 0xe1, 0x9e, 0xf5, - 0x57, 0x25, 0x2e, 0xfb, 0x38, 0xc1, 0xdf, 0x46, 0xc7, 0x3f, 0xfd, 0x86, - 0xd6, 0xb3, 0x07, 0xe2, 0x23, 0xb8, 0x77, 0xe5, 0xed, 0xcf, 0x3f, 0x90, - 0x24, 0xf8, 0x6c, 0xfc, 0xe1, 0x5f, 0x6b, 0xbd, 0x63, 0x10, 0x7f, 0x3b, - 0xa7, 0xaf, 0x61, 0xfc, 0xed, 0x12, 0xff, 0x08, 0xce, 0xbf, 0xf2, 0xab, - 0x85, 0xcb, 0x2d, 0x82, 0xcf, 0xc6, 0x5f, 0xbe, 0x0e, 0xf4, 0xa0, 0xe7, - 0x0f, 0x41, 0xb8, 0x3f, 0x77, 0xcc, 0x6d, 0x22, 0xeb, 0xeb, 0x1f, 0xa2, - 0xe3, 0x3f, 0xfd, 0xec, 0x63, 0x16, 0xa4, 0x5f, 0x40, 0x70, 0x6f, 0x66, - 0xc4, 0xc9, 0xb5, 0x10, 0x7c, 0x36, 0xbe, 0xea, 0x73, 0x8f, 0xed, 0x44, - 0xcf, 0x1f, 0x46, 0xfc, 0x5b, 0x6b, 0xec, 0x0c, 0x5d, 0xff, 0x30, 0x1d, - 0xef, 0x18, 0x7a, 0xcc, 0x42, 0xcf, 0x47, 0xb0, 0x6b, 0x9a, 0x39, 0x2b, - 0x43, 0xf0, 0xd9, 0xf8, 0x1f, 0x3f, 0xff, 0xd8, 0x4e, 0xf4, 0xfc, 0x11, - 0xd3, 0xdf, 0x0f, 0x48, 0xaf, 0x5f, 0x82, 0x0b, 0x12, 0x5c, 0x96, 0x60, - 0x67, 0x87, 0x84, 0x2f, 0xc1, 0x05, 0x09, 0x2e, 0x4b, 0xb0, 0xb3, 0x13, - 0xf1, 0xd7, 0xb4, 0xf6, 0x9e, 0x56, 0x3b, 0x77, 0xcd, 0xd3, 0x10, 0x1f, - 0xc1, 0x79, 0xe7, 0x73, 0xe6, 0x15, 0x9b, 0xb6, 0xa2, 0xf5, 0x15, 0x10, - 0xdc, 0xd3, 0xbc, 0xe3, 0xa1, 0xa6, 0xcb, 0xf0, 0x78, 0x99, 0x8d, 0x77, - 0xef, 0xde, 0x8a, 0xd6, 0xe7, 0x3c, 0x8e, 0xe4, 0xd3, 0x7a, 0x44, 0x33, - 0x97, 0x12, 0xfc, 0xc7, 0xe9, 0xf8, 0xa6, 0x6f, 0x6f, 0x45, 0xeb, 0x2b, - 0x20, 0xb8, 0xbf, 0x55, 0xcb, 0x59, 0xd7, 0x11, 0x7c, 0x36, 0xbe, 0xfb, - 0x8d, 0xad, 0x16, 0xd4, 0x0f, 0xe7, 0x09, 0xc2, 0xcf, 0xa2, 0x56, 0x9b, - 0xf0, 0x8f, 0xe1, 0xfa, 0x0c, 0xb0, 0xba, 0xef, 0xc1, 0xfc, 0xd3, 0xf1, - 0x65, 0x74, 0xbc, 0x8c, 0xe1, 0x27, 0x35, 0x36, 0xee, 0x3c, 0x29, 0xad, - 0x5f, 0x82, 0x0b, 0x12, 0x5c, 0x96, 0x60, 0x67, 0x54, 0xc2, 0x97, 0xe0, - 0x82, 0x04, 0x97, 0x25, 0xd8, 0xd9, 0x25, 0xe1, 0x4b, 0x70, 0x41, 0x82, - 0xcb, 0x12, 0xec, 0x7c, 0x45, 0xc2, 0x97, 0xe0, 0x82, 0x04, 0x97, 0x25, - 0xd8, 0xf9, 0xaa, 0x84, 0x2f, 0xc1, 0x05, 0x09, 0x2e, 0x4b, 0xb0, 0xe3, - 0x42, 0xd8, 0xeb, 0x7b, 0x27, 0xc9, 0xf0, 0x11, 0x5c, 0xba, 0xe4, 0xa7, - 0x7f, 0xca, 0xf0, 0x11, 0x5c, 0xfc, 0xe0, 0xf8, 0x88, 0x41, 0xf1, 0x11, - 0x9c, 0x7f, 0xe9, 0xc3, 0xf7, 0x29, 0xec, 0xb4, 0x43, 0x38, 0xb7, 0xeb, - 0x9a, 0x3a, 0x97, 0xe2, 0x23, 0xb8, 0xbf, 0xf3, 0x92, 0xcd, 0x14, 0x2e, - 0x20, 0xb8, 0x67, 0xde, 0xee, 0x5d, 0xab, 0x29, 0x3e, 0x82, 0x9d, 0x7f, - 0xdc, 0x71, 0x9a, 0xc2, 0x4e, 0x87, 0xc4, 0xbf, 0x04, 0x17, 0x24, 0xb8, - 0x2c, 0xc1, 0xce, 0x6a, 0x09, 0x5f, 0x82, 0x0b, 0x12, 0x5c, 0x96, 0x60, - 0xa7, 0x53, 0xc2, 0x97, 0xe0, 0x82, 0x04, 0x97, 0x25, 0xd8, 0x59, 0x23, - 0xe1, 0x4b, 0x70, 0x41, 0x82, 0xcb, 0x12, 0xec, 0xac, 0x95, 0xf0, 0x25, - 0xb8, 0x20, 0xc1, 0x65, 0x09, 0x76, 0x3e, 0x25, 0xe1, 0x4b, 0x70, 0x41, - 0x82, 0xcb, 0x12, 0xec, 0xac, 0x43, 0xfb, 0xf3, 0x99, 0x37, 0xd8, 0x7e, - 0xf6, 0x23, 0xf8, 0xe4, 0x23, 0x6f, 0x31, 0xb8, 0x80, 0xc7, 0xf7, 0xfd, - 0x82, 0xc1, 0x65, 0x3c, 0xfe, 0xbd, 0x77, 0xf9, 0xfe, 0xaf, 0x47, 0xe7, - 0xff, 0xba, 0xbf, 0x3c, 0xcd, 0xf0, 0x31, 0x7c, 0xc7, 0x77, 0x18, 0x5c, - 0xc0, 0xf0, 0x97, 0x87, 0x19, 0x5c, 0x46, 0x70, 0xf9, 0xb9, 0xaf, 0x30, - 0xd8, 0xd9, 0x80, 0xe0, 0x57, 0xc6, 0x38, 0x3e, 0x86, 0x7f, 0xf6, 0x0d, - 0x8e, 0x8f, 0x60, 0x30, 0x6b, 0xc1, 0x29, 0x86, 0x8f, 0xe0, 0xb1, 0x6b, - 0xae, 0x60, 0xb0, 0x73, 0x03, 0x84, 0xed, 0x0e, 0x93, 0xc1, 0xfd, 0x08, - 0x2e, 0xdc, 0x9b, 0x65, 0x70, 0x01, 0xc1, 0xee, 0xce, 0x1c, 0xc7, 0x47, - 0xf0, 0xc9, 0x17, 0x2f, 0xe4, 0xf8, 0x5d, 0x88, 0x7e, 0xf1, 0x18, 0x5f, - 0x7f, 0x17, 0x91, 0x4f, 0x99, 0xe1, 0x4b, 0x70, 0x59, 0x82, 0x9d, 0x6e, - 0x11, 0xee, 0x97, 0xe0, 0x82, 0x04, 0x97, 0x25, 0xd8, 0xb9, 0x51, 0xc2, - 0x97, 0xe0, 0x82, 0x04, 0x97, 0x25, 0xd8, 0xb9, 0x49, 0xc2, 0x97, 0xe0, - 0x82, 0x04, 0x97, 0x25, 0x58, 0x8c, 0xef, 0x2a, 0xe3, 0x83, 0x59, 0x41, - 0xb8, 0x6a, 0xbc, 0x61, 0xb3, 0xdf, 0x34, 0x1a, 0x54, 0xd2, 0x87, 0x35, - 0x6a, 0x3c, 0xc8, 0xac, 0x12, 0xaf, 0xf4, 0x6b, 0x6e, 0x40, 0x3f, 0x09, - 0xbd, 0x44, 0x02, 0xda, 0x7f, 0x14, 0x73, 0xc3, 0xf1, 0xdb, 0x13, 0x74, - 0xec, 0xc3, 0x79, 0xc0, 0xee, 0xa9, 0x4e, 0x4f, 0x8d, 0x7f, 0x7a, 0x36, - 0x4a, 0x1f, 0x91, 0x9f, 0x4d, 0xea, 0xf1, 0xd4, 0x8c, 0xc2, 0x85, 0xea, - 0xfb, 0xa3, 0x06, 0xd3, 0xf5, 0x95, 0x23, 0xd6, 0x57, 0xf5, 0x79, 0x55, - 0xf0, 0xab, 0xde, 0x57, 0x14, 0x9f, 0xe7, 0x71, 0x5b, 0xe5, 0x32, 0xfd, - 0xc9, 0xd2, 0xfb, 0x4a, 0x1f, 0x1c, 0xd5, 0xf8, 0x7d, 0x06, 0x00, 0x0b, - 0x8f, 0xfb, 0xc6, 0xd9, 0x06, 0xfb, 0x8f, 0x6a, 0x83, 0x20, 0x57, 0x04, - 0x56, 0x33, 0x99, 0x6f, 0x6f, 0x83, 0xf3, 0xc1, 0x95, 0x3a, 0x25, 0xfd, - 0x51, 0xb8, 0xfe, 0x64, 0x44, 0xfa, 0xe0, 0x75, 0x3a, 0x34, 0x49, 0xe1, - 0xdf, 0xee, 0xfe, 0x55, 0x93, 0xd7, 0x79, 0xf8, 0xcc, 0xce, 0xff, 0xd9, - 0x87, 0x67, 0x96, 0x1f, 0x1b, 0x48, 0xf9, 0x07, 0xf8, 0x0f, 0x9f, 0x6c, - 0x09, 0xcc, 0xa7, 0xf6, 0x97, 0x8f, 0x83, 0xef, 0x03, 0x51, 0xbf, 0x73, - 0x19, 0x11, 0x46, 0x27, 0x2a, 0x09, 0xfc, 0x73, 0x05, 0x91, 0xd2, 0xce, - 0x50, 0x47, 0x7b, 0x1b, 0x91, 0x2f, 0xa4, 0x9f, 0x6e, 0x21, 0xe7, 0xcb, - 0xd6, 0x83, 0xf6, 0xd8, 0x3b, 0x7d, 0x36, 0xec, 0x71, 0x75, 0xb8, 0x31, - 0x00, 0xd6, 0xf2, 0x7c, 0x36, 0xdf, 0x6b, 0x50, 0x9b, 0x0f, 0x2e, 0x56, - 0xa4, 0x7f, 0x85, 0x22, 0xfd, 0x95, 0x8a, 0xf4, 0xd7, 0x29, 0xd2, 0xbf, - 0x55, 0x91, 0xfe, 0xe7, 0x15, 0xe9, 0x3f, 0xac, 0x48, 0x7f, 0x9b, 0x22, - 0xfd, 0xdd, 0x8a, 0xf4, 0x9f, 0x53, 0xa4, 0xff, 0xd7, 0x8a, 0xf4, 0xff, - 0x41, 0x91, 0xfe, 0x0f, 0x15, 0xe9, 0xbf, 0xa9, 0x48, 0x7f, 0x52, 0x91, - 0xfe, 0xfb, 0x8a, 0xf4, 0x13, 0x9a, 0x1a, 0xfd, 0x0b, 0xd4, 0xe6, 0x83, - 0x05, 0x8a, 0xf4, 0x1d, 0x45, 0xfa, 0xd7, 0x2b, 0xd2, 0xef, 0x56, 0xa4, - 0x7f, 0xa7, 0x22, 0xfd, 0xfb, 0x15, 0xe9, 0x6f, 0x56, 0xa4, 0xbf, 0x43, - 0x91, 0xfe, 0x3e, 0x45, 0xfa, 0x07, 0x15, 0xe9, 0x7f, 0x5b, 0x91, 0xfe, - 0x61, 0x45, 0xfa, 0x27, 0x15, 0xe9, 0xff, 0x8b, 0x22, 0xfd, 0x77, 0x15, - 0xe9, 0xff, 0x46, 0x91, 0x7e, 0x5a, 0x57, 0xa3, 0xdf, 0xac, 0x36, 0x1f, - 0x2c, 0x56, 0xa4, 0x7f, 0x8d, 0x22, 0xfd, 0x4e, 0x45, 0xfa, 0x9f, 0x56, - 0xa4, 0x7f, 0x8f, 0x22, 0xfd, 0x4d, 0x8a, 0xf4, 0x1f, 0x53, 0xa4, 0x3f, - 0xaa, 0x48, 0xff, 0x9b, 0x8a, 0xf4, 0xbf, 0xa5, 0x48, 0xff, 0x65, 0x45, - 0xfa, 0x3f, 0x50, 0xa4, 0xff, 0x86, 0x22, 0xfd, 0x9f, 0x2b, 0xd2, 0xff, - 0x2f, 0x45, 0xfa, 0xc0, 0x50, 0xa3, 0xdf, 0xa8, 0x36, 0xdf, 0xbb, 0x58, - 0x91, 0xfe, 0x95, 0x8a, 0xf4, 0x57, 0x2a, 0xd2, 0x5f, 0xaf, 0x48, 0xff, - 0x56, 0x45, 0xfa, 0xf7, 0x2a, 0xd2, 0x7f, 0x58, 0x91, 0xfe, 0x76, 0x45, - 0xfa, 0xbb, 0x15, 0xe9, 0xe7, 0x8d, 0x73, 0x71, 0xff, 0xf0, 0xba, 0xc1, - 0x55, 0xbf, 0x87, 0x7e, 0xfd, 0xe5, 0xf5, 0x00, 0xe7, 0x13, 0x4e, 0xd0, - 0x0a, 0x70, 0x5f, 0x82, 0xdc, 0x9f, 0xb2, 0x34, 0xbf, 0x30, 0x69, 0x22, - 0x98, 0xd5, 0xeb, 0x0e, 0xf4, 0xb0, 0xe7, 0xed, 0x62, 0xf9, 0x05, 0x93, - 0xce, 0x67, 0xf7, 0x31, 0x0d, 0x0c, 0x6a, 0x79, 0x72, 0xed, 0x7a, 0x1a, - 0xde, 0xda, 0x16, 0x81, 0x92, 0xe9, 0xd7, 0x6b, 0xf3, 0xee, 0xb5, 0xf8, - 0x2a, 0x06, 0xff, 0xa9, 0xa9, 0xcd, 0x00, 0xad, 0x88, 0x95, 0xfc, 0x51, - 0x6d, 0x90, 0xd7, 0x03, 0xc7, 0x09, 0x7d, 0x0b, 0x68, 0xc0, 0x45, 0xa9, - 0xfc, 0x8d, 0x03, 0x80, 0xf0, 0x27, 0xf2, 0xcf, 0xe6, 0x1f, 0x7e, 0x38, - 0x7c, 0xfd, 0xb6, 0x05, 0x80, 0x9b, 0xb6, 0xeb, 0xc1, 0xd4, 0x27, 0x40, - 0x29, 0x05, 0x0e, 0x00, 0x9d, 0xe6, 0x7b, 0x3e, 0x81, 0x13, 0x30, 0xbd, - 0xfc, 0x82, 0xdd, 0xe6, 0x52, 0x7e, 0xdc, 0x39, 0x90, 0x9f, 0x67, 0x7e, - 0xb0, 0xb0, 0x39, 0xb9, 0xa4, 0x69, 0xc4, 0xb3, 0xc0, 0xae, 0xc1, 0x3d, - 0xb8, 0x94, 0x30, 0x69, 0x04, 0xd7, 0xcf, 0xf8, 0x03, 0x5a, 0xf7, 0x51, - 0x52, 0x8f, 0xee, 0xd3, 0xf1, 0xfa, 0x5d, 0x76, 0xc7, 0xc4, 0x72, 0xe8, - 0x45, 0x59, 0x1c, 0xcc, 0xbf, 0xe5, 0x00, 0xf8, 0x6c, 0x96, 0x6f, 0x02, - 0xb7, 0xd0, 0x7a, 0xb5, 0xb5, 0x7d, 0xbc, 0x1e, 0x29, 0xc7, 0x7c, 0xaa, - 0x24, 0x95, 0xf4, 0xeb, 0x8e, 0x50, 0xfa, 0x42, 0x7e, 0xe8, 0x1e, 0x4a, - 0x1f, 0x2d, 0xc7, 0xd5, 0x2b, 0xe9, 0xdf, 0x4a, 0xe9, 0xa7, 0x07, 0xc7, - 0x11, 0x0b, 0xde, 0x65, 0x91, 0xf4, 0x35, 0x91, 0xbe, 0x9b, 0x3d, 0x32, - 0xbf, 0x95, 0xee, 0x1f, 0x84, 0xad, 0x0a, 0xf9, 0x90, 0x9f, 0x8d, 0x94, - 0x7e, 0x05, 0x3d, 0xae, 0x0f, 0x93, 0x14, 0x7f, 0x97, 0x81, 0xd7, 0x4f, - 0xe9, 0xb1, 0xf9, 0x7f, 0x43, 0xe7, 0x9b, 0x12, 0x7d, 0x00, 0x46, 0x59, - 0xf8, 0x8f, 0xe5, 0xed, 0x82, 0xd7, 0x35, 0x17, 0x3d, 0xaa, 0xf9, 0x01, - 0x1d, 0xe5, 0xbb, 0x28, 0x3f, 0xde, 0x6d, 0xac, 0xde, 0x8f, 0xf7, 0x73, - 0xa4, 0x0e, 0xe5, 0x53, 0xbd, 0x04, 0x54, 0xa2, 0xf6, 0xee, 0x23, 0x5a, - 0x2b, 0xdc, 0xf5, 0xa9, 0x4d, 0x46, 0x69, 0x58, 0x1b, 0xbf, 0xf3, 0x46, - 0xcf, 0x2c, 0x81, 0x15, 0xba, 0x06, 0x5e, 0x48, 0xbc, 0x06, 0xc0, 0x0e, - 0xb8, 0x5f, 0x47, 0xb2, 0x39, 0x9f, 0xbf, 0x4a, 0xfe, 0x99, 0xbe, 0xb3, - 0xf5, 0x9f, 0xd0, 0x56, 0x85, 0xf0, 0x7f, 0x87, 0xc8, 0xbf, 0xf7, 0x59, - 0xc6, 0x0f, 0xd2, 0xb7, 0xb9, 0x88, 0x5f, 0xb2, 0x1f, 0x88, 0xdf, 0x24, - 0xea, 0x65, 0x38, 0x4e, 0x60, 0x00, 0x56, 0xa4, 0x28, 0x4a, 0x32, 0xfc, - 0xbe, 0xc2, 0xcf, 0x9f, 0x46, 0xce, 0x53, 0x17, 0x3b, 0x5f, 0x58, 0x1e, - 0x4c, 0x5e, 0x77, 0x47, 0xc8, 0xdf, 0x02, 0xdd, 0x06, 0xe1, 0x97, 0xac, - 0x8f, 0xf1, 0xb7, 0x26, 0x72, 0xbe, 0x28, 0x4f, 0xae, 0xaf, 0xd2, 0xf9, - 0x9a, 0x9d, 0x10, 0xd6, 0xdb, 0xa3, 0x91, 0x44, 0x4c, 0xaf, 0x9f, 0x5f, - 0x9c, 0xd4, 0xc3, 0xf2, 0x89, 0x48, 0xd4, 0x2e, 0x22, 0xba, 0x7f, 0x01, - 0x5d, 0x7f, 0x17, 0x63, 0x29, 0x51, 0xcb, 0x7d, 0x2d, 0x42, 0xde, 0xe0, - 0x8f, 0x28, 0xbf, 0x67, 0x7b, 0x7d, 0x16, 0xb4, 0x67, 0x58, 0x9e, 0x53, - 0x9b, 0xe3, 0xf6, 0x1f, 0xdc, 0xcb, 0xfb, 0x4f, 0xc2, 0xf9, 0x3f, 0xd0, - 0x40, 0xe6, 0xa3, 0x59, 0xab, 0x4c, 0xdb, 0x40, 0xfa, 0x5a, 0x4a, 0x80, - 0x71, 0x62, 0x2f, 0x26, 0x1a, 0xb8, 0x7d, 0x04, 0x0d, 0x80, 0x1f, 0x55, - 0x05, 0xf9, 0xbc, 0x05, 0x7c, 0x7e, 0x50, 0x41, 0x13, 0xb4, 0x31, 0x7d, - 0xe3, 0xe7, 0x49, 0x0f, 0xf2, 0xbf, 0x39, 0x5d, 0x9b, 0xbf, 0x60, 0xf3, - 0xef, 0xae, 0x57, 0x9b, 0x2f, 0x9f, 0x8f, 0xbe, 0x2a, 0xf2, 0x59, 0x78, - 0x86, 0xf4, 0xef, 0xe3, 0xf4, 0xbb, 0xd8, 0x7a, 0x13, 0xe1, 0xf9, 0xed, - 0x51, 0xc9, 0x5f, 0x79, 0x26, 0x8c, 0xa4, 0x50, 0x49, 0x4d, 0x7b, 0xf9, - 0x28, 0x18, 0xac, 0xf0, 0xa7, 0xd0, 0x41, 0x34, 0x60, 0xff, 0x78, 0x09, - 0x95, 0xa7, 0x4c, 0xcf, 0x0c, 0x94, 0x1f, 0x2b, 0xea, 0x4f, 0x01, 0xff, - 0x7a, 0x0a, 0xfb, 0x57, 0x1b, 0xee, 0xaa, 0x3b, 0x7b, 0x6f, 0x02, 0xd8, - 0x0e, 0x28, 0xa6, 0xe0, 0xfe, 0x83, 0xdb, 0xa8, 0x36, 0x7a, 0x4d, 0x68, - 0xbf, 0x3d, 0x70, 0xa2, 0xdd, 0x6d, 0x08, 0x9c, 0x7f, 0xaa, 0xc0, 0x3f, - 0xfa, 0x73, 0xba, 0x3e, 0xfc, 0xb4, 0xe1, 0x34, 0xd2, 0x1f, 0x3b, 0xe0, - 0x4f, 0xc1, 0x7e, 0x64, 0xbe, 0x09, 0x7f, 0x50, 0x69, 0xcd, 0xda, 0xf3, - 0xc9, 0x17, 0xc4, 0xc6, 0x0f, 0xfc, 0xbc, 0xfc, 0x64, 0x51, 0xe8, 0xfa, - 0xd9, 0x7e, 0x78, 0x77, 0x27, 0x85, 0xf3, 0xe0, 0x01, 0xd7, 0x08, 0xfa, - 0x0b, 0xdd, 0x5b, 0x6b, 0x04, 0xcf, 0x27, 0x9b, 0x4f, 0x97, 0x57, 0xf8, - 0xd2, 0x45, 0x20, 0x54, 0x3f, 0xd8, 0x2f, 0xcf, 0xe8, 0xb5, 0xf1, 0x17, - 0xcd, 0x4f, 0xbb, 0x71, 0x76, 0xe9, 0x77, 0x9c, 0x65, 0xfa, 0xab, 0xcf, - 0x32, 0xfd, 0x1b, 0xe8, 0xfe, 0x80, 0x62, 0xbb, 0x1e, 0x17, 0x3f, 0xbe, - 0x2e, 0xf9, 0xa7, 0xa8, 0xf3, 0xb2, 0x24, 0xfc, 0xbc, 0xb0, 0xf3, 0xe0, - 0xbe, 0x23, 0xc5, 0x9b, 0x93, 0x29, 0x44, 0x2f, 0x07, 0xfd, 0x2f, 0xf6, - 0x17, 0xcd, 0x9b, 0x52, 0xc5, 0x6d, 0xbe, 0xbd, 0x3a, 0x7c, 0x33, 0xb3, - 0x9f, 0xbb, 0x8c, 0x86, 0xe4, 0x10, 0xb4, 0x65, 0xa7, 0x93, 0xf9, 0x11, - 0x88, 0x8f, 0x79, 0x9d, 0xa8, 0xf3, 0xed, 0x67, 0x9d, 0x16, 0xf4, 0x2f, - 0x08, 0x7b, 0x69, 0x5a, 0x38, 0xff, 0xcc, 0xbf, 0x27, 0x41, 0x89, 0x9c, - 0x2f, 0xec, 0xaf, 0xa7, 0xae, 0x26, 0xfc, 0x42, 0x7b, 0xbc, 0xe8, 0x62, - 0x84, 0x4e, 0xf9, 0x67, 0xfd, 0x90, 0x63, 0x06, 0xaa, 0x01, 0xc3, 0xf3, - 0xba, 0x31, 0xde, 0x3e, 0xd3, 0xf8, 0xcf, 0x5d, 0x7d, 0xad, 0xa0, 0xcf, - 0xdf, 0xe3, 0xfb, 0xf3, 0x38, 0x8b, 0xa7, 0xb3, 0xc1, 0x78, 0x91, 0xcd, - 0xa7, 0xe7, 0xa1, 0x3f, 0x35, 0xbe, 0x90, 0xe2, 0xbf, 0x0a, 0x84, 0xf9, - 0xe0, 0xb8, 0x16, 0x84, 0x99, 0xfd, 0xf3, 0x1e, 0x32, 0x04, 0xff, 0xc7, - 0xe4, 0x65, 0x81, 0x57, 0xb5, 0x06, 0xb4, 0xd5, 0xde, 0x29, 0x12, 0x3f, - 0x63, 0x7b, 0x31, 0x91, 0xf1, 0xe5, 0x95, 0x11, 0xe4, 0x85, 0x98, 0x5b, - 0x21, 0xec, 0x3f, 0x8f, 0x3f, 0x88, 0xbc, 0xb0, 0xfd, 0xf2, 0xe5, 0x85, - 0xd8, 0x5f, 0x90, 0x0d, 0xc8, 0x0b, 0x2d, 0x20, 0x7f, 0x63, 0xbd, 0x8f, - 0x7f, 0x91, 0x92, 0x3f, 0x63, 0xbf, 0x1c, 0xe7, 0xf2, 0x5a, 0xcf, 0xe2, - 0x8b, 0x06, 0xbc, 0x7e, 0xda, 0xb7, 0x98, 0x3a, 0xcc, 0xe4, 0x53, 0xa7, - 0x07, 0xc7, 0xd1, 0xe3, 0xc9, 0x7a, 0x97, 0x08, 0xfa, 0xce, 0xe4, 0x41, - 0xe5, 0xe5, 0x32, 0x79, 0x11, 0x4b, 0x39, 0x91, 0xf6, 0xe5, 0x91, 0xae, - 0xd0, 0x9f, 0x65, 0xe9, 0x50, 0xfd, 0x27, 0xf2, 0x80, 0xf2, 0x74, 0x9b, - 0x7d, 0x79, 0x20, 0xf1, 0xb6, 0xd5, 0x05, 0xe4, 0x41, 0xd7, 0xf1, 0xbc, - 0xc9, 0xf0, 0x6f, 0x9b, 0x96, 0x3c, 0xde, 0xe4, 0xf2, 0x78, 0x95, 0x3d, - 0xbf, 0x81, 0xc4, 0xc7, 0x54, 0x1e, 0x2f, 0x31, 0x79, 0x3c, 0x2e, 0x8c, - 0xd7, 0x28, 0x0f, 0x30, 0xc4, 0xe4, 0x81, 0x15, 0x70, 0xa2, 0xde, 0x97, - 0x47, 0x7d, 0x85, 0x7e, 0x2c, 0x8f, 0xd3, 0x0f, 0x38, 0x1b, 0xdf, 0x27, - 0xd8, 0x79, 0x42, 0xcd, 0x2c, 0x73, 0x02, 0xf2, 0x60, 0xfe, 0xea, 0x05, - 0x14, 0x8e, 0xa0, 0xf3, 0xd4, 0x3a, 0x2d, 0x79, 0xfc, 0xb2, 0x42, 0x3f, - 0xfa, 0x1a, 0x89, 0xfd, 0xa0, 0xf1, 0x66, 0x33, 0x5c, 0xa7, 0xc1, 0xe4, - 0x3f, 0x04, 0x77, 0xc4, 0x41, 0x71, 0x11, 0xc4, 0x5f, 0xaf, 0x07, 0xe7, - 0xd7, 0xaa, 0x2f, 0xb5, 0xca, 0x07, 0x61, 0x2f, 0x17, 0xed, 0x8d, 0xa0, - 0x2f, 0xdc, 0x1e, 0x33, 0xf9, 0xe0, 0xd1, 0x3d, 0x16, 0xe2, 0x0f, 0xa0, - 0x78, 0x10, 0x46, 0x25, 0xbb, 0x9b, 0x82, 0xf8, 0xb7, 0x4f, 0x4b, 0x3e, - 0xff, 0xeb, 0xdb, 0x1b, 0xf6, 0xfc, 0x5c, 0xe0, 0xfe, 0x68, 0x1b, 0x16, - 0xf3, 0xb7, 0x75, 0x46, 0x70, 0xbc, 0x46, 0x79, 0x78, 0x5c, 0x1e, 0x78, - 0x78, 0x22, 0xeb, 0xcb, 0x23, 0x5b, 0xa1, 0x2f, 0x2b, 0x45, 0x7d, 0x89, - 0xb5, 0xbf, 0x28, 0x40, 0x59, 0xd4, 0x28, 0xd9, 0x5f, 0xfb, 0x26, 0xcb, - 0xc7, 0x6f, 0x9e, 0x96, 0x3c, 0x68, 0x97, 0x45, 0xbf, 0xbf, 0xff, 0x93, - 0x8d, 0x81, 0xfb, 0x6d, 0xce, 0x97, 0x07, 0xb7, 0xb7, 0x8d, 0x61, 0xf1, - 0x23, 0x93, 0xc7, 0xc4, 0x67, 0x22, 0xf2, 0x0d, 0x64, 0x34, 0xc1, 0xe4, - 0x41, 0xe5, 0x55, 0x1c, 0x8c, 0xb4, 0xcf, 0xeb, 0x89, 0x7d, 0x2e, 0x6e, - 0xa6, 0xf9, 0x0d, 0xa6, 0x2f, 0x93, 0xc1, 0xfb, 0x9e, 0x17, 0x89, 0xaf, - 0xa1, 0xfd, 0x1a, 0xb1, 0x40, 0x71, 0x09, 0x2a, 0x73, 0x8f, 0x07, 0xee, - 0x63, 0x18, 0x1f, 0x4d, 0x77, 0x5b, 0x44, 0xfb, 0x74, 0x79, 0x9d, 0xef, - 0x9f, 0xf7, 0xd1, 0x70, 0x39, 0x09, 0x56, 0x2c, 0xdb, 0x6b, 0x80, 0x1d, - 0xfd, 0xae, 0xc1, 0x17, 0xe3, 0xea, 0x1a, 0x8c, 0x87, 0x41, 0xab, 0x9d, - 0xdd, 0x1e, 0x15, 0x4f, 0xe6, 0xb7, 0x41, 0x4f, 0xe2, 0x2e, 0xb7, 0x53, - 0xb9, 0x2c, 0xaa, 0xa0, 0x83, 0x83, 0xfa, 0xe1, 0xf1, 0xad, 0xf0, 0xdf, - 0x9b, 0x0e, 0x3f, 0x84, 0x05, 0x3a, 0xdc, 0x64, 0xbf, 0x40, 0x94, 0xc1, - 0xba, 0x92, 0xe0, 0xdb, 0x2c, 0x5e, 0x85, 0x0f, 0xc7, 0xf1, 0x2a, 0xcb, - 0x17, 0xc1, 0xd3, 0x1a, 0xba, 0x9f, 0x74, 0xdc, 0x1d, 0x10, 0xee, 0xb3, - 0xab, 0xa9, 0xbf, 0x64, 0xf2, 0xd8, 0x2b, 0xdd, 0xf7, 0xf4, 0xc0, 0x7d, - 0x2f, 0xa8, 0xcf, 0xcc, 0xfe, 0x74, 0xae, 0xbe, 0x36, 0x78, 0x7f, 0x74, - 0x99, 0x7c, 0x01, 0x77, 0xf8, 0x03, 0x20, 0x78, 0x5f, 0x62, 0xf2, 0x86, - 0xe7, 0x85, 0x6a, 0xcc, 0xc0, 0x2c, 0xdf, 0x1f, 0x4d, 0x58, 0xbe, 0xfe, - 0x5b, 0x15, 0xf6, 0xc0, 0x89, 0xb1, 0x07, 0xdc, 0x5e, 0x31, 0x7b, 0x80, - 0xb5, 0x73, 0x6f, 0x5d, 0xd0, 0x1e, 0xec, 0x99, 0x01, 0x7b, 0xb0, 0xca, - 0x90, 0xed, 0xc1, 0x24, 0xe1, 0x9f, 0xad, 0x67, 0xff, 0xa9, 0x59, 0x0a, - 0xe7, 0xbf, 0xb8, 0xa3, 0xba, 0x3d, 0x4c, 0xd6, 0xe4, 0x2f, 0xaa, 0xf2, - 0x7f, 0x31, 0xfb, 0xdd, 0x0c, 0x5b, 0xaf, 0x87, 0xfc, 0x4d, 0xc1, 0x4e, - 0xa1, 0xfb, 0x14, 0x89, 0x37, 0x07, 0x92, 0xd3, 0x91, 0xcf, 0x8d, 0x46, - 0x85, 0x3f, 0xd1, 0x04, 0xf9, 0xe4, 0x06, 0x28, 0x6c, 0x49, 0xf1, 0xaf, - 0x44, 0x8f, 0xac, 0xd5, 0x33, 0x58, 0x7e, 0x02, 0xc7, 0x07, 0x30, 0x5e, - 0xb5, 0x1c, 0x60, 0x27, 0x91, 0x3f, 0xcc, 0x7a, 0x16, 0xf2, 0x87, 0xf6, - 0xbb, 0x54, 0x9f, 0x5d, 0x0d, 0xe5, 0x3f, 0x47, 0xc0, 0xd4, 0xf5, 0x97, - 0xc3, 0xfb, 0xa7, 0x0b, 0xba, 0xf5, 0x15, 0x58, 0xe5, 0x1f, 0xd4, 0x4a, - 0xd0, 0x1e, 0x40, 0x6b, 0xb7, 0xbf, 0xcb, 0x04, 0xcf, 0x3c, 0xb2, 0x87, - 0xe4, 0x47, 0x11, 0x66, 0xaf, 0x75, 0x20, 0x81, 0x48, 0x6f, 0x0c, 0xc9, - 0x97, 0xc2, 0x78, 0x9a, 0xd9, 0x57, 0x3d, 0x78, 0x5e, 0x9e, 0x8c, 0xb4, - 0x3f, 0xd2, 0xf9, 0x50, 0xb6, 0xe7, 0x99, 0x58, 0xff, 0x8f, 0x7e, 0xb5, - 0xe5, 0x78, 0xc8, 0xeb, 0xaa, 0xf3, 0xf1, 0x2f, 0x9c, 0x96, 0x3e, 0xdf, - 0xc7, 0xf7, 0x8b, 0xfb, 0xaf, 0x26, 0x61, 0xbf, 0x06, 0x06, 0x9a, 0x54, - 0xf4, 0xf9, 0xc9, 0xaa, 0xf1, 0x60, 0x94, 0x7d, 0x12, 0xcf, 0x73, 0x14, - 0xbf, 0x0f, 0x57, 0x9e, 0x3f, 0x91, 0x5f, 0x30, 0xa5, 0xc2, 0x2f, 0x18, - 0xad, 0x7a, 0xfe, 0xa2, 0xf8, 0xad, 0xed, 0xfc, 0x6d, 0xad, 0x3c, 0x0f, - 0x73, 0x44, 0x7e, 0x07, 0xe6, 0xc4, 0xf9, 0x47, 0xbf, 0x3e, 0x10, 0x61, - 0xcf, 0xc1, 0x7b, 0x58, 0xff, 0x89, 0x43, 0x99, 0x48, 0x31, 0xfe, 0x99, - 0xfd, 0x66, 0xe7, 0xa7, 0x85, 0xe8, 0x7f, 0xab, 0x06, 0xed, 0x31, 0xce, - 0xdf, 0x42, 0x03, 0xdd, 0xdb, 0x90, 0x42, 0x2d, 0xfe, 0x89, 0x15, 0xe4, - 0x3c, 0x9c, 0x24, 0xfd, 0x5d, 0x96, 0x0d, 0x92, 0x36, 0x08, 0x39, 0x0f, - 0x5a, 0xf0, 0x3c, 0x20, 0xf5, 0x6b, 0x40, 0xff, 0x97, 0x5f, 0xc2, 0xe3, - 0x0d, 0x64, 0x82, 0x99, 0x3c, 0x73, 0xa0, 0x1b, 0xac, 0xb2, 0x02, 0xf9, - 0x23, 0x2d, 0xab, 0xd1, 0xfc, 0x78, 0x52, 0xea, 0x9f, 0x4c, 0x84, 0xf9, - 0x07, 0xb2, 0x3f, 0xcf, 0xe9, 0xfe, 0x7e, 0x04, 0xe4, 0xed, 0xc5, 0xdd, - 0xbf, 0xd8, 0x7e, 0xb1, 0x76, 0xe0, 0xa9, 0xb9, 0xe4, 0x79, 0x3c, 0x1e, - 0xa8, 0xd1, 0x5e, 0x0e, 0xb3, 0xf9, 0x73, 0x59, 0xfe, 0x28, 0x8d, 0xe2, - 0x2b, 0x97, 0xd8, 0xc7, 0x1c, 0x1a, 0xcd, 0xd9, 0x26, 0xb0, 0x96, 0x11, - 0x7b, 0x04, 0xd6, 0xb1, 0x7c, 0xf4, 0xa9, 0x79, 0x24, 0xff, 0x04, 0x79, - 0x4f, 0xa5, 0x90, 0x1d, 0x75, 0x87, 0x90, 0x3e, 0xd2, 0xfc, 0xa7, 0xfb, - 0x80, 0x66, 0xc7, 0xec, 0xf7, 0x5e, 0x29, 0x1f, 0x7a, 0x94, 0xdf, 0x7f, - 0x77, 0xb2, 0x7a, 0x10, 0x40, 0xfc, 0xb3, 0xf9, 0x1f, 0xbb, 0x45, 0xf4, - 0xd7, 0xff, 0xcc, 0xe7, 0xb3, 0xfc, 0x5d, 0x9f, 0x45, 0xd6, 0x1f, 0xc0, - 0x27, 0xf2, 0x30, 0xb8, 0x3c, 0x08, 0x3f, 0x29, 0x92, 0xbf, 0x2b, 0xc5, - 0xe7, 0xef, 0xdc, 0x85, 0xc4, 0xfe, 0xb0, 0xfc, 0x43, 0xf1, 0x14, 0xcd, - 0x3f, 0x64, 0x05, 0x7b, 0xe9, 0xe7, 0xdf, 0xc4, 0x7c, 0xe9, 0xd3, 0x3d, - 0xe1, 0xf5, 0x0d, 0xd9, 0xff, 0xb3, 0xf5, 0xa4, 0x23, 0xf2, 0xd1, 0x4c, - 0x3e, 0xf5, 0x52, 0xfe, 0x3a, 0x53, 0x25, 0x7f, 0x9d, 0xa5, 0xe3, 0x39, - 0x96, 0x2c, 0x94, 0xf0, 0xe7, 0x04, 0xe2, 0x1d, 0x2c, 0xdf, 0xc8, 0xfa, - 0x4c, 0x56, 0x13, 0xeb, 0x1b, 0xe1, 0xf9, 0xf0, 0x63, 0x3d, 0x62, 0xbc, - 0x9f, 0xd6, 0xe7, 0x9a, 0x71, 0xf9, 0x73, 0x69, 0x7e, 0x51, 0x71, 0x3e, - 0xa8, 0xa7, 0xf3, 0xd9, 0xf3, 0x66, 0x53, 0x58, 0x9e, 0x4f, 0xd7, 0x57, - 0x7a, 0x74, 0xfc, 0xbd, 0x44, 0x5c, 0x3e, 0xf9, 0x9f, 0xee, 0x50, 0xcb, - 0x27, 0x7f, 0xfe, 0x4f, 0x6a, 0xad, 0x9f, 0xf2, 0xf8, 0x4e, 0x29, 0x3f, - 0xbf, 0xd1, 0x56, 0xe3, 0x67, 0x42, 0x57, 0x9b, 0xff, 0xee, 0x2a, 0x55, - 0xfe, 0xc3, 0xe3, 0x29, 0x5e, 0x3f, 0x90, 0xe8, 0xf7, 0xdd, 0x21, 0xc8, - 0x1f, 0x14, 0xed, 0x6c, 0x6c, 0xbe, 0xf6, 0x17, 0x46, 0x38, 0x3f, 0xb5, - 0xd2, 0xcf, 0xcf, 0xcb, 0xc6, 0xd6, 0x0b, 0xf6, 0x3c, 0xa2, 0xbc, 0xde, - 0x94, 0xca, 0x7e, 0x15, 0x6e, 0x17, 0xf5, 0xd3, 0xae, 0xc2, 0xcf, 0x6f, - 0x34, 0xb5, 0xfd, 0xfa, 0xd7, 0xfd, 0x22, 0xfd, 0x6a, 0xf2, 0x4c, 0x9b, - 0x6a, 0xf4, 0xaf, 0x8f, 0xac, 0xef, 0xd4, 0x4b, 0xf5, 0x0a, 0xe6, 0x8f, - 0x49, 0x7d, 0x8b, 0xdd, 0x8f, 0x4a, 0x1f, 0x5e, 0x48, 0xfc, 0xef, 0x1e, - 0x1b, 0x67, 0x73, 0x3f, 0x35, 0xbf, 0x4f, 0x0b, 0xbb, 0xff, 0xc9, 0xf5, - 0xdc, 0x0c, 0x3b, 0xef, 0xf0, 0x72, 0xe7, 0x2a, 0xac, 0xbf, 0xda, 0x7e, - 0x77, 0xfc, 0x81, 0xda, 0xfa, 0x6f, 0xda, 0x57, 0x25, 0x1f, 0x0e, 0x96, - 0xc4, 0xe5, 0xc3, 0xe1, 0xb5, 0x82, 0xd4, 0x2f, 0x6a, 0x9f, 0xdf, 0x2e, - 0xce, 0x2f, 0x3b, 0xb1, 0xf3, 0x01, 0x98, 0xaf, 0x64, 0x1f, 0x35, 0x6a, - 0x0f, 0xa3, 0xd6, 0x7b, 0xe5, 0x32, 0x35, 0xf9, 0x2c, 0x6e, 0x14, 0xe9, - 0x37, 0xdd, 0xa9, 0xc5, 0xca, 0xff, 0x47, 0x4b, 0xaa, 0x9c, 0xe7, 0xbc, - 0xb8, 0xde, 0xad, 0xf5, 0xe2, 0x79, 0xbe, 0x75, 0x0b, 0xe0, 0xfe, 0x0a, - 0xcf, 0xef, 0x15, 0xe7, 0x8f, 0x49, 0xf3, 0x1b, 0x8e, 0x19, 0xb1, 0xfc, - 0x3c, 0x71, 0xb5, 0xda, 0x7a, 0x6f, 0xa9, 0x53, 0x9b, 0xff, 0xfe, 0x05, - 0x6a, 0xf3, 0xb7, 0xaf, 0x52, 0x9b, 0xff, 0xf7, 0x8a, 0xf5, 0xce, 0x53, - 0x59, 0x45, 0xff, 0xb1, 0x46, 0x6d, 0xfe, 0x86, 0x9b, 0xa6, 0xd7, 0x3f, - 0xc4, 0xf0, 0xdf, 0xbc, 0x41, 0xed, 0x79, 0x5f, 0xf8, 0xa1, 0xa1, 0x76, - 0x9e, 0x7f, 0xac, 0x36, 0xff, 0xd8, 0x6b, 0x6a, 0xf3, 0xbf, 0xfb, 0x49, - 0x35, 0xfe, 0xbf, 0xf5, 0xac, 0x1a, 0xfd, 0x6d, 0x8a, 0xf6, 0x7b, 0x22, - 0x19, 0x3e, 0x5f, 0x07, 0xa3, 0x47, 0x49, 0x7d, 0x8e, 0xc6, 0x9f, 0x20, - 0x23, 0xc4, 0xaf, 0x7e, 0x7d, 0x82, 0xf5, 0x63, 0x44, 0xc4, 0xc3, 0xc5, - 0x25, 0x62, 0x3c, 0xec, 0xb2, 0x78, 0x58, 0xac, 0x67, 0x07, 0xe2, 0x61, - 0x2d, 0xee, 0xbe, 0xf7, 0x9f, 0x16, 0xa5, 0xef, 0xa2, 0xf8, 0x78, 0x2f, - 0xc4, 0x18, 0xd0, 0x8a, 0xc3, 0xda, 0x78, 0xd4, 0xfc, 0x46, 0xc5, 0xf3, - 0xf8, 0x6f, 0x49, 0xa9, 0xbf, 0x41, 0x75, 0xbe, 0xe5, 0xc4, 0xd6, 0xaf, - 0x0f, 0xd7, 0xfc, 0xfd, 0x89, 0x86, 0x69, 0xc5, 0x7f, 0x7f, 0x11, 0x11, - 0x0f, 0xf1, 0x4a, 0x3d, 0x8d, 0xd7, 0x51, 0x3d, 0x27, 0x83, 0xce, 0x3a, - 0xed, 0x1f, 0xc2, 0xfe, 0xd8, 0x4d, 0x66, 0x82, 0xf4, 0x55, 0xea, 0xfb, - 0x3a, 0xb8, 0x3a, 0xb6, 0xbe, 0x5f, 0x59, 0xef, 0x1d, 0x95, 0xf2, 0x5f, - 0x5c, 0x9f, 0xc2, 0xf3, 0x5d, 0x92, 0x7e, 0x99, 0x54, 0xbf, 0x72, 0xed, - 0xd5, 0xea, 0xbf, 0x54, 0xdf, 0x72, 0xac, 0x20, 0xc7, 0xfc, 0xff, 0x2e, - 0xe1, 0xf9, 0x5e, 0xc7, 0x09, 0xcd, 0x6d, 0xbd, 0x30, 0x35, 0x66, 0x92, - 0xe7, 0xbb, 0xc0, 0x25, 0xfd, 0x60, 0x53, 0x9b, 0x40, 0xe9, 0x00, 0xa9, - 0x47, 0xea, 0xb3, 0x71, 0x84, 0x46, 0xdf, 0xdf, 0xba, 0x8f, 0x25, 0xb0, - 0xc9, 0xfb, 0x90, 0x3d, 0x50, 0x23, 0x71, 0x89, 0x49, 0xf3, 0xbc, 0x59, - 0xb6, 0x5f, 0x6f, 0x40, 0xfb, 0xa2, 0x83, 0x71, 0x96, 0x8f, 0x76, 0x07, - 0x59, 0x3f, 0x5d, 0xce, 0xc2, 0xfd, 0x74, 0x88, 0xfe, 0xf6, 0xf9, 0xe3, - 0x68, 0x7e, 0x72, 0x6e, 0x90, 0xfe, 0x45, 0x22, 0xfd, 0x5e, 0xe0, 0x8d, - 0x22, 0xfa, 0xae, 0xe6, 0xe5, 0x11, 0xfd, 0x6a, 0xfd, 0x20, 0xa1, 0xf9, - 0xc2, 0x2e, 0x9c, 0xef, 0xb5, 0x49, 0xfd, 0x9a, 0x6d, 0x65, 0x7d, 0x98, - 0x7e, 0xd1, 0x7a, 0x5f, 0xf9, 0x23, 0x9d, 0xd5, 0x2b, 0xbe, 0xc8, 0x42, - 0x8a, 0x88, 0x7c, 0x0f, 0x92, 0x30, 0xfa, 0xa2, 0x81, 0x05, 0xf0, 0xb3, - 0xa4, 0xf5, 0xe8, 0x15, 0xf4, 0xd8, 0xfa, 0xbc, 0x0f, 0xc3, 0xd6, 0x27, - 0xe7, 0xab, 0x51, 0x3f, 0xcb, 0x72, 0xd4, 0xcf, 0x82, 0xf8, 0x4f, 0xe0, - 0x7e, 0x16, 0xc6, 0x8f, 0x15, 0xc5, 0x3f, 0xd9, 0xbf, 0xab, 0x79, 0x7f, - 0x1c, 0x00, 0xfb, 0x0c, 0x1f, 0x1f, 0x65, 0xe0, 0x5d, 0x0d, 0xf3, 0x6b, - 0x55, 0xf2, 0x0b, 0xc0, 0x75, 0xb2, 0xfc, 0xc9, 0xfb, 0x7b, 0x63, 0x86, - 0x57, 0x34, 0xec, 0x48, 0x7f, 0xf5, 0x92, 0x19, 0x1d, 0xbf, 0xa0, 0x9f, - 0x9f, 0x4d, 0xc4, 0xdf, 0xbf, 0x7f, 0x3e, 0x31, 0xbd, 0xfe, 0xb1, 0x6a, - 0xe7, 0xcb, 0x84, 0xe7, 0x6b, 0x95, 0x19, 0x3c, 0x5f, 0x51, 0xf9, 0x8b, - 0xf0, 0xf3, 0xc4, 0xf7, 0xc3, 0x9a, 0x8f, 0xf5, 0x19, 0x3d, 0xd0, 0x4d, - 0xdb, 0x75, 0x1d, 0xf5, 0xcb, 0x40, 0xa9, 0x11, 0x1c, 0xb0, 0x33, 0x19, - 0x43, 0xaf, 0x1f, 0xfe, 0xa2, 0x36, 0x3c, 0xa0, 0xd9, 0x23, 0xda, 0x78, - 0xcb, 0xd3, 0x76, 0x69, 0xfb, 0xdf, 0x2d, 0xf4, 0x3a, 0xe0, 0x6d, 0x68, - 0xff, 0xac, 0x84, 0x97, 0xf6, 0x96, 0x90, 0x75, 0x58, 0x6d, 0x39, 0x9c, - 0x87, 0x18, 0x9e, 0x8f, 0xf8, 0xf3, 0xbe, 0x43, 0x2c, 0x89, 0x67, 0x7e, - 0xc3, 0x2e, 0x19, 0xe8, 0x3e, 0x6e, 0x31, 0xfb, 0x72, 0xb3, 0xf0, 0x3e, - 0x7b, 0xd5, 0xfe, 0x63, 0xde, 0xff, 0xf4, 0x36, 0x3e, 0xef, 0xfe, 0x6b, - 0x98, 0x2b, 0x88, 0xbe, 0xd1, 0x7c, 0x79, 0xe2, 0x41, 0xde, 0x2f, 0x61, - 0x94, 0x70, 0x7e, 0x2f, 0x0f, 0x8a, 0x24, 0xbf, 0xa7, 0x17, 0x1b, 0x53, - 0x43, 0x06, 0xd1, 0xf0, 0x1d, 0x00, 0xac, 0x67, 0xe7, 0x23, 0x87, 0xf5, - 0x4b, 0x13, 0xf1, 0xd1, 0x6e, 0xb8, 0x69, 0xb1, 0x3f, 0x01, 0x80, 0xaf, - 0x25, 0x51, 0xbf, 0x14, 0x14, 0xf6, 0x38, 0xb5, 0x9c, 0xa5, 0xc5, 0x09, - 0xb6, 0x1f, 0x69, 0x30, 0x1d, 0x7b, 0x2e, 0xe7, 0x73, 0xfe, 0xfd, 0xa0, - 0xd4, 0xff, 0xc9, 0xfa, 0x71, 0x35, 0x50, 0x9c, 0x8f, 0x16, 0x5d, 0x1c, - 0x4a, 0xbb, 0x39, 0xa4, 0x9f, 0x6d, 0xa9, 0x60, 0x3e, 0x1d, 0x5e, 0x92, - 0x3c, 0xb7, 0x55, 0xf9, 0x79, 0xde, 0xdb, 0x07, 0x85, 0xfc, 0x0f, 0xf8, - 0xd5, 0xc1, 0x78, 0xfd, 0xfd, 0xef, 0x83, 0xd3, 0xec, 0xef, 0x94, 0xea, - 0x87, 0x56, 0xc8, 0xfe, 0xa5, 0x51, 0xac, 0xfc, 0x82, 0x18, 0xcf, 0xff, - 0xad, 0xc9, 0xe8, 0x75, 0xeb, 0xc4, 0x5f, 0x33, 0x7f, 0xb2, 0x4b, 0xf2, - 0x2f, 0xbc, 0xbf, 0x5c, 0xa8, 0xef, 0xfd, 0x4f, 0xfc, 0x7a, 0xf8, 0xf3, - 0x7d, 0x87, 0xb7, 0x92, 0x9d, 0x37, 0x01, 0xf6, 0xbf, 0x67, 0x46, 0x61, - 0xbf, 0x7e, 0x9c, 0xa3, 0xf2, 0x17, 0xc6, 0x2b, 0xec, 0x1b, 0xc9, 0x6e, - 0x26, 0x02, 0xf5, 0x38, 0xf4, 0x73, 0x72, 0xa6, 0xf5, 0xe7, 0x03, 0x79, - 0x7f, 0x98, 0xfe, 0xb8, 0xa0, 0xf8, 0xf1, 0xd6, 0xed, 0x3a, 0x7d, 0x3e, - 0xa4, 0x77, 0x95, 0xa8, 0x3f, 0xf2, 0xf7, 0xd0, 0x6a, 0xd4, 0x9f, 0x0f, - 0xcf, 0x95, 0xfe, 0x48, 0xfd, 0x31, 0x96, 0xbc, 0x3f, 0x10, 0xdd, 0x42, - 0x2d, 0x42, 0x5e, 0xa4, 0xfe, 0x18, 0x24, 0x7e, 0x1b, 0xd0, 0xa4, 0x7c, - 0xad, 0xa4, 0x4f, 0x82, 0xfe, 0x80, 0xc4, 0xa1, 0x6a, 0xfa, 0xb3, 0x52, - 0xca, 0x37, 0xd3, 0x7a, 0x79, 0x65, 0x7d, 0xc7, 0x10, 0xe3, 0x6b, 0xb8, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Aug 17 01:57:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75C41BBCE2E; Wed, 17 Aug 2016 01:57:59 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50E39152C; Wed, 17 Aug 2016 01:57:59 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H1vwGt082021; Wed, 17 Aug 2016 01:57:58 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H1vwrg082020; Wed, 17 Aug 2016 01:57:58 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201608170157.u7H1vwrg082020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 17 Aug 2016 01:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304248 - head/sys/dev/qlxgbe 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 01:57:59 -0000 Author: davidcs Date: Wed Aug 17 01:57:58 2016 New Revision: 304248 URL: https://svnweb.freebsd.org/changeset/base/304248 Log: Add ql_minidump.h MFC after:5 days Added: head/sys/dev/qlxgbe/ql_minidump.h (contents, props changed) Added: head/sys/dev/qlxgbe/ql_minidump.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/qlxgbe/ql_minidump.h Wed Aug 17 01:57:58 2016 (r304248) @@ -0,0 +1,470 @@ +/* + * Copyright (c) 2013-2016 Qlogic Corporation + * 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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. + */ + +/* + * File: ql_minidump.h + * + * $FreeBSD$ + */ +#ifndef _QL_MINIDUMP_H_ +#define _QL_MINIDUMP_H_ + +#define QL_DBG_STATE_ARRAY_LEN 16 +#define QL_DBG_CAP_SIZE_ARRAY_LEN 8 +#define QL_NO_OF_OCM_WINDOWS 16 + + +typedef struct ql_mdump_tmplt_hdr { + uint32_t entry_type ; + uint32_t first_entry_offset ; + uint32_t size_of_template ; + uint32_t recommended_capture_mask; + + uint32_t num_of_entries ; + uint32_t version ; + uint32_t driver_timestamp ; + uint32_t checksum ; + + uint32_t driver_capture_mask ; + uint32_t driver_info_word2 ; + uint32_t driver_info_word3 ; + uint32_t driver_info_word4 ; + + uint32_t saved_state_array[QL_DBG_STATE_ARRAY_LEN] ; + uint32_t capture_size_array[QL_DBG_CAP_SIZE_ARRAY_LEN] ; + + uint32_t ocm_window_array[QL_NO_OF_OCM_WINDOWS] ; +} ql_minidump_template_hdr_t ; + +/* + * MIU AGENT ADDRESSES. + */ + +#define MD_TA_CTL_ENABLE 0x2 +#define MD_TA_CTL_START 0x1 +#define MD_TA_CTL_BUSY 0x8 +#define MD_TA_CTL_CHECK 1000 + +#define MD_MIU_TEST_AGT_CTRL 0x41000090 +#define MD_MIU_TEST_AGT_ADDR_LO 0x41000094 +#define MD_MIU_TEST_AGT_ADDR_HI 0x41000098 + +#define MD_MIU_TEST_AGT_RDDATA_0_31 0x410000A8 +#define MD_MIU_TEST_AGT_RDDATA_32_63 0x410000AC +#define MD_MIU_TEST_AGT_RDDATA_64_95 0x410000B8 +#define MD_MIU_TEST_AGT_RDDATA_96_127 0x410000BC + +#define MD_MIU_TEST_AGT_WRDATA_0_31 0x410000A0 +#define MD_MIU_TEST_AGT_WRDATA_32_63 0x410000A4 +#define MD_MIU_TEST_AGT_WRDATA_64_95 0x410000B0 +#define MD_MIU_TEST_AGT_WRDATA_96_127 0x410000B4 + +/* + * ROM Read Address + */ + +#define MD_DIRECT_ROM_WINDOW 0x42110030 +#define MD_DIRECT_ROM_READ_BASE 0x42150000 + +/* + * Entry Type Defines + */ + +#define RDNOP 0 +#define RDCRB 1 +#define RDMUX 2 +#define QUEUE 3 +#define BOARD 4 +#define RDOCM 6 +#define L1DAT 11 +#define L1INS 12 +#define L2DTG 21 +#define L2ITG 22 +#define L2DAT 23 +#define L2INS 24 +#define POLLRD 35 +#define RDMUX2 36 +#define POLLRDMWR 37 +#define RDROM 71 +#define RDMEM 72 +#define CNTRL 98 +#define TLHDR 99 +#define RDEND 255 + +/* + * Index of State Table. The Template header maintains + * an array of 8 (0..7) words that is used to store some + * "State Information" from the board. + */ + +#define QL_PCIE_FUNC_INDX 0 +#define QL_CLK_STATE_INDX 1 +#define QL_SRE_STATE_INDX 2 +#define QL_OCM0_ADDR_INDX 3 + +#define QL_REVID_STATE_INDX 4 +#define QL_MAJVER_STATE_INDX 5 +#define QL_MINVER_STATE_INDX 6 +#define QL_SUBVER_STATE_INDX 7 + +/* + * Opcodes for Control Entries. + * These Flags are bit fields. + */ + +#define QL_DBG_OPCODE_WR 0x01 +#define QL_DBG_OPCODE_RW 0x02 +#define QL_DBG_OPCODE_AND 0x04 +#define QL_DBG_OPCODE_OR 0x08 +#define QL_DBG_OPCODE_POLL 0x10 +#define QL_DBG_OPCODE_RDSTATE 0x20 +#define QL_DBG_OPCODE_WRSTATE 0x40 +#define QL_DBG_OPCODE_MDSTATE 0x80 + +typedef struct ql_minidump_entry_hdr_s { + uint32_t entry_type ; + uint32_t entry_size ; + uint32_t entry_capture_size ; + union { + struct { + uint8_t entry_capture_mask ; + uint8_t entry_code ; + uint8_t driver_code ; + uint8_t driver_flags ; + }; + uint32_t entry_ctrl_word ; + }; +} ql_minidump_entry_hdr_t ; + +/* + * Driver Flags + */ +#define QL_DBG_SKIPPED_FLAG 0x80 /* driver skipped this entry */ +#define QL_DBG_SIZE_ERR_FLAG 0x40 /* entry size vs capture size mismatch*/ + +/* + * Generic Entry Including Header + */ + +typedef struct ql_minidump_entry_s { + ql_minidump_entry_hdr_t hdr ; + + uint32_t entry_data00 ; + uint32_t entry_data01 ; + uint32_t entry_data02 ; + uint32_t entry_data03 ; + + uint32_t entry_data04 ; + uint32_t entry_data05 ; + uint32_t entry_data06 ; + uint32_t entry_data07 ; +} ql_minidump_entry_t; + +/* + * Read CRB Entry Header + */ + +typedef struct ql_minidump_entry_rdcrb_s { + ql_minidump_entry_hdr_t h; + + uint32_t addr ; + union { + struct { + uint8_t addr_stride ; + uint8_t rsvd_0; + uint16_t rsvd_1 ; + } ; + uint32_t addr_cntrl ; + } ; + + uint32_t data_size ; + uint32_t op_count; + + uint32_t rsvd_2 ; + uint32_t rsvd_3 ; + uint32_t rsvd_4 ; + uint32_t rsvd_5 ; + +} ql_minidump_entry_rdcrb_t ; + +/* + * Cache Entry Header + */ + +typedef struct ql_minidump_entry_cache_s { + ql_minidump_entry_hdr_t h; + + uint32_t tag_reg_addr ; + union { + struct { + uint16_t tag_value_stride ; + uint16_t init_tag_value ; + } ; + uint32_t select_addr_cntrl ; + } ; + + uint32_t data_size ; + uint32_t op_count; + + uint32_t control_addr ; + union { + struct { + uint16_t write_value ; + uint8_t poll_mask ; + uint8_t poll_wait ; + }; + uint32_t control_value ; + } ; + + uint32_t read_addr ; + union { + struct { + uint8_t read_addr_stride ; + uint8_t read_addr_cnt ; + uint16_t rsvd_1 ; + } ; + uint32_t read_addr_cntrl ; + } ; +} ql_minidump_entry_cache_t ; + + +/* + * Read OCM Entry Header + */ + +typedef struct ql_minidump_entry_rdocm_s { + ql_minidump_entry_hdr_t h; + + uint32_t rsvd_0 ; + uint32_t rsvd_1 ; + + uint32_t data_size ; + uint32_t op_count; + + uint32_t rsvd_2 ; + uint32_t rsvd_3 ; + + uint32_t read_addr ; + uint32_t read_addr_stride ; + +} ql_minidump_entry_rdocm_t ; + +/* + * Read MEM Entry Header + */ + +typedef struct ql_minidump_entry_rdmem_s { + ql_minidump_entry_hdr_t h; + + uint32_t rsvd_0[6] ; + + uint32_t read_addr ; + uint32_t read_data_size ; + +} ql_minidump_entry_rdmem_t ; + +/* + * Read ROM Entry Header + */ + +typedef struct ql_minidump_entry_rdrom_s { + ql_minidump_entry_hdr_t h; + + uint32_t rsvd_0[6] ; + + uint32_t read_addr ; + uint32_t read_data_size ; + +} ql_minidump_entry_rdrom_t ; + +/* + * Read MUX Entry Header + */ + +typedef struct ql_minidump_entry_mux_s { + ql_minidump_entry_hdr_t h; + + uint32_t select_addr ; + union { + struct { + uint32_t rsvd_0 ; + } ; + uint32_t select_addr_cntrl ; + } ; + + uint32_t data_size ; + uint32_t op_count; + + uint32_t select_value ; + uint32_t select_value_stride ; + + uint32_t read_addr ; + uint32_t rsvd_1 ; + +} ql_minidump_entry_mux_t ; + +/* + * Read MUX2 Entry Header + */ + +typedef struct ql_minidump_entry_mux2_s { + ql_minidump_entry_hdr_t h; + + uint32_t select_addr_1; + uint32_t select_addr_2; + uint32_t select_value_1; + uint32_t select_value_2; + uint32_t select_value_count; + uint32_t select_value_mask; + uint32_t read_addr; + union { + struct { + uint8_t select_value_stride; + uint8_t data_size; + uint8_t reserved_0; + uint8_t reserved_1; + }; + uint32_t select_addr_value_cntrl; + }; + +} ql_minidump_entry_mux2_t; + +/* + * Read QUEUE Entry Header + */ + +typedef struct ql_minidump_entry_queue_s { + ql_minidump_entry_hdr_t h; + + uint32_t select_addr ; + union { + struct { + uint16_t queue_id_stride ; + uint16_t rsvd_0 ; + } ; + uint32_t select_addr_cntrl ; + } ; + + uint32_t data_size ; + uint32_t op_count ; + + uint32_t rsvd_1 ; + uint32_t rsvd_2 ; + + uint32_t read_addr ; + union { + struct { + uint8_t read_addr_stride ; + uint8_t read_addr_cnt ; + uint16_t rsvd_3 ; + } ; + uint32_t read_addr_cntrl ; + } ; + +} ql_minidump_entry_queue_t ; + +/* + * Control Entry Header + */ + +typedef struct ql_minidump_entry_cntrl_s { + ql_minidump_entry_hdr_t h; + + uint32_t addr ; + union { + struct { + uint8_t addr_stride ; + uint8_t state_index_a ; + uint16_t poll_timeout ; + } ; + uint32_t addr_cntrl ; + } ; + + uint32_t data_size ; + uint32_t op_count; + + union { + struct { + uint8_t opcode ; + uint8_t state_index_v ; + uint8_t shl ; + uint8_t shr ; + } ; + uint32_t control_value ; + } ; + + uint32_t value_1 ; + uint32_t value_2 ; + uint32_t value_3 ; +} ql_minidump_entry_cntrl_t ; + +/* + * Read with poll. + */ + +typedef struct ql_minidump_entry_rdcrb_with_poll_s { + ql_minidump_entry_hdr_t h; + + uint32_t select_addr; + uint32_t read_addr; + uint32_t select_value; + union { + struct { + uint16_t select_value_stride; + uint16_t op_count; + }; + uint32_t select_value_cntrl; + }; + + uint32_t poll; + uint32_t mask; + + uint32_t data_size; + uint32_t rsvd_0; + +} ql_minidump_entry_pollrd_t; + +/* + * Read_Modify_Write with poll. + */ + +typedef struct ql_minidump_entry_rd_modify_wr_with_poll_s { + ql_minidump_entry_hdr_t h; + + uint32_t addr_1; + uint32_t addr_2; + uint32_t value_1; + uint32_t value_2; + uint32_t poll; + uint32_t mask; + uint32_t modify_mask; + uint32_t data_size; + +} ql_minidump_entry_rd_modify_wr_with_poll_t; + +#endif /* #ifndef _QL_MINIDUMP_H_ */ + From owner-svn-src-all@freebsd.org Wed Aug 17 02:22:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 204A8BBC6D6; Wed, 17 Aug 2016 02:22:55 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (glebi.us [96.95.210.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 08E1315C6; Wed, 17 Aug 2016 02:22:54 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id u7H2MrxE006924 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 16 Aug 2016 19:22:53 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u7H2Mrbw006923; Tue, 16 Aug 2016 19:22:53 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 16 Aug 2016 19:22:53 -0700 From: Gleb Smirnoff To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r303646 - head/sys/ofed/drivers/infiniband/ulp/ipoib Message-ID: <20160817022253.GD1069@FreeBSD.org> References: <201608012222.u71MMB4E018482@repo.freebsd.org> <20160817000953.GB1069@FreeBSD.org> <20160817004128.GB94062@wkstn-mjohnston.west.isilon.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160817004128.GB94062@wkstn-mjohnston.west.isilon.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 02:22:55 -0000 On Tue, Aug 16, 2016 at 05:41:28PM -0700, Mark Johnston wrote: M> > M> Log: M> > M> ipoib: Bound the number of egress mbufs buffered during pathrec lookups. M> > M> M> > M> In pathological situations where the master subnet manager becomes M> > M> unresponsive for an extended period, we may otherwise end up queuing all M> > M> of the system's mbufs while waiting for a response to a path record lookup. M> > M> M> > M> This addresses the same issue as commit 1e85b806f9 in Linux. M> > M> M> > M> Reviewed by: cem, ngie M> > M> MFC after: 2 weeks M> > M> Sponsored by: EMC / Isilon Storage Division M> > M> M> > M> Modified: M> > M> head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c M> > M> M> > M> Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c M> > M> ============================================================================== M> > M> --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 1 22:19:23 2016 (r303645) M> > M> +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Mon Aug 1 22:22:11 2016 (r303646) M> > M> @@ -660,7 +660,13 @@ ipoib_unicast_send(struct mbuf *mb, stru M> > M> new_path = 1; M> > M> } M> > M> if (path) { M> > M> - _IF_ENQUEUE(&path->queue, mb); M> > M> + if (_IF_QLEN(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) M> > M> + _IF_ENQUEUE(&path->queue, mb); M> > M> + else { M> > M> + if_inc_counter(priv->dev, IFCOUNTER_OERRORS, 1); M> > M> + m_freem(mb); M> > M> + } M> > M> > Shouldn't that be IFCOUNTER_ODROPS? M> M> I'm not sure. I used IFCOUNTER_OERRORS to be consistent with other error M> cases in this function. This error case doesn't represent the normal M> source of outbound packet drops but rather indicates that a key routing M> agent on the network is not responding. OQDROPS seems like it's M> specifically for the case that we can't buffer packets because the M> transmitter isn't keeping up. I see. The fact that this is an if_queue has confused me. I expected that it is an ifqueue belonging to an ifnet. btw, may be this ifqueue can be reduced to mbufq. -- Totus tuus, Glebius. From owner-svn-src-all@freebsd.org Wed Aug 17 02:40:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94DD2BBCAA2; Wed, 17 Aug 2016 02:40:19 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66C041BE1; Wed, 17 Aug 2016 02:40:19 +0000 (UTC) (envelope-from davidcs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H2eIWN097690; Wed, 17 Aug 2016 02:40:18 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H2eIED097684; Wed, 17 Aug 2016 02:40:18 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201608170240.u7H2eIED097684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Wed, 17 Aug 2016 02:40:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304249 - head/sys/dev/qlxgbe 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 02:40:19 -0000 Author: davidcs Date: Wed Aug 17 02:40:17 2016 New Revision: 304249 URL: https://svnweb.freebsd.org/changeset/base/304249 Log: Add support for set/get cam search mode MFC after: 5 days Modified: head/sys/dev/qlxgbe/ql_dbg.h head/sys/dev/qlxgbe/ql_hw.c head/sys/dev/qlxgbe/ql_hw.h head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxgbe/ql_ver.h Modified: head/sys/dev/qlxgbe/ql_dbg.h ============================================================================== --- head/sys/dev/qlxgbe/ql_dbg.h Wed Aug 17 01:57:58 2016 (r304248) +++ head/sys/dev/qlxgbe/ql_dbg.h Wed Aug 17 02:40:17 2016 (r304249) @@ -52,6 +52,7 @@ extern void ql_dump_buf32(qla_host_t *ha #define INJCT_MBX_CMD_FAILURE 0x00008 #define INJCT_HEARTBEAT_FAILURE 0x00009 #define INJCT_TEMPERATURE_FAILURE 0x0000A +#define INJCT_M_GETCL_M_GETJCL_FAILURE 0x0000B #ifdef QL_DBG Modified: head/sys/dev/qlxgbe/ql_hw.c ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.c Wed Aug 17 01:57:58 2016 (r304248) +++ head/sys/dev/qlxgbe/ql_hw.c Wed Aug 17 02:40:17 2016 (r304249) @@ -74,6 +74,8 @@ static int qla_query_fw_dcbx_caps(qla_ho static int qla_set_port_config(qla_host_t *ha, uint32_t cfg_bits); static int qla_get_port_config(qla_host_t *ha, uint32_t *cfg_bits); static void qla_get_quick_stats(qla_host_t *ha); +static int qla_set_cam_search_mode(qla_host_t *ha, uint32_t search_mode); +static int qla_get_cam_search_mode(qla_host_t *ha); static void ql_minidump_free(qla_host_t *ha); @@ -94,11 +96,22 @@ qla_sysctl_get_drvr_stats(SYSCTL_HANDLER ha = (qla_host_t *)arg1; - for (i = 0; i < ha->hw.num_sds_rings; i++) + for (i = 0; i < ha->hw.num_sds_rings; i++) { + device_printf(ha->pci_dev, "%s: sds_ring[%d] = %p\n", __func__,i, (void *)ha->hw.sds[i].intr_count); + device_printf(ha->pci_dev, + "%s: sds_ring[%d].spurious_intr_count = %p\n", + __func__, + i, (void *)ha->hw.sds[i].spurious_intr_count); + + device_printf(ha->pci_dev, + "%s: sds_ring[%d].rx_free = %d\n", __func__,i, + ha->hw.sds[i].rx_free); + } + for (i = 0; i < ha->hw.num_tx_rings; i++) device_printf(ha->pci_dev, "%s: tx[%d] = %p\n", __func__,i, @@ -255,6 +268,47 @@ qla_sysctl_set_port_cfg_exit: return err; } +static int +qla_sysctl_set_cam_search_mode(SYSCTL_HANDLER_ARGS) +{ + int err, ret = 0; + qla_host_t *ha; + + err = sysctl_handle_int(oidp, &ret, 0, req); + + if (err || !req->newptr) + return (err); + + ha = (qla_host_t *)arg1; + + if ((ret == Q8_HW_CONFIG_CAM_SEARCH_MODE_INTERNAL) || + (ret == Q8_HW_CONFIG_CAM_SEARCH_MODE_AUTO)) { + err = qla_set_cam_search_mode(ha, (uint32_t)ret); + } else { + device_printf(ha->pci_dev, "%s: ret = %d\n", __func__, ret); + } + + return (err); +} + +static int +qla_sysctl_get_cam_search_mode(SYSCTL_HANDLER_ARGS) +{ + int err, ret = 0; + qla_host_t *ha; + + err = sysctl_handle_int(oidp, &ret, 0, req); + + if (err || !req->newptr) + return (err); + + ha = (qla_host_t *)arg1; + err = qla_get_cam_search_mode(ha); + + return (err); +} + + /* * Name: ql_hw_add_sysctls * Function: Add P3Plus specific sysctls @@ -362,6 +416,24 @@ ql_hw_add_sysctls(qla_host_t *ha) " 1 = xmt only; 2 = rcv only;\n" ); + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "set_cam_search_mode", CTLTYPE_INT | CTLFLAG_RW, + (void *)ha, 0, + qla_sysctl_set_cam_search_mode, "I", + "Set CAM Search Mode" + "\t 1 = search mode internal\n" + "\t 2 = search mode auto\n"); + + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), + OID_AUTO, "get_cam_search_mode", CTLTYPE_INT | CTLFLAG_RW, + (void *)ha, 0, + qla_sysctl_get_cam_search_mode, "I", + "Get CAM Search Mode" + "\t 1 = search mode internal\n" + "\t 2 = search mode auto\n"); + ha->hw.enable_9kb = 1; SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), @@ -407,7 +479,8 @@ ql_hw_add_sysctls(qla_host_t *ha) "\t\t\t 7: ocm: offchip memory rd_wr failure\n" "\t\t\t 8: mbx: mailbox command failure\n" "\t\t\t 9: heartbeat failure\n" - "\t\t\t A: temperature failure\n" ); + "\t\t\t A: temperature failure\n" + "\t\t\t 11: m_getcl or m_getjcl failure\n" ); SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), @@ -1299,6 +1372,85 @@ qla_config_fw_lro(qla_host_t *ha, uint16 return 0; } +static int +qla_set_cam_search_mode(qla_host_t *ha, uint32_t search_mode) +{ + device_t dev; + q80_hw_config_t *hw_config; + q80_hw_config_rsp_t *hw_config_rsp; + uint32_t err; + + dev = ha->pci_dev; + + hw_config = (q80_hw_config_t *)ha->hw.mbox; + bzero(hw_config, sizeof (q80_hw_config_t)); + + hw_config->opcode = Q8_MBX_HW_CONFIG; + hw_config->count_version = Q8_HW_CONFIG_SET_CAM_SEARCH_MODE_COUNT; + hw_config->count_version |= Q8_MBX_CMD_VERSION; + + hw_config->cmd = Q8_HW_CONFIG_SET_CAM_SEARCH_MODE; + + hw_config->u.set_cam_search_mode.mode = search_mode; + + if (qla_mbx_cmd(ha, (uint32_t *)hw_config, + (sizeof (q80_hw_config_t) >> 2), + ha->hw.mbox, (sizeof (q80_hw_config_rsp_t) >> 2), 0)) { + device_printf(dev, "%s: failed\n", __func__); + return -1; + } + hw_config_rsp = (q80_hw_config_rsp_t *)ha->hw.mbox; + + err = Q8_MBX_RSP_STATUS(hw_config_rsp->regcnt_status); + + if (err) { + device_printf(dev, "%s: failed [0x%08x]\n", __func__, err); + } + + return 0; +} + +static int +qla_get_cam_search_mode(qla_host_t *ha) +{ + device_t dev; + q80_hw_config_t *hw_config; + q80_hw_config_rsp_t *hw_config_rsp; + uint32_t err; + + dev = ha->pci_dev; + + hw_config = (q80_hw_config_t *)ha->hw.mbox; + bzero(hw_config, sizeof (q80_hw_config_t)); + + hw_config->opcode = Q8_MBX_HW_CONFIG; + hw_config->count_version = Q8_HW_CONFIG_GET_CAM_SEARCH_MODE_COUNT; + hw_config->count_version |= Q8_MBX_CMD_VERSION; + + hw_config->cmd = Q8_HW_CONFIG_GET_CAM_SEARCH_MODE; + + if (qla_mbx_cmd(ha, (uint32_t *)hw_config, + (sizeof (q80_hw_config_t) >> 2), + ha->hw.mbox, (sizeof (q80_hw_config_rsp_t) >> 2), 0)) { + device_printf(dev, "%s: failed\n", __func__); + return -1; + } + hw_config_rsp = (q80_hw_config_rsp_t *)ha->hw.mbox; + + err = Q8_MBX_RSP_STATUS(hw_config_rsp->regcnt_status); + + if (err) { + device_printf(dev, "%s: failed [0x%08x]\n", __func__, err); + } else { + device_printf(dev, "%s: cam search mode [0x%08x]\n", __func__, + hw_config_rsp->u.get_cam_search_mode.mode); + } + + return 0; +} + + + static void qla_xmt_stats(qla_host_t *ha, q80_xmt_stats_t *xstat, int i) { Modified: head/sys/dev/qlxgbe/ql_hw.h ============================================================================== --- head/sys/dev/qlxgbe/ql_hw.h Wed Aug 17 01:57:58 2016 (r304248) +++ head/sys/dev/qlxgbe/ql_hw.h Wed Aug 17 02:40:17 2016 (r304249) @@ -255,6 +255,7 @@ #define Q8_MBX_LINK_EVENT_REQ 0x0048 #define Q8_MBX_CONFIG_MAC_RX_MODE 0x0049 #define Q8_MBX_CONFIG_FW_LRO 0x004A +#define Q8_MBX_HW_CONFIG 0x004C #define Q8_MBX_INIT_NIC_FUNC 0x0060 #define Q8_MBX_STOP_NIC_FUNC 0x0061 #define Q8_MBX_IDC_REQ 0x0062 @@ -622,6 +623,87 @@ typedef struct _q80_config_md_templ_cmd_ } __packed q80_config_md_templ_cmd_rsp_t; /* + * Hardware Configuration Commands + */ + +typedef struct _q80_hw_config { + uint16_t opcode; + uint16_t count_version; +#define Q8_HW_CONFIG_SET_MDIO_REG_COUNT 0x06 +#define Q8_HW_CONFIG_GET_MDIO_REG_COUNT 0x05 +#define Q8_HW_CONFIG_SET_CAM_SEARCH_MODE_COUNT 0x03 +#define Q8_HW_CONFIG_GET_CAM_SEARCH_MODE_COUNT 0x02 +#define Q8_HW_CONFIG_SET_TEMP_THRESHOLD_COUNT 0x03 +#define Q8_HW_CONFIG_GET_TEMP_THRESHOLD_COUNT 0x02 +#define Q8_HW_CONFIG_GET_ECC_COUNTS_COUNT 0x02 + + uint32_t cmd; +#define Q8_HW_CONFIG_SET_MDIO_REG 0x01 +#define Q8_HW_CONFIG_GET_MDIO_REG 0x02 +#define Q8_HW_CONFIG_SET_CAM_SEARCH_MODE 0x03 +#define Q8_HW_CONFIG_GET_CAM_SEARCH_MODE 0x04 +#define Q8_HW_CONFIG_SET_TEMP_THRESHOLD 0x07 +#define Q8_HW_CONFIG_GET_TEMP_THRESHOLD 0x08 +#define Q8_HW_CONFIG_GET_ECC_COUNTS 0x0A + + union { + struct { + uint32_t phys_port_number; + uint32_t phy_dev_addr; + uint32_t reg_addr; + uint32_t data; + } set_mdio; + + struct { + uint32_t phys_port_number; + uint32_t phy_dev_addr; + uint32_t reg_addr; + } get_mdio; + + struct { + uint32_t mode; +#define Q8_HW_CONFIG_CAM_SEARCH_MODE_INTERNAL 0x1 +#define Q8_HW_CONFIG_CAM_SEARCH_MODE_AUTO 0x2 + + } set_cam_search_mode; + + struct { + uint32_t value; + } set_temp_threshold; + } u; +} __packed q80_hw_config_t; + +typedef struct _q80_hw_config_rsp { + uint16_t opcode; + uint16_t regcnt_status; + + union { + struct { + uint32_t value; + } get_mdio; + + struct { + uint32_t mode; + } get_cam_search_mode; + + struct { + uint32_t temp_warn; + uint32_t curr_temp; + uint32_t osc_ring_rate; + uint32_t core_voltage; + } get_temp_threshold; + + struct { + uint32_t ddr_ecc_error_count; + uint32_t ocm_ecc_error_count; + uint32_t l2_dcache_ecc_error_count; + uint32_t l2_icache_ecc_error_count; + uint32_t eport_ecc_error_count; + } get_ecc_counts; + } u; +} __packed q80_hw_config_rsp_t; + +/* * Link Event Request Command */ typedef struct _q80_link_event { @@ -1407,6 +1489,7 @@ typedef struct _qla_sds { volatile uint32_t rcv_active; uint32_t sds_consumer; uint64_t intr_count; + uint64_t spurious_intr_count; } qla_sds_t; #define Q8_MAX_LRO_CONT_DESC 7 Modified: head/sys/dev/qlxgbe/ql_isr.c ============================================================================== --- head/sys/dev/qlxgbe/ql_isr.c Wed Aug 17 01:57:58 2016 (r304248) +++ head/sys/dev/qlxgbe/ql_isr.c Wed Aug 17 02:40:17 2016 (r304249) @@ -463,6 +463,8 @@ qla_rcv_isr(qla_host_t *ha, uint32_t sds qla_sgl_comp_t sgc; uint16_t nhandles; uint32_t sds_replenish_threshold = 0; + uint32_t r_idx = 0; + qla_sds_t *sdsp; dev = ha->pci_dev; hw = &ha->hw; @@ -705,8 +707,18 @@ qla_rcv_isr(qla_host_t *ha, uint32_t sds if (hw->sds[sds_idx].sdsr_next != comp_idx) { QL_UPDATE_SDS_CONSUMER_INDEX(ha, sds_idx, comp_idx); + hw->sds[sds_idx].sdsr_next = comp_idx; + } else { + hw->sds[sds_idx].spurious_intr_count++; + + if (ha->hw.num_rds_rings > 1) + r_idx = sds_idx; + + sdsp = &ha->hw.sds[sds_idx]; + + if (sdsp->rx_free > ha->std_replenish) + qla_replenish_normal_rx(ha, sdsp, r_idx); } - hw->sds[sds_idx].sdsr_next = comp_idx; sdesc = (q80_stat_desc_t *)&hw->sds[sds_idx].sds_ring_base[comp_idx]; opcode = Q8_STAT_DESC_OPCODE((sdesc->data[1])); @@ -826,6 +838,20 @@ ql_mbx_isr(void *arg) device_printf(ha->pci_dev, "%s: sfp removed]\n", __func__); break; + case 0x8140: + { + uint32_t ombx[3]; + + ombx[0] = READ_REG32(ha, (Q8_FW_MBOX0 + 4)); + ombx[1] = READ_REG32(ha, (Q8_FW_MBOX0 + 8)); + ombx[2] = READ_REG32(ha, (Q8_FW_MBOX0 + 12)); + + device_printf(ha->pci_dev, "%s: " + "0x%08x 0x%08x 0x%08x 0x%08x \n", + __func__, data, ombx[0], ombx[1], ombx[2]); + } + break; + default: device_printf(ha->pci_dev, "%s: AEN[0x%08x]\n", __func__, data); break; @@ -872,8 +898,8 @@ qla_replenish_normal_rx(qla_host_t *ha, rdesc->rx_next = 0; } else { device_printf(ha->pci_dev, - "%s: ql_get_mbuf [0,(%d),(%d)] failed\n", - __func__, rdesc->rx_in, rxb->handle); + "%s: qla_get_mbuf [(%d),(%d),(%d)] failed\n", + __func__, r_idx, rdesc->rx_in, rxb->handle); rxb->m_head = NULL; rxb->next = sdsp->rxb_free; Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Wed Aug 17 01:57:58 2016 (r304248) +++ head/sys/dev/qlxgbe/ql_os.c Wed Aug 17 02:40:17 2016 (r304249) @@ -1592,6 +1592,9 @@ ql_get_mbuf(qla_host_t *ha, qla_rx_buf_t if (mp == NULL) { + if (QL_ERR_INJECT(ha, INJCT_M_GETCL_M_GETJCL_FAILURE)) + return(-1); + if (ha->hw.enable_9kb) mp = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, mbuf_size); else Modified: head/sys/dev/qlxgbe/ql_ver.h ============================================================================== --- head/sys/dev/qlxgbe/ql_ver.h Wed Aug 17 01:57:58 2016 (r304248) +++ head/sys/dev/qlxgbe/ql_ver.h Wed Aug 17 02:40:17 2016 (r304249) @@ -36,6 +36,6 @@ #define QLA_VERSION_MAJOR 3 #define QLA_VERSION_MINOR 10 -#define QLA_VERSION_BUILD 29 +#define QLA_VERSION_BUILD 30 #endif /* #ifndef _QL_VER_H_ */ From owner-svn-src-all@freebsd.org Wed Aug 17 05:02:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07011BBC176; Wed, 17 Aug 2016 05:02:20 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B968B1B24; Wed, 17 Aug 2016 05:02:19 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H52IZP054313; Wed, 17 Aug 2016 05:02:18 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H52I0i054311; Wed, 17 Aug 2016 05:02:18 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170502.u7H52I0i054311@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 05:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304251 - head/sys/dev/hyperv/storvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 05:02:20 -0000 Author: sephe Date: Wed Aug 17 05:02:18 2016 New Revision: 304251 URL: https://svnweb.freebsd.org/changeset/base/304251 Log: hyperv/storvsc: Deliver CAM_SEL_TIMEOUT upon SRB status error. SRB status is set to 0x20 by the hypervisor, if the specified LUN is unaccessible, and even worse the INQUIRY response will not be set by the hypervisor at all under this situation. Additionally, SRB status is 0x20 too, for TUR on an unaccessible LUN. Deliver CAM_SEL_TIMEOUT to CAM upon SRB status errors as suggested by Scott Long, other values seems improper. This commit fixes the Hyper-V disk hotplug support. Submitted by: Hongjiang Zhang MFC after: 3 days Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7521 Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c head/sys/dev/hyperv/storvsc/hv_vstorage.h Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Aug 17 04:41:47 2016 (r304250) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Aug 17 05:02:18 2016 (r304251) @@ -742,6 +742,7 @@ hv_storvsc_on_iocompletion(struct storvs * because the fields will be used later in storvsc_io_done(). */ request->vstor_packet.u.vm_srb.scsi_status = vm_srb->scsi_status; + request->vstor_packet.u.vm_srb.srb_status = vm_srb->srb_status; request->vstor_packet.u.vm_srb.transfer_len = vm_srb->transfer_len; if (((vm_srb->scsi_status & 0xFF) == SCSI_STATUS_CHECK_COND) && @@ -2007,28 +2008,6 @@ create_storvsc_request(union ccb *ccb, s return(0); } -/* - * SCSI Inquiry checks qualifier and type. - * If qualifier is 011b, means the device server is not capable - * of supporting a peripheral device on this logical unit, and - * the type should be set to 1Fh. - * - * Return 1 if it is valid, 0 otherwise. - */ -static inline int -is_inquiry_valid(const struct scsi_inquiry_data *inq_data) -{ - uint8_t type; - if (SID_QUAL(inq_data) != SID_QUAL_LU_CONNECTED) { - return (0); - } - type = SID_TYPE(inq_data); - if (type == T_NODEVICE) { - return (0); - } - return (1); -} - /** * @brief completion function before returning to CAM * @@ -2047,7 +2026,6 @@ storvsc_io_done(struct hv_storvsc_reques struct vmscsi_req *vm_srb = &reqp->vstor_packet.u.vm_srb; bus_dma_segment_t *ori_sglist = NULL; int ori_sg_count = 0; - /* destroy bounce buffer if it is used */ if (reqp->bounce_sgl_count) { ori_sglist = (bus_dma_segment_t *)ccb->csio.data_ptr; @@ -2102,88 +2080,71 @@ storvsc_io_done(struct hv_storvsc_reques ccb->ccb_h.status &= ~CAM_STATUS_MASK; if (vm_srb->scsi_status == SCSI_STATUS_OK) { const struct scsi_generic *cmd; - /* - * Check whether the data for INQUIRY cmd is valid or - * not. Windows 10 and Windows 2016 send all zero - * inquiry data to VM even for unpopulated slots. - */ + + if (vm_srb->srb_status != SRB_STATUS_SUCCESS) { + if (vm_srb->srb_status == SRB_STATUS_INVALID_LUN) { + xpt_print(ccb->ccb_h.path, "invalid LUN %d\n", + vm_srb->lun); + } else { + xpt_print(ccb->ccb_h.path, "Unknown SRB flag: %d\n", + vm_srb->srb_status); + } + /* + * If there are errors, for example, invalid LUN, + * host will inform VM through SRB status. + */ + ccb->ccb_h.status |= CAM_SEL_TIMEOUT; + } else { + ccb->ccb_h.status |= CAM_REQ_CMP; + } + cmd = (const struct scsi_generic *) ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? csio->cdb_io.cdb_ptr : csio->cdb_io.cdb_bytes); if (cmd->opcode == INQUIRY) { - /* - * The host of Windows 10 or 2016 server will response - * the inquiry request with invalid data for unexisted device: - [0x7f 0x0 0x5 0x2 0x1f ... ] - * But on windows 2012 R2, the response is: - [0x7f 0x0 0x0 0x0 0x0 ] - * That is why here wants to validate the inquiry response. - * The validation will skip the INQUIRY whose response is short, - * which is less than SHORT_INQUIRY_LENGTH (36). - * - * For more information about INQUIRY, please refer to: - * ftp://ftp.avc-pioneer.com/Mtfuji_7/Proposal/Jun09/INQUIRY.pdf - */ - struct scsi_inquiry_data *inq_data = - (struct scsi_inquiry_data *)csio->data_ptr; - uint8_t* resp_buf = (uint8_t*)csio->data_ptr; - /* Get the buffer length reported by host */ - int resp_xfer_len = vm_srb->transfer_len; - /* Get the available buffer length */ - int resp_buf_len = resp_xfer_len >= 5 ? resp_buf[4] + 5 : 0; - int data_len = (resp_buf_len < resp_xfer_len) ? resp_buf_len : resp_xfer_len; - if (data_len < SHORT_INQUIRY_LENGTH) { - ccb->ccb_h.status |= CAM_REQ_CMP; - if (bootverbose && data_len >= 5) { - mtx_lock(&sc->hs_lock); - xpt_print(ccb->ccb_h.path, - "storvsc skips the validation for short inquiry (%d)" - " [%x %x %x %x %x]\n", - data_len,resp_buf[0],resp_buf[1],resp_buf[2], - resp_buf[3],resp_buf[4]); - mtx_unlock(&sc->hs_lock); - } - } else if (is_inquiry_valid(inq_data) == 0) { - ccb->ccb_h.status |= CAM_DEV_NOT_THERE; + struct scsi_inquiry_data *inq_data = + (struct scsi_inquiry_data *)csio->data_ptr; + uint8_t *resp_buf = (uint8_t *)csio->data_ptr; + int resp_xfer_len, resp_buf_len, data_len; + + /* Get the buffer length reported by host */ + resp_xfer_len = vm_srb->transfer_len; + /* Get the available buffer length */ + resp_buf_len = resp_xfer_len >= 5 ? resp_buf[4] + 5 : 0; + data_len = (resp_buf_len < resp_xfer_len) ? + resp_buf_len : resp_xfer_len; + if (bootverbose && data_len >= 5) { - mtx_lock(&sc->hs_lock); - xpt_print(ccb->ccb_h.path, - "storvsc uninstalled invalid device" - " [%x %x %x %x %x]\n", - resp_buf[0],resp_buf[1],resp_buf[2],resp_buf[3],resp_buf[4]); - mtx_unlock(&sc->hs_lock); + xpt_print(ccb->ccb_h.path, "storvsc inquiry " + "(%d) [%x %x %x %x %x ... ]\n", data_len, + resp_buf[0], resp_buf[1], resp_buf[2], + resp_buf[3], resp_buf[4]); } - } else { - char vendor[16]; - cam_strvis(vendor, inq_data->vendor, sizeof(inq_data->vendor), - sizeof(vendor)); - /** - * XXX: upgrade SPC2 to SPC3 if host is WIN8 or WIN2012 R2 - * in order to support UNMAP feature - */ - if (!strncmp(vendor,"Msft",4) && - SID_ANSI_REV(inq_data) == SCSI_REV_SPC2 && - (vmstor_proto_version == VMSTOR_PROTOCOL_VERSION_WIN8_1 || - vmstor_proto_version== VMSTOR_PROTOCOL_VERSION_WIN8)) { - inq_data->version = SCSI_REV_SPC3; - if (bootverbose) { - mtx_lock(&sc->hs_lock); - xpt_print(ccb->ccb_h.path, - "storvsc upgrades SPC2 to SPC3\n"); - mtx_unlock(&sc->hs_lock); + if (vm_srb->srb_status == SRB_STATUS_SUCCESS && + data_len > SHORT_INQUIRY_LENGTH) { + char vendor[16]; + + cam_strvis(vendor, inq_data->vendor, + sizeof(inq_data->vendor), sizeof(vendor)); + + /* + * XXX: Upgrade SPC2 to SPC3 if host is WIN8 or + * WIN2012 R2 in order to support UNMAP feature. + */ + if (!strncmp(vendor, "Msft", 4) && + SID_ANSI_REV(inq_data) == SCSI_REV_SPC2 && + (vmstor_proto_version == + VMSTOR_PROTOCOL_VERSION_WIN8_1 || + vmstor_proto_version == + VMSTOR_PROTOCOL_VERSION_WIN8)) { + inq_data->version = SCSI_REV_SPC3; + if (bootverbose) { + xpt_print(ccb->ccb_h.path, + "storvsc upgrades " + "SPC2 to SPC3\n"); + } } } - ccb->ccb_h.status |= CAM_REQ_CMP; - if (bootverbose) { - mtx_lock(&sc->hs_lock); - xpt_print(ccb->ccb_h.path, - "storvsc has passed inquiry response (%d) validation\n", - data_len); - mtx_unlock(&sc->hs_lock); - } - } - } else { - ccb->ccb_h.status |= CAM_REQ_CMP; } } else { mtx_lock(&sc->hs_lock); Modified: head/sys/dev/hyperv/storvsc/hv_vstorage.h ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_vstorage.h Wed Aug 17 04:41:47 2016 (r304250) +++ head/sys/dev/hyperv/storvsc/hv_vstorage.h Wed Aug 17 05:02:18 2016 (r304251) @@ -249,9 +249,9 @@ struct vstor_packet { /** * SRB Status Masks (can be combined with above status codes) */ -#define SRB_STATUS_QUEUE_FROZEN 0x40 -#define SRB_STATUS_AUTOSENSE_VALID 0x80 - +#define SRB_STATUS_QUEUE_FROZEN 0x40 +#define SRB_STATUS_AUTOSENSE_VALID 0x80 +#define SRB_STATUS_INVALID_LUN 0X20 /** * Packet flags From owner-svn-src-all@freebsd.org Wed Aug 17 05:14:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE5B5BBC3DE; Wed, 17 Aug 2016 05:14:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E085121E; Wed, 17 Aug 2016 05:14:27 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H5EQqK058404; Wed, 17 Aug 2016 05:14:26 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H5EQrI058402; Wed, 17 Aug 2016 05:14:26 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170514.u7H5EQrI058402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 05:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304252 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 05:14:27 -0000 Author: sephe Date: Wed Aug 17 05:14:26 2016 New Revision: 304252 URL: https://svnweb.freebsd.org/changeset/base/304252 Log: hyperv/hn: Ignore the useless TX table. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7514 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/if_hnreg.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:02:18 2016 (r304251) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:14:26 2016 (r304252) @@ -930,44 +930,17 @@ retry_send_cmplt: } } -/* - * Net VSC receiving vRSS send table from VSP - */ static void -hv_nv_send_table(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt) +hn_proc_notify(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt) { - netvsc_dev *net_dev; - const nvsp_msg *nvsp_msg_pkt; - int i; - uint32_t count; - const uint32_t *table; - - net_dev = hv_nv_get_inbound_net_device(sc); - if (!net_dev) - return; + const struct hn_nvs_hdr *hdr; - nvsp_msg_pkt = VMBUS_CHANPKT_CONST_DATA(pkt); - - if (nvsp_msg_pkt->hdr.msg_type != - nvsp_msg5_type_send_indirection_table) { - printf("Netvsc: !Warning! receive msg type not " - "send_indirection_table. type = %d\n", - nvsp_msg_pkt->hdr.msg_type); + hdr = VMBUS_CHANPKT_CONST_DATA(pkt); + if (hdr->nvs_type == HN_NVS_TYPE_TXTBL_NOTE) { + /* Useless; ignore */ return; } - - count = nvsp_msg_pkt->msgs.vers_5_msgs.send_table.count; - if (count != VRSS_SEND_TABLE_SIZE) { - printf("Netvsc: Received wrong send table size: %u\n", count); - return; - } - - table = (const uint32_t *) - ((const uint8_t *)&nvsp_msg_pkt->msgs.vers_5_msgs.send_table + - nvsp_msg_pkt->msgs.vers_5_msgs.send_table.offset); - - for (i = 0; i < count; i++) - net_dev->vrss_send_table[i] = table[i]; + if_printf(sc->hn_ifp, "got notify, nvs type %u\n", hdr->nvs_type); } /* @@ -1005,7 +978,7 @@ hv_nv_on_channel_callback(struct vmbus_c hv_nv_on_receive(net_dev, rxr, chan, pkt); break; case VMBUS_CHANPKT_TYPE_INBAND: - hv_nv_send_table(sc, pkt); + hn_proc_notify(sc, pkt); break; default: if_printf(rxr->hn_ifp, Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Wed Aug 17 05:02:18 2016 (r304251) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Wed Aug 17 05:14:26 2016 (r304252) @@ -59,8 +59,11 @@ #define HN_NVS_TYPE_CHIM_DISCONN 106 #define HN_NVS_TYPE_RNDIS 107 #define HN_NVS_TYPE_NDIS_CONF 125 +#define HN_NVS_TYPE_VFASSOC_NOTE 128 /* notification */ +#define HN_NVS_TYPE_SET_DATAPATH 129 #define HN_NVS_TYPE_SUBCH_REQ 133 #define HN_NVS_TYPE_SUBCH_RESP 133 /* same as SUBCH_REQ */ +#define HN_NVS_TYPE_TXTBL_NOTE 134 /* notification */ /* * Any size less than this one will _not_ work, e.g. hn_nvs_init From owner-svn-src-all@freebsd.org Wed Aug 17 05:25:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81CCCBBC6A1; Wed, 17 Aug 2016 05:25:48 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BD561703; Wed, 17 Aug 2016 05:25:48 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H5Pl2h062167; Wed, 17 Aug 2016 05:25:47 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H5PlU1062165; Wed, 17 Aug 2016 05:25:47 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170525.u7H5PlU1062165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 05:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304253 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 05:25:48 -0000 Author: sephe Date: Wed Aug 17 05:25:47 2016 New Revision: 304253 URL: https://svnweb.freebsd.org/changeset/base/304253 Log: hyperv/hn: Simplify RNDIS RX packets acknowledgement. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7515 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/if_hnreg.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:14:26 2016 (r304252) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:25:47 2016 (r304253) @@ -902,20 +902,17 @@ static void hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid, uint32_t status) { - nvsp_msg rx_comp_msg; + struct hn_nvs_rndis_ack ack; int retries = 0; int ret = 0; - rx_comp_msg.hdr.msg_type = nvsp_msg_1_type_send_rndis_pkt_complete; - - /* Pass in the status */ - rx_comp_msg.msgs.vers_1_msgs.send_rndis_pkt_complete.status = - status; + ack.nvs_type = HN_NVS_TYPE_RNDIS_ACK; + ack.nvs_status = status; retry_send_cmplt: /* Send the completion */ - ret = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_COMP, 0, - &rx_comp_msg, sizeof(nvsp_msg), tid); + ret = vmbus_chan_send(chan, VMBUS_CHANPKT_TYPE_COMP, + VMBUS_CHANPKT_FLAG_NONE, &ack, sizeof(ack), tid); if (ret == 0) { /* success */ /* no-op */ Modified: head/sys/dev/hyperv/netvsc/if_hnreg.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnreg.h Wed Aug 17 05:14:26 2016 (r304252) +++ head/sys/dev/hyperv/netvsc/if_hnreg.h Wed Aug 17 05:25:47 2016 (r304253) @@ -44,6 +44,7 @@ * NVS message transacion status codes. */ #define HN_NVS_STATUS_OK 1 +#define HN_NVS_STATUS_FAILED 2 /* * NVS request/response message types. @@ -58,6 +59,7 @@ #define HN_NVS_TYPE_CHIM_CONNRESP 105 #define HN_NVS_TYPE_CHIM_DISCONN 106 #define HN_NVS_TYPE_RNDIS 107 +#define HN_NVS_TYPE_RNDIS_ACK 108 #define HN_NVS_TYPE_NDIS_CONF 125 #define HN_NVS_TYPE_VFASSOC_NOTE 128 /* notification */ #define HN_NVS_TYPE_SET_DATAPATH 129 @@ -199,4 +201,11 @@ struct hn_nvs_rndis { } __packed; CTASSERT(sizeof(struct hn_nvs_rndis) >= HN_NVS_REQSIZE_MIN); +struct hn_nvs_rndis_ack { + uint32_t nvs_type; /* HN_NVS_TYPE_RNDIS_ACK */ + uint32_t nvs_status; /* HN_NVS_STATUS_ */ + uint8_t nvs_rsvd[24]; +} __packed; +CTASSERT(sizeof(struct hn_nvs_rndis_ack) >= HN_NVS_REQSIZE_MIN); + #endif /* !_IF_HNREG_H_ */ From owner-svn-src-all@freebsd.org Wed Aug 17 05:34:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 999ADBBC9CD; Wed, 17 Aug 2016 05:34:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CB591CD1; Wed, 17 Aug 2016 05:34:03 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H5Y2Fv065918; Wed, 17 Aug 2016 05:34:02 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H5Y2DO065914; Wed, 17 Aug 2016 05:34:02 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170534.u7H5Y2DO065914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 05:34:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304254 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 05:34:03 -0000 Author: sephe Date: Wed Aug 17 05:34:02 2016 New Revision: 304254 URL: https://svnweb.freebsd.org/changeset/base/304254 Log: hyperv/hn: Remove reference to nvsp_msg MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7516 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:25:47 2016 (r304253) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:34:02 2016 (r304254) @@ -72,7 +72,7 @@ static void hv_nv_on_receive(netvsc_dev const struct vmbus_chanpkt_hdr *pkt); static void hn_nvs_sent_none(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, - const struct nvsp_msg_ *msg, int); + const void *, int); static struct hn_send_ctx hn_send_ctx_none = HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL); @@ -756,16 +756,16 @@ hv_nv_on_device_remove(struct hn_softc * void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev __unused, struct vmbus_channel *chan __unused, - const struct nvsp_msg_ *msg, int dlen) + const void *data, int dlen) { - vmbus_xact_wakeup(sndc->hn_cbarg, msg, dlen); + vmbus_xact_wakeup(sndc->hn_cbarg, data, dlen); } static void hn_nvs_sent_none(struct hn_send_ctx *sndc __unused, struct netvsc_dev_ *net_dev __unused, struct vmbus_channel *chan __unused, - const struct nvsp_msg_ *msg __unused, int dlen __unused) + const void *data __unused, int dlen __unused) { /* EMPTY */ } Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Aug 17 05:25:47 2016 (r304253) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Aug 17 05:34:02 2016 (r304254) @@ -792,8 +792,7 @@ hn_txeof(struct hn_tx_ring *txr) static void hn_tx_done(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, - struct vmbus_channel *chan, const struct nvsp_msg_ *msg __unused, - int dlen __unused) + struct vmbus_channel *chan, const void *data __unused, int dlen __unused) { struct hn_txdesc *txd = sndc->hn_cbarg; struct hn_tx_ring *txr; Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 17 05:25:47 2016 (r304253) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 17 05:34:02 2016 (r304254) @@ -93,10 +93,10 @@ hv_rf_send_offload_request(struct hn_sof static void hn_rndis_sent_halt(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, - const struct nvsp_msg_ *msg, int dlen); + const void *data, int dlen); static void hn_rndis_sent_cb(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, - const struct nvsp_msg_ *msg, int dlen); + const void *data, int dlen); /* * Set the Per-Packet-Info with the specified type @@ -1272,7 +1272,7 @@ hv_rf_on_close(struct hn_softc *sc) static void hn_rndis_sent_cb(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, - struct vmbus_channel *chan __unused, const struct nvsp_msg_ *msg __unused, + struct vmbus_channel *chan __unused, const void *data __unused, int dlen __unused) { if (sndc->hn_chim_idx != HN_NVS_CHIM_IDX_INVALID) @@ -1281,7 +1281,7 @@ hn_rndis_sent_cb(struct hn_send_ctx *snd static void hn_rndis_sent_halt(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, - struct vmbus_channel *chan __unused, const struct nvsp_msg_ *msg __unused, + struct vmbus_channel *chan __unused, const void *data __unused, int dlen __unused) { rndis_request *request = sndc->hn_cbarg; Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Wed Aug 17 05:25:47 2016 (r304253) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Wed Aug 17 05:34:02 2016 (r304254) @@ -42,7 +42,7 @@ struct hn_send_ctx; typedef void (*hn_sent_callback_t) (struct hn_send_ctx *, struct netvsc_dev_ *, - struct vmbus_channel *, const struct nvsp_msg_ *, int); + struct vmbus_channel *, const void *, int); struct hn_send_ctx { hn_sent_callback_t hn_cb; @@ -98,7 +98,7 @@ hn_nvs_send_sglist(struct vmbus_channel void hn_nvs_sent_xact(struct hn_send_ctx *sndc, struct netvsc_dev_ *net_dev, struct vmbus_channel *chan, - const struct nvsp_msg_ *msg, int dlen); + const void *data, int dlen); void hn_chim_free(struct netvsc_dev_ *net_dev, uint32_t chim_idx); #endif /* !_IF_HNVAR_H_ */ From owner-svn-src-all@freebsd.org Wed Aug 17 05:45:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90354BBCD44; Wed, 17 Aug 2016 05:45:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5461913CD; Wed, 17 Aug 2016 05:45:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H5jv9w069956; Wed, 17 Aug 2016 05:45:57 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H5jvMe069954; Wed, 17 Aug 2016 05:45:57 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170545.u7H5jvMe069954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 05:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304255 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 05:45:58 -0000 Author: sephe Date: Wed Aug 17 05:45:57 2016 New Revision: 304255 URL: https://svnweb.freebsd.org/changeset/base/304255 Log: hyperv/hn: Remove reference to nvsp_status MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7517 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:34:02 2016 (r304254) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:45:57 2016 (r304255) @@ -852,7 +852,7 @@ hv_nv_on_receive(netvsc_dev *net_dev, st netvsc_packet *net_vsc_pkt = &vsc_pkt; int count = 0; int i = 0; - int status = nvsp_status_success; + int status = HN_NVS_STATUS_OK; /* Make sure that this is a RNDIS message. */ nvs_hdr = VMBUS_CHANPKT_CONST_DATA(pkthdr); @@ -874,15 +874,16 @@ hv_nv_on_receive(netvsc_dev *net_dev, st /* Each range represents 1 RNDIS pkt that contains 1 Ethernet frame */ for (i = 0; i < count; i++) { - net_vsc_pkt->status = nvsp_status_success; + net_vsc_pkt->status = HN_NVS_STATUS_OK; net_vsc_pkt->data = ((uint8_t *)net_dev->rx_buf + pkt->cp_rxbuf[i].rb_ofs); net_vsc_pkt->tot_data_buf_len = pkt->cp_rxbuf[i].rb_len; hv_rf_on_receive(net_dev, rxr, net_vsc_pkt); - if (net_vsc_pkt->status != nvsp_status_success) { - status = nvsp_status_failure; - } + + /* XXX pretty broken; whack it */ + if (net_vsc_pkt->status != HN_NVS_STATUS_OK) + status = HN_NVS_STATUS_FAILED; } /* Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 17 05:34:02 2016 (r304254) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Aug 17 05:45:57 2016 (r304255) @@ -544,7 +544,7 @@ hv_rf_receive_data(struct hn_rx_ring *rx pkt->tot_data_buf_len -= data_offset; if (pkt->tot_data_buf_len < rndis_pkt->data_length) { - pkt->status = nvsp_status_failure; + pkt->status = HN_NVS_STATUS_FAILED; if_printf(rxr->hn_ifp, "total length %u is less than data length %u\n", pkt->tot_data_buf_len, rndis_pkt->data_length); @@ -555,7 +555,7 @@ hv_rf_receive_data(struct hn_rx_ring *rx pkt->data = (void *)((unsigned long)pkt->data + data_offset); if (hv_rf_find_recvinfo(rndis_pkt, &info)) { - pkt->status = nvsp_status_failure; + pkt->status = HN_NVS_STATUS_FAILED; if_printf(rxr->hn_ifp, "recvinfo parsing failed\n"); return; } @@ -580,13 +580,13 @@ hv_rf_on_receive(netvsc_dev *net_dev, /* Make sure the rndis device state is initialized */ if (net_dev->extension == NULL) { - pkt->status = nvsp_status_failure; + pkt->status = HN_NVS_STATUS_FAILED; return (ENODEV); } rndis_dev = (rndis_device *)net_dev->extension; if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) { - pkt->status = nvsp_status_failure; + pkt->status = HN_NVS_STATUS_FAILED; return (EINVAL); } From owner-svn-src-all@freebsd.org Wed Aug 17 05:57:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AEB8BBCFC4; Wed, 17 Aug 2016 05:57:11 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F225919FF; Wed, 17 Aug 2016 05:57:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H5vAiF073759; Wed, 17 Aug 2016 05:57:10 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H5vASH073757; Wed, 17 Aug 2016 05:57:10 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170557.u7H5vASH073757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 05:57:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304256 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 05:57:11 -0000 Author: sephe Date: Wed Aug 17 05:57:10 2016 New Revision: 304256 URL: https://svnweb.freebsd.org/changeset/base/304256 Log: hyperv/hn: Get rid of unused bits MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7518 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:45:57 2016 (r304255) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Wed Aug 17 05:57:10 2016 (r304256) @@ -690,8 +690,6 @@ hv_nv_on_device_add(struct hn_softc *sc, /* Initialize the NetVSC channel extension */ - sema_init(&net_dev->channel_init_sema, 0, "netdev_sema"); - /* * Open the channel */ @@ -722,7 +720,6 @@ cleanup: * Free the packet buffers on the netvsc device packet queue. * Release other resources. */ - sema_destroy(&net_dev->channel_init_sema); free(net_dev, M_NETVSC); return (NULL); @@ -747,7 +744,6 @@ hv_nv_on_device_remove(struct hn_softc * vmbus_chan_close(sc->hn_prichan); - sema_destroy(&net_dev->channel_init_sema); free(net_dev, M_NETVSC); return (0); Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Aug 17 05:45:57 2016 (r304255) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Aug 17 05:57:10 2016 (r304256) @@ -177,834 +177,6 @@ typedef struct rndis_recv_scale_param_ { uint32_t processor_masks_entry_size; } rndis_recv_scale_param; -typedef enum nvsp_msg_type_ { - nvsp_msg_type_none = 0, - - /* - * Init Messages - */ - nvsp_msg_type_init = 1, - nvsp_msg_type_init_complete = 2, - - nvsp_version_msg_start = 100, - - /* - * Version 1 Messages - */ - nvsp_msg_1_type_send_ndis_vers = nvsp_version_msg_start, - - nvsp_msg_1_type_send_rx_buf, - nvsp_msg_1_type_send_rx_buf_complete, - nvsp_msg_1_type_revoke_rx_buf, - - nvsp_msg_1_type_send_send_buf, - nvsp_msg_1_type_send_send_buf_complete, - nvsp_msg_1_type_revoke_send_buf, - - nvsp_msg_1_type_send_rndis_pkt, - nvsp_msg_1_type_send_rndis_pkt_complete, - - /* - * Version 2 Messages - */ - nvsp_msg_2_type_send_chimney_delegated_buf, - nvsp_msg_2_type_send_chimney_delegated_buf_complete, - nvsp_msg_2_type_revoke_chimney_delegated_buf, - - nvsp_msg_2_type_resume_chimney_rx_indication, - - nvsp_msg_2_type_terminate_chimney, - nvsp_msg_2_type_terminate_chimney_complete, - - nvsp_msg_2_type_indicate_chimney_event, - - nvsp_msg_2_type_send_chimney_packet, - nvsp_msg_2_type_send_chimney_packet_complete, - - nvsp_msg_2_type_post_chimney_rx_request, - nvsp_msg_2_type_post_chimney_rx_request_complete, - - nvsp_msg_2_type_alloc_rx_buf, - nvsp_msg_2_type_alloc_rx_buf_complete, - - nvsp_msg_2_type_free_rx_buf, - - nvsp_msg_2_send_vmq_rndis_pkt, - nvsp_msg_2_send_vmq_rndis_pkt_complete, - - nvsp_msg_2_type_send_ndis_config, - - nvsp_msg_2_type_alloc_chimney_handle, - nvsp_msg_2_type_alloc_chimney_handle_complete, - - nvsp_msg2_max = nvsp_msg_2_type_alloc_chimney_handle_complete, - - /* - * Version 4 Messages - */ - nvsp_msg4_type_send_vf_association, - nvsp_msg4_type_switch_data_path, - nvsp_msg4_type_uplink_connect_state_deprecated, - - nvsp_msg4_max = nvsp_msg4_type_uplink_connect_state_deprecated, - - /* - * Version 5 Messages - */ - nvsp_msg5_type_oid_query_ex, - nvsp_msg5_type_oid_query_ex_comp, - nvsp_msg5_type_subchannel, - nvsp_msg5_type_send_indirection_table, - - nvsp_msg5_max = nvsp_msg5_type_send_indirection_table, -} nvsp_msg_type; - -typedef enum nvsp_status_ { - nvsp_status_none = 0, - nvsp_status_success, - nvsp_status_failure, - /* Deprecated */ - nvsp_status_prot_vers_range_too_new, - /* Deprecated */ - nvsp_status_prot_vers_range_too_old, - nvsp_status_invalid_rndis_pkt, - nvsp_status_busy, - nvsp_status_max, -} nvsp_status; - -typedef struct nvsp_msg_hdr_ { - uint32_t msg_type; -} __packed nvsp_msg_hdr; - -/* - * Init Messages - */ - -/* - * This message is used by the VSC to initialize the channel - * after the channels has been opened. This message should - * never include anything other then versioning (i.e. this - * message will be the same for ever). - * - * Forever is a long time. The values have been redefined - * in Win7 to indicate major and minor protocol version - * number. - */ -typedef struct nvsp_msg_init_ { - union { - struct { - uint16_t minor_protocol_version; - uint16_t major_protocol_version; - } s; - /* Formerly min_protocol_version */ - uint32_t protocol_version; - } p1; - /* Formerly max_protocol_version */ - uint32_t protocol_version_2; -} __packed nvsp_msg_init; - -/* - * This message is used by the VSP to complete the initialization - * of the channel. This message should never include anything other - * then versioning (i.e. this message will be the same forever). - */ -typedef struct nvsp_msg_init_complete_ { - /* Deprecated */ - uint32_t negotiated_prot_vers; - uint32_t max_mdl_chain_len; - uint32_t status; -} __packed nvsp_msg_init_complete; - -typedef union nvsp_msg_init_uber_ { - nvsp_msg_init init; - nvsp_msg_init_complete init_compl; -} __packed nvsp_msg_init_uber; - -/* - * Version 1 Messages - */ - -/* - * This message is used by the VSC to send the NDIS version - * to the VSP. The VSP can use this information when handling - * OIDs sent by the VSC. - */ -typedef struct nvsp_1_msg_send_ndis_version_ { - uint32_t ndis_major_vers; - /* Deprecated */ - uint32_t ndis_minor_vers; -} __packed nvsp_1_msg_send_ndis_version; - -/* - * This message is used by the VSC to send a receive buffer - * to the VSP. The VSP can then use the receive buffer to - * send data to the VSC. - */ -typedef struct nvsp_1_msg_send_rx_buf_ { - uint32_t gpadl_handle; - uint16_t id; -} __packed nvsp_1_msg_send_rx_buf; - -typedef struct nvsp_1_rx_buf_section_ { - uint32_t offset; - uint32_t sub_allocation_size; - uint32_t num_sub_allocations; - uint32_t end_offset; -} __packed nvsp_1_rx_buf_section; - -/* - * This message is used by the VSP to acknowledge a receive - * buffer send by the VSC. This message must be sent by the - * VSP before the VSP uses the receive buffer. - */ -typedef struct nvsp_1_msg_send_rx_buf_complete_ { - uint32_t status; - uint32_t num_sections; - - /* - * The receive buffer is split into two parts, a large - * suballocation section and a small suballocation - * section. These sections are then suballocated by a - * certain size. - * - * For example, the following break up of the receive - * buffer has 6 large suballocations and 10 small - * suballocations. - * - * | Large Section | | Small Section | - * ------------------------------------------------------------ - * | | | | | | | | | | | | | | | | | | - * | | - * LargeOffset SmallOffset - */ - nvsp_1_rx_buf_section sections[1]; - -} __packed nvsp_1_msg_send_rx_buf_complete; - -/* - * This message is sent by the VSC to revoke the receive buffer. - * After the VSP completes this transaction, the VSP should never - * use the receive buffer again. - */ -typedef struct nvsp_1_msg_revoke_rx_buf_ { - uint16_t id; -} __packed nvsp_1_msg_revoke_rx_buf; - -/* - * This message is used by the VSC to send a send buffer - * to the VSP. The VSC can then use the send buffer to - * send data to the VSP. - */ -typedef struct nvsp_1_msg_send_send_buf_ { - uint32_t gpadl_handle; - uint16_t id; -} __packed nvsp_1_msg_send_send_buf; - -/* - * This message is used by the VSP to acknowledge a send - * buffer sent by the VSC. This message must be sent by the - * VSP before the VSP uses the sent buffer. - */ -typedef struct nvsp_1_msg_send_send_buf_complete_ { - uint32_t status; - - /* - * The VSC gets to choose the size of the send buffer and - * the VSP gets to choose the sections size of the buffer. - * This was done to enable dynamic reconfigurations when - * the cost of GPA-direct buffers decreases. - */ - uint32_t section_size; -} __packed nvsp_1_msg_send_send_buf_complete; - -/* - * This message is sent by the VSC to revoke the send buffer. - * After the VSP completes this transaction, the vsp should never - * use the send buffer again. - */ -typedef struct nvsp_1_msg_revoke_send_buf_ { - uint16_t id; -} __packed nvsp_1_msg_revoke_send_buf; - -/* - * This message is used by both the VSP and the VSC to send - * an RNDIS message to the opposite channel endpoint. - */ -typedef struct nvsp_1_msg_send_rndis_pkt_ { - /* - * This field is specified by RNIDS. They assume there's - * two different channels of communication. However, - * the Network VSP only has one. Therefore, the channel - * travels with the RNDIS packet. - */ - uint32_t chan_type; - - /* - * This field is used to send part or all of the data - * through a send buffer. This values specifies an - * index into the send buffer. If the index is - * 0xFFFFFFFF, then the send buffer is not being used - * and all of the data was sent through other VMBus - * mechanisms. - */ - uint32_t send_buf_section_idx; - uint32_t send_buf_section_size; -} __packed nvsp_1_msg_send_rndis_pkt; - -/* - * This message is used by both the VSP and the VSC to complete - * a RNDIS message to the opposite channel endpoint. At this - * point, the initiator of this message cannot use any resources - * associated with the original RNDIS packet. - */ -typedef struct nvsp_1_msg_send_rndis_pkt_complete_ { - uint32_t status; -} __packed nvsp_1_msg_send_rndis_pkt_complete; - - -/* - * Version 2 Messages - */ - -/* - * This message is used by the VSC to send the NDIS version - * to the VSP. The VSP can use this information when handling - * OIDs sent by the VSC. - */ -typedef struct nvsp_2_netvsc_capabilities_ { - union { - uint64_t as_uint64; - struct { - uint64_t vmq : 1; - uint64_t chimney : 1; - uint64_t sriov : 1; - uint64_t ieee8021q : 1; - uint64_t correlationid : 1; - uint64_t teaming : 1; - } u2; - } u1; -} __packed nvsp_2_netvsc_capabilities; - -typedef struct nvsp_2_msg_send_ndis_config_ { - uint32_t mtu; - uint32_t reserved; - nvsp_2_netvsc_capabilities capabilities; -} __packed nvsp_2_msg_send_ndis_config; - -/* - * NvspMessage2TypeSendChimneyDelegatedBuffer - */ -typedef struct nvsp_2_msg_send_chimney_buf_ -{ - /* - * On WIN7 beta, delegated_obj_max_size is defined as a uint32_t - * Since WIN7 RC, it was split into two uint16_t. To have the same - * struct layout, delegated_obj_max_size shall be the first field. - */ - uint16_t delegated_obj_max_size; - - /* - * The revision # of chimney protocol used between NVSC and NVSP. - * - * This revision is NOT related to the chimney revision between - * NDIS protocol and miniport drivers. - */ - uint16_t revision; - - uint32_t gpadl_handle; -} __packed nvsp_2_msg_send_chimney_buf; - - -/* Unsupported chimney revision 0 (only present in WIN7 beta) */ -#define NVSP_CHIMNEY_REVISION_0 0 - -/* WIN7 Beta Chimney QFE */ -#define NVSP_CHIMNEY_REVISION_1 1 - -/* The chimney revision since WIN7 RC */ -#define NVSP_CHIMNEY_REVISION_2 2 - - -/* - * NvspMessage2TypeSendChimneyDelegatedBufferComplete - */ -typedef struct nvsp_2_msg_send_chimney_buf_complete_ { - uint32_t status; - - /* - * Maximum number outstanding sends and pre-posted receives. - * - * NVSC should not post more than SendQuota/ReceiveQuota packets. - * Otherwise, it can block the non-chimney path for an indefinite - * amount of time. - * (since chimney sends/receives are affected by the remote peer). - * - * Note: NVSP enforces the quota restrictions on a per-VMBCHANNEL - * basis. It doesn't enforce the restriction separately for chimney - * send/receive. If NVSC doesn't voluntarily enforce "SendQuota", - * it may kill its own network connectivity. - */ - uint32_t send_quota; - uint32_t rx_quota; -} __packed nvsp_2_msg_send_chimney_buf_complete; - -/* - * NvspMessage2TypeRevokeChimneyDelegatedBuffer - */ -typedef struct nvsp_2_msg_revoke_chimney_buf_ { - uint32_t gpadl_handle; -} __packed nvsp_2_msg_revoke_chimney_buf; - - -#define NVSP_CHIMNEY_OBJECT_TYPE_NEIGHBOR 0 -#define NVSP_CHIMNEY_OBJECT_TYPE_PATH4 1 -#define NVSP_CHIMNEY_OBJECT_TYPE_PATH6 2 -#define NVSP_CHIMNEY_OBJECT_TYPE_TCP 3 - -/* - * NvspMessage2TypeAllocateChimneyHandle - */ -typedef struct nvsp_2_msg_alloc_chimney_handle_ { - uint64_t vsc_context; - uint32_t object_type; -} __packed nvsp_2_msg_alloc_chimney_handle; - -/* - * NvspMessage2TypeAllocateChimneyHandleComplete - */ -typedef struct nvsp_2_msg_alloc_chimney_handle_complete_ { - uint32_t vsp_handle; -} __packed nvsp_2_msg_alloc_chimney_handle_complete; - - -/* - * NvspMessage2TypeResumeChimneyRXIndication - */ -typedef struct nvsp_2_msg_resume_chimney_rx_indication { - /* - * Handle identifying the offloaded connection - */ - uint32_t vsp_tcp_handle; -} __packed nvsp_2_msg_resume_chimney_rx_indication; - - -#define NVSP_2_MSG_TERMINATE_CHIMNEY_FLAGS_FIRST_STAGE (0x01u) -#define NVSP_2_MSG_TERMINATE_CHIMNEY_FLAGS_RESERVED (~(0x01u)) - -/* - * NvspMessage2TypeTerminateChimney - */ -typedef struct nvsp_2_msg_terminate_chimney_ { - /* - * Handle identifying the offloaded object - */ - uint32_t vsp_handle; - - /* - * Terminate Offload Flags - * Bit 0: - * When set to 0, terminate the offload at the destination NIC - * Bit 1-31: Reserved, shall be zero - */ - uint32_t flags; - - union { - /* - * This field is valid only when bit 0 of flags is clear. - * It specifies the index into the premapped delegated - * object buffer. The buffer was sent through the - * NvspMessage2TypeSendChimneyDelegatedBuffer - * message at initialization time. - * - * NVSP will write the delegated state into the delegated - * buffer upon upload completion. - */ - uint32_t index; - - /* - * This field is valid only when bit 0 of flags is set. - * - * The seqence number of the most recently accepted RX - * indication when VSC sets its TCP context into - * "terminating" state. - * - * This allows NVSP to determines if there are any in-flight - * RX indications for which the acceptance state is still - * undefined. - */ - uint64_t last_accepted_rx_seq_no; - } f0; -} __packed nvsp_2_msg_terminate_chimney; - - -#define NVSP_TERMINATE_CHIMNEY_COMPLETE_FLAG_DATA_CORRUPTED 0x0000001u - -/* - * NvspMessage2TypeTerminateChimneyComplete - */ -typedef struct nvsp_2_msg_terminate_chimney_complete_ { - uint64_t vsc_context; - uint32_t flags; -} __packed nvsp_2_msg_terminate_chimney_complete; - -/* - * NvspMessage2TypeIndicateChimneyEvent - */ -typedef struct nvsp_2_msg_indicate_chimney_event_ { - /* - * When VscTcpContext is 0, event_type is an NDIS_STATUS event code - * Otherwise, EventType is an TCP connection event (defined in - * NdisTcpOffloadEventHandler chimney DDK document). - */ - uint32_t event_type; - - /* - * When VscTcpContext is 0, EventType is an NDIS_STATUS event code - * Otherwise, EventType is an TCP connection event specific information - * (defined in NdisTcpOffloadEventHandler chimney DDK document). - */ - uint32_t event_specific_info; - - /* - * If not 0, the event is per-TCP connection event. This field - * contains the VSC's TCP context. - * If 0, the event indication is global. - */ - uint64_t vsc_tcp_context; -} __packed nvsp_2_msg_indicate_chimney_event; - - -#define NVSP_1_CHIMNEY_SEND_INVALID_OOB_INDEX 0xffffu -#define NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX 0xffffffff - -/* - * NvspMessage2TypeSendChimneyPacket - */ -typedef struct nvsp_2_msg_send_chimney_pkt_ { - /* - * Identify the TCP connection for which this chimney send is - */ - uint32_t vsp_tcp_handle; - - /* - * This field is used to send part or all of the data - * through a send buffer. This values specifies an - * index into the send buffer. If the index is - * 0xFFFF, then the send buffer is not being used - * and all of the data was sent through other VMBus - * mechanisms. - */ - uint16_t send_buf_section_index; - uint16_t send_buf_section_size; - - /* - * OOB Data Index - * This an index to the OOB data buffer. If the index is 0xFFFFFFFF, - * then there is no OOB data. - * - * This field shall be always 0xFFFFFFFF for now. It is reserved for - * the future. - */ - uint16_t oob_data_index; - - /* - * DisconnectFlags = 0 - * Normal chimney send. See MiniportTcpOffloadSend for details. - * - * DisconnectFlags = TCP_DISCONNECT_GRACEFUL_CLOSE (0x01) - * Graceful disconnect. See MiniportTcpOffloadDisconnect for details. - * - * DisconnectFlags = TCP_DISCONNECT_ABORTIVE_CLOSE (0x02) - * Abortive disconnect. See MiniportTcpOffloadDisconnect for details. - */ - uint16_t disconnect_flags; - - uint32_t seq_no; -} __packed nvsp_2_msg_send_chimney_pkt; - -/* - * NvspMessage2TypeSendChimneyPacketComplete - */ -typedef struct nvsp_2_msg_send_chimney_pkt_complete_ { - /* - * The NDIS_STATUS for the chimney send - */ - uint32_t status; - - /* - * Number of bytes that have been sent to the peer (and ACKed by the peer). - */ - uint32_t bytes_transferred; -} __packed nvsp_2_msg_send_chimney_pkt_complete; - - -#define NVSP_1_CHIMNEY_RECV_FLAG_NO_PUSH 0x0001u -#define NVSP_1_CHIMNEY_RECV_INVALID_OOB_INDEX 0xffffu - -/* - * NvspMessage2TypePostChimneyRecvRequest - */ -typedef struct nvsp_2_msg_post_chimney_rx_request_ { - /* - * Identify the TCP connection which this chimney receive request - * is for. - */ - uint32_t vsp_tcp_handle; - - /* - * OOB Data Index - * This an index to the OOB data buffer. If the index is 0xFFFFFFFF, - * then there is no OOB data. - * - * This field shall be always 0xFFFFFFFF for now. It is reserved for - * the future. - */ - uint32_t oob_data_index; - - /* - * Bit 0 - * When it is set, this is a "no-push" receive. - * When it is clear, this is a "push" receive. - * - * Bit 1-15: Reserved and shall be zero - */ - uint16_t flags; - - /* - * For debugging and diagnoses purpose. - * The SeqNo is per TCP connection and starts from 0. - */ - uint32_t seq_no; -} __packed nvsp_2_msg_post_chimney_rx_request; - -/* - * NvspMessage2TypePostChimneyRecvRequestComplete - */ -typedef struct nvsp_2_msg_post_chimney_rx_request_complete_ { - /* - * The NDIS_STATUS for the chimney send - */ - uint32_t status; - - /* - * Number of bytes that have been sent to the peer (and ACKed by - * the peer). - */ - uint32_t bytes_xferred; -} __packed nvsp_2_msg_post_chimney_rx_request_complete; - -/* - * NvspMessage2TypeAllocateReceiveBuffer - */ -typedef struct nvsp_2_msg_alloc_rx_buf_ { - /* - * Allocation ID to match the allocation request and response - */ - uint32_t allocation_id; - - /* - * Length of the VM shared memory receive buffer that needs to - * be allocated - */ - uint32_t length; -} __packed nvsp_2_msg_alloc_rx_buf; - -/* - * NvspMessage2TypeAllocateReceiveBufferComplete - */ -typedef struct nvsp_2_msg_alloc_rx_buf_complete_ { - /* - * The NDIS_STATUS code for buffer allocation - */ - uint32_t status; - - /* - * Allocation ID from NVSP_2_MESSAGE_ALLOCATE_RECEIVE_BUFFER - */ - uint32_t allocation_id; - - /* - * GPADL handle for the allocated receive buffer - */ - uint32_t gpadl_handle; - - /* - * Receive buffer ID that is further used in - * NvspMessage2SendVmqRndisPacket - */ - uint64_t rx_buf_id; -} __packed nvsp_2_msg_alloc_rx_buf_complete; - -/* - * NvspMessage2TypeFreeReceiveBuffer - */ -typedef struct nvsp_2_msg_free_rx_buf_ { - /* - * Receive buffer ID previous returned in - * NvspMessage2TypeAllocateReceiveBufferComplete message - */ - uint64_t rx_buf_id; -} __packed nvsp_2_msg_free_rx_buf; - -/* - * This structure is used in defining the buffers in - * NVSP_2_MESSAGE_SEND_VMQ_RNDIS_PACKET structure - */ -typedef struct nvsp_xfer_page_range_ { - /* - * Specifies the ID of the receive buffer that has the buffer. This - * ID can be the general receive buffer ID specified in - * NvspMessage1TypeSendReceiveBuffer or it can be the shared memory - * receive buffer ID allocated by the VSC and specified in - * NvspMessage2TypeAllocateReceiveBufferComplete message - */ - uint64_t xfer_page_set_id; - - /* - * Number of bytes - */ - uint32_t byte_count; - - /* - * Offset in bytes from the beginning of the buffer - */ - uint32_t byte_offset; -} __packed nvsp_xfer_page_range; - -/* - * NvspMessage2SendVmqRndisPacket - */ -typedef struct nvsp_2_msg_send_vmq_rndis_pkt_ { - /* - * This field is specified by RNIDS. They assume there's - * two different channels of communication. However, - * the Network VSP only has one. Therefore, the channel - * travels with the RNDIS packet. It must be RMC_DATA - */ - uint32_t channel_type; - - /* - * Only the Range element corresponding to the RNDIS header of - * the first RNDIS message in the multiple RNDIS messages sent - * in one NVSP message. Information about the data portions as well - * as the subsequent RNDIS messages in the same NVSP message are - * embedded in the RNDIS header itself - */ - nvsp_xfer_page_range range; -} __packed nvsp_2_msg_send_vmq_rndis_pkt; - -/* - * This message is used by the VSC to complete - * a RNDIS VMQ message to the VSP. At this point, - * the initiator of this message can use any resources - * associated with the original RNDIS VMQ packet. - */ -typedef struct nvsp_2_msg_send_vmq_rndis_pkt_complete_ -{ - uint32_t status; -} __packed nvsp_2_msg_send_vmq_rndis_pkt_complete; - -/* - * Version 5 messages - */ -enum nvsp_subchannel_operation { - NVSP_SUBCHANNEL_NONE = 0, - NVSP_SUBCHANNE_ALLOCATE, - NVSP_SUBCHANNE_MAX -}; - -typedef struct nvsp_5_subchannel_request_ -{ - uint32_t op; - uint32_t num_subchannels; -} __packed nvsp_5_subchannel_request; - -typedef struct nvsp_5_subchannel_complete_ -{ - uint32_t status; - /* Actual number of subchannels allocated */ - uint32_t num_subchannels; -} __packed nvsp_5_subchannel_complete; - -typedef struct nvsp_5_send_indirect_table_ -{ - /* The number of entries in the send indirection table */ - uint32_t count; - /* - * The offset of the send indireciton table from top of - * this struct. The send indirection table tells which channel - * to put the send traffic on. Each entry is a channel number. - */ - uint32_t offset; -} __packed nvsp_5_send_indirect_table; - -typedef union nvsp_1_msg_uber_ { - nvsp_1_msg_send_ndis_version send_ndis_vers; - - nvsp_1_msg_send_rx_buf send_rx_buf; - nvsp_1_msg_send_rx_buf_complete send_rx_buf_complete; - nvsp_1_msg_revoke_rx_buf revoke_rx_buf; - - nvsp_1_msg_send_send_buf send_send_buf; - nvsp_1_msg_send_send_buf_complete send_send_buf_complete; - nvsp_1_msg_revoke_send_buf revoke_send_buf; - - nvsp_1_msg_send_rndis_pkt send_rndis_pkt; - nvsp_1_msg_send_rndis_pkt_complete send_rndis_pkt_complete; -} __packed nvsp_1_msg_uber; - - -typedef union nvsp_2_msg_uber_ { - nvsp_2_msg_send_ndis_config send_ndis_config; - - nvsp_2_msg_send_chimney_buf send_chimney_buf; - nvsp_2_msg_send_chimney_buf_complete send_chimney_buf_complete; - nvsp_2_msg_revoke_chimney_buf revoke_chimney_buf; - - nvsp_2_msg_resume_chimney_rx_indication resume_chimney_rx_indication; - nvsp_2_msg_terminate_chimney terminate_chimney; - nvsp_2_msg_terminate_chimney_complete terminate_chimney_complete; - nvsp_2_msg_indicate_chimney_event indicate_chimney_event; - - nvsp_2_msg_send_chimney_pkt send_chimney_packet; - nvsp_2_msg_send_chimney_pkt_complete send_chimney_packet_complete; - nvsp_2_msg_post_chimney_rx_request post_chimney_rx_request; - nvsp_2_msg_post_chimney_rx_request_complete - post_chimney_rx_request_complete; - - nvsp_2_msg_alloc_rx_buf alloc_rx_buffer; - nvsp_2_msg_alloc_rx_buf_complete alloc_rx_buffer_complete; - nvsp_2_msg_free_rx_buf free_rx_buffer; - - nvsp_2_msg_send_vmq_rndis_pkt send_vmq_rndis_pkt; - nvsp_2_msg_send_vmq_rndis_pkt_complete send_vmq_rndis_pkt_complete; - nvsp_2_msg_alloc_chimney_handle alloc_chimney_handle; - nvsp_2_msg_alloc_chimney_handle_complete alloc_chimney_handle_complete; -} __packed nvsp_2_msg_uber; - -typedef union nvsp_5_msg_uber_ -{ - nvsp_5_subchannel_request subchannel_request; - nvsp_5_subchannel_complete subchn_complete; - nvsp_5_send_indirect_table send_table; -} __packed nvsp_5_msg_uber; - -typedef union nvsp_all_msgs_ { - nvsp_msg_init_uber init_msgs; - nvsp_1_msg_uber vers_1_msgs; - nvsp_2_msg_uber vers_2_msgs; - nvsp_5_msg_uber vers_5_msgs; -} __packed nvsp_all_msgs; - -/* - * ALL Messages - */ -typedef struct nvsp_msg_ { - nvsp_msg_hdr hdr; - nvsp_all_msgs msgs; -} __packed nvsp_msg; - - /* * The following arguably belongs in a separate header file */ @@ -1061,13 +233,6 @@ typedef struct netvsc_dev_ { uint32_t rx_buf_gpadl_handle; uint32_t rx_section_count; - /* Used for NetVSP initialization protocol */ - struct sema channel_init_sema; - nvsp_msg channel_init_packet; - - nvsp_msg revoke_packet; - /*uint8_t hw_mac_addr[ETHER_ADDR_LEN];*/ - /* Holds rndis device info */ void *extension; @@ -1079,7 +244,6 @@ typedef struct netvsc_dev_ { struct hyperv_dma rxbuf_dma; struct hyperv_dma txbuf_dma; - uint32_t vrss_send_table[VRSS_SEND_TABLE_SIZE]; } netvsc_dev; struct vmbus_channel; From owner-svn-src-all@freebsd.org Wed Aug 17 07:07:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75009BBDEB6; Wed, 17 Aug 2016 07:07:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 476021EDB; Wed, 17 Aug 2016 07:07:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H77OUN099868; Wed, 17 Aug 2016 07:07:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H77O9Z099866; Wed, 17 Aug 2016 07:07:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608170707.u7H77O9Z099866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Aug 2016 07:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304260 - in stable/11/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 07:07:25 -0000 Author: kib Date: Wed Aug 17 07:07:24 2016 New Revision: 304260 URL: https://svnweb.freebsd.org/changeset/base/304260 Log: MFC r303913: Unconditionally perform checks that FPU region was entered, when #NM exception is caught in kernel mode. Modified: stable/11/sys/amd64/amd64/trap.c stable/11/sys/i386/i386/trap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/trap.c ============================================================================== --- stable/11/sys/amd64/amd64/trap.c Wed Aug 17 06:58:43 2016 (r304259) +++ stable/11/sys/amd64/amd64/trap.c Wed Aug 17 07:07:24 2016 (r304260) @@ -443,8 +443,8 @@ trap(struct trapframe *frame) goto out; case T_DNA: - KASSERT(!PCB_USER_FPU(td->td_pcb), - ("Unregistered use of FPU in kernel")); + if (PCB_USER_FPU(td->td_pcb)) + panic("Unregistered use of FPU in kernel"); fpudna(); goto out; Modified: stable/11/sys/i386/i386/trap.c ============================================================================== --- stable/11/sys/i386/i386/trap.c Wed Aug 17 06:58:43 2016 (r304259) +++ stable/11/sys/i386/i386/trap.c Wed Aug 17 07:07:24 2016 (r304260) @@ -540,8 +540,8 @@ trap(struct trapframe *frame) case T_DNA: #ifdef DEV_NPX - KASSERT(!PCB_USER_FPU(td->td_pcb), - ("Unregistered use of FPU in kernel")); + if (PCB_USER_FPU(td->td_pcb)) + panic("Unregistered use of FPU in kernel"); if (npxdna()) goto out; #endif From owner-svn-src-all@freebsd.org Wed Aug 17 07:07:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81466BBDEE9; Wed, 17 Aug 2016 07:07:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E3331F1E; Wed, 17 Aug 2016 07:07:30 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H77TKX099918; Wed, 17 Aug 2016 07:07:29 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H77TV2099916; Wed, 17 Aug 2016 07:07:29 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608170707.u7H77TV2099916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Aug 2016 07:07:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304261 - releng/11.0/lib/clang X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 07:07:30 -0000 Author: dim Date: Wed Aug 17 07:07:29 2016 New Revision: 304261 URL: https://svnweb.freebsd.org/changeset/base/304261 Log: Similar to r256297, disable assertions in llvm and clang for the releng/11.0 branch. This reduces the size of the clang executable, and improves its performance. Also bump FREEBSD_CC_VERSION. Approved by: re (gjb) Modified: releng/11.0/lib/clang/clang.build.mk releng/11.0/lib/clang/freebsd_cc_version.h Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/lib/clang/clang.build.mk ============================================================================== --- releng/11.0/lib/clang/clang.build.mk Wed Aug 17 07:07:24 2016 (r304260) +++ releng/11.0/lib/clang/clang.build.mk Wed Aug 17 07:07:29 2016 (r304261) @@ -8,7 +8,7 @@ CFLAGS+= -I${LLVM_SRCS}/include -I${CLAN -I${LLVM_SRCS}/${SRCDIR} ${INCDIR:C/^/-I${LLVM_SRCS}\//} -I. \ -I${LLVM_SRCS}/../../lib/clang/include \ -DLLVM_ON_UNIX -DLLVM_ON_FREEBSD \ - -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS #-DNDEBUG + -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG .if ${MK_CLANG_FULL} != "no" CFLAGS+= -DCLANG_ENABLE_ARCMT \ Modified: releng/11.0/lib/clang/freebsd_cc_version.h ============================================================================== --- releng/11.0/lib/clang/freebsd_cc_version.h Wed Aug 17 07:07:24 2016 (r304260) +++ releng/11.0/lib/clang/freebsd_cc_version.h Wed Aug 17 07:07:29 2016 (r304261) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1100004 +#define FREEBSD_CC_VERSION 1100005 From owner-svn-src-all@freebsd.org Wed Aug 17 07:09:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91104BBDFB7; Wed, 17 Aug 2016 07:09:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D4F51323; Wed, 17 Aug 2016 07:09:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H79Ne5000159; Wed, 17 Aug 2016 07:09:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H79N0a000157; Wed, 17 Aug 2016 07:09:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608170709.u7H79N0a000157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Aug 2016 07:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304262 - in stable/10/sys: amd64/amd64 i386/i386 X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 07:09:24 -0000 Author: kib Date: Wed Aug 17 07:09:22 2016 New Revision: 304262 URL: https://svnweb.freebsd.org/changeset/base/304262 Log: MFC r303913: Unconditionally perform checks that FPU region was entered, when #NM exception is caught in kernel mode. Modified: stable/10/sys/amd64/amd64/trap.c stable/10/sys/i386/i386/trap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/trap.c ============================================================================== --- stable/10/sys/amd64/amd64/trap.c Wed Aug 17 07:07:29 2016 (r304261) +++ stable/10/sys/amd64/amd64/trap.c Wed Aug 17 07:09:22 2016 (r304262) @@ -448,8 +448,8 @@ trap(struct trapframe *frame) goto out; case T_DNA: - KASSERT(!PCB_USER_FPU(td->td_pcb), - ("Unregistered use of FPU in kernel")); + if (PCB_USER_FPU(td->td_pcb)) + panic("Unregistered use of FPU in kernel"); fpudna(); goto out; Modified: stable/10/sys/i386/i386/trap.c ============================================================================== --- stable/10/sys/i386/i386/trap.c Wed Aug 17 07:07:29 2016 (r304261) +++ stable/10/sys/i386/i386/trap.c Wed Aug 17 07:09:22 2016 (r304262) @@ -534,8 +534,8 @@ trap(struct trapframe *frame) case T_DNA: #ifdef DEV_NPX - KASSERT(!PCB_USER_FPU(td->td_pcb), - ("Unregistered use of FPU in kernel")); + if (PCB_USER_FPU(td->td_pcb)) + panic("Unregistered use of FPU in kernel"); if (npxdna()) goto out; #endif From owner-svn-src-all@freebsd.org Wed Aug 17 07:11:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECC55BBB1EB; Wed, 17 Aug 2016 07:11:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B956E17FE; Wed, 17 Aug 2016 07:11:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H7BjSb000916; Wed, 17 Aug 2016 07:11:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H7BjGp000915; Wed, 17 Aug 2016 07:11:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608170711.u7H7BjGp000915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Aug 2016 07:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304263 - stable/11/sys/kern X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 07:11:47 -0000 Author: kib Date: Wed Aug 17 07:11:45 2016 New Revision: 304263 URL: https://svnweb.freebsd.org/changeset/base/304263 Log: MFC r303914: Re-schedule signals after kthread exits. Modified: stable/11/sys/kern/kern_kthread.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_kthread.c ============================================================================== --- stable/11/sys/kern/kern_kthread.c Wed Aug 17 07:09:22 2016 (r304262) +++ stable/11/sys/kern/kern_kthread.c Wed Aug 17 07:11:45 2016 (r304263) @@ -320,11 +320,13 @@ void kthread_exit(void) { struct proc *p; + struct thread *td; - p = curthread->td_proc; + td = curthread; + p = td->td_proc; /* A module may be waiting for us to exit. */ - wakeup(curthread); + wakeup(td); /* * The last exiting thread in a kernel process must tear down @@ -337,9 +339,10 @@ kthread_exit(void) rw_wunlock(&tidhash_lock); kproc_exit(0); } - LIST_REMOVE(curthread, td_hash); + LIST_REMOVE(td, td_hash); rw_wunlock(&tidhash_lock); - umtx_thread_exit(curthread); + umtx_thread_exit(td); + tdsigcleanup(td); PROC_SLOCK(p); thread_exit(); } From owner-svn-src-all@freebsd.org Wed Aug 17 07:13:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11C47BBB268; Wed, 17 Aug 2016 07:13:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D606619F9; Wed, 17 Aug 2016 07:13:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H7DQY3003679; Wed, 17 Aug 2016 07:13:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H7DQ7q003678; Wed, 17 Aug 2016 07:13:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608170713.u7H7DQ7q003678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Aug 2016 07:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304264 - stable/10/sys/kern X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 07:13:27 -0000 Author: kib Date: Wed Aug 17 07:13:25 2016 New Revision: 304264 URL: https://svnweb.freebsd.org/changeset/base/304264 Log: MFC r303914: Re-schedule signals after kthread exits. Modified: stable/10/sys/kern/kern_kthread.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_kthread.c ============================================================================== --- stable/10/sys/kern/kern_kthread.c Wed Aug 17 07:11:45 2016 (r304263) +++ stable/10/sys/kern/kern_kthread.c Wed Aug 17 07:13:25 2016 (r304264) @@ -322,11 +322,13 @@ void kthread_exit(void) { struct proc *p; + struct thread *td; - p = curthread->td_proc; + td = curthread; + p = td->td_proc; /* A module may be waiting for us to exit. */ - wakeup(curthread); + wakeup(td); /* * The last exiting thread in a kernel process must tear down @@ -339,9 +341,10 @@ kthread_exit(void) rw_wunlock(&tidhash_lock); kproc_exit(0); } - LIST_REMOVE(curthread, td_hash); + LIST_REMOVE(td, td_hash); rw_wunlock(&tidhash_lock); - umtx_thread_exit(curthread); + umtx_thread_exit(td); + tdsigcleanup(td); PROC_SLOCK(p); thread_exit(); } From owner-svn-src-all@freebsd.org Wed Aug 17 07:15:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07D77BBB2E9; Wed, 17 Aug 2016 07:15:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBF3D1BDC; Wed, 17 Aug 2016 07:15:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H7FpWn003820; Wed, 17 Aug 2016 07:15:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H7FpO4003819; Wed, 17 Aug 2016 07:15:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608170715.u7H7FpO4003819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Aug 2016 07:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304265 - stable/11/sys/fs/tmpfs X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 07:15:52 -0000 Author: kib Date: Wed Aug 17 07:15:50 2016 New Revision: 304265 URL: https://svnweb.freebsd.org/changeset/base/304265 Log: MFC r303916: Convert another tmpfs assert into runtime check. Modified: stable/11/sys/fs/tmpfs/tmpfs_subr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/11/sys/fs/tmpfs/tmpfs_subr.c Wed Aug 17 07:13:25 2016 (r304264) +++ stable/11/sys/fs/tmpfs/tmpfs_subr.c Wed Aug 17 07:15:50 2016 (r304265) @@ -819,10 +819,13 @@ tmpfs_dir_lookup_cookie(struct tmpfs_nod goto out; } - MPASS((cookie & TMPFS_DIRCOOKIE_MASK) == cookie); - dekey.td_hash = cookie; - /* Recover if direntry for cookie was removed */ - de = RB_NFIND(tmpfs_dir, dirhead, &dekey); + if ((cookie & TMPFS_DIRCOOKIE_MASK) != cookie) { + de = NULL; + } else { + dekey.td_hash = cookie; + /* Recover if direntry for cookie was removed */ + de = RB_NFIND(tmpfs_dir, dirhead, &dekey); + } dc->tdc_tree = de; dc->tdc_current = de; if (de != NULL && tmpfs_dirent_duphead(de)) { From owner-svn-src-all@freebsd.org Wed Aug 17 07:17:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E792BBB358; Wed, 17 Aug 2016 07:17:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 111781D36; Wed, 17 Aug 2016 07:17:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H7HGYB003924; Wed, 17 Aug 2016 07:17:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H7HGUs003923; Wed, 17 Aug 2016 07:17:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608170717.u7H7HGUs003923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Aug 2016 07:17:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304266 - stable/10/sys/fs/tmpfs X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 07:17:17 -0000 Author: kib Date: Wed Aug 17 07:17:16 2016 New Revision: 304266 URL: https://svnweb.freebsd.org/changeset/base/304266 Log: MFC r303916: Convert another tmpfs assert into runtime check. Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_subr.c Wed Aug 17 07:15:50 2016 (r304265) +++ stable/10/sys/fs/tmpfs/tmpfs_subr.c Wed Aug 17 07:17:16 2016 (r304266) @@ -818,10 +818,13 @@ tmpfs_dir_lookup_cookie(struct tmpfs_nod goto out; } - MPASS((cookie & TMPFS_DIRCOOKIE_MASK) == cookie); - dekey.td_hash = cookie; - /* Recover if direntry for cookie was removed */ - de = RB_NFIND(tmpfs_dir, dirhead, &dekey); + if ((cookie & TMPFS_DIRCOOKIE_MASK) != cookie) { + de = NULL; + } else { + dekey.td_hash = cookie; + /* Recover if direntry for cookie was removed */ + de = RB_NFIND(tmpfs_dir, dirhead, &dekey); + } dc->tdc_tree = de; dc->tdc_current = de; if (de != NULL && tmpfs_dirent_duphead(de)) { From owner-svn-src-all@freebsd.org Wed Aug 17 07:25:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B561CBBB6E1; Wed, 17 Aug 2016 07:25:51 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85AE815BC; Wed, 17 Aug 2016 07:25:51 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H7PoRV007726; Wed, 17 Aug 2016 07:25:50 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H7Pola007725; Wed, 17 Aug 2016 07:25:50 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201608170725.u7H7Pola007725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Wed, 17 Aug 2016 07:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304268 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 07:25:51 -0000 Author: kevlo Date: Wed Aug 17 07:25:50 2016 New Revision: 304268 URL: https://svnweb.freebsd.org/changeset/base/304268 Log: - Add the 'restrict' type qualifier to match function prototype. - Use .Lb libc rather than libpthread. Reviewed by: delphij Modified: head/lib/libc/gen/sem_timedwait.3 Modified: head/lib/libc/gen/sem_timedwait.3 ============================================================================== --- head/lib/libc/gen/sem_timedwait.3 Wed Aug 17 07:25:21 2016 (r304267) +++ head/lib/libc/gen/sem_timedwait.3 Wed Aug 17 07:25:50 2016 (r304268) @@ -34,18 +34,18 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2008 +.Dd August 17, 2016 .Dt SEM_TIMEDWAIT 3 .Os .Sh NAME .Nm sem_timedwait .Nd "lock a semaphore" .Sh LIBRARY -.Lb libpthread +.Lb libc .Sh SYNOPSIS .In semaphore.h .Ft int -.Fn sem_timedwait "sem_t *sem" "const struct timespec *abs_timeout" +.Fn sem_timedwait "sem_t * restrict sem" "const struct timespec * restrict abs_timeout" .Sh DESCRIPTION The .Fn sem_timedwait From owner-svn-src-all@freebsd.org Wed Aug 17 08:11:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F080DBBC63A; Wed, 17 Aug 2016 08:11:00 +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-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AC501EB6; Wed, 17 Aug 2016 08:11:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7H8AtKg097120 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 17 Aug 2016 11:10:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7H8AtKg097120 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7H8AtER097113; Wed, 17 Aug 2016 11:10:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 17 Aug 2016 11:10:55 +0300 From: Konstantin Belousov To: Jilles Tjoelker Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304180 - head/sys/ufs/ffs Message-ID: <20160817081055.GM83214@kib.kiev.ua> References: <201608151922.u7FJMOmT099410@repo.freebsd.org> <20160816215355.GB12199@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160816215355.GB12199@stack.nl> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 08:11:01 -0000 On Tue, Aug 16, 2016 at 11:53:55PM +0200, Jilles Tjoelker wrote: > Hmm, some people interpret POSIX differently than I do, but I think it > is clear that XBD 3.384 Synchronized I/O Data Integrity Completion > requires the indirect blocks to be written (because "all file system > information required to retrieve the data is successfully transferred"). > The Linux man page matches this interpretation except that an fsync of > the parent directory may be required. > > If the whole file is being considered, then any change to indirect > blocks is needed to access some data (because the file was extended, a > hole was filled or snapshotted data was overwritten). For other > overwrites, there is no change to indirect blocks and no conflict with > fdatasync's performance objectives. Note that the same argument is applicable to the inode block: the di_db and di_ib pointers to the direct blocks and to root indirect blocks are required to retrieve the written data. ... > Ideally, a changed i_size would also cause the inode to be written, but > I don't know how to determine that (there is no i_flag for it). Always > writing the inode would defeat the point of fdatasync. Which was my reasoning behind omitting the indirect block flushing. There is no practical difference between inode block and indirect blocks for metadata consistency. Note that the affected case is only the async mounts (not sync mounts, not any variants of softdeps). I can restore indirect block flushing and wait for them for DATA_ONLY sync, but then I should also add ffs_update() call. From owner-svn-src-all@freebsd.org Wed Aug 17 08:26:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B0B8BBCA72; Wed, 17 Aug 2016 08:26:10 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E82711892; Wed, 17 Aug 2016 08:26:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H8Q90i029851; Wed, 17 Aug 2016 08:26:09 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H8Q92B029850; Wed, 17 Aug 2016 08:26:09 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170826.u7H8Q92B029850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 08:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304270 - head/sys/dev/hyperv/utilities 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 08:26:10 -0000 Author: sephe Date: Wed Aug 17 08:26:08 2016 New Revision: 304270 URL: https://svnweb.freebsd.org/changeset/base/304270 Log: hyperv/util: Don't reference hn_softc in KVP hn_softc is private data struct. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7519 Modified: head/sys/dev/hyperv/utilities/hv_kvp.c Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Wed Aug 17 07:30:23 2016 (r304269) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Wed Aug 17 08:26:08 2016 (r304270) @@ -54,17 +54,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#include -#include -#include - #include -#include #include #include "hv_util.h" @@ -333,13 +329,11 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru for (devcnt = devcnt - 1; devcnt >= 0; devcnt--) { /* XXX access other driver's softc? are you kidding? */ device_t dev = devs[devcnt]; - struct hn_softc *sc = device_get_softc(dev); struct vmbus_channel *chan; char buf[HYPERV_GUID_STRLEN]; /* * Trying to find GUID of Network Device - * TODO: need vmbus interface. */ chan = vmbus_get_channel(dev); hyperv_guid2str(vmbus_chan_guid_inst(chan), @@ -348,7 +342,7 @@ hv_kvp_convert_utf16_ipinfo_to_utf8(stru if (strncmp(buf, (char *)umsg->body.kvp_ip_val.adapter_id, HYPERV_GUID_STRLEN - 1) == 0) { strlcpy((char *)umsg->body.kvp_ip_val.adapter_id, - sc->hn_ifp->if_xname, MAX_ADAPTER_ID_SIZE); + device_get_nameunit(dev), MAX_ADAPTER_ID_SIZE); break; } } From owner-svn-src-all@freebsd.org Wed Aug 17 08:29:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9F51BBCB46; Wed, 17 Aug 2016 08:29:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA7A81A74; Wed, 17 Aug 2016 08:29:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H8TUgB029994; Wed, 17 Aug 2016 08:29:30 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H8TUhV029992; Wed, 17 Aug 2016 08:29:30 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608170829.u7H8TUhV029992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Aug 2016 08:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304271 - head/sys/boot/efi/boot1 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 08:29:31 -0000 Author: manu Date: Wed Aug 17 08:29:30 2016 New Revision: 304271 URL: https://svnweb.freebsd.org/changeset/base/304271 Log: Correctly print and cast u_int64_t and off_t. Reported by: ed, imp MFC after: 1 week Modified: head/sys/boot/efi/boot1/ufs_module.c head/sys/boot/efi/boot1/zfs_module.c Modified: head/sys/boot/efi/boot1/ufs_module.c ============================================================================== --- head/sys/boot/efi/boot1/ufs_module.c Wed Aug 17 08:26:08 2016 (r304270) +++ head/sys/boot/efi/boot1/ufs_module.c Wed Aug 17 08:29:30 2016 (r304271) @@ -56,9 +56,9 @@ dskread(void *buf, u_int64_t lba, int nb devinfo->dev->Media->MediaId, lba, size, buf); if (status != EFI_SUCCESS) { - DPRINTF("dskread: failed dev: %p, id: %u, lba: %zu, size: %d, " + DPRINTF("dskread: failed dev: %p, id: %u, lba: %ju, size: %d, " "status: %lu\n", devinfo->dev, - devinfo->dev->Media->MediaId, lba, size, + devinfo->dev->Media->MediaId, (uintmax_t)lba, size, EFI_ERROR_CODE(status)); return (-1); } Modified: head/sys/boot/efi/boot1/zfs_module.c ============================================================================== --- head/sys/boot/efi/boot1/zfs_module.c Wed Aug 17 08:26:08 2016 (r304270) +++ head/sys/boot/efi/boot1/zfs_module.c Wed Aug 17 08:29:30 2016 (r304271) @@ -54,9 +54,9 @@ vdev_read(vdev_t *vdev, void *priv, off_ devinfo->dev->Media->MediaId, lba, bytes, buf); if (status != EFI_SUCCESS) { DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %jd, size: %zu," - " status: %lu\n", devinfo->dev, - devinfo->dev->Media->MediaId, lba, bytes, - EFI_ERROR_CODE(status)); + " status: %lu\n", devinfo->dev, + devinfo->dev->Media->MediaId, (intmax_t)lba, bytes, + EFI_ERROR_CODE(status)); return (-1); } From owner-svn-src-all@freebsd.org Wed Aug 17 08:32:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C8D9BBCD31; Wed, 17 Aug 2016 08:32:27 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 41F1C1E69; Wed, 17 Aug 2016 08:32:25 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id b6d34547; Wed, 17 Aug 2016 10:32:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=kB47U7MuPNfxjwhBCLDkvrQAYp4=; b=J5KJeikMT1hfOgToim0QQ4rUDWFK nncvEI+b3uI9YsHV79vMqrs10u5fy03UPGWF6nrvprd4bwNtqnFZo6kYxxu64EdR 7446PQRKVsh8D7xNwgzib9HF6Jvwy/N2GU73Oh44GwrshkMCCjTHNbbpXorhiZFw 4Jzyz1JN2X1VvKw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=i0iiy0daMvUN+S8W7P5dOz9SlKZw2PoIPOtSOU7IXmtFblq7voOBrX6L ClmW3sLUwKwp0hRMTlkdv5jFi9/B5OvX64r/2tbeLb+L0ss73RZb7BhJiskRXxGz DMw49IMPiXLzRf7SqC0bKzIBappP0i7RB6fFTaQd78P4c9xmFaI= Received: from knuckles.blih.net (ip-54.net-82-216-203.roubaix.rev.numericable.fr [82.216.203.54]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 68084b43 TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Wed, 17 Aug 2016 10:32:16 +0200 (CEST) Date: Wed, 17 Aug 2016 10:32:13 +0200 From: Emmanuel Vadot To: Warner Losh Cc: Ed Schouten , Emmanuel Vadot , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r304221 - head/sys/boot/efi/boot1 Message-Id: <20160817103213.e69dcfcbe18591a3fca30d9a@bidouilliste.com> In-Reply-To: References: <201608161423.u7GENZJi021956@repo.freebsd.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.29; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 08:32:27 -0000 On Tue, 16 Aug 2016 12:16:30 -0600 Warner Losh wrote: > On Tue, Aug 16, 2016 at 8:57 AM, Ed Schouten wrote: > > Hi Emmanuel, > > > > 2016-08-16 16:23 GMT+02:00 Emmanuel Vadot : > >> Author: manu > >> Date: Tue Aug 16 14:23:35 2016 > >> New Revision: 304221 > >> URL: https://svnweb.freebsd.org/changeset/base/304221 > >> > >> Log: > >> Use %ju modifier for u_int64_t and %jd modifier for off_t. > >> off_t is long long on arm32 and long on amd64 > > > > I think both of these should be solved differently: > > > > - For uint64_t, you can use 's PRIu64 in the formatting > > string. In kernel space, I suspect you need to use something like > > . > > cast it to intmax_t and use %jd. We've shunned PRIu64 in the tree. > It's existing practice, but I'm sure bruce will voice mild distaste. > > > - For off_t, it's all right to print it with %jd, but then be sure to > > also add a cast to the argument itself. It may not necessarily be > > equal to an intmax_t. > > The cast is important. > > Warner Thanks to all of you, I didn't know about PRI* (but I guess this was a good thing to not know about them). -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Wed Aug 17 08:37:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CAF6BBCF2F; Wed, 17 Aug 2016 08:37:41 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6C9E6128B; Wed, 17 Aug 2016 08:37:41 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H8be4h033742; Wed, 17 Aug 2016 08:37:40 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H8beLC033741; Wed, 17 Aug 2016 08:37:40 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608170837.u7H8beLC033741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Wed, 17 Aug 2016 08:37:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304272 - stable/11/usr.bin X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 08:37:41 -0000 Author: ache Date: Wed Aug 17 08:37:40 2016 New Revision: 304272 URL: https://svnweb.freebsd.org/changeset/base/304272 Log: MFC r303094 Continuation lines with comments badly affects gprof, it is excluded from build on amd64 f.e. Modified: stable/11/usr.bin/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/Makefile ============================================================================== --- stable/11/usr.bin/Makefile Wed Aug 17 08:29:30 2016 (r304271) +++ stable/11/usr.bin/Makefile Wed Aug 17 08:37:40 2016 (r304272) @@ -270,8 +270,9 @@ SUBDIR.${MK_TOOLCHAIN}+= ctags SUBDIR.${MK_TOOLCHAIN}+= cxxfilt SUBDIR.${MK_TOOLCHAIN}+= elfcopy SUBDIR.${MK_TOOLCHAIN}+= file2c -.if ${MACHINE_ARCH} != "aarch64" && \ # ARM64TODO gprof does not build - ${MACHINE_CPUARCH} != "riscv" # RISCVTODO gprof does not build +# ARM64TODO gprof does not build +# RISCVTODO gprof does not build +.if ${MACHINE_ARCH} != "aarch64" && ${MACHINE_CPUARCH} != "riscv" SUBDIR.${MK_TOOLCHAIN}+= gprof .endif SUBDIR.${MK_TOOLCHAIN}+= indent From owner-svn-src-all@freebsd.org Wed Aug 17 08:38:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC3EDBBCFBC; Wed, 17 Aug 2016 08:38:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A6A9143C; Wed, 17 Aug 2016 08:38:51 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H8cofw033827; Wed, 17 Aug 2016 08:38:50 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H8coRS033821; Wed, 17 Aug 2016 08:38:50 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608170838.u7H8coRS033821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 17 Aug 2016 08:38:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304273 - head/sys/dev/hyperv/utilities 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 08:38:51 -0000 Author: sephe Date: Wed Aug 17 08:38:49 2016 New Revision: 304273 URL: https://svnweb.freebsd.org/changeset/base/304273 Log: hyperv/util: Factor out helper for IC device_probe DEVMETHOD MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7530 Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c head/sys/dev/hyperv/utilities/hv_kvp.c head/sys/dev/hyperv/utilities/hv_shutdown.c head/sys/dev/hyperv/utilities/hv_timesync.c head/sys/dev/hyperv/utilities/hv_util.c head/sys/dev/hyperv/utilities/hv_util.h Modified: head/sys/dev/hyperv/utilities/hv_heartbeat.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_heartbeat.c Wed Aug 17 08:37:40 2016 (r304272) +++ head/sys/dev/hyperv/utilities/hv_heartbeat.c Wed Aug 17 08:38:49 2016 (r304273) @@ -41,10 +41,15 @@ #include "hv_util.h" #include "vmbus_if.h" -/* Heartbeat Service */ -static const struct hyperv_guid service_guid = { .hv_guid = - {0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e, - 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d} }; +static const struct vmbus_ic_desc vmbus_heartbeat_descs[] = { + { + .ic_guid = { .hv_guid = { + 0x39, 0x4f, 0x16, 0x57, 0x15, 0x91, 0x78, 0x4e, + 0xab, 0x55, 0x38, 0x2f, 0x3b, 0xd5, 0x42, 0x2d} }, + .ic_desc = "Hyper-V Heartbeat" + }, + VMBUS_IC_DESC_END +}; /** * Process heartbeat message @@ -96,14 +101,8 @@ hv_heartbeat_cb(struct vmbus_channel *ch static int hv_heartbeat_probe(device_t dev) { - if (resource_disabled("hvheartbeat", 0)) - return ENXIO; - if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, &service_guid) == 0) { - device_set_desc(dev, "Hyper-V Heartbeat Service"); - return BUS_PROBE_DEFAULT; - } - return ENXIO; + return (vmbus_ic_probe(dev, vmbus_heartbeat_descs)); } static int Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Wed Aug 17 08:37:40 2016 (r304272) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Wed Aug 17 08:38:49 2016 (r304273) @@ -87,9 +87,15 @@ static int hv_kvp_log = 0; log(LOG_INFO, "hv_kvp: " __VA_ARGS__); \ } while (0) -static const struct hyperv_guid service_guid = { .hv_guid = - {0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, - 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6} }; +static const struct vmbus_ic_desc vmbus_kvp_descs[] = { + { + .ic_guid = { .hv_guid = { + 0xe7, 0xf4, 0xa0, 0xa9, 0x45, 0x5a, 0x96, 0x4d, + 0xb8, 0x27, 0x8a, 0x84, 0x1e, 0x8c, 0x3, 0xe6 } }, + .ic_desc = "Hyper-V KVP" + }, + VMBUS_IC_DESC_END +}; /* character device prototypes */ static d_open_t hv_kvp_dev_open; @@ -867,14 +873,8 @@ hv_kvp_dev_daemon_poll(struct cdev *dev, static int hv_kvp_probe(device_t dev) { - if (resource_disabled("hvkvp", 0)) - return ENXIO; - if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, &service_guid) == 0) { - device_set_desc(dev, "Hyper-V KVP Service"); - return BUS_PROBE_DEFAULT; - } - return ENXIO; + return (vmbus_ic_probe(dev, vmbus_kvp_descs)); } static int Modified: head/sys/dev/hyperv/utilities/hv_shutdown.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_shutdown.c Wed Aug 17 08:37:40 2016 (r304272) +++ head/sys/dev/hyperv/utilities/hv_shutdown.c Wed Aug 17 08:38:49 2016 (r304273) @@ -46,9 +46,15 @@ #include "hv_util.h" #include "vmbus_if.h" -static const struct hyperv_guid service_guid = { .hv_guid = - {0x31, 0x60, 0x0B, 0X0E, 0x13, 0x52, 0x34, 0x49, - 0x81, 0x8B, 0x38, 0XD9, 0x0C, 0xED, 0x39, 0xDB} }; +static const struct vmbus_ic_desc vmbus_shutdown_descs[] = { + { + .ic_guid = { .hv_guid = { + 0x31, 0x60, 0x0b, 0x0e, 0x13, 0x52, 0x34, 0x49, + 0x81, 0x8b, 0x38, 0xd9, 0x0c, 0xed, 0x39, 0xdb } }, + .ic_desc = "Hyper-V Shutdown" + }, + VMBUS_IC_DESC_END +}; /** * Shutdown @@ -118,14 +124,8 @@ hv_shutdown_cb(struct vmbus_channel *cha static int hv_shutdown_probe(device_t dev) { - if (resource_disabled("hvshutdown", 0)) - return ENXIO; - if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, &service_guid) == 0) { - device_set_desc(dev, "Hyper-V Shutdown Service"); - return BUS_PROBE_DEFAULT; - } - return ENXIO; + return (vmbus_ic_probe(dev, vmbus_shutdown_descs)); } static int Modified: head/sys/dev/hyperv/utilities/hv_timesync.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_timesync.c Wed Aug 17 08:37:40 2016 (r304272) +++ head/sys/dev/hyperv/utilities/hv_timesync.c Wed Aug 17 08:38:49 2016 (r304273) @@ -58,10 +58,15 @@ typedef struct { uint64_t data; } time_sync_data; - /* Time Synch Service */ -static const struct hyperv_guid service_guid = {.hv_guid = - {0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49, - 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf } }; +static const struct vmbus_ic_desc vmbus_timesync_descs[] = { + { + .ic_guid = { .hv_guid = { + 0x30, 0xe6, 0x27, 0x95, 0xae, 0xd0, 0x7b, 0x49, + 0xad, 0xce, 0xe8, 0x0a, 0xb0, 0x17, 0x5c, 0xaf } }, + .ic_desc = "Hyper-V Timesync" + }, + VMBUS_IC_DESC_END +}; struct hv_ictimesync_data { uint64_t parenttime; @@ -174,14 +179,8 @@ hv_timesync_cb(struct vmbus_channel *cha static int hv_timesync_probe(device_t dev) { - if (resource_disabled("hvtimesync", 0)) - return ENXIO; - if (VMBUS_PROBE_GUID(device_get_parent(dev), dev, &service_guid) == 0) { - device_set_desc(dev, "Hyper-V Time Synch Service"); - return BUS_PROBE_DEFAULT; - } - return ENXIO; + return (vmbus_ic_probe(dev, vmbus_timesync_descs)); } static int Modified: head/sys/dev/hyperv/utilities/hv_util.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.c Wed Aug 17 08:37:40 2016 (r304272) +++ head/sys/dev/hyperv/utilities/hv_util.c Wed Aug 17 08:38:49 2016 (r304273) @@ -42,7 +42,9 @@ #include #include #include -#include "hv_util.h" +#include + +#include "vmbus_if.h" #define VMBUS_IC_BRSIZE (4 * PAGE_SIZE) @@ -75,6 +77,24 @@ hv_negotiate_version(struct hv_vmbus_icm } int +vmbus_ic_probe(device_t dev, const struct vmbus_ic_desc descs[]) +{ + device_t bus = device_get_parent(dev); + const struct vmbus_ic_desc *d; + + if (resource_disabled(device_get_name(dev), 0)) + return (ENXIO); + + for (d = descs; d->ic_desc != NULL; ++d) { + if (VMBUS_PROBE_GUID(bus, dev, &d->ic_guid) == 0) { + device_set_desc(dev, d->ic_desc); + return (BUS_PROBE_DEFAULT); + } + } + return (ENXIO); +} + +int hv_util_attach(device_t dev, vmbus_chan_callback_t cb) { struct hv_util_sc *sc = device_get_softc(dev); Modified: head/sys/dev/hyperv/utilities/hv_util.h ============================================================================== --- head/sys/dev/hyperv/utilities/hv_util.h Wed Aug 17 08:37:40 2016 (r304272) +++ head/sys/dev/hyperv/utilities/hv_util.h Wed Aug 17 08:38:49 2016 (r304273) @@ -31,6 +31,7 @@ #ifndef _HVUTIL_H_ #define _HVUTIL_H_ +#include #include /** @@ -42,9 +43,17 @@ typedef struct hv_util_sc { int ic_buflen; } hv_util_sc; +struct vmbus_ic_desc { + const struct hyperv_guid ic_guid; + const char *ic_desc; +}; + +#define VMBUS_IC_DESC_END { .ic_desc = NULL } + void hv_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, uint8_t *buf); -int hv_util_attach(device_t dev, vmbus_chan_callback_t cb); -int hv_util_detach(device_t dev); +int hv_util_attach(device_t dev, vmbus_chan_callback_t cb); +int hv_util_detach(device_t dev); +int vmbus_ic_probe(device_t dev, const struct vmbus_ic_desc descs[]); #endif From owner-svn-src-all@freebsd.org Wed Aug 17 08:51:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70D60BBA579; Wed, 17 Aug 2016 08:51:49 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C0C21BA1; Wed, 17 Aug 2016 08:51:49 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H8pm5c041026; Wed, 17 Aug 2016 08:51:48 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H8plGM041020; Wed, 17 Aug 2016 08:51:47 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608170851.u7H8plGM041020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Wed, 17 Aug 2016 08:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304275 - in stable/11/lib/libc: gen locale regex stdio X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 08:51:49 -0000 Author: ache Date: Wed Aug 17 08:51:47 2016 New Revision: 304275 URL: https://svnweb.freebsd.org/changeset/base/304275 Log: MFC r302824 1) Eliminate possibility to call __*collate_range_cmp() with inclomplete locale (which cause core dump) by removing whole 'table' argument by which it passed. 2) Restore __collate_range_cmp() in __sccl(). 3) Collating [a-z] range in regcomp() work only for single bytes locales (we can't do it now for other ones). In previous code only first 256 wchars are considered and all others are just silently dropped from the range. Modified: stable/11/lib/libc/gen/fnmatch.c stable/11/lib/libc/gen/glob.c stable/11/lib/libc/locale/collate.h stable/11/lib/libc/locale/collcmp.c stable/11/lib/libc/regex/regcomp.c stable/11/lib/libc/stdio/vfscanf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/fnmatch.c ============================================================================== --- stable/11/lib/libc/gen/fnmatch.c Wed Aug 17 08:51:41 2016 (r304274) +++ stable/11/lib/libc/gen/fnmatch.c Wed Aug 17 08:51:47 2016 (r304275) @@ -296,8 +296,8 @@ rangematch(const char *pattern, wchar_t if (table->__collate_load_error ? c <= test && test <= c2 : - __wcollate_range_cmp(table, c, test) <= 0 - && __wcollate_range_cmp(table, test, c2) <= 0 + __wcollate_range_cmp(c, test) <= 0 + && __wcollate_range_cmp(test, c2) <= 0 ) ok = 1; } else if (c == test) Modified: stable/11/lib/libc/gen/glob.c ============================================================================== --- stable/11/lib/libc/gen/glob.c Wed Aug 17 08:51:41 2016 (r304274) +++ stable/11/lib/libc/gen/glob.c Wed Aug 17 08:51:47 2016 (r304275) @@ -832,8 +832,8 @@ match(Char *name, Char *pat, Char *paten if ((*pat & M_MASK) == M_RNG) { if (table->__collate_load_error ? CHAR(c) <= CHAR(k) && CHAR(k) <= CHAR(pat[1]) : - __wcollate_range_cmp(table, CHAR(c), CHAR(k)) <= 0 - && __wcollate_range_cmp(table, CHAR(k), CHAR(pat[1])) <= 0 + __wcollate_range_cmp(CHAR(c), CHAR(k)) <= 0 + && __wcollate_range_cmp(CHAR(k), CHAR(pat[1])) <= 0 ) ok = 1; pat += 2; Modified: stable/11/lib/libc/locale/collate.h ============================================================================== --- stable/11/lib/libc/locale/collate.h Wed Aug 17 08:51:41 2016 (r304274) +++ stable/11/lib/libc/locale/collate.h Wed Aug 17 08:51:47 2016 (r304275) @@ -128,8 +128,8 @@ int __collate_load_tables(const char *); int __collate_equiv_value(locale_t, const wchar_t *, size_t); void _collate_lookup(struct xlocale_collate *,const wchar_t *, int *, int *, int, const int **); -int __collate_range_cmp(struct xlocale_collate *, char, char); -int __wcollate_range_cmp(struct xlocale_collate *, wchar_t, wchar_t); +int __collate_range_cmp(char, char); +int __wcollate_range_cmp(wchar_t, wchar_t); size_t _collate_wxfrm(struct xlocale_collate *, const wchar_t *, wchar_t *, size_t); size_t _collate_sxfrm(struct xlocale_collate *, const wchar_t *, char *, Modified: stable/11/lib/libc/locale/collcmp.c ============================================================================== --- stable/11/lib/libc/locale/collcmp.c Wed Aug 17 08:51:41 2016 (r304274) +++ stable/11/lib/libc/locale/collcmp.c Wed Aug 17 08:51:47 2016 (r304275) @@ -34,14 +34,13 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include "collate.h" /* * Compare two characters using collate */ -int __collate_range_cmp(struct xlocale_collate *table, char c1, char c2) +int __collate_range_cmp(char c1, char c2) { char s1[2], s2[2]; @@ -49,12 +48,10 @@ int __collate_range_cmp(struct xlocale_c s1[1] = '\0'; s2[0] = c2; s2[1] = '\0'; - struct _xlocale l = {{0}}; - l.components[XLC_COLLATE] = (struct xlocale_component *)table; - return (strcoll_l(s1, s2, &l)); + return (strcoll(s1, s2)); } -int __wcollate_range_cmp(struct xlocale_collate *table, wchar_t c1, wchar_t c2) +int __wcollate_range_cmp(wchar_t c1, wchar_t c2) { wchar_t s1[2], s2[2]; @@ -62,7 +59,5 @@ int __wcollate_range_cmp(struct xlocale_ s1[1] = L'\0'; s2[0] = c2; s2[1] = L'\0'; - struct _xlocale l = {{0}}; - l.components[XLC_COLLATE] = (struct xlocale_component *)table; - return (wcscoll_l(s1, s2, &l)); + return (wcscoll(s1, s2)); } Modified: stable/11/lib/libc/regex/regcomp.c ============================================================================== --- stable/11/lib/libc/regex/regcomp.c Wed Aug 17 08:51:41 2016 (r304274) +++ stable/11/lib/libc/regex/regcomp.c Wed Aug 17 08:51:47 2016 (r304275) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -817,14 +816,14 @@ p_b_term(struct parse *p, cset *cs) if (start == finish) CHadd(p, cs, start); else { - if (table->__collate_load_error) { - (void)REQUIRE((uch)start <= (uch)finish, REG_ERANGE); + if (table->__collate_load_error || MB_CUR_MAX > 1) { + (void)REQUIRE(start <= finish, REG_ERANGE); CHaddrange(p, cs, start, finish); } else { - (void)REQUIRE(__wcollate_range_cmp(table, start, finish) <= 0, REG_ERANGE); + (void)REQUIRE(__wcollate_range_cmp(start, finish) <= 0, REG_ERANGE); for (i = 0; i <= UCHAR_MAX; i++) { - if ( __wcollate_range_cmp(table, start, i) <= 0 - && __wcollate_range_cmp(table, i, finish) <= 0 + if ( __wcollate_range_cmp(start, i) <= 0 + && __wcollate_range_cmp(i, finish) <= 0 ) CHadd(p, cs, i); } Modified: stable/11/lib/libc/stdio/vfscanf.c ============================================================================== --- stable/11/lib/libc/stdio/vfscanf.c Wed Aug 17 08:51:41 2016 (r304274) +++ stable/11/lib/libc/stdio/vfscanf.c Wed Aug 17 08:51:47 2016 (r304275) @@ -873,7 +873,7 @@ doswitch: n = *fmt; if (n == ']' || (table->__collate_load_error ? n < c : - __wcollate_range_cmp(table, n, c) < 0 + __collate_range_cmp(n, c) < 0 ) ) { c = '-'; @@ -887,8 +887,8 @@ doswitch: } while (c < n); } else { for (i = 0; i < 256; i ++) - if (__wcollate_range_cmp(table, c, i) < 0 && - __wcollate_range_cmp(table, i, n) <= 0 + if (__collate_range_cmp(c, i) <= 0 && + __collate_range_cmp(i, n) <= 0 ) tab[i] = v; } From owner-svn-src-all@freebsd.org Wed Aug 17 09:07:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09467BBC381; Wed, 17 Aug 2016 09:07:45 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE4F51D89; Wed, 17 Aug 2016 09:07:44 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H97ia0045612; Wed, 17 Aug 2016 09:07:44 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H97ib5045611; Wed, 17 Aug 2016 09:07:44 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608170907.u7H97ib5045611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Wed, 17 Aug 2016 09:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304276 - stable/11/contrib/tcsh X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 09:07:45 -0000 Author: ache Date: Wed Aug 17 09:07:43 2016 New Revision: 304276 URL: https://svnweb.freebsd.org/changeset/base/304276 Log: MFC r302831 To mimic system glob, we definitely don't need manual upper/lower hack. The author clearly disagree in the comment, so this patch will be not submitted upstream. Modified: stable/11/contrib/tcsh/glob.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tcsh/glob.c ============================================================================== --- stable/11/contrib/tcsh/glob.c Wed Aug 17 08:51:47 2016 (r304275) +++ stable/11/contrib/tcsh/glob.c Wed Aug 17 09:07:43 2016 (r304276) @@ -142,12 +142,14 @@ globcharcoll(__Char c1, __Char c2, int c c1 = towlower(c1); c2 = towlower(c2); } else { +#ifndef __FreeBSD__ /* This should not be here, but I'll rather leave it in than engage in a LC_COLLATE flamewar about a shell I don't use... */ if (iswlower(c1) && iswupper(c2)) return (1); if (iswupper(c1) && iswlower(c2)) return (-1); +#endif } s1[0] = c1; s2[0] = c2; From owner-svn-src-all@freebsd.org Wed Aug 17 09:10:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A4C7BBC4B0; Wed, 17 Aug 2016 09:10:24 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED58A1F9C; Wed, 17 Aug 2016 09:10:23 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H9ANEM045781; Wed, 17 Aug 2016 09:10:23 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H9ANhJ045780; Wed, 17 Aug 2016 09:10:23 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608170910.u7H9ANhJ045780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Wed, 17 Aug 2016 09:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304277 - stable/11/usr.bin/tr X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 09:10:24 -0000 Author: ache Date: Wed Aug 17 09:10:22 2016 New Revision: 304277 URL: https://svnweb.freebsd.org/changeset/base/304277 Log: MFC r302826 Document incomplete support of [=equiv=] and collation for ranges. Modified: stable/11/usr.bin/tr/tr.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/tr/tr.1 ============================================================================== --- stable/11/usr.bin/tr/tr.1 Wed Aug 17 09:07:43 2016 (r304276) +++ stable/11/usr.bin/tr/tr.1 Wed Aug 17 09:10:22 2016 (r304277) @@ -334,6 +334,10 @@ should be used instead of explicit chara and .Dq Li A-Z . .Pp +.Dq Li [=equiv=] +expression and collation for ranges +are implemented for single byte locales only. +.Pp System V has historically implemented character ranges using the syntax .Dq Li [c-c] instead of the From owner-svn-src-all@freebsd.org Wed Aug 17 09:12:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56DC9BBC717; Wed, 17 Aug 2016 09:12:03 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 297DF1745; Wed, 17 Aug 2016 09:12:03 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H9C2gl049347; Wed, 17 Aug 2016 09:12:02 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H9C2Vu049346; Wed, 17 Aug 2016 09:12:02 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608170912.u7H9C2Vu049346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Wed, 17 Aug 2016 09:12:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304278 - stable/11/usr.bin/tr X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 09:12:03 -0000 Author: ache Date: Wed Aug 17 09:12:02 2016 New Revision: 304278 URL: https://svnweb.freebsd.org/changeset/base/304278 Log: MFC r302827 Optimize [Cc]flag case: don't repeatedly add the last character of string2 to squeeze cset when string2 reach its EOS state. Modified: stable/11/usr.bin/tr/tr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/tr/tr.c ============================================================================== --- stable/11/usr.bin/tr/tr.c Wed Aug 17 09:10:22 2016 (r304277) +++ stable/11/usr.bin/tr/tr.c Wed Aug 17 09:12:02 2016 (r304278) @@ -272,10 +272,11 @@ endloop: if (Cflag && !iswrune(cnt)) continue; if (cmap_lookup(map, cnt) == OOBCH) { - if (next(&s2)) + if (next(&s2)) { cmap_add(map, cnt, s2.lastch); - if (sflag) - cset_add(squeeze, s2.lastch); + if (sflag) + cset_add(squeeze, s2.lastch); + } } else cmap_add(map, cnt, cnt); if ((s2.state == EOS || s2.state == INFINITE) && From owner-svn-src-all@freebsd.org Wed Aug 17 09:20:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1630CBBC983; Wed, 17 Aug 2016 09:20:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAB491BCC; Wed, 17 Aug 2016 09:20:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H9K59C049769; Wed, 17 Aug 2016 09:20:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H9K5FS049768; Wed, 17 Aug 2016 09:20:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608170920.u7H9K5FS049768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Aug 2016 09:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304279 - head/sys/dev/acpica 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 09:20:06 -0000 Author: kib Date: Wed Aug 17 09:20:04 2016 New Revision: 304279 URL: https://svnweb.freebsd.org/changeset/base/304279 Log: By default, allow all to read the HPET registers pages. At the same time, by, by default disallow writes to the mmaped HPET pages. Intent is to allow userspace to use HPET as fast (i.e. no-syscall) timecounter for gettimeofday(2). Unfortunately, the permission model does not make it possible to safely unhide /dev/hpet in the jails even if default mode is set to 0444, because untrusted jailed root may change device permissions to writeable. Sponsored by: The FreeBSD Foundation MFC after: 3 weeks Modified: head/sys/dev/acpica/acpi_hpet.c Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Wed Aug 17 09:12:02 2016 (r304278) +++ head/sys/dev/acpica/acpi_hpet.c Wed Aug 17 09:20:04 2016 (r304279) @@ -762,14 +762,14 @@ hpet_attach(device_t dev) mda.mda_devsw = &hpet_cdevsw; mda.mda_uid = UID_ROOT; mda.mda_gid = GID_WHEEL; - mda.mda_mode = 0600; + mda.mda_mode = 0644; mda.mda_si_drv1 = sc; error = make_dev_s(&mda, &sc->pdev, "hpet%d", device_get_unit(dev)); if (error == 0) { sc->mmap_allow = 1; TUNABLE_INT_FETCH("hw.acpi.hpet.mmap_allow", &sc->mmap_allow); - sc->mmap_allow_write = 1; + sc->mmap_allow_write = 0; TUNABLE_INT_FETCH("hw.acpi.hpet.mmap_allow_write", &sc->mmap_allow_write); SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), From owner-svn-src-all@freebsd.org Wed Aug 17 09:20:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CFD1BBCA0E; Wed, 17 Aug 2016 09:20:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 698031DB1; Wed, 17 Aug 2016 09:20:36 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H9KZrH049826; Wed, 17 Aug 2016 09:20:35 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H9KZ8X049825; Wed, 17 Aug 2016 09:20:35 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201608170920.u7H9KZ8X049825@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 17 Aug 2016 09:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304280 - stable/11/sbin/pfctl X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 09:20:36 -0000 Author: kp Date: Wed Aug 17 09:20:35 2016 New Revision: 304280 URL: https://svnweb.freebsd.org/changeset/base/304280 Log: MFC r303663: pfctl: Allow TOS bits to be cleared TOS value 0 is valid, so use 256 as an invalid value rather than zero. This allows users to enforce TOS == 0 with pf. Reported by: Radek KrejÄa Modified: stable/11/sbin/pfctl/parse.y Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/pfctl/parse.y ============================================================================== --- stable/11/sbin/pfctl/parse.y Wed Aug 17 09:20:04 2016 (r304279) +++ stable/11/sbin/pfctl/parse.y Wed Aug 17 09:20:35 2016 (r304280) @@ -3593,8 +3593,8 @@ tos : STRING { else if ($1[0] == '0' && $1[1] == 'x') $$ = strtoul($1, NULL, 16); else - $$ = 0; /* flag bad argument */ - if (!$$ || $$ > 255) { + $$ = 256; /* flag bad argument */ + if ($$ < 0 || $$ > 255) { yyerror("illegal tos value %s", $1); free($1); YYERROR; @@ -3603,7 +3603,7 @@ tos : STRING { } | NUMBER { $$ = $1; - if (!$$ || $$ > 255) { + if ($$ < 0 || $$ > 255) { yyerror("illegal tos value %s", $1); YYERROR; } From owner-svn-src-all@freebsd.org Wed Aug 17 09:21:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FCFDBBCD77; Wed, 17 Aug 2016 09:21:57 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5A7312F1; Wed, 17 Aug 2016 09:21:56 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H9LuBh052551; Wed, 17 Aug 2016 09:21:56 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H9Lu6N052550; Wed, 17 Aug 2016 09:21:56 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201608170921.u7H9Lu6N052550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 17 Aug 2016 09:21:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304281 - stable/10/sbin/pfctl X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 09:21:57 -0000 Author: kp Date: Wed Aug 17 09:21:55 2016 New Revision: 304281 URL: https://svnweb.freebsd.org/changeset/base/304281 Log: MFC r303663: pfctl: Allow TOS bits to be cleared TOS value 0 is valid, so use 256 as an invalid value rather than zero. This allows users to enforce TOS == 0 with pf. Reported by: Radek KrejÄa Modified: stable/10/sbin/pfctl/parse.y Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/pfctl/parse.y ============================================================================== --- stable/10/sbin/pfctl/parse.y Wed Aug 17 09:20:35 2016 (r304280) +++ stable/10/sbin/pfctl/parse.y Wed Aug 17 09:21:55 2016 (r304281) @@ -3517,8 +3517,8 @@ tos : STRING { else if ($1[0] == '0' && $1[1] == 'x') $$ = strtoul($1, NULL, 16); else - $$ = 0; /* flag bad argument */ - if (!$$ || $$ > 255) { + $$ = 256; /* flag bad argument */ + if ($$ < 0 || $$ > 255) { yyerror("illegal tos value %s", $1); free($1); YYERROR; @@ -3527,7 +3527,7 @@ tos : STRING { } | NUMBER { $$ = $1; - if (!$$ || $$ > 255) { + if ($$ < 0 || $$ > 255) { yyerror("illegal tos value %s", $1); YYERROR; } From owner-svn-src-all@freebsd.org Wed Aug 17 09:23:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECD9DBBCF20; Wed, 17 Aug 2016 09:23:41 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCC90168F; Wed, 17 Aug 2016 09:23:41 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H9NegB053456; Wed, 17 Aug 2016 09:23:40 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H9NeGV053455; Wed, 17 Aug 2016 09:23:40 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201608170923.u7H9NeGV053455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 17 Aug 2016 09:23:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304282 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 09:23:42 -0000 Author: kp Date: Wed Aug 17 09:23:40 2016 New Revision: 304282 URL: https://svnweb.freebsd.org/changeset/base/304282 Log: MFC r302497: pf: Map hook returns onto the correct error values pf returns PF_PASS, PF_DROP, ... in the netpfil hooks, but the hook callers expect to get E error codes. Map the returns values. A pass is 0 (everything is OK), anything else means pf ate the packet, so return EACCES, which tells the stack not to emit an ICMP error message. PR: 207598 Modified: stable/11/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_ioctl.c Wed Aug 17 09:21:55 2016 (r304281) +++ stable/11/sys/netpfil/pf/pf_ioctl.c Wed Aug 17 09:23:40 2016 (r304282) @@ -3563,7 +3563,9 @@ pf_check_in(void *arg, struct mbuf **m, *m = NULL; } - return (chk); + if (chk != PF_PASS) + return (EACCES); + return (0); } static int @@ -3578,7 +3580,9 @@ pf_check_out(void *arg, struct mbuf **m, *m = NULL; } - return (chk); + if (chk != PF_PASS) + return (EACCES); + return (0); } #endif @@ -3601,7 +3605,9 @@ pf_check6_in(void *arg, struct mbuf **m, m_freem(*m); *m = NULL; } - return chk; + if (chk != PF_PASS) + return (EACCES); + return (0); } static int @@ -3617,7 +3623,9 @@ pf_check6_out(void *arg, struct mbuf **m m_freem(*m); *m = NULL; } - return chk; + if (chk != PF_PASS) + return (EACCES); + return (0); } #endif /* INET6 */ From owner-svn-src-all@freebsd.org Wed Aug 17 09:24:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 576A9BBCFC9; Wed, 17 Aug 2016 09:24:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 277DE186E; Wed, 17 Aug 2016 09:24:47 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H9OkhI053548; Wed, 17 Aug 2016 09:24:46 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H9OkTf053547; Wed, 17 Aug 2016 09:24:46 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201608170924.u7H9OkTf053547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 17 Aug 2016 09:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304283 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 09:24:47 -0000 Author: kp Date: Wed Aug 17 09:24:46 2016 New Revision: 304283 URL: https://svnweb.freebsd.org/changeset/base/304283 Log: MFC r302497: pf: Map hook returns onto the correct error values pf returns PF_PASS, PF_DROP, ... in the netpfil hooks, but the hook callers expect to get E error codes. Map the returns values. A pass is 0 (everything is OK), anything else means pf ate the packet, so return EACCES, which tells the stack not to emit an ICMP error message. PR: 207598 Modified: stable/10/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/10/sys/netpfil/pf/pf_ioctl.c Wed Aug 17 09:23:40 2016 (r304282) +++ stable/10/sys/netpfil/pf/pf_ioctl.c Wed Aug 17 09:24:46 2016 (r304283) @@ -3554,7 +3554,9 @@ pf_check_in(void *arg, struct mbuf **m, *m = NULL; } - return (chk); + if (chk != PF_PASS) + return (EACCES); + return (0); } static int @@ -3569,7 +3571,9 @@ pf_check_out(void *arg, struct mbuf **m, *m = NULL; } - return (chk); + if (chk != PF_PASS) + return (EACCES); + return (0); } #endif @@ -3592,7 +3596,9 @@ pf_check6_in(void *arg, struct mbuf **m, m_freem(*m); *m = NULL; } - return chk; + if (chk != PF_PASS) + return (EACCES); + return (0); } static int @@ -3608,7 +3614,9 @@ pf_check6_out(void *arg, struct mbuf **m m_freem(*m); *m = NULL; } - return chk; + if (chk != PF_PASS) + return (EACCES); + return (0); } #endif /* INET6 */ From owner-svn-src-all@freebsd.org Wed Aug 17 09:34:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29ADCBBD379; Wed, 17 Aug 2016 09:34:58 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED1E01F9C; Wed, 17 Aug 2016 09:34:57 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H9YvPT057248; Wed, 17 Aug 2016 09:34:57 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H9YvVl057246; Wed, 17 Aug 2016 09:34:57 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608170934.u7H9YvVl057246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Wed, 17 Aug 2016 09:34:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304284 - stable/11/lib/libc/gen X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 09:34:58 -0000 Author: ache Date: Wed Aug 17 09:34:56 2016 New Revision: 304284 URL: https://svnweb.freebsd.org/changeset/base/304284 Log: MFC r302943,r302944,r303004,r303010,r303011,r303013,r303014,r303074, r303088,r303142,r303208,r303210,r303530,r303536,r303564,r303565, r303706 In short: 1) All situations with glob(3) error return codes are well defined by POSIX, so rewrite old sporadic errors processing to match those definitions. Including subcases: Both C99 and POSIX directly prohibits any standard function to set errno to 0. Breaking this rule in 2001 NetBSD hack was imported which attempts to workaround very limited glob(3) return codes amount. Use POSIX-compatible workaround now with E2BIG which can't comes from other functions used instead of prohibited 0. Process errors happpens in (*readdirfunc)() too, as POSIX requires. Per POSIX GLOB_NOCHECK should return original pattern, unmodified, if no matches found. But our code strips all '\' returning it. Rewrite the code to allow to return original pattern. GLOB_ERR and gl_errfunc are supposed to work only for real directories per POSIX, so don't act on missing or plain files for ENOENT or ENOTDIR (as TODO in the code suggested). Remove the hack in the manpage describing how to skip ENOENT and ENOTDIR in gl_errfunc, it is unneeded now. Per POSIX GLOB_ERR must be considered even if gl_errfunc is not set, old code skips it in that case. 2) For near MAXPATHLEN long pathes old glob(3) code can operate on truncated results, prevent it in several places. 3) Results was not sorted according to collate as POSIX requires. 4) globtilde() forget to convert expanded user home dir from multibyte to wide chars. Moreover, those chars are addded as not protected, so can be treated as special chars. 5) Backward hack for EILSEQ in g_Ctoc() was not implemented, so all pathes with illegal byte sequences are skipped as result, implement it now. 6) GLOB_BRACE was somehow broken. First it repeatedly calls glob0() in globexp1() recursive calls, but glob0() was not supposed to be called repeatedly in the original code. It finalize results by possible adding original pattern for no match case, may return GLOB_NOMATCH error and by sorting all things. Original pattern adding or GLOB_NOMATCH error can happens each time glob0() called repeatedly, and sorting happens for one item only, all things are never sorted. Second, f.e. "a{a" pattern does not match "a{a" file but match "a" file instead. Third, some errors (f.e. for limits or overflow) can be ignored by GLOB_BRACE code because it forces return (0). Add non-finalizing flag to glob0() and make globexp0() wrapper around recursively called globexp1() to finalize things like glob0() does. Reorganize braces code to work correctly. 7) Don't allow MB_CUR_MAX * strlen overallocation hits GLOB_LIMIT_STRING (ARG_MAX) limit, use final string length, not malloced space for it. Modified: stable/11/lib/libc/gen/glob.3 stable/11/lib/libc/gen/glob.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/glob.3 ============================================================================== --- stable/11/lib/libc/gen/glob.3 Wed Aug 17 09:24:46 2016 (r304283) +++ stable/11/lib/libc/gen/glob.3 Wed Aug 17 09:34:56 2016 (r304284) @@ -275,24 +275,10 @@ is .Pf non- Dv NULL , .Fn glob calls -.Fa \*(lp*errfunc\*(rp Ns ( Fa path , errno ) . -This may be unintuitive: a pattern like -.Ql */Makefile -will try to -.Xr stat 2 -.Ql foo/Makefile -even if -.Ql foo -is not a directory, resulting in a -call to -.Fa errfunc . -The error routine can suppress this action by testing for -.Er ENOENT -and -.Er ENOTDIR ; +.Fa \*(lp*errfunc\*(rp Ns ( Fa path , errno ) , however, the .Dv GLOB_ERR -flag will still cause an immediate +flag will cause an immediate return when this happens. .Pp If @@ -377,7 +363,7 @@ file .It Dv GLOB_NOSPACE An attempt to allocate memory failed, or if .Fa errno -was 0 +was E2BIG, .Dv GLOB_LIMIT was specified in the flags and .Fa pglob\->gl_matchc Modified: stable/11/lib/libc/gen/glob.c ============================================================================== --- stable/11/lib/libc/gen/glob.c Wed Aug 17 09:24:46 2016 (r304283) +++ stable/11/lib/libc/gen/glob.c Wed Aug 17 09:34:56 2016 (r304284) @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); * 1. Patterns with illegal byte sequences match nothing - even if * GLOB_NOCHECK is specified. * 2. Illegal byte sequences in filenames are handled by treating them as - * single-byte characters with a value of the first byte of the sequence + * single-byte characters with a values of such bytes of the sequence * cast to wchar_t. * 3. State-dependent encodings are not currently supported. */ @@ -113,25 +113,20 @@ struct glob_limit { size_t l_string_cnt; }; -#define DOLLAR '$' -#define DOT '.' -#define EOS '\0' -#define LBRACKET '[' -#define NOT '!' -#define QUESTION '?' -#define QUOTE '\\' -#define RANGE '-' -#define RBRACKET ']' -#define SEP '/' -#define STAR '*' -#define TILDE '~' -#define UNDERSCORE '_' -#define LBRACE '{' -#define RBRACE '}' -#define SLASH '/' -#define COMMA ',' - -#ifndef DEBUG +#define DOT L'.' +#define EOS L'\0' +#define LBRACKET L'[' +#define NOT L'!' +#define QUESTION L'?' +#define QUOTE L'\\' +#define RANGE L'-' +#define RBRACKET L']' +#define SEP L'/' +#define STAR L'*' +#define TILDE L'~' +#define LBRACE L'{' +#define RBRACE L'}' +#define COMMA L',' #define M_QUOTE 0x8000000000ULL #define M_PROTECT 0x4000000000ULL @@ -140,28 +135,19 @@ struct glob_limit { typedef uint_fast64_t Char; -#else - -#define M_QUOTE 0x80 -#define M_PROTECT 0x40 -#define M_MASK 0xff -#define M_CHAR 0x7f - -typedef char Char; - -#endif - - #define CHAR(c) ((Char)((c)&M_CHAR)) #define META(c) ((Char)((c)|M_QUOTE)) -#define M_ALL META('*') -#define M_END META(']') -#define M_NOT META('!') -#define M_ONE META('?') -#define M_RNG META('-') -#define M_SET META('[') +#define UNPROT(c) ((c) & ~M_PROTECT) +#define M_ALL META(L'*') +#define M_END META(L']') +#define M_NOT META(L'!') +#define M_ONE META(L'?') +#define M_RNG META(L'-') +#define M_SET META(L'[') #define ismeta(c) (((c)&M_QUOTE) != 0) - +#ifdef DEBUG +#define isprot(c) (((c)&M_PROTECT) != 0) +#endif static int compare(const void *, const void *); static int g_Ctoc(const Char *, char *, size_t); @@ -172,19 +158,27 @@ static const Char *g_strchr(const Char * static Char *g_strcat(Char *, const Char *); #endif static int g_stat(Char *, struct stat *, glob_t *); -static int glob0(const Char *, glob_t *, struct glob_limit *); +static int glob0(const Char *, glob_t *, struct glob_limit *, + const char *); static int glob1(Char *, glob_t *, struct glob_limit *); static int glob2(Char *, Char *, Char *, Char *, glob_t *, struct glob_limit *); static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, struct glob_limit *); -static int globextend(const Char *, glob_t *, struct glob_limit *); +static int globextend(const Char *, glob_t *, struct glob_limit *, + const char *); static const Char * globtilde(const Char *, Char *, size_t, glob_t *); +static int globexp0(const Char *, glob_t *, struct glob_limit *, + const char *); static int globexp1(const Char *, glob_t *, struct glob_limit *); -static int globexp2(const Char *, const Char *, glob_t *, int *, +static int globexp2(const Char *, const Char *, glob_t *, struct glob_limit *); +static int globfinal(glob_t *, struct glob_limit *, size_t, + const char *); static int match(Char *, Char *, Char *); +static int err_nomatch(glob_t *, struct glob_limit *, const char *); +static int err_aborted(glob_t *, int, char *); #ifdef DEBUG static void qprintf(const char *, Char *); #endif @@ -199,6 +193,7 @@ glob(const char * __restrict pattern, in mbstate_t mbs; wchar_t wc; size_t clen; + int too_long; patnext = pattern; if (!(flags & GLOB_APPEND)) { @@ -218,24 +213,27 @@ glob(const char * __restrict pattern, in bufnext = patbuf; bufend = bufnext + MAXPATHLEN - 1; + too_long = 1; if (flags & GLOB_NOESCAPE) { memset(&mbs, 0, sizeof(mbs)); - while (bufend - bufnext >= MB_CUR_MAX) { + while (bufnext <= bufend) { clen = mbrtowc(&wc, patnext, MB_LEN_MAX, &mbs); if (clen == (size_t)-1 || clen == (size_t)-2) - return (GLOB_NOMATCH); - else if (clen == 0) + return (err_nomatch(pglob, &limit, pattern)); + else if (clen == 0) { + too_long = 0; break; + } *bufnext++ = wc; patnext += clen; } } else { /* Protect the quoted characters. */ memset(&mbs, 0, sizeof(mbs)); - while (bufend - bufnext >= MB_CUR_MAX) { - if (*patnext == QUOTE) { - if (*++patnext == EOS) { - *bufnext++ = QUOTE | M_PROTECT; + while (bufnext <= bufend) { + if (*patnext == '\\') { + if (*++patnext == '\0') { + *bufnext++ = QUOTE; continue; } prot = M_PROTECT; @@ -243,19 +241,47 @@ glob(const char * __restrict pattern, in prot = 0; clen = mbrtowc(&wc, patnext, MB_LEN_MAX, &mbs); if (clen == (size_t)-1 || clen == (size_t)-2) - return (GLOB_NOMATCH); - else if (clen == 0) + return (err_nomatch(pglob, &limit, pattern)); + else if (clen == 0) { + too_long = 0; break; + } *bufnext++ = wc | prot; patnext += clen; } } + if (too_long) + return (err_nomatch(pglob, &limit, pattern)); *bufnext = EOS; if (flags & GLOB_BRACE) - return (globexp1(patbuf, pglob, &limit)); + return (globexp0(patbuf, pglob, &limit, pattern)); else - return (glob0(patbuf, pglob, &limit)); + return (glob0(patbuf, pglob, &limit, pattern)); +} + +static int +globexp0(const Char *pattern, glob_t *pglob, struct glob_limit *limit, + const char *origpat) { + int rv; + size_t oldpathc; + + /* Protect a single {}, for find(1), like csh */ + if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) { + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + return (glob0(pattern, pglob, limit, origpat)); + } + + oldpathc = pglob->gl_pathc; + + if ((rv = globexp1(pattern, pglob, limit)) != 0) + return rv; + + return (globfinal(pglob, limit, oldpathc, origpat)); } /* @@ -266,24 +292,18 @@ glob(const char * __restrict pattern, in static int globexp1(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { - const Char* ptr = pattern; - int rv; + const Char* ptr; - if ((pglob->gl_flags & GLOB_LIMIT) && - limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { - errno = 0; - return (GLOB_NOSPACE); + if ((ptr = g_strchr(pattern, LBRACE)) != NULL) { + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + return (globexp2(ptr, pattern, pglob, limit)); } - /* Protect a single {}, for find(1), like csh */ - if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) - return glob0(pattern, pglob, limit); - - while ((ptr = g_strchr(ptr, LBRACE)) != NULL) - if (!globexp2(ptr, pattern, pglob, &rv, limit)) - return rv; - - return glob0(pattern, pglob, limit); + return (glob0(pattern, pglob, limit, NULL)); } @@ -293,10 +313,10 @@ globexp1(const Char *pattern, glob_t *pg * If it fails then it tries to glob the rest of the pattern and returns. */ static int -globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, +globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, struct glob_limit *limit) { - int i; + int i, rv; Char *lm, *ls; const Char *pe, *pm, *pm1, *pl; Char patbuf[MAXPATHLEN]; @@ -308,7 +328,7 @@ globexp2(const Char *ptr, const Char *pa ls = lm; /* Find the balanced brace */ - for (i = 0, pe = ++ptr; *pe; pe++) + for (i = 0, pe = ++ptr; *pe != EOS; pe++) if (*pe == LBRACKET) { /* Ignore everything between [] */ for (pm = pe++; *pe != RBRACKET && *pe != EOS; pe++) @@ -330,10 +350,8 @@ globexp2(const Char *ptr, const Char *pa } /* Non matching braces; just glob the pattern */ - if (i != 0 || *pe == EOS) { - *rv = glob0(patbuf, pglob, limit); - return (0); - } + if (i != 0 || *pe == EOS) + return (glob0(pattern, pglob, limit, NULL)); for (i = 0, pl = pm = ptr; pm <= pe; pm++) switch (*pm) { @@ -378,7 +396,9 @@ globexp2(const Char *ptr, const Char *pa #ifdef DEBUG qprintf("globexp2:", patbuf); #endif - *rv = globexp1(patbuf, pglob, limit); + rv = globexp1(patbuf, pglob, limit); + if (rv) + return (rv); /* move after the comma, to the next string */ pl = pm + 1; @@ -388,7 +408,6 @@ globexp2(const Char *ptr, const Char *pa default: break; } - *rv = 0; return (0); } @@ -401,9 +420,15 @@ static const Char * globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob) { struct passwd *pwd; - char *h; + char *h, *sc; const Char *p; Char *b, *eb; + wchar_t wc; + wchar_t wbuf[MAXPATHLEN]; + wchar_t *wbufend, *dc; + size_t clen; + mbstate_t mbs; + int too_long; if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE)) return (pattern); @@ -412,13 +437,17 @@ globtilde(const Char *pattern, Char *pat * Copy up to the end of the string or / */ eb = &patbuf[patbuf_len - 1]; - for (p = pattern + 1, h = (char *) patbuf; - h < (char *)eb && *p && *p != SLASH; *h++ = *p++) + for (p = pattern + 1, b = patbuf; + b < eb && *p != EOS && UNPROT(*p) != SEP; *b++ = *p++) continue; - *h = EOS; + if (*p != EOS && UNPROT(*p) != SEP) + return (NULL); - if (((char *) patbuf)[0] == EOS) { + *b = EOS; + h = NULL; + + if (patbuf[0] == EOS) { /* * handle a plain ~ or ~/ by expanding $HOME first (iff * we're not running setuid or setgid) and then trying @@ -438,20 +467,56 @@ globtilde(const Char *pattern, Char *pat /* * Expand a ~user */ - if ((pwd = getpwnam((char*) patbuf)) == NULL) + if (g_Ctoc(patbuf, (char *)wbuf, sizeof(wbuf))) + return (NULL); + if ((pwd = getpwnam((char *)wbuf)) == NULL) return (pattern); else h = pwd->pw_dir; } /* Copy the home directory */ - for (b = patbuf; b < eb && *h; *b++ = *h++) + dc = wbuf; + sc = h; + wbufend = wbuf + MAXPATHLEN - 1; + too_long = 1; + memset(&mbs, 0, sizeof(mbs)); + while (dc <= wbufend) { + clen = mbrtowc(&wc, sc, MB_LEN_MAX, &mbs); + if (clen == (size_t)-1 || clen == (size_t)-2) { + /* XXX See initial comment #2. */ + wc = (unsigned char)*sc; + clen = 1; + memset(&mbs, 0, sizeof(mbs)); + } + if ((*dc++ = wc) == EOS) { + too_long = 0; + break; + } + sc += clen; + } + if (too_long) + return (NULL); + + dc = wbuf; + for (b = patbuf; b < eb && *dc != EOS; *b++ = *dc++ | M_PROTECT) continue; + if (*dc != EOS) + return (NULL); /* Append the rest of the pattern */ - while (b < eb && (*b++ = *p++) != EOS) - continue; - *b = EOS; + if (*p != EOS) { + too_long = 1; + while (b <= eb) { + if ((*b++ = *p++) == EOS) { + too_long = 0; + break; + } + } + if (too_long) + return (NULL); + } else + *b = EOS; return (patbuf); } @@ -464,14 +529,18 @@ globtilde(const Char *pattern, Char *pat * if things went well, nonzero if errors occurred. */ static int -glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit) -{ +glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit, + const char *origpat) { const Char *qpatnext; int err; size_t oldpathc; Char *bufnext, c, patbuf[MAXPATHLEN]; qpatnext = globtilde(pattern, patbuf, MAXPATHLEN, pglob); + if (qpatnext == NULL) { + errno = E2BIG; + return (GLOB_NOSPACE); + } oldpathc = pglob->gl_pathc; bufnext = patbuf; @@ -530,30 +599,29 @@ glob0(const Char *pattern, glob_t *pglob if ((err = glob1(patbuf, pglob, limit)) != 0) return(err); - /* - * If there was no match we are going to append the pattern - * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified - * and the pattern did not contain any magic characters - * GLOB_NOMAGIC is there just for compatibility with csh. - */ - if (pglob->gl_pathc == oldpathc) { - if (((pglob->gl_flags & GLOB_NOCHECK) || - ((pglob->gl_flags & GLOB_NOMAGIC) && - !(pglob->gl_flags & GLOB_MAGCHAR)))) - return (globextend(pattern, pglob, limit)); - else - return (GLOB_NOMATCH); - } + if (origpat != NULL) + return (globfinal(pglob, limit, oldpathc, origpat)); + + return (0); +} + +static int +globfinal(glob_t *pglob, struct glob_limit *limit, size_t oldpathc, + const char *origpat) { + if (pglob->gl_pathc == oldpathc) + return (err_nomatch(pglob, limit, origpat)); + if (!(pglob->gl_flags & GLOB_NOSORT)) qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc, pglob->gl_pathc - oldpathc, sizeof(char *), compare); + return (0); } static int compare(const void *p, const void *q) { - return (strcmp(*(char **)p, *(char **)q)); + return (strcoll(*(char **)p, *(char **)q)); } static int @@ -593,44 +661,47 @@ glob2(Char *pathbuf, Char *pathend, Char if ((pglob->gl_flags & GLOB_LIMIT) && limit->l_stat_cnt++ >= GLOB_LIMIT_STAT) { - errno = 0; - if (pathend + 1 > pathend_last) - return (GLOB_ABORTED); - *pathend++ = SEP; - *pathend = EOS; + errno = E2BIG; return (GLOB_NOSPACE); } - if (((pglob->gl_flags & GLOB_MARK) && - pathend[-1] != SEP) && (S_ISDIR(sb.st_mode) - || (S_ISLNK(sb.st_mode) && - (g_stat(pathbuf, &sb, pglob) == 0) && + if ((pglob->gl_flags & GLOB_MARK) && + UNPROT(pathend[-1]) != SEP && + (S_ISDIR(sb.st_mode) || + (S_ISLNK(sb.st_mode) && + g_stat(pathbuf, &sb, pglob) == 0 && S_ISDIR(sb.st_mode)))) { - if (pathend + 1 > pathend_last) - return (GLOB_ABORTED); + if (pathend + 1 > pathend_last) { + errno = E2BIG; + return (GLOB_NOSPACE); + } *pathend++ = SEP; *pathend = EOS; } ++pglob->gl_matchc; - return (globextend(pathbuf, pglob, limit)); + return (globextend(pathbuf, pglob, limit, NULL)); } /* Find end of next segment, copy tentatively to pathend. */ q = pathend; p = pattern; - while (*p != EOS && *p != SEP) { + while (*p != EOS && UNPROT(*p) != SEP) { if (ismeta(*p)) anymeta = 1; - if (q + 1 > pathend_last) - return (GLOB_ABORTED); + if (q + 1 > pathend_last) { + errno = E2BIG; + return (GLOB_NOSPACE); + } *q++ = *p++; } if (!anymeta) { /* No expansion, do next segment. */ pathend = q; pattern = p; - while (*pattern == SEP) { - if (pathend + 1 > pathend_last) - return (GLOB_ABORTED); + while (UNPROT(*pattern) == SEP) { + if (pathend + 1 > pathend_last) { + errno = E2BIG; + return (GLOB_NOSPACE); + } *pathend++ = *pattern++; } } else /* Need expansion, recurse. */ @@ -647,26 +718,31 @@ glob3(Char *pathbuf, Char *pathend, Char { struct dirent *dp; DIR *dirp; - int err; - char buf[MAXPATHLEN]; + int err, too_long, saverrno, saverrno2; + char buf[MAXPATHLEN + MB_LEN_MAX - 1]; struct dirent *(*readdirfunc)(DIR *); - if (pathend > pathend_last) - return (GLOB_ABORTED); + if (pathend > pathend_last) { + errno = E2BIG; + return (GLOB_NOSPACE); + } *pathend = EOS; - errno = 0; + if (pglob->gl_errfunc != NULL && + g_Ctoc(pathbuf, buf, sizeof(buf))) { + errno = E2BIG; + return (GLOB_NOSPACE); + } + saverrno = errno; + errno = 0; if ((dirp = g_opendir(pathbuf, pglob)) == NULL) { - /* TODO: don't call for ENOENT or ENOTDIR? */ - if (pglob->gl_errfunc) { - if (g_Ctoc(pathbuf, buf, sizeof(buf))) - return (GLOB_ABORTED); - if (pglob->gl_errfunc(buf, errno) || - pglob->gl_flags & GLOB_ERR) - return (GLOB_ABORTED); - } - return (0); + if (errno == ENOENT || errno == ENOTDIR) + return (0); + err = err_aborted(pglob, errno, buf); + if (errno == 0) + errno = saverrno; + return (err); } err = 0; @@ -677,6 +753,7 @@ glob3(Char *pathbuf, Char *pathend, Char else readdirfunc = readdir; + errno = 0; /* Search directory for matching names. */ while ((dp = (*readdirfunc)(dirp)) != NULL) { char *sc; @@ -687,49 +764,70 @@ glob3(Char *pathbuf, Char *pathend, Char if ((pglob->gl_flags & GLOB_LIMIT) && limit->l_readdir_cnt++ >= GLOB_LIMIT_READDIR) { - errno = 0; - if (pathend + 1 > pathend_last) - err = GLOB_ABORTED; - else { - *pathend++ = SEP; - *pathend = EOS; - err = GLOB_NOSPACE; - } + errno = E2BIG; + err = GLOB_NOSPACE; break; } /* Initial DOT must be matched literally. */ - if (dp->d_name[0] == DOT && *pattern != DOT) + if (dp->d_name[0] == '.' && UNPROT(*pattern) != DOT) { + errno = 0; continue; + } memset(&mbs, 0, sizeof(mbs)); dc = pathend; sc = dp->d_name; - while (dc < pathend_last) { + too_long = 1; + while (dc <= pathend_last) { clen = mbrtowc(&wc, sc, MB_LEN_MAX, &mbs); if (clen == (size_t)-1 || clen == (size_t)-2) { - wc = *sc; + /* XXX See initial comment #2. */ + wc = (unsigned char)*sc; clen = 1; memset(&mbs, 0, sizeof(mbs)); } - if ((*dc++ = wc) == EOS) + if ((*dc++ = wc) == EOS) { + too_long = 0; break; + } sc += clen; } - if (!match(pathend, pattern, restpattern)) { + if (too_long && (err = err_aborted(pglob, ENAMETOOLONG, + buf))) { + errno = ENAMETOOLONG; + break; + } + if (too_long || !match(pathend, pattern, restpattern)) { *pathend = EOS; + errno = 0; continue; } + if (errno == 0) + errno = saverrno; err = glob2(pathbuf, --dc, pathend_last, restpattern, pglob, limit); if (err) break; + errno = 0; } + saverrno2 = errno; if (pglob->gl_flags & GLOB_ALTDIRFUNC) (*pglob->gl_closedir)(dirp); else closedir(dirp); - return (err); + errno = saverrno2; + + if (err) + return (err); + + if (dp == NULL && errno != 0 && + (err = err_aborted(pglob, errno, buf))) + return (err); + + if (errno == 0) + errno = saverrno; + return (0); } @@ -748,7 +846,8 @@ glob3(Char *pathbuf, Char *pathend, Char * gl_pathv points to (gl_offs + gl_pathc + 1) items. */ static int -globextend(const Char *path, glob_t *pglob, struct glob_limit *limit) +globextend(const Char *path, glob_t *pglob, struct glob_limit *limit, + const char *origpat) { char **pathv; size_t i, newsize, len; @@ -757,7 +856,7 @@ globextend(const Char *path, glob_t *pgl if ((pglob->gl_flags & GLOB_LIMIT) && pglob->gl_matchc > limit->l_path_lim) { - errno = 0; + errno = E2BIG; return (GLOB_NOSPACE); } @@ -775,18 +874,26 @@ globextend(const Char *path, glob_t *pgl } pglob->gl_pathv = pathv; - for (p = path; *p++;) - continue; - len = MB_CUR_MAX * (size_t)(p - path); /* XXX overallocation */ - limit->l_string_cnt += len; - if ((pglob->gl_flags & GLOB_LIMIT) && - limit->l_string_cnt >= GLOB_LIMIT_STRING) { - errno = 0; - return (GLOB_NOSPACE); + if (origpat != NULL) + copy = strdup(origpat); + else { + for (p = path; *p++ != EOS;) + continue; + len = MB_CUR_MAX * (size_t)(p - path); /* XXX overallocation */ + if ((copy = malloc(len)) != NULL) { + if (g_Ctoc(path, copy, len)) { + free(copy); + errno = E2BIG; + return (GLOB_NOSPACE); + } + } } - if ((copy = malloc(len)) != NULL) { - if (g_Ctoc(path, copy, len)) { + if (copy != NULL) { + limit->l_string_cnt += strlen(copy) + 1; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_string_cnt >= GLOB_LIMIT_STRING) { free(copy); + errno = E2BIG; return (GLOB_NOSPACE); } pathv[pglob->gl_offs + pglob->gl_pathc++] = copy; @@ -826,15 +933,17 @@ match(Char *name, Char *pat, Char *paten ok = 0; if ((k = *name++) == EOS) return (0); - if ((negate_range = ((*pat & M_MASK) == M_NOT)) != EOS) + if ((negate_range = ((*pat & M_MASK) == M_NOT)) != 0) ++pat; while (((c = *pat++) & M_MASK) != M_END) if ((*pat & M_MASK) == M_RNG) { if (table->__collate_load_error ? - CHAR(c) <= CHAR(k) && CHAR(k) <= CHAR(pat[1]) : - __wcollate_range_cmp(CHAR(c), CHAR(k)) <= 0 - && __wcollate_range_cmp(CHAR(k), CHAR(pat[1])) <= 0 - ) + CHAR(c) <= CHAR(k) && + CHAR(k) <= CHAR(pat[1]) : + __wcollate_range_cmp(CHAR(c), + CHAR(k)) <= 0 && + __wcollate_range_cmp(CHAR(k), + CHAR(pat[1])) <= 0) ok = 1; pat += 2; } else if (c == k) @@ -871,13 +980,15 @@ globfree(glob_t *pglob) static DIR * g_opendir(Char *str, glob_t *pglob) { - char buf[MAXPATHLEN]; + char buf[MAXPATHLEN + MB_LEN_MAX - 1]; - if (!*str) + if (*str == EOS) strcpy(buf, "."); else { - if (g_Ctoc(str, buf, sizeof(buf))) + if (g_Ctoc(str, buf, sizeof(buf))) { + errno = ENAMETOOLONG; return (NULL); + } } if (pglob->gl_flags & GLOB_ALTDIRFUNC) @@ -889,7 +1000,7 @@ g_opendir(Char *str, glob_t *pglob) static int g_lstat(Char *fn, struct stat *sb, glob_t *pglob) { - char buf[MAXPATHLEN]; + char buf[MAXPATHLEN + MB_LEN_MAX - 1]; if (g_Ctoc(fn, buf, sizeof(buf))) { errno = ENAMETOOLONG; @@ -903,7 +1014,7 @@ g_lstat(Char *fn, struct stat *sb, glob_ static int g_stat(Char *fn, struct stat *sb, glob_t *pglob) { - char buf[MAXPATHLEN]; + char buf[MAXPATHLEN + MB_LEN_MAX - 1]; if (g_Ctoc(fn, buf, sizeof(buf))) { errno = ENAMETOOLONG; @@ -933,10 +1044,14 @@ g_Ctoc(const Char *str, char *buf, size_ memset(&mbs, 0, sizeof(mbs)); while (len >= MB_CUR_MAX) { - clen = wcrtomb(buf, *str, &mbs); - if (clen == (size_t)-1) - return (1); - if (*str == L'\0') + clen = wcrtomb(buf, CHAR(*str), &mbs); + if (clen == (size_t)-1) { + /* XXX See initial comment #2. */ + *buf = (char)CHAR(*str); + clen = 1; + memset(&mbs, 0, sizeof(mbs)); + } + if (CHAR(*str) == EOS) return (0); str++; buf += clen; @@ -945,21 +1060,46 @@ g_Ctoc(const Char *str, char *buf, size_ return (1); } +static int +err_nomatch(glob_t *pglob, struct glob_limit *limit, const char *origpat) { + /* + * If there was no match we are going to append the origpat + * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified + * and the origpat did not contain any magic characters + * GLOB_NOMAGIC is there just for compatibility with csh. + */ + if ((pglob->gl_flags & GLOB_NOCHECK) || + ((pglob->gl_flags & GLOB_NOMAGIC) && + !(pglob->gl_flags & GLOB_MAGCHAR))) + return (globextend(NULL, pglob, limit, origpat)); + return (GLOB_NOMATCH); +} + +static int +err_aborted(glob_t *pglob, int err, char *buf) { + if ((pglob->gl_errfunc != NULL && pglob->gl_errfunc(buf, err)) || + (pglob->gl_flags & GLOB_ERR)) + return (GLOB_ABORTED); + return (0); +} + #ifdef DEBUG static void qprintf(const char *str, Char *s) { Char *p; - (void)printf("%s:\n", str); - for (p = s; *p; p++) - (void)printf("%c", CHAR(*p)); - (void)printf("\n"); - for (p = s; *p; p++) - (void)printf("%c", *p & M_PROTECT ? '"' : ' '); - (void)printf("\n"); - for (p = s; *p; p++) - (void)printf("%c", ismeta(*p) ? '_' : ' '); - (void)printf("\n"); + (void)printf("%s\n", str); + if (s != NULL) { + for (p = s; *p != EOS; p++) + (void)printf("%c", (char)CHAR(*p)); + (void)printf("\n"); + for (p = s; *p != EOS; p++) + (void)printf("%c", (isprot(*p) ? '\\' : ' ')); + (void)printf("\n"); + for (p = s; *p != EOS; p++) + (void)printf("%c", (ismeta(*p) ? '_' : ' ')); + (void)printf("\n"); + } } #endif From owner-svn-src-all@freebsd.org Wed Aug 17 09:52:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4252BBD812; Wed, 17 Aug 2016 09:52:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ECFE1BED; Wed, 17 Aug 2016 09:52:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7H9qCrJ064355; Wed, 17 Aug 2016 09:52:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7H9qA2B064331; Wed, 17 Aug 2016 09:52:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608170952.u7H9qA2B064331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Aug 2016 09:52:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304285 - in head: lib/libc lib/libc/aarch64/sys lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/sys lib/libc/x86 lib/libc/x86/sys sys/arm/arm sys/arm/include sys/arm64/a... 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 09:52:13 -0000 Author: kib Date: Wed Aug 17 09:52:09 2016 New Revision: 304285 URL: https://svnweb.freebsd.org/changeset/base/304285 Log: Implement userspace gettimeofday(2) with HPET timecounter. Right now, userspace (fast) gettimeofday(2) on x86 only works for RDTSC. For older machines, like Core2, where RDTSC is not C2/C3 invariant, and which fall to HPET hardware, this means that the call has both the penalty of the syscall and of the uncached hw behind the QPI or PCIe connection to the sought bridge. Nothing can me done against the access latency, but the syscall overhead can be removed. System already provides mappable /dev/hpetX devices, which gives straight access to the HPET registers page. Add yet another algorithm to the x86 'vdso' timehands. Libc is updated to handle both RDTSC and HPET. For HPET, the index of the hpet device to mmap is passed from kernel to userspace, index might be changed and libc invalidates its mapping as needed. Remove cpu_fill_vdso_timehands() KPI, instead require that timecounters which can be used from userspace, to provide tc_fill_vdso_timehands{,32}() methods. Merge i386 and amd64 libc//sys/__vdso_gettc.c into one source file in the new libc/x86/sys location. __vdso_gettc() internal interface is changed to move timecounter algorithm detection into the MD code. Measurements show that RDTSC even with the syscall overhead is faster than userspace HPET access. But still, userspace HPET is three-four times faster than syscall HPET on several Core2 and SandyBridge machines. Tested by: Howard Su Sponsored by: The FreeBSD Foundation MFC after: 1 month Differential revision: https://reviews.freebsd.org/D7473 Added: head/lib/libc/x86/ head/lib/libc/x86/sys/ head/lib/libc/x86/sys/Makefile.inc (contents, props changed) head/lib/libc/x86/sys/__vdso_gettc.c - copied, changed from r304281, head/lib/libc/i386/sys/__vdso_gettc.c Deleted: head/lib/libc/amd64/sys/__vdso_gettc.c head/lib/libc/i386/sys/__vdso_gettc.c Modified: head/lib/libc/Makefile head/lib/libc/aarch64/sys/__vdso_gettc.c head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/arm/sys/__vdso_gettc.c head/lib/libc/i386/sys/Makefile.inc head/lib/libc/sys/__vdso_gettimeofday.c head/lib/libc/sys/trivial-vdso_tc.c head/sys/arm/arm/generic_timer.c head/sys/arm/arm/machdep.c head/sys/arm/include/md_var.h head/sys/arm/include/vdso.h head/sys/arm64/arm64/machdep.c head/sys/arm64/include/md_var.h head/sys/arm64/include/vdso.h head/sys/dev/acpica/acpi_hpet.c head/sys/dev/acpica/acpi_hpet.h head/sys/kern/kern_tc.c head/sys/sys/timetc.h head/sys/sys/vdso.h head/sys/x86/include/vdso.h head/sys/x86/x86/tsc.c Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Wed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/Makefile Wed Aug 17 09:52:09 2016 (r304285) @@ -110,6 +110,9 @@ NOASM= ${LIBC_ARCH} == "mips" .include "${LIBC_SRCTOP}/softfloat/Makefile.inc" .endif +.if ${LIBC_ARCH} == "i386" || ${LIBC_ARCH} == "amd64" +.include "${LIBC_SRCTOP}/x86/sys/Makefile.inc" +.endif .if ${MK_NIS} != "no" CFLAGS+= -DYP .include "${LIBC_SRCTOP}/yp/Makefile.inc" Modified: head/lib/libc/aarch64/sys/__vdso_gettc.c ============================================================================== --- head/lib/libc/aarch64/sys/__vdso_gettc.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/aarch64/sys/__vdso_gettc.c Wed Aug 17 09:52:09 2016 (r304285) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libc_private.h" static inline uint64_t @@ -55,14 +56,15 @@ cp15_cntpct_get(void) } #pragma weak __vdso_gettc -u_int -__vdso_gettc(const struct vdso_timehands *th) +int +__vdso_gettc(const struct vdso_timehands *th, u_int *tc) { - uint64_t val; + if (th->th_algo != VDSO_TH_ALGO_ARM_GENTIM) + return (ENOSYS); __asm __volatile("isb" : : : "memory"); - val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); - return (val); + *tc = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); + return (0); } #pragma weak __vdso_gettimekeep Modified: head/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- head/lib/libc/amd64/sys/Makefile.inc Wed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/amd64/sys/Makefile.inc Wed Aug 17 09:52:09 2016 (r304285) @@ -2,7 +2,7 @@ # $FreeBSD$ SRCS+= amd64_get_fsbase.c amd64_get_gsbase.c amd64_set_fsbase.c \ - amd64_set_gsbase.c __vdso_gettc.c + amd64_set_gsbase.c MDASM= vfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \ sbrk.S setlogin.S sigreturn.S Modified: head/lib/libc/arm/sys/__vdso_gettc.c ============================================================================== --- head/lib/libc/arm/sys/__vdso_gettc.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/arm/sys/__vdso_gettc.c Wed Aug 17 09:52:09 2016 (r304285) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libc_private.h" #if __ARM_ARCH >= 6 @@ -58,11 +59,12 @@ cp15_cntpct_get(void) #endif #pragma weak __vdso_gettc -u_int -__vdso_gettc(const struct vdso_timehands *th) +int +__vdso_gettc(const struct vdso_timehands *th, u_int *tc) { - uint64_t val; + if (th->th_algo != VDSO_TH_ALGO_ARM_GENTIM) + return (ENOSYS); #if __ARM_ARCH >= 6 /* * Userspace gettimeofday() is only enabled on ARMv7 CPUs, but @@ -70,11 +72,12 @@ __vdso_gettc(const struct vdso_timehands * armv7-a directive does not work. */ __asm __volatile(".word\t0xf57ff06f" : : : "memory"); /* isb */ - val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); + *tc = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); + return (0); #else - val = 0; + *tc = 0; + return (ENOSYS); #endif - return (val); } #pragma weak __vdso_gettimekeep Modified: head/lib/libc/i386/sys/Makefile.inc ============================================================================== --- head/lib/libc/i386/sys/Makefile.inc Wed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/i386/sys/Makefile.inc Wed Aug 17 09:52:09 2016 (r304285) @@ -5,8 +5,7 @@ SRCS+= i386_clr_watch.c i386_set_watch.c i386_vm86.c .endif SRCS+= i386_get_fsbase.c i386_get_gsbase.c i386_get_ioperm.c i386_get_ldt.c \ - i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c \ - __vdso_gettc.c + i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \ sbrk.S setlogin.S sigreturn.S syscall.S Modified: head/lib/libc/sys/__vdso_gettimeofday.c ============================================================================== --- head/lib/libc/sys/__vdso_gettimeofday.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/sys/__vdso_gettimeofday.c Wed Aug 17 09:52:09 2016 (r304285) @@ -34,12 +34,16 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" -static u_int -tc_delta(const struct vdso_timehands *th) +static int +tc_delta(const struct vdso_timehands *th, u_int *delta) { + int error; + u_int tc; - return ((__vdso_gettc(th) - th->th_offset_count) & - th->th_counter_mask); + error = __vdso_gettc(th, &tc); + if (error == 0) + *delta = (tc - th->th_offset_count) & th->th_counter_mask; + return (error); } /* @@ -56,6 +60,8 @@ binuptime(struct bintime *bt, struct vds { struct vdso_timehands *th; uint32_t curr, gen; + u_int delta; + int error; do { if (!tk->tk_enabled) @@ -63,11 +69,14 @@ binuptime(struct bintime *bt, struct vds curr = atomic_load_acq_32(&tk->tk_current); th = &tk->tk_th[curr]; - if (th->th_algo != VDSO_TH_ALGO_1) - return (ENOSYS); gen = atomic_load_acq_32(&th->th_gen); *bt = th->th_offset; - bintime_addx(bt, th->th_scale * tc_delta(th)); + error = tc_delta(th, &delta); + if (error == EAGAIN) + continue; + if (error != 0) + return (error); + bintime_addx(bt, th->th_scale * delta); if (abs) bintime_add(bt, &th->th_boottime); Modified: head/lib/libc/sys/trivial-vdso_tc.c ============================================================================== --- head/lib/libc/sys/trivial-vdso_tc.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/lib/libc/sys/trivial-vdso_tc.c Wed Aug 17 09:52:09 2016 (r304285) @@ -32,11 +32,11 @@ __FBSDID("$FreeBSD$"); #include #pragma weak __vdso_gettc -u_int -__vdso_gettc(const struct vdso_timehands *th) +int +__vdso_gettc(const struct vdso_timehands *th, u_int *tc) { - return (0); + return (ENOSYS); } #pragma weak __vdso_gettimekeep Added: head/lib/libc/x86/sys/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/x86/sys/Makefile.inc Wed Aug 17 09:52:09 2016 (r304285) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +.PATH: ${LIBC_SRCTOP}/x86/sys + +SRCS+= \ + __vdso_gettc.c Copied and modified: head/lib/libc/x86/sys/__vdso_gettc.c (from r304281, head/lib/libc/i386/sys/__vdso_gettc.c) ============================================================================== --- head/lib/libc/i386/sys/__vdso_gettc.c Wed Aug 17 09:21:55 2016 (r304281, copy source) +++ head/lib/libc/x86/sys/__vdso_gettc.c Wed Aug 17 09:52:09 2016 (r304285) @@ -1,5 +1,10 @@ /*- * Copyright (c) 2012 Konstantin Belousov + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -26,19 +31,27 @@ #include __FBSDID("$FreeBSD$"); -#include +#include +#include "namespace.h" #include +#include +#include #include #include +#include +#include +#include +#include "un-namespace.h" #include #include +#include #include "libc_private.h" -static int lfence_works = -1; - -static int -get_lfence_usage(void) +static void +lfence_mb(void) { +#if defined(__i386__) + static int lfence_works = -1; u_int cpuid_supported, p[4]; if (lfence_works == -1) { @@ -57,7 +70,7 @@ get_lfence_usage(void) " jmp 2f\n" "1: movl $0,%0\n" "2:\n" - : "=r" (cpuid_supported) : : "eax", "ecx"); + : "=r" (cpuid_supported) : : "eax", "ecx", "cc"); if (cpuid_supported) { __asm __volatile( " pushl %%ebx\n" @@ -70,16 +83,21 @@ get_lfence_usage(void) } else lfence_works = 0; } - return (lfence_works); + if (lfence_works == 1) + lfence(); +#elif defined(__amd64__) + lfence(); +#else +#error "arch" +#endif } static u_int -__vdso_gettc_low(const struct vdso_timehands *th) +__vdso_gettc_rdtsc_low(const struct vdso_timehands *th) { u_int rv; - if (get_lfence_usage() == 1) - lfence(); + lfence_mb(); __asm __volatile("rdtsc; shrd %%cl, %%edx, %0" : "=a" (rv) : "c" (th->th_x86_shift) : "edx"); return (rv); @@ -88,21 +106,68 @@ __vdso_gettc_low(const struct vdso_timeh static u_int __vdso_rdtsc32(void) { - u_int rv; - if (get_lfence_usage() == 1) - lfence(); - rv = rdtsc32(); - return (rv); + lfence_mb(); + return (rdtsc32()); +} + +static char *hpet_dev_map = NULL; +static uint32_t hpet_idx = 0xffffffff; + +static void +__vdso_init_hpet(uint32_t u) +{ + static const char devprefix[] = "/dev/hpet"; + char devname[64], *c, *c1, t; + int fd; + + c1 = c = stpcpy(devname, devprefix); + u = hpet_idx; + do { + *c++ = u % 10 + '0'; + u /= 10; + } while (u != 0); + *c = '\0'; + for (c--; c1 != c; c1++, c--) { + t = *c1; + *c1 = *c; + *c = t; + } + fd = _open(devname, O_RDONLY); + if (fd == -1) { + hpet_dev_map = MAP_FAILED; + return; + } + if (hpet_dev_map != NULL && hpet_dev_map != MAP_FAILED) + munmap(hpet_dev_map, PAGE_SIZE); + hpet_dev_map = mmap(NULL, PAGE_SIZE, PROT_READ, MAP_SHARED, fd, 0); + _close(fd); } #pragma weak __vdso_gettc -u_int -__vdso_gettc(const struct vdso_timehands *th) +int +__vdso_gettc(const struct vdso_timehands *th, u_int *tc) { + uint32_t tmp; - return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : - __vdso_rdtsc32()); + switch (th->th_algo) { + case VDSO_TH_ALGO_X86_TSC: + *tc = th->th_x86_shift > 0 ? __vdso_gettc_rdtsc_low(th) : + __vdso_rdtsc32(); + return (0); + case VDSO_TH_ALGO_X86_HPET: + tmp = th->th_x86_hpet_idx; + if (hpet_dev_map == NULL || tmp != hpet_idx) { + hpet_idx = tmp; + __vdso_init_hpet(hpet_idx); + } + if (hpet_dev_map == MAP_FAILED) + return (ENOSYS); + *tc = *(volatile uint32_t *)(hpet_dev_map + HPET_MAIN_COUNTER); + return (0); + default: + return (ENOSYS); + } } #pragma weak __vdso_gettimekeep Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/arm/arm/generic_timer.c Wed Aug 17 09:52:09 2016 (r304285) @@ -105,6 +105,10 @@ static struct resource_spec timer_spec[] { -1, 0 } }; +static uint32_t arm_tmr_fill_vdso_timehands(struct vdso_timehands *vdso_th, + struct timecounter *tc); +static void arm_tmr_do_delay(int usec, void *); + static timecounter_get_t arm_tmr_get_timecount; static struct timecounter arm_tmr_timecount = { @@ -114,6 +118,7 @@ static struct timecounter arm_tmr_timeco .tc_counter_mask = ~0u, .tc_frequency = 0, .tc_quality = 1000, + .tc_fill_vdso_timehands = arm_tmr_fill_vdso_timehands, }; #ifdef __arm__ @@ -128,10 +133,6 @@ static struct timecounter arm_tmr_timeco #define set_el1(x, val) WRITE_SPECIALREG(x ##_el1, val) #endif -static uint32_t arm_tmr_fill_vdso_timehands(struct vdso_timehands *vdso_th, - struct timecounter *tc); -static void arm_tmr_do_delay(int usec, void *); - static int get_freq(void) { @@ -412,8 +413,6 @@ arm_tmr_attach(device_t dev) } } - arm_cpu_fill_vdso_timehands = arm_tmr_fill_vdso_timehands; - arm_tmr_timecount.tc_frequency = sc->clkfreq; tc_init(&arm_tmr_timecount); @@ -535,7 +534,8 @@ arm_tmr_fill_vdso_timehands(struct vdso_ struct timecounter *tc) { + vdso_th->th_algo = VDSO_TH_ALGO_ARM_GENTIM; vdso_th->th_physical = arm_tmr_sc->physical; bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); - return (tc == &arm_tmr_timecount); + return (1); } Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/arm/arm/machdep.c Wed Aug 17 09:52:09 2016 (r304285) @@ -2003,14 +2003,3 @@ initarm(struct arm_boot_params *abp) #endif /* __ARM_ARCH < 6 */ #endif /* FDT */ - -uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, - struct timecounter *); - -uint32_t -cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) -{ - - return (arm_cpu_fill_vdso_timehands != NULL ? - arm_cpu_fill_vdso_timehands(vdso_th, tc) : 0); -} Modified: head/sys/arm/include/md_var.h ============================================================================== --- head/sys/arm/include/md_var.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/arm/include/md_var.h Wed Aug 17 09:52:09 2016 (r304285) @@ -45,11 +45,6 @@ extern int (*_arm_bzero)(void *, int, in extern int _min_memcpy_size; extern int _min_bzero_size; -struct vdso_timehands; -struct timecounter; -extern uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, - struct timecounter *); - #define DST_IS_USER 0x1 #define SRC_IS_USER 0x2 #define IS_PHYSICAL 0x4 Modified: head/sys/arm/include/vdso.h ============================================================================== --- head/sys/arm/include/vdso.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/arm/include/vdso.h Wed Aug 17 09:52:09 2016 (r304285) @@ -32,4 +32,6 @@ uint32_t th_physical; \ uint32_t th_res[7]; +#define VDSO_TH_ALGO_ARM_GENTIM VDSO_TH_ALGO_1 + #endif Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/arm64/arm64/machdep.c Wed Aug 17 09:52:09 2016 (r304285) @@ -1005,17 +1005,6 @@ initarm(struct arm64_bootparams *abp) early_boot = 0; } -uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, - struct timecounter *); - -uint32_t -cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) -{ - - return (arm_cpu_fill_vdso_timehands != NULL ? - arm_cpu_fill_vdso_timehands(vdso_th, tc) : 0); -} - #ifdef DDB #include Modified: head/sys/arm64/include/md_var.h ============================================================================== --- head/sys/arm64/include/md_var.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/arm64/include/md_var.h Wed Aug 17 09:52:09 2016 (r304285) @@ -47,9 +47,4 @@ void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); int minidumpsys(struct dumperinfo *); -struct vdso_timehands; -struct timecounter; -extern uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, - struct timecounter *); - #endif /* !_MACHINE_MD_VAR_H_ */ Modified: head/sys/arm64/include/vdso.h ============================================================================== --- head/sys/arm64/include/vdso.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/arm64/include/vdso.h Wed Aug 17 09:52:09 2016 (r304285) @@ -32,4 +32,6 @@ uint32_t th_physical; \ uint32_t th_res[7]; +#define VDSO_TH_ALGO_ARM_GENTIM VDSO_TH_ALGO_1 + #endif /* !_MACHINE_VDSO_H_ */ Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/dev/acpica/acpi_hpet.c Wed Aug 17 09:52:09 2016 (r304285) @@ -29,6 +29,8 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" +#include "opt_compat.h" + #if defined(__amd64__) #define DEV_APIC #else @@ -47,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -141,6 +144,35 @@ hpet_get_timecount(struct timecounter *t return (bus_read_4(sc->mem_res, HPET_MAIN_COUNTER)); } +uint32_t +hpet_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) +{ + struct hpet_softc *sc; + + sc = tc->tc_priv; + vdso_th->th_algo = VDSO_TH_ALGO_X86_HPET; + vdso_th->th_x86_shift = 0; + vdso_th->th_x86_hpet_idx = device_get_unit(sc->dev); + bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); + return (sc->mmap_allow != 0); +} + +#ifdef COMPAT_FREEBSD32 +uint32_t +hpet_vdso_timehands32(struct vdso_timehands32 *vdso_th32, + struct timecounter *tc) +{ + struct hpet_softc *sc; + + sc = tc->tc_priv; + vdso_th32->th_algo = VDSO_TH_ALGO_X86_HPET; + vdso_th32->th_x86_shift = 0; + vdso_th32->th_x86_hpet_idx = device_get_unit(sc->dev); + bzero(vdso_th32->th_res, sizeof(vdso_th32->th_res)); + return (sc->mmap_allow != 0); +} +#endif + static void hpet_enable(struct hpet_softc *sc) { @@ -537,6 +569,10 @@ hpet_attach(device_t dev) sc->tc.tc_quality = 950, sc->tc.tc_frequency = sc->freq; sc->tc.tc_priv = sc; + sc->tc.tc_fill_vdso_timehands = hpet_vdso_timehands; +#ifdef COMPAT_FREEBSD32 + sc->tc.tc_fill_vdso_timehands32 = hpet_vdso_timehands32; +#endif tc_init(&sc->tc); } /* If not disabled - setup and announce event timers. */ Modified: head/sys/dev/acpica/acpi_hpet.h ============================================================================== --- head/sys/dev/acpica/acpi_hpet.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/dev/acpica/acpi_hpet.h Wed Aug 17 09:52:09 2016 (r304285) @@ -64,4 +64,15 @@ #define HPET_MIN_CYCLES 128 /* Period considered reliable. */ +#ifdef _KERNEL +struct timecounter; +struct vdso_timehands; +struct vdso_timehands32; + +uint32_t hpet_vdso_timehands(struct vdso_timehands *vdso_th, + struct timecounter *tc); +uint32_t hpet_vdso_timehands32(struct vdso_timehands32 *vdso_th32, + struct timecounter *tc); +#endif + #endif /* !__ACPI_HPET_H__ */ Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/kern/kern_tc.c Wed Aug 17 09:52:09 2016 (r304285) @@ -6,11 +6,14 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * Copyright (c) 2011 The FreeBSD Foundation + * Copyright (c) 2011, 2015, 2016 The FreeBSD Foundation * All rights reserved. * * Portions of this software were developed by Julien Ridoux at the University * of Melbourne under sponsorship from the FreeBSD Foundation. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. */ #include @@ -2130,13 +2133,16 @@ tc_fill_vdso_timehands(struct vdso_timeh uint32_t enabled; th = timehands; - vdso_th->th_algo = VDSO_TH_ALGO_1; vdso_th->th_scale = th->th_scale; vdso_th->th_offset_count = th->th_offset_count; vdso_th->th_counter_mask = th->th_counter->tc_counter_mask; vdso_th->th_offset = th->th_offset; vdso_th->th_boottime = th->th_boottime; - enabled = cpu_fill_vdso_timehands(vdso_th, th->th_counter); + if (th->th_counter->tc_fill_vdso_timehands != NULL) { + enabled = th->th_counter->tc_fill_vdso_timehands(vdso_th, + th->th_counter); + } else + enabled = 0; if (!vdso_th_enable) enabled = 0; return (enabled); @@ -2150,7 +2156,6 @@ tc_fill_vdso_timehands32(struct vdso_tim uint32_t enabled; th = timehands; - vdso_th32->th_algo = VDSO_TH_ALGO_1; *(uint64_t *)&vdso_th32->th_scale[0] = th->th_scale; vdso_th32->th_offset_count = th->th_offset_count; vdso_th32->th_counter_mask = th->th_counter->tc_counter_mask; @@ -2158,7 +2163,11 @@ tc_fill_vdso_timehands32(struct vdso_tim *(uint64_t *)&vdso_th32->th_offset.frac[0] = th->th_offset.frac; vdso_th32->th_boottime.sec = th->th_boottime.sec; *(uint64_t *)&vdso_th32->th_boottime.frac[0] = th->th_boottime.frac; - enabled = cpu_fill_vdso_timehands32(vdso_th32, th->th_counter); + if (th->th_counter->tc_fill_vdso_timehands32 != NULL) { + enabled = th->th_counter->tc_fill_vdso_timehands32(vdso_th32, + th->th_counter); + } else + enabled = 0; if (!vdso_th_enable) enabled = 0; return (enabled); Modified: head/sys/sys/timetc.h ============================================================================== --- head/sys/sys/timetc.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/sys/timetc.h Wed Aug 17 09:52:09 2016 (r304285) @@ -28,8 +28,14 @@ */ struct timecounter; +struct vdso_timehands; +struct vdso_timehands32; typedef u_int timecounter_get_t(struct timecounter *); typedef void timecounter_pps_t(struct timecounter *); +typedef uint32_t timecounter_fill_vdso_timehands_t(struct vdso_timehands *, + struct timecounter *); +typedef uint32_t timecounter_fill_vdso_timehands32_t(struct vdso_timehands32 *, + struct timecounter *); struct timecounter { timecounter_get_t *tc_get_timecount; @@ -68,6 +74,8 @@ struct timecounter { /* Pointer to the timecounter's private parts. */ struct timecounter *tc_next; /* Pointer to the next timecounter. */ + timecounter_fill_vdso_timehands_t *tc_fill_vdso_timehands; + timecounter_fill_vdso_timehands32_t *tc_fill_vdso_timehands32; }; extern struct timecounter *timecounter; Modified: head/sys/sys/vdso.h ============================================================================== --- head/sys/sys/vdso.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/sys/vdso.h Wed Aug 17 09:52:09 2016 (r304285) @@ -53,6 +53,7 @@ struct vdso_timekeep { #define VDSO_TK_VER_1 0x1 #define VDSO_TK_VER_CURR VDSO_TK_VER_1 #define VDSO_TH_ALGO_1 0x1 +#define VDSO_TH_ALGO_2 0x2 #ifndef _KERNEL @@ -62,7 +63,7 @@ struct timezone; int __vdso_clock_gettime(clockid_t clock_id, struct timespec *ts); int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz); -u_int __vdso_gettc(const struct vdso_timehands *vdso_th); +int __vdso_gettc(const struct vdso_timehands *vdso_th, u_int *tc); int __vdso_gettimekeep(struct vdso_timekeep **tk); #endif Modified: head/sys/x86/include/vdso.h ============================================================================== --- head/sys/x86/include/vdso.h Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/x86/include/vdso.h Wed Aug 17 09:52:09 2016 (r304285) @@ -1,7 +1,11 @@ /*- * Copyright 2012 Konstantin Belousov . + * Copyright 2016 The FreeBSD Foundation. * All rights reserved. * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -30,7 +34,11 @@ #define VDSO_TIMEHANDS_MD \ uint32_t th_x86_shift; \ - uint32_t th_res[7]; + uint32_t th_x86_hpet_idx; \ + uint32_t th_res[6]; + +#define VDSO_TH_ALGO_X86_TSC VDSO_TH_ALGO_1 +#define VDSO_TH_ALGO_X86_HPET VDSO_TH_ALGO_2 #ifdef _KERNEL #ifdef COMPAT_FREEBSD32 Modified: head/sys/x86/x86/tsc.c ============================================================================== --- head/sys/x86/x86/tsc.c Wed Aug 17 09:34:56 2016 (r304284) +++ head/sys/x86/x86/tsc.c Wed Aug 17 09:52:09 2016 (r304285) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "cpufreq_if.h" @@ -93,14 +94,22 @@ static unsigned tsc_get_timecount_low_lf static unsigned tsc_get_timecount_mfence(struct timecounter *tc); static unsigned tsc_get_timecount_low_mfence(struct timecounter *tc); static void tsc_levels_changed(void *arg, int unit); +static uint32_t x86_tsc_vdso_timehands(struct vdso_timehands *vdso_th, + struct timecounter *tc); +#ifdef COMPAT_FREEBSD32 +static uint32_t x86_tsc_vdso_timehands32(struct vdso_timehands32 *vdso_th32, + struct timecounter *tc); +#endif static struct timecounter tsc_timecounter = { - tsc_get_timecount, /* get_timecount */ - 0, /* no poll_pps */ - ~0u, /* counter_mask */ - 0, /* frequency */ - "TSC", /* name */ - 800, /* quality (adjusted in code) */ + .tc_get_timecount = tsc_get_timecount, + .tc_counter_mask = ~0u, + .tc_name = "TSC", + .tc_quality = 800, /* adjusted in code */ + .tc_fill_vdso_timehands = x86_tsc_vdso_timehands, +#ifdef COMPAT_FREEBSD32 + .tc_fill_vdso_timehands32 = x86_tsc_vdso_timehands32, +#endif }; static void @@ -724,23 +733,27 @@ tsc_get_timecount_low_mfence(struct time return (tsc_get_timecount_low(tc)); } -uint32_t -cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) +static uint32_t +x86_tsc_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) { + vdso_th->th_algo = VDSO_TH_ALGO_X86_TSC; vdso_th->th_x86_shift = (int)(intptr_t)tc->tc_priv; + vdso_th->th_x86_hpet_idx = 0xffffffff; bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); - return (tc == &tsc_timecounter); + return (1); } #ifdef COMPAT_FREEBSD32 -uint32_t -cpu_fill_vdso_timehands32(struct vdso_timehands32 *vdso_th32, +static uint32_t +x86_tsc_vdso_timehands32(struct vdso_timehands32 *vdso_th32, struct timecounter *tc) { + vdso_th32->th_algo = VDSO_TH_ALGO_X86_TSC; vdso_th32->th_x86_shift = (int)(intptr_t)tc->tc_priv; + vdso_th32->th_x86_hpet_idx = 0xffffffff; bzero(vdso_th32->th_res, sizeof(vdso_th32->th_res)); - return (tc == &tsc_timecounter); + return (1); } #endif From owner-svn-src-all@freebsd.org Wed Aug 17 10:09:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F5A3BBDDCF; Wed, 17 Aug 2016 10:09:18 +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 ED0C7170C; Wed, 17 Aug 2016 10:09:17 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id D11D72591; Wed, 17 Aug 2016 10:09:16 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 0854325F4; Wed, 17 Aug 2016 12:07:51 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> Date: Wed, 17 Aug 2016 12:07:50 +0200 In-Reply-To: (Nathan Whitehorn's message of "Mon, 15 Aug 2016 08:04:26 -0700") Message-ID: <861t1n6749.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 10:09:18 -0000 Nathan Whitehorn writes: > As a note for people who weren't paying attention to the bug, we need > to fix this in a better way outside of the constraints of getting 11.0 > out the door. The system (gpart, the installer, ZFS, etc.) uses the > reported GEOM stripesize for partition alignment and IO block size > selection. If that is wrong, we should identify devices on which it is > wrong and fix them, and maybe also add some global tunable that sets a > floor on the numbers reported by GEOM_DISK. Hacking the installer like > this is triage, which is fine, but not viable as a permanent solution > to anything. Modifying GEOM to report a bogus number when none is provided by the lower layer(s) is absolutely not going to happen. You have absolutely no idea what your proposed change will break. And you keep refusing to address the fact that most drivers don't report a stripe size, except by repeating your claim that they do, with no evidence to back it up. Feel free to 'grep -r stripesize /usr/src/sys/dev'. Go on, I'll wait. Your contention that the installer does not make policy decisions is equally spurious. The installer makes many policy decisions, including the disk layout, the size of the swap partition, the name of the pool, the use of boot environments (which I dislike but am not allowed to override), the number of filesets and their mountpoints (which I also dislike and am not allowed to override either), etc. The Unix philosophy is to push such decisions up the stack, not down. The decision to align partitions on 4096-byte boundaries because we're not sure of the correct number but know for a fact that using a smaller number can have a huge impact on performance is the installer's to make. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@freebsd.org Wed Aug 17 10:14:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49341BBDFA7; Wed, 17 Aug 2016 10:14:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A4BF1C0A; Wed, 17 Aug 2016 10:14:23 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HAEMpd071639; Wed, 17 Aug 2016 10:14:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HAEMHA071638; Wed, 17 Aug 2016 10:14:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608171014.u7HAEMHA071638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Aug 2016 10:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304286 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 10:14:23 -0000 Author: kib Date: Wed Aug 17 10:14:22 2016 New Revision: 304286 URL: https://svnweb.freebsd.org/changeset/base/304286 Log: Remove duplicated code. aio_aqueue() calls aio_init_aioinfo() as the first action. There is no need to duplicate the code in kern_aio_fsync(). Also fix indent for aio_aqueue() definition. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D7523 Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Wed Aug 17 09:52:09 2016 (r304285) +++ head/sys/kern/vfs_aio.c Wed Aug 17 10:14:22 2016 (r304286) @@ -1441,7 +1441,7 @@ static struct aiocb_ops aiocb_ops_osigev */ int aio_aqueue(struct thread *td, struct aiocb *ujob, struct aioliojob *lj, - int type, struct aiocb_ops *ops) + int type, struct aiocb_ops *ops) { struct proc *p = td->td_proc; cap_rights_t rights; @@ -2476,14 +2476,9 @@ static int kern_aio_fsync(struct thread *td, int op, struct aiocb *ujob, struct aiocb_ops *ops) { - struct proc *p = td->td_proc; - struct kaioinfo *ki; if (op != O_SYNC) /* XXX lack of O_DSYNC */ return (EINVAL); - ki = p->p_aioinfo; - if (ki == NULL) - aio_init_aioinfo(p); return (aio_aqueue(td, ujob, NULL, LIO_SYNC, ops)); } From owner-svn-src-all@freebsd.org Wed Aug 17 10:16:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7508EBBC0E9; Wed, 17 Aug 2016 10:16:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 530921EA9; Wed, 17 Aug 2016 10:16:43 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HAGgOE071758; Wed, 17 Aug 2016 10:16:42 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HAGgdt071756; Wed, 17 Aug 2016 10:16:42 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608171016.u7HAGgdt071756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 17 Aug 2016 10:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304287 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 10:16:43 -0000 Author: kib Date: Wed Aug 17 10:16:42 2016 New Revision: 304287 URL: https://svnweb.freebsd.org/changeset/base/304287 Log: Add fdatasync(2) man page, combined with fsync(2). Reviewed by: emaste, rpokala, wblock Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D7522 Modified: head/lib/libc/sys/Makefile.inc head/lib/libc/sys/fsync.2 Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Wed Aug 17 10:14:22 2016 (r304286) +++ head/lib/libc/sys/Makefile.inc Wed Aug 17 10:16:42 2016 (r304287) @@ -366,6 +366,7 @@ MLINKS+=ffclock.2 ffclock_getcounter.2 \ ffclock.2 ffclock_getestimate.2 \ ffclock.2 ffclock_setestimate.2 MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2 +MLINKS+=fsync.2 fdatasync.2 MLINKS+=getdirentries.2 getdents.2 MLINKS+=getfh.2 lgetfh.2 MLINKS+=getgid.2 getegid.2 Modified: head/lib/libc/sys/fsync.2 ============================================================================== --- head/lib/libc/sys/fsync.2 Wed Aug 17 10:14:22 2016 (r304286) +++ head/lib/libc/sys/fsync.2 Wed Aug 17 10:16:42 2016 (r304287) @@ -1,5 +1,11 @@ .\" Copyright (c) 1983, 1993 .\" The Regents of the University of California. All rights reserved. +.\" Copyright (c) 2016 The FreeBSD Foundation, Inc. +.\" All rights reserved. +.\" +.\" Parts of this documentation were written by +.\" Konstantin Belousov under sponsorship +.\" from the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -28,40 +34,65 @@ .\" @(#)fsync.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd August 17, 2016 .Dt FSYNC 2 .Os .Sh NAME -.Nm fsync +.Nm fdatasync, fsync .Nd "synchronise changes to a file" .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In unistd.h .Ft int +.Fn fdatasync "int fd" +.Ft int .Fn fsync "int fd" .Sh DESCRIPTION The .Fn fsync system call -causes all modified data and attributes of +causes all modified data and attributes of the file referenced by +the file descriptor .Fa fd to be moved to a permanent storage device. This normally results in all in-core modified copies of buffers for the associated file to be written to a disk. .Pp The +.Fn fdatasync +system call causes all modified data of +.Fa fd +to be moved to a permanent storage device. +Unlike +.Fn fsync , +the system call does not guarantee that file attributes or +metadata necessary to access the file are committed to the permanent storage. +.Pp +The .Fn fsync system call should be used by programs that require a file to be in a known state, for example, in building a simple transaction facility. +If the file metadata has already been committed, using +.Fn fdatasync +can be more efficient than +.Fn fsync . +.Pp +Both +.Fn fdatasync +and +.Fn fsync +calls are cancellation points. .Sh RETURN VALUES .Rv -std fsync .Sh ERRORS The .Fn fsync -fails if: +and +.Fn fdatasync +calls fail if: .Bl -tag -width Er .It Bq Er EBADF The @@ -85,3 +116,15 @@ The .Fn fsync system call appeared in .Bx 4.2 . +The +.Fn fdatasync +system call appeared in +.Fx 12.0 +.Sh BUGS +The +.Fn fdatasync +system call currently does not guarantee that enqueued +.Xr aio 4 +requests for the file referenced by +.Fa fd +are completed before the syscall returns. From owner-svn-src-all@freebsd.org Wed Aug 17 10:20:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96FB1BBC1FD; Wed, 17 Aug 2016 10:20:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63CD41275; Wed, 17 Aug 2016 10:20:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HAK5fe071929; Wed, 17 Aug 2016 10:20:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HAK5Rj071927; Wed, 17 Aug 2016 10:20:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608171020.u7HAK5Rj071927@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 17 Aug 2016 10:20:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304288 - in head: lib/libc/sys 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 10:20:06 -0000 Author: bdrewery Date: Wed Aug 17 10:20:05 2016 New Revision: 304288 URL: https://svnweb.freebsd.org/changeset/base/304288 Log: Garbage collect _umtx_lock(2)/_umtx_unlock(2) references removed in r263318. This has no real impact on the resulting libc.so file. MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/sys/Symbol.map head/sys/kern/capabilities.conf Modified: head/lib/libc/sys/Symbol.map ============================================================================== --- head/lib/libc/sys/Symbol.map Wed Aug 17 10:16:42 2016 (r304287) +++ head/lib/libc/sys/Symbol.map Wed Aug 17 10:20:05 2016 (r304288) @@ -34,9 +34,7 @@ FBSD_1.0 { __setugid; __syscall; __sysctl; - _umtx_lock; _umtx_op; - _umtx_unlock; abort2; accept; access; @@ -459,12 +457,8 @@ FBSDprivate_1.0 { __sys___syscall; ___sysctl; __sys___sysctl; - __umtx_lock; - __sys__umtx_lock; __umtx_op; __sys__umtx_op; - __umtx_unlock; - __sys__umtx_unlock; _abort2; __sys_abort2; _accept; Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Wed Aug 17 10:16:42 2016 (r304287) +++ head/sys/kern/capabilities.conf Wed Aug 17 10:20:05 2016 (r304288) @@ -64,9 +64,7 @@ __sysctl ## ## XXRW: Need to check this very carefully. ## -_umtx_lock _umtx_op -_umtx_unlock ## ## Allow process termination using abort2(2). From owner-svn-src-all@freebsd.org Wed Aug 17 10:20:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51BF8BBC2CB; Wed, 17 Aug 2016 10:20:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C54114A3; Wed, 17 Aug 2016 10:20:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HAKaU4071990; Wed, 17 Aug 2016 10:20:36 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HAKaki071989; Wed, 17 Aug 2016 10:20:36 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608171020.u7HAKaki071989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Aug 2016 10:20:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304289 - head/sys/arm/allwinner 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 10:20:37 -0000 Author: manu Date: Wed Aug 17 10:20:36 2016 New Revision: 304289 URL: https://svnweb.freebsd.org/changeset/base/304289 Log: a10_gpio_get_function now returns the whole function not only GPIO_INPUT/GPIO_OUTPUT. a10_gpio_get_pud now returns the whole pud not only PULLDOWN/PULLUP. Add a10_gpio_get_drv to get the current drive strenght. During fdt pin configure, avoid setting function/drive/pud if it's already in the correct value. Tested on Allwinner H3 and A20 MFC after: 1 week Modified: head/sys/arm/allwinner/a10_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 10:20:05 2016 (r304288) +++ head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 10:20:36 2016 (r304289) @@ -210,14 +210,8 @@ a10_gpio_get_function(struct a10_gpio_so offset = ((pin & 0x07) << 2); func = A10_GPIO_READ(sc, A10_GPIO_GP_CFG(bank, pin >> 3)); - switch ((func >> offset) & 0x7) { - case A10_GPIO_INPUT: - return (GPIO_PIN_INPUT); - case A10_GPIO_OUTPUT: - return (GPIO_PIN_OUTPUT); - } - return (0); + return ((func >> offset) & 0x7); } static int @@ -257,14 +251,8 @@ a10_gpio_get_pud(struct a10_gpio_softc * offset = ((pin & 0x0f) << 1); val = A10_GPIO_READ(sc, A10_GPIO_GP_PUL(bank, pin >> 4)); - switch ((val >> offset) & 0x3) { - case A10_GPIO_PULLDOWN: - return (GPIO_PIN_PULLDOWN); - case A10_GPIO_PULLUP: - return (GPIO_PIN_PULLUP); - } - return (0); + return ((val >> offset) & AW_GPIO_PUD_MASK); } static void @@ -285,6 +273,23 @@ a10_gpio_set_pud(struct a10_gpio_softc * A10_GPIO_WRITE(sc, A10_GPIO_GP_PUL(bank, pin >> 4), val); } +static uint32_t +a10_gpio_get_drv(struct a10_gpio_softc *sc, uint32_t pin) +{ + uint32_t bank, offset, val; + + /* Must be called with lock held. */ + A10_GPIO_LOCK_ASSERT(sc); + + bank = sc->padconf->pins[pin].port; + pin = sc->padconf->pins[pin].pin; + offset = ((pin & 0x0f) << 1); + + val = A10_GPIO_READ(sc, A10_GPIO_GP_DRV(bank, pin >> 4)); + + return ((val >> offset) & AW_GPIO_DRV_MASK); +} + static void a10_gpio_set_drv(struct a10_gpio_softc *sc, uint32_t pin, uint32_t drive) { @@ -373,14 +378,39 @@ static int a10_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags) { struct a10_gpio_softc *sc; + uint32_t func; + uint32_t pud; sc = device_get_softc(dev); if (pin >= sc->padconf->npins) return (EINVAL); A10_GPIO_LOCK(sc); - *flags = a10_gpio_get_function(sc, pin); - *flags |= a10_gpio_get_pud(sc, pin); + func = a10_gpio_get_function(sc, pin); + switch (func) { + case A10_GPIO_INPUT: + *flags = GPIO_PIN_INPUT; + break; + case A10_GPIO_OUTPUT: + *flags = GPIO_PIN_OUTPUT; + break; + default: + *flags = 0; + break; + } + + pud = a10_gpio_get_pud(sc, pin); + switch (pud) { + case A10_GPIO_PULLDOWN: + *flags |= GPIO_PIN_PULLDOWN; + break; + case A10_GPIO_PULLUP: + *flags |= GPIO_PIN_PULLUP; + break; + default: + break; + } + A10_GPIO_UNLOCK(sc); return (0); @@ -564,9 +594,13 @@ aw_fdt_configure_pins(device_t dev, phan } A10_GPIO_LOCK(sc); - a10_gpio_set_function(sc, pin_num, pin_func); - a10_gpio_set_drv(sc, pin_num, pin_drive); - a10_gpio_set_pud(sc, pin_num, pin_pull); + + if (a10_gpio_get_function(sc, pin_num) != pin_func) + a10_gpio_set_function(sc, pin_num, pin_func); + if (a10_gpio_get_drv(sc, pin_num) != pin_drive) + a10_gpio_set_drv(sc, pin_num, pin_drive); + if (a10_gpio_get_pud(sc, pin_num) != pin_pull) + a10_gpio_set_pud(sc, pin_num, pin_pull); A10_GPIO_UNLOCK(sc); } From owner-svn-src-all@freebsd.org Wed Aug 17 11:11:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C880DBBB5DE; Wed, 17 Aug 2016 11:11:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 750291484; Wed, 17 Aug 2016 11:11:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 34ED1104750F; Wed, 17 Aug 2016 20:40:59 +1000 (AEST) Date: Wed, 17 Aug 2016 20:40:58 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Jilles Tjoelker , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304180 - head/sys/ufs/ffs In-Reply-To: <20160817081055.GM83214@kib.kiev.ua> Message-ID: <20160817191239.A3117@besplex.bde.org> References: <201608151922.u7FJMOmT099410@repo.freebsd.org> <20160816215355.GB12199@stack.nl> <20160817081055.GM83214@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=I9sqMnmzHltNhR3enRgA:9 a=kSGpwUHVDBIaL0fO:21 a=A_BSZxN6wfCI-H8q:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 11:11:01 -0000 On Wed, 17 Aug 2016, Konstantin Belousov wrote: > On Tue, Aug 16, 2016 at 11:53:55PM +0200, Jilles Tjoelker wrote: >> Hmm, some people interpret POSIX differently than I do, but I think it >> is clear that XBD 3.384 Synchronized I/O Data Integrity Completion >> requires the indirect blocks to be written (because "all file system >> information required to retrieve the data is successfully transferred"). >> The Linux man page matches this interpretation except that an fsync of >> the parent directory may be required. All related directories must be synced. It is almost useless to sync the data if the data cannot be found later using normal file system operations. Not quite useless if the file can be recovered by fsck and saved in lost+found, but the metadata needed to guarantee that that works probably requires a lot of writes anyway. >> If the whole file is being considered, then any change to indirect >> blocks is needed to access some data (because the file was extended, a >> hole was filled or snapshotted data was overwritten). For other >> overwrites, there is no change to indirect blocks and no conflict with >> fdatasync's performance objectives. > Note that the same argument is applicable to the inode block: the di_db > and di_ib pointers to the direct blocks and to root indirect blocks are > required to retrieve the written data. I would never have guessed that you left out either. > ... > >> Ideally, a changed i_size would also cause the inode to be written, but >> I don't know how to determine that (there is no i_flag for it). Always >> writing the inode would defeat the point of fdatasync. My version does a bcmp() of the in-core copy with the disk copy to avoid null changes. This turned out to be not very useful. It was intended mainly to avoid writing null changes for timestamps. By I already avoid most timestamp changes by mounting with -noatime and not having large data. I use only seconds granularity for timestamps. With nanoseconds granularity, any change to a file is guaranteed to change its in-core inode, so the bcmp() wouldn't work. But timestamps are about the only metadata that obviously doesn't need syncing. Especially atimes. POSIX doesn't allow turning off atimes, but it also doesn't require syncing them before the system crashes except probably using FSYNC of metadata. There is an i_flag for critical metadata like i_size. It is IN_MODIFIED. This flag is often mismanaged. Many places set only IN_CHANGE after making a critical change. ufs_chown() is one such place. Ownerships are fairly critical metadata. They are not considered critical enough to sync immediately, but they should be synced by FSYNC of metadata. But the implementation is to set only IN_CHANGE. i_ctime is usually updated much later and IN_MODIFIED is set then to say that the relatively unimportant i_ctime has been modified. This inhibits the optimization of syncing for chown() but not syncing for ctime changes. > Which was my reasoning behind omitting the indirect block flushing. > There is no practical difference between inode block and indirect blocks > for metadata consistency. Ugh. > Note that the affected case is only the async mounts (not sync mounts, > not any variants of softdeps). I fixed the non-syncing of inodes for the async mount case ~15 years ago in my version, and finally merged the changes to my version of -current a few months OK. It was stupid that ordinary fsync() synced the indirect blocks but not the more important inode. Directory metadata is still not synced by fsync() in the async mount case. > I can restore indirect block flushing and wait for them for DATA_ONLY sync, > but then I should also add ffs_update() call. Here are my ffs fixes for -current. The are mostly to sprinkle missing DOINGASYNC() checks and finally fix ffs_update(): X Index: ffs/ffs_balloc.c X =================================================================== X --- ffs/ffs_balloc.c (revision 304069) X +++ ffs/ffs_balloc.c (working copy) X @@ -155,4 +155,6 @@ X if (flags & IO_SYNC) X bwrite(bp); X + else if (DOINGASYNC(vp)) X + bdwrite(bp); X else X bawrite(bp); X @@ -265,12 +267,10 @@ X newb, 0, fs->fs_bsize, 0, bp); X bdwrite(bp); X + } else if ((flags & IO_SYNC) == 0 && DOINGASYNC(vp)) { X + if (bp->b_bufsize == fs->fs_bsize) X + bp->b_flags |= B_CLUSTEROK; X + bdwrite(bp); This restructures the code a little to fix the DOINGASYNC() check. IO_SYNC was not checked. X } else { X - /* X - * Write synchronously so that indirect blocks X - * never point at garbage. X - */ X - if (DOINGASYNC(vp)) X - bdwrite(bp); X - else if ((error = bwrite(bp)) != 0) X + if ((error = bwrite(bp)) != 0) X goto fail; X } The comment was banal and duplicated ad nauseum, except it was wrong when the DOINGASYNC() check was under it. X @@ -335,9 +335,9 @@ X indirs[i - 1].in_off, nb); X bdwrite(nbp); X + } else if ((flags & IO_SYNC) == 0 && DOINGASYNC(vp)) { X + if (nbp->b_bufsize == fs->fs_bsize) X + nbp->b_flags |= B_CLUSTEROK; X + bdwrite(nbp); X } else { X - /* X - * Write synchronously so that indirect blocks X - * never point at garbage. X - */ X if ((error = bwrite(nbp)) != 0) { X brelse(bp); Here the DOINGASYNC() check was missing and the comment wasn't broken. X @@ -829,12 +829,10 @@ X newb, 0, fs->fs_bsize, 0, bp); X bdwrite(bp); X + } else if ((flags & IO_SYNC) == 0 && DOINGASYNC(vp)) { X + if (bp->b_bufsize == fs->fs_bsize) X + bp->b_flags |= B_CLUSTEROK; X + bdwrite(bp); X } else { X - /* X - * Write synchronously so that indirect blocks X - * never point at garbage. X - */ X - if (DOINGASYNC(vp)) X - bdwrite(bp); X - else if ((error = bwrite(bp)) != 0) X + if ((error = bwrite(bp)) != 0) X goto fail; X } X @@ -900,9 +898,9 @@ X indirs[i - 1].in_off, nb); X bdwrite(nbp); X + } else if ((flags & IO_SYNC) == 0 && DOINGASYNC(vp)) { X + if (nbp->b_bufsize == fs->fs_bsize) X + nbp->b_flags |= B_CLUSTEROK; X + bdwrite(nbp); X } else { X - /* X - * Write synchronously so that indirect blocks X - * never point at garbage. X - */ X if ((error = bwrite(nbp)) != 0) { X brelse(bp); There are 4 instances of almost the same code (not exactly the same). I changed them to be as identical as possbile. X Index: ffs/ffs_inode.c X =================================================================== X --- ffs/ffs_inode.c (revision 304069) X +++ ffs/ffs_inode.c (working copy) X @@ -155,5 +155,5 @@ X random_harvest_queue(&(ip->i_din2), sizeof(ip->i_din2), 1, RANDOM_FS_ATIME); X } X - if (waitfor && !DOINGASYNC(vp)) X + if (waitfor) X error = bwrite(bp); X else if (vm_page_count_severe() || buf_dirty_count_severe()) { This fixes ffs_update() by removing dyson's old DOINGASYNC() hack. This is a very safe change, but it needs a havy sprinkling of DOINGASYNC() in callers to avoid passing waitfor = TRUE too often. Many callers have already been fixed. X @@ -265,5 +265,5 @@ X } X ip->i_flag |= IN_CHANGE; X - if ((error = ffs_update(vp, !DOINGASYNC(vp)))) X + if ((error = ffs_update(vp, (flags & IO_SYNC) != 0))) X return (error); X for (i = 0; i < NXADDR; i++) { This was a broken caller. It and the next few fixes are in ffs_truncate(). ffs_truncate() has already converted (!DOINGASYNC() && !DOINGSOFTDEP()) to IO_ASYNC in flags here, so (flags & IO_SYNC) must be checked here so as to not lose the caller's setting of IO_SYNC. This gives the same precedence to IO_SYNC as in the checks above. ffs_truncate() used to do separate checks like the ones above. This was more readable but not as fail-safe when a check was forgotten. X @@ -291,5 +291,5 @@ X if (needextclean) X goto extclean; X - return (ffs_update(vp, !DOINGASYNC(vp))); X + return (ffs_update(vp, (flags & IO_SYNC) != 0)); X } X if (ip->i_size == length) { X @@ -329,5 +329,5 @@ X bawrite(bp); X ip->i_flag |= IN_CHANGE | IN_UPDATE; X - return (ffs_update(vp, !DOINGASYNC(vp))); X + return (ffs_update(vp, (flags & IO_SYNC) != 0)); X } X /* X @@ -358,8 +358,8 @@ X if (blkno != 0) X brelse(bp); X - else if (DOINGSOFTDEP(vp) || DOINGASYNC(vp)) X - bdwrite(bp); X - else X + else if (flags & IO_SYNC) X bwrite(bp); X + else X + bdwrite(bp); X } X /* Better check the DOINGSOFTDEP() part of ths fix. The caller's IO_SYNC flag and previous logic were defeated by checking DOINGSOFTDEP() again here. Note that callers were changed to not check DOING*() before calling ffs_update(). They just pass IO_SYNC if they want to force a sync. Most callers don't want to force it, so they pass 0 and syncing is controlled by DOINGSOFTDEP() and DOINGASYNC() in the usual way. This gives ufs's old fail-safe behaviour of sync metadata for ffs_truncate() in the non-softdep non-async mount case. Old versions were not so careful and depending on callers calculating the flag. X @@ -479,5 +479,5 @@ X } X ip->i_flag |= IN_CHANGE | IN_UPDATE; X - allerror = ffs_update(vp, !DOINGASYNC(vp)); X + allerror = ffs_update(vp, (flags & IO_SYNC) != 0); X X /* X @@ -611,5 +611,5 @@ X else X softdep_setup_freeblocks(ip, length, IO_EXT); X - return (ffs_update(vp, (flags & IO_SYNC) != 0 || !DOINGASYNC(vp))); X + return (ffs_update(vp, (flags & IO_SYNC) != 0)); X } X End of fixes for ffs_truncate(). X Index: ffs/ffs_vnops.c X =================================================================== X --- ffs/ffs_vnops.c (revision 304069) X +++ ffs/ffs_vnops.c (working copy) X @@ -717,5 +717,5 @@ X else X flags = seqcount << BA_SEQSHIFT; X - if ((ioflag & IO_SYNC) && !DOINGASYNC(vp)) X + if (ioflag & IO_SYNC) X flags |= IO_SYNC; X flags |= BA_UNMAPPED; X @@ -1037,5 +1037,5 @@ X osize = dp->di_extsize; X flags = IO_EXT; X - if ((ioflag & IO_SYNC) && !DOINGASYNC(vp)) X + if (ioflag & IO_SYNC) X flags |= IO_SYNC; X Examples of the ffs_write() and ffs_extwrite() callers calculating the flag wrong. There must be some magic for DOINGSOFTDEP() here and I hope I didn't break it. The old code forces IO_SYNC when the caller doesn't ask for it. This is the correct fail-safe behaviour for the old non-softdep non-async non-sync mount case, but is pessimal. It avoided here for the async mount case, but for the softdep case IO_SYNC is bogusly set here and then soft updates have to magically dishonor IO_SYNC to avoid all writes become since (just ordered and delayed for soft updates). I don't see how soft updates can work write here. If it dishonors IO_SYNC at lower levels, then this breaks the caller's reques tof sync writes, and if it doesn't dishonor IO_SYNC at lower levels, then the usual case is pessimized. X Index: ufs/ufs_lookup.c X =================================================================== X --- ufs/ufs_lookup.c (revision 304069) X +++ ufs/ufs_lookup.c (working copy) X @@ -1249,5 +1249,5 @@ X if (flags & DOWHITEOUT) X error = bwrite(bp); X - else if (DOINGASYNC(dvp) && dp->i_count != 0) X + else if (DOINGASYNC(dvp)) X bdwrite(bp); X else A pure async mount case fix -- don't do anything sync unless asked for. X Index: ufs/ufs_vnops.c X =================================================================== X --- ufs/ufs_vnops.c (revision 304069) X +++ ufs/ufs_vnops.c (working copy) X @@ -992,5 +992,5 @@ X if (DOINGSOFTDEP(vp)) X softdep_setup_link(VTOI(tdvp), ip); X - error = UFS_UPDATE(vp, !(DOINGSOFTDEP(vp) | DOINGASYNC(vp))); X + error = UFS_UPDATE(vp, !DOINGSOFTDEP(vp) && !DOINGASYNC(vp)); X if (!error) { X ufs_makedirentry(ip, cnp, &newdir); X @@ -1336,5 +1336,5 @@ X if (DOINGSOFTDEP(fvp)) X softdep_setup_link(tdp, fip); X - error = UFS_UPDATE(fvp, !(DOINGSOFTDEP(fvp) | DOINGASYNC(fvp))); X + error = UFS_UPDATE(fvp, !DOINGSOFTDEP(fvp) && !DOINGASYNC(fvp)); X if (error) X goto bad; X @@ -1489,6 +1489,6 @@ X if (DOINGSOFTDEP(tdvp)) X softdep_setup_dotdot_link(tdp, fip); X - error = UFS_UPDATE(tdvp, !(DOINGSOFTDEP(tdvp) | X - DOINGASYNC(tdvp))); X + error = UFS_UPDATE(tdvp, !DOINGSOFTDEP(tdvp) && X + !DOINGASYNC(tdvp)); X /* Don't go to bad here as the new link exists. */ X if (error) Use consistent logic, and don't do manual optimizations of logical expressions. X @@ -1534,5 +1534,6 @@ X ufsdirhash_dirtrunc(tdp, endoff); X #endif X - UFS_TRUNCATE(tdvp, endoff, IO_NORMAL | IO_SYNC, tcnp->cn_cred); X + UFS_TRUNCATE(tdvp, endoff, IO_NORMAL | X + (DOINGASYNC(tdvp) ? 0 : IO_SYNC), tcnp->cn_cred); X } X if (error == 0 && tdp->i_flag & IN_NEEDSYNC) This looks wrong. Why do we want to override IO_NORMAL? IIRC, I wrote it like this since I didn't want to change the policy for soft updates. This is near the directory compaction fix. I completed this set of patches after understanding the simplifications given by IO_NORMAL letting ffs_truncate() handle the details. X @@ -1879,5 +1880,5 @@ X if (DOINGSOFTDEP(dvp)) X softdep_setup_mkdir(dp, ip); X - error = UFS_UPDATE(dvp, !(DOINGSOFTDEP(dvp) | DOINGASYNC(dvp))); X + error = UFS_UPDATE(dvp, !DOINGSOFTDEP(dvp) && !DOINGASYNC(dvp)); X if (error) X goto bad; X @@ -1936,6 +1937,6 @@ X } X } X - if ((error = UFS_UPDATE(tvp, !(DOINGSOFTDEP(tvp) | X - DOINGASYNC(tvp)))) != 0) { X + if ((error = UFS_UPDATE(tvp, !DOINGSOFTDEP(tvp) && X + !DOINGASYNC(tvp))) != 0) { X (void)bwrite(bp); X goto bad; X @@ -2671,5 +2672,5 @@ X * Make sure inode goes to disk before directory entry. X */ X - error = UFS_UPDATE(tvp, !(DOINGSOFTDEP(tvp) | DOINGASYNC(tvp))); X + error = UFS_UPDATE(tvp, !DOINGSOFTDEP(tvp) && !DOINGASYNC(tvp)); X if (error) X goto bad; Lots more style fixes to remove home made optimizations. Bruce From owner-svn-src-all@freebsd.org Wed Aug 17 13:09:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F3CFBBD762; Wed, 17 Aug 2016 13:09:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3222B1ECA; Wed, 17 Aug 2016 13:09:32 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HD9VF6036483; Wed, 17 Aug 2016 13:09:31 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HD9VCh036482; Wed, 17 Aug 2016 13:09:31 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608171309.u7HD9VCh036482@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Aug 2016 13:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304290 - head/sys/arm/allwinner 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 13:09:32 -0000 Author: manu Date: Wed Aug 17 13:09:31 2016 New Revision: 304290 URL: https://svnweb.freebsd.org/changeset/base/304290 Log: Only set pud settings if this is a pullup or pulldown configuration. This removes the need to set the MMC pins with pullups in our DTS. Thanks to jmcneill@ for spotting this. Tested on Orange Pi One (Allwinner H3). MFC after: 1 week Modified: head/sys/arm/allwinner/a10_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 10:20:36 2016 (r304289) +++ head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 13:09:31 2016 (r304290) @@ -57,6 +57,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #if defined(__aarch64__) #include "opt_soc.h" #endif @@ -599,7 +601,9 @@ aw_fdt_configure_pins(device_t dev, phan a10_gpio_set_function(sc, pin_num, pin_func); if (a10_gpio_get_drv(sc, pin_num) != pin_drive) a10_gpio_set_drv(sc, pin_num, pin_drive); - if (a10_gpio_get_pud(sc, pin_num) != pin_pull) + if (a10_gpio_get_pud(sc, pin_num) != pin_pull && + (pin_pull == SUN4I_PINCTRL_PULL_UP || + pin_pull == SUN4I_PINCTRL_PULL_DOWN)) a10_gpio_set_pud(sc, pin_num, pin_pull); A10_GPIO_UNLOCK(sc); } From owner-svn-src-all@freebsd.org Wed Aug 17 13:19:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9618BBDAC7; Wed, 17 Aug 2016 13:19:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89DFE17A8; Wed, 17 Aug 2016 13:19:29 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HDJSrS040397; Wed, 17 Aug 2016 13:19:28 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HDJSdt040396; Wed, 17 Aug 2016 13:19:28 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608171319.u7HDJSdt040396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Aug 2016 13:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304291 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 13:19:29 -0000 Author: manu Date: Wed Aug 17 13:19:28 2016 New Revision: 304291 URL: https://svnweb.freebsd.org/changeset/base/304291 Log: Remove pullup settings for MMC pins, this is not needed since r304290 MFC after: 1 week Modified: head/sys/boot/fdt/dts/arm/bananapi.dts Modified: head/sys/boot/fdt/dts/arm/bananapi.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/bananapi.dts Wed Aug 17 13:09:31 2016 (r304290) +++ head/sys/boot/fdt/dts/arm/bananapi.dts Wed Aug 17 13:19:28 2016 (r304291) @@ -41,7 +41,3 @@ }; }; }; - -&mmc0_pins_a { - allwinner,pull = ; -}; From owner-svn-src-all@freebsd.org Wed Aug 17 14:36:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AA21BBD156; Wed, 17 Aug 2016 14:36:07 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3531A1774; Wed, 17 Aug 2016 14:36:06 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net ([128.54.117.176]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7HEa0P5006569 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 17 Aug 2016 07:36:01 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> Date: Wed, 17 Aug 2016 07:36:00 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <861t1n6749.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVb4EAMaBaW94IvkrbqJOuc277FbO3w/nQosgRFWeFnhLSfkhOOIqmsosANZbmQDQIMpj4Ejr+Kxe49oFwwBGrlh0blyFwEbqHo= X-Sonic-ID: C;JPrl6odk5hGnlqDx2xNB0g== M;Yrpa64dk5hGnlqDx2xNB0g== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 14:36:07 -0000 On 08/17/16 03:07, Dag-Erling Smørgrav wrote: > Nathan Whitehorn writes: >> As a note for people who weren't paying attention to the bug, we need >> to fix this in a better way outside of the constraints of getting 11.0 >> out the door. The system (gpart, the installer, ZFS, etc.) uses the >> reported GEOM stripesize for partition alignment and IO block size >> selection. If that is wrong, we should identify devices on which it is >> wrong and fix them, and maybe also add some global tunable that sets a >> floor on the numbers reported by GEOM_DISK. Hacking the installer like >> this is triage, which is fine, but not viable as a permanent solution >> to anything. > Modifying GEOM to report a bogus number when none is provided by the > lower layer(s) is absolutely not going to happen. You have absolutely > no idea what your proposed change will break. And you keep refusing to > address the fact that most drivers don't report a stripe size, except by > repeating your claim that they do, with no evidence to back it up. Feel > free to 'grep -r stripesize /usr/src/sys/dev'. Go on, I'll wait. And yet, if you look at the GEOM XML, it is reported and there. And, look, it's even right for the AF 512e disks in my machine! 512 4096 I've literally never seen a case where we don't already do the right thing here. The GEOM stripesize is, whether you like it or not, the way we have long ago decided to communicate the information about optimal alignment from the disk drivers to userland. We do a good job of it, too. It's correct, as far as I can tell, 100% of the time on all possible variants of AF disks. One could argue that calling this the "stripesize" is a hack, and I would agree, but it's what the operating system does and has done for many years. As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev, as I'm sure you know, and you will find all the code that handles this there. > Your contention that the installer does not make policy decisions is > equally spurious. The installer makes many policy decisions, including > the disk layout, the size of the swap partition, the name of the pool, > the use of boot environments (which I dislike but am not allowed to > override), the number of filesets and their mountpoints (which I also > dislike and am not allowed to override either), etc. The Unix > philosophy is to push such decisions up the stack, not down. The > decision to align partitions on 4096-byte boundaries because we're not > sure of the correct number but know for a fact that using a smaller > number can have a huge impact on performance is the installer's to make. Those are all things that the operating system does not have defaults for: there are no tools like, say, gpart or newfs that layout disks in any even vaguely automated way, and so no tools that would ever have defaults for, say, the size of a swap partition except for the installer. As such, the defaults are quite properly in the installer. This is quite different: there are many tools that care about disk alignment (say, gpart) and, by default, use the GEOM stripesize. The installer is, after this patch, overriding what was meant to be a system-wide default. My concern is that pushing this into the installer means that newfs, zfs, gpart, etc., which all look at the GEOM stripesize for preferred alignment, will still have suboptimal behavior on systems affected by your patch. If we identified which drivers are reporting the wrong alignment, we could fix the whole system at a go by changing it there. As it is, we now have inconsistent default behavior for partitions between tools (the installer and sade will now use a different alignment than gpart on whatever systems you were trying to fix here) and between pre- and post-installation environments. You are papering over a bug in some unspecified driver with some unspecified disks by hacking the installer. This is fine as an expedient for 11.0, but is a ridiculous solution to the problem otherwise. We should just fix the driver for whatever weird disk you have in your machine (what is it, by the way?). Since making the reported "stripe size" match the physical sector size is what GEOM has done since at least 2009, I doubt very much that fixing any bugs in that reported value would have the weird unintended consequences you imply it might. -Nathan > > DES From owner-svn-src-all@freebsd.org Wed Aug 17 14:44:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F272BBD6AF; Wed, 17 Aug 2016 14:44:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5CF61EDB; Wed, 17 Aug 2016 14:44:48 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HEim4c074353; Wed, 17 Aug 2016 14:44:48 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HEimsD074352; Wed, 17 Aug 2016 14:44:48 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608171444.u7HEimsD074352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 17 Aug 2016 14:44:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304292 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 14:44:49 -0000 Author: tuexen Date: Wed Aug 17 14:44:47 2016 New Revision: 304292 URL: https://svnweb.freebsd.org/changeset/base/304292 Log: Use names for SCTP and UDPLite when reporting the input histogram. MFC after: 3 days Modified: head/usr.bin/netstat/inet6.c Modified: head/usr.bin/netstat/inet6.c ============================================================================== --- head/usr.bin/netstat/inet6.c Wed Aug 17 13:19:28 2016 (r304291) +++ head/usr.bin/netstat/inet6.c Wed Aug 17 14:44:47 2016 (r304292) @@ -207,11 +207,11 @@ static const char *ip6nh[] = { "#129", "#130", "#131", - "#132", + "SCTP", "#133", "#134", "#135", - "#136", + "UDPLite", "#137", "#138", "#139", From owner-svn-src-all@freebsd.org Wed Aug 17 14:49:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E53D3BBD75D; Wed, 17 Aug 2016 14:49:54 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A51E1225; Wed, 17 Aug 2016 14:49:54 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1ba2A4-0002Qi-Sk; Wed, 17 Aug 2016 17:49:44 +0300 Date: Wed, 17 Aug 2016 17:49:44 +0300 From: Slawa Olhovchenkov To: Nathan Whitehorn Cc: Dag-Erling =?utf-8?B?U23DuHJncmF2?= , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit Message-ID: <20160817144944.GM22212@zxy.spb.ru> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 14:49:55 -0000 On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote: > > Your contention that the installer does not make policy decisions is > > equally spurious. The installer makes many policy decisions, including > > the disk layout, the size of the swap partition, the name of the pool, > > the use of boot environments (which I dislike but am not allowed to > > override), the number of filesets and their mountpoints (which I also > > dislike and am not allowed to override either), etc. The Unix > > philosophy is to push such decisions up the stack, not down. The > > decision to align partitions on 4096-byte boundaries because we're not > > sure of the correct number but know for a fact that using a smaller > > number can have a huge impact on performance is the installer's to make. > > Those are all things that the operating system does not have defaults > for: there are no tools like, say, gpart or newfs that layout disks in > any even vaguely automated way, and so no tools that would ever have > defaults for, say, the size of a swap partition except for the > installer. As such, the defaults are quite properly in the installer. > This is quite different: there are many tools that care about disk > alignment (say, gpart) and, by default, use the GEOM stripesize. The > installer is, after this patch, overriding what was meant to be a > system-wide default. > > My concern is that pushing this into the installer means that newfs, > zfs, gpart, etc., which all look at the GEOM stripesize for preferred > alignment, will still have suboptimal behavior on systems affected by > your patch. If we identified which drivers are reporting the wrong > alignment, we could fix the whole system at a go by changing it there. > As it is, we now have inconsistent default behavior for partitions > between tools (the installer and sade will now use a different alignment > than gpart on whatever systems you were trying to fix here) and between > pre- and post-installation environments. In long term, prefered aligment is forsing 4k (or may be more): install system on 512b [mirror] disk aligment now may be need required replace disk to 4k aligment. For more flexsible in future now best chois is 4k or more. From owner-svn-src-all@freebsd.org Wed Aug 17 14:55:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95BD2BBD92E; Wed, 17 Aug 2016 14:55:51 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D749169C; Wed, 17 Aug 2016 14:55:51 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id EACCE1FE022; Wed, 17 Aug 2016 16:55:47 +0200 (CEST) Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Slawa Olhovchenkov , Nathan Whitehorn References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <20160817144944.GM22212@zxy.spb.ru> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Hans Petter Selasky Message-ID: <4a28f419-5293-0753-068d-1e07ddb01c2d@selasky.org> Date: Wed, 17 Aug 2016 17:00:16 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160817144944.GM22212@zxy.spb.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 14:55:51 -0000 On 08/17/16 16:49, Slawa Olhovchenkov wrote: > On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote: > > In long term, prefered aligment is forsing 4k (or may be more): > install system on 512b [mirror] disk aligment now may be need required replace > disk to 4k aligment. For more flexsible in future now best chois is 4k > or more. Hi, Not sure if it is an issue, but what will happen if a magic disk has a size less than 4K and uses a block size of 512bytes and the disk alignment gets rounded up to 4K. Will any of logic in this patch fail or hang? --HPS From owner-svn-src-all@freebsd.org Wed Aug 17 15:05:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF716BBDB78; Wed, 17 Aug 2016 15:05:12 +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 B924C1B66; Wed, 17 Aug 2016 15:05:12 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id C40212C47; Wed, 17 Aug 2016 15:05:10 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id E87798EAE; Wed, 17 Aug 2016 17:03:44 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> Date: Wed, 17 Aug 2016 17:03:44 +0200 In-Reply-To: <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> (Nathan Whitehorn's message of "Wed, 17 Aug 2016 07:36:00 -0700") Message-ID: <86wpjf4eun.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 15:05:13 -0000 Nathan Whitehorn writes: > Dag-Erling Sm=C3=B8rgrav writes: > > [...] And you keep refusing to address the fact that most drivers > > don't report a stripe size, except by repeating your claim that they > > do, with no evidence to back it up. Feel free to 'grep -r > > stripesize /usr/src/sys/dev'. Go on, I'll wait. > And yet, if you look at the GEOM XML, it is reported and there. And, > look, it's even right for the AF 512e disks in my machine! Yes, that is one of the few cases where we get it right, as previously mentioned. But it only works because it's known to us (listed in the quirk table) and directly attached. If you replace that drive with a brand new one a year from now, you have no guarantee that the new drive will be recognized as an AF drive. > I've literally never seen a case where we don't already do the right > thing here. The I can only conclude that you have very little real-world experience. I have mentioned several examples to you, and even told you how to confirm, by inspecting the source code, that most drivers do *not* set the stripe size. > It's correct, as far as I can tell, 100% of the time on all possible > variants of AF disks. You keep repeating this, as if it somehow proves me wrong. It doesn't. > One could argue that calling this the "stripesize" is a hack, and I > would agree, One could, but one would be wrong. > As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev, > as I'm sure you know, and you will find all the code that handles this > there. Only for directly attached drives, and most drives do not report the correct physical sector size, which is why we have quirk tables. > We should just fix the driver for whatever weird disk you have in your > machine (what is it, by the way?). Oh please. Now you're just being an . DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@freebsd.org Wed Aug 17 15:05:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76A16BBDBCC; Wed, 17 Aug 2016 15:05:43 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5680F1CF1; Wed, 17 Aug 2016 15:05:43 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net ([128.54.117.176]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7HF5Xwu007627 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 17 Aug 2016 08:05:33 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Slawa Olhovchenkov References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <20160817144944.GM22212@zxy.spb.ru> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Nathan Whitehorn Message-ID: Date: Wed, 17 Aug 2016 08:05:33 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160817144944.GM22212@zxy.spb.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVY0KSf7VD9Zfubr+ZpkYcRaUXT1pxoj4TvCRRVM0SS5bJMk3PnnZ9rL0VzhOWk3egwnO0UiwR5A/GEgjOh8h0h1ypsui/GRNZY= X-Sonic-ID: C;cCx/C4xk5hGvKq/hcgQksw== M;Ug+1C4xk5hGvKq/hcgQksw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 15:05:43 -0000 On 08/17/16 07:49, Slawa Olhovchenkov wrote: > On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote: > >>> Your contention that the installer does not make policy decisions is >>> equally spurious. The installer makes many policy decisions, including >>> the disk layout, the size of the swap partition, the name of the pool, >>> the use of boot environments (which I dislike but am not allowed to >>> override), the number of filesets and their mountpoints (which I also >>> dislike and am not allowed to override either), etc. The Unix >>> philosophy is to push such decisions up the stack, not down. The >>> decision to align partitions on 4096-byte boundaries because we're not >>> sure of the correct number but know for a fact that using a smaller >>> number can have a huge impact on performance is the installer's to make. >> Those are all things that the operating system does not have defaults >> for: there are no tools like, say, gpart or newfs that layout disks in >> any even vaguely automated way, and so no tools that would ever have >> defaults for, say, the size of a swap partition except for the >> installer. As such, the defaults are quite properly in the installer. >> This is quite different: there are many tools that care about disk >> alignment (say, gpart) and, by default, use the GEOM stripesize. The >> installer is, after this patch, overriding what was meant to be a >> system-wide default. >> >> My concern is that pushing this into the installer means that newfs, >> zfs, gpart, etc., which all look at the GEOM stripesize for preferred >> alignment, will still have suboptimal behavior on systems affected by >> your patch. If we identified which drivers are reporting the wrong >> alignment, we could fix the whole system at a go by changing it there. >> As it is, we now have inconsistent default behavior for partitions >> between tools (the installer and sade will now use a different alignment >> than gpart on whatever systems you were trying to fix here) and between >> pre- and post-installation environments. > In long term, prefered aligment is forsing 4k (or may be more): > install system on 512b [mirror] disk aligment now may be need required replace > disk to 4k aligment. For more flexsible in future now best chois is 4k > or more. For future-proofing in such circumstances, it might be worth expanding the vfs.zfs.min_auto_ashift tunable into some global thing that the disk drivers (or geom_disk) read to round up the physical sector sizes they would otherwise report. That would ensure that gpart, zfs, etc. all behave consistently in such cases. -Nathan From owner-svn-src-all@freebsd.org Wed Aug 17 15:06:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A93E7BBDC37; Wed, 17 Aug 2016 15:06:58 +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 716FE1E6F; Wed, 17 Aug 2016 15:06:57 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 8A0CE2C5C; Wed, 17 Aug 2016 15:06:56 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id BE9468EB1; Wed, 17 Aug 2016 17:05:30 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Hans Petter Selasky Cc: Slawa Olhovchenkov , Nathan Whitehorn , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <20160817144944.GM22212@zxy.spb.ru> <4a28f419-5293-0753-068d-1e07ddb01c2d@selasky.org> Date: Wed, 17 Aug 2016 17:05:30 +0200 In-Reply-To: <4a28f419-5293-0753-068d-1e07ddb01c2d@selasky.org> (Hans Petter Selasky's message of "Wed, 17 Aug 2016 17:00:16 +0200") Message-ID: <86shu34erp.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 15:06:58 -0000 Hans Petter Selasky writes: > Not sure if it is an issue, but what will happen if a magic disk has a > size less than 4K and uses a block size of 512bytes and the disk > alignment gets rounded up to 4K. Will any of logic in this patch fail > or hang? What is a magic disk, and why would you want to install FreeBSD on a drive with less than 4096 bytes available? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@freebsd.org Wed Aug 17 15:07:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20688BBDC82; Wed, 17 Aug 2016 15:07:16 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5CD1113B; Wed, 17 Aug 2016 15:07:15 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1ba2Qz-0002vR-Vl; Wed, 17 Aug 2016 18:07:13 +0300 Date: Wed, 17 Aug 2016 18:07:13 +0300 From: Slawa Olhovchenkov To: Hans Petter Selasky Cc: Nathan Whitehorn , Dag-Erling =?utf-8?B?U23DuHJncmF2?= , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit Message-ID: <20160817150713.GO8192@zxy.spb.ru> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <20160817144944.GM22212@zxy.spb.ru> <4a28f419-5293-0753-068d-1e07ddb01c2d@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4a28f419-5293-0753-068d-1e07ddb01c2d@selasky.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 15:07:16 -0000 On Wed, Aug 17, 2016 at 05:00:16PM +0200, Hans Petter Selasky wrote: > On 08/17/16 16:49, Slawa Olhovchenkov wrote: > > On Wed, Aug 17, 2016 at 07:36:00AM -0700, Nathan Whitehorn wrote: > > > > > In long term, prefered aligment is forsing 4k (or may be more): > > install system on 512b [mirror] disk aligment now may be need required replace > > disk to 4k aligment. For more flexsible in future now best chois is 4k > > or more. > > Hi, > > Not sure if it is an issue, but what will happen if a magic disk has a > size less than 4K and uses a block size of 512bytes and the disk > alignment gets rounded up to 4K. Will any of logic in this patch fail or > hang? I am not sure about understunding you. Do you talk about disk total size of 1536 bytes and less? From owner-svn-src-all@freebsd.org Wed Aug 17 15:14:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EF2ABBDF74; Wed, 17 Aug 2016 15:14:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D5721632; Wed, 17 Aug 2016 15:14:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HFEL9f085460; Wed, 17 Aug 2016 15:14:21 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HFELuO085459; Wed, 17 Aug 2016 15:14:21 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201608171514.u7HFELuO085459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 17 Aug 2016 15:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304293 - stable/10/sys/net X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 15:14:22 -0000 Author: kp Date: Wed Aug 17 15:14:21 2016 New Revision: 304293 URL: https://svnweb.freebsd.org/changeset/base/304293 Log: MFC r289932, r289940: PF_ANEQ() macro will in most situations returns TRUE comparing two identical IPv4 packets (when it should return FALSE). It happens because PF_ANEQ() doesn't stop if first 32 bits of IPv4 packets are equal and starts to check next 3*32 bits (like for IPv6 packet). Those bits containt some garbage and in result PF_ANEQ() wrongly returns TRUE. Fix: Check if packet is of AF_INET type and if it is then compare only first 32 bits of data. PR: 204005 Submitted by: MiÅ‚osz Kaniewski Modified: stable/10/sys/net/pfvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/pfvar.h ============================================================================== --- stable/10/sys/net/pfvar.h Wed Aug 17 14:44:47 2016 (r304292) +++ stable/10/sys/net/pfvar.h Wed Aug 17 15:14:21 2016 (r304293) @@ -198,10 +198,11 @@ extern struct rwlock pf_rules_lock; (a)->addr32[0] == (b)->addr32[0])) \ #define PF_ANEQ(a, b, c) \ - ((a)->addr32[0] != (b)->addr32[0] || \ + ((c == AF_INET && (a)->addr32[0] != (b)->addr32[0]) || \ + (c == AF_INET6 && ((a)->addr32[0] != (b)->addr32[0] || \ (a)->addr32[1] != (b)->addr32[1] || \ (a)->addr32[2] != (b)->addr32[2] || \ - (a)->addr32[3] != (b)->addr32[3]) \ + (a)->addr32[3] != (b)->addr32[3]))) \ #define PF_AZERO(a, c) \ ((c == AF_INET && !(a)->addr32[0]) || \ From owner-svn-src-all@freebsd.org Wed Aug 17 15:16:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6640BBC03C; Wed, 17 Aug 2016 15:16:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EC8E1832; Wed, 17 Aug 2016 15:16:54 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A70CF1FE022; Wed, 17 Aug 2016 17:16:46 +0200 (CEST) Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <20160817144944.GM22212@zxy.spb.ru> <4a28f419-5293-0753-068d-1e07ddb01c2d@selasky.org> <86shu34erp.fsf@desk.des.no> Cc: Slawa Olhovchenkov , Nathan Whitehorn , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org From: Hans Petter Selasky Message-ID: Date: Wed, 17 Aug 2016 17:21:15 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <86shu34erp.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 15:16:54 -0000 On 08/17/16 17:05, Dag-Erling Smørgrav wrote: > Hans Petter Selasky writes: >> Not sure if it is an issue, but what will happen if a magic disk has a >> size less than 4K and uses a block size of 512bytes and the disk >> alignment gets rounded up to 4K. Will any of logic in this patch fail >> or hang? > > What is a magic disk, and why would you want to install FreeBSD on a > drive with less than 4096 bytes available? > Hi, My intention is not to install FreeBSD on a 3K disk. My question is pure mathematical, if the bsdinstall will segfault, division by zero or anything like that, if one should try to install FreeBSD on a 3K disk, because you round up the size of the disk to be bigger than it actually is. Should there be a check for too small disks in there? --HPS From owner-svn-src-all@freebsd.org Wed Aug 17 15:27:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65B6EBBC38D; Wed, 17 Aug 2016 15:27:13 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 547D01F2C; Wed, 17 Aug 2016 15:27:12 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net ([128.54.117.176]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7HFR0Tj010256 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 17 Aug 2016 08:27:00 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> Date: Wed, 17 Aug 2016 08:26:59 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <86wpjf4eun.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVauyAqj5D59L9d0QuN0zBMVNDOaOVZqi33i5R04TrQjZxWiMikqeUTfFdKKNYjKECq/OJ34p50jI2xIHmOQQl0AanFmcraZIEw= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 15:27:13 -0000 On 08/17/16 08:03, Dag-Erling Smørgrav wrote: > Nathan Whitehorn writes: >> Dag-Erling Smørgrav writes: >>> [...] And you keep refusing to address the fact that most drivers >>> don't report a stripe size, except by repeating your claim that they >>> do, with no evidence to back it up. Feel free to 'grep -r >>> stripesize /usr/src/sys/dev'. Go on, I'll wait. >> And yet, if you look at the GEOM XML, it is reported and there. And, >> look, it's even right for the AF 512e disks in my machine! > Yes, that is one of the few cases where we get it right, as previously > mentioned. But it only works because it's known to us (listed in the > quirk table) and directly attached. If you replace that drive with a > brand new one a year from now, you have no guarantee that the new drive > will be recognized as an AF drive. Not true at all. All modern disks report their physical sector size, as distinct from the logical one, in their ATA IDENTIFY data and ata_da.c uses that. There is also a small quirks table for some older spinning disks and a few SSDs that lie and mostly hasn't needed additions in quite some time. camcontrol identify correctly reports 4096 for the physical sector size on 5 different random AF-512e disks I just checked (some of those are also, redundantly, in the quirks table). Since this seems to have become the standard, I can't imagine that the quirks table would need to grow much in the future for this issue. > >> I've literally never seen a case where we don't already do the right >> thing here. > The I can only conclude that you have very little real-world experience. > I have mentioned several examples to you, and even told you how to > confirm, by inspecting the source code, that most drivers do *not* set > the stripe size. Most drivers? Yes, sure. Most drivers that people use? No. And I am aware of how to use grep, thanks. > >> It's correct, as far as I can tell, 100% of the time on all possible >> variants of AF disks. > You keep repeating this, as if it somehow proves me wrong. It doesn't. > >> One could argue that calling this the "stripesize" is a hack, and I >> would agree, > One could, but one would be wrong. >> As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev, >> as I'm sure you know, and you will find all the code that handles this >> there. > Only for directly attached drives, and most drives do not report the > correct physical sector size, which is why we have quirk tables. Which disks? Your original email said that VMware reports too-small values and that there is a bug in the LSI MegaRAID driver. I'm not sure which actual drivers those were (e.g. mfid or through CAM), or how they were set up (RAID or passthrough), but that's a small list and those issues can presumably be fixed. I would be happy to help make those changes if you can provide some more information. >> We should just fix the driver for whatever weird disk you have in your >> machine (what is it, by the way?). > Oh please. Now you're just being an . I somehow still don't know what problem, on what hardware, you are actually trying to fix. Instead, I get delightful personal invective. The patch is fine for 11.0. I would like to know what bugs it was fixing, so we can fix them more broadly after the release. Is that so much to ask? -Nathan > DES From owner-svn-src-all@freebsd.org Wed Aug 17 15:41:27 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFFEEBBC7D2; Wed, 17 Aug 2016 15:41:27 +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 776611905; Wed, 17 Aug 2016 15:41:27 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id E4C702D4B; Wed, 17 Aug 2016 15:41:25 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 1AD428EB6; Wed, 17 Aug 2016 17:40:00 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Hans Petter Selasky Cc: Slawa Olhovchenkov , Nathan Whitehorn , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <20160817144944.GM22212@zxy.spb.ru> <4a28f419-5293-0753-068d-1e07ddb01c2d@selasky.org> <86shu34erp.fsf@desk.des.no> Date: Wed, 17 Aug 2016 17:39:59 +0200 In-Reply-To: (Hans Petter Selasky's message of "Wed, 17 Aug 2016 17:21:15 +0200") Message-ID: <86oa4r4d68.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 15:41:27 -0000 Hans Petter Selasky writes: > My intention is not to install FreeBSD on a 3K disk. My question is > pure mathematical, if the bsdinstall will segfault, division by zero > or anything like that, if one should try to install FreeBSD on a 3K > disk, because you round up the size of the disk to be bigger than it > actually is. The code in question computes the offset and size of the largest block of contiguous free space on a disk that already has a partition table. If you even got this far, it would round the offset up to 4096 and the size down by and equivalent amount and you'd get an error box saying "No free space left on device". Say you have a 3584-byte provider with 512-byte sectors formatted with MBR, leaving 3072 bytes (6 sectors) free at offset 512 (1); stripe size is unreported and is arbitrarily set to the smallest common multiple of 512 and 4096, which is 4096; misalignment is 512 % 4096 =3D=3D 512 bytes; adjustment is (4096 - 512) / 512 =3D=3D 7 sectors; adjusted offset is 8 sectors, adjusted size is -1 sectors which the caller rejects (and yes, the variables are unsigned and the check is for <=3D 0, not =3D=3D 0, so everything works as intended). DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@freebsd.org Wed Aug 17 15:46:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 216D5BBCB5E; Wed, 17 Aug 2016 15:46:31 +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 DEB701EF3; Wed, 17 Aug 2016 15:46:30 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id A58C82DAA; Wed, 17 Aug 2016 15:46:29 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id E0E088EB9; Wed, 17 Aug 2016 17:45:03 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> Date: Wed, 17 Aug 2016 17:45:03 +0200 In-Reply-To: <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> (Nathan Whitehorn's message of "Wed, 17 Aug 2016 08:26:59 -0700") Message-ID: <86k2ff4cxs.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 15:46:31 -0000 Nathan Whitehorn writes: > Dag-Erling Sm=C3=B8rgrav writes: > > I have mentioned several examples to you, and even told you how to > > confirm, by inspecting the source code, that most drivers do *not* > > set the stripe size. > Most drivers? Yes, sure. Most drivers that people use? No. Every. Single. Dell. Server. Probably every single HP server as well, I haven't checked. VirtualBox gets it wrong. Xen gets it wrong. I believe KVM (including RHEV) and VMWare get it wrong too, but haven't been able to verify. I guess those aren't important to you? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@freebsd.org Wed Aug 17 15:51:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FEBDBBCF0D for ; Wed, 17 Aug 2016 15:51:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45DF317C3 for ; Wed, 17 Aug 2016 15:51:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x244.google.com with SMTP id j124so9762626ith.3 for ; Wed, 17 Aug 2016 08:51:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=JYv1HpFsXQQRe/172PSgaDrpEqVyQrRQoZp/b+yaMaI=; b=f7LhX+p303RsnS+bW9b0zpcgPfVL91pNeuhhRkCJg6ccZ3xFg/HhlBMVBB6PZ6T8nA r/tg+xlegkIxsPK50JTBv899HFBzAxSYCtenMKIVSQqrzprKzJfFnUrqLESJnE2D4b54 pHB6+Vw6oPoiMmFx47Xi+AVzPd6eKsKQfEp4oiFk2wKj0I/05c5v+FBOKmnHYEfKVfr4 PRJPiW/h3SoqK8ugXEjX0vCoquj9WO5AjRm2V9P5TRy294DJ+Izyx7CFEB4u+fOsYIJc 1TjV+1TE009POeC8olPxo5GN8Vmaj6u2+w7YbViJe+WDJi8oV+DxUnlSpiO/QlM7KQeL TrLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=JYv1HpFsXQQRe/172PSgaDrpEqVyQrRQoZp/b+yaMaI=; b=hmWpYBUHMtMcF9ht0gMO7IpgHSZgVrYvsnCueRivjHbbZ7vLgwQET8yyhfSaqcePEz pzS+o9GGHC3ZGRYTxHcZvpQj10suQiiAEbDezAbKaKwU1BJIXK0q796CF4MbKgwFT1Ue 2Q5EdP71wJ0mvVbmydfMriHSDD/gU2u2PFYipgk0nvFPvMSJoY/EZolCXbPef73pcS0i yqEGWzkWd8gd4HkI1tx9FF3NWg97SE4OR7U14vgu6PZ0/CIuFy7eCoAZ5ZwGzXpI4PM2 y8F33Hvo5hDjLuqPY7bHbObV8CaGg0lxk30CUzU6H0Oy5Za22PAf177uceytvBnhcuCr m43Q== X-Gm-Message-State: AEkoout1OQ4OLkOg0Rs5BFl+kwOERgyUuN8Nqx0Ms9+uh7sc0ep112SGtmL4AtNCjCREK1rUa2HI3o892C/EwA== X-Received: by 10.36.116.193 with SMTP id o184mr1312981itc.14.1471449078665; Wed, 17 Aug 2016 08:51:18 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Wed, 17 Aug 2016 08:51:17 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> From: Warner Losh Date: Wed, 17 Aug 2016 09:51:17 -0600 X-Google-Sender-Auth: uZkeXaP3Q4A-Hf5Z2gUPrmbwsv0 Message-ID: Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Nathan Whitehorn Cc: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 15:51:19 -0000 On Wed, Aug 17, 2016 at 8:36 AM, Nathan Whitehorn wrote: > As for grepping, the CAM disk drivers are all in sys/cam, not sys/dev, as > I'm sure you know, and you will find all the code that handles this there. There's at least a dozen disk drivers that aren't CAM. The code in CAM that handles this is, at best, a set of heuristics that can and does get it wrong. These two facts alone severely undermine your argument. Warner From owner-svn-src-all@freebsd.org Wed Aug 17 15:57:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B235CBBD285 for ; Wed, 17 Aug 2016 15:57:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78EC01B47 for ; Wed, 17 Aug 2016 15:57:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22b.google.com with SMTP id x131so3440904ite.0 for ; Wed, 17 Aug 2016 08:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=OWdDeo5p8TbGZXEy2BHOYjfW5WQFv/tv5+s847PJkv0=; b=bLfvT3X40eHSZ4tK4Fq0j0zrEUPsBu4gDdNxAehVVrrU0ns3G5dLkHNaYZ85bPYPMZ 3tllWb52S6PKgVliaCJEO6to+Aw37ZivIqtrFqoOgT3wL0yjVcG9QazWvDZS1gpZRPgP Z5DQIXhU9QQz85TWuWCTjlcJILFAqvqAdvi5GULFJOfvXMXQ9MPCwnmwyl5r8mLgshRB vObkcHB0jsDPL/Bu5pexA1o1LI282wWq+qWJnHykJKO09yG08S7Z8t4T7LaDnTWAsvTD PW9G5ibJtzh42mqopAAvfTXaKOkV1QFX6xOt3Y8dfw40gCW6q7cv/K0/52Bh5umhhBbh N2fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=OWdDeo5p8TbGZXEy2BHOYjfW5WQFv/tv5+s847PJkv0=; b=TdSXGzqZ3ia+Gi2Brts3iSt76+nzM/jG4TKjCL7n4MQw1LP7sIhRxrmMRkMnM6U/vY yH9YO3bkcC0gIwsvpX56l/eBq9/FR9cFB4llbRFdqrwRiq90BQVf1V3IlJ39yRiS4NV5 dRTYvVus8saehB7gcbzI4kGhYaSylNS+5PDe+McT4w7fZGRglZIm7SuuyTJ6VAoc8/p9 H5s9YDQRspvungFNHGCS4OHODrgjZENsjj4BOClZaBzGNVFtzrn6FTgnNXWXSf+wKtcT xWU61Xadum0aXmVdorCG58Ak/qtZcYq3z1jVJZ3Uvss/DCqd/C0ZCV3UpRvjI6baXpGO 8pcw== X-Gm-Message-State: AEkoouvI2baKzYdbe8KWeiNflk7DXT32BrSLt1ApsvMEgCwX6gXN3ATVeqAktjYuDP5jPEdi3lvCMzi2uETFBw== X-Received: by 10.36.213.131 with SMTP id a125mr28507079itg.14.1471449464862; Wed, 17 Aug 2016 08:57:44 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Wed, 17 Aug 2016 08:57:44 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> From: Warner Losh Date: Wed, 17 Aug 2016 09:57:44 -0600 X-Google-Sender-Auth: 0hCCn9pT0_4YusyeE7b6_TZ72PA Message-ID: Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Nathan Whitehorn Cc: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 15:57:45 -0000 On Wed, Aug 17, 2016 at 9:26 AM, Nathan Whitehorn wrote: > Not true at all. All modern disks report their physical sector size, as > distinct from the logical one, in their ATA IDENTIFY data and ata_da.c uses > that. You are correct that there are two fields in the ATA IDENTIFY. However, you are incorrect in thinking that all modern disks report their actual physical sector size instead of a 'compatibility' number. We have dozens of quirks and are adding them at the rate of a couple a month to make the current imperfect magic happen. > There is also a small quirks table for some older spinning disks and a > few SSDs that lie and mostly hasn't needed additions in quite some time. > camcontrol identify correctly reports 4096 for the physical sector size on 5 > different random AF-512e disks I just checked (some of those are also, > redundantly, in the quirks table). Since this seems to have become the > standard, I can't imagine that the quirks table would need to grow much in > the future for this issue. Any yet the table continues to grow. As someone who evaluates disks for a large streaming media company, you cannot begin to imagine the number of things that vendors get wrong... Life would be so much easier if you could actually trust vendors to report things correctly in their ATA IDENTIFY command. SCSI is better, but still not perfect. You should really listen to people that have been on the front line here. CAM does a decent job of getting things right. It isn't perfect and can never be perfect. Expecting it to magically change to be perfect is unreasonable and will literally never happen. Warner From owner-svn-src-all@freebsd.org Wed Aug 17 16:04:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB033BBD458 for ; Wed, 17 Aug 2016 16:04:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC6BA1016 for ; Wed, 17 Aug 2016 16:04:11 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x236.google.com with SMTP id q83so139669945iod.1 for ; Wed, 17 Aug 2016 09:04:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=QRWZtKbWPpkJCCQ/imWTJrvm6XS25Sq3TXTC6Sup3Kg=; b=AQzkDk0YuL7+lDjc+9AqoPE7J4E9fZJGpUBG079hpeTPeKpXuJ3pdcM8doPbbKcUhW 8u75wCXWsJTCfcMDycOLBew15EIlwapDIbX+1fOABjL4SfF36qPGD7zS3xaZgVfvUdeu 2Qt02hadCnLi/hY8DrcI2V3ssbI+3yOfFG6rfc2MkEfg68UYVCMHskAknIgxT18ou7Gf Yu4vAsPxpk01MpHLUZ6v3qULfpYOjEB5QvndNDUyuckhkKBrB74C9z3RBhtI5NXihkPR GwW4+Nfgi2Urizsyb0Z5Nc07tAdmpBhFTh86PkriWuUBQY2t7oU3XxnnCXZp8VP76nN+ jayw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=QRWZtKbWPpkJCCQ/imWTJrvm6XS25Sq3TXTC6Sup3Kg=; b=Rs6sdDnACh2v9ifngYQetVZT0tv7pJw/pOMDYU/eX4kEay8n+cNUElLGuW+ztqi/Gl HUA2cXovISio5+UuM4Lui5FhTUevTnQYLH1wMLoSU1yNILcmgnZ0rp/0AGDJ7KkDKUvM UINJZba5vI39kcwjQTRgOIhw1sNGgOh+cWFcq8LFAHU/At4r38tLkN7Rs/vSs1sX7SEe FzS82RLDayyOjzGaXn/emUrPv9m81WYvU+4iCvcYgayodLGieI6WOCYps1WEiD2TJrRC /OH/zGskTQYvO5J7+rjUSy/JuEZ8VdqlMjJFO7o8GCUp7Vud7fq+cWid+Tu59x+83u/o 0S2A== X-Gm-Message-State: AEkoouvGaJWGVAF49F3+pE70L7es59WPGPeLXdrmrbQVh7fe3D86FAojioI/XSvZtwtVscNN0ISOzGC5w9k9EQ== X-Received: by 10.107.21.134 with SMTP id 128mr46020959iov.59.1471449850980; Wed, 17 Aug 2016 09:04:10 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Wed, 17 Aug 2016 09:04:10 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <86k2ff4cxs.fsf@desk.des.no> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> From: Warner Losh Date: Wed, 17 Aug 2016 10:04:10 -0600 X-Google-Sender-Auth: pzwaT3jDht6bHzP9EtcMvqdBvx0 Message-ID: Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 16:04:12 -0000 On Wed, Aug 17, 2016 at 9:45 AM, Dag-Erling Sm=C3=B8rgrav wrot= e: > Nathan Whitehorn writes: >> Dag-Erling Sm=C3=B8rgrav writes: >> > I have mentioned several examples to you, and even told you how to >> > confirm, by inspecting the source code, that most drivers do *not* >> > set the stripe size. >> Most drivers? Yes, sure. Most drivers that people use? No. > > Every. Single. Dell. Server. > > Probably every single HP server as well, I haven't checked. > > VirtualBox gets it wrong. Xen gets it wrong. I believe KVM (including > RHEV) and VMWare get it wrong too, but haven't been able to verify. > > I guess those aren't important to you? Also, SD cards get it wrong. It is reported, true enough, but it is often wrong in the sense it can be suboptimal. Different SD cards report different things for the number of sectors to erase at a time. Some vendors do an excellent job of reporting the optimal amount. Others do not (often because the Warner From owner-svn-src-all@freebsd.org Wed Aug 17 16:07:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 848F8BBD4FF for ; Wed, 17 Aug 2016 16:07:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4968512FB for ; Wed, 17 Aug 2016 16:07:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22e.google.com with SMTP id 38so139670427iol.0 for ; Wed, 17 Aug 2016 09:07:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=sXOymg03wEIXSHlZsbXXBAyULcIHHA5ZOFE62g7kR8c=; b=vwfRnSuNmJaoNFVgN9GdgWrWdkF6kobpLz5HoDc6G/1NHljUFTlClghT6PYEepqJS1 bo6C9sk2wO1o+cPI6zMrUtptn76u/aD7LNRrGdeFr2UUhIQbF2j2M9zu5yesk5jV7fj7 1uhc2UF9JucuDdw9bj1eFGMSJiiR7LT1uTd3aacRnJOyPQCc27RwKnlyLWKgHYgCMR4u xKyLABkzdNLAN7vNSBHgxpQNDtWGTI86v6g8JWChxrbsEy/UvqoWNR6osGW83FaNNBun Q0HVRCWS6vBdDBObCk9Pd710qzcLu6IhZGnfbu4pEtgLFrQYisA2COq6K5O3+mrJtkkR eC1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=sXOymg03wEIXSHlZsbXXBAyULcIHHA5ZOFE62g7kR8c=; b=MA6KpEYSXn+heSpAEpbdOhe11EApOAd6wvdq/l+SuIWfUyQQR90ddNpZBzIccTBdmd zigszIVzseDhscYbcnrpXj6hSxXI1iCNZRBT8ndfXEp5enIqUphFn7cJyxh4mwPiCu8W P2u6GZsNrVb7cPjFebs6Y/jgkGdeYE5LvFk7ktC783ZEKSn+iPDGOPQedIr1hn9w6gOL Iy8feu/FNZqMZrM3q/EKQiA1XlPSODn78Ad8llh6sm0Q1M7WlaKDpT238ogEPTXAEshd RqW7cjOJGQNYobu2CQ3pfpuQVVgk/3xRe3yCG3ERp6FRRci3xIntcnhMSwf0+AbItSBF GoDw== X-Gm-Message-State: AEkooutHB8oc1nRQyn7gFkjsZEnW1/RDu056omSYaHX3iEFLHwmpDO1S8rin8FTG0wCeNvdyXXGW8fwa0q4rCg== X-Received: by 10.107.21.134 with SMTP id 128mr46043999iov.59.1471450037657; Wed, 17 Aug 2016 09:07:17 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Wed, 17 Aug 2016 09:07:16 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> From: Warner Losh Date: Wed, 17 Aug 2016 10:07:16 -0600 X-Google-Sender-Auth: FzpSm3LweYC1M_S-iLcYqXcjSqA Message-ID: Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 16:07:18 -0000 On Wed, Aug 17, 2016 at 10:04 AM, Warner Losh wrote: > On Wed, Aug 17, 2016 at 9:45 AM, Dag-Erling Sm=C3=B8rgrav wr= ote: >> Nathan Whitehorn writes: >>> Dag-Erling Sm=C3=B8rgrav writes: >>> > I have mentioned several examples to you, and even told you how to >>> > confirm, by inspecting the source code, that most drivers do *not* >>> > set the stripe size. >>> Most drivers? Yes, sure. Most drivers that people use? No. >> >> Every. Single. Dell. Server. >> >> Probably every single HP server as well, I haven't checked. >> >> VirtualBox gets it wrong. Xen gets it wrong. I believe KVM (including >> RHEV) and VMWare get it wrong too, but haven't been able to verify. >> >> I guess those aren't important to you? > > Also, SD cards get it wrong. It is reported, true enough, but it is often > wrong in the sense it can be suboptimal. Different SD cards report > different things for the number of sectors to erase at a time. Some > vendors do an excellent job of reporting the optimal amount. Others > do not (often because [stupid gmail] often because they copy from last year's design. I've had to override the reported size numerous times to get decent performance from SD cards in the past. Almost all of the recent embedded boards that FreeBSD supports use SD cards. While we provide images to just boot off of, there are several designs that have both a SD card and an embedded eMMC or similar card that we should be able to run the installer on. Warner From owner-svn-src-all@freebsd.org Wed Aug 17 16:30:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8BAEBBDCDD; Wed, 17 Aug 2016 16:30:14 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C833812E4; Wed, 17 Aug 2016 16:30:14 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net ([169.228.189.36]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7HGUA9k019851 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 17 Aug 2016 09:30:10 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: Date: Wed, 17 Aug 2016 09:30:10 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <86k2ff4cxs.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVbU5fKK7v1KoKr1/TS73Krui+yWVRtIZt9HPU8bT3ZHmC6m1WuQ2YcB8JDJp1JXGg9q3KlKF9MPZLDDw6yiPAGL+nmqd22ePms= X-Sonic-ID: C;fJeO3Zdk5hGtYK/hcgQksw== M;vB3X3Zdk5hGtYK/hcgQksw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 16:30:15 -0000 On 08/17/16 08:45, Dag-Erling Smørgrav wrote: > Nathan Whitehorn writes: >> Dag-Erling Smørgrav writes: >>> I have mentioned several examples to you, and even told you how to >>> confirm, by inspecting the source code, that most drivers do *not* >>> set the stripe size. >> Most drivers? Yes, sure. Most drivers that people use? No. > Every. Single. Dell. Server. > > Probably every single HP server as well, I haven't checked. > > VirtualBox gets it wrong. Xen gets it wrong. I believe KVM (including > RHEV) and VMWare get it wrong too, but haven't been able to verify. > > I guess those aren't important to you? > > DES OK. In which configurations? My Dell servers, for instance, don't do this. How are they set up? What drivers are being used? Is this something that affects passthrough disks, RAIDs, disk images? The point is that *if the reported stripe size is wrong*, more things than partition alignment in the installer will suffer for it. Fixing the installer with a bandaid in the run-up to a release is fine, but *we need to fix the underlying problem*. -Nathan From owner-svn-src-all@freebsd.org Wed Aug 17 16:36:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73C11BBDFF1; Wed, 17 Aug 2016 16:36:17 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E2DE190A; Wed, 17 Aug 2016 16:36:17 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net ([169.228.189.36]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7HGaCAs026713 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 17 Aug 2016 09:36:13 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Warner Losh References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Nathan Whitehorn Message-ID: <445700cb-c4b4-9272-df17-a851a6200543@freebsd.org> Date: Wed, 17 Aug 2016 09:36:12 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVaNaPsK1U2+5Er4m0/6y4VC+uZX4higp+OnDJSIsGNtmD4TzmkNfLifRmuQbCpgLDvyKNm7IAk+q0U6Wk83UCTSsL1RBki5VNY= X-Sonic-ID: C;zlvRtZhk5hGvua/hcgQksw== M;UJz6tZhk5hGvua/hcgQksw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 16:36:17 -0000 On 08/17/16 08:57, Warner Losh wrote: > On Wed, Aug 17, 2016 at 9:26 AM, Nathan Whitehorn > wrote: >> Not true at all. All modern disks report their physical sector size, as >> distinct from the logical one, in their ATA IDENTIFY data and ata_da.c uses >> that. > You are correct that there are two fields in the ATA IDENTIFY. However, > you are incorrect in thinking that all modern disks report their actual > physical sector size instead of a 'compatibility' number. We have dozens > of quirks and are adding them at the rate of a couple a month to make the > current imperfect magic happen. > >> There is also a small quirks table for some older spinning disks and a >> few SSDs that lie and mostly hasn't needed additions in quite some time. >> camcontrol identify correctly reports 4096 for the physical sector size on 5 >> different random AF-512e disks I just checked (some of those are also, >> redundantly, in the quirks table). Since this seems to have become the >> standard, I can't imagine that the quirks table would need to grow much in >> the future for this issue. > Any yet the table continues to grow. As someone who evaluates disks for a large > streaming media company, you cannot begin to imagine the number of things > that vendors get wrong... Life would be so much easier if you could actually > trust vendors to report things correctly in their ATA IDENTIFY command. > SCSI is better, but still not perfect. > > You should really listen to people that have been on the front line here. > CAM does a decent job of getting things right. It isn't perfect and can never > be perfect. Expecting it to magically change to be perfect is unreasonable > and will literally never happen. > > Warner > OK, so then what is the solution here? We have a number of tools that need to know this information: gpart, sade, bsdinstall, zfs, graid, etc. If we want to have a consistent set of defaults -- for example, to use 4K across the board, which I think is a good idea -- there should be a central place to set this that does not involve hacking a variety of independent tools. Do you disagree? I don't care how that happens. It happens that the way we currently encode this is geom stripesize. If we feel like we can't get this right in drivers, then we should provide a tunable to set a minimum default alignment. You could implement this in lots of different ways. But having static values hardcoded in random places that makes similar tools (sade, gpart) behave inconsistently cannot possibly be the answer. This is my point, from beginning to end. Is there any reason -- at all -- that we should prefer per-tool one-off changes to fixing the central mechanism we already have to give consistent results that we think are reliable? -Nathan From owner-svn-src-all@freebsd.org Wed Aug 17 16:56:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9A56BBD633; Wed, 17 Aug 2016 16:56:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 967DF163A; Wed, 17 Aug 2016 16:56:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HGuKm2023171; Wed, 17 Aug 2016 16:56:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HGuKHE023170; Wed, 17 Aug 2016 16:56:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608171656.u7HGuKHE023170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 17 Aug 2016 16:56:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304295 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 16:56:21 -0000 Author: tuexen Date: Wed Aug 17 16:56:20 2016 New Revision: 304295 URL: https://svnweb.freebsd.org/changeset/base/304295 Log: Fix the output for scope statistics. MFC after: 3 days Modified: head/usr.bin/netstat/inet6.c Modified: head/usr.bin/netstat/inet6.c ============================================================================== --- head/usr.bin/netstat/inet6.c Wed Aug 17 15:50:56 2016 (r304294) +++ head/usr.bin/netstat/inet6.c Wed Aug 17 16:56:20 2016 (r304295) @@ -488,8 +488,8 @@ ip6_stats(u_long off, const char *name, "{N:/global%s}\n");\ break;\ default:\ - xo_emit("\t\t{qke:name/%x}{:count/%ju} " \ - "addresses scope=%x\n",\ + xo_emit("\t\t{qke:name/%#x}{:count/%ju} " \ + "{N:/addresses scope=%#x}\n",\ i, (uintmax_t)ip6stat.s, i); \ }\ } while (0); From owner-svn-src-all@freebsd.org Wed Aug 17 17:54:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C224BBD6EC; Wed, 17 Aug 2016 17:54:25 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BE9813C6; Wed, 17 Aug 2016 17:54:25 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HHsORB044850; Wed, 17 Aug 2016 17:54:24 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HHsOKj044849; Wed, 17 Aug 2016 17:54:24 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201608171754.u7HHsOKj044849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 17 Aug 2016 17:54:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304296 - stable/11 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 17:54:25 -0000 Author: lwhsu (ports committer) Date: Wed Aug 17 17:54:24 2016 New Revision: 304296 URL: https://svnweb.freebsd.org/changeset/base/304296 Log: MFC 303935 Only remove empty directories before packaging. This preserves files are intentionally empty, most of them are in tests.txz Reviewed by: bdrewery Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Wed Aug 17 16:56:20 2016 (r304295) +++ stable/11/Makefile.inc1 Wed Aug 17 17:54:24 2016 (r304296) @@ -1011,7 +1011,7 @@ distributeworld installworld stageworld: ${IMAKEENV} rm -rf ${INSTALLTMP} .if make(distributeworld) .for dist in ${EXTRA_DISTRIBUTIONS} - find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -empty -delete + find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -type d -empty -delete .endfor .if defined(NO_ROOT) .for dist in base ${EXTRA_DISTRIBUTIONS} From owner-svn-src-all@freebsd.org Wed Aug 17 17:57:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23085BBD7D2; Wed, 17 Aug 2016 17:57:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D6C361604; Wed, 17 Aug 2016 17:57:35 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id UAA10915; Wed, 17 Aug 2016 20:57:28 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1ba55j-000ID5-UU; Wed, 17 Aug 2016 20:57:27 +0300 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Nathan Whitehorn , Warner Losh References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <445700cb-c4b4-9272-df17-a851a6200543@freebsd.org> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Andriy Gapon Message-ID: Date: Wed, 17 Aug 2016 20:56:31 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <445700cb-c4b4-9272-df17-a851a6200543@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 17:57:37 -0000 On 17/08/2016 19:36, Nathan Whitehorn wrote: > OK, so then what is the solution here? We have a number of tools that need to > know this information: gpart, sade, bsdinstall, zfs, graid, etc. If we want to > have a consistent set of defaults -- for example, to use 4K across the board, > which I think is a good idea -- there should be a central place to set this that > does not involve hacking a variety of independent tools. Do you disagree? > > I don't care how that happens. It happens that the way we currently encode this > is geom stripesize. If we feel like we can't get this right in drivers, then we > should provide a tunable to set a minimum default alignment. You could implement > this in lots of different ways. But having static values hardcoded in random > places that makes similar tools (sade, gpart) behave inconsistently cannot > possibly be the answer. > > This is my point, from beginning to end. Is there any reason -- at all -- that > we should prefer per-tool one-off changes to fixing the central mechanism we > already have to give consistent results that we think are reliable? It would be perfect to get a correct description of a disk and to do that in central place. But still I, as a user / administrator, want to be able to _force_ the alignment that I want when I partition a disk, create a filesystem, etc. That is, even if the kernel reports the perfectly correct information and the tools know how to automatically do what's best for me, I still want to eb able to override. And I think that installers and administrative tools should provide a way to do that. And many already do, e.g. 'gpart add -a X'. So, I do not see how striving for the better disk detection (in a central place) and having more knobs in the administration tools are mutually exclusive or conflicting goals. Just my two bits. -- Andriy Gapon From owner-svn-src-all@freebsd.org Wed Aug 17 17:59:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0A2BBBD8B2; Wed, 17 Aug 2016 17:59:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A127117C3; Wed, 17 Aug 2016 17:59:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HHx93M045058; Wed, 17 Aug 2016 17:59:09 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HHx93Z045057; Wed, 17 Aug 2016 17:59:09 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608171759.u7HHx93Z045057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Aug 2016 17:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304297 - head/sys/modules/dtb/allwinner 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 17:59:10 -0000 Author: manu Date: Wed Aug 17 17:59:09 2016 New Revision: 304297 URL: https://svnweb.freebsd.org/changeset/base/304297 Log: Add sun5i-a13-olinuxino to the build. Modified: head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/modules/dtb/allwinner/Makefile ============================================================================== --- head/sys/modules/dtb/allwinner/Makefile Wed Aug 17 17:54:24 2016 (r304296) +++ head/sys/modules/dtb/allwinner/Makefile Wed Aug 17 17:59:09 2016 (r304297) @@ -8,6 +8,7 @@ DTS= \ olimex-a20-som-evb.dts \ olinuxino-lime.dts \ pcduino3.dts \ - sinovoip-bpi-m3.dts + sinovoip-bpi-m3.dts \ + sun5i-a13-olinuxino.dts .include From owner-svn-src-all@freebsd.org Wed Aug 17 18:00:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33FA6BBD95B; Wed, 17 Aug 2016 18:00:28 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16D0E199B; Wed, 17 Aug 2016 18:00:27 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net ([169.228.189.36]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7HI0L49005836 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 17 Aug 2016 11:00:21 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Andriy Gapon , Warner Losh References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <445700cb-c4b4-9272-df17-a851a6200543@freebsd.org> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Nathan Whitehorn Message-ID: Date: Wed, 17 Aug 2016 11:00:20 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVYFIqqtA+yJncLr5Or0QwCYVKjmrfBlc9pzSgMAArO9tTOHCI7G34u7CIZR0VDDz/SsDfULAI0+GYGruHbj8cS2nvNzrZB44iE= X-Sonic-ID: C;BB+2dqRk5hGmWKDx2xNB0g== M;kGj+dqRk5hGmWKDx2xNB0g== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 18:00:28 -0000 On 08/17/16 10:56, Andriy Gapon wrote: > On 17/08/2016 19:36, Nathan Whitehorn wrote: >> OK, so then what is the solution here? We have a number of tools that need to >> know this information: gpart, sade, bsdinstall, zfs, graid, etc. If we want to >> have a consistent set of defaults -- for example, to use 4K across the board, >> which I think is a good idea -- there should be a central place to set this that >> does not involve hacking a variety of independent tools. Do you disagree? >> >> I don't care how that happens. It happens that the way we currently encode this >> is geom stripesize. If we feel like we can't get this right in drivers, then we >> should provide a tunable to set a minimum default alignment. You could implement >> this in lots of different ways. But having static values hardcoded in random >> places that makes similar tools (sade, gpart) behave inconsistently cannot >> possibly be the answer. >> >> This is my point, from beginning to end. Is there any reason -- at all -- that >> we should prefer per-tool one-off changes to fixing the central mechanism we >> already have to give consistent results that we think are reliable? > It would be perfect to get a correct description of a disk and to do that in > central place. But still I, as a user / administrator, want to be able to > _force_ the alignment that I want when I partition a disk, create a filesystem, > etc. That is, even if the kernel reports the perfectly correct information and > the tools know how to automatically do what's best for me, I still want to eb > able to override. And I think that installers and administrative tools should > provide a way to do that. And many already do, e.g. 'gpart add -a X'. > So, I do not see how striving for the better disk detection (in a central place) > and having more knobs in the administration tools are mutually exclusive or > conflicting goals. > > Just my two bits. Agreed 100%. The issue here is that this kind of patch unconditionally overrides the kernel in an unsettable way. I think the right scheme is: 1. Try to get the real values as much as possible. 2. Provide a global hint to all tools that you want some value (e.g. 4K) unless the drivers are *sure* it's the wrong answer. 3. Have options in individual tools to force other values. We have (1), though it can probably be improved, and (3) and just need (2). -Nathan From owner-svn-src-all@freebsd.org Wed Aug 17 19:33:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CA51BBD7A2; Wed, 17 Aug 2016 19:33:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDA351F19; Wed, 17 Aug 2016 19:33:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HJXsIS082827; Wed, 17 Aug 2016 19:33:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HJXqdE082811; Wed, 17 Aug 2016 19:33:52 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608171933.u7HJXqdE082811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Aug 2016 19:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304298 - in vendor/llvm/dist: . cmake/modules docs docs/CommandGuide docs/TableGen include/llvm-c include/llvm/ADT include/llvm/Analysis include/llvm/CodeGen include/llvm/IR include/ll... X-SVN-Group: vendor 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 19:33:55 -0000 Author: dim Date: Wed Aug 17 19:33:52 2016 New Revision: 304298 URL: https://svnweb.freebsd.org/changeset/base/304298 Log: Vendor import of llvm release_39 branch r278877: https://llvm.org/svn/llvm-project/llvm/branches/release_39@278877 Added: vendor/llvm/dist/lib/IR/AttributeSetNode.h (contents, props changed) vendor/llvm/dist/test/CodeGen/AArch64/aarch64-vcvtfp2fxs-combine.ll vendor/llvm/dist/test/CodeGen/AMDGPU/invalid-opencl-version-metadata1.ll vendor/llvm/dist/test/CodeGen/AMDGPU/invalid-opencl-version-metadata2.ll vendor/llvm/dist/test/CodeGen/AMDGPU/invalid-opencl-version-metadata3.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.fdiv.fast.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.groupstaticsize.ll vendor/llvm/dist/test/CodeGen/ARM/ssat-v4t.ll vendor/llvm/dist/test/CodeGen/ARM/usat-v4t.ll vendor/llvm/dist/test/CodeGen/Mips/jumptable_labels.ll vendor/llvm/dist/test/CodeGen/X86/pr28504.ll vendor/llvm/dist/test/CodeGen/X86/pr28824.ll vendor/llvm/dist/test/CodeGen/X86/tail-merge-after-mbp.ll vendor/llvm/dist/test/DebugInfo/COFF/pr28747.ll vendor/llvm/dist/test/Linker/Inputs/metadata-with-global-value-operand.ll vendor/llvm/dist/test/Linker/metadata-with-global-value-operand.ll vendor/llvm/dist/test/Transforms/IndVarSimplify/pr28935.ll vendor/llvm/dist/test/Transforms/Inline/inalloca-not-static.ll vendor/llvm/dist/test/Transforms/LCSSA/pr28424.ll vendor/llvm/dist/test/Transforms/LCSSA/pr28608.ll vendor/llvm/dist/test/Transforms/LoopSimplify/pr28272.ll vendor/llvm/dist/test/Transforms/LoopStrengthReduce/X86/pr28719.ll vendor/llvm/dist/test/Transforms/LoopVectorize/pr28541.ll vendor/llvm/dist/test/Transforms/SafeStack/coloring-ssp.ll vendor/llvm/dist/test/Transforms/SafeStack/layout-region-split.ll Deleted: vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.groupstaticgroup.ll vendor/llvm/dist/test/CodeGen/AMDGPU/reciprocal.ll Modified: vendor/llvm/dist/CMakeLists.txt vendor/llvm/dist/LICENSE.TXT vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake vendor/llvm/dist/docs/CodeGenerator.rst vendor/llvm/dist/docs/CommandGuide/FileCheck.rst vendor/llvm/dist/docs/CommandGuide/llvm-nm.rst vendor/llvm/dist/docs/CommandGuide/opt.rst vendor/llvm/dist/docs/ExceptionHandling.rst vendor/llvm/dist/docs/Extensions.rst vendor/llvm/dist/docs/GarbageCollection.rst vendor/llvm/dist/docs/GetElementPtr.rst vendor/llvm/dist/docs/HowToUseInstrMappings.rst vendor/llvm/dist/docs/InAlloca.rst vendor/llvm/dist/docs/LangRef.rst vendor/llvm/dist/docs/MIRLangRef.rst vendor/llvm/dist/docs/MarkedUpDisassembly.rst vendor/llvm/dist/docs/MergeFunctions.rst vendor/llvm/dist/docs/NVPTXUsage.rst vendor/llvm/dist/docs/ReleaseNotes.rst vendor/llvm/dist/docs/SegmentedStacks.rst vendor/llvm/dist/docs/SourceLevelDebugging.rst vendor/llvm/dist/docs/Statepoints.rst vendor/llvm/dist/docs/TableGen/LangIntro.rst vendor/llvm/dist/docs/TableGen/index.rst vendor/llvm/dist/docs/WritingAnLLVMBackend.rst vendor/llvm/dist/docs/WritingAnLLVMPass.rst vendor/llvm/dist/docs/index.rst vendor/llvm/dist/include/llvm-c/Core.h vendor/llvm/dist/include/llvm/ADT/GraphTraits.h vendor/llvm/dist/include/llvm/ADT/SCCIterator.h vendor/llvm/dist/include/llvm/ADT/STLExtras.h vendor/llvm/dist/include/llvm/ADT/Triple.h vendor/llvm/dist/include/llvm/ADT/iterator.h vendor/llvm/dist/include/llvm/Analysis/CallGraph.h vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpander.h vendor/llvm/dist/include/llvm/CodeGen/MachineBasicBlock.h vendor/llvm/dist/include/llvm/IR/Attributes.h vendor/llvm/dist/include/llvm/IR/CFG.h vendor/llvm/dist/include/llvm/IR/IntrinsicsX86.td vendor/llvm/dist/include/llvm/Target/TargetLowering.h vendor/llvm/dist/lib/Analysis/BlockFrequencyInfoImpl.cpp vendor/llvm/dist/lib/Analysis/ConstantFolding.cpp vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp vendor/llvm/dist/lib/Analysis/LoopUnrollAnalyzer.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolutionExpander.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp vendor/llvm/dist/lib/CodeGen/BranchFolding.cpp vendor/llvm/dist/lib/CodeGen/SafeStack.cpp vendor/llvm/dist/lib/CodeGen/SafeStackColoring.cpp vendor/llvm/dist/lib/CodeGen/SafeStackLayout.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp vendor/llvm/dist/lib/CodeGen/TwoAddressInstructionPass.cpp vendor/llvm/dist/lib/IR/AttributeImpl.h vendor/llvm/dist/lib/IR/AutoUpgrade.cpp vendor/llvm/dist/lib/IR/Core.cpp vendor/llvm/dist/lib/IR/Metadata.cpp vendor/llvm/dist/lib/Support/Triple.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64.td vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUIntrinsicInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUIntrinsicInfo.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp vendor/llvm/dist/lib/Target/AMDGPU/R600ISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/R600ISelLowering.h vendor/llvm/dist/lib/Target/AMDGPU/SIDefines.h vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.h vendor/llvm/dist/lib/Target/AMDGPU/SIInstrFormats.td vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.h vendor/llvm/dist/lib/Target/AMDGPU/SIInstrInfo.td vendor/llvm/dist/lib/Target/AMDGPU/SIInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/SIIntrinsics.td vendor/llvm/dist/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIRegisterInfo.h vendor/llvm/dist/lib/Target/AMDGPU/SIWholeQuadMode.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.td vendor/llvm/dist/lib/Target/ARM/ARMInstrThumb2.td vendor/llvm/dist/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp vendor/llvm/dist/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp vendor/llvm/dist/lib/Target/Mips/MipsTargetMachine.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86InstrInfo.cpp vendor/llvm/dist/lib/Target/X86/X86InstrInfo.h vendor/llvm/dist/lib/Target/X86/X86InstrSSE.td vendor/llvm/dist/lib/Transforms/IPO/FunctionAttrs.cpp vendor/llvm/dist/lib/Transforms/IPO/GlobalOpt.cpp vendor/llvm/dist/lib/Transforms/IPO/PassManagerBuilder.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineSelect.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstructionCombining.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/ThreadSanitizer.cpp vendor/llvm/dist/lib/Transforms/Scalar/ConstantProp.cpp vendor/llvm/dist/lib/Transforms/Scalar/EarlyCSE.cpp vendor/llvm/dist/lib/Transforms/Scalar/IndVarSimplify.cpp vendor/llvm/dist/lib/Transforms/Scalar/JumpThreading.cpp vendor/llvm/dist/lib/Transforms/Scalar/LICM.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopStrengthReduce.cpp vendor/llvm/dist/lib/Transforms/Utils/CloneFunction.cpp vendor/llvm/dist/lib/Transforms/Utils/InlineFunction.cpp vendor/llvm/dist/lib/Transforms/Utils/LCSSA.cpp vendor/llvm/dist/lib/Transforms/Utils/LoopSimplify.cpp vendor/llvm/dist/lib/Transforms/Vectorize/LoopVectorize.cpp vendor/llvm/dist/test/CodeGen/AMDGPU/amdgpu-codegenprepare.ll vendor/llvm/dist/test/CodeGen/AMDGPU/amdgpu.private-memory.ll vendor/llvm/dist/test/CodeGen/AMDGPU/basic-branch.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fdiv.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fp_to_sint.f64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fp_to_sint.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fp_to_uint.f64.ll vendor/llvm/dist/test/CodeGen/AMDGPU/fp_to_uint.ll vendor/llvm/dist/test/CodeGen/AMDGPU/rcp-pattern.ll vendor/llvm/dist/test/CodeGen/AMDGPU/skip-if-dead.ll vendor/llvm/dist/test/CodeGen/AMDGPU/vector-alloca.ll vendor/llvm/dist/test/CodeGen/AMDGPU/wqm.ll vendor/llvm/dist/test/CodeGen/ARM/arm-and-tst-peephole.ll vendor/llvm/dist/test/CodeGen/ARM/ssat.ll vendor/llvm/dist/test/CodeGen/Mips/2009-11-16-CstPoolLoad.ll vendor/llvm/dist/test/CodeGen/Mips/2010-07-20-Switch.ll vendor/llvm/dist/test/CodeGen/Mips/analyzebranch.ll vendor/llvm/dist/test/CodeGen/Mips/atomic.ll vendor/llvm/dist/test/CodeGen/Mips/blez_bgez.ll vendor/llvm/dist/test/CodeGen/Mips/blockaddr.ll vendor/llvm/dist/test/CodeGen/Mips/ehframe-indirect.ll vendor/llvm/dist/test/CodeGen/Mips/fcmp.ll vendor/llvm/dist/test/CodeGen/Mips/fpbr.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/ashr.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/indirectbr.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/lshr.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/select-dbl.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/select-flt.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/select-int.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/shl.ll vendor/llvm/dist/test/CodeGen/Mips/longbranch.ll vendor/llvm/dist/test/CodeGen/Mips/msa/basic_operations.ll vendor/llvm/dist/test/CodeGen/Mips/msa/basic_operations_float.ll vendor/llvm/dist/test/CodeGen/Mips/octeon.ll vendor/llvm/dist/test/CodeGen/X86/avx-intrinsics-fast-isel.ll vendor/llvm/dist/test/CodeGen/X86/avx-intrinsics-x86-upgrade.ll vendor/llvm/dist/test/CodeGen/X86/avx-intrinsics-x86.ll vendor/llvm/dist/test/CodeGen/X86/avx512-cvt.ll vendor/llvm/dist/test/CodeGen/X86/sse-intrinsics-fast-isel-x86_64.ll vendor/llvm/dist/test/CodeGen/X86/sse-intrinsics-fast-isel.ll vendor/llvm/dist/test/CodeGen/X86/sse2-intrinsics-fast-isel-x86_64.ll vendor/llvm/dist/test/CodeGen/X86/sse2-intrinsics-fast-isel.ll vendor/llvm/dist/test/CodeGen/X86/sse2-intrinsics-x86-upgrade.ll vendor/llvm/dist/test/CodeGen/X86/sse2-intrinsics-x86.ll vendor/llvm/dist/test/CodeGen/X86/twoaddr-lea.ll vendor/llvm/dist/test/DebugInfo/COFF/inlining-same-name.ll vendor/llvm/dist/test/Instrumentation/ThreadSanitizer/do-not-instrument-memory-access.ll vendor/llvm/dist/test/MC/Disassembler/ARM/unpredictable-SSAT-arm.txt vendor/llvm/dist/test/MC/Mips/cpsetup.s vendor/llvm/dist/test/MC/Mips/expansion-jal-sym-pic.s vendor/llvm/dist/test/MC/Mips/macro-la.s vendor/llvm/dist/test/MC/Mips/mips3/valid.s vendor/llvm/dist/test/MC/Mips/mips4/valid.s vendor/llvm/dist/test/MC/Mips/mips5/valid.s vendor/llvm/dist/test/MC/Mips/mips64/valid.s vendor/llvm/dist/test/MC/Mips/mips64r2/valid.s vendor/llvm/dist/test/MC/Mips/mips64r3/valid.s vendor/llvm/dist/test/MC/Mips/mips64r5/valid.s vendor/llvm/dist/test/MC/Mips/relocation.s vendor/llvm/dist/test/Transforms/ConstProp/calls.ll vendor/llvm/dist/test/Transforms/EarlyCSE/basic.ll vendor/llvm/dist/test/Transforms/GlobalOpt/metadata.ll vendor/llvm/dist/test/Transforms/Inline/inline_constprop.ll vendor/llvm/dist/test/Transforms/InstCombine/call.ll vendor/llvm/dist/test/Transforms/InstCombine/log-pow.ll vendor/llvm/dist/test/Transforms/InstCombine/select.ll vendor/llvm/dist/unittests/ADT/SCCIteratorTest.cpp vendor/llvm/dist/unittests/IR/MetadataTest.cpp vendor/llvm/dist/unittests/Support/IteratorTest.cpp vendor/llvm/dist/utils/release/test-release.sh Modified: vendor/llvm/dist/CMakeLists.txt ============================================================================== --- vendor/llvm/dist/CMakeLists.txt Wed Aug 17 17:59:09 2016 (r304297) +++ vendor/llvm/dist/CMakeLists.txt Wed Aug 17 19:33:52 2016 (r304298) @@ -293,6 +293,7 @@ endif() option(LLVM_ENABLE_CXX1Y "Compile with C++1y enabled." OFF) option(LLVM_ENABLE_LIBCXX "Use libc++ if available." OFF) option(LLVM_ENABLE_LIBCXXABI "Use libc++abi when using libc++." OFF) +option(LLVM_ENABLE_LLD "Use lld as C and C++ linker." OFF) option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON) option(LLVM_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF) Modified: vendor/llvm/dist/LICENSE.TXT ============================================================================== --- vendor/llvm/dist/LICENSE.TXT Wed Aug 17 17:59:09 2016 (r304297) +++ vendor/llvm/dist/LICENSE.TXT Wed Aug 17 19:33:52 2016 (r304298) @@ -61,8 +61,6 @@ licenses, and/or restrictions: Program Directory ------- --------- -Autoconf llvm/autoconf - llvm/projects/ModuleMaker/autoconf Google Test llvm/utils/unittest/googletest OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex} pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT} Modified: vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake Wed Aug 17 17:59:09 2016 (r304297) +++ vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake Wed Aug 17 19:33:52 2016 (r304298) @@ -144,6 +144,12 @@ function(add_flag_or_print_warning flag endif() endfunction() +if(LLVM_ENABLE_LLD) + check_cxx_compiler_flag("-fuse-ld=lld" CXX_SUPPORTS_LLD) + append_if(CXX_SUPPORTS_LLD "-fuse-ld=lld" + CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS) +endif() + if( LLVM_ENABLE_PIC ) if( XCODE ) # Xcode has -mdynamic-no-pic on by default, which overrides -fPIC. I don't Modified: vendor/llvm/dist/docs/CodeGenerator.rst ============================================================================== --- vendor/llvm/dist/docs/CodeGenerator.rst Wed Aug 17 17:59:09 2016 (r304297) +++ vendor/llvm/dist/docs/CodeGenerator.rst Wed Aug 17 19:33:52 2016 (r304298) @@ -436,7 +436,7 @@ For example, consider this simple LLVM e The X86 instruction selector might produce this machine code for the ``div`` and ``ret``: -.. code-block:: llvm +.. code-block:: text ;; Start of div %EAX = mov %reg1024 ;; Copy X (in reg1024) into EAX @@ -453,7 +453,7 @@ By the end of code generation, the regis registers and delete the resultant identity moves producing the following code: -.. code-block:: llvm +.. code-block:: text ;; X is in EAX, Y is in ECX mov %EAX, %EDX @@ -965,7 +965,7 @@ target code. For example, consider the This LLVM code corresponds to a SelectionDAG that looks basically like this: -.. code-block:: llvm +.. code-block:: text (fadd:f32 (fmul:f32 (fadd:f32 W, X), Y), Z) Modified: vendor/llvm/dist/docs/CommandGuide/FileCheck.rst ============================================================================== --- vendor/llvm/dist/docs/CommandGuide/FileCheck.rst Wed Aug 17 17:59:09 2016 (r304297) +++ vendor/llvm/dist/docs/CommandGuide/FileCheck.rst Wed Aug 17 19:33:52 2016 (r304298) @@ -144,7 +144,7 @@ exists anywhere in the file. The FileCheck -check-prefix option ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -The FileCheck :option:`-check-prefix` option allows multiple test +The FileCheck `-check-prefix` option allows multiple test configurations to be driven from one `.ll` file. This is useful in many circumstances, for example, testing different architectural variants with :program:`llc`. Here's a simple example: @@ -303,7 +303,7 @@ be aware that the definition rule can ma So, for instance, the code below will pass: -.. code-block:: llvm +.. code-block:: text ; CHECK-DAG: vmov.32 [[REG2:d[0-9]+]][0] ; CHECK-DAG: vmov.32 [[REG2]][1] @@ -312,7 +312,7 @@ So, for instance, the code below will pa While this other code, will not: -.. code-block:: llvm +.. code-block:: text ; CHECK-DAG: vmov.32 [[REG2:d[0-9]+]][0] ; CHECK-DAG: vmov.32 [[REG2]][1] @@ -473,7 +473,7 @@ To match newline characters in regular e matches output of the form (from llvm-dwarfdump): -.. code-block:: llvm +.. code-block:: text DW_AT_location [DW_FORM_sec_offset] (0x00000233) DW_AT_name [DW_FORM_strp] ( .debug_str[0x000000c9] = "intd") Modified: vendor/llvm/dist/docs/CommandGuide/llvm-nm.rst ============================================================================== --- vendor/llvm/dist/docs/CommandGuide/llvm-nm.rst Wed Aug 17 17:59:09 2016 (r304297) +++ vendor/llvm/dist/docs/CommandGuide/llvm-nm.rst Wed Aug 17 19:33:52 2016 (r304298) @@ -68,11 +68,11 @@ OPTIONS .. option:: -B (default) - Use BSD output format. Alias for :option:`--format=bsd`. + Use BSD output format. Alias for `--format=bsd`. .. option:: -P - Use POSIX.2 output format. Alias for :option:`--format=posix`. + Use POSIX.2 output format. Alias for `--format=posix`. .. option:: --debug-syms, -a Modified: vendor/llvm/dist/docs/CommandGuide/opt.rst ============================================================================== --- vendor/llvm/dist/docs/CommandGuide/opt.rst Wed Aug 17 17:59:09 2016 (r304297) +++ vendor/llvm/dist/docs/CommandGuide/opt.rst Wed Aug 17 19:33:52 2016 (r304298) @@ -12,16 +12,16 @@ DESCRIPTION The :program:`opt` command is the modular LLVM optimizer and analyzer. It takes LLVM source files as input, runs the specified optimizations or analyses on it, and then outputs the optimized file or the analysis results. The -function of :program:`opt` depends on whether the :option:`-analyze` option is +function of :program:`opt` depends on whether the `-analyze` option is given. -When :option:`-analyze` is specified, :program:`opt` performs various analyses +When `-analyze` is specified, :program:`opt` performs various analyses of the input source. It will usually print the results on standard output, but in a few cases, it will print output to standard error or generate a file with the analysis output, which is usually done when the output is meant for another program. -While :option:`-analyze` is *not* given, :program:`opt` attempts to produce an +While `-analyze` is *not* given, :program:`opt` attempts to produce an optimized output file. The optimizations available via :program:`opt` depend upon what libraries were linked into it as well as any additional libraries that have been loaded with the :option:`-load` option. Use the :option:`-help` @@ -68,19 +68,19 @@ OPTIONS .. option:: -disable-opt - This option is only meaningful when :option:`-std-link-opts` is given. It + This option is only meaningful when `-std-link-opts` is given. It disables most passes. .. option:: -strip-debug This option causes opt to strip debug information from the module before - applying other optimizations. It is essentially the same as :option:`-strip` + applying other optimizations. It is essentially the same as `-strip` but it ensures that stripping of debug information is done first. .. option:: -verify-each This option causes opt to add a verify pass after every pass otherwise - specified on the command line (including :option:`-verify`). This is useful + specified on the command line (including `-verify`). This is useful for cases where it is suspected that a pass is creating an invalid module but it is not clear which pass is doing it. Modified: vendor/llvm/dist/docs/ExceptionHandling.rst ============================================================================== --- vendor/llvm/dist/docs/ExceptionHandling.rst Wed Aug 17 17:59:09 2016 (r304297) +++ vendor/llvm/dist/docs/ExceptionHandling.rst Wed Aug 17 19:33:52 2016 (r304298) @@ -406,7 +406,7 @@ outlined. After the handler is outlined ``llvm.eh.exceptionpointer`` ---------------------------- -.. code-block:: llvm +.. code-block:: text i8 addrspace(N)* @llvm.eh.padparam.pNi8(token %catchpad) @@ -427,7 +427,7 @@ backend. Uses of them are generated by ``llvm.eh.sjlj.setjmp`` ~~~~~~~~~~~~~~~~~~~~~~~ -.. code-block:: llvm +.. code-block:: text i32 @llvm.eh.sjlj.setjmp(i8* %setjmp_buf) @@ -664,7 +664,7 @@ all of the new IR instructions: return 0; } -.. code-block:: llvm +.. code-block:: text define i32 @f() nounwind personality i32 (...)* @__CxxFrameHandler3 { entry: @@ -741,7 +741,7 @@ C++ code: } } -.. code-block:: llvm +.. code-block:: text define void @f() #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { entry: Modified: vendor/llvm/dist/docs/Extensions.rst ============================================================================== --- vendor/llvm/dist/docs/Extensions.rst Wed Aug 17 17:59:09 2016 (r304297) +++ vendor/llvm/dist/docs/Extensions.rst Wed Aug 17 19:33:52 2016 (r304298) @@ -43,7 +43,7 @@ The following additional relocation type corresponds to the COFF relocation types ``IMAGE_REL_I386_DIR32NB`` (32-bit) or ``IMAGE_REL_AMD64_ADDR32NB`` (64-bit). -.. code-block:: gas +.. code-block:: text .text fun: Modified: vendor/llvm/dist/docs/GarbageCollection.rst ============================================================================== --- vendor/llvm/dist/docs/GarbageCollection.rst Wed Aug 17 17:59:09 2016 (r304297) +++ vendor/llvm/dist/docs/GarbageCollection.rst Wed Aug 17 19:33:52 2016 (r304298) @@ -204,7 +204,7 @@ IR features is specified by the selected Specifying GC code generation: ``gc "..."`` ------------------------------------------- -.. code-block:: llvm +.. code-block:: text define @name(...) gc "name" { ... } Modified: vendor/llvm/dist/docs/GetElementPtr.rst ============================================================================== --- vendor/llvm/dist/docs/GetElementPtr.rst Wed Aug 17 17:59:09 2016 (r304297) +++ vendor/llvm/dist/docs/GetElementPtr.rst Wed Aug 17 19:33:52 2016 (r304298) @@ -105,7 +105,7 @@ memory, or a global variable. To make this clear, let's consider a more obtuse example: -.. code-block:: llvm +.. code-block:: text %MyVar = uninitialized global i32 ... @@ -142,7 +142,7 @@ Quick answer: there are no superfluous i This question arises most often when the GEP instruction is applied to a global variable which is always a pointer type. For example, consider this: -.. code-block:: llvm +.. code-block:: text %MyStruct = uninitialized global { float*, i32 } ... @@ -178,7 +178,7 @@ The GetElementPtr instruction dereferenc memory in any way. That's what the Load and Store instructions are for. GEP is only involved in the computation of addresses. For example, consider this: -.. code-block:: llvm +.. code-block:: text %MyVar = uninitialized global { [40 x i32 ]* } ... @@ -195,7 +195,7 @@ illegal. In order to access the 18th integer in the array, you would need to do the following: -.. code-block:: llvm +.. code-block:: text %idx = getelementptr { [40 x i32]* }, { [40 x i32]* }* %, i64 0, i32 0 %arr = load [40 x i32]** %idx @@ -204,7 +204,7 @@ following: In this case, we have to load the pointer in the structure with a load instruction before we can index into the array. If the example was changed to: -.. code-block:: llvm +.. code-block:: text %MyVar = uninitialized global { [40 x i32 ] } ... Modified: vendor/llvm/dist/docs/HowToUseInstrMappings.rst ============================================================================== --- vendor/llvm/dist/docs/HowToUseInstrMappings.rst Wed Aug 17 17:59:09 2016 (r304297) +++ vendor/llvm/dist/docs/HowToUseInstrMappings.rst Wed Aug 17 19:33:52 2016 (r304298) @@ -30,7 +30,7 @@ instructions with each other. These tabl ``XXXInstrInfo.inc`` file along with the functions to query them. Following is the definition of ``InstrMapping`` class definied in Target.td file: -.. code-block:: llvm +.. code-block:: text class InstrMapping { // Used to reduce search space only to the instructions using this @@ -69,7 +69,7 @@ non-predicated form by assigning appropr fields. For this relationship, non-predicated instructions are treated as key instruction since they are the one used to query the interface function. -.. code-block:: llvm +.. code-block:: text def getPredOpcode : InstrMapping { // Choose a FilterClass that is used as a base class for all the @@ -116,7 +116,7 @@ to include relevant information in its d following to be the current definitions of ADD, ADD_pt (true) and ADD_pf (false) instructions: -.. code-block:: llvm +.. code-block:: text def ADD : ALU32_rr<(outs IntRegs:$dst), (ins IntRegs:$a, IntRegs:$b), "$dst = add($a, $b)", @@ -137,7 +137,7 @@ In this step, we modify these instructio required by the relationship model, getPredOpcode, so that they can be related. -.. code-block:: llvm +.. code-block:: text def ADD : PredRel, ALU32_rr<(outs IntRegs:$dst), (ins IntRegs:$a, IntRegs:$b), "$dst = add($a, $b)", Modified: vendor/llvm/dist/docs/InAlloca.rst ============================================================================== --- vendor/llvm/dist/docs/InAlloca.rst Wed Aug 17 17:59:09 2016 (r304297) +++ vendor/llvm/dist/docs/InAlloca.rst Wed Aug 17 19:33:52 2016 (r304298) @@ -41,7 +41,7 @@ that passes two default-constructed ``Fo g(Foo(), Foo()); } -.. code-block:: llvm +.. code-block:: text %struct.Foo = type { i32, i32 } declare void @Foo_ctor(%struct.Foo* %this) Modified: vendor/llvm/dist/docs/LangRef.rst ============================================================================== --- vendor/llvm/dist/docs/LangRef.rst Wed Aug 17 17:59:09 2016 (r304297) +++ vendor/llvm/dist/docs/LangRef.rst Wed Aug 17 19:33:52 2016 (r304298) @@ -839,7 +839,7 @@ Note that the Mach-O platform doesn't su Here is an example of a COMDAT group where a function will only be selected if the COMDAT key's section is the largest: -.. code-block:: llvm +.. code-block:: text $foo = comdat largest @foo = global i32 2, comdat($foo) @@ -851,7 +851,7 @@ the COMDAT key's section is the largest: As a syntactic sugar the ``$name`` can be omitted if the name is the same as the global name: -.. code-block:: llvm +.. code-block:: text $foo = comdat any @foo = global i32 2, comdat @@ -875,7 +875,7 @@ if a collision occurs in the symbol tabl The combined use of COMDATS and section attributes may yield surprising results. For example: -.. code-block:: llvm +.. code-block:: text $foo = comdat any $bar = comdat any @@ -1205,7 +1205,7 @@ makes the format of the prologue data hi A trivial example of valid prologue data for the x86 architecture is ``i8 144``, which encodes the ``nop`` instruction: -.. code-block:: llvm +.. code-block:: text define void @f() prologue i8 144 { ... } @@ -1213,7 +1213,7 @@ Generally prologue data can be formed by which skips the metadata, as in this example of valid prologue data for the x86_64 architecture, where the first two bytes encode ``jmp .+10``: -.. code-block:: llvm +.. code-block:: text %0 = type <{ i8, i8, i8* }> @@ -2237,7 +2237,7 @@ source file name to the local function n The syntax for the source file name is simply: -.. code-block:: llvm +.. code-block:: text source_filename = "/path/to/source.c" @@ -2847,7 +2847,7 @@ cleared low bit. However, in the ``%C`` allowed to assume that the '``undef``' operand could be the same as ``%Y``, allowing the whole '``select``' to be eliminated. -.. code-block:: llvm +.. code-block:: text %A = xor undef, undef @@ -2899,7 +2899,7 @@ does not execute at all. This allows us code after it. Because the undefined operation "can't happen", the optimizer can assume that it occurs in dead code. -.. code-block:: llvm +.. code-block:: text a: store undef -> %X b: store %X -> undef @@ -3884,7 +3884,7 @@ their operand. For example: Metadata nodes that aren't uniqued use the ``distinct`` keyword. For example: -.. code-block:: llvm +.. code-block:: text !0 = distinct !{!"test\00", i32 10} @@ -3949,7 +3949,7 @@ fields are tuples containing the debug i unit, regardless of code optimizations (some nodes are only emitted if there are references to them from instructions). -.. code-block:: llvm +.. code-block:: text !0 = !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang", isOptimized: true, flags: "-O2", runtimeVersion: 2, @@ -3985,7 +3985,7 @@ DIBasicType ``DIBasicType`` nodes represent primitive types, such as ``int``, ``bool`` and ``float``. ``tag:`` defaults to ``DW_TAG_base_type``. -.. code-block:: llvm +.. code-block:: text !0 = !DIBasicType(name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char) @@ -3994,7 +3994,7 @@ DIBasicType The ``encoding:`` describes the details of the type. Usually it's one of the following: -.. code-block:: llvm +.. code-block:: text DW_ATE_address = 1 DW_ATE_boolean = 2 @@ -4014,7 +4014,7 @@ refers to a tuple; the first operand is types of the formal arguments in order. If the first operand is ``null``, that represents a function with no return value (such as ``void foo() {}`` in C++). -.. code-block:: llvm +.. code-block:: text !0 = !BasicType(name: "int", size: 32, align: 32, DW_ATE_signed) !1 = !BasicType(name: "char", size: 8, align: 8, DW_ATE_signed_char) @@ -4028,7 +4028,7 @@ DIDerivedType ``DIDerivedType`` nodes represent types derived from other types, such as qualified types. -.. code-block:: llvm +.. code-block:: text !0 = !DIBasicType(name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char) @@ -4037,7 +4037,7 @@ qualified types. The following ``tag:`` values are valid: -.. code-block:: llvm +.. code-block:: text DW_TAG_member = 13 DW_TAG_pointer_type = 15 @@ -4089,7 +4089,7 @@ does not have ``flags: DIFlagFwdDecl`` together will unique such definitions at parse time via the ``identifier:`` field, even if the nodes are ``distinct``. -.. code-block:: llvm +.. code-block:: text !0 = !DIEnumerator(name: "SixKind", value: 7) !1 = !DIEnumerator(name: "SevenKind", value: 7) @@ -4100,7 +4100,7 @@ field, even if the nodes are ``distinct` The following ``tag:`` values are valid: -.. code-block:: llvm +.. code-block:: text DW_TAG_array_type = 1 DW_TAG_class_type = 2 @@ -4219,7 +4219,7 @@ type with an ODR ``identifier:`` and tha then the subprogram declaration is uniqued based only on its ``linkageName:`` and ``scope:``. -.. code-block:: llvm +.. code-block:: text define void @_Z3foov() !dbg !0 { ... @@ -4244,7 +4244,7 @@ DILexicalBlock two lexical blocks at same depth. They are valid targets for ``scope:`` fields. -.. code-block:: llvm +.. code-block:: text !0 = distinct !DILexicalBlock(scope: !1, file: !2, line: 7, column: 35) @@ -4290,7 +4290,7 @@ the ``arg:`` field is set to non-zero, t parameter, and it will be included in the ``variables:`` field of its :ref:`DISubprogram`. -.. code-block:: llvm +.. code-block:: text !0 = !DILocalVariable(name: "this", arg: 1, scope: !3, file: !2, line: 7, type: !3, flags: DIFlagArtificial) @@ -4313,7 +4313,7 @@ The current supported vocabulary is limi - ``DW_OP_bit_piece, 16, 8`` specifies the offset and size (``16`` and ``8`` here, respectively) of the variable piece from the working expression. -.. code-block:: llvm +.. code-block:: text !0 = !DIExpression(DW_OP_deref) !1 = !DIExpression(DW_OP_plus, 3) @@ -4336,7 +4336,7 @@ DIImportedEntity ``DIImportedEntity`` nodes represent entities (such as modules) imported into a compile unit. -.. code-block:: llvm +.. code-block:: text !2 = !DIImportedEntity(tag: DW_TAG_imported_module, name: "foo", scope: !0, entity: !1, line: 7) @@ -4349,7 +4349,7 @@ The ``name:`` field is the macro identif defining a function-like macro, and the ``value`` field is the token-string used to expand the macro identifier. -.. code-block:: llvm +.. code-block:: text !2 = !DIMacro(macinfo: DW_MACINFO_define, line: 7, name: "foo(x)", value: "((x) + 1)") @@ -4362,7 +4362,7 @@ DIMacroFile The ``nodes:`` field is a list of ``DIMacro`` and ``DIMacroFile`` nodes that appear in the included source file. -.. code-block:: llvm +.. code-block:: text !2 = !DIMacroFile(macinfo: DW_MACINFO_start_file, line: 7, file: !2, nodes: !3) @@ -5660,7 +5660,7 @@ block. Therefore, it must be the only no Example: """""""" -.. code-block:: llvm +.. code-block:: text dispatch1: %cs1 = catchswitch within none [label %handler0, label %handler1] unwind to caller @@ -5711,7 +5711,7 @@ the ``catchret``'s behavior is undefined Example: """""""" -.. code-block:: llvm +.. code-block:: text catchret from %catch label %continue @@ -5761,7 +5761,7 @@ It transfers control to ``continue`` or Example: """""""" -.. code-block:: llvm +.. code-block:: text cleanupret from %cleanup unwind to caller cleanupret from %cleanup unwind label %continue @@ -5851,7 +5851,7 @@ unsigned and/or signed overflow, respect Example: """""""" -.. code-block:: llvm +.. code-block:: text = add i32 4, %var ; yields i32:result = 4 + %var @@ -5890,7 +5890,7 @@ optimizations: Example: """""""" -.. code-block:: llvm +.. code-block:: text = fadd float 4.0, %var ; yields float:result = 4.0 + %var @@ -5942,7 +5942,7 @@ unsigned and/or signed overflow, respect Example: """""""" -.. code-block:: llvm +.. code-block:: text = sub i32 4, %var ; yields i32:result = 4 - %var = sub i32 0, %val ; yields i32:result = -%var @@ -5985,7 +5985,7 @@ unsafe floating point optimizations: Example: """""""" -.. code-block:: llvm +.. code-block:: text = fsub float 4.0, %var ; yields float:result = 4.0 - %var = fsub float -0.0, %val ; yields float:result = -%var @@ -6039,7 +6039,7 @@ unsigned and/or signed overflow, respect Example: """""""" -.. code-block:: llvm +.. code-block:: text = mul i32 4, %var ; yields i32:result = 4 * %var @@ -6078,7 +6078,7 @@ unsafe floating point optimizations: Example: """""""" -.. code-block:: llvm +.. code-block:: text = fmul float 4.0, %var ; yields float:result = 4.0 * %var @@ -6122,7 +6122,7 @@ such, "((a udiv exact b) mul b) == a"). Example: """""""" -.. code-block:: llvm +.. code-block:: text = udiv i32 4, %var ; yields i32:result = 4 / %var @@ -6168,7 +6168,7 @@ a :ref:`poison value ` if Example: """""""" -.. code-block:: llvm +.. code-block:: text = sdiv i32 4, %var ; yields i32:result = 4 / %var @@ -6207,7 +6207,7 @@ unsafe floating point optimizations: Example: """""""" -.. code-block:: llvm +.. code-block:: text = fdiv float 4.0, %var ; yields float:result = 4.0 / %var @@ -6249,7 +6249,7 @@ Taking the remainder of a division by ze Example: """""""" -.. code-block:: llvm +.. code-block:: text = urem i32 4, %var ; yields i32:result = 4 % %var @@ -6304,7 +6304,7 @@ result of the division and the remainder Example: """""""" -.. code-block:: llvm +.. code-block:: text = srem i32 4, %var ; yields i32:result = 4 % %var @@ -6344,7 +6344,7 @@ to enable otherwise unsafe floating poin Example: """""""" -.. code-block:: llvm +.. code-block:: text = frem float 4.0, %var ; yields float:result = 4.0 % %var @@ -6406,7 +6406,7 @@ nsw/nuw bits in (mul %op1, (shl 1, %op2) Example: """""""" -.. code-block:: llvm +.. code-block:: text = shl i32 4, %var ; yields i32: 4 << %var = shl i32 4, 2 ; yields i32: 16 @@ -6455,7 +6455,7 @@ non-zero. Example: """""""" -.. code-block:: llvm +.. code-block:: text = lshr i32 4, 1 ; yields i32:result = 2 = lshr i32 4, 2 ; yields i32:result = 1 @@ -6506,7 +6506,7 @@ non-zero. Example: """""""" -.. code-block:: llvm +.. code-block:: text = ashr i32 4, 1 ; yields i32:result = 2 = ashr i32 4, 2 ; yields i32:result = 1 @@ -6558,7 +6558,7 @@ The truth table used for the '``and``' i Example: """""""" -.. code-block:: llvm +.. code-block:: text = and i32 4, %var ; yields i32:result = 4 & %var = and i32 15, 40 ; yields i32:result = 8 @@ -6657,7 +6657,7 @@ The truth table used for the '``xor``' i Example: """""""" -.. code-block:: llvm +.. code-block:: text = xor i32 4, %var ; yields i32:result = 4 ^ %var = xor i32 15, 40 ; yields i32:result = 39 @@ -6710,7 +6710,7 @@ exceeds the length of ``val``, the resul Example: """""""" -.. code-block:: llvm +.. code-block:: text = extractelement <4 x i32> %vec, i32 0 ; yields i32 @@ -6752,7 +6752,7 @@ undefined. Example: """""""" -.. code-block:: llvm +.. code-block:: text = insertelement <4 x i32> %vec, i32 1, i32 0 ; yields <4 x i32> @@ -6800,7 +6800,7 @@ only one vector. Example: """""""" -.. code-block:: llvm +.. code-block:: text = shufflevector <4 x i32> %v1, <4 x i32> %v2, <4 x i32> ; yields <4 x i32> @@ -6859,7 +6859,7 @@ the index operands. Example: """""""" -.. code-block:: llvm +.. code-block:: text = extractvalue {i32, float} %agg, 0 ; yields i32 @@ -8126,7 +8126,7 @@ or :ref:`ptrtoint ` instruct Example: """""""" -.. code-block:: llvm +.. code-block:: text %X = bitcast i8 255 to i8 ; yields i8 :-1 %Y = bitcast i32* %x to sint* ; yields sint*:%x @@ -8265,7 +8265,7 @@ as the values being compared. Otherwise, Example: """""""" -.. code-block:: llvm +.. code-block:: text = icmp eq i32 4, 5 ; yields: result=false = icmp ne float* %X, %X ; yields: result=false @@ -8379,7 +8379,7 @@ assumptions to be made about the values Example: """""""" -.. code-block:: llvm +.. code-block:: text = fcmp oeq float 4.0, 5.0 ; yields: result=false = fcmp one float 4.0, 5.0 ; yields: result=true @@ -8815,7 +8815,7 @@ that does not carry an appropriate :ref: Example: """""""" -.. code-block:: llvm +.. code-block:: text dispatch: %cs = catchswitch within none [label %handler0] unwind to caller @@ -8885,7 +8885,7 @@ that does not carry an appropriate :ref: Example: """""""" -.. code-block:: llvm +.. code-block:: text %tok = cleanuppad within %cs [] @@ -12481,19 +12481,19 @@ optimistic assumptions made during compi ``@llvm.experimental.deoptimize`` -- its body is defined to be equivalent to: -.. code-block:: llvm +.. code-block:: text - define void @llvm.experimental.guard(i1 %pred, ) { - %realPred = and i1 %pred, undef - br i1 %realPred, label %continue, label %leave [, !make.implicit !{}] - - leave: - call void @llvm.experimental.deoptimize() [ "deopt"() ] - ret void - - continue: - ret void - } + define void @llvm.experimental.guard(i1 %pred, ) { + %realPred = and i1 %pred, undef + br i1 %realPred, label %continue, label %leave [, !make.implicit !{}] + + leave: + call void @llvm.experimental.deoptimize() [ "deopt"() ] + ret void + + continue: + ret void + } with the optional ``[, !make.implicit !{}]`` present if and only if it Modified: vendor/llvm/dist/docs/MIRLangRef.rst ============================================================================== --- vendor/llvm/dist/docs/MIRLangRef.rst Wed Aug 17 17:59:09 2016 (r304297) +++ vendor/llvm/dist/docs/MIRLangRef.rst Wed Aug 17 19:33:52 2016 (r304298) @@ -111,7 +111,6 @@ Here is an example of a YAML document th .. code-block:: llvm - --- | define i32 @inc(i32* %x) { entry: %0 = load i32, i32* %x @@ -119,7 +118,6 @@ Here is an example of a YAML document th store i32 %1, i32* %x ret i32 %1 } - ... .. _YAML block literal string: http://www.yaml.org/spec/1.2/spec.html#id2795688 @@ -129,7 +127,7 @@ Machine Functions The remaining YAML documents contain the machine functions. This is an example of such YAML document: -.. code-block:: llvm +.. code-block:: text --- name: inc @@ -172,7 +170,7 @@ A machine basic block is defined in a si that contains the block's ID. The example below defines two blocks that have an ID of zero and one: -.. code-block:: llvm +.. code-block:: text bb.0: @@ -182,7 +180,7 @@ The example below defines two blocks tha A machine basic block can also have a name. It should be specified after the ID in the block's definition: -.. code-block:: llvm +.. code-block:: text bb.0.entry: ; This block's name is "entry" @@ -196,7 +194,7 @@ Block References The machine basic blocks are identified by their ID numbers. Individual blocks are referenced using the following syntax: -.. code-block:: llvm +.. code-block:: text %bb.[.] @@ -213,7 +211,7 @@ Successors The machine basic block's successors have to be specified before any of the instructions: -.. code-block:: llvm +.. code-block:: text bb.0.entry: successors: %bb.1.then, %bb.2.else @@ -227,7 +225,7 @@ The branch weights can be specified in b The example below defines a block that has two successors with branch weights of 32 and 16: -.. code-block:: llvm +.. code-block:: text bb.0.entry: successors: %bb.1.then(32), %bb.2.else(16) @@ -240,7 +238,7 @@ Live In Registers The machine basic block's live in registers have to be specified before any of the instructions: -.. code-block:: llvm +.. code-block:: text bb.0.entry: liveins: %edi, %esi @@ -255,7 +253,7 @@ Miscellaneous Attributes The attributes ``IsAddressTaken``, ``IsLandingPad`` and ``Alignment`` can be specified in brackets after the block's definition: -.. code-block:: llvm +.. code-block:: text bb.0.entry (address-taken): @@ -278,7 +276,7 @@ The instruction's name is usually specif below shows an instance of the X86 ``RETQ`` instruction with a single machine operand: -.. code-block:: llvm +.. code-block:: text RETQ %eax @@ -287,7 +285,7 @@ operands, the instruction's name has to below shows an instance of the AArch64 ``LDPXpost`` instruction with three defined register operands: -.. code-block:: llvm +.. code-block:: text %sp, %fp, %lr = LDPXpost %sp, 2 @@ -303,7 +301,7 @@ Instruction Flags The flag ``frame-setup`` can be specified before the instruction's name: -.. code-block:: llvm +.. code-block:: text %fp = frame-setup ADDXri %sp, 0, 0 @@ -321,13 +319,13 @@ but they can also be used in a number of The physical registers are identified by their name. They use the following syntax: -.. code-block:: llvm +.. code-block:: text % The example below shows three X86 physical registers: -.. code-block:: llvm +.. code-block:: text %eax %r15 @@ -336,13 +334,13 @@ The example below shows three X86 physic The virtual registers are identified by their ID number. They use the following syntax: -.. code-block:: llvm +.. code-block:: text % Example: -.. code-block:: llvm +.. code-block:: text %0 @@ -366,7 +364,7 @@ The immediate machine operands are untyp example below shows an instance of the X86 ``MOV32ri`` instruction that has an immediate machine operand ``-42``: -.. code-block:: llvm +.. code-block:: text %eax = MOV32ri -42 @@ -384,14 +382,14 @@ machine operands. The register operands and a reference to the tied register operand. The full syntax of a register operand is shown below: -.. code-block:: llvm +.. code-block:: text [] [ : ] [ (tied-def ) ] This example shows an instance of the X86 ``XOR32rr`` instruction that has 5 register operands with different register flags: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Aug 17 19:34:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AFB3BBD7F3; Wed, 17 Aug 2016 19:34:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EE7711E5; Wed, 17 Aug 2016 19:34:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HJYKNP082885; Wed, 17 Aug 2016 19:34:20 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HJYKhw082884; Wed, 17 Aug 2016 19:34:20 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608171934.u7HJYKhw082884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Aug 2016 19:34:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304299 - vendor/llvm/llvm-release_39-r278877 X-SVN-Group: vendor 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 19:34:21 -0000 Author: dim Date: Wed Aug 17 19:34:20 2016 New Revision: 304299 URL: https://svnweb.freebsd.org/changeset/base/304299 Log: Tag llvm release_39 branch r278877. Added: vendor/llvm/llvm-release_39-r278877/ - copied from r304298, vendor/llvm/dist/ From owner-svn-src-all@freebsd.org Wed Aug 17 19:34:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56647BBD876; Wed, 17 Aug 2016 19:34:40 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDCCE1345; Wed, 17 Aug 2016 19:34:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HJYdQN082939; Wed, 17 Aug 2016 19:34:39 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HJYd1I082937; Wed, 17 Aug 2016 19:34:39 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608171934.u7HJYd1I082937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Aug 2016 19:34:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304300 - in vendor/clang/dist: docs include/clang/AST include/clang/Analysis/Analyses include/clang/Basic include/clang/Sema include/clang/Serialization include/clang/StaticAnalyzer/Co... X-SVN-Group: vendor 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 19:34:40 -0000 Author: dim Date: Wed Aug 17 19:34:38 2016 New Revision: 304300 URL: https://svnweb.freebsd.org/changeset/base/304300 Log: Vendor import of clang release_39 branch r278877: https://llvm.org/svn/llvm-project/cfe/branches/release_39@278877 Added: vendor/clang/dist/test/CoverageMapping/system_macro.cpp (contents, props changed) vendor/clang/dist/test/Modules/Inputs/PR28332/ vendor/clang/dist/test/Modules/Inputs/PR28332/TextualInclude.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/PR28332/a.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/PR28332/b.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/PR28332/c.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/PR28332/module.modulemap vendor/clang/dist/test/Modules/pr28332.cpp (contents, props changed) vendor/clang/dist/test/PCH/Inputs/pragma-once.h (contents, props changed) vendor/clang/dist/test/PCH/pragma-once.c (contents, props changed) Deleted: vendor/clang/dist/test/CodeGen/forwarding-blocks-if.c vendor/clang/dist/test/CoverageMapping/system_macro.c vendor/clang/dist/test/Parser/cxx1z-constexpr-lambdas.cpp vendor/clang/dist/test/SemaCXX/cxx1z-constexpr-lambdas.cpp Modified: vendor/clang/dist/docs/AttributeReference.rst vendor/clang/dist/docs/ReleaseNotes.rst vendor/clang/dist/docs/UsersManual.rst vendor/clang/dist/include/clang/AST/ExternalASTSource.h vendor/clang/dist/include/clang/AST/StmtGraphTraits.h vendor/clang/dist/include/clang/Analysis/Analyses/Dominators.h vendor/clang/dist/include/clang/Basic/BuiltinsX86.def vendor/clang/dist/include/clang/Basic/DiagnosticASTKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticParseKinds.td vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/include/clang/Serialization/ASTReader.h vendor/clang/dist/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h vendor/clang/dist/lib/AST/ASTDiagnostic.cpp vendor/clang/dist/lib/AST/DeclCXX.cpp vendor/clang/dist/lib/AST/ExprConstant.cpp vendor/clang/dist/lib/Analysis/CFG.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/CodeGen/CGBlocks.cpp vendor/clang/dist/lib/CodeGen/CGBuiltin.cpp vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp vendor/clang/dist/lib/CodeGen/CGStmt.cpp vendor/clang/dist/lib/CodeGen/CoverageMappingGen.cpp vendor/clang/dist/lib/Driver/ToolChains.cpp vendor/clang/dist/lib/Driver/ToolChains.h vendor/clang/dist/lib/Driver/Tools.cpp vendor/clang/dist/lib/Headers/avx512fintrin.h vendor/clang/dist/lib/Headers/avxintrin.h vendor/clang/dist/lib/Headers/cpuid.h vendor/clang/dist/lib/Headers/emmintrin.h vendor/clang/dist/lib/Headers/xmmintrin.h vendor/clang/dist/lib/Lex/Pragma.cpp vendor/clang/dist/lib/Parse/ParseExpr.cpp vendor/clang/dist/lib/Parse/ParseExprCXX.cpp vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaExprCXX.cpp vendor/clang/dist/lib/Sema/SemaLambda.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/lib/Sema/TreeTransform.h vendor/clang/dist/lib/Serialization/ASTReader.cpp vendor/clang/dist/lib/Serialization/ASTReaderDecl.cpp vendor/clang/dist/lib/Serialization/ASTWriter.cpp vendor/clang/dist/test/CXX/special/class.copy/p11.0x.move.cpp vendor/clang/dist/test/CodeGen/avx-builtins.c vendor/clang/dist/test/CodeGen/builtins-x86.c vendor/clang/dist/test/CodeGen/sse-builtins.c vendor/clang/dist/test/CodeGen/sse2-builtins.c vendor/clang/dist/test/CodeGen/target-data.c vendor/clang/dist/test/CodeGenCXX/debug-info-cxx1y.cpp vendor/clang/dist/test/CodeGenCXX/switch-case-folding-2.cpp vendor/clang/dist/test/CodeGenOpenCL/cl20-device-side-enqueue.cl vendor/clang/dist/test/CodeGenOpenCL/to_addr_builtin.cl vendor/clang/dist/test/Driver/cl-options.c vendor/clang/dist/test/Driver/cl-pch-errorhandling.cpp vendor/clang/dist/test/Driver/cl-pch-search.cpp vendor/clang/dist/test/Driver/cl-pch-showincludes.cpp vendor/clang/dist/test/Driver/cloudabi.c vendor/clang/dist/test/Driver/cloudabi.cpp vendor/clang/dist/test/Driver/frame-pointer-elim.c vendor/clang/dist/test/Misc/diag-template-diffing.cpp vendor/clang/dist/test/Sema/bitfield.c vendor/clang/dist/test/Sema/constant-conversion.c vendor/clang/dist/test/Sema/enable_if.c vendor/clang/dist/test/Sema/typo-correction.c vendor/clang/dist/test/SemaCXX/enable_if.cpp vendor/clang/dist/test/SemaCXX/lambda-expressions.cpp vendor/clang/dist/test/SemaCXX/return-stack-addr-2.cpp vendor/clang/dist/test/SemaCXX/warn-thread-safety-analysis.cpp vendor/clang/dist/test/SemaCXX/warn-unsequenced.cpp vendor/clang/dist/www/cxx_dr_status.html vendor/clang/dist/www/make_cxx_dr_status Modified: vendor/clang/dist/docs/AttributeReference.rst ============================================================================== --- vendor/clang/dist/docs/AttributeReference.rst Wed Aug 17 19:34:20 2016 (r304299) +++ vendor/clang/dist/docs/AttributeReference.rst Wed Aug 17 19:34:38 2016 (r304300) @@ -1,13 +1,2736 @@ .. ------------------------------------------------------------------- NOTE: This file is automatically generated by running clang-tblgen - -gen-attr-docs. Do not edit this file by hand!! The contents for - this file are automatically generated by a server-side process. - - Please do not commit this file. The file exists for local testing - purposes only. + -gen-attr-docs. Do not edit this file by hand!! ------------------------------------------------------------------- =================== Attributes in Clang -=================== \ No newline at end of file +=================== +.. contents:: + :local: + +Introduction +============ + +This page lists the attributes currently supported by Clang. + +Function Attributes +=================== + + +interrupt +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Clang supports the GNU style ``__attribute__((interrupt("TYPE")))`` attribute on +ARM targets. This attribute may be attached to a function definition and +instructs the backend to generate appropriate function entry/exit code so that +it can be used directly as an interrupt service routine. + +The parameter passed to the interrupt attribute is optional, but if +provided it must be a string literal with one of the following values: "IRQ", +"FIQ", "SWI", "ABORT", "UNDEF". + +The semantics are as follows: + +- If the function is AAPCS, Clang instructs the backend to realign the stack to + 8 bytes on entry. This is a general requirement of the AAPCS at public + interfaces, but may not hold when an exception is taken. Doing this allows + other AAPCS functions to be called. +- If the CPU is M-class this is all that needs to be done since the architecture + itself is designed in such a way that functions obeying the normal AAPCS ABI + constraints are valid exception handlers. +- If the CPU is not M-class, the prologue and epilogue are modified to save all + non-banked registers that are used, so that upon return the user-mode state + will not be corrupted. Note that to avoid unnecessary overhead, only + general-purpose (integer) registers are saved in this way. If VFP operations + are needed, that state must be saved manually. + + Specifically, interrupt kinds other than "FIQ" will save all core registers + except "lr" and "sp". "FIQ" interrupts will save r0-r7. +- If the CPU is not M-class, the return instruction is changed to one of the + canonical sequences permitted by the architecture for exception return. Where + possible the function itself will make the necessary "lr" adjustments so that + the "preferred return address" is selected. + + Unfortunately the compiler is unable to make this guarantee for an "UNDEF" + handler, where the offset from "lr" to the preferred return address depends on + the execution state of the code which generated the exception. In this case + a sequence equivalent to "movs pc, lr" will be used. + + +abi_tag (gnu::abi_tag) +---------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``abi_tag`` attribute can be applied to a function, variable, class or +inline namespace declaration to modify the mangled name of the entity. It gives +the ability to distinguish between different versions of the same entity but +with different ABI versions supported. For example, a newer version of a class +could have a different set of data members and thus have a different size. Using +the ``abi_tag`` attribute, it is possible to have different mangled names for +a global variable of the class type. Therefor, the old code could keep using +the old manged name and the new code will use the new mangled name with tags. + + +acquire_capability (acquire_shared_capability, clang::acquire_capability, clang::acquire_shared_capability) +----------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Marks a function as acquiring a capability. + + +interrupt +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Clang supports the GNU style ``__attribute__((interrupt))`` attribute on +x86/x86-64 targets.The compiler generates function entry and exit sequences +suitable for use in an interrupt handler when this attribute is present. +The 'IRET' instruction, instead of the 'RET' instruction, is used to return +from interrupt or exception handlers. All registers, except for the EFLAGS +register which is restored by the 'IRET' instruction, are preserved by the +compiler. + +Any interruptible-without-stack-switch code must be compiled with +-mno-red-zone since interrupt handlers can and will, because of the +hardware design, touch the red zone. + +1. interrupt handler must be declared with a mandatory pointer argument: + + .. code-block:: c + + struct interrupt_frame + { + uword_t ip; + uword_t cs; + uword_t flags; + uword_t sp; + uword_t ss; + }; + + __attribute__ ((interrupt)) + void f (struct interrupt_frame *frame) { + ... + } + +2. exception handler: + + The exception handler is very similar to the interrupt handler with + a different mandatory function signature: + + .. code-block:: c + + __attribute__ ((interrupt)) + void f (struct interrupt_frame *frame, uword_t error_code) { + ... + } + + and compiler pops 'ERROR_CODE' off stack before the 'IRET' instruction. + + The exception handler should only be used for exceptions which push an + error code and all other exceptions must use the interrupt handler. + The system will crash if the wrong handler is used. + + +assert_capability (assert_shared_capability, clang::assert_capability, clang::assert_shared_capability) +------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Marks a function that dynamically tests whether a capability is held, and halts +the program if it is not held. + + +assume_aligned (gnu::assume_aligned) +------------------------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Use ``__attribute__((assume_aligned([,]))`` on a function +declaration to specify that the return value of the function (which must be a +pointer type) has the specified offset, in bytes, from an address with the +specified alignment. The offset is taken to be zero if omitted. + +.. code-block:: c++ + + // The returned pointer value has 32-byte alignment. + void *a() __attribute__((assume_aligned (32))); + + // The returned pointer value is 4 bytes greater than an address having + // 32-byte alignment. + void *b() __attribute__((assume_aligned (32, 4))); + +Note that this attribute provides information to the compiler regarding a +condition that the code already ensures is true. It does not cause the compiler +to enforce the provided alignment assumption. + + +availability +------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +The ``availability`` attribute can be placed on declarations to describe the +lifecycle of that declaration relative to operating system versions. Consider +the function declaration for a hypothetical function ``f``: + +.. code-block:: c++ + + void f(void) __attribute__((availability(macos,introduced=10.4,deprecated=10.6,obsoleted=10.7))); + +The availability attribute states that ``f`` was introduced in Mac OS X 10.4, +deprecated in Mac OS X 10.6, and obsoleted in Mac OS X 10.7. This information +is used by Clang to determine when it is safe to use ``f``: for example, if +Clang is instructed to compile code for Mac OS X 10.5, a call to ``f()`` +succeeds. If Clang is instructed to compile code for Mac OS X 10.6, the call +succeeds but Clang emits a warning specifying that the function is deprecated. +Finally, if Clang is instructed to compile code for Mac OS X 10.7, the call +fails because ``f()`` is no longer available. + +The availability attribute is a comma-separated list starting with the +platform name and then including clauses specifying important milestones in the +declaration's lifetime (in any order) along with additional information. Those +clauses can be: + +introduced=\ *version* + The first version in which this declaration was introduced. + +deprecated=\ *version* + The first version in which this declaration was deprecated, meaning that + users should migrate away from this API. + +obsoleted=\ *version* + The first version in which this declaration was obsoleted, meaning that it + was removed completely and can no longer be used. + +unavailable + This declaration is never available on this platform. + +message=\ *string-literal* + Additional message text that Clang will provide when emitting a warning or + error about use of a deprecated or obsoleted declaration. Useful to direct + users to replacement APIs. + +replacement=\ *string-literal* + Additional message text that Clang will use to provide Fix-It when emitting + a warning about use of a deprecated declaration. The Fix-It will replace + the deprecated declaration with the new declaration specified. + +Multiple availability attributes can be placed on a declaration, which may +correspond to different platforms. Only the availability attribute with the +platform corresponding to the target platform will be used; any others will be +ignored. If no availability attribute specifies availability for the current +target platform, the availability attributes are ignored. Supported platforms +are: + +``ios`` + Apple's iOS operating system. The minimum deployment target is specified by + the ``-mios-version-min=*version*`` or ``-miphoneos-version-min=*version*`` + command-line arguments. + +``macos`` + Apple's Mac OS X operating system. The minimum deployment target is + specified by the ``-mmacosx-version-min=*version*`` command-line argument. + ``macosx`` is supported for backward-compatibility reasons, but it is + deprecated. + +``tvos`` + Apple's tvOS operating system. The minimum deployment target is specified by + the ``-mtvos-version-min=*version*`` command-line argument. + +``watchos`` + Apple's watchOS operating system. The minimum deployment target is specified by + the ``-mwatchos-version-min=*version*`` command-line argument. + +A declaration can typically be used even when deploying back to a platform +version prior to when the declaration was introduced. When this happens, the +declaration is `weakly linked +`_, +as if the ``weak_import`` attribute were added to the declaration. A +weakly-linked declaration may or may not be present a run-time, and a program +can determine whether the declaration is present by checking whether the +address of that declaration is non-NULL. + +The flag ``strict`` disallows using API when deploying back to a +platform version prior to when the declaration was introduced. An +attempt to use such API before its introduction causes a hard error. +Weakly-linking is almost always a better API choice, since it allows +users to query availability at runtime. + +If there are multiple declarations of the same entity, the availability +attributes must either match on a per-platform basis or later +declarations must not have availability attributes for that +platform. For example: + +.. code-block:: c + + void g(void) __attribute__((availability(macos,introduced=10.4))); + void g(void) __attribute__((availability(macos,introduced=10.4))); // okay, matches + void g(void) __attribute__((availability(ios,introduced=4.0))); // okay, adds a new platform + void g(void); // okay, inherits both macos and ios availability from above. + void g(void) __attribute__((availability(macos,introduced=10.5))); // error: mismatch + +When one method overrides another, the overriding method can be more widely available than the overridden method, e.g.,: + +.. code-block:: objc + + @interface A + - (id)method __attribute__((availability(macos,introduced=10.4))); + - (id)method2 __attribute__((availability(macos,introduced=10.4))); + @end + + @interface B : A + - (id)method __attribute__((availability(macos,introduced=10.3))); // okay: method moved into base class later + - (id)method __attribute__((availability(macos,introduced=10.5))); // error: this method was available via the base class in 10.4 + @end + + +_Noreturn +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "","","","X", "" + +A function declared as ``_Noreturn`` shall not return to its caller. The +compiler will generate a diagnostic for a function declared as ``_Noreturn`` +that appears to be capable of returning to its caller. + + +noreturn +-------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "","X","","", "" + +A function declared as ``[[noreturn]]`` shall not return to its caller. The +compiler will generate a diagnostic for a function declared as ``[[noreturn]]`` +that appears to be capable of returning to its caller. + + +carries_dependency +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``carries_dependency`` attribute specifies dependency propagation into and +out of functions. + +When specified on a function or Objective-C method, the ``carries_dependency`` +attribute means that the return value carries a dependency out of the function, +so that the implementation need not constrain ordering upon return from that +function. Implementations of the function and its caller may choose to preserve +dependencies instead of emitting memory ordering instructions such as fences. + +Note, this attribute does not change the meaning of the program, but may result +in generation of more efficient code. + + +deprecated (gnu::deprecated) +---------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","X","", "" + +The ``deprecated`` attribute can be applied to a function, a variable, or a +type. This is useful when identifying functions, variables, or types that are +expected to be removed in a future version of a program. + +Consider the function declaration for a hypothetical function ``f``: + +.. code-block:: c++ + + void f(void) __attribute__((deprecated("message", "replacement"))); + +When spelled as `__attribute__((deprecated))`, the deprecated attribute can have +two optional string arguments. The first one is the message to display when +emitting the warning; the second one enables the compiler to provide a Fix-It +to replace the deprecated name with a new name. Otherwise, when spelled as +`[[gnu::deprecated]] or [[deprecated]]`, the attribute can have one optional +string argument which is the message to display when emitting the warning. + + +disable_tail_calls (clang::disable_tail_calls) +---------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``disable_tail_calls`` attribute instructs the backend to not perform tail call optimization inside the marked function. + +For example: + + .. code-block:: c + + int callee(int); + + int foo(int a) __attribute__((disable_tail_calls)) { + return callee(a); // This call is not tail-call optimized. + } + +Marking virtual functions as ``disable_tail_calls`` is legal. + + .. code-block:: c++ + + int callee(int); + + class Base { + public: + [[clang::disable_tail_calls]] virtual int foo1() { + return callee(); // This call is not tail-call optimized. + } + }; + + class Derived1 : public Base { + public: + int foo1() override { + return callee(); // This call is tail-call optimized. + } + }; + + +enable_if +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +.. Note:: Some features of this attribute are experimental. The meaning of + multiple enable_if attributes on a single declaration is subject to change in + a future version of clang. Also, the ABI is not standardized and the name + mangling may change in future versions. To avoid that, use asm labels. + +The ``enable_if`` attribute can be placed on function declarations to control +which overload is selected based on the values of the function's arguments. +When combined with the ``overloadable`` attribute, this feature is also +available in C. + +.. code-block:: c++ + + int isdigit(int c); + int isdigit(int c) __attribute__((enable_if(c <= -1 || c > 255, "chosen when 'c' is out of range"))) __attribute__((unavailable("'c' must have the value of an unsigned char or EOF"))); + + void foo(char c) { + isdigit(c); + isdigit(10); + isdigit(-10); // results in a compile-time error. + } + +The enable_if attribute takes two arguments, the first is an expression written +in terms of the function parameters, the second is a string explaining why this +overload candidate could not be selected to be displayed in diagnostics. The +expression is part of the function signature for the purposes of determining +whether it is a redeclaration (following the rules used when determining +whether a C++ template specialization is ODR-equivalent), but is not part of +the type. + +The enable_if expression is evaluated as if it were the body of a +bool-returning constexpr function declared with the arguments of the function +it is being applied to, then called with the parameters at the call site. If the +result is false or could not be determined through constant expression +evaluation, then this overload will not be chosen and the provided string may +be used in a diagnostic if the compile fails as a result. + +Because the enable_if expression is an unevaluated context, there are no global +state changes, nor the ability to pass information from the enable_if +expression to the function body. For example, suppose we want calls to +strnlen(strbuf, maxlen) to resolve to strnlen_chk(strbuf, maxlen, size of +strbuf) only if the size of strbuf can be determined: + +.. code-block:: c++ + + __attribute__((always_inline)) + static inline size_t strnlen(const char *s, size_t maxlen) + __attribute__((overloadable)) + __attribute__((enable_if(__builtin_object_size(s, 0) != -1))), + "chosen when the buffer size is known but 'maxlen' is not"))) + { + return strnlen_chk(s, maxlen, __builtin_object_size(s, 0)); + } + +Multiple enable_if attributes may be applied to a single declaration. In this +case, the enable_if expressions are evaluated from left to right in the +following manner. First, the candidates whose enable_if expressions evaluate to +false or cannot be evaluated are discarded. If the remaining candidates do not +share ODR-equivalent enable_if expressions, the overload resolution is +ambiguous. Otherwise, enable_if overload resolution continues with the next +enable_if attribute on the candidates that have not been discarded and have +remaining enable_if attributes. In this way, we pick the most specific +overload out of a number of viable overloads using enable_if. + +.. code-block:: c++ + + void f() __attribute__((enable_if(true, ""))); // #1 + void f() __attribute__((enable_if(true, ""))) __attribute__((enable_if(true, ""))); // #2 + + void g(int i, int j) __attribute__((enable_if(i, ""))); // #1 + void g(int i, int j) __attribute__((enable_if(j, ""))) __attribute__((enable_if(true))); // #2 + +In this example, a call to f() is always resolved to #2, as the first enable_if +expression is ODR-equivalent for both declarations, but #1 does not have another +enable_if expression to continue evaluating, so the next round of evaluation has +only a single candidate. In a call to g(1, 1), the call is ambiguous even though +#2 has more enable_if attributes, because the first enable_if expressions are +not ODR-equivalent. + +Query for this feature with ``__has_attribute(enable_if)``. + +Note that functions with one or more ``enable_if`` attributes may not have +their address taken, unless all of the conditions specified by said +``enable_if`` are constants that evaluate to ``true``. For example: + +.. code-block:: c + + const int TrueConstant = 1; + const int FalseConstant = 0; + int f(int a) __attribute__((enable_if(a > 0, ""))); + int g(int a) __attribute__((enable_if(a == 0 || a != 0, ""))); + int h(int a) __attribute__((enable_if(1, ""))); + int i(int a) __attribute__((enable_if(TrueConstant, ""))); + int j(int a) __attribute__((enable_if(FalseConstant, ""))); + + void fn() { + int (*ptr)(int); + ptr = &f; // error: 'a > 0' is not always true + ptr = &g; // error: 'a == 0 || a != 0' is not a truthy constant + ptr = &h; // OK: 1 is a truthy constant + ptr = &i; // OK: 'TrueConstant' is a truthy constant + ptr = &j; // error: 'FalseConstant' is a constant, but not truthy + } + +Because ``enable_if`` evaluation happens during overload resolution, +``enable_if`` may give unintuitive results when used with templates, depending +on when overloads are resolved. In the example below, clang will emit a +diagnostic about no viable overloads for ``foo`` in ``bar``, but not in ``baz``: + +.. code-block:: c++ + + double foo(int i) __attribute__((enable_if(i > 0, ""))); + void *foo(int i) __attribute__((enable_if(i <= 0, ""))); + template + auto bar() { return foo(I); } + + template + auto baz() { return foo(T::number); } + + struct WithNumber { constexpr static int number = 1; }; + void callThem() { + bar(); + baz(); + } + +This is because, in ``bar``, ``foo`` is resolved prior to template +instantiation, so the value for ``I`` isn't known (thus, both ``enable_if`` +conditions for ``foo`` fail). However, in ``baz``, ``foo`` is resolved during +template instantiation, so the value for ``T::number`` is known. + + +flatten (gnu::flatten) +---------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``flatten`` attribute causes calls within the attributed function to +be inlined unless it is impossible to do so, for example if the body of the +callee is unavailable or if the callee has the ``noinline`` attribute. + + +format (gnu::format) +-------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Clang supports the ``format`` attribute, which indicates that the function +accepts a ``printf`` or ``scanf``-like format string and corresponding +arguments or a ``va_list`` that contains these arguments. + +Please see `GCC documentation about format attribute +`_ to find details +about attribute syntax. + +Clang implements two kinds of checks with this attribute. + +#. Clang checks that the function with the ``format`` attribute is called with + a format string that uses format specifiers that are allowed, and that + arguments match the format string. This is the ``-Wformat`` warning, it is + on by default. + +#. Clang checks that the format string argument is a literal string. This is + the ``-Wformat-nonliteral`` warning, it is off by default. + + Clang implements this mostly the same way as GCC, but there is a difference + for functions that accept a ``va_list`` argument (for example, ``vprintf``). + GCC does not emit ``-Wformat-nonliteral`` warning for calls to such + functions. Clang does not warn if the format string comes from a function + parameter, where the function is annotated with a compatible attribute, + otherwise it warns. For example: + + .. code-block:: c + + __attribute__((__format__ (__scanf__, 1, 3))) + void foo(const char* s, char *buf, ...) { + va_list ap; + va_start(ap, buf); + + vprintf(s, ap); // warning: format string is not a string literal + } + + In this case we warn because ``s`` contains a format string for a + ``scanf``-like function, but it is passed to a ``printf``-like function. + + If the attribute is removed, clang still warns, because the format string is + not a string literal. + + Another example: + + .. code-block:: c + + __attribute__((__format__ (__printf__, 1, 3))) + void foo(const char* s, char *buf, ...) { + va_list ap; + va_start(ap, buf); + + vprintf(s, ap); // warning + } + + In this case Clang does not warn because the format string ``s`` and + the corresponding arguments are annotated. If the arguments are + incorrect, the caller of ``foo`` will receive a warning. + + +ifunc (gnu::ifunc) +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +``__attribute__((ifunc("resolver")))`` is used to mark that the address of a declaration should be resolved at runtime by calling a resolver function. + +The symbol name of the resolver function is given in quotes. A function with this name (after mangling) must be defined in the current translation unit; it may be ``static``. The resolver function should take no arguments and return a pointer. + +The ``ifunc`` attribute may only be used on a function declaration. A function declaration with an ``ifunc`` attribute is considered to be a definition of the declared entity. The entity must not have weak linkage; for example, in C++, it cannot be applied to a declaration if a definition at that location would be considered inline. + +Not all targets support this attribute. ELF targets support this attribute when using binutils v2.20.1 or higher and glibc v2.11.1 or higher. Non-ELF targets currently do not support this attribute. + + +internal_linkage (clang::internal_linkage) +------------------------------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``internal_linkage`` attribute changes the linkage type of the declaration to internal. +This is similar to C-style ``static``, but can be used on classes and class methods. When applied to a class definition, +this attribute affects all methods and static data members of that class. +This can be used to contain the ABI of a C++ library by excluding unwanted class methods from the export tables. + + +interrupt +--------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Clang supports the GNU style ``__attribute__((interrupt("ARGUMENT")))`` attribute on +MIPS targets. This attribute may be attached to a function definition and instructs +the backend to generate appropriate function entry/exit code so that it can be used +directly as an interrupt service routine. + +By default, the compiler will produce a function prologue and epilogue suitable for +an interrupt service routine that handles an External Interrupt Controller (eic) +generated interrupt. This behaviour can be explicitly requested with the "eic" +argument. + +Otherwise, for use with vectored interrupt mode, the argument passed should be +of the form "vector=LEVEL" where LEVEL is one of the following values: +"sw0", "sw1", "hw0", "hw1", "hw2", "hw3", "hw4", "hw5". The compiler will +then set the interrupt mask to the corresponding level which will mask all +interrupts up to and including the argument. + +The semantics are as follows: + +- The prologue is modified so that the Exception Program Counter (EPC) and + Status coprocessor registers are saved to the stack. The interrupt mask is + set so that the function can only be interrupted by a higher priority + interrupt. The epilogue will restore the previous values of EPC and Status. + +- The prologue and epilogue are modified to save and restore all non-kernel + registers as necessary. + +- The FPU is disabled in the prologue, as the floating pointer registers are not + spilled to the stack. + +- The function return sequence is changed to use an exception return instruction. + +- The parameter sets the interrupt mask for the function corresponding to the + interrupt level specified. If no mask is specified the interrupt mask + defaults to "eic". + + +noalias +------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "","","X","", "" + +The ``noalias`` attribute indicates that the only memory accesses inside +function are loads and stores from objects pointed to by its pointer-typed +arguments, with arbitrary offsets. + + +noduplicate (clang::noduplicate) +-------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``noduplicate`` attribute can be placed on function declarations to control +whether function calls to this function can be duplicated or not as a result of +optimizations. This is required for the implementation of functions with +certain special requirements, like the OpenCL "barrier" function, that might +need to be run concurrently by all the threads that are executing in lockstep +on the hardware. For example this attribute applied on the function +"nodupfunc" in the code below avoids that: + +.. code-block:: c + + void nodupfunc() __attribute__((noduplicate)); + // Setting it as a C++11 attribute is also valid + // void nodupfunc() [[clang::noduplicate]]; + void foo(); + void bar(); + + nodupfunc(); + if (a > n) { + foo(); + } else { + bar(); + } + +gets possibly modified by some optimizations into code similar to this: + +.. code-block:: c + + if (a > n) { + nodupfunc(); + foo(); + } else { + nodupfunc(); + bar(); + } + +where the call to "nodupfunc" is duplicated and sunk into the two branches +of the condition. + + +no_sanitize (clang::no_sanitize) +-------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +Use the ``no_sanitize`` attribute on a function declaration to specify +that a particular instrumentation or set of instrumentations should not be +applied to that function. The attribute takes a list of string literals, +which have the same meaning as values accepted by the ``-fno-sanitize=`` +flag. For example, ``__attribute__((no_sanitize("address", "thread")))`` +specifies that AddressSanitizer and ThreadSanitizer should not be applied +to the function. + +See :ref:`Controlling Code Generation ` for a +full list of supported sanitizer flags. + + +no_sanitize_address (no_address_safety_analysis, gnu::no_address_safety_analysis, gnu::no_sanitize_address) +----------------------------------------------------------------------------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +.. _langext-address_sanitizer: + +Use ``__attribute__((no_sanitize_address))`` on a function declaration to +specify that address safety instrumentation (e.g. AddressSanitizer) should +not be applied to that function. + + +no_sanitize_thread +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +.. _langext-thread_sanitizer: + +Use ``__attribute__((no_sanitize_thread))`` on a function declaration to +specify that checks for data races on plain (non-atomic) memory accesses should +not be inserted by ThreadSanitizer. The function is still instrumented by the +tool to avoid false positives and provide meaningful stack traces. + + +no_sanitize_memory +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +.. _langext-memory_sanitizer: + +Use ``__attribute__((no_sanitize_memory))`` on a function declaration to +specify that checks for uninitialized memory should not be inserted +(e.g. by MemorySanitizer). The function may still be instrumented by the tool +to avoid false positives in other places. + + +no_split_stack (gnu::no_split_stack) +------------------------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``no_split_stack`` attribute disables the emission of the split stack +preamble for a particular function. It has no effect if ``-fsplit-stack`` +is not specified. + + +not_tail_called (clang::not_tail_called) +---------------------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","X","","", "" + +The ``not_tail_called`` attribute prevents tail-call optimization on statically bound calls. It has no effect on indirect calls. Virtual functions, objective-c methods, and functions marked as ``always_inline`` cannot be marked as ``not_tail_called``. + +For example, it prevents tail-call optimization in the following case: + + .. code-block:: c + + int __attribute__((not_tail_called)) foo1(int); + + int foo2(int a) { + return foo1(a); // No tail-call optimization on direct calls. + } + +However, it doesn't prevent tail-call optimization in this case: + + .. code-block:: c + + int __attribute__((not_tail_called)) foo1(int); + + int foo2(int a) { + int (*fn)(int) = &foo1; + + // not_tail_called has no effect on an indirect call even if the call can be + // resolved at compile time. + return (*fn)(a); + } + +Marking virtual functions as ``not_tail_called`` is an error: + + .. code-block:: c++ + + class Base { + public: + // not_tail_called on a virtual function is an error. + [[clang::not_tail_called]] virtual int foo1(); + + virtual int foo2(); + + // Non-virtual functions can be marked ``not_tail_called``. + [[clang::not_tail_called]] int foo3(); + }; + + class Derived1 : public Base { + public: + int foo1() override; + + // not_tail_called on a virtual function is an error. + [[clang::not_tail_called]] int foo2() override; + }; + + +#pragma omp declare simd +------------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "","","","", "X" + +The `declare simd` construct can be applied to a function to enable the creation +of one or more versions that can process multiple arguments using SIMD +instructions from a single invocation in a SIMD loop. The `declare simd` +directive is a declarative directive. There may be multiple `declare simd` +directives for a function. The use of a `declare simd` construct on a function +enables the creation of SIMD versions of the associated function that can be +used to process multiple arguments from a single invocation from a SIMD loop +concurrently. +The syntax of the `declare simd` construct is as follows: + + .. code-block:: c + + #pragma omp declare simd [clause[[,] clause] ...] new-line + [#pragma omp declare simd [clause[[,] clause] ...] new-line] + [...] + function definition or declaration + +where clause is one of the following: + + .. code-block:: c + + simdlen(length) + linear(argument-list[:constant-linear-step]) + aligned(argument-list[:alignment]) + uniform(argument-list) + inbranch + notinbranch + + +#pragma omp declare target +-------------------------- +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "","","","", "X" + +The `declare target` directive specifies that variables and functions are mapped +to a device for OpenMP offload mechanism. + +The syntax of the declare target directive is as follows: + + .. code-block:: c + + #pragma omp declare target new-line + declarations-definition-seq + #pragma omp end declare target new-line + + +objc_boxable +------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Structs and unions marked with the ``objc_boxable`` attribute can be used +with the Objective-C boxed expression syntax, ``@(...)``. + +**Usage**: ``__attribute__((objc_boxable))``. This attribute +can only be placed on a declaration of a trivially-copyable struct or union: + +.. code-block:: objc + + struct __attribute__((objc_boxable)) some_struct { + int i; + }; + union __attribute__((objc_boxable)) some_union { + int i; + float f; + }; + typedef struct __attribute__((objc_boxable)) _some_struct some_struct; + + // ... + + some_struct ss; + NSValue *boxed = @(ss); + + +objc_method_family +------------------ +.. csv-table:: Supported Syntaxes + :header: "GNU", "C++11", "__declspec", "Keyword", "Pragma" + + "X","","","", "" + +Many methods in Objective-C have conventional meanings determined by their +selectors. It is sometimes useful to be able to mark a method as having a +particular conventional meaning despite not having the right selector, or as +not having the conventional meaning that its selector would suggest. For these +use cases, we provide an attribute to specifically describe the "method family" +that a method belongs to. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Aug 17 19:35:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1A12BBD8BA; Wed, 17 Aug 2016 19:35:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9F4A14F3; Wed, 17 Aug 2016 19:35:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HJZ5qA083008; Wed, 17 Aug 2016 19:35:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HJZ52t083007; Wed, 17 Aug 2016 19:35:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608171935.u7HJZ52t083007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Aug 2016 19:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304301 - vendor/clang/clang-release_39-r278877 X-SVN-Group: vendor 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 19:35:07 -0000 Author: dim Date: Wed Aug 17 19:35:05 2016 New Revision: 304301 URL: https://svnweb.freebsd.org/changeset/base/304301 Log: Tag clang release_39 branch r278877. Added: vendor/clang/clang-release_39-r278877/ - copied from r304300, vendor/clang/dist/ From owner-svn-src-all@freebsd.org Wed Aug 17 19:35:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C0BDBBD8FB; Wed, 17 Aug 2016 19:35:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11A4F1665; Wed, 17 Aug 2016 19:35:24 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HJZNCw083067; Wed, 17 Aug 2016 19:35:23 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HJZMOh083062; Wed, 17 Aug 2016 19:35:22 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608171935.u7HJZMOh083062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Aug 2016 19:35:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304302 - in vendor/compiler-rt/dist: cmake cmake/Modules lib/builtins lib/sanitizer_common/tests test/asan/TestCases test/asan/TestCases/Darwin X-SVN-Group: vendor 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 19:35:24 -0000 Author: dim Date: Wed Aug 17 19:35:22 2016 New Revision: 304302 URL: https://svnweb.freebsd.org/changeset/base/304302 Log: Vendor import of compiler-rt release_39 branch r278877: https://llvm.org/svn/llvm-project/compiler-rt/branches/release_39@278877 Deleted: vendor/compiler-rt/dist/test/asan/TestCases/Darwin/dead-strip.c Modified: vendor/compiler-rt/dist/cmake/Modules/BuiltinTests.cmake vendor/compiler-rt/dist/cmake/builtin-config-ix.cmake vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc vendor/compiler-rt/dist/test/asan/TestCases/alloca_constant_size.cc Modified: vendor/compiler-rt/dist/cmake/Modules/BuiltinTests.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/BuiltinTests.cmake Wed Aug 17 19:35:05 2016 (r304301) +++ vendor/compiler-rt/dist/cmake/Modules/BuiltinTests.cmake Wed Aug 17 19:35:22 2016 (r304302) @@ -2,11 +2,15 @@ # This function takes an OS and a list of architectures and identifies the # subset of the architectures list that the installed toolchain can target. function(try_compile_only output) + cmake_parse_arguments(ARG "" "" "SOURCE;FLAGS" ${ARGN}) + if(NOT ARG_SOURCE) + set(ARG_SOURCE "int foo(int x, int y) { return x + y; }\n") + endif() set(SIMPLE_C ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/src.c) - file(WRITE ${SIMPLE_C} "int foo(int x, int y) { return x + y; }\n") + file(WRITE ${SIMPLE_C} "${ARG_SOURCE}\n") string(REGEX MATCHALL "<[A-Za-z0-9_]*>" substitutions ${CMAKE_C_COMPILE_OBJECT}) - string(REPLACE ";" " " extra_flags "${ARGN}") + string(REPLACE ";" " " extra_flags "${ARG_FLAGS}") set(test_compile_command "${CMAKE_C_COMPILE_OBJECT}") foreach(substitution ${substitutions}) @@ -51,7 +55,20 @@ endfunction() function(builtin_check_c_compiler_flag flag output) if(NOT DEFINED ${output}) message(STATUS "Performing Test ${output}") - try_compile_only(result ${flag}) + try_compile_only(result FLAGS ${flag}) + set(${output} ${result} CACHE INTERNAL "Compiler supports ${flag}") + if(${result}) + message(STATUS "Performing Test ${output} - Success") + else() + message(STATUS "Performing Test ${output} - Failed") + endif() + endif() +endfunction() + +function(builtin_check_c_compiler_source output source) + if(NOT DEFINED ${output}) + message(STATUS "Performing Test ${output}") + try_compile_only(result SOURCE ${source}) set(${output} ${result} CACHE INTERNAL "Compiler supports ${flag}") if(${result}) message(STATUS "Performing Test ${output} - Success") Modified: vendor/compiler-rt/dist/cmake/builtin-config-ix.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/builtin-config-ix.cmake Wed Aug 17 19:35:05 2016 (r304301) +++ vendor/compiler-rt/dist/cmake/builtin-config-ix.cmake Wed Aug 17 19:35:22 2016 (r304302) @@ -1,4 +1,5 @@ include(BuiltinTests) +include(CheckCSourceCompiles) # Make all the tests only check the compiler set(TEST_COMPILE_ONLY On) @@ -14,6 +15,15 @@ builtin_check_c_compiler_flag(-mfloat-ab builtin_check_c_compiler_flag(-mfloat-abi=hard COMPILER_RT_HAS_FLOAT_ABI_HARD_FLAG) builtin_check_c_compiler_flag(-static COMPILER_RT_HAS_STATIC_FLAG) +builtin_check_c_compiler_source(COMPILER_RT_SUPPORTS_ATOMIC_KEYWORD +" +int foo(int x, int y) { + _Atomic int result = x * y; + return result; +} +") + + set(ARM64 aarch64) set(ARM32 arm armhf) set(X86 i386 i686) Modified: vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt Wed Aug 17 19:35:05 2016 (r304301) +++ vendor/compiler-rt/dist/lib/builtins/CMakeLists.txt Wed Aug 17 19:35:22 2016 (r304302) @@ -38,8 +38,6 @@ set(GENERIC_SOURCES ashlti3.c ashrdi3.c ashrti3.c - # FIXME: atomic.c may only be compiled if host compiler understands _Atomic - # atomic.c clear_cache.c clzdi2.c clzsi2.c @@ -162,6 +160,12 @@ set(GENERIC_SOURCES umodsi3.c umodti3.c) +if(COMPILER_RT_SUPPORTS_ATOMIC_KEYWORD) + set(GENERIC_SOURCES + ${GENERIC_SOURCES} + atomic.c) +endif() + set(MSVC_SOURCES divsc3.c divdc3.c Modified: vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc Wed Aug 17 19:35:05 2016 (r304301) +++ vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc Wed Aug 17 19:35:22 2016 (r304302) @@ -62,7 +62,9 @@ TEST(Symbolizer, DemangleSwiftAndCXX) { EXPECT_STREQ("_TtSd", DemangleSwiftAndCXX("_TtSd")); // Check that the rest demangles properly. EXPECT_STREQ("f1(char*, int)", DemangleSwiftAndCXX("_Z2f1Pci")); +#if !SANITIZER_FREEBSD // QoI issue with libcxxrt on FreeBSD EXPECT_STREQ("foo", DemangleSwiftAndCXX("foo")); +#endif EXPECT_STREQ("", DemangleSwiftAndCXX("")); } #endif Modified: vendor/compiler-rt/dist/test/asan/TestCases/alloca_constant_size.cc ============================================================================== --- vendor/compiler-rt/dist/test/asan/TestCases/alloca_constant_size.cc Wed Aug 17 19:35:05 2016 (r304301) +++ vendor/compiler-rt/dist/test/asan/TestCases/alloca_constant_size.cc Wed Aug 17 19:35:22 2016 (r304302) @@ -10,6 +10,8 @@ // MSVC provides _alloca instead of alloca. #if defined(_MSC_VER) && !defined(alloca) # define alloca _alloca +#elif defined(__FreeBSD__) +#include #else #include #endif From owner-svn-src-all@freebsd.org Wed Aug 17 19:36:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 334C9BBD94A; Wed, 17 Aug 2016 19:36:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB60117C5; Wed, 17 Aug 2016 19:36:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HJa2W0083135; Wed, 17 Aug 2016 19:36:02 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HJa2vU083134; Wed, 17 Aug 2016 19:36:02 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608171936.u7HJa2vU083134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Aug 2016 19:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304303 - vendor/compiler-rt/compiler-rt-release_39-r278877 X-SVN-Group: vendor 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 19:36:03 -0000 Author: dim Date: Wed Aug 17 19:36:01 2016 New Revision: 304303 URL: https://svnweb.freebsd.org/changeset/base/304303 Log: Tag compiler-rt release_39 branch r278877. Added: vendor/compiler-rt/compiler-rt-release_39-r278877/ - copied from r304302, vendor/compiler-rt/dist/ From owner-svn-src-all@freebsd.org Wed Aug 17 19:36:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D672ABBD99A; Wed, 17 Aug 2016 19:36:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96DA0193F; Wed, 17 Aug 2016 19:36:26 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HJaP4C083195; Wed, 17 Aug 2016 19:36:25 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HJaPgi083191; Wed, 17 Aug 2016 19:36:25 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608171936.u7HJaPgi083191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Aug 2016 19:36:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304304 - in vendor/libc++/dist: include test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time test/std/iterators/iterator.range test/std/numerics/complex.number/complex.tr... X-SVN-Group: vendor 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 19:36:26 -0000 Author: dim Date: Wed Aug 17 19:36:25 2016 New Revision: 304304 URL: https://svnweb.freebsd.org/changeset/base/304304 Log: Vendor import of libc++ release_39 branch r278877: https://llvm.org/svn/llvm-project/libcxx/branches/release_39@278877 Added: vendor/libc++/dist/test/std/iterators/iterator.range/begin-end.fail.cpp (contents, props changed) Modified: vendor/libc++/dist/include/iterator vendor/libc++/dist/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp vendor/libc++/dist/test/std/numerics/complex.number/complex.transcendentals/asin.pass.cpp Modified: vendor/libc++/dist/include/iterator ============================================================================== --- vendor/libc++/dist/include/iterator Wed Aug 17 19:36:01 2016 (r304303) +++ vendor/libc++/dist/include/iterator Wed Aug 17 19:36:25 2016 (r304304) @@ -1632,16 +1632,16 @@ reverse_iterator rend(initia template inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -auto cbegin(const _Cp& __c) -> decltype(begin(__c)) +auto cbegin(const _Cp& __c) -> decltype(_VSTD::begin(__c)) { - return begin(__c); + return _VSTD::begin(__c); } template inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 -auto cend(const _Cp& __c) -> decltype(end(__c)) +auto cend(const _Cp& __c) -> decltype(_VSTD::end(__c)) { - return end(__c); + return _VSTD::end(__c); } template @@ -1674,16 +1674,16 @@ auto rend(const _Cp& __c) -> decltype(__ template inline _LIBCPP_INLINE_VISIBILITY -auto crbegin(const _Cp& __c) -> decltype(rbegin(__c)) +auto crbegin(const _Cp& __c) -> decltype(_VSTD::rbegin(__c)) { - return rbegin(__c); + return _VSTD::rbegin(__c); } template inline _LIBCPP_INLINE_VISIBILITY -auto crend(const _Cp& __c) -> decltype(rend(__c)) +auto crend(const _Cp& __c) -> decltype(_VSTD::rend(__c)) { - return rend(__c); + return _VSTD::rend(__c); } #endif Modified: vendor/libc++/dist/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp Wed Aug 17 19:36:01 2016 (r304303) +++ vendor/libc++/dist/test/std/experimental/filesystem/fs.op.funcs/fs.op.last_write_time/last_write_time.pass.cpp Wed Aug 17 19:36:25 2016 (r304304) @@ -158,7 +158,8 @@ TEST_CASE(get_last_write_time_dynamic_en TEST_CHECK(ftime2 > ftime); TEST_CHECK(dtime2 > dtime); - TEST_CHECK(LastAccessTime(file) == file_access_time); + TEST_CHECK(LastAccessTime(file) == file_access_time || + LastAccessTime(file) == Clock::to_time_t(ftime2)); TEST_CHECK(LastAccessTime(dir) == dir_access_time); } Added: vendor/libc++/dist/test/std/iterators/iterator.range/begin-end.fail.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/libc++/dist/test/std/iterators/iterator.range/begin-end.fail.cpp Wed Aug 17 19:36:25 2016 (r304304) @@ -0,0 +1,51 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "test_macros.h" + +#if TEST_STD_VER < 11 +#error +#else + +// +// template auto begin(C& c) -> decltype(c.begin()); +// template auto begin(const C& c) -> decltype(c.begin()); +// template auto end(C& c) -> decltype(c.end()); +// template auto end(const C& c) -> decltype(c.end()); +// template reverse_iterator rbegin(initializer_list il); +// template reverse_iterator rend(initializer_list il); + + +#include +#include + +namespace Foo { + struct FakeContainer {}; + typedef int FakeIter; + + FakeIter begin(const FakeContainer &) { return 1; } + FakeIter end (const FakeContainer &) { return 2; } + FakeIter rbegin(const FakeContainer &) { return 3; } + FakeIter rend (const FakeContainer &) { return 4; } + + FakeIter cbegin(const FakeContainer &) { return 11; } + FakeIter cend (const FakeContainer &) { return 12; } + FakeIter crbegin(const FakeContainer &) { return 13; } + FakeIter crend (const FakeContainer &) { return 14; } +} + + +int main(){ +// Bug #28927 - shouldn't find these via ADL + (void) std::cbegin (Foo::FakeContainer()); + (void) std::cend (Foo::FakeContainer()); + (void) std::crbegin(Foo::FakeContainer()); + (void) std::crend (Foo::FakeContainer()); +} +#endif Modified: vendor/libc++/dist/test/std/numerics/complex.number/complex.transcendentals/asin.pass.cpp ============================================================================== --- vendor/libc++/dist/test/std/numerics/complex.number/complex.transcendentals/asin.pass.cpp Wed Aug 17 19:36:01 2016 (r304303) +++ vendor/libc++/dist/test/std/numerics/complex.number/complex.transcendentals/asin.pass.cpp Wed Aug 17 19:36:25 2016 (r304304) @@ -91,7 +91,6 @@ void test_edges() { assert(std::isnan(r.real())); assert(std::isnan(r.imag())); - assert(std::signbit(testcases[i].imag()) == std::signbit(r.imag())); } else if (std::isnan(testcases[i].real()) && std::isinf(testcases[i].imag())) { From owner-svn-src-all@freebsd.org Wed Aug 17 19:36:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26040BBD9EA; Wed, 17 Aug 2016 19:36:47 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFCE11A99; Wed, 17 Aug 2016 19:36:46 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HJakq6083251; Wed, 17 Aug 2016 19:36:46 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HJak7H083250; Wed, 17 Aug 2016 19:36:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608171936.u7HJak7H083250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Aug 2016 19:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304305 - vendor/libc++/libc++-release_39-r278877 X-SVN-Group: vendor 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 19:36:47 -0000 Author: dim Date: Wed Aug 17 19:36:45 2016 New Revision: 304305 URL: https://svnweb.freebsd.org/changeset/base/304305 Log: Tag libc++ release_39 branch r278877. Added: vendor/libc++/libc++-release_39-r278877/ - copied from r304304, vendor/libc++/dist/ From owner-svn-src-all@freebsd.org Wed Aug 17 19:37:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76EDABBDA52; Wed, 17 Aug 2016 19:37:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 485AC1C41; Wed, 17 Aug 2016 19:37:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HJaxvU083304; Wed, 17 Aug 2016 19:36:59 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HJaxxj083303; Wed, 17 Aug 2016 19:36:59 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608171936.u7HJaxxj083303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Aug 2016 19:36:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304306 - vendor/lld/dist/docs X-SVN-Group: vendor 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 19:37:00 -0000 Author: dim Date: Wed Aug 17 19:36:59 2016 New Revision: 304306 URL: https://svnweb.freebsd.org/changeset/base/304306 Log: Vendor import of lld release_39 branch r278877: https://llvm.org/svn/llvm-project/lld/branches/release_39@278877 Modified: vendor/lld/dist/docs/ReleaseNotes.rst Modified: vendor/lld/dist/docs/ReleaseNotes.rst ============================================================================== --- vendor/lld/dist/docs/ReleaseNotes.rst Wed Aug 17 19:36:45 2016 (r304305) +++ vendor/lld/dist/docs/ReleaseNotes.rst Wed Aug 17 19:36:59 2016 (r304306) @@ -24,6 +24,12 @@ ELF Improvements * Initial support for LTO. +Changes to the MIPS Target +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +* Added support for MIPS N64 ABI. +* Added support for TLS relocations for both O32 and N64 MIPS ABIs. + COFF Improvements ----------------- From owner-svn-src-all@freebsd.org Wed Aug 17 19:37:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E685BBDAB5; Wed, 17 Aug 2016 19:37:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 457BC1DA0; Wed, 17 Aug 2016 19:37:28 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HJbRSu083364; Wed, 17 Aug 2016 19:37:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HJbRer083363; Wed, 17 Aug 2016 19:37:27 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608171937.u7HJbRer083363@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Aug 2016 19:37:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304307 - vendor/lld/lld-release_39-r278877 X-SVN-Group: vendor 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 19:37:28 -0000 Author: dim Date: Wed Aug 17 19:37:27 2016 New Revision: 304307 URL: https://svnweb.freebsd.org/changeset/base/304307 Log: Tag lld release_39 branch r278877. Added: vendor/lld/lld-release_39-r278877/ - copied from r304306, vendor/lld/dist/ From owner-svn-src-all@freebsd.org Wed Aug 17 19:37:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E6FDBBDB52; Wed, 17 Aug 2016 19:37:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A0671F10; Wed, 17 Aug 2016 19:37:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HJbqFY083444; Wed, 17 Aug 2016 19:37:52 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HJbogi083420; Wed, 17 Aug 2016 19:37:50 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608171937.u7HJbogi083420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Aug 2016 19:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304308 - in vendor/lldb/dist: include/lldb include/lldb/Host/android include/lldb/Host/linux include/lldb/Target scripts/Xcode source/Host/common source/Plugins/Instruction/MIPS source... X-SVN-Group: vendor 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 19:37:53 -0000 Author: dim Date: Wed Aug 17 19:37:50 2016 New Revision: 304308 URL: https://svnweb.freebsd.org/changeset/base/304308 Log: Vendor import of lldb release_39 branch r278877: https://llvm.org/svn/llvm-project/lldb/branches/release_39@278877 Modified: vendor/lldb/dist/include/lldb/Host/android/Android.h vendor/lldb/dist/include/lldb/Host/linux/Ptrace.h vendor/lldb/dist/include/lldb/Target/RegisterContext.h vendor/lldb/dist/include/lldb/lldb-private-types.h vendor/lldb/dist/scripts/Xcode/build-llvm.py vendor/lldb/dist/source/Host/common/File.cpp vendor/lldb/dist/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp vendor/lldb/dist/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h vendor/lldb/dist/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp vendor/lldb/dist/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.cpp vendor/lldb/dist/source/Plugins/Process/Linux/NativeThreadLinux.cpp vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_arm.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_arm64.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_i386.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_mips.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_mips64.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_powerpc.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_s390x.h vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_x86_64.h vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp vendor/lldb/dist/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp vendor/lldb/dist/source/Target/RegisterContext.cpp Modified: vendor/lldb/dist/include/lldb/Host/android/Android.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/android/Android.h Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/include/lldb/Host/android/Android.h Wed Aug 17 19:37:50 2016 (r304308) @@ -14,9 +14,6 @@ #include #include -#define _isatty isatty -#define SYS_tgkill __NR_tgkill - namespace std { template Modified: vendor/lldb/dist/include/lldb/Host/linux/Ptrace.h ============================================================================== --- vendor/lldb/dist/include/lldb/Host/linux/Ptrace.h Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/include/lldb/Host/linux/Ptrace.h Wed Aug 17 19:37:50 2016 (r304308) @@ -14,33 +14,24 @@ #include -#ifdef __ANDROID_NDK__ -#define PT_DETACH PTRACE_DETACH +#ifndef __GLIBC__ typedef int __ptrace_request; #endif #define DEBUG_PTRACE_MAXBYTES 20 // Support ptrace extensions even when compiled without required kernel support -#ifndef PT_GETREGS - #ifndef PTRACE_GETREGS - #define PTRACE_GETREGS 12 - #endif -#endif -#ifndef PT_SETREGS - #ifndef PTRACE_SETREGS - #define PTRACE_SETREGS 13 - #endif -#endif -#ifndef PT_GETFPREGS - #ifndef PTRACE_GETFPREGS - #define PTRACE_GETFPREGS 14 - #endif -#endif -#ifndef PT_SETFPREGS - #ifndef PTRACE_SETFPREGS - #define PTRACE_SETFPREGS 15 - #endif +#ifndef PTRACE_GETREGS + #define PTRACE_GETREGS 12 +#endif +#ifndef PTRACE_SETREGS + #define PTRACE_SETREGS 13 +#endif +#ifndef PTRACE_GETFPREGS + #define PTRACE_GETFPREGS 14 +#endif +#ifndef PTRACE_SETFPREGS + #define PTRACE_SETFPREGS 15 #endif #ifndef PTRACE_GETREGSET #define PTRACE_GETREGSET 0x4204 Modified: vendor/lldb/dist/include/lldb/Target/RegisterContext.h ============================================================================== --- vendor/lldb/dist/include/lldb/Target/RegisterContext.h Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/include/lldb/Target/RegisterContext.h Wed Aug 17 19:37:50 2016 (r304308) @@ -46,6 +46,11 @@ public: virtual const RegisterInfo * GetRegisterInfoAtIndex (size_t reg) = 0; + // Detect the register size dynamically. + uint32_t + UpdateDynamicRegisterSize (const lldb_private::ArchSpec &arch, + RegisterInfo* reg_info); + virtual size_t GetRegisterSetCount () = 0; Modified: vendor/lldb/dist/include/lldb/lldb-private-types.h ============================================================================== --- vendor/lldb/dist/include/lldb/lldb-private-types.h Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/include/lldb/lldb-private-types.h Wed Aug 17 19:37:50 2016 (r304308) @@ -54,6 +54,10 @@ namespace lldb_private // null, all registers in this list will be invalidated when the value of this // register changes. For example, the invalidate list for eax would be rax // ax, ah, and al. + const uint8_t *dynamic_size_dwarf_expr_bytes; // A DWARF expression that when evaluated gives + // the byte size of this register. + size_t dynamic_size_dwarf_len; // The length of the DWARF expression in bytes + // in the dynamic_size_dwarf_expr_bytes member. }; //---------------------------------------------------------------------- Modified: vendor/lldb/dist/scripts/Xcode/build-llvm.py ============================================================================== --- vendor/lldb/dist/scripts/Xcode/build-llvm.py Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/scripts/Xcode/build-llvm.py Wed Aug 17 19:37:50 2016 (r304308) @@ -19,11 +19,11 @@ def LLVM_HASH_INCLUDES_DIFFS (): # it with regexps. Only change how this works if you know what you are doing. def LLVM_REF (): - llvm_ref = "master" + llvm_ref = "release_39" return llvm_ref def CLANG_REF (): - clang_ref = "master" + clang_ref = "release_39" return clang_ref # For use with Xcode-style builds Modified: vendor/lldb/dist/source/Host/common/File.cpp ============================================================================== --- vendor/lldb/dist/source/Host/common/File.cpp Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Host/common/File.cpp Wed Aug 17 19:37:50 2016 (r304308) @@ -1010,7 +1010,7 @@ File::CalculateInteractiveAndTerminal () { m_is_interactive = eLazyBoolNo; m_is_real_terminal = eLazyBoolNo; -#if (defined(_WIN32) || defined(__ANDROID_NDK__)) +#if defined(_WIN32) if (_isatty(fd)) { m_is_interactive = eLazyBoolYes; Modified: vendor/lldb/dist/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp Wed Aug 17 19:37:50 2016 (r304308) @@ -494,9 +494,13 @@ EmulateInstructionMIPS::GetOpcodeForInst //---------------------------------------------------------------------- // Prologue/Epilogue instructions //---------------------------------------------------------------------- - { "ADDiu", &EmulateInstructionMIPS::Emulate_ADDiu, "ADDIU rt,rs,immediate" }, - { "SW", &EmulateInstructionMIPS::Emulate_SW, "SW rt,offset(rs)" }, - { "LW", &EmulateInstructionMIPS::Emulate_LW, "LW rt,offset(base)" }, + { "ADDiu", &EmulateInstructionMIPS::Emulate_ADDiu, "ADDIU rt, rs, immediate" }, + { "SW", &EmulateInstructionMIPS::Emulate_SW, "SW rt, offset(rs)" }, + { "LW", &EmulateInstructionMIPS::Emulate_LW, "LW rt, offset(base)" }, + { "SUBU", &EmulateInstructionMIPS::Emulate_SUBU_ADDU, "SUBU rd, rs, rt" }, + { "ADDU", &EmulateInstructionMIPS::Emulate_SUBU_ADDU, "ADDU rd, rs, rt" }, + { "LUI", &EmulateInstructionMIPS::Emulate_LUI, "LUI rt, immediate" }, + //---------------------------------------------------------------------- // MicroMIPS Prologue/Epilogue instructions //---------------------------------------------------------------------- @@ -904,36 +908,57 @@ EmulateInstructionMIPS::nonvolatile_reg_ bool EmulateInstructionMIPS::Emulate_ADDiu (llvm::MCInst& insn) { + // ADDIU rt, rs, immediate + // GPR[rt] <- GPR[rs] + sign_extend(immediate) + + uint8_t dst, src; bool success = false; const uint32_t imm16 = insn.getOperand(2).getImm(); - uint32_t imm = SignedBits(imm16, 15, 0); - uint64_t result; - uint32_t src, dst; + int64_t imm = SignedBits(imm16, 15, 0); dst = m_reg_info->getEncodingValue (insn.getOperand(0).getReg()); src = m_reg_info->getEncodingValue (insn.getOperand(1).getReg()); - /* Check if this is addiu sp,,imm16 */ - if (dst == dwarf_sp_mips) + // If immediate value is greater then 2^16 - 1 then clang generate + // LUI, ADDIU, SUBU instructions in prolog. + // Example + // lui $1, 0x2 + // addiu $1, $1, -0x5920 + // subu $sp, $sp, $1 + // In this case, ADDIU dst and src will be same and not equal to sp + if (dst == src) { + Context context; + /* read register */ - uint64_t src_opd_val = ReadRegisterUnsigned (eRegisterKindDWARF, dwarf_zero_mips + src, 0, &success); + const int64_t src_opd_val = ReadRegisterUnsigned (eRegisterKindDWARF, dwarf_zero_mips + src, 0, &success); if (!success) return false; - result = src_opd_val + imm; + /* Check if this is daddiu sp, sp, imm16 */ + if (dst == dwarf_sp_mips) + { + uint64_t result = src_opd_val + imm; + RegisterInfo reg_info_sp; - Context context; - RegisterInfo reg_info_sp; - if (GetRegisterInfo (eRegisterKindDWARF, dwarf_sp_mips, reg_info_sp)) - context.SetRegisterPlusOffset (reg_info_sp, imm); + if (GetRegisterInfo (eRegisterKindDWARF, dwarf_sp_mips, reg_info_sp)) + context.SetRegisterPlusOffset (reg_info_sp, imm); - /* We are allocating bytes on stack */ - context.type = eContextAdjustStackPointer; + /* We are allocating bytes on stack */ + context.type = eContextAdjustStackPointer; - WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_sp_mips, result); + WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_sp_mips, result); + return true; + } + + imm += src_opd_val; + context.SetImmediateSigned (imm); + context.type = eContextImmediate; + + if (!WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_zero_mips + dst, imm)) + return false; } - + return true; } @@ -968,7 +993,7 @@ EmulateInstructionMIPS::Emulate_SW (llvm WriteRegisterUnsigned (bad_vaddr_context, eRegisterKindDWARF, dwarf_bad_mips, address); /* We look for sp based non-volatile register stores */ - if (base == dwarf_sp_mips && nonvolatile_reg_p (src)) + if (nonvolatile_reg_p (src)) { RegisterInfo reg_info_src; @@ -1027,7 +1052,7 @@ EmulateInstructionMIPS::Emulate_LW (llvm bad_vaddr_context.type = eContextInvalid; WriteRegisterUnsigned (bad_vaddr_context, eRegisterKindDWARF, dwarf_bad_mips, address); - if (base == dwarf_sp_mips && nonvolatile_reg_p (src)) + if (nonvolatile_reg_p (src)) { RegisterValue data_src; RegisterInfo reg_info_src; @@ -1049,6 +1074,105 @@ EmulateInstructionMIPS::Emulate_LW (llvm } bool +EmulateInstructionMIPS::Emulate_SUBU_ADDU (llvm::MCInst& insn) +{ + // SUBU sp, , + // ADDU sp, , + // ADDU dst, sp, + + bool success = false; + uint64_t result; + uint8_t src, dst, rt; + const char *op_name = m_insn_info->getName (insn.getOpcode ()); + + dst = m_reg_info->getEncodingValue (insn.getOperand(0).getReg()); + src = m_reg_info->getEncodingValue (insn.getOperand(1).getReg()); + + /* Check if sp is destination register */ + if (dst == dwarf_sp_mips) + { + rt = m_reg_info->getEncodingValue (insn.getOperand(2).getReg()); + + /* read register */ + uint64_t src_opd_val = ReadRegisterUnsigned (eRegisterKindDWARF, dwarf_zero_mips + src, 0, &success); + if (!success) + return false; + + /* read register */ + uint64_t rt_opd_val = ReadRegisterUnsigned (eRegisterKindDWARF, dwarf_zero_mips + rt, 0, &success); + if (!success) + return false; + + if (!strcasecmp (op_name, "SUBU")) + result = src_opd_val - rt_opd_val; + else + result = src_opd_val + rt_opd_val; + + Context context; + RegisterInfo reg_info_sp; + if (GetRegisterInfo (eRegisterKindDWARF, dwarf_sp_mips, reg_info_sp)) + context.SetRegisterPlusOffset (reg_info_sp, rt_opd_val); + + /* We are allocating bytes on stack */ + context.type = eContextAdjustStackPointer; + + WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_sp_mips, result); + + return true; + } + else if (src == dwarf_sp_mips) + { + rt = m_reg_info->getEncodingValue (insn.getOperand(2).getReg()); + + /* read register */ + uint64_t src_opd_val = ReadRegisterUnsigned (eRegisterKindDWARF, dwarf_zero_mips + src, 0, &success); + if (!success) + return false; + + /* read register */ + uint64_t rt_opd_val = ReadRegisterUnsigned (eRegisterKindDWARF, dwarf_zero_mips + rt, 0, &success); + if (!success) + return false; + + Context context; + + if (!strcasecmp (op_name, "SUBU")) + result = src_opd_val - rt_opd_val; + else + result = src_opd_val + rt_opd_val; + + context.SetImmediateSigned (result); + context.type = eContextImmediate; + + if (!WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_zero_mips + dst, result)) + return false; + } + + return true; +} + +bool +EmulateInstructionMIPS::Emulate_LUI (llvm::MCInst& insn) +{ + // LUI rt, immediate + // GPR[rt] <- sign_extend(immediate << 16) + + const uint32_t imm32 = insn.getOperand(1).getImm() << 16; + int64_t imm = SignedBits(imm32, 31, 0); + uint8_t rt; + Context context; + + rt = m_reg_info->getEncodingValue (insn.getOperand(0).getReg()); + context.SetImmediateSigned (imm); + context.type = eContextImmediate; + + if (WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_zero_mips + rt, imm)) + return true; + + return false; +} + +bool EmulateInstructionMIPS::Emulate_ADDIUSP (llvm::MCInst& insn) { bool success = false; Modified: vendor/lldb/dist/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h ============================================================================== --- vendor/lldb/dist/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.h Wed Aug 17 19:37:50 2016 (r304308) @@ -127,6 +127,12 @@ protected: Emulate_ADDiu (llvm::MCInst& insn); bool + Emulate_SUBU_ADDU (llvm::MCInst& insn); + + bool + Emulate_LUI (llvm::MCInst& insn); + + bool Emulate_SW (llvm::MCInst& insn); bool Modified: vendor/lldb/dist/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp Wed Aug 17 19:37:50 2016 (r304308) @@ -482,10 +482,15 @@ EmulateInstructionMIPS64::GetOpcodeForIn //---------------------------------------------------------------------- // Prologue/Epilogue instructions //---------------------------------------------------------------------- - { "DADDiu", &EmulateInstructionMIPS64::Emulate_DADDiu, "DADDIU rt,rs,immediate" }, - { "ADDiu", &EmulateInstructionMIPS64::Emulate_DADDiu, "ADDIU rt,rs,immediate" }, - { "SD", &EmulateInstructionMIPS64::Emulate_SD, "SD rt,offset(rs)" }, - { "LD", &EmulateInstructionMIPS64::Emulate_LD, "LD rt,offset(base)" }, + { "DADDiu", &EmulateInstructionMIPS64::Emulate_DADDiu, "DADDIU rt, rs, immediate" }, + { "ADDiu", &EmulateInstructionMIPS64::Emulate_DADDiu, "ADDIU rt, rs, immediate" }, + { "SD", &EmulateInstructionMIPS64::Emulate_SD, "SD rt, offset(rs)" }, + { "LD", &EmulateInstructionMIPS64::Emulate_LD, "LD rt, offset(base)" }, + { "DSUBU", &EmulateInstructionMIPS64::Emulate_DSUBU_DADDU, "DSUBU rd, rs, rt" }, + { "SUBU", &EmulateInstructionMIPS64::Emulate_DSUBU_DADDU, "SUBU rd, rs, rt" }, + { "DADDU", &EmulateInstructionMIPS64::Emulate_DSUBU_DADDU, "DADDU rd, rs, rt" }, + { "ADDU", &EmulateInstructionMIPS64::Emulate_DSUBU_DADDU, "ADDU rd, rs, rt" }, + { "LUI", &EmulateInstructionMIPS64::Emulate_LUI, "LUI rt, immediate" }, @@ -771,36 +776,57 @@ EmulateInstructionMIPS64::nonvolatile_re bool EmulateInstructionMIPS64::Emulate_DADDiu (llvm::MCInst& insn) { + // DADDIU rt, rs, immediate + // GPR[rt] <- GPR[rs] + sign_extend(immediate) + + uint8_t dst, src; bool success = false; const uint32_t imm16 = insn.getOperand(2).getImm(); - uint64_t imm = SignedBits(imm16, 15, 0); - uint64_t result; - uint32_t src, dst; + int64_t imm = SignedBits(imm16, 15, 0); dst = m_reg_info->getEncodingValue (insn.getOperand(0).getReg()); src = m_reg_info->getEncodingValue (insn.getOperand(1).getReg()); - /* Check if this is daddiu sp,,imm16 */ - if (dst == dwarf_sp_mips64) + // If immediate is greater than 2^16 - 1 then clang generate + // LUI, (D)ADDIU,(D)SUBU instructions in prolog. + // Example + // lui $1, 0x2 + // daddiu $1, $1, -0x5920 + // dsubu $sp, $sp, $1 + // In this case, (D)ADDIU dst and src will be same and not equal to sp + if (dst == src) { + Context context; + /* read register */ - uint64_t src_opd_val = ReadRegisterUnsigned (eRegisterKindDWARF, dwarf_zero_mips64 + src, 0, &success); + const int64_t src_opd_val = ReadRegisterUnsigned (eRegisterKindDWARF, dwarf_zero_mips64 + src, 0, &success); if (!success) return false; - result = src_opd_val + imm; + /* Check if this is daddiu sp, sp, imm16 */ + if (dst == dwarf_sp_mips64) + { + uint64_t result = src_opd_val + imm; + RegisterInfo reg_info_sp; - Context context; - RegisterInfo reg_info_sp; - if (GetRegisterInfo (eRegisterKindDWARF, dwarf_sp_mips64, reg_info_sp)) - context.SetRegisterPlusOffset (reg_info_sp, imm); + if (GetRegisterInfo (eRegisterKindDWARF, dwarf_sp_mips64, reg_info_sp)) + context.SetRegisterPlusOffset (reg_info_sp, imm); - /* We are allocating bytes on stack */ - context.type = eContextAdjustStackPointer; + /* We are allocating bytes on stack */ + context.type = eContextAdjustStackPointer; - WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_sp_mips64, result); + WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_sp_mips64, result); + return true; + } + + imm += src_opd_val; + context.SetImmediateSigned (imm); + context.type = eContextImmediate; + + if (!WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_zero_mips64 + dst, imm)) + return false; } - + return true; } @@ -832,7 +858,7 @@ EmulateInstructionMIPS64::Emulate_SD (ll address = address + imm; /* We look for sp based non-volatile register stores */ - if (base == dwarf_sp_mips64 && nonvolatile_reg_p (src)) + if (nonvolatile_reg_p (src)) { Context context; RegisterValue data_src; @@ -888,7 +914,7 @@ EmulateInstructionMIPS64::Emulate_LD (ll WriteRegisterUnsigned (bad_vaddr_context, eRegisterKindDWARF, dwarf_bad_mips64, address); - if (base == dwarf_sp_mips64 && nonvolatile_reg_p (src)) + if (nonvolatile_reg_p (src)) { RegisterValue data_src; RegisterInfo reg_info_src; @@ -908,6 +934,104 @@ EmulateInstructionMIPS64::Emulate_LD (ll return false; } +bool +EmulateInstructionMIPS64::Emulate_LUI (llvm::MCInst& insn) +{ + // LUI rt, immediate + // GPR[rt] <- sign_extend(immediate << 16) + + const uint32_t imm32 = insn.getOperand(1).getImm() << 16; + int64_t imm = SignedBits(imm32, 31, 0); + uint8_t rt; + Context context; + + rt = m_reg_info->getEncodingValue (insn.getOperand(0).getReg()); + context.SetImmediateSigned (imm); + context.type = eContextImmediate; + + if (WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_zero_mips64 + rt, imm)) + return true; + + return false; +} + +bool +EmulateInstructionMIPS64::Emulate_DSUBU_DADDU (llvm::MCInst& insn) +{ + // DSUBU sp, , + // DADDU sp, , + // DADDU dst, sp, + + bool success = false; + uint64_t result; + uint8_t src, dst, rt; + const char *op_name = m_insn_info->getName (insn.getOpcode ()); + + dst = m_reg_info->getEncodingValue (insn.getOperand(0).getReg()); + src = m_reg_info->getEncodingValue (insn.getOperand(1).getReg()); + + /* Check if sp is destination register */ + if (dst == dwarf_sp_mips64) + { + rt = m_reg_info->getEncodingValue (insn.getOperand(2).getReg()); + + /* read register */ + uint64_t src_opd_val = ReadRegisterUnsigned (eRegisterKindDWARF, dwarf_zero_mips64 + src, 0, &success); + if (!success) + return false; + + /* read register */ + uint64_t rt_opd_val = ReadRegisterUnsigned (eRegisterKindDWARF, dwarf_zero_mips64 + rt, 0, &success); + if (!success) + return false; + + if (!strcasecmp (op_name, "DSUBU") || !strcasecmp (op_name, "SUBU")) + result = src_opd_val - rt_opd_val; + else + result = src_opd_val + rt_opd_val; + + Context context; + RegisterInfo reg_info_sp; + if (GetRegisterInfo (eRegisterKindDWARF, dwarf_sp_mips64, reg_info_sp)) + context.SetRegisterPlusOffset (reg_info_sp, rt_opd_val); + + /* We are allocating bytes on stack */ + context.type = eContextAdjustStackPointer; + + WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_sp_mips64, result); + + return true; + } + else if (src == dwarf_sp_mips64) + { + rt = m_reg_info->getEncodingValue (insn.getOperand(2).getReg()); + + /* read register */ + uint64_t src_opd_val = ReadRegisterUnsigned (eRegisterKindDWARF, dwarf_zero_mips64 + src, 0, &success); + if (!success) + return false; + + /* read register */ + uint64_t rt_opd_val = ReadRegisterUnsigned (eRegisterKindDWARF, dwarf_zero_mips64 + rt, 0, &success); + if (!success) + return false; + + Context context; + + if (!strcasecmp (op_name, "DSUBU") || !strcasecmp (op_name, "SUBU")) + result = src_opd_val - rt_opd_val; + else + result = src_opd_val + rt_opd_val; + + context.SetImmediateSigned (result); + context.type = eContextImmediate; + + if (!WriteRegisterUnsigned (context, eRegisterKindDWARF, dwarf_zero_mips64 + dst, result)) + return false; + } + + return true; +} /* Emulate below MIPS branch instructions. Modified: vendor/lldb/dist/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h ============================================================================== --- vendor/lldb/dist/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h Wed Aug 17 19:37:50 2016 (r304308) @@ -121,6 +121,12 @@ protected: Emulate_DADDiu (llvm::MCInst& insn); bool + Emulate_DSUBU_DADDU (llvm::MCInst& insn); + + bool + Emulate_LUI (llvm::MCInst& insn); + + bool Emulate_SD (llvm::MCInst& insn); bool Modified: vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.cpp Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Plugins/Process/Linux/NativeProcessLinux.cpp Wed Aug 17 19:37:50 2016 (r304308) @@ -58,7 +58,6 @@ #include "lldb/Host/linux/Personality.h" #include "lldb/Host/linux/Ptrace.h" #include "lldb/Host/linux/Uio.h" -#include "lldb/Host/android/Android.h" #define LLDB_PERSONALITY_GET_CURRENT_SETTINGS 0xffffffff Modified: vendor/lldb/dist/source/Plugins/Process/Linux/NativeThreadLinux.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Linux/NativeThreadLinux.cpp Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Plugins/Process/Linux/NativeThreadLinux.cpp Wed Aug 17 19:37:50 2016 (r304308) @@ -30,7 +30,7 @@ #include // Try to define a macro to encapsulate the tgkill syscall #define tgkill(pid, tid, sig) \ - syscall(SYS_tgkill, static_cast< ::pid_t>(pid), static_cast< ::pid_t>(tid), sig) + syscall(__NR_tgkill, static_cast< ::pid_t>(pid), static_cast< ::pid_t>(tid), sig) using namespace lldb; using namespace lldb_private; Modified: vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp Wed Aug 17 19:37:50 2016 (r304308) @@ -19,6 +19,7 @@ #include "lldb/Core/StructuredData.h" #include "lldb/DataFormatters/FormatManager.h" #include "lldb/Host/StringConvert.h" +#include "lldb/Utility/StringExtractor.h" using namespace lldb; using namespace lldb_private; @@ -30,6 +31,7 @@ DynamicRegisterInfo::DynamicRegisterInfo m_set_names (), m_value_regs_map (), m_invalidate_regs_map (), + m_dynamic_reg_size_map (), m_reg_data_byte_size (0), m_finalized (false) { @@ -43,6 +45,7 @@ DynamicRegisterInfo::DynamicRegisterInfo m_set_names (), m_value_regs_map (), m_invalidate_regs_map (), + m_dynamic_reg_size_map (), m_reg_data_byte_size (0), m_finalized (false) { @@ -292,6 +295,27 @@ DynamicRegisterInfo::SetRegisterInfo(con reg_info.byte_size = bitsize / 8; + std::string dwarf_opcode_string; + if (reg_info_dict->GetValueForKeyAsString ("dynamic_size_dwarf_expr_bytes", dwarf_opcode_string)) + { + reg_info.dynamic_size_dwarf_len = dwarf_opcode_string.length () / 2; + assert (reg_info.dynamic_size_dwarf_len > 0); + + std::vector dwarf_opcode_bytes(reg_info.dynamic_size_dwarf_len); + uint32_t j; + StringExtractor opcode_extractor; + // Swap "dwarf_opcode_string" over into "opcode_extractor" + opcode_extractor.GetStringRef ().swap (dwarf_opcode_string); + uint32_t ret_val = opcode_extractor.GetHexBytesAvail (dwarf_opcode_bytes.data (), + reg_info.dynamic_size_dwarf_len); + assert (ret_val == reg_info.dynamic_size_dwarf_len); + + for (j = 0; j < reg_info.dynamic_size_dwarf_len; ++j) + m_dynamic_reg_size_map[i].push_back(dwarf_opcode_bytes[j]); + + reg_info.dynamic_size_dwarf_expr_bytes = m_dynamic_reg_size_map[i].data (); + } + std::string format_str; if (reg_info_dict->GetValueForKeyAsString("format", format_str, nullptr)) { @@ -417,6 +441,14 @@ DynamicRegisterInfo::AddRegister (Regist for (i=0; reg_info.invalidate_regs[i] != LLDB_INVALID_REGNUM; ++i) m_invalidate_regs_map[reg_num].push_back(reg_info.invalidate_regs[i]); } + if (reg_info.dynamic_size_dwarf_expr_bytes) + { + for (i = 0; i < reg_info.dynamic_size_dwarf_len; ++i) + m_dynamic_reg_size_map[reg_num].push_back(reg_info.dynamic_size_dwarf_expr_bytes[i]); + + reg_info.dynamic_size_dwarf_expr_bytes = m_dynamic_reg_size_map[reg_num].data (); + } + m_regs.push_back (reg_info); uint32_t set = GetRegisterSetIndexByName (set_name, true); assert (set < m_sets.size()); @@ -641,6 +673,14 @@ DynamicRegisterInfo::GetRegisterInfoAtIn return NULL; } +RegisterInfo * +DynamicRegisterInfo::GetRegisterInfoAtIndex (uint32_t i) +{ + if (i < m_regs.size()) + return &m_regs[i]; + return NULL; +} + const RegisterSet * DynamicRegisterInfo::GetRegisterSet (uint32_t i) const { @@ -688,6 +728,7 @@ DynamicRegisterInfo::Clear() m_set_names.clear(); m_value_regs_map.clear(); m_invalidate_regs_map.clear(); + m_dynamic_reg_size_map.clear(); m_reg_data_byte_size = 0; m_finalized = false; } Modified: vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.h ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.h Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Plugins/Process/Utility/DynamicRegisterInfo.h Wed Aug 17 19:37:50 2016 (r304308) @@ -56,6 +56,9 @@ public: const lldb_private::RegisterInfo * GetRegisterInfoAtIndex (uint32_t i) const; + lldb_private::RegisterInfo * + GetRegisterInfoAtIndex (uint32_t i); + const lldb_private::RegisterSet * GetRegisterSet (uint32_t i) const; @@ -81,6 +84,8 @@ protected: typedef std::vector set_reg_num_collection; typedef std::vector name_collection; typedef std::map reg_to_regs_map; + typedef std::vector dwarf_opcode; + typedef std::map dynamic_reg_size_map; lldb_private::RegisterInfo * GetRegisterInfo (const lldb_private::ConstString ®_name); @@ -91,6 +96,7 @@ protected: name_collection m_set_names; reg_to_regs_map m_value_regs_map; reg_to_regs_map m_invalidate_regs_map; + dynamic_reg_size_map m_dynamic_reg_size_map; size_t m_reg_data_byte_size; // The number of bytes required to store all registers bool m_finalized; }; Modified: vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp Wed Aug 17 19:37:50 2016 (r304308) @@ -177,7 +177,7 @@ enum #define EXC_OFFSET(idx) ((idx) * 4 + sizeof (RegisterContextDarwin_arm::GPR) + sizeof (RegisterContextDarwin_arm::FPU)) #define DBG_OFFSET(reg) ((LLVM_EXTENSION offsetof (RegisterContextDarwin_arm::DBG, reg) + sizeof (RegisterContextDarwin_arm::GPR) + sizeof (RegisterContextDarwin_arm::FPU) + sizeof (RegisterContextDarwin_arm::EXC))) -#define DEFINE_DBG(reg, i) #reg, NULL, sizeof(((RegisterContextDarwin_arm::DBG *)NULL)->reg[i]), DBG_OFFSET(reg[i]), eEncodingUint, eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM }, NULL, NULL +#define DEFINE_DBG(reg, i) #reg, NULL, sizeof(((RegisterContextDarwin_arm::DBG *)NULL)->reg[i]), DBG_OFFSET(reg[i]), eEncodingUint, eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM }, NULL, NULL, NULL, 0 #define REG_CONTEXT_SIZE (sizeof (RegisterContextDarwin_arm::GPR) + sizeof (RegisterContextDarwin_arm::FPU) + sizeof (RegisterContextDarwin_arm::EXC)) static RegisterInfo g_register_infos[] = { Modified: vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp Wed Aug 17 19:37:50 2016 (r304308) @@ -51,7 +51,7 @@ using namespace lldb_private; #define EXC_OFFSET_NAME(reg) (LLVM_EXTENSION offsetof (RegisterContextDarwin_arm64::EXC, reg) + sizeof (RegisterContextDarwin_arm64::GPR) + sizeof (RegisterContextDarwin_arm64::FPU)) #define DBG_OFFSET_NAME(reg) (LLVM_EXTENSION offsetof (RegisterContextDarwin_arm64::DBG, reg) + sizeof (RegisterContextDarwin_arm64::GPR) + sizeof (RegisterContextDarwin_arm64::FPU) + sizeof (RegisterContextDarwin_arm64::EXC)) -#define DEFINE_DBG(reg, i) #reg, NULL, sizeof(((RegisterContextDarwin_arm64::DBG *)NULL)->reg[i]), DBG_OFFSET_NAME(reg[i]), eEncodingUint, eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM }, NULL, NULL +#define DEFINE_DBG(reg, i) #reg, NULL, sizeof(((RegisterContextDarwin_arm64::DBG *)NULL)->reg[i]), DBG_OFFSET_NAME(reg[i]), eEncodingUint, eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM }, NULL, NULL, NULL, 0 #define REG_CONTEXT_SIZE (sizeof (RegisterContextDarwin_arm64::GPR) + sizeof (RegisterContextDarwin_arm64::FPU) + sizeof (RegisterContextDarwin_arm64::EXC)) //----------------------------------------------------------------------------- Modified: vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm.cpp Wed Aug 17 19:37:50 2016 (r304308) @@ -27,7 +27,7 @@ using namespace lldb_private; #define EXC_OFFSET(idx) ((idx) * 4 + sizeof (RegisterContextFreeBSD_arm::GPR) + sizeof (RegisterContextFreeBSD_arm::FPU)) #define DBG_OFFSET(reg) ((LLVM_EXTENSION offsetof (RegisterContextFreeBSD_arm::DBG, reg) + sizeof (RegisterContextFreeBSD_arm::GPR) + sizeof (RegisterContextFreeBSD_arm::FPU) + sizeof (RegisterContextFreeBSD_arm::EXC))) -#define DEFINE_DBG(reg, i) #reg, NULL, sizeof(((RegisterContextFreeBSD_arm::DBG *)NULL)->reg[i]), DBG_OFFSET(reg[i]), eEncodingUint, eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, dbg_##reg##i }, NULL, NULL +#define DEFINE_DBG(reg, i) #reg, NULL, sizeof(((RegisterContextFreeBSD_arm::DBG *)NULL)->reg[i]), DBG_OFFSET(reg[i]), eEncodingUint, eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, dbg_##reg##i }, NULL, NULL, NULL, 0 #define REG_CONTEXT_SIZE (sizeof (RegisterContextFreeBSD_arm::GPR) + sizeof (RegisterContextFreeBSD_arm::FPU) + sizeof (RegisterContextFreeBSD_arm::EXC)) //----------------------------------------------------------------------------- Modified: vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextFreeBSD_arm64.cpp Wed Aug 17 19:37:50 2016 (r304308) @@ -23,7 +23,7 @@ using namespace lldb; #define EXC_OFFSET_NAME(reg) (LLVM_EXTENSION offsetof (RegisterContextFreeBSD_arm64::EXC, reg) + sizeof (RegisterContextFreeBSD_arm64::GPR) + sizeof (RegisterContextFreeBSD_arm64::FPU)) #define DBG_OFFSET_NAME(reg) (LLVM_EXTENSION offsetof (RegisterContextFreeBSD_arm64::DBG, reg) + sizeof (RegisterContextFreeBSD_arm64::GPR) + sizeof (RegisterContextFreeBSD_arm64::FPU) + sizeof (RegisterContextFreeBSD_arm64::EXC)) -#define DEFINE_DBG(reg, i) #reg, NULL, sizeof(((RegisterContextFreeBSD_arm64::DBG *)NULL)->reg[i]), DBG_OFFSET_NAME(reg[i]), lldb::eEncodingUint, lldb::eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, dbg_##reg##i }, NULL, NULL +#define DEFINE_DBG(reg, i) #reg, NULL, sizeof(((RegisterContextFreeBSD_arm64::DBG *)NULL)->reg[i]), DBG_OFFSET_NAME(reg[i]), lldb::eEncodingUint, lldb::eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, dbg_##reg##i }, NULL, NULL, NULL, 0 #define REG_CONTEXT_SIZE (sizeof (RegisterContextFreeBSD_arm64::GPR) + sizeof (RegisterContextFreeBSD_arm64::FPU) + sizeof (RegisterContextFreeBSD_arm64::EXC)) //----------------------------------------------------------------------------- Modified: vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLinux_arm.cpp Wed Aug 17 19:37:50 2016 (r304308) @@ -26,7 +26,7 @@ using namespace lldb_private; #define EXC_OFFSET(idx) ((idx) * 4 + sizeof (RegisterContextLinux_arm::GPR) + sizeof (RegisterContextLinux_arm::FPU)) #define DBG_OFFSET(reg) ((LLVM_EXTENSION offsetof (RegisterContextLinux_arm::DBG, reg) + sizeof (RegisterContextLinux_arm::GPR) + sizeof (RegisterContextLinux_arm::FPU) + sizeof (RegisterContextLinux_arm::EXC))) -#define DEFINE_DBG(reg, i) #reg, NULL, sizeof(((RegisterContextLinux_arm::DBG *)NULL)->reg[i]), DBG_OFFSET(reg[i]), eEncodingUint, eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, dbg_##reg##i }, NULL, NULL +#define DEFINE_DBG(reg, i) #reg, NULL, sizeof(((RegisterContextLinux_arm::DBG *)NULL)->reg[i]), DBG_OFFSET(reg[i]), eEncodingUint, eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, dbg_##reg##i }, NULL, NULL, NULL, 0 #define REG_CONTEXT_SIZE (sizeof (RegisterContextLinux_arm::GPR) + sizeof (RegisterContextLinux_arm::FPU) + sizeof (RegisterContextLinux_arm::EXC)) //----------------------------------------------------------------------------- Modified: vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Plugins/Process/Utility/RegisterContextLinux_arm64.cpp Wed Aug 17 19:37:50 2016 (r304308) @@ -26,7 +26,7 @@ #define EXC_OFFSET_NAME(reg) (LLVM_EXTENSION offsetof (RegisterContextLinux_arm64::EXC, reg) + sizeof (RegisterContextLinux_arm64::GPR) + sizeof (RegisterContextLinux_arm64::FPU)) #define DBG_OFFSET_NAME(reg) (LLVM_EXTENSION offsetof (RegisterContextLinux_arm64::DBG, reg) + sizeof (RegisterContextLinux_arm64::GPR) + sizeof (RegisterContextLinux_arm64::FPU) + sizeof (RegisterContextLinux_arm64::EXC)) -#define DEFINE_DBG(reg, i) #reg, NULL, sizeof(((RegisterContextLinux_arm64::DBG *)NULL)->reg[i]), DBG_OFFSET_NAME(reg[i]), lldb::eEncodingUint, lldb::eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, dbg_##reg##i }, NULL, NULL +#define DEFINE_DBG(reg, i) #reg, NULL, sizeof(((RegisterContextLinux_arm64::DBG *)NULL)->reg[i]), DBG_OFFSET_NAME(reg[i]), lldb::eEncodingUint, lldb::eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, dbg_##reg##i }, NULL, NULL, NULL, 0 #define REG_CONTEXT_SIZE (sizeof (RegisterContextLinux_arm64::GPR) + sizeof (RegisterContextLinux_arm64::FPU) + sizeof (RegisterContextLinux_arm64::EXC)) Modified: vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_arm.h ============================================================================== --- vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_arm.h Wed Aug 17 19:37:27 2016 (r304307) +++ vendor/lldb/dist/source/Plugins/Process/Utility/RegisterInfos_arm.h Wed Aug 17 19:37:50 2016 (r304308) @@ -327,111 +327,111 @@ static uint32_t g_q15_contains[] = { fpu static RegisterInfo g_register_infos_arm[] = { // NAME ALT SZ OFFSET ENCODING FORMAT EH_FRAME DWARF GENERIC PROCESS PLUGIN LLDB NATIVE VALUE REGS INVALIDATE REGS // =========== ======= == ============== ================ ==================== =================== =================== ========================== =================== ============= ============== ================= -{ "r0", nullptr, 4, GPR_OFFSET(0), eEncodingUint, eFormatHex, { ehframe_r0, dwarf_r0, LLDB_REGNUM_GENERIC_ARG1, LLDB_INVALID_REGNUM, gpr_r0 }, nullptr, nullptr }, -{ "r1", nullptr, 4, GPR_OFFSET(1), eEncodingUint, eFormatHex, { ehframe_r1, dwarf_r1, LLDB_REGNUM_GENERIC_ARG2, LLDB_INVALID_REGNUM, gpr_r1 }, nullptr, nullptr }, -{ "r2", nullptr, 4, GPR_OFFSET(2), eEncodingUint, eFormatHex, { ehframe_r2, dwarf_r2, LLDB_REGNUM_GENERIC_ARG3, LLDB_INVALID_REGNUM, gpr_r2 }, nullptr, nullptr }, -{ "r3", nullptr, 4, GPR_OFFSET(3), eEncodingUint, eFormatHex, { ehframe_r3, dwarf_r3, LLDB_REGNUM_GENERIC_ARG4, LLDB_INVALID_REGNUM, gpr_r3 }, nullptr, nullptr }, -{ "r4", nullptr, 4, GPR_OFFSET(4), eEncodingUint, eFormatHex, { ehframe_r4, dwarf_r4, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r4 }, nullptr, nullptr }, -{ "r5", nullptr, 4, GPR_OFFSET(5), eEncodingUint, eFormatHex, { ehframe_r5, dwarf_r5, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r5 }, nullptr, nullptr }, -{ "r6", nullptr, 4, GPR_OFFSET(6), eEncodingUint, eFormatHex, { ehframe_r6, dwarf_r6, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r6 }, nullptr, nullptr }, -{ "r7", nullptr, 4, GPR_OFFSET(7), eEncodingUint, eFormatHex, { ehframe_r7, dwarf_r7, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r7 }, nullptr, nullptr }, -{ "r8", nullptr, 4, GPR_OFFSET(8), eEncodingUint, eFormatHex, { ehframe_r8, dwarf_r8, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r8 }, nullptr, nullptr }, -{ "r9", nullptr, 4, GPR_OFFSET(9), eEncodingUint, eFormatHex, { ehframe_r9, dwarf_r9, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r9 }, nullptr, nullptr }, -{ "r10", nullptr, 4, GPR_OFFSET(10), eEncodingUint, eFormatHex, { ehframe_r10, dwarf_r10, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r10 }, nullptr, nullptr }, -{ "r11", nullptr, 4, GPR_OFFSET(11), eEncodingUint, eFormatHex, { ehframe_r11, dwarf_r11, LLDB_REGNUM_GENERIC_FP, LLDB_INVALID_REGNUM, gpr_r11 }, nullptr, nullptr }, -{ "r12", nullptr, 4, GPR_OFFSET(12), eEncodingUint, eFormatHex, { ehframe_r12, dwarf_r12, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r12 }, nullptr, nullptr }, -{ "sp", "r13", 4, GPR_OFFSET(13), eEncodingUint, eFormatHex, { ehframe_sp, dwarf_sp, LLDB_REGNUM_GENERIC_SP, LLDB_INVALID_REGNUM, gpr_sp }, nullptr, nullptr }, -{ "lr", "r14", 4, GPR_OFFSET(14), eEncodingUint, eFormatHex, { ehframe_lr, dwarf_lr, LLDB_REGNUM_GENERIC_RA, LLDB_INVALID_REGNUM, gpr_lr }, nullptr, nullptr }, -{ "pc", "r15", 4, GPR_OFFSET(15), eEncodingUint, eFormatHex, { ehframe_pc, dwarf_pc, LLDB_REGNUM_GENERIC_PC, LLDB_INVALID_REGNUM, gpr_pc }, nullptr, nullptr }, -{ "cpsr", "psr", 4, GPR_OFFSET(16), eEncodingUint, eFormatHex, { ehframe_cpsr, dwarf_cpsr, LLDB_REGNUM_GENERIC_FLAGS, LLDB_INVALID_REGNUM, gpr_cpsr }, nullptr, nullptr }, - -{ "s0", nullptr, 4, FPU_OFFSET(0), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s0, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s0 }, nullptr, g_s0_invalidates }, -{ "s1", nullptr, 4, FPU_OFFSET(1), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s1, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s1 }, nullptr, g_s1_invalidates }, -{ "s2", nullptr, 4, FPU_OFFSET(2), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s2, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s2 }, nullptr, g_s2_invalidates }, -{ "s3", nullptr, 4, FPU_OFFSET(3), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s3, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s3 }, nullptr, g_s3_invalidates }, -{ "s4", nullptr, 4, FPU_OFFSET(4), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s4, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s4 }, nullptr, g_s4_invalidates }, -{ "s5", nullptr, 4, FPU_OFFSET(5), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s5, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s5 }, nullptr, g_s5_invalidates }, -{ "s6", nullptr, 4, FPU_OFFSET(6), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s6, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s6 }, nullptr, g_s6_invalidates }, -{ "s7", nullptr, 4, FPU_OFFSET(7), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s7, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s7 }, nullptr, g_s7_invalidates }, -{ "s8", nullptr, 4, FPU_OFFSET(8), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s8, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s8 }, nullptr, g_s8_invalidates }, -{ "s9", nullptr, 4, FPU_OFFSET(9), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s9, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s9 }, nullptr, g_s9_invalidates }, -{ "s10", nullptr, 4, FPU_OFFSET(10), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s10, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s10 }, nullptr, g_s10_invalidates }, -{ "s11", nullptr, 4, FPU_OFFSET(11), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s11, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s11 }, nullptr, g_s11_invalidates }, -{ "s12", nullptr, 4, FPU_OFFSET(12), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s12, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s12 }, nullptr, g_s12_invalidates }, -{ "s13", nullptr, 4, FPU_OFFSET(13), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s13, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s13 }, nullptr, g_s13_invalidates }, -{ "s14", nullptr, 4, FPU_OFFSET(14), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s14, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s14 }, nullptr, g_s14_invalidates }, -{ "s15", nullptr, 4, FPU_OFFSET(15), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s15, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s15 }, nullptr, g_s15_invalidates }, -{ "s16", nullptr, 4, FPU_OFFSET(16), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s16, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s16 }, nullptr, g_s16_invalidates }, -{ "s17", nullptr, 4, FPU_OFFSET(17), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s17, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s17 }, nullptr, g_s17_invalidates }, -{ "s18", nullptr, 4, FPU_OFFSET(18), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s18, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s18 }, nullptr, g_s18_invalidates }, -{ "s19", nullptr, 4, FPU_OFFSET(19), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s19, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s19 }, nullptr, g_s19_invalidates }, -{ "s20", nullptr, 4, FPU_OFFSET(20), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s20, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s20 }, nullptr, g_s20_invalidates }, -{ "s21", nullptr, 4, FPU_OFFSET(21), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s21, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s21 }, nullptr, g_s21_invalidates }, -{ "s22", nullptr, 4, FPU_OFFSET(22), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s22, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s22 }, nullptr, g_s22_invalidates }, -{ "s23", nullptr, 4, FPU_OFFSET(23), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s23, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s23 }, nullptr, g_s23_invalidates }, -{ "s24", nullptr, 4, FPU_OFFSET(24), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s24, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s24 }, nullptr, g_s24_invalidates }, -{ "s25", nullptr, 4, FPU_OFFSET(25), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s25, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s25 }, nullptr, g_s25_invalidates }, -{ "s26", nullptr, 4, FPU_OFFSET(26), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s26, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s26 }, nullptr, g_s26_invalidates }, -{ "s27", nullptr, 4, FPU_OFFSET(27), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s27, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s27 }, nullptr, g_s27_invalidates }, -{ "s28", nullptr, 4, FPU_OFFSET(28), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s28, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s28 }, nullptr, g_s28_invalidates }, -{ "s29", nullptr, 4, FPU_OFFSET(29), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s29, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s29 }, nullptr, g_s29_invalidates }, -{ "s30", nullptr, 4, FPU_OFFSET(30), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s30, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s30 }, nullptr, g_s30_invalidates }, -{ "s31", nullptr, 4, FPU_OFFSET(31), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s31, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s31 }, nullptr, g_s31_invalidates }, -{ "fpscr", nullptr, 4, FPSCR_OFFSET, eEncodingUint, eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_fpscr }, nullptr, nullptr }, - -{ "d0", nullptr, 8, FPU_OFFSET(0), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d0, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d0 }, g_d0_contains, g_d0_invalidates }, -{ "d1", nullptr, 8, FPU_OFFSET(2), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d1, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d1 }, g_d1_contains, g_d1_invalidates }, -{ "d2", nullptr, 8, FPU_OFFSET(4), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d2, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d2 }, g_d2_contains, g_d2_invalidates }, -{ "d3", nullptr, 8, FPU_OFFSET(6), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d3, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d3 }, g_d3_contains, g_d3_invalidates }, -{ "d4", nullptr, 8, FPU_OFFSET(8), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d4, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d4 }, g_d4_contains, g_d4_invalidates }, -{ "d5", nullptr, 8, FPU_OFFSET(10), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d5, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d5 }, g_d5_contains, g_d5_invalidates }, -{ "d6", nullptr, 8, FPU_OFFSET(12), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d6, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d6 }, g_d6_contains, g_d6_invalidates }, -{ "d7", nullptr, 8, FPU_OFFSET(14), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d7, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d7 }, g_d7_contains, g_d7_invalidates }, -{ "d8", nullptr, 8, FPU_OFFSET(16), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d8, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d8 }, g_d8_contains, g_d8_invalidates }, -{ "d9", nullptr, 8, FPU_OFFSET(18), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d9, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d9 }, g_d9_contains, g_d9_invalidates }, -{ "d10", nullptr, 8, FPU_OFFSET(20), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d10, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d10 }, g_d10_contains, g_d10_invalidates }, -{ "d11", nullptr, 8, FPU_OFFSET(22), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d11, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d11 }, g_d11_contains, g_d11_invalidates }, -{ "d12", nullptr, 8, FPU_OFFSET(24), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d12, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d12 }, g_d12_contains, g_d12_invalidates }, -{ "d13", nullptr, 8, FPU_OFFSET(26), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d13, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d13 }, g_d13_contains, g_d13_invalidates }, -{ "d14", nullptr, 8, FPU_OFFSET(28), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d14, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d14 }, g_d14_contains, g_d14_invalidates }, -{ "d15", nullptr, 8, FPU_OFFSET(30), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d15, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d15 }, g_d15_contains, g_d15_invalidates }, -{ "d16", nullptr, 8, FPU_OFFSET(32), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d16, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d16 }, nullptr, g_d16_invalidates }, -{ "d17", nullptr, 8, FPU_OFFSET(34), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d17, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d17 }, nullptr, g_d17_invalidates }, -{ "d18", nullptr, 8, FPU_OFFSET(36), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d18, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d18 }, nullptr, g_d18_invalidates }, -{ "d19", nullptr, 8, FPU_OFFSET(38), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d19, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d19 }, nullptr, g_d19_invalidates }, -{ "d20", nullptr, 8, FPU_OFFSET(40), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d20, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d20 }, nullptr, g_d20_invalidates }, -{ "d21", nullptr, 8, FPU_OFFSET(42), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d21, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d21 }, nullptr, g_d21_invalidates }, -{ "d22", nullptr, 8, FPU_OFFSET(44), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d22, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d22 }, nullptr, g_d22_invalidates }, -{ "d23", nullptr, 8, FPU_OFFSET(46), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d23, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d23 }, nullptr, g_d23_invalidates }, -{ "d24", nullptr, 8, FPU_OFFSET(48), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d24, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d24 }, nullptr, g_d24_invalidates }, -{ "d25", nullptr, 8, FPU_OFFSET(50), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d25, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d25 }, nullptr, g_d25_invalidates }, -{ "d26", nullptr, 8, FPU_OFFSET(52), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d26, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d26 }, nullptr, g_d26_invalidates }, -{ "d27", nullptr, 8, FPU_OFFSET(54), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d27, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d27 }, nullptr, g_d27_invalidates }, -{ "d28", nullptr, 8, FPU_OFFSET(56), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d28, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d28 }, nullptr, g_d28_invalidates }, -{ "d29", nullptr, 8, FPU_OFFSET(58), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d29, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d29 }, nullptr, g_d29_invalidates }, -{ "d30", nullptr, 8, FPU_OFFSET(60), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d30, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d30 }, nullptr, g_d30_invalidates }, -{ "d31", nullptr, 8, FPU_OFFSET(62), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d31, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d31 }, nullptr, g_d31_invalidates }, - -{ "q0", nullptr, 16, FPU_OFFSET(0), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q0, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q0 }, g_q0_contains, nullptr, }, -{ "q1", nullptr, 16, FPU_OFFSET(4), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q1, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q1 }, g_q1_contains, nullptr, }, -{ "q2", nullptr, 16, FPU_OFFSET(8), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q2, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q2 }, g_q2_contains, nullptr, }, -{ "q3", nullptr, 16, FPU_OFFSET(12), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q3, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q3 }, g_q3_contains, nullptr, }, -{ "q4", nullptr, 16, FPU_OFFSET(16), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q4, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q4 }, g_q4_contains, nullptr, }, -{ "q5", nullptr, 16, FPU_OFFSET(20), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q5, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q5 }, g_q5_contains, nullptr, }, -{ "q6", nullptr, 16, FPU_OFFSET(24), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q6, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q6 }, g_q6_contains, nullptr, }, -{ "q7", nullptr, 16, FPU_OFFSET(28), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q7, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q7 }, g_q7_contains, nullptr, }, -{ "q8", nullptr, 16, FPU_OFFSET(32), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q8, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q8 }, g_q8_contains, nullptr, }, -{ "q9", nullptr, 16, FPU_OFFSET(36), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q9, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q9 }, g_q9_contains, nullptr, }, -{ "q10", nullptr, 16, FPU_OFFSET(40), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q10, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q10 }, g_q10_contains, nullptr, }, -{ "q11", nullptr, 16, FPU_OFFSET(44), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q11, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q11 }, g_q11_contains, nullptr, }, -{ "q12", nullptr, 16, FPU_OFFSET(48), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q12, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q12 }, g_q12_contains, nullptr, }, -{ "q13", nullptr, 16, FPU_OFFSET(52), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q13, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q13 }, g_q13_contains, nullptr, }, -{ "q14", nullptr, 16, FPU_OFFSET(56), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q14, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q14 }, g_q14_contains, nullptr, }, -{ "q15", nullptr, 16, FPU_OFFSET(60), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q15, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q15 }, g_q15_contains, nullptr, }, - -{ "exception", nullptr, 4, EXC_OFFSET(0), eEncodingUint, eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, exc_exception }, nullptr, nullptr }, -{ "fsr", nullptr, 4, EXC_OFFSET(1), eEncodingUint, eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, exc_fsr }, nullptr, nullptr }, -{ "far", nullptr, 4, EXC_OFFSET(2), eEncodingUint, eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, exc_far }, nullptr, nullptr }, +{ "r0", nullptr, 4, GPR_OFFSET(0), eEncodingUint, eFormatHex, { ehframe_r0, dwarf_r0, LLDB_REGNUM_GENERIC_ARG1, LLDB_INVALID_REGNUM, gpr_r0 }, nullptr, nullptr, nullptr, 0}, +{ "r1", nullptr, 4, GPR_OFFSET(1), eEncodingUint, eFormatHex, { ehframe_r1, dwarf_r1, LLDB_REGNUM_GENERIC_ARG2, LLDB_INVALID_REGNUM, gpr_r1 }, nullptr, nullptr, nullptr, 0}, +{ "r2", nullptr, 4, GPR_OFFSET(2), eEncodingUint, eFormatHex, { ehframe_r2, dwarf_r2, LLDB_REGNUM_GENERIC_ARG3, LLDB_INVALID_REGNUM, gpr_r2 }, nullptr, nullptr, nullptr, 0}, +{ "r3", nullptr, 4, GPR_OFFSET(3), eEncodingUint, eFormatHex, { ehframe_r3, dwarf_r3, LLDB_REGNUM_GENERIC_ARG4, LLDB_INVALID_REGNUM, gpr_r3 }, nullptr, nullptr, nullptr, 0}, +{ "r4", nullptr, 4, GPR_OFFSET(4), eEncodingUint, eFormatHex, { ehframe_r4, dwarf_r4, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r4 }, nullptr, nullptr, nullptr, 0}, +{ "r5", nullptr, 4, GPR_OFFSET(5), eEncodingUint, eFormatHex, { ehframe_r5, dwarf_r5, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r5 }, nullptr, nullptr, nullptr, 0}, +{ "r6", nullptr, 4, GPR_OFFSET(6), eEncodingUint, eFormatHex, { ehframe_r6, dwarf_r6, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r6 }, nullptr, nullptr, nullptr, 0}, +{ "r7", nullptr, 4, GPR_OFFSET(7), eEncodingUint, eFormatHex, { ehframe_r7, dwarf_r7, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r7 }, nullptr, nullptr, nullptr, 0}, +{ "r8", nullptr, 4, GPR_OFFSET(8), eEncodingUint, eFormatHex, { ehframe_r8, dwarf_r8, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r8 }, nullptr, nullptr, nullptr, 0}, +{ "r9", nullptr, 4, GPR_OFFSET(9), eEncodingUint, eFormatHex, { ehframe_r9, dwarf_r9, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r9 }, nullptr, nullptr, nullptr, 0}, +{ "r10", nullptr, 4, GPR_OFFSET(10), eEncodingUint, eFormatHex, { ehframe_r10, dwarf_r10, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r10 }, nullptr, nullptr, nullptr, 0}, +{ "r11", nullptr, 4, GPR_OFFSET(11), eEncodingUint, eFormatHex, { ehframe_r11, dwarf_r11, LLDB_REGNUM_GENERIC_FP, LLDB_INVALID_REGNUM, gpr_r11 }, nullptr, nullptr, nullptr, 0}, +{ "r12", nullptr, 4, GPR_OFFSET(12), eEncodingUint, eFormatHex, { ehframe_r12, dwarf_r12, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, gpr_r12 }, nullptr, nullptr, nullptr, 0}, +{ "sp", "r13", 4, GPR_OFFSET(13), eEncodingUint, eFormatHex, { ehframe_sp, dwarf_sp, LLDB_REGNUM_GENERIC_SP, LLDB_INVALID_REGNUM, gpr_sp }, nullptr, nullptr, nullptr, 0}, +{ "lr", "r14", 4, GPR_OFFSET(14), eEncodingUint, eFormatHex, { ehframe_lr, dwarf_lr, LLDB_REGNUM_GENERIC_RA, LLDB_INVALID_REGNUM, gpr_lr }, nullptr, nullptr, nullptr, 0}, +{ "pc", "r15", 4, GPR_OFFSET(15), eEncodingUint, eFormatHex, { ehframe_pc, dwarf_pc, LLDB_REGNUM_GENERIC_PC, LLDB_INVALID_REGNUM, gpr_pc }, nullptr, nullptr, nullptr, 0}, +{ "cpsr", "psr", 4, GPR_OFFSET(16), eEncodingUint, eFormatHex, { ehframe_cpsr, dwarf_cpsr, LLDB_REGNUM_GENERIC_FLAGS, LLDB_INVALID_REGNUM, gpr_cpsr }, nullptr, nullptr, nullptr, 0}, + +{ "s0", nullptr, 4, FPU_OFFSET(0), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s0, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s0 }, nullptr, g_s0_invalidates, nullptr, 0}, +{ "s1", nullptr, 4, FPU_OFFSET(1), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s1, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s1 }, nullptr, g_s1_invalidates, nullptr, 0}, +{ "s2", nullptr, 4, FPU_OFFSET(2), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s2, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s2 }, nullptr, g_s2_invalidates, nullptr, 0}, +{ "s3", nullptr, 4, FPU_OFFSET(3), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s3, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s3 }, nullptr, g_s3_invalidates, nullptr, 0}, +{ "s4", nullptr, 4, FPU_OFFSET(4), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s4, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s4 }, nullptr, g_s4_invalidates, nullptr, 0}, +{ "s5", nullptr, 4, FPU_OFFSET(5), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s5, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s5 }, nullptr, g_s5_invalidates, nullptr, 0}, +{ "s6", nullptr, 4, FPU_OFFSET(6), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s6, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s6 }, nullptr, g_s6_invalidates, nullptr, 0}, +{ "s7", nullptr, 4, FPU_OFFSET(7), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s7, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s7 }, nullptr, g_s7_invalidates, nullptr, 0}, +{ "s8", nullptr, 4, FPU_OFFSET(8), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s8, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s8 }, nullptr, g_s8_invalidates, nullptr, 0}, +{ "s9", nullptr, 4, FPU_OFFSET(9), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s9, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s9 }, nullptr, g_s9_invalidates, nullptr, 0}, +{ "s10", nullptr, 4, FPU_OFFSET(10), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s10, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s10 }, nullptr, g_s10_invalidates, nullptr, 0}, +{ "s11", nullptr, 4, FPU_OFFSET(11), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s11, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s11 }, nullptr, g_s11_invalidates, nullptr, 0}, +{ "s12", nullptr, 4, FPU_OFFSET(12), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s12, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s12 }, nullptr, g_s12_invalidates, nullptr, 0}, +{ "s13", nullptr, 4, FPU_OFFSET(13), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s13, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s13 }, nullptr, g_s13_invalidates, nullptr, 0}, +{ "s14", nullptr, 4, FPU_OFFSET(14), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s14, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s14 }, nullptr, g_s14_invalidates, nullptr, 0}, +{ "s15", nullptr, 4, FPU_OFFSET(15), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s15, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s15 }, nullptr, g_s15_invalidates, nullptr, 0}, +{ "s16", nullptr, 4, FPU_OFFSET(16), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s16, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s16 }, nullptr, g_s16_invalidates, nullptr, 0}, +{ "s17", nullptr, 4, FPU_OFFSET(17), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s17, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s17 }, nullptr, g_s17_invalidates, nullptr, 0}, +{ "s18", nullptr, 4, FPU_OFFSET(18), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s18, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s18 }, nullptr, g_s18_invalidates, nullptr, 0}, +{ "s19", nullptr, 4, FPU_OFFSET(19), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s19, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s19 }, nullptr, g_s19_invalidates, nullptr, 0}, +{ "s20", nullptr, 4, FPU_OFFSET(20), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s20, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s20 }, nullptr, g_s20_invalidates, nullptr, 0}, +{ "s21", nullptr, 4, FPU_OFFSET(21), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s21, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s21 }, nullptr, g_s21_invalidates, nullptr, 0}, +{ "s22", nullptr, 4, FPU_OFFSET(22), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s22, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s22 }, nullptr, g_s22_invalidates, nullptr, 0}, +{ "s23", nullptr, 4, FPU_OFFSET(23), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s23, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s23 }, nullptr, g_s23_invalidates, nullptr, 0}, +{ "s24", nullptr, 4, FPU_OFFSET(24), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s24, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s24 }, nullptr, g_s24_invalidates, nullptr, 0}, +{ "s25", nullptr, 4, FPU_OFFSET(25), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s25, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s25 }, nullptr, g_s25_invalidates, nullptr, 0}, +{ "s26", nullptr, 4, FPU_OFFSET(26), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s26, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s26 }, nullptr, g_s26_invalidates, nullptr, 0}, +{ "s27", nullptr, 4, FPU_OFFSET(27), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s27, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s27 }, nullptr, g_s27_invalidates, nullptr, 0}, +{ "s28", nullptr, 4, FPU_OFFSET(28), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s28, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s28 }, nullptr, g_s28_invalidates, nullptr, 0}, +{ "s29", nullptr, 4, FPU_OFFSET(29), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s29, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s29 }, nullptr, g_s29_invalidates, nullptr, 0}, +{ "s30", nullptr, 4, FPU_OFFSET(30), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s30, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s30 }, nullptr, g_s30_invalidates, nullptr, 0}, +{ "s31", nullptr, 4, FPU_OFFSET(31), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_s31, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_s31 }, nullptr, g_s31_invalidates, nullptr, 0}, +{ "fpscr", nullptr, 4, FPSCR_OFFSET, eEncodingUint, eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_fpscr }, nullptr, nullptr, nullptr, 0}, + +{ "d0", nullptr, 8, FPU_OFFSET(0), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d0, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d0 }, g_d0_contains, g_d0_invalidates, nullptr, 0}, +{ "d1", nullptr, 8, FPU_OFFSET(2), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d1, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d1 }, g_d1_contains, g_d1_invalidates, nullptr, 0}, +{ "d2", nullptr, 8, FPU_OFFSET(4), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d2, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d2 }, g_d2_contains, g_d2_invalidates, nullptr, 0}, +{ "d3", nullptr, 8, FPU_OFFSET(6), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d3, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d3 }, g_d3_contains, g_d3_invalidates, nullptr, 0}, +{ "d4", nullptr, 8, FPU_OFFSET(8), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d4, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d4 }, g_d4_contains, g_d4_invalidates, nullptr, 0}, +{ "d5", nullptr, 8, FPU_OFFSET(10), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d5, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d5 }, g_d5_contains, g_d5_invalidates, nullptr, 0}, +{ "d6", nullptr, 8, FPU_OFFSET(12), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d6, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d6 }, g_d6_contains, g_d6_invalidates, nullptr, 0}, +{ "d7", nullptr, 8, FPU_OFFSET(14), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d7, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d7 }, g_d7_contains, g_d7_invalidates, nullptr, 0}, +{ "d8", nullptr, 8, FPU_OFFSET(16), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d8, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d8 }, g_d8_contains, g_d8_invalidates, nullptr, 0}, +{ "d9", nullptr, 8, FPU_OFFSET(18), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d9, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d9 }, g_d9_contains, g_d9_invalidates, nullptr, 0}, +{ "d10", nullptr, 8, FPU_OFFSET(20), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d10, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d10 }, g_d10_contains, g_d10_invalidates, nullptr, 0}, +{ "d11", nullptr, 8, FPU_OFFSET(22), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d11, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d11 }, g_d11_contains, g_d11_invalidates, nullptr, 0}, +{ "d12", nullptr, 8, FPU_OFFSET(24), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d12, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d12 }, g_d12_contains, g_d12_invalidates, nullptr, 0}, +{ "d13", nullptr, 8, FPU_OFFSET(26), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d13, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d13 }, g_d13_contains, g_d13_invalidates, nullptr, 0}, +{ "d14", nullptr, 8, FPU_OFFSET(28), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d14, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d14 }, g_d14_contains, g_d14_invalidates, nullptr, 0}, +{ "d15", nullptr, 8, FPU_OFFSET(30), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d15, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d15 }, g_d15_contains, g_d15_invalidates, nullptr, 0}, +{ "d16", nullptr, 8, FPU_OFFSET(32), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d16, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d16 }, nullptr, g_d16_invalidates, nullptr, 0 }, +{ "d17", nullptr, 8, FPU_OFFSET(34), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d17, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d17 }, nullptr, g_d17_invalidates, nullptr, 0}, +{ "d18", nullptr, 8, FPU_OFFSET(36), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d18, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d18 }, nullptr, g_d18_invalidates, nullptr, 0}, +{ "d19", nullptr, 8, FPU_OFFSET(38), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d19, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d19 }, nullptr, g_d19_invalidates, nullptr, 0}, +{ "d20", nullptr, 8, FPU_OFFSET(40), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d20, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d20 }, nullptr, g_d20_invalidates, nullptr, 0}, +{ "d21", nullptr, 8, FPU_OFFSET(42), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d21, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d21 }, nullptr, g_d21_invalidates, nullptr, 0}, +{ "d22", nullptr, 8, FPU_OFFSET(44), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d22, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d22 }, nullptr, g_d22_invalidates, nullptr, 0}, +{ "d23", nullptr, 8, FPU_OFFSET(46), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d23, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d23 }, nullptr, g_d23_invalidates, nullptr, 0}, +{ "d24", nullptr, 8, FPU_OFFSET(48), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d24, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d24 }, nullptr, g_d24_invalidates, nullptr, 0}, +{ "d25", nullptr, 8, FPU_OFFSET(50), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d25, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d25 }, nullptr, g_d25_invalidates, nullptr, 0}, +{ "d26", nullptr, 8, FPU_OFFSET(52), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d26, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d26 }, nullptr, g_d26_invalidates, nullptr, 0}, +{ "d27", nullptr, 8, FPU_OFFSET(54), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d27, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d27 }, nullptr, g_d27_invalidates, nullptr, 0}, +{ "d28", nullptr, 8, FPU_OFFSET(56), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d28, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d28 }, nullptr, g_d28_invalidates, nullptr, 0}, +{ "d29", nullptr, 8, FPU_OFFSET(58), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d29, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d29 }, nullptr, g_d29_invalidates, nullptr, 0}, +{ "d30", nullptr, 8, FPU_OFFSET(60), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d30, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d30 }, nullptr, g_d30_invalidates, nullptr, 0}, +{ "d31", nullptr, 8, FPU_OFFSET(62), eEncodingIEEE754, eFormatFloat, { LLDB_INVALID_REGNUM, dwarf_d31, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_d31 }, nullptr, g_d31_invalidates, nullptr, 0}, + +{ "q0", nullptr, 16, FPU_OFFSET(0), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q0, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q0 }, g_q0_contains, nullptr, nullptr, 0}, +{ "q1", nullptr, 16, FPU_OFFSET(4), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q1, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q1 }, g_q1_contains, nullptr, nullptr, 0}, +{ "q2", nullptr, 16, FPU_OFFSET(8), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q2, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q2 }, g_q2_contains, nullptr, nullptr, 0}, +{ "q3", nullptr, 16, FPU_OFFSET(12), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q3, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q3 }, g_q3_contains, nullptr, nullptr, 0}, +{ "q4", nullptr, 16, FPU_OFFSET(16), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q4, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q4 }, g_q4_contains, nullptr, nullptr, 0}, +{ "q5", nullptr, 16, FPU_OFFSET(20), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q5, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q5 }, g_q5_contains, nullptr, nullptr, 0}, +{ "q6", nullptr, 16, FPU_OFFSET(24), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q6, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q6 }, g_q6_contains, nullptr, nullptr, 0}, +{ "q7", nullptr, 16, FPU_OFFSET(28), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q7, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q7 }, g_q7_contains, nullptr, nullptr, 0}, +{ "q8", nullptr, 16, FPU_OFFSET(32), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q8, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q8 }, g_q8_contains, nullptr, nullptr, 0}, +{ "q9", nullptr, 16, FPU_OFFSET(36), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q9, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q9 }, g_q9_contains, nullptr, nullptr, 0}, +{ "q10", nullptr, 16, FPU_OFFSET(40), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q10, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q10 }, g_q10_contains, nullptr, nullptr, 0}, +{ "q11", nullptr, 16, FPU_OFFSET(44), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q11, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q11 }, g_q11_contains, nullptr, nullptr, 0}, +{ "q12", nullptr, 16, FPU_OFFSET(48), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q12, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q12 }, g_q12_contains, nullptr, nullptr, 0}, +{ "q13", nullptr, 16, FPU_OFFSET(52), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q13, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q13 }, g_q13_contains, nullptr, nullptr, 0}, +{ "q14", nullptr, 16, FPU_OFFSET(56), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q14, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q14 }, g_q14_contains, nullptr, nullptr, 0}, +{ "q15", nullptr, 16, FPU_OFFSET(60), eEncodingVector, eFormatVectorOfUInt8, { LLDB_INVALID_REGNUM, dwarf_q15, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, fpu_q15 }, g_q15_contains, nullptr, nullptr, 0}, + +{ "exception", nullptr, 4, EXC_OFFSET(0), eEncodingUint, eFormatHex, { LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, exc_exception }, nullptr, nullptr, nullptr, 0}, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Aug 17 19:38:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBAC9BBDB9F; Wed, 17 Aug 2016 19:38:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FD7811DC; Wed, 17 Aug 2016 19:38:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HJcBXG083501; Wed, 17 Aug 2016 19:38:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HJcBEv083500; Wed, 17 Aug 2016 19:38:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608171938.u7HJcBEv083500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Aug 2016 19:38:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304309 - vendor/lldb/lldb-release_39-r278877 X-SVN-Group: vendor 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 19:38:13 -0000 Author: dim Date: Wed Aug 17 19:38:11 2016 New Revision: 304309 URL: https://svnweb.freebsd.org/changeset/base/304309 Log: Tag lldb release_39 branch r278877. Added: vendor/lldb/lldb-release_39-r278877/ - copied from r304308, vendor/lldb/dist/ From owner-svn-src-all@freebsd.org Wed Aug 17 20:20:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E411ABBC96D; Wed, 17 Aug 2016 20:20:43 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E9C01E48; Wed, 17 Aug 2016 20:20:43 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 894443592E5; Wed, 17 Aug 2016 22:20:40 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 5D3A928494; Wed, 17 Aug 2016 22:20:40 +0200 (CEST) Date: Wed, 17 Aug 2016 22:20:40 +0200 From: Jilles Tjoelker To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304176 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern Message-ID: <20160817202040.GA21263@stack.nl> References: <201608151908.u7FJ8phh091939@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201608151908.u7FJ8phh091939@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 20:20:44 -0000 On Mon, Aug 15, 2016 at 07:08:51PM +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon Aug 15 19:08:51 2016 > New Revision: 304176 > URL: https://svnweb.freebsd.org/changeset/base/304176 > Log: > Add an implementation of fdatasync(2). > The syscall is a trivial wrapper around new VOP_FDATASYNC(), sharing > code with fsync(2). For all filesystems, this commit provides the > implementation which delegates the work of VOP_FDATASYNC() to > VOP_FSYNC(). This is functionally correct but not efficient. > This is not yet POSIX-compliant implementation, because it does not > ensure that queued AIO requests are completed before returning. > Reviewed by: mckusick > Discussed with: avg (ZFS), jhb (AIO part) > Tested by: pho > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > Differential revision: https://reviews.freebsd.org/D7471 > Modified: > head/include/unistd.h > head/lib/libc/sys/Symbol.map > head/sys/compat/freebsd32/syscalls.master > head/sys/kern/syscalls.master > head/sys/kern/vfs_default.c > head/sys/kern/vfs_syscalls.c > head/sys/kern/vnode_if.src > Modified: head/include/unistd.h > ============================================================================== > --- head/include/unistd.h Mon Aug 15 19:05:41 2016 (r304175) > +++ head/include/unistd.h Mon Aug 15 19:08:51 2016 (r304176) > @@ -384,6 +384,7 @@ extern int optind, opterr, optopt; > /* ISO/IEC 9945-1: 1996 */ > #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE > int fsync(int); > +int fdatasync(int); > > /* > * ftruncate() was in the POSIX Realtime Extension (it's used for shared Apparently these functions were added closely enough in time that they can stay together here :) > [snip] > Modified: head/sys/kern/vfs_syscalls.c > ============================================================================== > --- head/sys/kern/vfs_syscalls.c Mon Aug 15 19:05:41 2016 (r304175) > +++ head/sys/kern/vfs_syscalls.c Mon Aug 15 19:08:51 2016 (r304176) > @@ -3354,20 +3354,8 @@ freebsd6_ftruncate(struct thread *td, st > } > #endif > > -/* > - * Sync an open file. > - */ > -#ifndef _SYS_SYSPROTO_H_ > -struct fsync_args { > - int fd; > -}; > -#endif > -int > -sys_fsync(td, uap) > - struct thread *td; > - struct fsync_args /* { > - int fd; > - } */ *uap; > +static int > +kern_fsync(struct thread *td, int fd, bool fullsync) > { > struct vnode *vp; > struct mount *mp; > @@ -3375,11 +3363,15 @@ sys_fsync(td, uap) > cap_rights_t rights; > int error, lock_flags; > > - AUDIT_ARG_FD(uap->fd); > - error = getvnode(td, uap->fd, cap_rights_init(&rights, CAP_FSYNC), &fp); > + AUDIT_ARG_FD(fd); > + error = getvnode(td, fd, cap_rights_init(&rights, CAP_FSYNC), &fp); > if (error != 0) > return (error); > vp = fp->f_vnode; > +#if 0 > + if (!fullsync) > + /* XXXKIB: compete outstanding aio writes */; Under the _POSIX_SYNCHRONIZED_IO option, completing outstanding I/O requests is in fact required for fsync() as well. The fdatasync() function is completely under the _POSIX_SYNCHRONIZED_IO option. We do not implement this option, but keeping fdatasync()'s guarantees a subset of fsync()'s guarantees seems sensible. > +#endif > error = vn_start_write(vp, &mp, V_WAIT | PCATCH); > if (error != 0) > goto drop; > [snip] > Modified: head/sys/kern/vnode_if.src > ============================================================================== > --- head/sys/kern/vnode_if.src Mon Aug 15 19:05:41 2016 (r304175) > +++ head/sys/kern/vnode_if.src Mon Aug 15 19:08:51 2016 (r304176) > @@ -703,6 +703,14 @@ vop_add_writecount { > IN int inc; > }; > > +%% fdatasync vp L L L > + > +vop_fdatasync { > + IN struct vnode *vp; > + IN struct thread *td; > +}; > + > + > # The VOPs below are spares at the end of the table to allow new VOPs to be > # added in stable branches without breaking the KBI. New VOPs in HEAD should > # be added above these spares. When merging a new VOP to a stable branch, A waitfor parameter like in vop_fsync may be useful to implement aio_fsync(O_DSYNC) later on. -- Jilles Tjoelker From owner-svn-src-all@freebsd.org Wed Aug 17 20:21:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11486BBC9D4; Wed, 17 Aug 2016 20:21:35 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B8BA1126B; Wed, 17 Aug 2016 20:21:34 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HKLXaj001586; Wed, 17 Aug 2016 20:21:33 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HKLXJ4001584; Wed, 17 Aug 2016 20:21:33 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201608172021.u7HKLXJ4001584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 17 Aug 2016 20:21:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304313 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 20:21:35 -0000 Author: ae Date: Wed Aug 17 20:21:33 2016 New Revision: 304313 URL: https://svnweb.freebsd.org/changeset/base/304313 Log: Teach netisr_get_cpuid() to limit a given value to supported by netisr. Use netisr_get_cpuid() in netisr_select_cpuid() to limit cpuid value returned by protocol to be sure that it is not greather than nws_count. PR: 211836 Reviewed by: adrian MFC after: 3 days Modified: head/sys/net/if_epair.c head/sys/net/netisr.c Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Wed Aug 17 19:43:45 2016 (r304312) +++ head/sys/net/if_epair.c Wed Aug 17 20:21:33 2016 (r304313) @@ -807,9 +807,9 @@ epair_clone_create(struct if_clone *ifc, * cache locality but we can at least allow parallelism. */ sca->cpuid = - netisr_get_cpuid(sca->ifp->if_index % netisr_get_cpucount()); + netisr_get_cpuid(sca->ifp->if_index); scb->cpuid = - netisr_get_cpuid(scb->ifp->if_index % netisr_get_cpucount()); + netisr_get_cpuid(scb->ifp->if_index); /* Initialise pseudo media types. */ ifmedia_init(&sca->media, 0, epair_media_change, epair_media_status); Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Wed Aug 17 19:43:45 2016 (r304312) +++ head/sys/net/netisr.c Wed Aug 17 20:21:33 2016 (r304313) @@ -272,10 +272,7 @@ u_int netisr_get_cpuid(u_int cpunumber) { - KASSERT(cpunumber < nws_count, ("%s: %u > %u", __func__, cpunumber, - nws_count)); - - return (nws_array[cpunumber]); + return (nws_array[cpunumber % nws_count]); } /* @@ -810,10 +807,12 @@ netisr_select_cpuid(struct netisr_proto * dispatch. In the queued case, fall back on the SOURCE * policy. */ - if (*cpuidp != NETISR_CPUID_NONE) + if (*cpuidp != NETISR_CPUID_NONE) { + *cpuidp = netisr_get_cpuid(*cpuidp); return (m); + } if (dispatch_policy == NETISR_DISPATCH_HYBRID) { - *cpuidp = curcpu; + *cpuidp = netisr_get_cpuid(curcpu); return (m); } policy = NETISR_POLICY_SOURCE; From owner-svn-src-all@freebsd.org Wed Aug 17 20:24:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D47FCBBCAF6; Wed, 17 Aug 2016 20:24:15 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B09A6165C; Wed, 17 Aug 2016 20:24:15 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HKOEIN002396; Wed, 17 Aug 2016 20:24:14 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HKOECi002393; Wed, 17 Aug 2016 20:24:14 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201608172024.u7HKOECi002393@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Wed, 17 Aug 2016 20:24:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304314 - in head/sys/mips: broadcom 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 20:24:15 -0000 Author: landonf Date: Wed Aug 17 20:24:14 2016 New Revision: 304314 URL: https://svnweb.freebsd.org/changeset/base/304314 Log: mips/broadcom: Implement CFE-based EARLY_PRINTF support. This adds support for EARLY_PRINTF via the CFE console; the aim is to provide a fix for the otherwise cyclic dependency between PMU discovery and console printf/DELAY: - We need to parse the bhnd(4) core table to determine the address (and type) of the PMU/PLL registers and calculate the CPU clock frequency. - The core table parsing code will emit a printf() if a parse error is hit. - Safely calling printf() without EARLY_PRINTF requires a working DELAY+cninit, which means we need the PMU. Errors in core table parsing shouldn't happen, but lack of EARLY_PRINTF makes debugging more difficult. Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D7498 Modified: head/sys/mips/broadcom/bcm_machdep.c head/sys/mips/conf/BCM head/sys/mips/conf/SENTRY5 Modified: head/sys/mips/broadcom/bcm_machdep.c ============================================================================== --- head/sys/mips/broadcom/bcm_machdep.c Wed Aug 17 20:21:33 2016 (r304313) +++ head/sys/mips/broadcom/bcm_machdep.c Wed Aug 17 20:24:14 2016 (r304314) @@ -198,6 +198,21 @@ platform_start(__register_t a0, __regist /* Initialize pcpu stuff */ mips_pcpu0_init(); +#ifdef CFE + /* + * Initialize CFE firmware trampolines. This must be done + * before any CFE APIs are called, including writing + * to the CFE console. + * + * CFE passes the following values in registers: + * a0: firmware handle + * a2: firmware entry point + * a3: entry point seal + */ + if (a3 == CFE_EPTSEAL) + cfe_init(a0, a2); +#endif + #if 0 /* * Probe the Broadcom on-chip PLL clock registers @@ -234,23 +249,40 @@ platform_start(__register_t a0, __regist mips_timer_early_init(platform_counter_freq); -#ifdef CFE - /* - * Initialize CFE firmware trampolines before - * we initialize the low-level console. - * - * CFE passes the following values in registers: - * a0: firmware handle - * a2: firmware entry point - * a3: entry point seal - */ - if (a3 == CFE_EPTSEAL) - cfe_init(a0, a2); -#endif - cninit(); mips_init(); mips_timer_init_params(platform_counter_freq, socinfo->double_count); } + +/* + * CFE-based EARLY_PRINTF support. To use, add the following to the kernel + * config: + * option EARLY_PRINTF + * option CFE + * device cfe + */ +#if defined(EARLY_PRINTF) && defined(CFE) +static void +bcm_cfe_eputc(int c) +{ + static int fd = -1; + unsigned char ch; + + ch = (unsigned char) c; + + if (fd == -1) { + if ((fd = cfe_getstdhandle(CFE_STDHANDLE_CONSOLE)) < 0) + return; + } + + if (ch == '\n') + early_putc('\r'); + + while ((cfe_write(fd, &ch, 1)) == 0) + continue; +} + +early_putc_t *early_putc = bcm_cfe_eputc; +#endif /* EARLY_PRINTF */ Modified: head/sys/mips/conf/BCM ============================================================================== --- head/sys/mips/conf/BCM Wed Aug 17 20:21:33 2016 (r304313) +++ head/sys/mips/conf/BCM Wed Aug 17 20:24:14 2016 (r304314) @@ -52,6 +52,7 @@ options INVARIANT_SUPPORT #options BHND_LOGLEVEL=BHND_DEBUG_LEVEL #options BUS_DEBUG #makeoptions BUS_DEBUG +options EARLY_PRINTF #options VERBOSE_SYSINIT #makeoptions VERBOSE_SYSINIT Modified: head/sys/mips/conf/SENTRY5 ============================================================================== --- head/sys/mips/conf/SENTRY5 Wed Aug 17 20:21:33 2016 (r304313) +++ head/sys/mips/conf/SENTRY5 Wed Aug 17 20:24:14 2016 (r304314) @@ -31,9 +31,8 @@ makeoptions TRAMPLOADADDR=0x807963c0 hints "SENTRY5.hints" include "../broadcom/std.broadcom" -# sentry5 normally ships with cfe firmware; use the console for now +# sentry5 normally ships with cfe firmware options CFE -options CFE_CONSOLE options ALT_BREAK_TO_DEBUGGER device cfe @@ -57,6 +56,7 @@ options INVARIANT_SUPPORT #options BUS_DEBUG #makeoptions BUS_DEBUG +options EARLY_PRINTF device bhnd device siba From owner-svn-src-all@freebsd.org Wed Aug 17 20:27:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EE0DBBCB78; Wed, 17 Aug 2016 20:27:05 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4477A1828; Wed, 17 Aug 2016 20:27:05 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HKR4UF002536; Wed, 17 Aug 2016 20:27:04 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HKR46H002535; Wed, 17 Aug 2016 20:27:04 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201608172027.u7HKR46H002535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Wed, 17 Aug 2016 20:27:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304315 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 20:27:05 -0000 Author: jilles Date: Wed Aug 17 20:27:04 2016 New Revision: 304315 URL: https://svnweb.freebsd.org/changeset/base/304315 Log: rights(4): CAP_FSYNC also permits fdatasync(2). Modified: head/share/man/man4/rights.4 Modified: head/share/man/man4/rights.4 ============================================================================== --- head/share/man/man4/rights.4 Wed Aug 17 20:24:14 2016 (r304314) +++ head/share/man/man4/rights.4 Wed Aug 17 20:27:04 2016 (r304315) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 27, 2015 +.Dd August 17, 2016 .Dt RIGHTS 4 .Os .Sh NAME @@ -254,6 +254,7 @@ Permit .It Dv CAP_FSYNC Permit .Xr aio_fsync 2 , +.Xr fdatasync 2 , .Xr fsync 2 and .Xr openat 2 From owner-svn-src-all@freebsd.org Wed Aug 17 20:32:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FAC7BBD0C3; Wed, 17 Aug 2016 20:32:10 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1CCC1EA2; Wed, 17 Aug 2016 20:32:09 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HKW9oS002750; Wed, 17 Aug 2016 20:32:09 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HKW8YD002746; Wed, 17 Aug 2016 20:32:08 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608172032.u7HKW8YD002746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Aug 2016 20:32:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304316 - in head/sys/arm: allwinner allwinner/a10 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 20:32:10 -0000 Author: manu Date: Wed Aug 17 20:32:08 2016 New Revision: 304316 URL: https://svnweb.freebsd.org/changeset/base/304316 Log: Rename kernel config A10 into ALLWINNER_UP as it is intend to work with all Allwinner Uniprocessor SoC. As of now it works with A10 and A13 (and possibly R8 as it is the same as the A13). Move files.a10 into a1o subdirectory as it should be. Rename std.a10 into std.allwinner_up Added: head/sys/arm/allwinner/a10/files.a10 (contents, props changed) - copied, changed from r304315, head/sys/arm/allwinner/files.a10 head/sys/arm/allwinner/files.allwinner_up (contents, props changed) head/sys/arm/allwinner/std.allwinner_up (contents, props changed) - copied, changed from r304315, head/sys/arm/allwinner/std.a10 head/sys/arm/conf/ALLWINNER_UP (contents, props changed) - copied, changed from r304315, head/sys/arm/conf/A10 Deleted: head/sys/arm/allwinner/files.a10 head/sys/arm/allwinner/std.a10 head/sys/arm/conf/A10 Copied and modified: head/sys/arm/allwinner/a10/files.a10 (from r304315, head/sys/arm/allwinner/files.a10) ============================================================================== --- head/sys/arm/allwinner/files.a10 Wed Aug 17 20:27:04 2016 (r304315, copy source) +++ head/sys/arm/allwinner/a10/files.a10 Wed Aug 17 20:32:08 2016 (r304316) @@ -2,4 +2,3 @@ arm/allwinner/a10/a10_intc.c standard arm/allwinner/a10_padconf.c standard -arm/allwinner/timer.c standard Added: head/sys/arm/allwinner/files.allwinner_up ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/files.allwinner_up Wed Aug 17 20:32:08 2016 (r304316) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +arm/allwinner/timer.c standard Copied and modified: head/sys/arm/allwinner/std.allwinner_up (from r304315, head/sys/arm/allwinner/std.a10) ============================================================================== --- head/sys/arm/allwinner/std.a10 Wed Aug 17 20:27:04 2016 (r304315, copy source) +++ head/sys/arm/allwinner/std.allwinner_up Wed Aug 17 20:32:08 2016 (r304316) @@ -1,4 +1,4 @@ -# Allwinner A10 common options +# Allwinner Uniprocessor common options #$FreeBSD$ cpu CPU_CORTEXA @@ -8,6 +8,7 @@ makeoptions CONF_CFLAGS="-march=armv7a" makeoptions KERNVIRTADDR=0xc0200000 options KERNVIRTADDR=0xc0200000 +files "../allwinner/files.allwinner_up" files "../allwinner/files.allwinner" -files "../allwinner/files.a10" +files "../allwinner/a10/files.a10" files "../allwinner/a13/files.a13" Copied and modified: head/sys/arm/conf/ALLWINNER_UP (from r304315, head/sys/arm/conf/A10) ============================================================================== --- head/sys/arm/conf/A10 Wed Aug 17 20:27:04 2016 (r304315, copy source) +++ head/sys/arm/conf/ALLWINNER_UP Wed Aug 17 20:32:08 2016 (r304316) @@ -1,5 +1,5 @@ # -# A10 -- Custom configuration for the AllWinner A10 SoC +# ALLWINNER_UP -- Custom configuration for the AllWinner Uniprocessor SoC # # For more information on this file, please read the config(5) manual page, # and/or the handbook section on Kernel Configuration Files: @@ -18,10 +18,10 @@ # # $FreeBSD$ -ident A10 +ident ALLWINNER_UP include "std.armv6" -include "../allwinner/std.a10" +include "../allwinner/std.allwinner_up" options INTRNG From owner-svn-src-all@freebsd.org Wed Aug 17 21:29:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1511BBBD42E; Wed, 17 Aug 2016 21:29:59 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA43817E8; Wed, 17 Aug 2016 21:29:58 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HLTw7e025632; Wed, 17 Aug 2016 21:29:58 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HLTwn2025631; Wed, 17 Aug 2016 21:29:58 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201608172129.u7HLTwn2025631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 17 Aug 2016 21:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304317 - head/sys/boot/efi/boot1 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 21:29:59 -0000 Author: tsoome Date: Wed Aug 17 21:29:57 2016 New Revision: 304317 URL: https://svnweb.freebsd.org/changeset/base/304317 Log: boot1.efi Free() should check for NULL to provide consistent behavior with libstand Free(). Reviewed by: imp Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D7497 Modified: head/sys/boot/efi/boot1/boot1.c Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Wed Aug 17 20:32:08 2016 (r304316) +++ head/sys/boot/efi/boot1/boot1.c Wed Aug 17 21:29:57 2016 (r304317) @@ -78,7 +78,8 @@ Malloc(size_t len, const char *file __un void Free(void *buf, const char *file __unused, int line __unused) { - (void)bs->FreePool(buf); + if (buf != NULL) + (void)bs->FreePool(buf); } /* From owner-svn-src-all@freebsd.org Wed Aug 17 21:44:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B092EBBDC00; Wed, 17 Aug 2016 21:44:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7487C1782; Wed, 17 Aug 2016 21:44:04 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HLi3Hi032960; Wed, 17 Aug 2016 21:44:03 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HLi2XJ032947; Wed, 17 Aug 2016 21:44:02 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608172144.u7HLi2XJ032947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 17 Aug 2016 21:44:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304318 - in head/sys/arm/allwinner: . clk 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 21:44:04 -0000 Author: manu Date: Wed Aug 17 21:44:02 2016 New Revision: 304318 URL: https://svnweb.freebsd.org/changeset/base/304318 Log: Rename allwinner_machdep.{c.h} to aw_machdep.{c.h} as all allwinner source files are name aw_* Added: head/sys/arm/allwinner/aw_machdep.c - copied, changed from r304317, head/sys/arm/allwinner/allwinner_machdep.c head/sys/arm/allwinner/aw_machdep.h - copied, changed from r304317, head/sys/arm/allwinner/allwinner_machdep.h Deleted: head/sys/arm/allwinner/allwinner_machdep.c head/sys/arm/allwinner/allwinner_machdep.h Modified: head/sys/arm/allwinner/a10_ehci.c head/sys/arm/allwinner/a10_gpio.c head/sys/arm/allwinner/a10_mmc.c head/sys/arm/allwinner/aw_if_dwc.c head/sys/arm/allwinner/aw_mp.c head/sys/arm/allwinner/aw_rtc.c head/sys/arm/allwinner/clk/aw_pll.c head/sys/arm/allwinner/files.allwinner head/sys/arm/allwinner/timer.c Modified: head/sys/arm/allwinner/a10_ehci.c ============================================================================== --- head/sys/arm/allwinner/a10_ehci.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/a10_ehci.c Wed Aug 17 21:44:02 2016 (r304318) @@ -58,7 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/a10_gpio.c Wed Aug 17 21:44:02 2016 (r304318) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- head/sys/arm/allwinner/a10_mmc.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/a10_mmc.c Wed Aug 17 21:44:02 2016 (r304318) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include #include Modified: head/sys/arm/allwinner/aw_if_dwc.c ============================================================================== --- head/sys/arm/allwinner/aw_if_dwc.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/aw_if_dwc.c Wed Aug 17 21:44:02 2016 (r304318) @@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include #include Copied and modified: head/sys/arm/allwinner/aw_machdep.c (from r304317, head/sys/arm/allwinner/allwinner_machdep.c) ============================================================================== --- head/sys/arm/allwinner/allwinner_machdep.c Wed Aug 17 21:29:57 2016 (r304317, copy source) +++ head/sys/arm/allwinner/aw_machdep.c Wed Aug 17 21:44:02 2016 (r304318) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2012 Ganbold Tsagaankhuu - * Copyright (c) 2015-2016 Emmanuel Vadot + * Copyright (c) 2015-2016 Emmanuel Vadot * All rights reserved. * * This code is derived from software written for Brini by Mark Brinicombe @@ -26,6 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * from: FreeBSD: //depot/projects/arm/src/sys/arm/ti/ti_machdep.c */ @@ -52,7 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "platform_if.h" Copied and modified: head/sys/arm/allwinner/aw_machdep.h (from r304317, head/sys/arm/allwinner/allwinner_machdep.h) ============================================================================== --- head/sys/arm/allwinner/allwinner_machdep.h Wed Aug 17 21:29:57 2016 (r304317, copy source) +++ head/sys/arm/allwinner/aw_machdep.h Wed Aug 17 21:44:02 2016 (r304318) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Emmanuel Vadot + * Copyright (c) 2015 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/arm/allwinner/aw_mp.c ============================================================================== --- head/sys/arm/allwinner/aw_mp.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/aw_mp.c Wed Aug 17 21:44:02 2016 (r304318) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include /* Register for all dual-core SoC */ #define A20_CPUCFG_BASE 0x01c25c00 Modified: head/sys/arm/allwinner/aw_rtc.c ============================================================================== --- head/sys/arm/allwinner/aw_rtc.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/aw_rtc.c Wed Aug 17 21:44:02 2016 (r304318) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include #include "clock_if.h" Modified: head/sys/arm/allwinner/clk/aw_pll.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_pll.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/clk/aw_pll.c Wed Aug 17 21:44:02 2016 (r304318) @@ -49,7 +49,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include "clkdev_if.h" Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/files.allwinner Wed Aug 17 21:44:02 2016 (r304318) @@ -16,7 +16,7 @@ arm/allwinner/aw_rsb.c optional rsb arm/allwinner/aw_rtc.c standard arm/allwinner/aw_wdog.c standard arm/allwinner/a20/a20_cpu_cfg.c standard -arm/allwinner/allwinner_machdep.c standard +arm/allwinner/aw_machdep.c standard arm/allwinner/aw_mp.c optional smp arm/allwinner/axp209.c optional axp209 arm/allwinner/axp81x.c optional axp81x Modified: head/sys/arm/allwinner/timer.c ============================================================================== --- head/sys/arm/allwinner/timer.c Wed Aug 17 21:29:57 2016 (r304317) +++ head/sys/arm/allwinner/timer.c Wed Aug 17 21:44:02 2016 (r304318) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); #include -#include +#include /** * Timer registers addr From owner-svn-src-all@freebsd.org Wed Aug 17 21:57:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96BA4BBD0A4; Wed, 17 Aug 2016 21:57:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C6E51FC1; Wed, 17 Aug 2016 21:57:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HLvBF3036681; Wed, 17 Aug 2016 21:57:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HLvBhu036678; Wed, 17 Aug 2016 21:57:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608172157.u7HLvBhu036678@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 17 Aug 2016 21:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304319 - in head: contrib/llvm/lib/Target/X86 contrib/llvm/tools/clang/lib/Basic lib/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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 21:57:12 -0000 Author: dim Date: Wed Aug 17 21:57:11 2016 New Revision: 304319 URL: https://svnweb.freebsd.org/changeset/base/304319 Log: Pull in r262772 from upstream clang trunk (by Simon Pilgrim): [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't support XSAVE. Differential Revision: http://reviews.llvm.org/D17682 Pull in r262782 from upstream llvm trunk (by Simon Pilgrim): [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't support XSAVE. Differential Revision: http://reviews.llvm.org/D17683 This ensures clang does not emit AVX instructions for CPUTYPE=btver1. Reported by: Michel Depeige PR: 211864 MFC after: 3 days Modified: head/contrib/llvm/lib/Target/X86/X86.td head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp head/lib/clang/freebsd_cc_version.h Modified: head/contrib/llvm/lib/Target/X86/X86.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86.td Wed Aug 17 21:44:02 2016 (r304318) +++ head/contrib/llvm/lib/Target/X86/X86.td Wed Aug 17 21:57:11 2016 (r304319) @@ -576,7 +576,6 @@ def : Proc<"btver1", [ FeaturePRFCHW, FeatureLZCNT, FeaturePOPCNT, - FeatureXSAVE, FeatureSlowSHLD, FeatureLAHFSAHF ]>; Modified: head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp ============================================================================== --- head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Wed Aug 17 21:44:02 2016 (r304318) +++ head/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Wed Aug 17 21:57:11 2016 (r304319) @@ -2731,7 +2731,6 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "prfchw", true); setFeatureEnabledImpl(Features, "cx16", true); setFeatureEnabledImpl(Features, "fxsr", true); - setFeatureEnabledImpl(Features, "xsave", true); break; case CK_BDVER4: setFeatureEnabledImpl(Features, "avx2", true); Modified: head/lib/clang/freebsd_cc_version.h ============================================================================== --- head/lib/clang/freebsd_cc_version.h Wed Aug 17 21:44:02 2016 (r304318) +++ head/lib/clang/freebsd_cc_version.h Wed Aug 17 21:57:11 2016 (r304319) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1200000 +#define FREEBSD_CC_VERSION 1200001 From owner-svn-src-all@freebsd.org Wed Aug 17 22:13:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEECABBD5AF; Wed, 17 Aug 2016 22:13:41 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 808951BCD; Wed, 17 Aug 2016 22:13:41 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7HMDevU043965; Wed, 17 Aug 2016 22:13:40 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7HMDdcC043955; Wed, 17 Aug 2016 22:13:39 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201608172213.u7HMDdcC043955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 17 Aug 2016 22:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304320 - head/secure/lib/libcrypto 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.22 Precedence: list List-Id: "SVN commit messages 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, 17 Aug 2016 22:13:41 -0000 Author: jkim Date: Wed Aug 17 22:13:39 2016 New Revision: 304320 URL: https://svnweb.freebsd.org/changeset/base/304320 Log: Disable assembly sources when compiler/assembler cannot compile certain instructions. For example, GCC 4.2.1 + binutils 2.17.50 does not support AVX instructions. Reported by: bde MFC after: 2 weeks Added: head/secure/lib/libcrypto/opensslconf-aarch64.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-aarch64.h head/secure/lib/libcrypto/opensslconf-arm.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-arm.h head/secure/lib/libcrypto/opensslconf-mips.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-mips.h head/secure/lib/libcrypto/opensslconf-powerpc.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-powerpc.h head/secure/lib/libcrypto/opensslconf-riscv.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-riscv.h head/secure/lib/libcrypto/opensslconf-sparc64.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-sparc64.h head/secure/lib/libcrypto/opensslconf-x86.h.in - copied, changed from r304319, head/secure/lib/libcrypto/opensslconf-x86.h Deleted: head/secure/lib/libcrypto/opensslconf-aarch64.h head/secure/lib/libcrypto/opensslconf-arm.h head/secure/lib/libcrypto/opensslconf-mips.h head/secure/lib/libcrypto/opensslconf-powerpc.h head/secure/lib/libcrypto/opensslconf-riscv.h head/secure/lib/libcrypto/opensslconf-sparc64.h head/secure/lib/libcrypto/opensslconf-x86.h Modified: head/secure/lib/libcrypto/Makefile head/secure/lib/libcrypto/Makefile.asm head/secure/lib/libcrypto/Makefile.inc Modified: head/secure/lib/libcrypto/Makefile ============================================================================== --- head/secure/lib/libcrypto/Makefile Wed Aug 17 21:57:11 2016 (r304319) +++ head/secure/lib/libcrypto/Makefile Wed Aug 17 22:13:39 2016 (r304320) @@ -22,9 +22,9 @@ MAN+= config.5 des_modes.7 # base sources SRCS= cpt_err.c cryptlib.c cversion.c ex_data.c mem.c mem_dbg.c o_dir.c \ o_fips.c o_init.c o_str.c o_time.c uid.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= x86_64cpuid.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= x86cpuid.S .else SRCS+= mem_clr.c @@ -33,10 +33,10 @@ INCS+= crypto.h ebcdic.h opensslv.h ossl # aes SRCS+= aes_cfb.c aes_ctr.c aes_ecb.c aes_ige.c aes_misc.c aes_ofb.c aes_wrap.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= aes-x86_64.S aesni-mb-x86_64.S aesni-sha1-x86_64.S \ aesni-sha256-x86_64.S aesni-x86_64.S bsaes-x86_64.S vpaes-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= aes-586.S aesni-x86.S vpaes-x86.S .else SRCS+= aes_cbc.c aes_core.c @@ -60,7 +60,7 @@ INCS+= asn1.h asn1_mac.h asn1t.h # bf SRCS+= bf_cfb64.c bf_ecb.c bf_ofb64.c bf_skey.c -.if ${MACHINE_CPUARCH} == "i386" +.if defined(ASM_i386) .if ${MACHINE_CPU:Mi686} SRCS+= bf-686.S .else @@ -82,10 +82,10 @@ SRCS+= bn_add.c bn_blind.c bn_const.c bn bn_exp.c bn_exp2.c bn_gcd.c bn_gf2m.c bn_kron.c bn_lib.c bn_mod.c \ bn_mont.c bn_mpi.c bn_mul.c bn_nist.c bn_prime.c bn_print.c bn_rand.c \ bn_recp.c bn_shift.c bn_sqr.c bn_sqrt.c bn_word.c bn_x931p.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= rsaz-avx2.S rsaz-x86_64.S rsaz_exp.c x86_64-gcc.c x86_64-gf2m.S \ x86_64-mont.S x86_64-mont5.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= bn-586.S co-586.S x86-gf2m.S x86-mont.S .else SRCS+= bn_asm.c @@ -98,9 +98,9 @@ INCS+= buffer.h # camellia SRCS+= cmll_cfb.c cmll_ctr.c cmll_ecb.c cmll_ofb.c cmll_utl.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= cmll_misc.c cmll-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= cmll-x86.S .else SRCS+= camellia.c cmll_cbc.c cmll_misc.c @@ -135,7 +135,7 @@ SRCS+= cbc_cksm.c cbc_enc.c cfb64ede.c c des_old2.c ecb3_enc.c ecb_enc.c ede_cbcm_enc.c enc_read.c enc_writ.c \ fcrypt.c ofb64ede.c ofb64enc.c ofb_enc.c pcbc_enc.c qud_cksm.c \ rand_key.c read2pwd.c rpc_enc.c set_key.c str2key.c xcbc_enc.c -.if ${MACHINE_CPUARCH} == "i386" +.if defined(ASM_i386) SRCS+= crypt586.S des-586.S .else SRCS+= des_enc.c fcrypt_b.c @@ -161,7 +161,7 @@ SRCS+= ec2_mult.c ec2_oct.c ec2_smpl.c e ec_curve.c ec_cvt.c ec_err.c ec_key.c ec_lib.c ec_mult.c ec_oct.c \ ec_pmeth.c ec_print.c eck_prn.c ecp_mont.c ecp_nist.c ecp_oct.c \ ecp_smpl.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= ecp_nistz256.c ecp_nistz256-x86_64.S .endif INCS+= ec.h @@ -218,9 +218,9 @@ INCS+= md4.h # md5 SRCS+= md5_dgst.c md5_one.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= md5-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= md5-586.S .endif INCS+= md5.h @@ -232,9 +232,9 @@ INCS+= mdc2.h # modes SRCS+= cbc128.c ccm128.c cfb128.c ctr128.c cts128.c gcm128.c ofb128.c \ wrap128.c xts128.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= aesni-gcm-x86_64.S ghash-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= ghash-x86.S .endif INCS+= modes.h @@ -278,9 +278,9 @@ INCS+= rc2.h # rc4 SRCS+= rc4_utl.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= rc4-md5-x86_64.S rc4-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= rc4-586.S .else SRCS+= rc4_enc.c rc4_skey.c @@ -289,7 +289,7 @@ INCS+= rc4.h # rc5 SRCS+= rc5_ecb.c rc5_skey.c rc5cfb64.c rc5ofb64.c -.if ${MACHINE_CPUARCH} == "i386" +.if defined(ASM_i386) SRCS+= rc5-586.S .else SRCS+= rc5_enc.c @@ -298,7 +298,7 @@ INCS+= rc5.h # ripemd SRCS+= rmd_dgst.c rmd_one.c -.if ${MACHINE_CPUARCH} == "i386" +.if defined(ASM_i386) SRCS+= rmd-586.S .endif INCS+= ripemd.h @@ -316,10 +316,10 @@ INCS+= seed.h # sha SRCS+= sha1_one.c sha1dgst.c sha256.c sha512.c sha_dgst.c sha_one.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= sha1-mb-x86_64.S sha1-x86_64.S sha256-mb-x86_64.S sha256-x86_64.S \ sha512-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= sha1-586.S sha256-586.S sha512-586.S .endif INCS+= sha.h @@ -348,9 +348,9 @@ INCS+= ui.h ui_compat.h # whrlpool SRCS+= wp_dgst.c -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) SRCS+= wp-x86_64.S -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) SRCS+= wp-mmx.S wp_block.c .else SRCS+= wp_block.c @@ -389,13 +389,7 @@ CFLAGS+= -I${LCRYPTO_SRC}/crypto/modes ACFLAGS+= -Wa,--noexecstack .endif -.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" -OPENSSLCONF_H= opensslconf-x86.h -.else -OPENSSLCONF_H= opensslconf-${MACHINE_CPUARCH}.h -.endif - -CLEANFILES= buildinf.h opensslconf.h +CLEANFILES= buildinf.h opensslconf.h opensslconf.h.tmp buildinf.h: Makefile ( echo "#ifndef MK1MF_BUILD"; \ @@ -404,17 +398,21 @@ buildinf.h: Makefile echo " #define PLATFORM \"platform: FreeBSD-${MACHINE_ARCH}\""; \ echo "#endif" ) > ${.TARGET} -opensslconf.h: ${OPENSSLCONF_H} - ${CP} ${.ALLSRC} ${.TARGET} +opensslconf.h: opensslconf-${MACHINE_CPUARCH:C/^(amd64|i386)$/x86/}.h.in +.if defined(ASM_${MACHINE_CPUARCH}) + sed 's/%%ASM%%//; /%%NO_ASM%%/d' ${.ALLSRC} > ${.TARGET}.tmp +.else + sed '/%%ASM%%/d; s/%%NO_ASM%%//' ${.ALLSRC} > ${.TARGET}.tmp +.endif + ${CP} ${.TARGET}.tmp ${.TARGET} .include -.if ${MACHINE_CPUARCH} == "amd64" -_bn_asmpath= ${LCRYPTO_SRC}/crypto/bn/asm -.endif - -.if exists(${.CURDIR}/${MACHINE_CPUARCH}) +.if defined(ASM_${MACHINE_CPUARCH}) .PATH: ${.CURDIR}/${MACHINE_CPUARCH} +.if defined(ASM_amd64) +.PATH: ${LCRYPTO_SRC}/crypto/bn/asm +.endif .endif .PATH: ${LCRYPTO_SRC}/crypto \ @@ -423,7 +421,6 @@ _bn_asmpath= ${LCRYPTO_SRC}/crypto/bn/as ${LCRYPTO_SRC}/crypto/bf \ ${LCRYPTO_SRC}/crypto/bio \ ${LCRYPTO_SRC}/crypto/bn \ - ${_bn_asmpath} \ ${LCRYPTO_SRC}/crypto/buffer \ ${LCRYPTO_SRC}/crypto/camellia \ ${LCRYPTO_SRC}/crypto/cast \ Modified: head/secure/lib/libcrypto/Makefile.asm ============================================================================== --- head/secure/lib/libcrypto/Makefile.asm Wed Aug 17 21:57:11 2016 (r304319) +++ head/secure/lib/libcrypto/Makefile.asm Wed Aug 17 22:13:39 2016 (r304320) @@ -6,7 +6,7 @@ .include "Makefile.inc" -.if ${MACHINE_CPUARCH} == "amd64" +.if defined(ASM_amd64) .PATH: ${LCRYPTO_SRC}/crypto \ ${LCRYPTO_SRC}/crypto/aes/asm \ @@ -78,7 +78,7 @@ ${s}.S: ${s}.s cat ${s}.s ) > ${.TARGET} .endfor -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) .PATH: ${LCRYPTO_SRC}/crypto \ ${LCRYPTO_SRC}/crypto/aes/asm \ Modified: head/secure/lib/libcrypto/Makefile.inc ============================================================================== --- head/secure/lib/libcrypto/Makefile.inc Wed Aug 17 21:57:11 2016 (r304319) +++ head/secure/lib/libcrypto/Makefile.inc Wed Aug 17 22:13:39 2016 (r304320) @@ -21,7 +21,17 @@ CFLAGS+=-DL_ENDIAN CFLAGS+=-DB_ENDIAN .endif -.if ${MACHINE_CPUARCH} == "amd64" +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +_ASM_AVX!= { \ + echo vzeroall | \ + ${CC} -x assembler -o /dev/null -c - 2> /dev/null; \ + } && echo yes || echo no +.if ${_ASM_AVX} == yes +ASM_${MACHINE_CPUARCH}= +.endif +.endif + +.if defined(ASM_amd64) CFLAGS+=-DOPENSSL_IA32_SSE2 CFLAGS+=-DAES_ASM -DBSAES_ASM -DVPAES_ASM CFLAGS+=-DECP_NISTZ256_ASM @@ -30,7 +40,7 @@ CFLAGS+=-DMD5_ASM CFLAGS+=-DGHASH_ASM CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM CFLAGS+=-DWHIRLPOOL_ASM -.elif ${MACHINE_CPUARCH} == "i386" +.elif defined(ASM_i386) CFLAGS+=-DOPENSSL_IA32_SSE2 CFLAGS+=-DAES_ASM -DVPAES_ASM CFLAGS+=-DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m Copied and modified: head/secure/lib/libcrypto/opensslconf-aarch64.h.in (from r304319, head/secure/lib/libcrypto/opensslconf-aarch64.h) ============================================================================== --- head/secure/lib/libcrypto/opensslconf-aarch64.h Wed Aug 17 21:57:11 2016 (r304319, copy source) +++ head/secure/lib/libcrypto/opensslconf-aarch64.h.in Wed Aug 17 22:13:39 2016 (r304320) @@ -51,9 +51,9 @@ extern "C" { #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif -#ifndef OPENSSL_NO_ASM -# define OPENSSL_NO_ASM -#endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif #ifndef OPENSSL_NO_STATIC_ENGINE # define OPENSSL_NO_STATIC_ENGINE #endif @@ -101,6 +101,8 @@ extern "C" { # endif #endif +%%ASM%%#define OPENSSL_CPUID_OBJ +%%ASM%% /* crypto/opensslconf.h.in */ /* Generate 80386 code? */ Copied and modified: head/secure/lib/libcrypto/opensslconf-arm.h.in (from r304319, head/secure/lib/libcrypto/opensslconf-arm.h) ============================================================================== --- head/secure/lib/libcrypto/opensslconf-arm.h Wed Aug 17 21:57:11 2016 (r304319, copy source) +++ head/secure/lib/libcrypto/opensslconf-arm.h.in Wed Aug 17 22:13:39 2016 (r304320) @@ -51,9 +51,9 @@ extern "C" { #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif -#ifndef OPENSSL_NO_ASM -# define OPENSSL_NO_ASM -#endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif #ifndef OPENSSL_NO_STATIC_ENGINE # define OPENSSL_NO_STATIC_ENGINE #endif @@ -101,6 +101,8 @@ extern "C" { # endif #endif +%%ASM%%#define OPENSSL_CPUID_OBJ +%%ASM%% /* crypto/opensslconf.h.in */ /* Generate 80386 code? */ Copied and modified: head/secure/lib/libcrypto/opensslconf-mips.h.in (from r304319, head/secure/lib/libcrypto/opensslconf-mips.h) ============================================================================== --- head/secure/lib/libcrypto/opensslconf-mips.h Wed Aug 17 21:57:11 2016 (r304319, copy source) +++ head/secure/lib/libcrypto/opensslconf-mips.h.in Wed Aug 17 22:13:39 2016 (r304320) @@ -51,9 +51,9 @@ extern "C" { #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif -#ifndef OPENSSL_NO_ASM -# define OPENSSL_NO_ASM -#endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif #ifndef OPENSSL_NO_STATIC_ENGINE # define OPENSSL_NO_STATIC_ENGINE #endif Copied and modified: head/secure/lib/libcrypto/opensslconf-powerpc.h.in (from r304319, head/secure/lib/libcrypto/opensslconf-powerpc.h) ============================================================================== --- head/secure/lib/libcrypto/opensslconf-powerpc.h Wed Aug 17 21:57:11 2016 (r304319, copy source) +++ head/secure/lib/libcrypto/opensslconf-powerpc.h.in Wed Aug 17 22:13:39 2016 (r304320) @@ -51,9 +51,9 @@ extern "C" { #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif -#ifndef OPENSSL_NO_ASM -# define OPENSSL_NO_ASM -#endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif #ifndef OPENSSL_NO_STATIC_ENGINE # define OPENSSL_NO_STATIC_ENGINE #endif @@ -101,6 +101,8 @@ extern "C" { # endif #endif +%%ASM%%#define OPENSSL_CPUID_OBJ +%%ASM%% /* crypto/opensslconf.h.in */ /* Generate 80386 code? */ Copied and modified: head/secure/lib/libcrypto/opensslconf-riscv.h.in (from r304319, head/secure/lib/libcrypto/opensslconf-riscv.h) ============================================================================== --- head/secure/lib/libcrypto/opensslconf-riscv.h Wed Aug 17 21:57:11 2016 (r304319, copy source) +++ head/secure/lib/libcrypto/opensslconf-riscv.h.in Wed Aug 17 22:13:39 2016 (r304320) @@ -51,9 +51,9 @@ extern "C" { #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif -#ifndef OPENSSL_NO_ASM -# define OPENSSL_NO_ASM -#endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif #ifndef OPENSSL_NO_STATIC_ENGINE # define OPENSSL_NO_STATIC_ENGINE #endif Copied and modified: head/secure/lib/libcrypto/opensslconf-sparc64.h.in (from r304319, head/secure/lib/libcrypto/opensslconf-sparc64.h) ============================================================================== --- head/secure/lib/libcrypto/opensslconf-sparc64.h Wed Aug 17 21:57:11 2016 (r304319, copy source) +++ head/secure/lib/libcrypto/opensslconf-sparc64.h.in Wed Aug 17 22:13:39 2016 (r304320) @@ -51,9 +51,9 @@ extern "C" { #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif -#ifndef OPENSSL_NO_ASM -# define OPENSSL_NO_ASM -#endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif #ifndef OPENSSL_NO_STATIC_ENGINE # define OPENSSL_NO_STATIC_ENGINE #endif @@ -101,6 +101,8 @@ extern "C" { # endif #endif +%%ASM%%#define OPENSSL_CPUID_OBJ +%%ASM%% /* crypto/opensslconf.h.in */ /* Generate 80386 code? */ Copied and modified: head/secure/lib/libcrypto/opensslconf-x86.h.in (from r304319, head/secure/lib/libcrypto/opensslconf-x86.h) ============================================================================== --- head/secure/lib/libcrypto/opensslconf-x86.h Wed Aug 17 21:57:11 2016 (r304319, copy source) +++ head/secure/lib/libcrypto/opensslconf-x86.h.in Wed Aug 17 22:13:39 2016 (r304320) @@ -51,6 +51,9 @@ extern "C" { #ifndef OPENSSL_THREADS # define OPENSSL_THREADS #endif +%%NO_ASM%%#ifndef OPENSSL_NO_ASM +%%NO_ASM%%# define OPENSSL_NO_ASM +%%NO_ASM%%#endif #ifndef OPENSSL_NO_STATIC_ENGINE # define OPENSSL_NO_STATIC_ENGINE #endif @@ -98,8 +101,8 @@ extern "C" { # endif #endif -#define OPENSSL_CPUID_OBJ - +%%ASM%%#define OPENSSL_CPUID_OBJ +%%ASM%% /* crypto/opensslconf.h.in */ /* Generate 80386 code? */ From owner-svn-src-all@freebsd.org Thu Aug 18 00:37:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EB2ABBCBB5; Thu, 18 Aug 2016 00:37:10 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B56BD1B78; Thu, 18 Aug 2016 00:37:09 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I0b841095671; Thu, 18 Aug 2016 00:37:08 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I0b77A095653; Thu, 18 Aug 2016 00:37:07 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201608180037.u7I0b77A095653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 18 Aug 2016 00:37:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304321 - in head/sys: boot/efi/boot1 boot/efi/loader boot/i386/boot2 boot/i386/gptboot boot/i386/gptzfsboot boot/i386/zfsboot boot/userboot/ficl boot/userboot/userboot boot/userboot/zf... 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 00:37:10 -0000 Author: tsoome Date: Thu Aug 18 00:37:07 2016 New Revision: 304321 URL: https://svnweb.freebsd.org/changeset/base/304321 Log: Add SHA512, skein, large blocks support for loader zfs. Updated sha512 from illumos. Using skein from freebsd crypto tree. Since loader itself is using 64MB memory for heap, updated zfsboot to use same, and this also allows to support zfs large blocks. Note, adding additional features does increate zfsboot code, therefore this update does increase zfsboot code to 128k, also I have ported gptldr.S update to zfsldr.S to support 64k+ code. With this update, boot1.efi has almost reached the current limit of the size set for it, so one of the future patches for boot1.efi will need to increase the limit. Currently known missing zfs features in boot loader are edonr and gzip support. Reviewed by: delphij, imp Approved by: imp (mentor) Obtained from: sha256.c update and skein_zfs.c stub from illumos. Differential Revision: https://reviews.freebsd.org/D7418 Added: head/sys/cddl/boot/zfs/skein_zfs.c (contents, props changed) Modified: head/sys/boot/efi/boot1/Makefile head/sys/boot/efi/loader/Makefile head/sys/boot/i386/boot2/Makefile head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptboot/gptldr.S head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/zfsboot/Makefile head/sys/boot/i386/zfsboot/zfsboot.c head/sys/boot/i386/zfsboot/zfsldr.S head/sys/boot/userboot/ficl/Makefile head/sys/boot/userboot/userboot/Makefile head/sys/boot/userboot/zfs/Makefile head/sys/boot/zfs/Makefile head/sys/boot/zfs/zfsimpl.c head/sys/cddl/boot/zfs/fletcher.c head/sys/cddl/boot/zfs/sha256.c head/sys/cddl/boot/zfs/zfsimpl.h head/sys/cddl/boot/zfs/zfssubr.c Modified: head/sys/boot/efi/boot1/Makefile ============================================================================== --- head/sys/boot/efi/boot1/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/efi/boot1/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -19,12 +19,16 @@ CWARNFLAGS.zfs_module.c += -Wno-missing- CWARNFLAGS.zfs_module.c += -Wno-sign-compare CWARNFLAGS.zfs_module.c += -Wno-unused-parameter CWARNFLAGS.zfs_module.c += -Wno-unused-function +CWARNFLAGS.skein.c += -Wno-cast-align +CWARNFLAGS.skein.c += -Wno-missing-variable-declarations .endif # architecture-specific loader code SRCS= boot1.c self_reloc.c start.S ufs_module.c .if ${MK_ZFS} != "no" SRCS+= zfs_module.c +SRCS+= skein.c skein_block.c +.PATH: ${.CURDIR}/../../../crypto/skein .endif CFLAGS+= -I. @@ -40,6 +44,7 @@ CFLAGS+= -DEFI_DEBUG .if ${MK_ZFS} != "no" CFLAGS+= -I${.CURDIR}/../../zfs/ CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs/ +CFLAGS+= -I${.CURDIR}/../../../crypto/skein CFLAGS+= -DEFI_ZFS_BOOT .endif Modified: head/sys/boot/efi/loader/Makefile ============================================================================== --- head/sys/boot/efi/loader/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/efi/loader/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -24,6 +24,8 @@ SRCS= autoload.c \ .if ${MK_ZFS} != "no" SRCS+= zfs.c .PATH: ${.CURDIR}/../../zfs +SRCS+= skein.c skein_block.c +.PATH: ${.CURDIR}/../../../crypto/skein # Disable warnings that are currently incompatible with the zfs boot code CWARNFLAGS.zfs.c+= -Wno-sign-compare @@ -53,6 +55,7 @@ CFLAGS+= -I${.CURDIR}/../../i386/libi386 .if ${MK_ZFS} != "no" CFLAGS+= -I${.CURDIR}/../../zfs CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +CFLAGS+= -I${.CURDIR}/../../../crypto/skein CFLAGS+= -DEFI_ZFS_BOOT .endif CFLAGS+= -DNO_PCI -DEFI Modified: head/sys/boot/i386/boot2/Makefile ============================================================================== --- head/sys/boot/i386/boot2/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/boot2/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -33,7 +33,7 @@ CFLAGS= -fomit-frame-pointer \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${.CURDIR}/../../common \ -I${.CURDIR}/../btx/lib -I. \ - -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/gptboot/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -32,10 +32,10 @@ CFLAGS= -DBOOTPROG=\"gptboot\" \ -I${.CURDIR}/../btx/lib -I. \ -I${.CURDIR}/../boot2 \ -I${.CURDIR}/../../.. \ - -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline + -Winline -Wno-pointer-sign CFLAGS.gcc+= --param max-inline-insns-single=100 Modified: head/sys/boot/i386/gptboot/gptldr.S ============================================================================== --- head/sys/boot/i386/gptboot/gptldr.S Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/gptboot/gptldr.S Thu Aug 18 00:37:07 2016 (r304321) @@ -45,7 +45,7 @@ /* Misc. Constants */ .set SIZ_PAG,0x1000 # Page size .set SIZ_SEC,0x200 # Sector size - .set COPY_BLKS,0x4 # Number of blocks + .set COPY_BLKS,0x8 # Number of blocks # to copy for boot2 .set COPY_BLK_SZ,0x8000 # Copy in 32k blocks; must be # a multiple of 16 bytes Modified: head/sys/boot/i386/gptzfsboot/Makefile ============================================================================== --- head/sys/boot/i386/gptzfsboot/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/gptzfsboot/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -2,7 +2,7 @@ .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../gptboot \ ${.CURDIR}/../zfsboot ${.CURDIR}/../common \ - ${.CURDIR}/../../common + ${.CURDIR}/../../common ${.CURDIR}/../../../crypto/skein FILES= gptzfsboot MAN= gptzfsboot.8 @@ -27,13 +27,14 @@ CFLAGS= -DBOOTPROG=\"gptzfsboot\" \ -I${.CURDIR}/../common \ -I${.CURDIR}/../../zfs \ -I${.CURDIR}/../../../cddl/boot/zfs \ + -I${.CURDIR}/../../../crypto/skein \ -I${.CURDIR}/../btx/lib -I. \ -I${.CURDIR}/../boot2 \ -I${.CURDIR}/../../.. \ - -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ - -Winline + -Winline -Wno-tentative-definition-incomplete-type -Wno-pointer-sign .if !defined(LOADER_NO_GELI_SUPPORT) CFLAGS+= -DLOADER_GELI_SUPPORT @@ -67,12 +68,13 @@ gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \ - drv.o gpt.o util.o ${OPENCRYPTO_XTS} + drv.o gpt.o util.o skein.o skein_block.o ${OPENCRYPTO_XTS} gptzfsboot.bin: gptzfsboot.out ${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET} -gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o ${OPENCRYPTO_XTS} +gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o \ + skein.o skein_block.o ${OPENCRYPTO_XTS} ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} ${LIBGELIBOOT} zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c Modified: head/sys/boot/i386/zfsboot/Makefile ============================================================================== --- head/sys/boot/i386/zfsboot/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/zfsboot/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -1,6 +1,7 @@ # $FreeBSD$ -.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common ${.CURDIR}/../../common +.PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../common \ + ${.CURDIR}/../../common ${.CURDIR}/../../../crypto/skein FILES= zfsboot MAN= zfsboot.8 @@ -25,9 +26,10 @@ CFLAGS= -DBOOTPROG=\"zfsboot\" \ -I${.CURDIR}/../common \ -I${.CURDIR}/../../zfs \ -I${.CURDIR}/../../../cddl/boot/zfs \ + -I${.CURDIR}/../../../crypto/skein \ -I${.CURDIR}/../btx/lib -I. \ -I${.CURDIR}/../boot2 \ - -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ + -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Winline @@ -55,12 +57,13 @@ zfsldr.out: zfsldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o CLEANFILES+= zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \ - zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o util.o + zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o util.o \ + skein.o skein_block.o -# We currently allow 65536 bytes for zfsboot - in practice it could be +# We currently allow 128k bytes for zfsboot - in practice it could be # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr. # -BOOT2SIZE= 65536 +BOOT2SIZE= 131072 zfsboot2: zfsboot.ld @set -- `ls -l zfsboot.ld`; x=$$((${BOOT2SIZE}-$$5)); \ @@ -77,7 +80,7 @@ zfsboot.ldr: zfsboot.bin: zfsboot.out ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET} -zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o +zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o util.o skein.o skein_block.o ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} SRCS= zfsboot.c Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/zfsboot/zfsboot.c Thu Aug 18 00:37:07 2016 (r304321) @@ -105,7 +105,7 @@ static struct bios_smap smap; /* * The minimum amount of memory to reserve in bios_extmem for the heap. */ -#define HEAP_MIN (3 * 1024 * 1024) +#define HEAP_MIN (64 * 1024 * 1024) static char *heap_next; static char *heap_end; Modified: head/sys/boot/i386/zfsboot/zfsldr.S ============================================================================== --- head/sys/boot/i386/zfsboot/zfsldr.S Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/i386/zfsboot/zfsldr.S Thu Aug 18 00:37:07 2016 (r304321) @@ -32,8 +32,11 @@ /* Misc. Constants */ .set SIZ_PAG,0x1000 # Page size .set SIZ_SEC,0x200 # Sector size - - .set NSECT,0x80 + .set COPY_BLKS,0x8 # Number of blocks + # to copy for boot2 + .set COPY_BLK_SZ,0x8000 # Copy in 32k blocks; must be + # a multiple of 16 bytes + .set NSECT,(COPY_BLK_SZ / SIZ_SEC * COPY_BLKS) .globl start .code16 @@ -88,12 +91,12 @@ main.3: add $0x10,%si # Next entry /* * Ok, we have a slice and drive in %dx now, so use that to locate and * load boot2. %si references the start of the slice we are looking - * for, so go ahead and load up the 128 sectors starting at sector 1024 - * (i.e. after the two vdev labels). We don't have do anything fancy - * here to allow for an extra copy of boot1 and a partition table - * (compare to this section of the UFS bootstrap) so we just load it - * all at 0x9000. The first part of boot2 is BTX, which wants to run - * at 0x9000. The boot2.bin binary starts right after the end of BTX, + * for, so go ahead and load up the COPY_BLKS*COPY_BLK_SZ/SIZ_SEC sectors + * starting at sector 1024 (i.e. after the two vdev labels). We don't + * have do anything fancy here to allow for an extra copy of boot1 and + * a partition table (compare to this section of the UFS bootstrap) so we + * just load it all at 0x9000. The first part of boot2 is BTX, which wants + * to run at 0x9000. The boot2.bin binary starts right after the end of BTX, * so we have to figure out where the start of it is and then move the * binary to 0xc000. Normally, BTX clients start at MEM_USR, or 0xa000, * but when we use btxld to create zfsboot2, we use an entry point of @@ -116,23 +119,37 @@ main.6: pushal # Save params incl %eax # Advance to add $SIZ_SEC,%ebx # next sector loop main.6 # If not last, read another - mov MEM_BTX+0xa,%bx # Get BTX length - mov $NSECT*SIZ_SEC-1,%di # Size of load area (less one) - mov %di,%si # End of load area, 0x9000 rel - sub %bx,%di # End of client, 0xc000 rel - mov %di,%cx # Size of - inc %cx # client - mov $(MEM_BTX)>>4,%dx # Segment - mov %dx,%ds # addressing 0x9000 - mov $(MEM_USR+2*SIZ_PAG)>>4,%dx # Segment - mov %dx,%es # addressing 0xc000 - std # Move with decrement - rep # Relocate - movsb # client + + mov $MEM_BTX,%bx # BTX + mov 0xa(%bx),%si # Get BTX length and set + add %bx,%si # %si to start of boot2 + dec %si # Set %ds:%si to point at the + mov %si,%ax # last byte we want to copy + shr $4,%ax # from boot2, with %si made as + add $(COPY_BLKS*COPY_BLK_SZ/16),%ax # small as possible. + and $0xf,%si # + mov %ax,%ds # + mov $(MEM_USR+2*SIZ_PAG)/16,%ax # Set %es:(-1) to point at + add $(COPY_BLKS*COPY_BLK_SZ/16),%ax # the last byte we + mov %ax,%es # want to copy boot2 into. + mov $COPY_BLKS,%bx # Copy COPY_BLKS 32k blocks +copyloop: + add $COPY_BLK_SZ,%si # Adjust %ds:%si to point at + mov %ds,%ax # the end of the next 32k to + sub $COPY_BLK_SZ/16,%ax # copy from boot2 + mov %ax,%ds + mov $COPY_BLK_SZ-1,%di # Adjust %es:%di to point at + mov %es,%ax # the end of the next 32k into + sub $COPY_BLK_SZ/16,%ax # which we want boot2 copied + mov %ax,%es + mov $COPY_BLK_SZ,%cx # Copy 32k + std + rep movsb + dec %bx + jnz copyloop + mov %cx,%ds # Reset %ds and %es + mov %cx,%es cld # Back to increment - xor %dx,%dx # Back - mov %ds,%dx # to zero - mov %dx,%es # segment /* * Enable A20 so we can access memory above 1 meg. Modified: head/sys/boot/userboot/ficl/Makefile ============================================================================== --- head/sys/boot/userboot/ficl/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/userboot/ficl/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -10,6 +10,9 @@ BASE_SRCS= dict.c ficl.c fileaccess.c fl SRCS= ${BASE_SRCS} sysdep.c softcore.c CLEANFILES= softcore.c testmain testmain.o + +CWARNFLAGS.loader.c.c += -Wno-implicit-function-declaration + .if HAVE_PNP CFLAGS+= -DHAVE_PNP .endif Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/userboot/userboot/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -35,6 +35,8 @@ CFLAGS+= -I${.CURDIR}/../../.. CFLAGS+= -I${.CURDIR}/../../../../lib/libstand CFLAGS+= -ffreestanding -I. +CWARNFLAGS.main.c += -Wno-implicit-function-declaration + LDFLAGS+= -nostdlib -Wl,-Bsymbolic NEWVERSWHAT= "User boot" ${MACHINE_CPUARCH} Modified: head/sys/boot/userboot/zfs/Makefile ============================================================================== --- head/sys/boot/userboot/zfs/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/userboot/zfs/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -2,15 +2,16 @@ S= ${.CURDIR}/../../zfs -.PATH: ${S} +.PATH: ${S} ${.CURDIR}/../../../crypto/skein LIB= zfsboot INTERNALLIB= -SRCS+= zfs.c +SRCS+= zfs.c skein.c skein_block.c CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../../.. -I. CFLAGS+= -I${.CURDIR}/../../../../lib/libstand CFLAGS+= -I${.CURDIR}/../../../cddl/boot/zfs +CFLAGS+= -I${.CURDIR}/../../../crypto/skein CFLAGS+= -ffreestanding -fPIC CFLAGS+= -Wformat -Wall Modified: head/sys/boot/zfs/Makefile ============================================================================== --- head/sys/boot/zfs/Makefile Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/zfs/Makefile Thu Aug 18 00:37:07 2016 (r304321) @@ -5,10 +5,14 @@ INTERNALLIB= SRCS+= zfs.c +SRCS+= skein.c skein_block.c +.PATH: ${.CURDIR}/../../crypto/skein + CFLAGS+= -DBOOTPROG=\"zfsloader\" CFLAGS+= -I${.CURDIR}/../common -I${.CURDIR}/../.. -I. CFLAGS+= -I${.CURDIR}/../../../lib/libstand CFLAGS+= -I${.CURDIR}/../../cddl/boot/zfs +CFLAGS+= -I${.CURDIR}/../../crypto/skein .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -march=i386 Modified: head/sys/boot/zfs/zfsimpl.c ============================================================================== --- head/sys/boot/zfs/zfsimpl.c Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/boot/zfs/zfsimpl.c Thu Aug 18 00:37:07 2016 (r304321) @@ -58,6 +58,8 @@ static const char *features_for_read[] = "com.delphix:extensible_dataset", "com.delphix:embedded_data", "org.open-zfs:large_blocks", + "org.illumos:sha512", + "org.illumos:skein", NULL }; @@ -78,6 +80,9 @@ static char *zfs_temp_buf, *zfs_temp_end static int zio_read(const spa_t *spa, const blkptr_t *bp, void *buf); static int zfs_get_root(const spa_t *spa, uint64_t *objid); static int zfs_rlookup(const spa_t *spa, uint64_t objnum, char *result); +static int zap_lookup(const spa_t *spa, const dnode_phys_t *dnode, + const char *name, uint64_t integer_size, uint64_t num_integers, + void *value); static void zfs_init(void) @@ -420,7 +425,7 @@ vdev_read_phys(vdev_t *vdev, const blkpt rc = vdev->v_phys_read(vdev, vdev->v_read_priv, offset, buf, psize); if (rc) return (rc); - if (bp && zio_checksum_verify(bp, buf)) + if (bp && zio_checksum_verify(vdev->spa, bp, buf)) return (EIO); return (0); @@ -1074,6 +1079,7 @@ vdev_probe(vdev_phys_read_t *read, void } zfs_free(upbuf, VDEV_UBERBLOCK_SIZE(vdev)); + vdev->spa = spa; if (spap) *spap = spa; return (0); @@ -1122,7 +1128,7 @@ zio_read_gang(const spa_t *spa, const bl pbuf += BP_GET_PSIZE(gbp); } - if (zio_checksum_verify(bp, buf)) + if (zio_checksum_verify(spa, bp, buf)) return (EIO); return (0); } @@ -1224,7 +1230,8 @@ dnode_read(const spa_t *spa, const dnode int i, rc; if (bsize > SPA_MAXBLOCKSIZE) { - printf("ZFS: I/O error - blocks larger than 128K are not supported\n"); + printf("ZFS: I/O error - blocks larger than %llu are not " + "supported\n", SPA_MAXBLOCKSIZE); return (EIO); } @@ -1364,12 +1371,73 @@ fzap_leaf_value(const zap_leaf_t *zl, co return value; } +static void +stv(int len, void *addr, uint64_t value) +{ + switch (len) { + case 1: + *(uint8_t *)addr = value; + return; + case 2: + *(uint16_t *)addr = value; + return; + case 4: + *(uint32_t *)addr = value; + return; + case 8: + *(uint64_t *)addr = value; + return; + } +} + +/* + * Extract a array from a zap leaf entry. + */ +static void +fzap_leaf_array(const zap_leaf_t *zl, const zap_leaf_chunk_t *zc, + uint64_t integer_size, uint64_t num_integers, void *buf) +{ + uint64_t array_int_len = zc->l_entry.le_value_intlen; + uint64_t value = 0; + uint64_t *u64 = buf; + char *p = buf; + int len = MIN(zc->l_entry.le_value_numints, num_integers); + int chunk = zc->l_entry.le_value_chunk; + int byten = 0; + + if (integer_size == 8 && len == 1) { + *u64 = fzap_leaf_value(zl, zc); + return; + } + + while (len > 0) { + struct zap_leaf_array *la = &ZAP_LEAF_CHUNK(zl, chunk).l_array; + int i; + + ASSERT3U(chunk, <, ZAP_LEAF_NUMCHUNKS(zl)); + for (i = 0; i < ZAP_LEAF_ARRAY_BYTES && len > 0; i++) { + value = (value << 8) | la->la_array[i]; + byten++; + if (byten == array_int_len) { + stv(integer_size, p, value); + byten = 0; + len--; + if (len == 0) + return; + p += integer_size; + } + } + chunk = la->la_next; + } +} + /* * Lookup a value in a fatzap directory. Assumes that the zap scratch * buffer contains the directory header. */ static int -fzap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) +fzap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, + uint64_t integer_size, uint64_t num_integers, void *value) { int bsize = dnode->dn_datablkszsec << SPA_MINBLOCKSHIFT; zap_phys_t zh = *(zap_phys_t *) zap_scratch; @@ -1436,9 +1504,10 @@ fzap_lookup(const spa_t *spa, const dnod zc = &ZAP_LEAF_CHUNK(&zl, zc->l_entry.le_next); } if (fzap_name_equal(&zl, zc, name)) { - if (zc->l_entry.le_value_intlen * zc->l_entry.le_value_numints > 8) + if (zc->l_entry.le_value_intlen * zc->l_entry.le_value_numints > + integer_size * num_integers) return (E2BIG); - *value = fzap_leaf_value(&zl, zc); + fzap_leaf_array(&zl, zc, integer_size, num_integers, value); return (0); } @@ -1449,7 +1518,8 @@ fzap_lookup(const spa_t *spa, const dnod * Lookup a name in a zap object and return its value as a uint64_t. */ static int -zap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, uint64_t *value) +zap_lookup(const spa_t *spa, const dnode_phys_t *dnode, const char *name, + uint64_t integer_size, uint64_t num_integers, void *value) { int rc; uint64_t zap_type; @@ -1462,8 +1532,10 @@ zap_lookup(const spa_t *spa, const dnode zap_type = *(uint64_t *) zap_scratch; if (zap_type == ZBT_MICRO) return mzap_lookup(dnode, name, value); - else if (zap_type == ZBT_HEADER) - return fzap_lookup(spa, dnode, name, value); + else if (zap_type == ZBT_HEADER) { + return fzap_lookup(spa, dnode, name, integer_size, + num_integers, value); + } printf("ZFS: invalid zap_type=%d\n", (int)zap_type); return (EIO); } @@ -1802,7 +1874,8 @@ zfs_lookup_dataset(const spa_t *spa, con if (objset_get_dnode(spa, &spa->spa_mos, DMU_POOL_DIRECTORY_OBJECT, &dir)) return (EIO); - if (zap_lookup(spa, &dir, DMU_POOL_ROOT_DATASET, &dir_obj)) + if (zap_lookup(spa, &dir, DMU_POOL_ROOT_DATASET, sizeof (dir_obj), + 1, &dir_obj)) return (EIO); p = name; @@ -1832,7 +1905,8 @@ zfs_lookup_dataset(const spa_t *spa, con return (EIO); /* Actual loop condition #2. */ - if (zap_lookup(spa, &child_dir_zap, element, &dir_obj) != 0) + if (zap_lookup(spa, &child_dir_zap, element, sizeof (dir_obj), + 1, &dir_obj) != 0) return (ENOENT); } @@ -1962,9 +2036,9 @@ zfs_get_root(const spa_t *spa, uint64_t /* * Lookup the pool_props and see if we can find a bootfs. */ - if (zap_lookup(spa, &dir, DMU_POOL_PROPS, &props) == 0 + if (zap_lookup(spa, &dir, DMU_POOL_PROPS, sizeof (props), 1, &props) == 0 && objset_get_dnode(spa, &spa->spa_mos, props, &propdir) == 0 - && zap_lookup(spa, &propdir, "bootfs", &bootfs) == 0 + && zap_lookup(spa, &propdir, "bootfs", sizeof (bootfs), 1, &bootfs) == 0 && bootfs != 0) { *objid = bootfs; @@ -1973,7 +2047,7 @@ zfs_get_root(const spa_t *spa, uint64_t /* * Lookup the root dataset directory */ - if (zap_lookup(spa, &dir, DMU_POOL_ROOT_DATASET, &root) + if (zap_lookup(spa, &dir, DMU_POOL_ROOT_DATASET, sizeof (root), 1, &root) || objset_get_dnode(spa, &spa->spa_mos, root, &dir)) { printf("ZFS: can't find root dsl_dir\n"); return (EIO); @@ -2047,7 +2121,8 @@ check_mos_features(const spa_t *spa) if ((rc = objset_get_dnode(spa, &spa->spa_mos, DMU_OT_OBJECT_DIRECTORY, &dir)) != 0) return (rc); - if ((rc = zap_lookup(spa, &dir, DMU_POOL_FEATURES_FOR_READ, &objnum)) != 0) + if ((rc = zap_lookup(spa, &dir, DMU_POOL_FEATURES_FOR_READ, + sizeof (objnum), 1, &objnum)) != 0) return (rc); if ((rc = objset_get_dnode(spa, &spa->spa_mos, objnum, &dir)) != 0) @@ -2072,6 +2147,7 @@ check_mos_features(const spa_t *spa) static int zfs_spa_init(spa_t *spa) { + dnode_phys_t dir; int rc; if (zio_read(spa, &spa->spa_uberblock.ub_rootbp, &spa->spa_mos)) { @@ -2083,6 +2159,17 @@ zfs_spa_init(spa_t *spa) return (EIO); } + if (objset_get_dnode(spa, &spa->spa_mos, DMU_POOL_DIRECTORY_OBJECT, + &dir)) { + printf("ZFS: failed to read pool %s directory object\n", + spa->spa_name); + return (EIO); + } + /* this is allowed to fail, older pools do not have salt */ + rc = zap_lookup(spa, &dir, DMU_POOL_CHECKSUM_SALT, 1, + sizeof (spa->spa_cksum_salt.zcs_bytes), + spa->spa_cksum_salt.zcs_bytes); + rc = check_mos_features(spa); if (rc != 0) { printf("ZFS: pool %s is not supported\n", spa->spa_name); @@ -2173,7 +2260,7 @@ zfs_lookup(const struct zfsmount *mount, if (rc) return (rc); - rc = zap_lookup(spa, &dn, ZFS_ROOT_OBJ, &rootnum); + rc = zap_lookup(spa, &dn, ZFS_ROOT_OBJ, sizeof (rootnum), 1, &rootnum); if (rc) return (rc); @@ -2205,7 +2292,7 @@ zfs_lookup(const struct zfsmount *mount, return (ENOTDIR); parentnum = objnum; - rc = zap_lookup(spa, &dn, element, &objnum); + rc = zap_lookup(spa, &dn, element, sizeof (objnum), 1, &objnum); if (rc) return (rc); objnum = ZFS_DIRENT_OBJ(objnum); Modified: head/sys/cddl/boot/zfs/fletcher.c ============================================================================== --- head/sys/cddl/boot/zfs/fletcher.c Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/cddl/boot/zfs/fletcher.c Thu Aug 18 00:37:07 2016 (r304321) @@ -23,10 +23,9 @@ * Use is subject to license terms. */ -/*#pragma ident "%Z%%M% %I% %E% SMI"*/ - static void -fletcher_2_native(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_2_native(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) { const uint64_t *ip = buf; const uint64_t *ipend = ip + (size / sizeof (uint64_t)); @@ -43,7 +42,8 @@ fletcher_2_native(const void *buf, uint6 } static void -fletcher_2_byteswap(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_2_byteswap(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) { const uint64_t *ip = buf; const uint64_t *ipend = ip + (size / sizeof (uint64_t)); @@ -60,7 +60,8 @@ fletcher_2_byteswap(const void *buf, uin } static void -fletcher_4_native(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_4_native(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) { const uint32_t *ip = buf; const uint32_t *ipend = ip + (size / sizeof (uint32_t)); @@ -77,7 +78,8 @@ fletcher_4_native(const void *buf, uint6 } static void -fletcher_4_byteswap(const void *buf, uint64_t size, zio_cksum_t *zcp) +fletcher_4_byteswap(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) { const uint32_t *ip = buf; const uint32_t *ipend = ip + (size / sizeof (uint32_t)); Modified: head/sys/cddl/boot/zfs/sha256.c ============================================================================== --- head/sys/cddl/boot/zfs/sha256.c Wed Aug 17 22:13:39 2016 (r304320) +++ head/sys/cddl/boot/zfs/sha256.c Thu Aug 18 00:37:07 2016 (r304321) @@ -23,19 +23,21 @@ * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ - -/*#pragma ident "%Z%%M% %I% %E% SMI"*/ +/* + * Copyright 2013 Saso Kiselkov. All rights reserved. + * Copyright 2015 Toomas Soome + */ /* - * SHA-256 checksum, as specified in FIPS 180-2, available at: + * SHA-256 and SHA-512/256 hashes, as specified in FIPS 180-4, available at: * http://csrc.nist.gov/cryptval * - * This is a very compact implementation of SHA-256. + * This is a very compact implementation of SHA-256 and SHA-512/256. * It is designed to be simple and portable, not to be fast. */ /* - * The literal definitions according to FIPS180-2 would be: + * The literal definitions according to FIPS180-4 would be: * * Ch(x, y, z) (((x) & (y)) ^ ((~(x)) & (z))) * Maj(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) @@ -44,12 +46,21 @@ */ #define Ch(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) #define Maj(x, y, z) (((x) & (y)) ^ ((z) & ((x) ^ (y)))) -#define Rot32(x, s) (((x) >> s) | ((x) << (32 - s))) -#define SIGMA0(x) (Rot32(x, 2) ^ Rot32(x, 13) ^ Rot32(x, 22)) -#define SIGMA1(x) (Rot32(x, 6) ^ Rot32(x, 11) ^ Rot32(x, 25)) -#define sigma0(x) (Rot32(x, 7) ^ Rot32(x, 18) ^ ((x) >> 3)) -#define sigma1(x) (Rot32(x, 17) ^ Rot32(x, 19) ^ ((x) >> 10)) +#define ROTR(x, n) (((x) >> (n)) | ((x) << ((sizeof (x) * NBBY)-(n)))) + +/* SHA-224/256 operations */ +#define BIGSIGMA0_256(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) +#define BIGSIGMA1_256(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) +#define SIGMA0_256(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ ((x) >> 3)) +#define SIGMA1_256(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ ((x) >> 10)) + +/* SHA-384/512 operations */ +#define BIGSIGMA0_512(x) (ROTR((x), 28) ^ ROTR((x), 34) ^ ROTR((x), 39)) +#define BIGSIGMA1_512(x) (ROTR((x), 14) ^ ROTR((x), 18) ^ ROTR((x), 41)) +#define SIGMA0_512(x) (ROTR((x), 1) ^ ROTR((x), 8) ^ ((x) >> 7)) +#define SIGMA1_512(x) (ROTR((x), 19) ^ ROTR((x), 61) ^ ((x) >> 6)) +/* SHA-256 round constants */ static const uint32_t SHA256_K[64] = { 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, @@ -69,46 +80,134 @@ static const uint32_t SHA256_K[64] = { 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 }; +/* SHA-512 round constants */ +static const uint64_t SHA512_K[80] = { + 0x428A2F98D728AE22ULL, 0x7137449123EF65CDULL, + 0xB5C0FBCFEC4D3B2FULL, 0xE9B5DBA58189DBBCULL, + 0x3956C25BF348B538ULL, 0x59F111F1B605D019ULL, + 0x923F82A4AF194F9BULL, 0xAB1C5ED5DA6D8118ULL, + 0xD807AA98A3030242ULL, 0x12835B0145706FBEULL, + 0x243185BE4EE4B28CULL, 0x550C7DC3D5FFB4E2ULL, + 0x72BE5D74F27B896FULL, 0x80DEB1FE3B1696B1ULL, + 0x9BDC06A725C71235ULL, 0xC19BF174CF692694ULL, + 0xE49B69C19EF14AD2ULL, 0xEFBE4786384F25E3ULL, + 0x0FC19DC68B8CD5B5ULL, 0x240CA1CC77AC9C65ULL, + 0x2DE92C6F592B0275ULL, 0x4A7484AA6EA6E483ULL, + 0x5CB0A9DCBD41FBD4ULL, 0x76F988DA831153B5ULL, + 0x983E5152EE66DFABULL, 0xA831C66D2DB43210ULL, + 0xB00327C898FB213FULL, 0xBF597FC7BEEF0EE4ULL, + 0xC6E00BF33DA88FC2ULL, 0xD5A79147930AA725ULL, + 0x06CA6351E003826FULL, 0x142929670A0E6E70ULL, + 0x27B70A8546D22FFCULL, 0x2E1B21385C26C926ULL, + 0x4D2C6DFC5AC42AEDULL, 0x53380D139D95B3DFULL, + 0x650A73548BAF63DEULL, 0x766A0ABB3C77B2A8ULL, + 0x81C2C92E47EDAEE6ULL, 0x92722C851482353BULL, + 0xA2BFE8A14CF10364ULL, 0xA81A664BBC423001ULL, + 0xC24B8B70D0F89791ULL, 0xC76C51A30654BE30ULL, + 0xD192E819D6EF5218ULL, 0xD69906245565A910ULL, + 0xF40E35855771202AULL, 0x106AA07032BBD1B8ULL, + 0x19A4C116B8D2D0C8ULL, 0x1E376C085141AB53ULL, + 0x2748774CDF8EEB99ULL, 0x34B0BCB5E19B48A8ULL, + 0x391C0CB3C5C95A63ULL, 0x4ED8AA4AE3418ACBULL, + 0x5B9CCA4F7763E373ULL, 0x682E6FF3D6B2B8A3ULL, + 0x748F82EE5DEFB2FCULL, 0x78A5636F43172F60ULL, + 0x84C87814A1F0AB72ULL, 0x8CC702081A6439ECULL, + 0x90BEFFFA23631E28ULL, 0xA4506CEBDE82BDE9ULL, + 0xBEF9A3F7B2C67915ULL, 0xC67178F2E372532BULL, + 0xCA273ECEEA26619CULL, 0xD186B8C721C0C207ULL, + 0xEADA7DD6CDE0EB1EULL, 0xF57D4F7FEE6ED178ULL, + 0x06F067AA72176FBAULL, 0x0A637DC5A2C898A6ULL, + 0x113F9804BEF90DAEULL, 0x1B710B35131C471BULL, + 0x28DB77F523047D84ULL, 0x32CAAB7B40C72493ULL, + 0x3C9EBE0A15C9BEBCULL, 0x431D67C49C100D4CULL, + 0x4CC5D4BECB3E42B6ULL, 0x597F299CFC657E2AULL, + 0x5FCB6FAB3AD6FAECULL, 0x6C44198C4A475817ULL +}; + static void SHA256Transform(uint32_t *H, const uint8_t *cp) { uint32_t a, b, c, d, e, f, g, h, t, T1, T2, W[64]; - for (t = 0; t < 16; t++, cp += 4) + /* copy chunk into the first 16 words of the message schedule */ + for (t = 0; t < 16; t++, cp += sizeof (uint32_t)) W[t] = (cp[0] << 24) | (cp[1] << 16) | (cp[2] << 8) | cp[3]; + /* extend the first 16 words into the remaining 48 words */ for (t = 16; t < 64; t++) - W[t] = sigma1(W[t - 2]) + W[t - 7] + - sigma0(W[t - 15]) + W[t - 16]; + W[t] = SIGMA1_256(W[t - 2]) + W[t - 7] + + SIGMA0_256(W[t - 15]) + W[t - 16]; + /* init working variables to the current hash value */ a = H[0]; b = H[1]; c = H[2]; d = H[3]; e = H[4]; f = H[5]; g = H[6]; h = H[7]; + /* iterate the compression function for all rounds of the hash */ for (t = 0; t < 64; t++) { - T1 = h + SIGMA1(e) + Ch(e, f, g) + SHA256_K[t] + W[t]; - T2 = SIGMA0(a) + Maj(a, b, c); + T1 = h + BIGSIGMA1_256(e) + Ch(e, f, g) + SHA256_K[t] + W[t]; + T2 = BIGSIGMA0_256(a) + Maj(a, b, c); h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2; } + /* add the compressed chunk to the current hash value */ H[0] += a; H[1] += b; H[2] += c; H[3] += d; H[4] += e; H[5] += f; H[6] += g; H[7] += h; } static void -zio_checksum_SHA256(const void *buf, uint64_t size, zio_cksum_t *zcp) +SHA512Transform(uint64_t *H, const uint8_t *cp) +{ + uint64_t a, b, c, d, e, f, g, h, t, T1, T2, W[80]; + + /* copy chunk into the first 16 words of the message schedule */ + for (t = 0; t < 16; t++, cp += sizeof (uint64_t)) + W[t] = ((uint64_t)cp[0] << 56) | ((uint64_t)cp[1] << 48) | + ((uint64_t)cp[2] << 40) | ((uint64_t)cp[3] << 32) | + ((uint64_t)cp[4] << 24) | ((uint64_t)cp[5] << 16) | + ((uint64_t)cp[6] << 8) | (uint64_t)cp[7]; + + /* extend the first 16 words into the remaining 64 words */ + for (t = 16; t < 80; t++) + W[t] = SIGMA1_512(W[t - 2]) + W[t - 7] + + SIGMA0_512(W[t - 15]) + W[t - 16]; + + /* init working variables to the current hash value */ + a = H[0]; b = H[1]; c = H[2]; d = H[3]; + e = H[4]; f = H[5]; g = H[6]; h = H[7]; + + /* iterate the compression function for all rounds of the hash */ + for (t = 0; t < 80; t++) { + T1 = h + BIGSIGMA1_512(e) + Ch(e, f, g) + SHA512_K[t] + W[t]; + T2 = BIGSIGMA0_512(a) + Maj(a, b, c); + h = g; g = f; f = e; e = d + T1; + d = c; c = b; b = a; a = T1 + T2; + } + + /* add the compressed chunk to the current hash value */ + H[0] += a; H[1] += b; H[2] += c; H[3] += d; + H[4] += e; H[5] += f; H[6] += g; H[7] += h; +} + +/* + * Implements the SHA-224 and SHA-256 hash algos - to select between them + * pass the appropriate initial values of 'H' and truncate the last 32 bits + * in case of SHA-224. + */ +static void +SHA256(uint32_t *H, const void *buf, uint64_t size, zio_cksum_t *zcp) { - uint32_t H[8] = { 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, - 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 }; uint8_t pad[128]; - int padsize = size & 63; - int i; + unsigned padsize = size & 63; + unsigned i, k; + /* process all blocks up to the last one */ for (i = 0; i < size - padsize; i += 64) SHA256Transform(H, (uint8_t *)buf + i); - for (i = 0; i < padsize; i++) - pad[i] = ((uint8_t *)buf)[i]; + /* process the last block and padding */ + for (k = 0; k < padsize; k++) + pad[k] = ((uint8_t *)buf)[k+i]; for (pad[padsize++] = 0x80; (padsize & 63) != 56; padsize++) pad[padsize] = 0; @@ -125,3 +224,102 @@ zio_checksum_SHA256(const void *buf, uin (uint64_t)H[4] << 32 | H[5], (uint64_t)H[6] << 32 | H[7]); } + +/* + * encode 64bit data in big-endian format. + */ +static void +Encode64(uint8_t *output, uint64_t *input, size_t len) +{ + size_t i, j; + for (i = 0, j = 0; j < len; i++, j += 8) { + output[j] = (input[i] >> 56) & 0xff; + output[j + 1] = (input[i] >> 48) & 0xff; + output[j + 2] = (input[i] >> 40) & 0xff; + output[j + 3] = (input[i] >> 32) & 0xff; + output[j + 4] = (input[i] >> 24) & 0xff; + output[j + 5] = (input[i] >> 16) & 0xff; + output[j + 6] = (input[i] >> 8) & 0xff; + output[j + 7] = input[i] & 0xff; + } +} + +/* + * Implements the SHA-384, SHA-512 and SHA-512/t hash algos - to select + * between them pass the appropriate initial values for 'H'. The output + * of this function is truncated to the first 256 bits that fit into 'zcp'. + */ +static void +SHA512(uint64_t *H, const void *buf, uint64_t size, zio_cksum_t *zcp) +{ + uint64_t c64[2]; + uint8_t pad[256]; + unsigned padsize = size & 127; + unsigned i, k; + + /* process all blocks up to the last one */ + for (i = 0; i < size - padsize; i += 128) + SHA512Transform(H, (uint8_t *)buf + i); + + /* process the last block and padding */ + for (k = 0; k < padsize; k++) + pad[k] = ((uint8_t *)buf)[k+i]; + + if (padsize < 112) { + for (pad[padsize++] = 0x80; padsize < 112; padsize++) + pad[padsize] = 0; + } else { + for (pad[padsize++] = 0x80; padsize < 240; padsize++) + pad[padsize] = 0; + } + + c64[0] = 0; + c64[1] = size << 3; + Encode64(pad+padsize, c64, sizeof (c64)); + padsize += sizeof (c64); + + for (i = 0; i < padsize; i += 128) + SHA512Transform(H, pad + i); + + /* truncate the output to the first 256 bits which fit into 'zcp' */ + Encode64((uint8_t *)zcp, H, sizeof (uint64_t) * 4); +} + +static void +zio_checksum_SHA256(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) +{ + /* SHA-256 as per FIPS 180-4. */ + uint32_t H[] = { + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, + 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 + }; + SHA256(H, buf, size, zcp); +} + +static void +zio_checksum_SHA512_native(const void *buf, uint64_t size, + const void *ctx_template __unused, zio_cksum_t *zcp) +{ + /* SHA-512/256 as per FIPS 180-4. */ + uint64_t H[] = { + 0x22312194FC2BF72CULL, 0x9F555FA3C84C64C2ULL, + 0x2393B86B6F53B151ULL, 0x963877195940EABDULL, + 0x96283EE2A88EFFE3ULL, 0xBE5E1E2553863992ULL, + 0x2B0199FC2C85B8AAULL, 0x0EB72DDC81C52CA2ULL + }; + SHA512(H, buf, size, zcp); +} + +static void +zio_checksum_SHA512_byteswap(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + zio_cksum_t tmp; + + zio_checksum_SHA512_native(buf, size, ctx_template, &tmp); + zcp->zc_word[0] = BSWAP_64(tmp.zc_word[0]); + zcp->zc_word[1] = BSWAP_64(tmp.zc_word[1]); + zcp->zc_word[2] = BSWAP_64(tmp.zc_word[2]); + zcp->zc_word[3] = BSWAP_64(tmp.zc_word[3]); +} Added: head/sys/cddl/boot/zfs/skein_zfs.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/cddl/boot/zfs/skein_zfs.c Thu Aug 18 00:37:07 2016 (r304321) @@ -0,0 +1,92 @@ +/* + * 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://opensource.org/licenses/CDDL-1.0. + * 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 + * + * $FreeBSD$ + */ +/* + * Copyright 2013 Saso Kiselkov. All rights reserved. + */ +#include + +/* + * Computes a native 256-bit skein MAC checksum. Please note that this + * function requires the presence of a ctx_template that should be allocated + * using zio_checksum_skein_tmpl_init. + */ +/*ARGSUSED*/ +static void +zio_checksum_skein_native(const void *buf, uint64_t size, + const void *ctx_template, zio_cksum_t *zcp) +{ + Skein_512_Ctxt_t ctx; + + ASSERT(ctx_template != NULL); + bcopy(ctx_template, &ctx, sizeof (ctx)); + (void) Skein_512_Update(&ctx, buf, size); + (void) Skein_512_Final(&ctx, (uint8_t *)zcp); + bzero(&ctx, sizeof (ctx)); +} + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 18 01:25:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D750CBBD8AB; Thu, 18 Aug 2016 01:25:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA32B1316; Thu, 18 Aug 2016 01:25:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I1PCe4014170; Thu, 18 Aug 2016 01:25:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I1PCs3014169; Thu, 18 Aug 2016 01:25:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201608180125.u7I1PCs3014169@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 18 Aug 2016 01:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304322 - head/sys/net80211 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 01:25:13 -0000 Author: adrian Date: Thu Aug 18 01:25:12 2016 New Revision: 304322 URL: https://svnweb.freebsd.org/changeset/base/304322 Log: [net80211] correctly lock the ifp before accessing the lladdr. Tested by: dhw Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Thu Aug 18 00:37:07 2016 (r304321) +++ head/sys/net80211/ieee80211_ioctl.c Thu Aug 18 01:25:12 2016 (r304322) @@ -3394,10 +3394,12 @@ ieee80211_ioctl(struct ifnet *ifp, u_lon * Check if the MAC address was changed * via SIOCSIFLLADDR ioctl. */ + if_addr_rlock(ifp); if ((ifp->if_flags & IFF_UP) == 0 && !IEEE80211_ADDR_EQ(vap->iv_myaddr, IF_LLADDR(ifp))) IEEE80211_ADDR_COPY(vap->iv_myaddr, IF_LLADDR(ifp)); + if_addr_runlock(ifp); } break; case SIOCADDMULTI: From owner-svn-src-all@freebsd.org Thu Aug 18 01:48:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED2EDBBDD51; Thu, 18 Aug 2016 01:48:59 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFB691B35; Thu, 18 Aug 2016 01:48:59 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I1mxn9021654; Thu, 18 Aug 2016 01:48:59 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I1mwTi021652; Thu, 18 Aug 2016 01:48:58 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180148.u7I1mwTi021652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 01:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304323 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 01:49:00 -0000 Author: yongari Date: Thu Aug 18 01:48:58 2016 New Revision: 304323 URL: https://svnweb.freebsd.org/changeset/base/304323 Log: Pass PHY location information and remove PHY access hack. Modified: head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 01:25:12 2016 (r304322) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 01:48:58 2016 (r304323) @@ -303,8 +303,6 @@ axge_miibus_writereg(device_t dev, int p int locked; sc = device_get_softc(dev); - if (sc->sc_phyno != phy) - return (0); locked = mtx_owned(&sc->sc_mtx); if (!locked) AXGE_LOCK(sc); @@ -434,7 +432,6 @@ axge_attach_post(struct usb_ether *ue) struct axge_softc *sc; sc = uether_getsc(ue); - sc->sc_phyno = 3; /* Initialize controller and get station address. */ axge_chip_init(sc); @@ -466,7 +463,7 @@ axge_attach_post_sub(struct usb_ether *u mtx_lock(&Giant); error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp, uether_ifmedia_upd, ue->ue_methods->ue_mii_sts, - BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, MIIF_DOPAUSE); + BMSR_DEFCAPMASK, AXGE_PHY_ADDR, MII_OFFSET_ANY, MIIF_DOPAUSE); mtx_unlock(&Giant); return (error); Modified: head/sys/dev/usb/net/if_axgereg.h ============================================================================== --- head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 01:25:12 2016 (r304322) +++ head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 01:48:58 2016 (r304323) @@ -158,11 +158,12 @@ enum { AXGE_N_TRANSFER, }; +#define AXGE_PHY_ADDR 3 + struct axge_softc { struct usb_ether sc_ue; struct mtx sc_mtx; struct usb_xfer *sc_xfer[AXGE_N_TRANSFER]; - int sc_phyno; int sc_flags; #define AXGE_FLAG_LINK 0x0001 /* got a link */ From owner-svn-src-all@freebsd.org Thu Aug 18 02:14:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C881FBBE45B; Thu, 18 Aug 2016 02:14:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 998DE18B5; Thu, 18 Aug 2016 02:14:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I2EdgI032507; Thu, 18 Aug 2016 02:14:39 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I2Edk7032506; Thu, 18 Aug 2016 02:14:39 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180214.u7I2Edk7032506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 02:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304324 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 02:14:40 -0000 Author: yongari Date: Thu Aug 18 02:14:39 2016 New Revision: 304324 URL: https://svnweb.freebsd.org/changeset/base/304324 Log: Don't explicitly call MIIBUS_STATCHG() method handler. Link state change should be handled by PHY driver. Some broken PHY H/Ws may need that workaround but it seems axge(4) don't use such PHYs. Modified: head/sys/dev/usb/net/if_axge.c Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 01:48:58 2016 (r304323) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 02:14:39 2016 (r304324) @@ -724,11 +724,6 @@ axge_tick(struct usb_ether *ue) AXGE_LOCK_ASSERT(sc, MA_OWNED); mii_tick(mii); - if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) { - axge_miibus_statchg(ue->ue_dev); - if ((sc->sc_flags & AXGE_FLAG_LINK) != 0) - axge_start(ue); - } } static void From owner-svn-src-all@freebsd.org Thu Aug 18 04:25:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3581FBBDFF0; Thu, 18 Aug 2016 04:25:19 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB96B15EC; Thu, 18 Aug 2016 04:25:18 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I4PIU8081873; Thu, 18 Aug 2016 04:25:18 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I4PHED081871; Thu, 18 Aug 2016 04:25:17 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180425.u7I4PHED081871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 04:25:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304325 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 04:25:19 -0000 Author: yongari Date: Thu Aug 18 04:25:17 2016 New Revision: 304325 URL: https://svnweb.freebsd.org/changeset/base/304325 Log: Rename cryptic RX filter constants with more readable ones. No functional change. Modified: head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 02:14:39 2016 (r304324) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 04:25:17 2016 (r304325) @@ -743,11 +743,11 @@ axge_setmulti(struct usb_ether *ue) rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { - rxmode |= RCR_AMALL; + rxmode |= RCR_ACPT_ALL_MCAST; axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); return; } - rxmode &= ~RCR_AMALL; + rxmode &= ~RCR_ACPT_ALL_MCAST; if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { @@ -775,9 +775,9 @@ axge_setpromisc(struct usb_ether *ue) rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); if (ifp->if_flags & IFF_PROMISC) - rxmode |= RCR_PRO; + rxmode |= RCR_PROMISC; else - rxmode &= ~RCR_PRO; + rxmode &= ~RCR_PROMISC; axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); axge_setmulti(ue); @@ -828,16 +828,16 @@ axge_init(struct usb_ether *ue) axge_csum_cfg(ue); /* Configure RX settings. */ - rxmode = (RCR_AM | RCR_SO | RCR_DROP_CRCE); + rxmode = (RCR_ACPT_MCAST | RCR_START | RCR_DROP_CRCERR); if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) rxmode |= RCR_IPE; /* If we want promiscuous mode, set the allframes bit. */ if (ifp->if_flags & IFF_PROMISC) - rxmode |= RCR_PRO; + rxmode |= RCR_PROMISC; if (ifp->if_flags & IFF_BROADCAST) - rxmode |= RCR_AB; + rxmode |= RCR_ACPT_BCAST; axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); Modified: head/sys/dev/usb/net/if_axgereg.h ============================================================================== --- head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 02:14:39 2016 (r304324) +++ head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 04:25:17 2016 (r304325) @@ -57,13 +57,14 @@ /* Rx control register */ #define AXGE_RCR 0x0b #define RCR_STOP 0x0000 -#define RCR_PRO 0x0001 -#define RCR_AMALL 0x0002 -#define RCR_AB 0x0008 -#define RCR_AM 0x0010 -#define RCR_AP 0x0020 -#define RCR_SO 0x0080 -#define RCR_DROP_CRCE 0x0100 +#define RCR_PROMISC 0x0001 +#define RCR_ACPT_ALL_MCAST 0x0002 +#define RCR_AUTOPAD_BNDRY 0x0004 +#define RCR_ACPT_BCAST 0x0008 +#define RCR_ACPT_MCAST 0x0010 +#define RCR_ACPT_PHY_MCAST 0x0020 +#define RCR_START 0x0080 +#define RCR_DROP_CRCERR 0x0100 #define RCR_IPE 0x0200 #define RCR_TX_CRC_PAD 0x0400 From owner-svn-src-all@freebsd.org Thu Aug 18 05:07:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA948BBCCD1; Thu, 18 Aug 2016 05:07:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E18017C7; Thu, 18 Aug 2016 05:07:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I572nm096521; Thu, 18 Aug 2016 05:07:02 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I572ZI096519; Thu, 18 Aug 2016 05:07:02 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180507.u7I572ZI096519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 05:07:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304326 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 05:07:03 -0000 Author: yongari Date: Thu Aug 18 05:07:02 2016 New Revision: 304326 URL: https://svnweb.freebsd.org/changeset/base/304326 Log: Switch to TX header format rather than directly manipulating header structures. This simplifies mbuf copy operation to USB buffers as well as improving readability. The controller supports Microsoft LSOv1(aka TSO) but this change set does not include the support due to copying overhead to USB buffers and large amount of memory waste. Remove useless ZLP padding which seems to come from Linux. Required bits the code tried to set was not copied into USB buffer so it had no effect. Unlike Linux, FreeBSD USB stack automatically generates ZLP so no explicit padding is required in driver.[1] Micro-optimize updating IFCOUNTER_OPACKETS counter by moving it out of TX loop since updating counter is not cheap operation as it did long time ago and we already know how many number of packets were queued after exiting the loop. While here, fix a checksum offloading bug which will happen when upper stack computes checksum while H/W checksum offloading is active. The controller should be notified to not recompute the checksum in this case. Reviewed by: kevlo (initial version), hselasky Pointed out by: hselasky [1] Modified: head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 04:25:17 2016 (r304325) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 05:07:02 2016 (r304326) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -144,8 +145,8 @@ static const struct usb_config axge_conf .type = UE_BULK, .endpoint = UE_ADDR_ANY, .direction = UE_DIR_OUT, - .frames = 16, - .bufsize = 16 * MCLBYTES, + .frames = AXGE_N_FRAMES, + .bufsize = AXGE_N_FRAMES * MCLBYTES, .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, .callback = axge_bulk_write_callback, .timeout = 10000, /* 10 seconds */ @@ -630,7 +631,7 @@ axge_bulk_write_callback(struct usb_xfer struct ifnet *ifp; struct usb_page_cache *pc; struct mbuf *m; - uint32_t txhdr; + struct axge_frame_txhdr txhdr; int nframes, pos; sc = usbd_xfer_softc(xfer); @@ -651,36 +652,25 @@ tr_setup: return; } - for (nframes = 0; nframes < 16 && + for (nframes = 0; nframes < AXGE_N_FRAMES && !IFQ_DRV_IS_EMPTY(&ifp->if_snd); nframes++) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; usbd_xfer_set_frame_offset(xfer, nframes * MCLBYTES, - nframes); - pos = 0; + nframes); pc = usbd_xfer_get_frame(xfer, nframes); - txhdr = htole32(m->m_pkthdr.len); - usbd_copy_in(pc, 0, &txhdr, sizeof(txhdr)); - txhdr = 0; - txhdr = htole32(txhdr); - usbd_copy_in(pc, 4, &txhdr, sizeof(txhdr)); - pos += 8; + txhdr.mss = 0; + txhdr.len = htole32(AXGE_TXBYTES(m->m_pkthdr.len)); + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0 && + (m->m_pkthdr.csum_flags & AXGE_CSUM_FEATURES) == 0) + txhdr.len |= htole32(AXGE_CSUM_DISABLE); + + pos = 0; + usbd_copy_in(pc, pos, &txhdr, sizeof(txhdr)); + pos += sizeof(txhdr); usbd_m_copy_in(pc, pos, m, 0, m->m_pkthdr.len); pos += m->m_pkthdr.len; - if ((pos % usbd_xfer_max_framelen(xfer)) == 0) - txhdr |= 0x80008000; - - /* - * XXX - * Update TX packet counter here. This is not - * correct way but it seems that there is no way - * to know how many packets are sent at the end - * of transfer because controller combines - * multiple writes into single one if there is - * room in TX buffer of controller. - */ - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); /* * if there's a BPF listener, bounce a copy @@ -694,6 +684,16 @@ tr_setup: usbd_xfer_set_frame_len(xfer, nframes, pos); } if (nframes != 0) { + /* + * XXX + * Update TX packet counter here. This is not + * correct way but it seems that there is no way + * to know how many packets are sent at the end + * of transfer because controller combines + * multiple writes into single one if there is + * room in TX buffer of controller. + */ + if_inc_counter(ifp, IFCOUNTER_OPACKETS, nframes); usbd_xfer_set_frames(xfer, nframes); usbd_transfer_submit(xfer); ifp->if_drv_flags |= IFF_DRV_OACTIVE; Modified: head/sys/dev/usb/net/if_axgereg.h ============================================================================== --- head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 04:25:17 2016 (r304325) +++ head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 05:07:02 2016 (r304326) @@ -159,6 +159,26 @@ enum { AXGE_N_TRANSFER, }; +#define AXGE_N_FRAMES 16 + +struct axge_frame_txhdr { +#if BYTE_ORDER == LITTLE_ENDIAN + uint32_t len; +#define AXGE_TXLEN_MASK 0x0001FFFF +#define AXGE_VLAN_INSERT 0x20000000 +#define AXGE_CSUM_DISABLE 0x80000000 + uint32_t mss; +#define AXGE_MSS_MASK 0x00003FFF +#define AXGE_PADDING 0x80008000 +#define AXGE_VLAN_TAG_MASK 0xFFFF0000 +#else + uint32_t mss; + uint32_t len; +#endif +} __packed; + +#define AXGE_TXBYTES(x) ((x) & AXGE_TXLEN_MASK) + #define AXGE_PHY_ADDR 3 struct axge_softc { From owner-svn-src-all@freebsd.org Thu Aug 18 05:33:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFD60BBE365; Thu, 18 Aug 2016 05:33:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 91BED1503; Thu, 18 Aug 2016 05:33:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I5XwSP007504; Thu, 18 Aug 2016 05:33:58 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I5XwHv007496; Thu, 18 Aug 2016 05:33:58 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608180533.u7I5XwHv007496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Aug 2016 05:33:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304327 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 05:34:00 -0000 Author: sephe Date: Thu Aug 18 05:33:58 2016 New Revision: 304327 URL: https://svnweb.freebsd.org/changeset/base/304327 Log: hyperv/hn: Pass RX packet info to netvsc_recv. This paves to nuke netvsc_packet, which does not serves much purpose now. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7541 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:07:02 2016 (r304326) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:33:58 2016 (r304327) @@ -275,7 +275,6 @@ typedef void (*pfn_on_send_rx_completion #endif typedef struct netvsc_packet_ { - uint16_t vlan_tci; uint32_t status; uint32_t tot_data_buf_len; void *data; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 18 05:07:02 2016 (r304326) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 18 05:33:58 2016 (r304327) @@ -1278,9 +1278,7 @@ hn_lro_rx(struct lro_ctrl *lc, struct mb */ int netvsc_recv(struct hn_rx_ring *rxr, netvsc_packet *packet, - const rndis_tcp_ip_csum_info *csum_info, - const struct rndis_hash_info *hash_info, - const struct rndis_hash_value *hash_value) + const struct hn_recvinfo *info) { struct ifnet *ifp = rxr->hn_ifp; struct mbuf *m_new; @@ -1332,28 +1330,28 @@ netvsc_recv(struct hn_rx_ring *rxr, netv do_csum = 0; /* receive side checksum offload */ - if (csum_info != NULL) { + if (info->csum_info != NULL) { /* IP csum offload */ - if (csum_info->receive.ip_csum_succeeded && do_csum) { + if (info->csum_info->receive.ip_csum_succeeded && do_csum) { m_new->m_pkthdr.csum_flags |= (CSUM_IP_CHECKED | CSUM_IP_VALID); rxr->hn_csum_ip++; } /* TCP/UDP csum offload */ - if ((csum_info->receive.tcp_csum_succeeded || - csum_info->receive.udp_csum_succeeded) && do_csum) { + if ((info->csum_info->receive.tcp_csum_succeeded || + info->csum_info->receive.udp_csum_succeeded) && do_csum) { m_new->m_pkthdr.csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); m_new->m_pkthdr.csum_data = 0xffff; - if (csum_info->receive.tcp_csum_succeeded) + if (info->csum_info->receive.tcp_csum_succeeded) rxr->hn_csum_tcp++; else rxr->hn_csum_udp++; } - if (csum_info->receive.ip_csum_succeeded && - csum_info->receive.tcp_csum_succeeded) + if (info->csum_info->receive.ip_csum_succeeded && + info->csum_info->receive.tcp_csum_succeeded) do_lro = 1; } else { const struct ether_header *eh; @@ -1409,19 +1407,18 @@ netvsc_recv(struct hn_rx_ring *rxr, netv } } skip: - if ((packet->vlan_tci != 0) && - (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) != 0) { - m_new->m_pkthdr.ether_vtag = packet->vlan_tci; + if (info->vlan_info != NULL) { + m_new->m_pkthdr.ether_vtag = info->vlan_info->u1.s1.vlan_id; m_new->m_flags |= M_VLANTAG; } - if (hash_info != NULL && hash_value != NULL) { + if (info->hash_info != NULL && info->hash_value != NULL) { rxr->hn_rss_pkts++; - m_new->m_pkthdr.flowid = hash_value->hash_value; - if ((hash_info->hash_info & NDIS_HASH_FUNCTION_MASK) == + m_new->m_pkthdr.flowid = info->hash_value->hash_value; + if ((info->hash_info->hash_info & NDIS_HASH_FUNCTION_MASK) == NDIS_HASH_FUNCTION_TOEPLITZ) { uint32_t type = - (hash_info->hash_info & NDIS_HASH_TYPE_MASK); + (info->hash_info->hash_info & NDIS_HASH_TYPE_MASK); switch (type) { case NDIS_HASH_IPV4: @@ -1450,8 +1447,8 @@ skip: } } } else { - if (hash_value != NULL) { - m_new->m_pkthdr.flowid = hash_value->hash_value; + if (info->hash_value != NULL) { + m_new->m_pkthdr.flowid = info->hash_value->hash_value; } else { m_new->m_pkthdr.flowid = rxr->hn_rx_idx; hash_type = M_HASHTYPE_OPAQUE; Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Thu Aug 18 05:07:02 2016 (r304326) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Thu Aug 18 05:33:58 2016 (r304327) @@ -1088,11 +1088,10 @@ typedef struct rndismp_rx_bufs_info_ { */ struct hn_rx_ring; struct hn_tx_ring; +struct hn_recvinfo; int netvsc_recv(struct hn_rx_ring *rxr, - netvsc_packet *packet, const rndis_tcp_ip_csum_info *csum_info, - const struct rndis_hash_info *hash_info, - const struct rndis_hash_value *hash_value); + netvsc_packet *packet, const struct hn_recvinfo *info); void netvsc_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); void* hv_set_rppi_data(rndis_msg *rndis_mesg, Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 18 05:07:02 2016 (r304326) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 18 05:33:58 2016 (r304327) @@ -52,13 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -struct hv_rf_recvinfo { - const ndis_8021q_info *vlan_info; - const rndis_tcp_ip_csum_info *csum_info; - const struct rndis_hash_info *hash_info; - const struct rndis_hash_value *hash_value; -}; - #define HV_RF_RECVINFO_VLAN 0x1 #define HV_RF_RECVINFO_CSUM 0x2 #define HV_RF_RECVINFO_HASHINF 0x4 @@ -444,7 +437,7 @@ hv_rf_receive_indicate_status(rndis_devi } static int -hv_rf_find_recvinfo(const rndis_packet *rpkt, struct hv_rf_recvinfo *info) +hv_rf_find_recvinfo(const rndis_packet *rpkt, struct hn_recvinfo *info) { const rndis_per_packet_info *ppi; uint32_t mask, len; @@ -530,7 +523,7 @@ hv_rf_receive_data(struct hn_rx_ring *rx { rndis_packet *rndis_pkt; uint32_t data_offset; - struct hv_rf_recvinfo info; + struct hn_recvinfo info; rndis_pkt = &message->msg.packet; @@ -559,13 +552,7 @@ hv_rf_receive_data(struct hn_rx_ring *rx if_printf(rxr->hn_ifp, "recvinfo parsing failed\n"); return; } - - if (info.vlan_info != NULL) - pkt->vlan_tci = info.vlan_info->u1.s1.vlan_id; - else - pkt->vlan_tci = 0; - - netvsc_recv(rxr, pkt, info.csum_info, info.hash_info, info.hash_value); + netvsc_recv(rxr, pkt, &info); } /* Modified: head/sys/dev/hyperv/netvsc/if_hnvar.h ============================================================================== --- head/sys/dev/hyperv/netvsc/if_hnvar.h Thu Aug 18 05:07:02 2016 (r304326) +++ head/sys/dev/hyperv/netvsc/if_hnvar.h Thu Aug 18 05:33:58 2016 (r304327) @@ -35,7 +35,6 @@ #include struct netvsc_dev_; -struct nvsp_msg_; struct vmbus_channel; struct hn_send_ctx; @@ -51,6 +50,18 @@ struct hn_send_ctx { int hn_chim_sz; }; +struct rndis_hash_info; +struct rndix_hash_value; +struct ndis_8021q_info_; +struct rndis_tcp_ip_csum_info_; + +struct hn_recvinfo { + const struct ndis_8021q_info_ *vlan_info; + const struct rndis_tcp_ip_csum_info_ *csum_info; + const struct rndis_hash_info *hash_info; + const struct rndis_hash_value *hash_value; +}; + #define HN_SEND_CTX_INITIALIZER(cb, cbarg) \ { \ .hn_cb = cb, \ From owner-svn-src-all@freebsd.org Thu Aug 18 05:45:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20651BBE730; Thu, 18 Aug 2016 05:45:00 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB98B1C9C; Thu, 18 Aug 2016 05:44:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I5ixTv011307; Thu, 18 Aug 2016 05:44:59 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I5ix1Q011306; Thu, 18 Aug 2016 05:44:59 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608180544.u7I5ix1Q011306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Aug 2016 05:44:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304329 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 05:45:00 -0000 Author: sephe Date: Thu Aug 18 05:44:58 2016 New Revision: 304329 URL: https://svnweb.freebsd.org/changeset/base/304329 Log: hyperv/hn: Constify RNDIS messages on RX path. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7542 Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 18 05:35:43 2016 (r304328) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 18 05:44:58 2016 (r304329) @@ -67,10 +67,11 @@ __FBSDID("$FreeBSD$"); */ static int hv_rf_send_request(rndis_device *device, rndis_request *request, uint32_t message_type); -static void hv_rf_receive_response(rndis_device *device, rndis_msg *response); +static void hv_rf_receive_response(rndis_device *device, + const rndis_msg *response); static void hv_rf_receive_indicate_status(rndis_device *device, - rndis_msg *response); -static void hv_rf_receive_data(struct hn_rx_ring *rxr, rndis_msg *message, + const rndis_msg *response); +static void hv_rf_receive_data(struct hn_rx_ring *rxr, const rndis_msg *message, netvsc_packet *pkt); static int hv_rf_query_device(rndis_device *device, uint32_t oid, void *result, uint32_t *result_size); @@ -295,7 +296,7 @@ sendit: * RNDIS filter receive response */ static void -hv_rf_receive_response(rndis_device *device, rndis_msg *response) +hv_rf_receive_response(rndis_device *device, const rndis_msg *response) { rndis_request *request = NULL; rndis_request *next_request; @@ -417,9 +418,9 @@ cleanup: * RNDIS filter receive indicate status */ static void -hv_rf_receive_indicate_status(rndis_device *device, rndis_msg *response) +hv_rf_receive_indicate_status(rndis_device *device, const rndis_msg *response) { - rndis_indicate_status *indicate = &response->msg.indicate_status; + const rndis_indicate_status *indicate = &response->msg.indicate_status; switch(indicate->status) { case RNDIS_STATUS_MEDIA_CONNECT: @@ -518,10 +519,10 @@ skip: * RNDIS filter receive data */ static void -hv_rf_receive_data(struct hn_rx_ring *rxr, rndis_msg *message, +hv_rf_receive_data(struct hn_rx_ring *rxr, const rndis_msg *message, netvsc_packet *pkt) { - rndis_packet *rndis_pkt; + const rndis_packet *rndis_pkt; uint32_t data_offset; struct hn_recvinfo info; @@ -563,7 +564,7 @@ hv_rf_on_receive(netvsc_dev *net_dev, struct hn_rx_ring *rxr, netvsc_packet *pkt) { rndis_device *rndis_dev; - rndis_msg *rndis_hdr; + const rndis_msg *rndis_hdr; /* Make sure the rndis device state is initialized */ if (net_dev->extension == NULL) { From owner-svn-src-all@freebsd.org Thu Aug 18 05:52:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1545EBBE94D; Thu, 18 Aug 2016 05:52:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CACD112D0; Thu, 18 Aug 2016 05:52:04 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I5q4CA015006; Thu, 18 Aug 2016 05:52:04 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I5q3O0015000; Thu, 18 Aug 2016 05:52:03 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608180552.u7I5q3O0015000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Aug 2016 05:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304330 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 05:52:05 -0000 Author: sephe Date: Thu Aug 18 05:52:03 2016 New Revision: 304330 URL: https://svnweb.freebsd.org/changeset/base/304330 Log: hyperv/hn: Get rid of the useless netvsc_packet MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7544 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Aug 18 05:44:58 2016 (r304329) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Thu Aug 18 05:52:03 2016 (r304330) @@ -66,7 +66,7 @@ static int hv_nv_connect_to_vsp(struct static void hv_nv_on_send_completion(netvsc_dev *net_dev, struct vmbus_channel *, const struct vmbus_chanpkt_hdr *pkt); static void hv_nv_on_receive_completion(struct vmbus_channel *chan, - uint64_t tid, uint32_t status); + uint64_t tid); static void hv_nv_on_receive(netvsc_dev *net_dev, struct hn_rx_ring *rxr, struct vmbus_channel *chan, const struct vmbus_chanpkt_hdr *pkt); @@ -844,11 +844,8 @@ hv_nv_on_receive(netvsc_dev *net_dev, st { const struct vmbus_chanpkt_rxbuf *pkt; const struct hn_nvs_hdr *nvs_hdr; - netvsc_packet vsc_pkt; - netvsc_packet *net_vsc_pkt = &vsc_pkt; int count = 0; int i = 0; - int status = HN_NVS_STATUS_OK; /* Make sure that this is a RNDIS message. */ nvs_hdr = VMBUS_CHANPKT_CONST_DATA(pkthdr); @@ -870,16 +867,9 @@ hv_nv_on_receive(netvsc_dev *net_dev, st /* Each range represents 1 RNDIS pkt that contains 1 Ethernet frame */ for (i = 0; i < count; i++) { - net_vsc_pkt->status = HN_NVS_STATUS_OK; - net_vsc_pkt->data = ((uint8_t *)net_dev->rx_buf + - pkt->cp_rxbuf[i].rb_ofs); - net_vsc_pkt->tot_data_buf_len = pkt->cp_rxbuf[i].rb_len; - - hv_rf_on_receive(net_dev, rxr, net_vsc_pkt); - - /* XXX pretty broken; whack it */ - if (net_vsc_pkt->status != HN_NVS_STATUS_OK) - status = HN_NVS_STATUS_FAILED; + hv_rf_on_receive(net_dev, rxr, + (const uint8_t *)net_dev->rx_buf + pkt->cp_rxbuf[i].rb_ofs, + pkt->cp_rxbuf[i].rb_len); } /* @@ -887,7 +877,7 @@ hv_nv_on_receive(netvsc_dev *net_dev, st * messages (not just data messages) will trigger a response * message back to the host. */ - hv_nv_on_receive_completion(chan, pkt->cp_hdr.cph_xactid, status); + hv_nv_on_receive_completion(chan, pkt->cp_hdr.cph_xactid); } /* @@ -896,15 +886,14 @@ hv_nv_on_receive(netvsc_dev *net_dev, st * Send a receive completion packet to RNDIS device (ie NetVsp) */ static void -hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid, - uint32_t status) +hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid) { struct hn_nvs_rndis_ack ack; int retries = 0; int ret = 0; ack.nvs_type = HN_NVS_TYPE_RNDIS_ACK; - ack.nvs_status = status; + ack.nvs_status = HN_NVS_STATUS_OK; retry_send_cmplt: /* Send the completion */ Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:44:58 2016 (r304329) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Thu Aug 18 05:52:03 2016 (r304330) @@ -274,12 +274,6 @@ typedef void (*pfn_on_send_rx_completion #define BITS_PER_LONG 32 #endif -typedef struct netvsc_packet_ { - uint32_t status; - uint32_t tot_data_buf_len; - void *data; -} netvsc_packet; - typedef struct { uint8_t mac_addr[6]; /* Assumption unsigned long */ uint8_t link_state; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 18 05:44:58 2016 (r304329) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Aug 18 05:52:03 2016 (r304330) @@ -1277,7 +1277,7 @@ hn_lro_rx(struct lro_ctrl *lc, struct mb * Note: This is no longer used as a callback */ int -netvsc_recv(struct hn_rx_ring *rxr, netvsc_packet *packet, +netvsc_recv(struct hn_rx_ring *rxr, const void *data, int dlen, const struct hn_recvinfo *info) { struct ifnet *ifp = rxr->hn_ifp; @@ -1291,17 +1291,16 @@ netvsc_recv(struct hn_rx_ring *rxr, netv /* * Bail out if packet contains more data than configured MTU. */ - if (packet->tot_data_buf_len > (ifp->if_mtu + ETHER_HDR_LEN)) { + if (dlen > (ifp->if_mtu + ETHER_HDR_LEN)) { return (0); - } else if (packet->tot_data_buf_len <= MHLEN) { + } else if (dlen <= MHLEN) { m_new = m_gethdr(M_NOWAIT, MT_DATA); if (m_new == NULL) { if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return (0); } - memcpy(mtod(m_new, void *), packet->data, - packet->tot_data_buf_len); - m_new->m_pkthdr.len = m_new->m_len = packet->tot_data_buf_len; + memcpy(mtod(m_new, void *), data, dlen); + m_new->m_pkthdr.len = m_new->m_len = dlen; rxr->hn_small_pkts++; } else { /* @@ -1311,7 +1310,7 @@ netvsc_recv(struct hn_rx_ring *rxr, netv * if looped around to the Hyper-V TX channel, so avoid them. */ size = MCLBYTES; - if (packet->tot_data_buf_len > MCLBYTES) { + if (dlen > MCLBYTES) { /* 4096 */ size = MJUMPAGESIZE; } @@ -1322,7 +1321,7 @@ netvsc_recv(struct hn_rx_ring *rxr, netv return (0); } - hv_m_append(m_new, packet->tot_data_buf_len, packet->data); + hv_m_append(m_new, dlen, data); } m_new->m_pkthdr.rcvif = ifp; Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Thu Aug 18 05:44:58 2016 (r304329) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Thu Aug 18 05:52:03 2016 (r304330) @@ -1090,8 +1090,8 @@ struct hn_rx_ring; struct hn_tx_ring; struct hn_recvinfo; -int netvsc_recv(struct hn_rx_ring *rxr, - netvsc_packet *packet, const struct hn_recvinfo *info); +int netvsc_recv(struct hn_rx_ring *rxr, const void *data, int dlen, + const struct hn_recvinfo *info); void netvsc_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); void* hv_set_rppi_data(rndis_msg *rndis_mesg, Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 18 05:44:58 2016 (r304329) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Aug 18 05:52:03 2016 (r304330) @@ -71,8 +71,8 @@ static void hv_rf_receive_response(rndis const rndis_msg *response); static void hv_rf_receive_indicate_status(rndis_device *device, const rndis_msg *response); -static void hv_rf_receive_data(struct hn_rx_ring *rxr, const rndis_msg *message, - netvsc_packet *pkt); +static void hv_rf_receive_data(struct hn_rx_ring *rxr, + const void *data, int dlen); static int hv_rf_query_device(rndis_device *device, uint32_t oid, void *result, uint32_t *result_size); static inline int hv_rf_query_device_mac(rndis_device *device); @@ -519,9 +519,9 @@ skip: * RNDIS filter receive data */ static void -hv_rf_receive_data(struct hn_rx_ring *rxr, const rndis_msg *message, - netvsc_packet *pkt) +hv_rf_receive_data(struct hn_rx_ring *rxr, const void *data, int dlen) { + const rndis_msg *message = data; const rndis_packet *rndis_pkt; uint32_t data_offset; struct hn_recvinfo info; @@ -536,24 +536,22 @@ hv_rf_receive_data(struct hn_rx_ring *rx /* Remove rndis header, then pass data packet up the stack */ data_offset = RNDIS_HEADER_SIZE + rndis_pkt->data_offset; - pkt->tot_data_buf_len -= data_offset; - if (pkt->tot_data_buf_len < rndis_pkt->data_length) { - pkt->status = HN_NVS_STATUS_FAILED; + dlen -= data_offset; + if (dlen < rndis_pkt->data_length) { if_printf(rxr->hn_ifp, "total length %u is less than data length %u\n", - pkt->tot_data_buf_len, rndis_pkt->data_length); + dlen, rndis_pkt->data_length); return; } - pkt->tot_data_buf_len = rndis_pkt->data_length; - pkt->data = (void *)((unsigned long)pkt->data + data_offset); + dlen = rndis_pkt->data_length; + data = (const uint8_t *)data + data_offset; if (hv_rf_find_recvinfo(rndis_pkt, &info)) { - pkt->status = HN_NVS_STATUS_FAILED; if_printf(rxr->hn_ifp, "recvinfo parsing failed\n"); return; } - netvsc_recv(rxr, pkt, &info); + netvsc_recv(rxr, data, dlen, &info); } /* @@ -561,30 +559,25 @@ hv_rf_receive_data(struct hn_rx_ring *rx */ int hv_rf_on_receive(netvsc_dev *net_dev, - struct hn_rx_ring *rxr, netvsc_packet *pkt) + struct hn_rx_ring *rxr, const void *data, int dlen) { rndis_device *rndis_dev; const rndis_msg *rndis_hdr; /* Make sure the rndis device state is initialized */ - if (net_dev->extension == NULL) { - pkt->status = HN_NVS_STATUS_FAILED; + if (net_dev->extension == NULL) return (ENODEV); - } rndis_dev = (rndis_device *)net_dev->extension; - if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) { - pkt->status = HN_NVS_STATUS_FAILED; + if (rndis_dev->state == RNDIS_DEV_UNINITIALIZED) return (EINVAL); - } - - rndis_hdr = pkt->data; + rndis_hdr = data; switch (rndis_hdr->ndis_msg_type) { /* data message */ case REMOTE_NDIS_PACKET_MSG: - hv_rf_receive_data(rxr, rndis_hdr, pkt); + hv_rf_receive_data(rxr, data, dlen); break; /* completion messages */ case REMOTE_NDIS_INITIALIZE_CMPLT: Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Thu Aug 18 05:44:58 2016 (r304329) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Thu Aug 18 05:52:03 2016 (r304330) @@ -115,8 +115,8 @@ typedef struct rndis_device_ { struct hn_softc; struct hn_rx_ring; -int hv_rf_on_receive(netvsc_dev *net_dev, - struct hn_rx_ring *rxr, netvsc_packet *pkt); +int hv_rf_on_receive(netvsc_dev *net_dev, struct hn_rx_ring *rxr, + const void *data, int dlen); void hv_rf_receive_rollup(netvsc_dev *net_dev); void hv_rf_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, int nchan, From owner-svn-src-all@freebsd.org Thu Aug 18 06:03:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35DE6BBEAEA; Thu, 18 Aug 2016 06:03:13 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 01B611897; Thu, 18 Aug 2016 06:03:12 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 10DCE104B4F3; Thu, 18 Aug 2016 16:03:03 +1000 (AEST) Date: Thu, 18 Aug 2016 16:03:02 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jung-uk Kim cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304320 - head/secure/lib/libcrypto In-Reply-To: <201608172213.u7HMDdcC043955@repo.freebsd.org> Message-ID: <20160818155154.F822@besplex.bde.org> References: <201608172213.u7HMDdcC043955@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=K1TFXFyNfQ2oaDB8vgkA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 06:03:13 -0000 On Wed, 17 Aug 2016, Jung-uk Kim wrote: > Log: > Disable assembly sources when compiler/assembler cannot compile certain > instructions. For example, GCC 4.2.1 + binutils 2.17.50 does not support > AVX instructions. > > Reported by: bde > MFC after: 2 weeks Thanks. I tried WITHOUT_SSL to work around this, but that was broken too. WITHOUT_SSL removes too many things, but not enough for makeworld to actually work. I sent the list to bdrewery. He already knows about the problem of course. Bruce From owner-svn-src-all@freebsd.org Thu Aug 18 06:03:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F240BBEB51; Thu, 18 Aug 2016 06:03:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C1FA1A10; Thu, 18 Aug 2016 06:03:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I63tYv018818; Thu, 18 Aug 2016 06:03:55 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I63tWj018817; Thu, 18 Aug 2016 06:03:55 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608180603.u7I63tWj018817@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 18 Aug 2016 06:03:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304331 - head/sys/dev/hyperv/utilities 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 06:03:56 -0000 Author: sephe Date: Thu Aug 18 06:03:55 2016 New Revision: 304331 URL: https://svnweb.freebsd.org/changeset/base/304331 Log: hyperv/kvp: Remove unnecessary function parameter. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7550 Modified: head/sys/dev/hyperv/utilities/hv_kvp.c Modified: head/sys/dev/hyperv/utilities/hv_kvp.c ============================================================================== --- head/sys/dev/hyperv/utilities/hv_kvp.c Thu Aug 18 05:52:03 2016 (r304330) +++ head/sys/dev/hyperv/utilities/hv_kvp.c Thu Aug 18 06:03:55 2016 (r304331) @@ -217,10 +217,9 @@ hv_kvp_transaction_init(hv_kvp_sc *sc, u * hv_kvp - version neogtiation function */ static void -hv_kvp_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, - struct hv_vmbus_icmsg_negotiate *negop, - uint8_t *buf) +hv_kvp_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, uint8_t *buf) { + struct hv_vmbus_icmsg_negotiate *negop; int icframe_vercnt; int icmsg_vercnt; @@ -641,7 +640,7 @@ hv_kvp_process_request(void *context, in hv_kvp_transaction_init(sc, recvlen, requestid, kvp_buf); if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - hv_kvp_negotiate_version(icmsghdrp, NULL, kvp_buf); + hv_kvp_negotiate_version(icmsghdrp, kvp_buf); hv_kvp_respond_host(sc, ret); /* From owner-svn-src-all@freebsd.org Thu Aug 18 06:29:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76936BBEE42; Thu, 18 Aug 2016 06:29:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5298F141A; Thu, 18 Aug 2016 06:29:08 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I6T7O4026394; Thu, 18 Aug 2016 06:29:07 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I6T7ik026391; Thu, 18 Aug 2016 06:29:07 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180629.u7I6T7ik026391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 06:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304332 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 06:29:08 -0000 Author: yongari Date: Thu Aug 18 06:29:07 2016 New Revision: 304332 URL: https://svnweb.freebsd.org/changeset/base/304332 Log: Introduce axge_rxfilter() which configures RX filtering and replace axge_setmulti()/axge_setpromisc() with axge_rxfilter(). Multicast filter programming and promiscuous mode requires access to a common RX configuration register so there is no need to use separate functions with added complexity. axge_rxfilter() does not read back AXGE_RCR register since accessing a register in USB is too slow and we already have all knowledge of required configuration. Rebuilding RX filter configuration is simpler and faster than manipulating every bits after reading back the register. Note, axge_rxfilter() does not set RCR_IPE(IP header alignment on 32bit boundary) to disable extra padding bytes insertion. The extra padding wastes ethernet to USB host bandwidth as well as complicating RX handling logic. Current USB framework requires copying RX frames to mbufs so there is no need to worry about alignment. Previously axge_rx_frame() performed wrong bound check due to the extra padding and it was broken when RX checksum offloading is disabled. See added comment in axge_rx_frame () for actual RX packet layout. In axge_init(), disable WOL. It's meaningless to enable WOL in normal operation. In axge_rxeof(), use properly sized mbuf rather than blindly allocating a mbuf cluster. Use RX H/W checksum offloading only when administrator requested RX checksum offloading. Previously it always used RX H/W checksum offloading result regardless of RX checksum offloading state. Separate L4 checksum offloading validation from L3 one and properly set required offloading bits for each layer. This is to fix setting L4 checksum offloading bits for L3 packets. There are still lots of RX errors(probably RX FIFO overflows) under moderate load. Users are strongly recommended to enable ethernet flow control. Reviewed by: kevlo (initial version), hselasky Modified: head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:03:55 2016 (r304331) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:29:07 2016 (r304332) @@ -104,8 +104,7 @@ static uether_fn_t axge_init; static uether_fn_t axge_stop; static uether_fn_t axge_start; static uether_fn_t axge_tick; -static uether_fn_t axge_setmulti; -static uether_fn_t axge_setpromisc; +static uether_fn_t axge_rxfilter; static int axge_read_mem(struct axge_softc *, uint8_t, uint16_t, uint16_t, void *, int); @@ -200,8 +199,8 @@ static const struct usb_ether_methods ax .ue_init = axge_init, .ue_stop = axge_stop, .ue_tick = axge_tick, - .ue_setmulti = axge_setmulti, - .ue_setpromisc = axge_setpromisc, + .ue_setmulti = axge_rxfilter, + .ue_setpromisc = axge_rxfilter, .ue_mii_upd = axge_ifmedia_upd, .ue_mii_sts = axge_ifmedia_sts, }; @@ -727,7 +726,7 @@ axge_tick(struct usb_ether *ue) } static void -axge_setmulti(struct usb_ether *ue) +axge_rxfilter(struct usb_ether *ue) { struct axge_softc *sc; struct ifnet *ifp; @@ -741,14 +740,26 @@ axge_setmulti(struct usb_ether *ue) h = 0; AXGE_LOCK_ASSERT(sc, MA_OWNED); - rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); + /* + * Configure RX settings. + * Don't set RCR_IPE(IP header alignment on 32bit boundary) to disable + * inserting extra padding bytes. This wastes ethernet to USB host + * bandwidth as well as complicating RX handling logic. Current USB + * framework requires copying RX frames to mbufs so there is no need + * to worry about alignment. + */ + rxmode = RCR_DROP_CRCERR | RCR_START; + if (ifp->if_flags & IFF_BROADCAST) + rxmode |= RCR_ACPT_BCAST; if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + if (ifp->if_flags & IFF_PROMISC) + rxmode |= RCR_PROMISC; rxmode |= RCR_ACPT_ALL_MCAST; axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); return; } - rxmode &= ~RCR_ACPT_ALL_MCAST; + rxmode |= RCR_ACPT_MCAST; if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -764,26 +775,6 @@ axge_setmulti(struct usb_ether *ue) } static void -axge_setpromisc(struct usb_ether *ue) -{ - struct axge_softc *sc; - struct ifnet *ifp; - uint16_t rxmode; - - sc = uether_getsc(ue); - ifp = uether_getifp(ue); - rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR); - - if (ifp->if_flags & IFF_PROMISC) - rxmode |= RCR_PROMISC; - else - rxmode &= ~RCR_PROMISC; - - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); - axge_setmulti(ue); -} - -static void axge_start(struct usb_ether *ue) { struct axge_softc *sc; @@ -801,7 +792,6 @@ axge_init(struct usb_ether *ue) { struct axge_softc *sc; struct ifnet *ifp; - uint16_t rxmode; sc = uether_getsc(ue); ifp = uether_getifp(ue); @@ -827,25 +817,22 @@ axge_init(struct usb_ether *ue) /* Configure TX/RX checksum offloading. */ axge_csum_cfg(ue); - /* Configure RX settings. */ - rxmode = (RCR_ACPT_MCAST | RCR_START | RCR_DROP_CRCERR); - if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) - rxmode |= RCR_IPE; - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) - rxmode |= RCR_PROMISC; - - if (ifp->if_flags & IFF_BROADCAST) - rxmode |= RCR_ACPT_BCAST; - - axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, rxmode); + /* Configure RX filters. */ + axge_rxfilter(ue); - axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_MMSR, - MMSR_PME_TYPE | MMSR_PME_POL | MMSR_RWMP); + /* + * XXX + * Controller supports wakeup on link change detection, + * magic packet and wakeup frame recpetion. But it seems + * there is no framework for USB ethernet suspend/wakeup. + * Disable all wakeup functions. + */ + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_MMSR, 0); + (void)axge_read_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_MMSR); - /* Load the multicast filter. */ - axge_setmulti(ue); + /* Configure default medium type. */ + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MSR, MSR_GM | MSR_FD | + MSR_RFC | MSR_TFC | MSR_RE); usbd_xfer_set_stall(sc->sc_xfer[AXGE_BULK_DT_WR]); @@ -921,12 +908,12 @@ axge_ioctl(struct ifnet *ifp, u_long cmd static void axge_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen) { - uint32_t pos; - uint32_t pkt_cnt; + struct axge_frame_rxhdr pkt_hdr; uint32_t rxhdr; - uint32_t pkt_hdr; + uint32_t pos; + uint32_t pkt_cnt, pkt_end; uint32_t hdr_off; - uint32_t pktlen; + uint32_t pktlen; /* verify we have enough data */ if (actlen < (int)sizeof(rxhdr)) @@ -937,41 +924,47 @@ axge_rx_frame(struct usb_ether *ue, stru usbd_copy_out(pc, actlen - sizeof(rxhdr), &rxhdr, sizeof(rxhdr)); rxhdr = le32toh(rxhdr); - pkt_cnt = (uint16_t)rxhdr; - hdr_off = (uint16_t)(rxhdr >> 16); + pkt_cnt = rxhdr & 0xFFFF; + hdr_off = pkt_end = (rxhdr >> 16) & 0xFFFF; + /* + * <----------------------- actlen ------------------------> + * [frame #0]...[frame #N][pkt_hdr #0]...[pkt_hdr #N][rxhdr] + * Each RX frame would be aligned on 8 bytes boundary. If + * RCR_IPE bit is set in AXGE_RCR register, there would be 2 + * padding bytes and 6 dummy bytes(as the padding also should + * be aligned on 8 bytes boundary) for each RX frame to align + * IP header on 32bits boundary. Driver don't set RCR_IPE bit + * of AXGE_RCR register, so there should be no padding bytes + * which simplifies RX logic a lot. + */ while (pkt_cnt--) { /* verify the header offset */ if ((int)(hdr_off + sizeof(pkt_hdr)) > actlen) { DPRINTF("End of packet headers\n"); break; } - if ((int)pos >= actlen) { + usbd_copy_out(pc, hdr_off, &pkt_hdr, sizeof(pkt_hdr)); + pkt_hdr.status = le32toh(pkt_hdr.status); + pktlen = AXGE_RXBYTES(pkt_hdr.status); + if (pos + pktlen > pkt_end) { DPRINTF("Data position reached end\n"); break; } - usbd_copy_out(pc, hdr_off, &pkt_hdr, sizeof(pkt_hdr)); - pkt_hdr = le32toh(pkt_hdr); - pktlen = (pkt_hdr >> 16) & 0x1fff; - if (pkt_hdr & (AXGE_RXHDR_CRC_ERR | AXGE_RXHDR_DROP_ERR)) { + if (AXGE_RX_ERR(pkt_hdr.status) != 0) { DPRINTF("Dropped a packet\n"); if_inc_counter(ue->ue_ifp, IFCOUNTER_IERRORS, 1); - } - if (pktlen >= 6 && (int)(pos + pktlen) <= actlen) { - axge_rxeof(ue, pc, pos + 2, pktlen - 6, pkt_hdr); - } else { - DPRINTF("Invalid packet pos=%d len=%d\n", - (int)pos, (int)pktlen); - } + } else + axge_rxeof(ue, pc, pos, pktlen, pkt_hdr.status); pos += (pktlen + 7) & ~7; hdr_off += sizeof(pkt_hdr); } } static void -axge_rxeof(struct usb_ether *ue, struct usb_page_cache *pc, - unsigned int offset, unsigned int len, uint32_t pkt_hdr) +axge_rxeof(struct usb_ether *ue, struct usb_page_cache *pc, unsigned int offset, + unsigned int len, uint32_t status) { struct ifnet *ifp; struct mbuf *m; @@ -982,29 +975,34 @@ axge_rxeof(struct usb_ether *ue, struct return; } - m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + if (len > MHLEN - ETHER_ALIGN) + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + else + m = m_gethdr(M_NOWAIT, MT_DATA); if (m == NULL) { if_inc_counter(ifp, IFCOUNTER_IQDROPS, 1); return; } m->m_pkthdr.rcvif = ifp; - m->m_len = m->m_pkthdr.len = len + ETHER_ALIGN; - m_adj(m, ETHER_ALIGN); + m->m_len = m->m_pkthdr.len = len; + m->m_data += ETHER_ALIGN; usbd_copy_out(pc, offset, mtod(m, uint8_t *), len); - if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - - if ((pkt_hdr & (AXGE_RXHDR_L4CSUM_ERR | AXGE_RXHDR_L3CSUM_ERR)) == 0) { - if ((pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) == - AXGE_RXHDR_L4_TYPE_TCP || - (pkt_hdr & AXGE_RXHDR_L4_TYPE_MASK) == - AXGE_RXHDR_L4_TYPE_UDP) { + if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) { + if ((status & AXGE_RX_L3_CSUM_ERR) == 0 && + (status & AXGE_RX_L3_TYPE_MASK) == AXGE_RX_L3_TYPE_IPV4) + m->m_pkthdr.csum_flags |= CSUM_IP_CHECKED | + CSUM_IP_VALID; + if ((status & AXGE_RX_L4_CSUM_ERR) == 0 && + ((status & AXGE_RX_L4_TYPE_MASK) == AXGE_RX_L4_TYPE_UDP || + (status & AXGE_RX_L4_TYPE_MASK) == AXGE_RX_L4_TYPE_TCP)) { m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | - CSUM_PSEUDO_HDR | CSUM_IP_CHECKED | CSUM_IP_VALID; + CSUM_PSEUDO_HDR; m->m_pkthdr.csum_data = 0xffff; } } + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); _IF_ENQUEUE(&ue->ue_rxq, m); } Modified: head/sys/dev/usb/net/if_axgereg.h ============================================================================== --- head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 06:03:55 2016 (r304331) +++ head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 06:29:07 2016 (r304332) @@ -142,14 +142,6 @@ #define AXGE_CONFIG_IDX 0 /* config number 1 */ #define AXGE_IFACE_IDX 0 -#define AXGE_RXHDR_L4_TYPE_MASK 0x1c -#define AXGE_RXHDR_L4CSUM_ERR 1 -#define AXGE_RXHDR_L3CSUM_ERR 2 -#define AXGE_RXHDR_L4_TYPE_UDP 4 -#define AXGE_RXHDR_L4_TYPE_TCP 16 -#define AXGE_RXHDR_CRC_ERR 0x20000000 -#define AXGE_RXHDR_DROP_ERR 0x80000000 - #define GET_MII(sc) uether_getmii(&(sc)->sc_ue) /* The interrupt endpoint is currently unused by the ASIX part. */ @@ -181,6 +173,33 @@ struct axge_frame_txhdr { #define AXGE_PHY_ADDR 3 +struct axge_frame_rxhdr { + uint32_t status; +#define AXGE_RX_L4_CSUM_ERR 0x00000001 +#define AXGE_RX_L3_CSUM_ERR 0x00000002 +#define AXGE_RX_L4_TYPE_UDP 0x00000004 +#define AXGE_RX_L4_TYPE_ICMP 0x00000008 +#define AXGE_RX_L4_TYPE_IGMP 0x0000000C +#define AXGE_RX_L4_TYPE_TCP 0x00000010 +#define AXGE_RX_L4_TYPE_MASK 0x0000001C +#define AXGE_RX_L3_TYPE_IPV4 0x00000020 +#define AXGE_RX_L3_TYPE_IPV6 0x00000040 +#define AXGE_RX_L3_TYPE_MASK 0x00000060 +#define AXGE_RX_VLAN_IND_MASK 0x00000700 +#define AXGE_RX_GOOD_PKT 0x00000800 +#define AXGE_RX_VLAN_PRI_MASK 0x00007000 +#define AXGE_RX_MBCAST 0x00008000 +#define AXGE_RX_LEN_MASK 0x1FFF0000 +#define AXGE_RX_CRC_ERR 0x20000000 +#define AXGE_RX_MII_ERR 0x40000000 +#define AXGE_RX_DROP_PKT 0x80000000 +#define AXGE_RX_LEN_SHIFT 16 +} __packed; + +#define AXGE_RXBYTES(x) (((x) & AXGE_RX_LEN_MASK) >> AXGE_RX_LEN_SHIFT) +#define AXGE_RX_ERR(x) \ + ((x) & (AXGE_RX_CRC_ERR | AXGE_RX_MII_ERR | AXGE_RX_DROP_PKT)) + struct axge_softc { struct usb_ether sc_ue; struct mtx sc_mtx; From owner-svn-src-all@freebsd.org Thu Aug 18 06:35:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 096BBBBEF97; Thu, 18 Aug 2016 06:35:11 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEC13183A; Thu, 18 Aug 2016 06:35:10 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I6ZAhL030092; Thu, 18 Aug 2016 06:35:10 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I6ZAVh030091; Thu, 18 Aug 2016 06:35:10 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180635.u7I6ZAVh030091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 06:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304333 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 06:35:11 -0000 Author: yongari Date: Thu Aug 18 06:35:09 2016 New Revision: 304333 URL: https://svnweb.freebsd.org/changeset/base/304333 Log: When usbd_transfer_setup() fails, don't call usbd_transfer_unsetup(). Modified: head/sys/dev/usb/net/if_axge.c Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:29:07 2016 (r304332) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:35:09 2016 (r304333) @@ -553,7 +553,8 @@ axge_attach(device_t dev) sc->sc_xfer, axge_config, AXGE_N_TRANSFER, sc, &sc->sc_mtx); if (error) { device_printf(dev, "allocating USB transfers failed\n"); - goto detach; + mtx_destroy(&sc->sc_mtx); + return (ENXIO); } ue->ue_sc = sc; From owner-svn-src-all@freebsd.org Thu Aug 18 06:39:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27A68BBD015; Thu, 18 Aug 2016 06:39:11 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02E0119F3; Thu, 18 Aug 2016 06:39:10 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I6dAmB030263; Thu, 18 Aug 2016 06:39:10 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I6d9op030256; Thu, 18 Aug 2016 06:39:09 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201608180639.u7I6d9op030256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 18 Aug 2016 06:39:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304334 - in head/lib/libc: net 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 06:39:11 -0000 Author: kevlo Date: Thu Aug 18 06:39:09 2016 New Revision: 304334 URL: https://svnweb.freebsd.org/changeset/base/304334 Log: Remove from the SYNOPSIS. Modified: head/lib/libc/net/inet_net.3 head/lib/libc/sys/bind.2 head/lib/libc/sys/connect.2 head/lib/libc/sys/listen.2 head/lib/libc/sys/recv.2 head/lib/libc/sys/send.2 head/lib/libc/sys/socket.2 Modified: head/lib/libc/net/inet_net.3 ============================================================================== --- head/lib/libc/net/inet_net.3 Thu Aug 18 06:35:09 2016 (r304333) +++ head/lib/libc/net/inet_net.3 Thu Aug 18 06:39:09 2016 (r304334) @@ -32,7 +32,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 26, 2006 +.Dd August 18, 2016 .Dt INET_NET 3 .Os .Sh NAME @@ -42,7 +42,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .In netinet/in.h .In arpa/inet.h Modified: head/lib/libc/sys/bind.2 ============================================================================== --- head/lib/libc/sys/bind.2 Thu Aug 18 06:35:09 2016 (r304333) +++ head/lib/libc/sys/bind.2 Thu Aug 18 06:39:09 2016 (r304334) @@ -28,7 +28,7 @@ .\" @(#)bind.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 26, 2014 +.Dd August 18, 2016 .Dt BIND 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft int .Fn bind "int s" "const struct sockaddr *addr" "socklen_t addrlen" Modified: head/lib/libc/sys/connect.2 ============================================================================== --- head/lib/libc/sys/connect.2 Thu Aug 18 06:35:09 2016 (r304333) +++ head/lib/libc/sys/connect.2 Thu Aug 18 06:39:09 2016 (r304334) @@ -28,7 +28,7 @@ .\" @(#)connect.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd February 4, 2016 +.Dd August 18, 2016 .Dt CONNECT 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft int .Fn connect "int s" "const struct sockaddr *name" "socklen_t namelen" Modified: head/lib/libc/sys/listen.2 ============================================================================== --- head/lib/libc/sys/listen.2 Thu Aug 18 06:35:09 2016 (r304333) +++ head/lib/libc/sys/listen.2 Thu Aug 18 06:39:09 2016 (r304334) @@ -28,7 +28,7 @@ .\" From: @(#)listen.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd July 15, 2014 +.Dd August 18, 2016 .Dt LISTEN 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft int .Fn listen "int s" "int backlog" Modified: head/lib/libc/sys/recv.2 ============================================================================== --- head/lib/libc/sys/recv.2 Thu Aug 18 06:35:09 2016 (r304333) +++ head/lib/libc/sys/recv.2 Thu Aug 18 06:39:09 2016 (r304334) @@ -28,7 +28,7 @@ .\" @(#)recv.2 8.3 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd January 29, 2016 +.Dd August 18, 2016 .Dt RECV 2 .Os .Sh NAME @@ -40,7 +40,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft ssize_t .Fn recv "int s" "void *buf" "size_t len" "int flags" Modified: head/lib/libc/sys/send.2 ============================================================================== --- head/lib/libc/sys/send.2 Thu Aug 18 06:35:09 2016 (r304333) +++ head/lib/libc/sys/send.2 Thu Aug 18 06:39:09 2016 (r304334) @@ -28,7 +28,7 @@ .\" From: @(#)send.2 8.2 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd January 29, 2016 +.Dd August 18, 2016 .Dt SEND 2 .Os .Sh NAME @@ -40,7 +40,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft ssize_t .Fn send "int s" "const void *msg" "size_t len" "int flags" Modified: head/lib/libc/sys/socket.2 ============================================================================== --- head/lib/libc/sys/socket.2 Thu Aug 18 06:35:09 2016 (r304333) +++ head/lib/libc/sys/socket.2 Thu Aug 18 06:39:09 2016 (r304334) @@ -28,7 +28,7 @@ .\" From: @(#)socket.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd March 19, 2013 +.Dd August 18, 2016 .Dt SOCKET 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In sys/socket.h .Ft int .Fn socket "int domain" "int type" "int protocol" From owner-svn-src-all@freebsd.org Thu Aug 18 06:46:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B780BBD420; Thu, 18 Aug 2016 06:46:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E34F11B3; Thu, 18 Aug 2016 06:46:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I6kE8H033790; Thu, 18 Aug 2016 06:46:14 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I6kE4f033789; Thu, 18 Aug 2016 06:46:14 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180646.u7I6kE4f033789@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 06:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304335 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 06:46:15 -0000 Author: yongari Date: Thu Aug 18 06:46:14 2016 New Revision: 304335 URL: https://svnweb.freebsd.org/changeset/base/304335 Log: In axge_stop(), clear medium receive enable bit which will stop RX MAC operation. Modified: head/sys/dev/usb/net/if_axge.c Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:39:09 2016 (r304334) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:46:14 2016 (r304335) @@ -847,12 +847,17 @@ axge_stop(struct usb_ether *ue) { struct axge_softc *sc; struct ifnet *ifp; + uint16_t val; sc = uether_getsc(ue); ifp = uether_getifp(ue); AXGE_LOCK_ASSERT(sc, MA_OWNED); + val = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MSR); + val &= ~MSR_RE; + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MSR, val); + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); sc->sc_flags &= ~AXGE_FLAG_LINK; From owner-svn-src-all@freebsd.org Thu Aug 18 06:50:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E3FBBBD5EE; Thu, 18 Aug 2016 06:50:25 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from vps1.elischer.org (vps1.elischer.org [204.109.63.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "vps1.elischer.org", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B2CF13E0; Thu, 18 Aug 2016 06:50:25 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-226-8.lns20.per1.internode.on.net [121.45.226.8]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u7I6oEwm000886 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 17 Aug 2016 23:50:17 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd To: John Baldwin , src-committers@freebsd.org References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Julian Elischer Message-ID: <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> Date: Thu, 18 Aug 2016 14:50:08 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <2065331.KaGOSftJhd@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 06:50:25 -0000 On 16/08/2016 4:54 AM, John Baldwin wrote: > On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >> Author: jhb >> Date: Mon Aug 15 20:38:02 2016 >> New Revision: 304187 >> URL: https://svnweb.freebsd.org/changeset/base/304187 >> >> Log: >> Remove the mcd(4) driver for Mitsumi CD-ROM players. >> >> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in >> the manpage, this driver is only useful as a backend to cdcontrol to >> play audio CDs since it doesn't use DMA, so its data performance is >> "abysmal" (and that was true in the mid 90's). > No one stepped up to test patches for it either when I last posted patches to > convert it from timeout(9) to callout(9). I have a few more drivers that are > both very old and that people have no business using in 12 (think ISA > adapters that don't do DMA and can't be used with pccard) that I will be > removing over the next little while. I brought up a list of drivers on arch@ > a couple of years ago and the conversation drifted off into the weeds about > trimming GENERIC, etc. No one objected to the specific drivers I listed > though (and I got a few pleas of "please remove"). If someone shows up > desperately clutching an ISA adapter they can always dig up the source from > svn and deal with forward porting it for whatever API changes have happened > since it was removed. I would imagine any machine still holding one of these probably has not enough memory to run FreeBSD. would we still run in 2MB? > From owner-svn-src-all@freebsd.org Thu Aug 18 07:11:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC22FBBDB83; Thu, 18 Aug 2016 07:11:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC72B1D5E; Thu, 18 Aug 2016 07:11:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I7BVGY044701; Thu, 18 Aug 2016 07:11:31 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I7BVRt044700; Thu, 18 Aug 2016 07:11:31 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608180711.u7I7BVRt044700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Thu, 18 Aug 2016 07:11:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304336 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 07:11:33 -0000 Author: yongari Date: Thu Aug 18 07:11:31 2016 New Revision: 304336 URL: https://svnweb.freebsd.org/changeset/base/304336 Log: When device is detached make sure to stop the controller and make it return zero-length USB packet. Modified: head/sys/dev/usb/net/if_axge.c Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 06:46:14 2016 (r304335) +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 07:11:31 2016 (r304336) @@ -580,9 +580,27 @@ axge_detach(device_t dev) { struct axge_softc *sc; struct usb_ether *ue; + uint16_t val; sc = device_get_softc(dev); ue = &sc->sc_ue; + if (device_is_attached(dev)) { + AXGE_LOCK(sc); + /* + * XXX + * ether_ifdetach(9) should be called first. + */ + axge_stop(ue); + /* Force bulk-in to return a zero-length USB packet. */ + val = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_EPPRCR); + val |= EPPRCR_BZ | EPPRCR_IPRL; + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_EPPRCR, val); + /* Change clock. */ + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, AXGE_CLK_SELECT, 0); + /* Disable MAC. */ + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RCR, 0); + AXGE_UNLOCK(sc); + } usbd_transfer_unsetup(sc->sc_xfer, AXGE_N_TRANSFER); uether_ifdetach(ue); mtx_destroy(&sc->sc_mtx); From owner-svn-src-all@freebsd.org Thu Aug 18 07:31:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB7BEBBE013; Thu, 18 Aug 2016 07:31:20 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8861815E8; Thu, 18 Aug 2016 07:31:20 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I7VJ2r051282; Thu, 18 Aug 2016 07:31:19 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I7VJYd051276; Thu, 18 Aug 2016 07:31:19 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201608180731.u7I7VJYd051276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 18 Aug 2016 07:31:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304337 - stable/11/sys/dev/e1000 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 07:31:20 -0000 Author: sbruno Date: Thu Aug 18 07:31:19 2016 New Revision: 304337 URL: https://svnweb.freebsd.org/changeset/base/304337 Log: MFC r304149 e1000: Add support for Kaby Lake IDs Fixup some errors when transitioning to/from low power states. Modified: stable/11/sys/dev/e1000/e1000_api.c stable/11/sys/dev/e1000/e1000_hw.h stable/11/sys/dev/e1000/e1000_ich8lan.c stable/11/sys/dev/e1000/e1000_ich8lan.h stable/11/sys/dev/e1000/e1000_phy.c stable/11/sys/dev/e1000/if_em.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/e1000/e1000_api.c ============================================================================== --- stable/11/sys/dev/e1000/e1000_api.c Thu Aug 18 07:11:31 2016 (r304336) +++ stable/11/sys/dev/e1000/e1000_api.c Thu Aug 18 07:31:19 2016 (r304337) @@ -304,6 +304,10 @@ s32 e1000_set_mac_type(struct e1000_hw * case E1000_DEV_ID_PCH_SPT_I219_LM2: case E1000_DEV_ID_PCH_SPT_I219_V2: case E1000_DEV_ID_PCH_LBG_I219_LM3: + case E1000_DEV_ID_PCH_SPT_I219_LM4: + case E1000_DEV_ID_PCH_SPT_I219_V4: + case E1000_DEV_ID_PCH_SPT_I219_LM5: + case E1000_DEV_ID_PCH_SPT_I219_V5: mac->type = e1000_pch_spt; break; case E1000_DEV_ID_82575EB_COPPER: Modified: stable/11/sys/dev/e1000/e1000_hw.h ============================================================================== --- stable/11/sys/dev/e1000/e1000_hw.h Thu Aug 18 07:11:31 2016 (r304336) +++ stable/11/sys/dev/e1000/e1000_hw.h Thu Aug 18 07:31:19 2016 (r304337) @@ -142,6 +142,10 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_SPT_I219_LM2 0x15B7 /* Sunrise Point-H PCH */ #define E1000_DEV_ID_PCH_SPT_I219_V2 0x15B8 /* Sunrise Point-H PCH */ #define E1000_DEV_ID_PCH_LBG_I219_LM3 0x15B9 /* LEWISBURG PCH */ +#define E1000_DEV_ID_PCH_SPT_I219_LM4 0x15D7 +#define E1000_DEV_ID_PCH_SPT_I219_V4 0x15D8 +#define E1000_DEV_ID_PCH_SPT_I219_LM5 0x15E3 +#define E1000_DEV_ID_PCH_SPT_I219_V5 0x15D6 #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 @@ -957,9 +961,13 @@ struct e1000_dev_spec_ich8lan { E1000_MUTEX nvm_mutex; E1000_MUTEX swflag_mutex; bool nvm_k1_enabled; + bool disable_k1_off; bool eee_disable; u16 eee_lp_ability; enum e1000_ulp_state ulp_state; + bool ulp_capability_disabled; + bool during_suspend_flow; + bool during_dpg_exit; }; struct e1000_dev_spec_82575 { Modified: stable/11/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- stable/11/sys/dev/e1000/e1000_ich8lan.c Thu Aug 18 07:11:31 2016 (r304336) +++ stable/11/sys/dev/e1000/e1000_ich8lan.c Thu Aug 18 07:31:19 2016 (r304337) @@ -288,7 +288,7 @@ static void e1000_toggle_lanphypc_pch_lp mac_reg &= ~E1000_CTRL_LANPHYPC_VALUE; E1000_WRITE_REG(hw, E1000_CTRL, mac_reg); E1000_WRITE_FLUSH(hw); - usec_delay(10); + msec_delay(1); mac_reg &= ~E1000_CTRL_LANPHYPC_OVERRIDE; E1000_WRITE_REG(hw, E1000_CTRL, mac_reg); E1000_WRITE_FLUSH(hw); @@ -1625,7 +1625,17 @@ static s32 e1000_check_for_copper_link_i hw->phy.ops.write_reg_locked(hw, I217_PLL_CLOCK_GATE_REG, phy_reg); - } + + if (speed == SPEED_1000) { + hw->phy.ops.read_reg_locked(hw, HV_PM_CTRL, + &phy_reg); + + phy_reg |= HV_PM_CTRL_K1_CLK_REQ; + + hw->phy.ops.write_reg_locked(hw, HV_PM_CTRL, + phy_reg); + } + } hw->phy.ops.release(hw); if (ret_val) @@ -1718,7 +1728,8 @@ static s32 e1000_check_for_copper_link_i u32 pcieanacfg = E1000_READ_REG(hw, E1000_PCIEANACFG); u32 fextnvm6 = E1000_READ_REG(hw, E1000_FEXTNVM6); - if (pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE) + if ((pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE) && + (hw->dev_spec.ich8lan.disable_k1_off == FALSE)) fextnvm6 |= E1000_FEXTNVM6_K1_OFF_ENABLE; else fextnvm6 &= ~E1000_FEXTNVM6_K1_OFF_ENABLE; Modified: stable/11/sys/dev/e1000/e1000_ich8lan.h ============================================================================== --- stable/11/sys/dev/e1000/e1000_ich8lan.h Thu Aug 18 07:11:31 2016 (r304336) +++ stable/11/sys/dev/e1000/e1000_ich8lan.h Thu Aug 18 07:31:19 2016 (r304337) @@ -239,7 +239,7 @@ /* PHY Power Management Control */ #define HV_PM_CTRL PHY_REG(770, 17) -#define HV_PM_CTRL_PLL_STOP_IN_K1_GIGA 0x100 +#define HV_PM_CTRL_K1_CLK_REQ 0x200 #define HV_PM_CTRL_K1_ENABLE 0x4000 #define I217_PLL_CLOCK_GATE_REG PHY_REG(772, 28) Modified: stable/11/sys/dev/e1000/e1000_phy.c ============================================================================== --- stable/11/sys/dev/e1000/e1000_phy.c Thu Aug 18 07:11:31 2016 (r304336) +++ stable/11/sys/dev/e1000/e1000_phy.c Thu Aug 18 07:31:19 2016 (r304337) @@ -4146,12 +4146,13 @@ s32 e1000_read_phy_reg_mphy(struct e1000 *data = E1000_READ_REG(hw, E1000_MPHY_DATA); /* Disable access to mPHY if it was originally disabled */ - if (locked) { + if (locked) ready = e1000_is_mphy_ready(hw); - if (!ready) - return -E1000_ERR_PHY; - } - E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS); + if (!ready) + return -E1000_ERR_PHY; + E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, + E1000_MPHY_DIS_ACCESS); + return E1000_SUCCESS; } @@ -4210,12 +4211,13 @@ s32 e1000_write_phy_reg_mphy(struct e100 E1000_WRITE_REG(hw, E1000_MPHY_DATA, data); /* Disable access to mPHY if it was originally disabled */ - if (locked) { + if (locked) ready = e1000_is_mphy_ready(hw); - if (!ready) - return -E1000_ERR_PHY; - } - E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS); + if (!ready) + return -E1000_ERR_PHY; + E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, + E1000_MPHY_DIS_ACCESS); + return E1000_SUCCESS; } Modified: stable/11/sys/dev/e1000/if_em.c ============================================================================== --- stable/11/sys/dev/e1000/if_em.c Thu Aug 18 07:11:31 2016 (r304336) +++ stable/11/sys/dev/e1000/if_em.c Thu Aug 18 07:31:19 2016 (r304337) @@ -193,6 +193,12 @@ static em_vendor_info_t em_vendor_info_a { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V2, PCI_ANY_ID, PCI_ANY_ID, 0}, { 0x8086, E1000_DEV_ID_PCH_LBG_I219_LM3, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_LM4, + PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V4, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_LM5, + PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V5, PCI_ANY_ID, PCI_ANY_ID, 0}, /* required last entry */ { 0, 0, 0, 0, 0} }; From owner-svn-src-all@freebsd.org Thu Aug 18 07:32:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31883BBE11B; Thu, 18 Aug 2016 07:32:05 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F6B91889; Thu, 18 Aug 2016 07:32:04 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I7W3CM051941; Thu, 18 Aug 2016 07:32:03 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I7W2Wx051934; Thu, 18 Aug 2016 07:32:02 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201608180732.u7I7W2Wx051934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Thu, 18 Aug 2016 07:32:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304338 - stable/10/sys/dev/e1000 X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 07:32:05 -0000 Author: sbruno Date: Thu Aug 18 07:32:02 2016 New Revision: 304338 URL: https://svnweb.freebsd.org/changeset/base/304338 Log: MFC r304149 e1000: Add support for Kaby Lake IDs Fixup some errors when transitioning to/from low power states. Modified: stable/10/sys/dev/e1000/e1000_api.c stable/10/sys/dev/e1000/e1000_hw.h stable/10/sys/dev/e1000/e1000_ich8lan.c stable/10/sys/dev/e1000/e1000_ich8lan.h stable/10/sys/dev/e1000/e1000_phy.c stable/10/sys/dev/e1000/if_em.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/e1000/e1000_api.c ============================================================================== --- stable/10/sys/dev/e1000/e1000_api.c Thu Aug 18 07:31:19 2016 (r304337) +++ stable/10/sys/dev/e1000/e1000_api.c Thu Aug 18 07:32:02 2016 (r304338) @@ -304,6 +304,10 @@ s32 e1000_set_mac_type(struct e1000_hw * case E1000_DEV_ID_PCH_SPT_I219_LM2: case E1000_DEV_ID_PCH_SPT_I219_V2: case E1000_DEV_ID_PCH_LBG_I219_LM3: + case E1000_DEV_ID_PCH_SPT_I219_LM4: + case E1000_DEV_ID_PCH_SPT_I219_V4: + case E1000_DEV_ID_PCH_SPT_I219_LM5: + case E1000_DEV_ID_PCH_SPT_I219_V5: mac->type = e1000_pch_spt; break; case E1000_DEV_ID_82575EB_COPPER: Modified: stable/10/sys/dev/e1000/e1000_hw.h ============================================================================== --- stable/10/sys/dev/e1000/e1000_hw.h Thu Aug 18 07:31:19 2016 (r304337) +++ stable/10/sys/dev/e1000/e1000_hw.h Thu Aug 18 07:32:02 2016 (r304338) @@ -142,6 +142,10 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_SPT_I219_LM2 0x15B7 /* Sunrise Point-H PCH */ #define E1000_DEV_ID_PCH_SPT_I219_V2 0x15B8 /* Sunrise Point-H PCH */ #define E1000_DEV_ID_PCH_LBG_I219_LM3 0x15B9 /* LEWISBURG PCH */ +#define E1000_DEV_ID_PCH_SPT_I219_LM4 0x15D7 +#define E1000_DEV_ID_PCH_SPT_I219_V4 0x15D8 +#define E1000_DEV_ID_PCH_SPT_I219_LM5 0x15E3 +#define E1000_DEV_ID_PCH_SPT_I219_V5 0x15D6 #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 @@ -957,9 +961,13 @@ struct e1000_dev_spec_ich8lan { E1000_MUTEX nvm_mutex; E1000_MUTEX swflag_mutex; bool nvm_k1_enabled; + bool disable_k1_off; bool eee_disable; u16 eee_lp_ability; enum e1000_ulp_state ulp_state; + bool ulp_capability_disabled; + bool during_suspend_flow; + bool during_dpg_exit; }; struct e1000_dev_spec_82575 { Modified: stable/10/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- stable/10/sys/dev/e1000/e1000_ich8lan.c Thu Aug 18 07:31:19 2016 (r304337) +++ stable/10/sys/dev/e1000/e1000_ich8lan.c Thu Aug 18 07:32:02 2016 (r304338) @@ -288,7 +288,7 @@ static void e1000_toggle_lanphypc_pch_lp mac_reg &= ~E1000_CTRL_LANPHYPC_VALUE; E1000_WRITE_REG(hw, E1000_CTRL, mac_reg); E1000_WRITE_FLUSH(hw); - usec_delay(10); + msec_delay(1); mac_reg &= ~E1000_CTRL_LANPHYPC_OVERRIDE; E1000_WRITE_REG(hw, E1000_CTRL, mac_reg); E1000_WRITE_FLUSH(hw); @@ -1625,7 +1625,17 @@ static s32 e1000_check_for_copper_link_i hw->phy.ops.write_reg_locked(hw, I217_PLL_CLOCK_GATE_REG, phy_reg); - } + + if (speed == SPEED_1000) { + hw->phy.ops.read_reg_locked(hw, HV_PM_CTRL, + &phy_reg); + + phy_reg |= HV_PM_CTRL_K1_CLK_REQ; + + hw->phy.ops.write_reg_locked(hw, HV_PM_CTRL, + phy_reg); + } + } hw->phy.ops.release(hw); if (ret_val) @@ -1718,7 +1728,8 @@ static s32 e1000_check_for_copper_link_i u32 pcieanacfg = E1000_READ_REG(hw, E1000_PCIEANACFG); u32 fextnvm6 = E1000_READ_REG(hw, E1000_FEXTNVM6); - if (pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE) + if ((pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE) && + (hw->dev_spec.ich8lan.disable_k1_off == FALSE)) fextnvm6 |= E1000_FEXTNVM6_K1_OFF_ENABLE; else fextnvm6 &= ~E1000_FEXTNVM6_K1_OFF_ENABLE; Modified: stable/10/sys/dev/e1000/e1000_ich8lan.h ============================================================================== --- stable/10/sys/dev/e1000/e1000_ich8lan.h Thu Aug 18 07:31:19 2016 (r304337) +++ stable/10/sys/dev/e1000/e1000_ich8lan.h Thu Aug 18 07:32:02 2016 (r304338) @@ -239,7 +239,7 @@ /* PHY Power Management Control */ #define HV_PM_CTRL PHY_REG(770, 17) -#define HV_PM_CTRL_PLL_STOP_IN_K1_GIGA 0x100 +#define HV_PM_CTRL_K1_CLK_REQ 0x200 #define HV_PM_CTRL_K1_ENABLE 0x4000 #define I217_PLL_CLOCK_GATE_REG PHY_REG(772, 28) Modified: stable/10/sys/dev/e1000/e1000_phy.c ============================================================================== --- stable/10/sys/dev/e1000/e1000_phy.c Thu Aug 18 07:31:19 2016 (r304337) +++ stable/10/sys/dev/e1000/e1000_phy.c Thu Aug 18 07:32:02 2016 (r304338) @@ -4148,10 +4148,10 @@ s32 e1000_read_phy_reg_mphy(struct e1000 /* Disable access to mPHY if it was originally disabled */ if (locked) ready = e1000_is_mphy_ready(hw); - if (!ready) - return -E1000_ERR_PHY; - E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, - E1000_MPHY_DIS_ACCESS); + if (!ready) + return -E1000_ERR_PHY; + E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, + E1000_MPHY_DIS_ACCESS); return E1000_SUCCESS; } @@ -4213,10 +4213,10 @@ s32 e1000_write_phy_reg_mphy(struct e100 /* Disable access to mPHY if it was originally disabled */ if (locked) ready = e1000_is_mphy_ready(hw); - if (!ready) - return -E1000_ERR_PHY; - E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, - E1000_MPHY_DIS_ACCESS); + if (!ready) + return -E1000_ERR_PHY; + E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, + E1000_MPHY_DIS_ACCESS); return E1000_SUCCESS; } Modified: stable/10/sys/dev/e1000/if_em.c ============================================================================== --- stable/10/sys/dev/e1000/if_em.c Thu Aug 18 07:31:19 2016 (r304337) +++ stable/10/sys/dev/e1000/if_em.c Thu Aug 18 07:32:02 2016 (r304338) @@ -192,6 +192,12 @@ static em_vendor_info_t em_vendor_info_a { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V2, PCI_ANY_ID, PCI_ANY_ID, 0}, { 0x8086, E1000_DEV_ID_PCH_LBG_I219_LM3, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_LM4, + PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V4, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_LM5, + PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V5, PCI_ANY_ID, PCI_ANY_ID, 0}, /* required last entry */ { 0, 0, 0, 0, 0} }; From owner-svn-src-all@freebsd.org Thu Aug 18 07:43:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D082BBBE487; Thu, 18 Aug 2016 07:43:19 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE19311DF; Thu, 18 Aug 2016 07:43:19 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I7hIDK056032; Thu, 18 Aug 2016 07:43:18 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I7hIod056027; Thu, 18 Aug 2016 07:43:18 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608180743.u7I7hIod056027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 18 Aug 2016 07:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304339 - in stable/11/bin/sh: . tests/expansion X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 07:43:19 -0000 Author: ache Date: Thu Aug 18 07:43:18 2016 New Revision: 304339 URL: https://svnweb.freebsd.org/changeset/base/304339 Log: MFC r302937 Path generation was not according to collate Approved by: jilles Added: stable/11/bin/sh/tests/expansion/pathname6.0 - copied unchanged from r302937, head/bin/sh/tests/expansion/pathname6.0 Modified: stable/11/bin/sh/expand.c stable/11/bin/sh/tests/expansion/Makefile stable/11/bin/sh/tests/expansion/pathname1.0 stable/11/bin/sh/tests/expansion/pathname2.0 Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/sh/expand.c ============================================================================== --- stable/11/bin/sh/expand.c Thu Aug 18 07:32:02 2016 (r304338) +++ stable/11/bin/sh/expand.c Thu Aug 18 07:43:18 2016 (r304339) @@ -1196,7 +1196,7 @@ expsortcmp(const void *p1, const void *p const char *s1 = *(const char * const *)p1; const char *s2 = *(const char * const *)p2; - return (strcmp(s1, s2)); + return (strcoll(s1, s2)); } Modified: stable/11/bin/sh/tests/expansion/Makefile ============================================================================== --- stable/11/bin/sh/tests/expansion/Makefile Thu Aug 18 07:32:02 2016 (r304338) +++ stable/11/bin/sh/tests/expansion/Makefile Thu Aug 18 07:43:18 2016 (r304339) @@ -66,6 +66,7 @@ ${PACKAGE}FILES+= pathname2.0 ${PACKAGE}FILES+= pathname3.0 ${PACKAGE}FILES+= pathname4.0 ${PACKAGE}FILES+= pathname5.0 +${PACKAGE}FILES+= pathname6.0 ${PACKAGE}FILES+= plus-minus1.0 ${PACKAGE}FILES+= plus-minus2.0 ${PACKAGE}FILES+= plus-minus3.0 Modified: stable/11/bin/sh/tests/expansion/pathname1.0 ============================================================================== --- stable/11/bin/sh/tests/expansion/pathname1.0 Thu Aug 18 07:32:02 2016 (r304338) +++ stable/11/bin/sh/tests/expansion/pathname1.0 Thu Aug 18 07:43:18 2016 (r304339) @@ -1,5 +1,9 @@ # $FreeBSD$ +unset LC_ALL +LC_COLLATE=C +export LC_COLLATE + failures=0 check() { Modified: stable/11/bin/sh/tests/expansion/pathname2.0 ============================================================================== --- stable/11/bin/sh/tests/expansion/pathname2.0 Thu Aug 18 07:32:02 2016 (r304338) +++ stable/11/bin/sh/tests/expansion/pathname2.0 Thu Aug 18 07:43:18 2016 (r304339) @@ -1,5 +1,9 @@ # $FreeBSD$ +unset LC_ALL +LC_COLLATE=C +export LC_COLLATE + failures=0 check() { Copied: stable/11/bin/sh/tests/expansion/pathname6.0 (from r302937, head/bin/sh/tests/expansion/pathname6.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/bin/sh/tests/expansion/pathname6.0 Thu Aug 18 07:43:18 2016 (r304339, copy of r302937, head/bin/sh/tests/expansion/pathname6.0) @@ -0,0 +1,29 @@ +# $FreeBSD$ + +unset LC_ALL +LC_COLLATE=en_US.US-ASCII +export LC_COLLATE + +failures=0 + +check() { + testcase=$1 + expect=$2 + eval "set -- $testcase" + actual="$*" + if [ "$actual" != "$expect" ]; then + failures=$((failures+1)) + printf '%s\n' "For $testcase, expected $expect actual $actual" + fi +} + +set -e +T=$(mktemp -d ${TMPDIR:-/tmp}/sh-test.XXXXXX) +trap 'rm -rf $T' 0 +cd -P $T + +touch A B a b + +check '*' 'a A b B' + +exit $((failures != 0)) From owner-svn-src-all@freebsd.org Thu Aug 18 07:53:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4919DBBE7B4; Thu, 18 Aug 2016 07:53:22 +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-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD9E318CC; Thu, 18 Aug 2016 07:53:21 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7I7rHwY063896 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 18 Aug 2016 10:53:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7I7rHwY063896 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7I7rGlP063895; Thu, 18 Aug 2016 10:53:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 18 Aug 2016 10:53:16 +0300 From: Konstantin Belousov To: Jilles Tjoelker Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304176 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern Message-ID: <20160818075316.GW83214@kib.kiev.ua> References: <201608151908.u7FJ8phh091939@repo.freebsd.org> <20160817202040.GA21263@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160817202040.GA21263@stack.nl> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 07:53:22 -0000 On Wed, Aug 17, 2016 at 10:20:40PM +0200, Jilles Tjoelker wrote: > On Mon, Aug 15, 2016 at 07:08:51PM +0000, Konstantin Belousov wrote: > > /* ISO/IEC 9945-1: 1996 */ > > #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE > > int fsync(int); > > +int fdatasync(int); > > > > /* > > * ftruncate() was in the POSIX Realtime Extension (it's used for shared > > Apparently these functions were added closely enough in time that they > can stay together here :) Is this a form of suggestion to use other value for POSIX_VISIBLE ? > > +#if 0 > > + if (!fullsync) > > + /* XXXKIB: compete outstanding aio writes */; > > Under the _POSIX_SYNCHRONIZED_IO option, completing outstanding I/O > requests is in fact required for fsync() as well. The fdatasync() > function is completely under the _POSIX_SYNCHRONIZED_IO option. > > We do not implement this option, but keeping fdatasync()'s guarantees a > subset of fsync()'s guarantees seems sensible. I will consider this if and when the AIO flush would be implemented. I looked at the AIO code to estimate the needed work, but did not started coding and quite possible it would be postponed. > > +%% fdatasync vp L L L > > + > > +vop_fdatasync { > > + IN struct vnode *vp; > > + IN struct thread *td; > > +}; > A waitfor parameter like in vop_fsync may be useful to implement > aio_fsync(O_DSYNC) later on. I really do not see how would it be. aio_fsync(O_DSYNC) is equivalent to fdatasync(2) in the async context. Completion of the aio request indicates that virtual fdatasync(2) execution did finished in that context. The use of waitfor in the VOP_FSYNC() is to allow syncer to initiate flush without waiting, or getting notification for the completion. Could you, please, elaborate ? If the KPI change is needed there, it is obviously desirable to make it right before MFC to stable. From owner-svn-src-all@freebsd.org Thu Aug 18 08:36:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D864CBB63BC; Thu, 18 Aug 2016 08:36:25 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9AC31D29; Thu, 18 Aug 2016 08:36:25 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I8aP1U074625; Thu, 18 Aug 2016 08:36:25 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I8aOeW074620; Thu, 18 Aug 2016 08:36:24 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608180836.u7I8aOeW074620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 18 Aug 2016 08:36:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304340 - stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 08:36:25 -0000 Author: ache Date: Thu Aug 18 08:36:24 2016 New Revision: 304340 URL: https://svnweb.freebsd.org/changeset/base/304340 Log: MFC r303569 Reflect CLDR timedef changes Modified: stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.common stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.holiday (contents, props changed) stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.common ============================================================================== --- stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.common Thu Aug 18 07:43:18 2016 (r304339) +++ stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.common Thu Aug 18 08:36:24 2016 (r304340) @@ -9,97 +9,97 @@ LANG=ru_RU.KOI8-R -12 ÑÎ× äÅÎØ ÒÁÂÏÔÎÉËÁ ÐÒÏËÕÒÁÔÕÒÙ -13 ÑÎ× äÅÎØ ÒÏÓÓÉÊÓËÏÊ ÐÅÞÁÔÉ -14 ÑÎ× óÔÁÒÙÊ îÏ×ÙÊ ÇÏÄ -21 ÑÎ× äÅÎØ ÉÎÖÅÎÅÒÎÙÈ ×ÏÊÓË -25 ÑÎ× ôÁÔØÑÎÉÎ ÄÅÎØ. óÔÕÄÅÎÞÅÓËÉÊ ÐÒÁÚÄÎÉË - 8 ÆÅ× äÅÎØ ÒÏÓÓÉÊÓËÏÊ ÎÁÕËÉ -10 ÆÅ× äÅÎØ ÄÉÐÌÏÍÁÔÉÞÅÓËÏÇÏ ÒÁÂÏÔÎÉËÁ - 1 ÍÁÒ ÷ÓÅÍÉÒÎÙÊ ÄÅÎØ ÇÒÁÖÄÁÎÓËÏÊ ÏÂÏÒÏÎÙ +12 ÑÎ×. äÅÎØ ÒÁÂÏÔÎÉËÁ ÐÒÏËÕÒÁÔÕÒÙ +13 ÑÎ×. äÅÎØ ÒÏÓÓÉÊÓËÏÊ ÐÅÞÁÔÉ +14 ÑÎ×. óÔÁÒÙÊ îÏ×ÙÊ ÇÏÄ +21 ÑÎ×. äÅÎØ ÉÎÖÅÎÅÒÎÙÈ ×ÏÊÓË +25 ÑÎ×. ôÁÔØÑÎÉÎ ÄÅÎØ. óÔÕÄÅÎÞÅÓËÉÊ ÐÒÁÚÄÎÉË + 8 ÆÅ×Ò. äÅÎØ ÒÏÓÓÉÊÓËÏÊ ÎÁÕËÉ +10 ÆÅ×Ò. äÅÎØ ÄÉÐÌÏÍÁÔÉÞÅÓËÏÇÏ ÒÁÂÏÔÎÉËÁ + 1 ÍÁÒÔÁ ÷ÓÅÍÉÒÎÙÊ ÄÅÎØ ÇÒÁÖÄÁÎÓËÏÊ ÏÂÏÒÏÎÙ 03/SunSecond äÅÎØ ÒÁÂÏÔÎÉËÏ× ÇÅÏÄÅÚÉÉ É ËÁÒÔÏÇÒÁÆÉÉ -11 ÍÁÒ äÅÎØ ÒÁÂÏÔÎÉËÁ ÏÒÇÁÎÏ× ÎÁÒËÏËÏÎÔÒÏÌÑ -18 ÍÁÒ äÅÎØ ÎÁÌÏÇÏ×ÏÊ ÐÏÌÉÃÉÉ +11 ÍÁÒÔÁ äÅÎØ ÒÁÂÏÔÎÉËÁ ÏÒÇÁÎÏ× ÎÁÒËÏËÏÎÔÒÏÌÑ +18 ÍÁÒÔÁ äÅÎØ ÎÁÌÏÇÏ×ÏÊ ÐÏÌÉÃÉÉ 03/SunThird äÅÎØ ÒÁÂÏÔÎÉËÏ× ÔÏÒÇÏ×ÌÉ, ÂÙÔÏ×ÏÇÏ ÏÂÓÌÕÖÉ×ÁÎÉÑ ÎÁÓÅÌÅÎÉÑ É ÖÉÌÉÝÎÏ-ËÏÍÍÕÎÁÌØÎÏÇÏ ÈÏÚÑÊÓÔ×Á -27 ÍÁÒ íÅÖÄÕÎÁÒÏÄÎÙÊ ÄÅÎØ ÔÅÁÔÒÁ -27 ÍÁÒ äÅÎØ ×ÎÕÔÒÅÎÎÉÈ ×ÏÊÓË - 1 ÁÐÒ äÅÎØ ÓÍÅÈÁ - 2 ÁÐÒ äÅÎØ ÅÄÉÎÅÎÉÑ ÎÁÒÏÄÏ× +27 ÍÁÒÔÁ íÅÖÄÕÎÁÒÏÄÎÙÊ ÄÅÎØ ÔÅÁÔÒÁ +27 ÍÁÒÔÁ äÅÎØ ×ÎÕÔÒÅÎÎÉÈ ×ÏÊÓË + 1 ÁÐÒ. äÅÎØ ÓÍÅÈÁ + 2 ÁÐÒ. äÅÎØ ÅÄÉÎÅÎÉÑ ÎÁÒÏÄÏ× 04/SunFirst äÅÎØ ÇÅÏÌÏÇÁ -12 ÁÐÒ äÅÎØ ËÏÓÍÏÎÁ×ÔÉËÉ +12 ÁÐÒ. äÅÎØ ËÏÓÍÏÎÁ×ÔÉËÉ 04/SunSecond äÅÎØ ×ÏÊÓË ÐÒÏÔÉ×Ï×ÏÚÄÕÛÎÏÊ ÏÂÏÒÏÎÙ -26 ÁÐÒ äÅÎØ ÐÁÍÑÔÉ ÐÏÇÉÂÛÉÈ × ÒÁÄÉÁÃÉÏÎÎÙÈ Á×ÁÒÉÑÈ É ËÁÔÁÓÔÒÏÆÁÈ -30 ÁÐÒ äÅÎØ ÐÏÖÁÒÎÏÊ ÏÈÒÁÎÙ - 7 ÍÁÊ äÅÎØ ÒÁÄÉÏ -17 ÍÁÊ íÅÖÄÕÎÁÒÏÄÎÙÊ ÄÅÎØ ÔÅÌÅËÏÍÍÕÎÉËÁÃÉÊ -18 ÍÁÊ íÅÖÄÕÎÁÒÏÄÎÙÊ ÄÅÎØ ÍÕÚÅÅ× -24 ÍÁÊ äÅÎØ ÓÌÁ×ÑÎÓËÏÊ ÐÉÓØÍÅÎÎÏÓÔÉ É ËÕÌØÔÕÒÙ -26 ÍÁÊ äÅÎØ ÒÏÓÓÉÊÓËÏÇÏ ÐÒÅÄÐÒÉÎÉÍÁÔÅÌØÓÔ×Á -27 ÍÁÊ ïÂÝÅÒÏÓÓÉÊÓËÉÊ ÄÅÎØ ÂÉÂÌÉÏÔÅË -28 ÍÁÊ äÅÎØ ÐÏÇÒÁÎÉÞÎÉËÁ -30 ÍÁÊ äÅÎØ ÐÏÖÁÒÎÏÊ ÏÈÒÁÎÙ -31 ÍÁÊ äÅÎØ òÏÓÓÉÊÓËÏÊ áÄ×ÏËÁÔÕÒÙ +26 ÁÐÒ. äÅÎØ ÐÁÍÑÔÉ ÐÏÇÉÂÛÉÈ × ÒÁÄÉÁÃÉÏÎÎÙÈ Á×ÁÒÉÑÈ É ËÁÔÁÓÔÒÏÆÁÈ +30 ÁÐÒ. äÅÎØ ÐÏÖÁÒÎÏÊ ÏÈÒÁÎÙ + 7 ÍÁÑ äÅÎØ ÒÁÄÉÏ +17 ÍÁÑ íÅÖÄÕÎÁÒÏÄÎÙÊ ÄÅÎØ ÔÅÌÅËÏÍÍÕÎÉËÁÃÉÊ +18 ÍÁÑ íÅÖÄÕÎÁÒÏÄÎÙÊ ÄÅÎØ ÍÕÚÅÅ× +24 ÍÁÑ äÅÎØ ÓÌÁ×ÑÎÓËÏÊ ÐÉÓØÍÅÎÎÏÓÔÉ É ËÕÌØÔÕÒÙ +26 ÍÁÑ äÅÎØ ÒÏÓÓÉÊÓËÏÇÏ ÐÒÅÄÐÒÉÎÉÍÁÔÅÌØÓÔ×Á +27 ÍÁÑ ïÂÝÅÒÏÓÓÉÊÓËÉÊ ÄÅÎØ ÂÉÂÌÉÏÔÅË +28 ÍÁÑ äÅÎØ ÐÏÇÒÁÎÉÞÎÉËÁ +30 ÍÁÑ äÅÎØ ÐÏÖÁÒÎÏÊ ÏÈÒÁÎÙ +31 ÍÁÑ äÅÎØ òÏÓÓÉÊÓËÏÊ áÄ×ÏËÁÔÕÒÙ 05/SunLast äÅÎØ ÈÉÍÉËÁ - 1 ÉÀÎ äÅÎØ ÚÁÝÉÔÙ ÄÅÔÅÊ - 5 ÉÀÎ äÅÎØ ÜËÏÌÏÇÁ - 6 ÉÀÎ ðÕÛËÉÎÓËÉÊ ÄÅÎØ - 8 ÉÀÎ äÅÎØ ÓÏÃÉÁÌØÎÏÇÏ ÒÁÂÏÔÎÉËÁ + 1 ÉÀÎÑ äÅÎØ ÚÁÝÉÔÙ ÄÅÔÅÊ + 5 ÉÀÎÑ äÅÎØ ÜËÏÌÏÇÁ + 6 ÉÀÎÑ ðÕÛËÉÎÓËÉÊ ÄÅÎØ + 8 ÉÀÎÑ äÅÎØ ÓÏÃÉÁÌØÎÏÇÏ ÒÁÂÏÔÎÉËÁ 06/SunSecond äÅÎØ ÒÁÂÏÔÎÉËÏ× ÌÅÇËÏÊ ÐÒÏÍÙÛÌÅÎÎÏÓÔÉ 06/SunThird äÅÎØ ÍÅÄÉÃÉÎÓËÏÇÏ ÒÁÂÏÔÎÉËÁ -22 ÉÀÎ äÅÎØ ÐÁÍÑÔÉ É ÓËÏÒÂÉ (îÁÞÁÌÏ ÷ÅÌÉËÏÊ ïÔÅÞÅÓÔ×ÅÎÎÏÊ ÷ÏÊÎÙ, 1941 ÇÏÄ) -27 ÉÀÎ äÅÎØ ÍÏÌÏÄÅÖÉ -29 ÉÀÎ äÅÎØ ÐÁÒÔÉÚÁÎ É ÐÏÄÐÏÌØÝÉËÏ× +22 ÉÀÎÑ äÅÎØ ÐÁÍÑÔÉ É ÓËÏÒÂÉ (îÁÞÁÌÏ ÷ÅÌÉËÏÊ ïÔÅÞÅÓÔ×ÅÎÎÏÊ ÷ÏÊÎÙ, 1941 ÇÏÄ) +27 ÉÀÎÑ äÅÎØ ÍÏÌÏÄÅÖÉ +29 ÉÀÎÑ äÅÎØ ÐÁÒÔÉÚÁÎ É ÐÏÄÐÏÌØÝÉËÏ× 06/SatLast äÅÎØ ÉÚÏÂÒÅÔÁÔÅÌÑ É ÒÁÃÉÏÎÁÌÉÚÁÔÏÒÁ 07/SunFirst äÅÎØ ÒÁÂÏÔÎÉËÏ× ÍÏÒÓËÏÇÏ É ÒÅÞÎÏÇÏ ÆÌÏÔÁ 07/SunSecond äÅÎØ ÒÙÂÁËÁ 07/SunSecond äÅÎØ ÒÏÓÓÉÊÓËÏÊ ÐÏÞÔÙ 07/SunThird äÅÎØ ÍÅÔÁÌÌÕÒÇÁ 07/SunLast äÅÎØ ÷ÏÅÎÎÏ-íÏÒÓËÏÇÏ æÌÏÔÁ -28 ÉÀÌ äÅÎØ ËÒÅÝÅÎÉÑ òÕÓÉ - 6 Á×Ç äÅÎØ ÖÅÌÅÚÎÏÄÏÒÏÖÎÙÈ ×ÏÊÓË +28 ÉÀÌÑ äÅÎØ ËÒÅÝÅÎÉÑ òÕÓÉ + 6 Á×Ç. äÅÎØ ÖÅÌÅÚÎÏÄÏÒÏÖÎÙÈ ×ÏÊÓË 08/SunFirst äÅÎØ ÖÅÌÅÚÎÏÄÏÒÏÖÎÉËÁ -12 Á×Ç äÅÎØ ×ÏÅÎÎÏ-×ÏÚÄÕÛÎÙÈ ÓÉÌ +12 Á×Ç. äÅÎØ ×ÏÅÎÎÏ-×ÏÚÄÕÛÎÙÈ ÓÉÌ 08/SunSecond äÅÎØ ÓÔÒÏÉÔÅÌÑ 08/SunThird äÅÎØ ÷ÏÚÄÕÛÎÏÇÏ æÌÏÔÁ -22 Á×Ç äÅÎØ ÇÏÓÕÄÁÒÓÔ×ÅÎÎÏÇÏ ÆÌÁÇÁ -27 Á×Ç äÅÎØ ËÉÎÏ +22 Á×Ç. äÅÎØ ÇÏÓÕÄÁÒÓÔ×ÅÎÎÏÇÏ ÆÌÁÇÁ +27 Á×Ç. äÅÎØ ËÉÎÏ 08/SunLast äÅÎØ ÛÁÈÔÅÒÁ - 1 ÓÅÎ äÅÎØ ÚÎÁÎÉÊ - 2 ÓÅÎ äÅÎØ ÒÏÓÓÉÊÓËÏÊ Ç×ÁÒÄÉÉ - 3 ÓÅÎ äÅÎØ ÓÏÌÉÄÁÒÎÏÓÔÉ × ÂÏÒØÂÅ Ó ÔÅÒÒÏÒÉÚÍÏÍ - 4 ÓÅÎ äÅÎØ ÓÐÅÃÉÁÌÉÓÔÁ ÐÏ ÑÄÅÒÎÏÍÕ ÏÂÅÓÐÅÞÅÎÉÀ + 1 ÓÅÎÔ. äÅÎØ ÚÎÁÎÉÊ + 2 ÓÅÎÔ. äÅÎØ ÒÏÓÓÉÊÓËÏÊ Ç×ÁÒÄÉÉ + 3 ÓÅÎÔ. äÅÎØ ÓÏÌÉÄÁÒÎÏÓÔÉ × ÂÏÒØÂÅ Ó ÔÅÒÒÏÒÉÚÍÏÍ + 4 ÓÅÎÔ. äÅÎØ ÓÐÅÃÉÁÌÉÓÔÁ ÐÏ ÑÄÅÒÎÏÍÕ ÏÂÅÓÐÅÞÅÎÉÀ 09/SunFirst äÅÎØ ÒÁÂÏÔÎÉËÏ× ÎÅÆÔÑÎÏÊ É ÇÁÚÏ×ÏÊ ÐÒÏÍÙÛÌÅÎÎÏÓÔÉ 09/SunSecond äÅÎØ ÔÁÎËÉÓÔÁ 09/SunThird äÅÎØ ÒÁÂÏÔÎÉËÏ× ÌÅÓÁ -28 ÓÅÎ äÅÎØ ÒÁÂÏÔÎÉËÁ ÁÔÏÍÎÏÊ ÐÒÏÍÙÛÌÅÎÎÏÓÔÉ +28 ÓÅÎÔ. äÅÎØ ÒÁÂÏÔÎÉËÁ ÁÔÏÍÎÏÊ ÐÒÏÍÙÛÌÅÎÎÏÓÔÉ 09/SunLast äÅÎØ ÍÁÛÉÎÏÓÔÒÏÉÔÅÌÑ - 1 ÏËÔ äÅÎØ ÐÏÖÉÌÙÈ ÌÀÄÅÊ - 1 ÏËÔ äÅÎØ ÓÕÈÏÐÕÔÎÙÈ ×ÏÊÓË - 4 ÏËÔ äÅÎØ ËÏÓÍÉÞÅÓËÉÈ ×ÏÊÓË - 5 ÏËÔ äÅÎØ ÕÞÉÔÅÌÑ -14 ÏËÔ íÅÖÄÕÎÁÒÏÄÎÙÊ ÄÅÎØ ÓÔÁÎÄÁÒÔÉÚÁÃÉÉ + 1 ÏËÔ. äÅÎØ ÐÏÖÉÌÙÈ ÌÀÄÅÊ + 1 ÏËÔ. äÅÎØ ÓÕÈÏÐÕÔÎÙÈ ×ÏÊÓË + 4 ÏËÔ. äÅÎØ ËÏÓÍÉÞÅÓËÉÈ ×ÏÊÓË + 5 ÏËÔ. äÅÎØ ÕÞÉÔÅÌÑ +14 ÏËÔ. íÅÖÄÕÎÁÒÏÄÎÙÊ ÄÅÎØ ÓÔÁÎÄÁÒÔÉÚÁÃÉÉ 10/SunSecond äÅÎØ ÒÁÂÏÔÎÉËÏ× ÓÅÌØÓËÏÇÏ ÈÏÚÑÊÓÔ×Á É ÐÅÒÅÒÁÂÁÔÙ×ÁÀÝÅÊ ÐÒÏÍÙÛÌÅÎÎÏÓÔÉ 10/SunThird äÅÎØ ÒÁÂÏÔÎÉËÏ× ÄÏÒÏÖÎÏÇÏ ÈÏÚÑÊÓÔ×Á -24 ÏËÔ íÅÖÄÕÎÁÒÏÄÎÙÊ ÄÅÎØ ïïî -25 ÏËÔ äÅÎØ ÔÁÍÏÖÅÎÎÉËÁ -30 ÏËÔ äÅÎØ ÐÁÍÑÔÉ ÖÅÒÔ× ÐÏÌÉÔÉÞÅÓËÉÈ ÒÅÐÒÅÓÓÉÊ +24 ÏËÔ. íÅÖÄÕÎÁÒÏÄÎÙÊ ÄÅÎØ ïïî +25 ÏËÔ. äÅÎØ ÔÁÍÏÖÅÎÎÉËÁ +30 ÏËÔ. äÅÎØ ÐÁÍÑÔÉ ÖÅÒÔ× ÐÏÌÉÔÉÞÅÓËÉÈ ÒÅÐÒÅÓÓÉÊ 10/SunLast äÅÎØ ÒÁÂÏÔÎÉËÏ× Á×ÔÏÍÏÂÉÌØÎÏÇÏ ÔÒÁÎÓÐÏÒÔÁ - 7 ÎÏÑ äÅÎØ ÏËÔÑÂÒØÓËÏÊ ÒÅ×ÏÌÀÃÉÉ 1917 ÇÏÄÁ - 9 ÎÏÑ ÷ÓÅÍÉÒÎÙÊ ÄÅÎØ ËÁÞÅÓÔ×Á -10 ÎÏÑ äÅÎØ ÍÉÌÉÃÉÉ -16 ÎÏÑ äÅÎØ ÍÏÒÓËÏÊ ÐÅÈÏÔÙ -17 ÎÏÑ íÅÖÄÕÎÁÒÏÄÎÙÊ ÄÅÎØ ÓÔÕÄÅÎÔÏ× -19 ÎÏÑ äÅÎØ ÒÁËÅÔÎÙÈ ×ÏÊÓË É ÁÒÔÉÌÌÅÒÉÉ -21 ÎÏÑ äÅÎØ ÒÁÂÏÔÎÉËÏ× ÎÁÌÏÇÏ×ÙÈ ÏÒÇÁÎÏ× -26 ÎÏÑ ÷ÓÅÍÉÒÎÙÊ ÄÅÎØ ÉÎÆÏÒÍÁÃÉÉ + 7 ÎÏÑÂ. äÅÎØ ÏËÔÑÂÒØÓËÏÊ ÒÅ×ÏÌÀÃÉÉ 1917 ÇÏÄÁ + 9 ÎÏÑÂ. ÷ÓÅÍÉÒÎÙÊ ÄÅÎØ ËÁÞÅÓÔ×Á +10 ÎÏÑÂ. äÅÎØ ÍÉÌÉÃÉÉ +16 ÎÏÑÂ. äÅÎØ ÍÏÒÓËÏÊ ÐÅÈÏÔÙ +17 ÎÏÑÂ. íÅÖÄÕÎÁÒÏÄÎÙÊ ÄÅÎØ ÓÔÕÄÅÎÔÏ× +19 ÎÏÑÂ. äÅÎØ ÒÁËÅÔÎÙÈ ×ÏÊÓË É ÁÒÔÉÌÌÅÒÉÉ +21 ÎÏÑÂ. äÅÎØ ÒÁÂÏÔÎÉËÏ× ÎÁÌÏÇÏ×ÙÈ ÏÒÇÁÎÏ× +26 ÎÏÑÂ. ÷ÓÅÍÉÒÎÙÊ ÄÅÎØ ÉÎÆÏÒÍÁÃÉÉ 11/SunLast äÅÎØ ÍÁÔÅÒÉ - 1 ÄÅË ÷ÓÅÍÉÒÎÙÊ ÄÅÎØ ÂÏÒØÂÙ ÓÏ óðéäÏÍ - 3 ÄÅË äÅÎØ ÀÒÉÓÔÁ - 9 ÄÅË äÅÎØ çÅÒÏÅ× ïÔÅÞÅÓÔ×Á -12 ÄÅË äÅÎØ ëÏÎÓÔÉÔÕÃÉÉ -17 ÄÅË äÅÎØ ÒÁËÅÔÎÙÈ ×ÏÊÓË ÓÔÒÁÔÅÇÉÞÅÓËÏÇÏ ÎÁÚÎÁÞÅÎÉÑ -20 ÄÅË äÅÎØ ÒÁÂÏÔÎÉËÁ ÏÒÇÁÎÏ× ÂÅÚÏÐÁÓÎÏÓÔÉ -22 ÄÅË äÅÎØ ÜÎÅÒÇÅÔÉËÁ -27 ÄÅË äÅÎØ ÓÐÁÓÁÔÅÌÑ + 1 ÄÅË. ÷ÓÅÍÉÒÎÙÊ ÄÅÎØ ÂÏÒØÂÙ ÓÏ óðéäÏÍ + 3 ÄÅË. äÅÎØ ÀÒÉÓÔÁ + 9 ÄÅË. äÅÎØ çÅÒÏÅ× ïÔÅÞÅÓÔ×Á +12 ÄÅË. äÅÎØ ëÏÎÓÔÉÔÕÃÉÉ +17 ÄÅË. äÅÎØ ÒÁËÅÔÎÙÈ ×ÏÊÓË ÓÔÒÁÔÅÇÉÞÅÓËÏÇÏ ÎÁÚÎÁÞÅÎÉÑ +20 ÄÅË. äÅÎØ ÒÁÂÏÔÎÉËÁ ÏÒÇÁÎÏ× ÂÅÚÏÐÁÓÎÏÓÔÉ +22 ÄÅË. äÅÎØ ÜÎÅÒÇÅÔÉËÁ +27 ÄÅË. äÅÎØ ÓÐÁÓÁÔÅÌÑ #endif /* !_ru_RU_KOI8_R_common_ */ Modified: stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.holiday ============================================================================== --- stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.holiday Thu Aug 18 07:43:18 2016 (r304339) +++ stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.holiday Thu Aug 18 08:36:24 2016 (r304340) @@ -9,17 +9,17 @@ LANG=ru_RU.KOI8-R - 1 ÑÎ× îÏ×ÙÊ ÇÏÄ - 2 ÑÎ× îÏ×ÏÇÏÄÎÉÅ ËÁÎÉËÕÌÙ - 3 ÑÎ× îÏ×ÏÇÏÄÎÉÅ ËÁÎÉËÕÌÙ - 4 ÑÎ× îÏ×ÏÇÏÄÎÉÅ ËÁÎÉËÕÌÙ - 5 ÑÎ× îÏ×ÏÇÏÄÎÉÅ ËÁÎÉËÕÌÙ - 7 ÑÎ× òÏÖÄÅÓÔ×Ï èÒÉÓÔÏ×Ï -23 ÆÅ× äÅÎØ ÚÁÝÉÔÎÉËÁ ïÔÅÞÅÓÔ×Á - 8 ÍÁÒ íÅÖÄÕÎÁÒÏÄÎÙÊ ÖÅÎÓËÉÊ ÄÅÎØ - 1 ÍÁÊ ðÒÁÚÄÎÉË ÷ÅÓÎÙ É ôÒÕÄÁ - 9 ÍÁÊ äÅÎØ ðÏÂÅÄÙ -12 ÉÀÎ äÅÎØ òÏÓÓÉÉ - 4 ÎÏÑ äÅÎØ ÎÁÒÏÄÎÏÇÏ ÅÄÉÎÓÔ×Á + 1 ÑÎ×. îÏ×ÙÊ ÇÏÄ + 2 ÑÎ×. îÏ×ÏÇÏÄÎÉÅ ËÁÎÉËÕÌÙ + 3 ÑÎ×. îÏ×ÏÇÏÄÎÉÅ ËÁÎÉËÕÌÙ + 4 ÑÎ×. îÏ×ÏÇÏÄÎÉÅ ËÁÎÉËÕÌÙ + 5 ÑÎ×. îÏ×ÏÇÏÄÎÉÅ ËÁÎÉËÕÌÙ + 7 ÑÎ×. òÏÖÄÅÓÔ×Ï èÒÉÓÔÏ×Ï +23 ÆÅ×Ò. äÅÎØ ÚÁÝÉÔÎÉËÁ ïÔÅÞÅÓÔ×Á + 8 ÍÁÒÔÁ íÅÖÄÕÎÁÒÏÄÎÙÊ ÖÅÎÓËÉÊ ÄÅÎØ + 1 ÍÁÑ ðÒÁÚÄÎÉË ÷ÅÓÎÙ É ôÒÕÄÁ + 9 ÍÁÑ äÅÎØ ðÏÂÅÄÙ +12 ÉÀÎÑ äÅÎØ òÏÓÓÉÉ + 4 ÎÏÑÂ. äÅÎØ ÎÁÒÏÄÎÏÇÏ ÅÄÉÎÓÔ×Á #endif /* !_ru_RU_KOI8_R_holiday_ */ Modified: stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military ============================================================================== --- stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military Thu Aug 18 07:43:18 2016 (r304339) +++ stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military Thu Aug 18 08:36:24 2016 (r304340) @@ -9,20 +9,20 @@ LANG=ru_RU.KOI8-R -27 ÑÎ× äÅÎØ ÓÎÑÔÉÑ ÂÌÏËÁÄÙ ÇÏÒÏÄÁ ìÅÎÉÎÇÒÁÄÁ (1944 ÇÏÄ) - 2 ÆÅ× äÅÎØ ÒÁÚÇÒÏÍÁ ÓÏ×ÅÔÓËÉÍÉ ×ÏÊÓËÁÍÉ ÎÅÍÅÃËÏ-ÆÁÛÉÓÔÓËÉÈ ×ÏÊÓË × óÔÁÌÉÎÇÒÁÄÓËÏÊ ÂÉÔ×Å (1943 ÇÏÄ) -23 ÆÅ× äÅÎØ ÐÏÂÅÄÙ ëÒÁÓÎÏÊ áÒÍÉÉ ÎÁÄ ËÁÊÚÅÒÏ×ÓËÉÍÉ ×ÏÊÓËÁÍÉ çÅÒÍÁÎÉÉ (1918 ÇÏÄ) -18 ÁÐÒ äÅÎØ ÐÏÂÅÄÙ ÒÕÓÓËÉÈ ×ÏÉÎÏ× ËÎÑÚÑ áÌÅËÓÁÎÄÒÁ îÅ×ÓËÏÇÏ ÎÁÄ ÎÅÍÅÃËÉÍÉ ÒÙÃÁÒÑÍÉ ÎÁ þÕÄÓËÏÍ ÏÚÅÒÅ (ìÅÄÏ×ÏÅ ÐÏÂÏÉÝÅ, 1242 ÇÏÄ) -10 ÉÀÌ äÅÎØ ÐÏÂÅÄÙ ÒÕÓÓËÏÊ ÁÒÍÉÉ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ ðÅÔÒÁ ðÅÒ×ÏÇÏ ÎÁÄ Û×ÅÄÁÍÉ × ðÏÌÔÁ×ÓËÏÍ ÓÒÁÖÅÎÉÉ (1709 ÇÏÄ) - 9 Á×Ç äÅÎØ ÐÅÒ×ÏÊ × ÒÏÓÓÉÊÓËÏÊ ÉÓÔÏÒÉÉ ÍÏÒÓËÏÊ ÐÏÂÅÄÙ ÒÕÓÓËÏÇÏ ÆÌÏÔÁ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ ðÅÔÒÁ ðÅÒ×ÏÇÏ ÎÁÄ Û×ÅÄÁÍÉ Õ ÍÙÓÁ çÁÎÇÕÔ (1714 ÇÏÄ) -23 Á×Ç äÅÎØ ÒÁÚÇÒÏÍÁ ÓÏ×ÅÔÓËÉÍÉ ×ÏÊÓËÁÍÉ ÎÅÍÅÃËÏ-ÆÁÛÉÓÔÓËÉÈ ×ÏÊÓË × ëÕÒÓËÏÊ ÂÉÔ×Å (1943 ÇÏÄ) - 2 ÓÅÎ äÅÎØ ÏËÏÎÞÁÎÉÑ ÷ÔÏÒÏÊ ÍÉÒÏ×ÏÊ ×ÏÊÎÙ (1945 ÇÏÄ) - 8 ÓÅÎ äÅÎØ âÏÒÏÄÉÎÓËÏÇÏ ÓÒÁÖÅÎÉÑ ÒÕÓÓËÏÊ ÁÒÍÉÉ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ í.é. ëÕÔÕÚÏ×Á Ó ÆÒÁÎÃÕÚÓËÏÊ ÁÒÍÉÅÊ (1812 ÇÏÄ) -11 ÓÅÎ äÅÎØ ÐÏÂÅÄÙ ÒÕÓÓËÏÊ ÜÓËÁÄÒÙ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ æ.æ. õÛÁËÏ×Á ÎÁÄ ÔÕÒÅÃËÏÊ ÜÓËÁÄÒÏÊ Õ ÍÙÓÁ ôÅÎÄÒÁ (1790 ÇÏÄ) -21 ÓÅÎ äÅÎØ ÐÏÂÅÄÙ ÒÕÓÓËÉÈ ÐÏÌËÏ× ×Ï ÇÌÁ×Å Ó ×ÅÌÉËÉÍ ËÎÑÚÅÍ äÍÉÔÒÉÅÍ äÏÎÓËÉÍ ÎÁÄ ÍÏÎÇÏÌÏ-ÔÁÔÁÒÓËÉÍÉ ×ÏÊÓËÁÍÉ × ëÕÌÉËÏ×ÓËÏÊ ÂÉÔ×Å (1380 ÇÏÄ) - 7 ÎÏÑ äÅÎØ ÏÓ×ÏÂÏÖÄÅÎÉÑ íÏÓË×Ù ÓÉÌÁÍÉ ÎÁÒÏÄÎÏÇÏ ÏÐÏÌÞÅÎÉÑ ÐÏÄ ÒÕËÏ×ÏÄÓÔ×ÏÍ ëÕÚØÍÙ íÉÎÉÎÁ É äÍÉÔÒÉÑ ðÏÖÁÒÓËÏÇÏ ÏÔ ÐÏÌØÓËÉÈ ÉÎÔÅÒ×ÅÎÔÏ× (1612 ÇÏÄ) - 1 ÄÅË äÅÎØ ÐÏÂÅÄÙ ÒÕÓÓËÏÊ ÜÓËÁÄÒÙ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ ð.ó. îÁÈÉÍÏ×Á ÎÁÄ ÔÕÒÅÃËÏÊ ÜÓËÁÄÒÏÊ Õ ÍÙÓÁ óÉÎÏÐ (1853 ÇÏÄ) - 5 ÄÅË äÅÎØ ÎÁÞÁÌÁ ËÏÎÔÒÎÁÓÔÕÐÌÅÎÉÑ ÓÏ×ÅÔÓËÉÈ ×ÏÊÓË ÐÒÏÔÉ× ÎÅÍÅÃËÏ-ÆÁÛÉÓÔÓËÉÈ ×ÏÊÓË × ÂÉÔ×Å ÐÏÄ íÏÓË×ÏÊ (1941 ÇÏÄ) -24 ÄÅË äÅÎØ ×ÚÑÔÉÑ ÔÕÒÅÃËÏÊ ËÒÅÐÏÓÔÉ éÚÍÁÉÌ ÒÕÓÓËÉÍÉ ×ÏÊÓËÁÍÉ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ á.÷. óÕ×ÏÒÏ×Á (1790 ÇÏÄ) +27 ÑÎ×. äÅÎØ ÓÎÑÔÉÑ ÂÌÏËÁÄÙ ÇÏÒÏÄÁ ìÅÎÉÎÇÒÁÄÁ (1944 ÇÏÄ) + 2 ÆÅ×Ò. äÅÎØ ÒÁÚÇÒÏÍÁ ÓÏ×ÅÔÓËÉÍÉ ×ÏÊÓËÁÍÉ ÎÅÍÅÃËÏ-ÆÁÛÉÓÔÓËÉÈ ×ÏÊÓË × óÔÁÌÉÎÇÒÁÄÓËÏÊ ÂÉÔ×Å (1943 ÇÏÄ) +23 ÆÅ×Ò. äÅÎØ ÐÏÂÅÄÙ ëÒÁÓÎÏÊ áÒÍÉÉ ÎÁÄ ËÁÊÚÅÒÏ×ÓËÉÍÉ ×ÏÊÓËÁÍÉ çÅÒÍÁÎÉÉ (1918 ÇÏÄ) +18 ÁÐÒ. äÅÎØ ÐÏÂÅÄÙ ÒÕÓÓËÉÈ ×ÏÉÎÏ× ËÎÑÚÑ áÌÅËÓÁÎÄÒÁ îÅ×ÓËÏÇÏ ÎÁÄ ÎÅÍÅÃËÉÍÉ ÒÙÃÁÒÑÍÉ ÎÁ þÕÄÓËÏÍ ÏÚÅÒÅ (ìÅÄÏ×ÏÅ ÐÏÂÏÉÝÅ, 1242 ÇÏÄ) +10 ÉÀÌÑ äÅÎØ ÐÏÂÅÄÙ ÒÕÓÓËÏÊ ÁÒÍÉÉ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ ðÅÔÒÁ ðÅÒ×ÏÇÏ ÎÁÄ Û×ÅÄÁÍÉ × ðÏÌÔÁ×ÓËÏÍ ÓÒÁÖÅÎÉÉ (1709 ÇÏÄ) + 9 Á×Ç. äÅÎØ ÐÅÒ×ÏÊ × ÒÏÓÓÉÊÓËÏÊ ÉÓÔÏÒÉÉ ÍÏÒÓËÏÊ ÐÏÂÅÄÙ ÒÕÓÓËÏÇÏ ÆÌÏÔÁ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ ðÅÔÒÁ ðÅÒ×ÏÇÏ ÎÁÄ Û×ÅÄÁÍÉ Õ ÍÙÓÁ çÁÎÇÕÔ (1714 ÇÏÄ) +23 Á×Ç. äÅÎØ ÒÁÚÇÒÏÍÁ ÓÏ×ÅÔÓËÉÍÉ ×ÏÊÓËÁÍÉ ÎÅÍÅÃËÏ-ÆÁÛÉÓÔÓËÉÈ ×ÏÊÓË × ëÕÒÓËÏÊ ÂÉÔ×Å (1943 ÇÏÄ) + 2 ÓÅÎÔ. äÅÎØ ÏËÏÎÞÁÎÉÑ ÷ÔÏÒÏÊ ÍÉÒÏ×ÏÊ ×ÏÊÎÙ (1945 ÇÏÄ) + 8 ÓÅÎÔ. äÅÎØ âÏÒÏÄÉÎÓËÏÇÏ ÓÒÁÖÅÎÉÑ ÒÕÓÓËÏÊ ÁÒÍÉÉ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ í.é. ëÕÔÕÚÏ×Á Ó ÆÒÁÎÃÕÚÓËÏÊ ÁÒÍÉÅÊ (1812 ÇÏÄ) +11 ÓÅÎÔ. äÅÎØ ÐÏÂÅÄÙ ÒÕÓÓËÏÊ ÜÓËÁÄÒÙ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ æ.æ. õÛÁËÏ×Á ÎÁÄ ÔÕÒÅÃËÏÊ ÜÓËÁÄÒÏÊ Õ ÍÙÓÁ ôÅÎÄÒÁ (1790 ÇÏÄ) +21 ÓÅÎÔ. äÅÎØ ÐÏÂÅÄÙ ÒÕÓÓËÉÈ ÐÏÌËÏ× ×Ï ÇÌÁ×Å Ó ×ÅÌÉËÉÍ ËÎÑÚÅÍ äÍÉÔÒÉÅÍ äÏÎÓËÉÍ ÎÁÄ ÍÏÎÇÏÌÏ-ÔÁÔÁÒÓËÉÍÉ ×ÏÊÓËÁÍÉ × ëÕÌÉËÏ×ÓËÏÊ ÂÉÔ×Å (1380 ÇÏÄ) + 7 ÎÏÑÂ. äÅÎØ ÏÓ×ÏÂÏÖÄÅÎÉÑ íÏÓË×Ù ÓÉÌÁÍÉ ÎÁÒÏÄÎÏÇÏ ÏÐÏÌÞÅÎÉÑ ÐÏÄ ÒÕËÏ×ÏÄÓÔ×ÏÍ ëÕÚØÍÙ íÉÎÉÎÁ É äÍÉÔÒÉÑ ðÏÖÁÒÓËÏÇÏ ÏÔ ÐÏÌØÓËÉÈ ÉÎÔÅÒ×ÅÎÔÏ× (1612 ÇÏÄ) + 1 ÄÅË. äÅÎØ ÐÏÂÅÄÙ ÒÕÓÓËÏÊ ÜÓËÁÄÒÙ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ ð.ó. îÁÈÉÍÏ×Á ÎÁÄ ÔÕÒÅÃËÏÊ ÜÓËÁÄÒÏÊ Õ ÍÙÓÁ óÉÎÏÐ (1853 ÇÏÄ) + 5 ÄÅË. äÅÎØ ÎÁÞÁÌÁ ËÏÎÔÒÎÁÓÔÕÐÌÅÎÉÑ ÓÏ×ÅÔÓËÉÈ ×ÏÊÓË ÐÒÏÔÉ× ÎÅÍÅÃËÏ-ÆÁÛÉÓÔÓËÉÈ ×ÏÊÓË × ÂÉÔ×Å ÐÏÄ íÏÓË×ÏÊ (1941 ÇÏÄ) +24 ÄÅË. äÅÎØ ×ÚÑÔÉÑ ÔÕÒÅÃËÏÊ ËÒÅÐÏÓÔÉ éÚÍÁÉÌ ÒÕÓÓËÉÍÉ ×ÏÊÓËÁÍÉ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ á.÷. óÕ×ÏÒÏ×Á (1790 ÇÏÄ) #endif /* !_ru_RU_KOI8_R_military_ */ Modified: stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox ============================================================================== --- stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox Thu Aug 18 07:43:18 2016 (r304339) +++ stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox Thu Aug 18 08:36:24 2016 (r304340) @@ -10,14 +10,14 @@ LANG=ru_RU.KOI8-R Paskha=ðÁÓÈÁ -21 ÓÅÎ òÏÖÄÅÓÔ×Ï ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ -27 ÓÅÎ ÷ÏÚÄ×ÉÖÅÎÉÅ ëÒÅÓÔÁ çÏÓÐÏÄÎÑ -14 ÏËÔ ðÏËÒÏ× ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ - 4 ÄÅË ÷×ÅÄÅÎÉÅ ×Ï ÈÒÁÍ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ - 7 ÑÎ× òÏÖÄÅÓÔ×Ï èÒÉÓÔÏ×Ï -14 ÑÎ× ïÂÒÅÚÁÎÉÅ çÏÓÐÏÄÎÅ -19 ÑÎ× âÏÇÏÑ×ÌÅÎÉÅ ÉÌÉ ëÒÅÝÅÎÉÅ çÏÓÐÏÄÎÅ -15 ÆÅ× óÒÅÔÅÎÉÅ çÏÓÐÏÄÎÅ +21 ÓÅÎÔ. òÏÖÄÅÓÔ×Ï ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ +27 ÓÅÎÔ. ÷ÏÚÄ×ÉÖÅÎÉÅ ëÒÅÓÔÁ çÏÓÐÏÄÎÑ +14 ÏËÔ. ðÏËÒÏ× ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ + 4 ÄÅË. ÷×ÅÄÅÎÉÅ ×Ï ÈÒÁÍ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ + 7 ÑÎ×. òÏÖÄÅÓÔ×Ï èÒÉÓÔÏ×Ï +14 ÑÎ×. ïÂÒÅÚÁÎÉÅ çÏÓÐÏÄÎÅ +19 ÑÎ×. âÏÇÏÑ×ÌÅÎÉÅ ÉÌÉ ëÒÅÝÅÎÉÅ çÏÓÐÏÄÎÅ +15 ÆÅ×Ò. óÒÅÔÅÎÉÅ çÏÓÐÏÄÎÅ ðÁÓÈÁ-48 ÷ÅÌÉËÉÊ ðÏÓÔ ðÁÓÈÁ-7 ÷ÈÏÄ çÏÓÐÏÄÅÎØ × éÅÒÕÓÁÌÉÍ. ÷ÅÒÂÎÏÅ ÷ÏÓËÒÅÓÅÎØÅ ðÁÓÈÁ-3 ÷ÅÌÉËÉÊ þÅÔ×ÅÒÇ @@ -25,12 +25,12 @@ Paskha=ðÁÓÈÁ ðÁÓÈÁ ÷ÏÓËÒÅÓÅÎÉÅ èÒÉÓÔÏ×Ï ðÁÓÈÁ+39 ÷ÏÚÎÅÓÅÎÉÅ ðÁÓÈÁ+49 äÅÎØ ó×ÑÔÏÊ ôÒÏÉÃÙ. ðÑÔÉÄÅÓÑÔÎÉÃÁ - 7 ÁÐÒ âÌÁÇÏ×ÅÝÅÎÉÅ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ - 7 ÉÀÌ òÏÖÄÅÓÔ×Ï éÏÁÎÎÁ ðÒÅÄÔÅÞÉ -12 ÉÀÌ äÅÎØ Ó×ÑÔÙÈ ÐÅÒ×Ï×ÅÒÈÏ×ÎÙÈ ÁÐÏÓÔÏÌÏ× ðÅÔÒÁ É ðÁ×ÌÁ -19 Á×Ç ðÒÅÏÂÒÁÖÅÎÉÅ çÏÓÐÏÄÎÅ -28 Á×Ç õÓÐÅÎÉÅ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ -11 ÓÅÎ õÓÅËÎÏ×ÅÎÉÅ ÇÌÁ×Ù éÏÁÎÎÁ ðÒÅÄÔÅÞÉ + 7 ÁÐÒ. âÌÁÇÏ×ÅÝÅÎÉÅ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ + 7 ÉÀÌÑ òÏÖÄÅÓÔ×Ï éÏÁÎÎÁ ðÒÅÄÔÅÞÉ +12 ÉÀÌÑ äÅÎØ Ó×ÑÔÙÈ ÐÅÒ×Ï×ÅÒÈÏ×ÎÙÈ ÁÐÏÓÔÏÌÏ× ðÅÔÒÁ É ðÁ×ÌÁ +19 Á×Ç. ðÒÅÏÂÒÁÖÅÎÉÅ çÏÓÐÏÄÎÅ +28 Á×Ç. õÓÐÅÎÉÅ ðÒÅÓ×ÑÔÏÊ âÏÇÏÒÏÄÉÃÙ +11 ÓÅÎÔ. õÓÅËÎÏ×ÅÎÉÅ ÇÌÁ×Ù éÏÁÎÎÁ ðÒÅÄÔÅÞÉ #endif /* !_ru_RU_KOI8_R_orthodox_ */ Modified: stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan ============================================================================== --- stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan Thu Aug 18 07:43:18 2016 (r304339) +++ stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan Thu Aug 18 08:36:24 2016 (r304340) @@ -10,33 +10,33 @@ LANG=ru_RU.KOI8-R Paskha=ðÁÓÈÁ -21 ÄÅË* úÉÍÎÅÅ ÓÏÌÎÃÅÓÔÏÑÎÉÅ -25 ÄÅË ëÏÌÑÄÁ (ÓÄ×ÉÎÕÔÏÅ ÚÉÍÎÅÅ ÓÏÌÎÃÅÓÔÏÑÎÉÅ) - 6 ÑÎ× äÅÎØ ëÁÝÅÑ É ÷ÅÌÅÓÁ -24 ÆÅ× äÅÎØ ÷ÅÌÅÓÁ -29 ÆÅ× äÅÎØ ëÁÝÅÑ - 1 ÍÁÒ äÅÎØ íÁÒÅÎÙ -14 ÍÁÒ îÏ×ÙÊ çÏÄ, ï×ÓÅÎØ ÍÁÌÙÊ +21 ÄÅË.* úÉÍÎÅÅ ÓÏÌÎÃÅÓÔÏÑÎÉÅ +25 ÄÅË. ëÏÌÑÄÁ (ÓÄ×ÉÎÕÔÏÅ ÚÉÍÎÅÅ ÓÏÌÎÃÅÓÔÏÑÎÉÅ) + 6 ÑÎ×. äÅÎØ ëÁÝÅÑ É ÷ÅÌÅÓÁ +24 ÆÅ×Ò. äÅÎØ ÷ÅÌÅÓÁ +29 ÆÅ×Ò. äÅÎØ ëÁÝÅÑ + 1 ÍÁÒÔÁ äÅÎØ íÁÒÅÎÙ +14 ÍÁÒÔÁ îÏ×ÙÊ çÏÄ, ï×ÓÅÎØ ÍÁÌÙÊ ðÁÓÈÁ-55 íÁÓÌÅÎÉÃÁ ðÁÓÈÁ+7 ëÒÁÓÎÁÑ çÏÒËÁ ðÁÓÈÁ+16 òÁÄÕÎÉÃÁ -20 ÍÁÒ* ÷ÅÓÅÎÎÉÅ ÒÁ×ÎÏÄÅÎÓÔ×ÉÅ - 7 ÁÐÒ äÅÎØ íÁÒÅÎÙ (ÓÄ×ÉÎÕÔÏÅ ×ÅÓÅÎÎÅÅ ÒÁ×ÎÏÄÅÎÓÔ×ÉÅ) - 6 ÍÁÊ äÅÎØ äÁÖØÂÏÇÁ, ï×ÓÅÎØ ÂÏÌØÛÏÊ -22 ÍÁÊ ñÒÉÌÉÎ äÅÎØ -15 ÉÀÎ äÅÎØ ôÒÉÇÌÁ×Á -21 ÉÀÎ* ìÅÔÎÅÅ ÓÏÌÎÃÅÓÔÏÑÎÉÅ - 1 ÉÀÌ òÕÓÁÌØÎÁÑ îÅÄÅÌÑ - 7 ÉÀÌ ëÕÐÁÌÁ (ÓÄ×ÉÎÕÔÏÅ ÌÅÔÎÅÅ ÓÏÌÎÃÅÓÔÏÑÎÉÅ) -27 ÉÀÌ ïÔÂÏÒ ÖÅÒÔ× ðÅÒÕÎÕ, ÒÕÓÁÌÉÉ - 2 Á×Ç ðÅÒÕÎÏ× äÅÎØ -21 Á×Ç äÅÎØ óÔÒÉÂÏÇÁ -28 Á×Ç õÓÐÅÎÉÅ úÌÁÔÏÇÏÒËÉ -14 ÓÅÎ äÅÎØ ÷ÏÌÈÁ úÍÅÅ×ÉÞÁ -22 ÓÅÎ* ðÏ×ÏÒÏÔ Ë ÚÉÍÅ (ÏÓÅÎÎÅÅ ÒÁ×ÎÏÄÅÎÓÔ×ÉÅ) -10 ÎÏÑ äÅÎØ íÁËÏÛÉ -21 ÎÏÑ äÅÎØ ó×ÁÒÏÇÁ É óÅÍÁÒÇÌÁ - 9 ÄÅË äÅÎØ äÁÖØÂÏÇÁ É íÁÒÅÎÙ +20 ÍÁÒÔÁ* ÷ÅÓÅÎÎÅÅ ÒÁ×ÎÏÄÅÎÓÔ×ÉÅ + 7 ÁÐÒ. äÅÎØ íÁÒÅÎÙ (ÓÄ×ÉÎÕÔÏÅ ×ÅÓÅÎÎÅÅ ÒÁ×ÎÏÄÅÎÓÔ×ÉÅ) + 6 ÍÁÑ äÅÎØ äÁÖØÂÏÇÁ, ï×ÓÅÎØ ÂÏÌØÛÏÊ +22 ÍÁÑ ñÒÉÌÉÎ äÅÎØ +15 ÉÀÎÑ äÅÎØ ôÒÉÇÌÁ×Á +21 ÉÀÎÑ* ìÅÔÎÅÅ ÓÏÌÎÃÅÓÔÏÑÎÉÅ + 1 ÉÀÌÑ òÕÓÁÌØÎÁÑ îÅÄÅÌÑ + 7 ÉÀÌÑ ëÕÐÁÌÁ (ÓÄ×ÉÎÕÔÏÅ ÌÅÔÎÅÅ ÓÏÌÎÃÅÓÔÏÑÎÉÅ) +27 ÉÀÌÑ ïÔÂÏÒ ÖÅÒÔ× ðÅÒÕÎÕ, ÒÕÓÁÌÉÉ + 2 Á×Ç. ðÅÒÕÎÏ× äÅÎØ +21 Á×Ç. äÅÎØ óÔÒÉÂÏÇÁ +28 Á×Ç. õÓÐÅÎÉÅ úÌÁÔÏÇÏÒËÉ +14 ÓÅÎÔ. äÅÎØ ÷ÏÌÈÁ úÍÅÅ×ÉÞÁ +22 ÓÅÎÔ.* ðÏ×ÏÒÏÔ Ë ÚÉÍÅ (ÏÓÅÎÎÅÅ ÒÁ×ÎÏÄÅÎÓÔ×ÉÅ) +10 ÎÏÑÂ. äÅÎØ íÁËÏÛÉ +21 ÎÏÑÂ. äÅÎØ ó×ÁÒÏÇÁ É óÅÍÁÒÇÌÁ + 9 ÄÅË. äÅÎØ äÁÖØÂÏÇÁ É íÁÒÅÎÙ #endif /* !_ru_RU_KOI8_R_pagan_ */ From owner-svn-src-all@freebsd.org Thu Aug 18 08:47:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 548A2BB664A; Thu, 18 Aug 2016 08:47:07 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24D1B133A; Thu, 18 Aug 2016 08:47:07 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I8l6pK078400; Thu, 18 Aug 2016 08:47:06 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I8l6V7078399; Thu, 18 Aug 2016 08:47:06 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608180847.u7I8l6V7078399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 18 Aug 2016 08:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304341 - stable/11/usr.bin/calendar/calendars/ru_RU.UTF-8 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 08:47:07 -0000 Author: ache Date: Thu Aug 18 08:47:06 2016 New Revision: 304341 URL: https://svnweb.freebsd.org/changeset/base/304341 Log: MFC r303568 Remove another vestige of scripted conversion Modified: stable/11/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan ============================================================================== --- stable/11/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Thu Aug 18 08:36:24 2016 (r304340) +++ stable/11/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Thu Aug 18 08:47:06 2016 (r304341) @@ -35,7 +35,7 @@ Paskha=ПаÑха 14 Ñент. День Волха Змеевича 22 Ñент.* Поворот к зиме (оÑеннее равноденÑтвие) 10 ноÑб. День Макоши -21 ноÑб. День Сварога и Семартагла +21 ноÑб. День Сварога и Семаргла 9 дек. День Дажьбога и Марены #endif /* !_ru_RU_UTF_8_pagan_ */ From owner-svn-src-all@freebsd.org Thu Aug 18 08:49:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2776EBB66BE; Thu, 18 Aug 2016 08:49:03 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE114151B; Thu, 18 Aug 2016 08:49:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I8n2aH078504; Thu, 18 Aug 2016 08:49:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I8n2jc078503; Thu, 18 Aug 2016 08:49:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201608180849.u7I8n2jc078503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 18 Aug 2016 08:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304342 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 08:49:03 -0000 Author: hselasky Date: Thu Aug 18 08:49:02 2016 New Revision: 304342 URL: https://svnweb.freebsd.org/changeset/base/304342 Log: Add support for setting blocking and non-blocking mode on /dev/rdma_cm by returning success on FIONBIO and FIOASYNC IOCTLs. The actual flags handling is done by the kern_ioctl() function. Reported by: Alex Bowden Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/core/ucma.c Modified: head/sys/ofed/drivers/infiniband/core/ucma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/ucma.c Thu Aug 18 08:47:06 2016 (r304341) +++ head/sys/ofed/drivers/infiniband/core/ucma.c Thu Aug 18 08:49:02 2016 (r304342) @@ -42,6 +42,8 @@ #include #include +#include + #include #include #include @@ -1345,11 +1347,25 @@ static int ucma_close(struct inode *inod return 0; } +static long +ucma_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) +{ + + switch (cmd) { + case FIONBIO: + case FIOASYNC: + return (0); + default: + return (-ENOTTY); + } +} + static const struct file_operations ucma_fops = { .owner = THIS_MODULE, .open = ucma_open, .release = ucma_close, .write = ucma_write, + .unlocked_ioctl = ucma_ioctl, .poll = ucma_poll, .llseek = no_llseek, }; From owner-svn-src-all@freebsd.org Thu Aug 18 08:52:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93FDEBB68D9; Thu, 18 Aug 2016 08:52:56 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7008C1A16; Thu, 18 Aug 2016 08:52:56 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I8qtC9081917; Thu, 18 Aug 2016 08:52:55 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I8qtNU081915; Thu, 18 Aug 2016 08:52:55 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608180852.u7I8qtNU081915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 18 Aug 2016 08:52:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304343 - in stable/11/usr.bin/calendar/calendars: ru_RU.KOI8-R ru_RU.UTF-8 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 08:52:56 -0000 Author: ache Date: Thu Aug 18 08:52:55 2016 New Revision: 304343 URL: https://svnweb.freebsd.org/changeset/base/304343 Log: MFC r303581 Fix date Modified: stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military stable/11/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.military Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military ============================================================================== --- stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military Thu Aug 18 08:49:02 2016 (r304342) +++ stable/11/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military Thu Aug 18 08:52:55 2016 (r304343) @@ -20,7 +20,7 @@ LANG=ru_RU.KOI8-R 8 ÓÅÎÔ. äÅÎØ âÏÒÏÄÉÎÓËÏÇÏ ÓÒÁÖÅÎÉÑ ÒÕÓÓËÏÊ ÁÒÍÉÉ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ í.é. ëÕÔÕÚÏ×Á Ó ÆÒÁÎÃÕÚÓËÏÊ ÁÒÍÉÅÊ (1812 ÇÏÄ) 11 ÓÅÎÔ. äÅÎØ ÐÏÂÅÄÙ ÒÕÓÓËÏÊ ÜÓËÁÄÒÙ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ æ.æ. õÛÁËÏ×Á ÎÁÄ ÔÕÒÅÃËÏÊ ÜÓËÁÄÒÏÊ Õ ÍÙÓÁ ôÅÎÄÒÁ (1790 ÇÏÄ) 21 ÓÅÎÔ. äÅÎØ ÐÏÂÅÄÙ ÒÕÓÓËÉÈ ÐÏÌËÏ× ×Ï ÇÌÁ×Å Ó ×ÅÌÉËÉÍ ËÎÑÚÅÍ äÍÉÔÒÉÅÍ äÏÎÓËÉÍ ÎÁÄ ÍÏÎÇÏÌÏ-ÔÁÔÁÒÓËÉÍÉ ×ÏÊÓËÁÍÉ × ëÕÌÉËÏ×ÓËÏÊ ÂÉÔ×Å (1380 ÇÏÄ) - 7 ÎÏÑÂ. äÅÎØ ÏÓ×ÏÂÏÖÄÅÎÉÑ íÏÓË×Ù ÓÉÌÁÍÉ ÎÁÒÏÄÎÏÇÏ ÏÐÏÌÞÅÎÉÑ ÐÏÄ ÒÕËÏ×ÏÄÓÔ×ÏÍ ëÕÚØÍÙ íÉÎÉÎÁ É äÍÉÔÒÉÑ ðÏÖÁÒÓËÏÇÏ ÏÔ ÐÏÌØÓËÉÈ ÉÎÔÅÒ×ÅÎÔÏ× (1612 ÇÏÄ) + 4 ÎÏÑÂ. äÅÎØ ÏÓ×ÏÂÏÖÄÅÎÉÑ íÏÓË×Ù ÓÉÌÁÍÉ ÎÁÒÏÄÎÏÇÏ ÏÐÏÌÞÅÎÉÑ ÐÏÄ ÒÕËÏ×ÏÄÓÔ×ÏÍ ëÕÚØÍÙ íÉÎÉÎÁ É äÍÉÔÒÉÑ ðÏÖÁÒÓËÏÇÏ ÏÔ ÐÏÌØÓËÉÈ ÉÎÔÅÒ×ÅÎÔÏ× (1612 ÇÏÄ) 1 ÄÅË. äÅÎØ ÐÏÂÅÄÙ ÒÕÓÓËÏÊ ÜÓËÁÄÒÙ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ ð.ó. îÁÈÉÍÏ×Á ÎÁÄ ÔÕÒÅÃËÏÊ ÜÓËÁÄÒÏÊ Õ ÍÙÓÁ óÉÎÏÐ (1853 ÇÏÄ) 5 ÄÅË. äÅÎØ ÎÁÞÁÌÁ ËÏÎÔÒÎÁÓÔÕÐÌÅÎÉÑ ÓÏ×ÅÔÓËÉÈ ×ÏÊÓË ÐÒÏÔÉ× ÎÅÍÅÃËÏ-ÆÁÛÉÓÔÓËÉÈ ×ÏÊÓË × ÂÉÔ×Å ÐÏÄ íÏÓË×ÏÊ (1941 ÇÏÄ) 24 ÄÅË. äÅÎØ ×ÚÑÔÉÑ ÔÕÒÅÃËÏÊ ËÒÅÐÏÓÔÉ éÚÍÁÉÌ ÒÕÓÓËÉÍÉ ×ÏÊÓËÁÍÉ ÐÏÄ ËÏÍÁÎÄÏ×ÁÎÉÅÍ á.÷. óÕ×ÏÒÏ×Á (1790 ÇÏÄ) Modified: stable/11/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.military ============================================================================== --- stable/11/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.military Thu Aug 18 08:49:02 2016 (r304342) +++ stable/11/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.military Thu Aug 18 08:52:55 2016 (r304343) @@ -20,7 +20,7 @@ LANG=ru_RU.UTF-8 8 Ñент. День БородинÑкого ÑÑ€Ð°Ð¶ÐµÐ½Ð¸Ñ Ñ€ÑƒÑÑкой армии под командованием Ðœ.И. Кутузова Ñ Ñ„Ñ€Ð°Ð½Ñ†ÑƒÐ·Ñкой армией (1812 год) 11 Ñент. День победы руÑÑкой ÑÑкадры под командованием Ф.Ф. Ушакова над турецкой ÑÑкадрой у мыÑа Тендра (1790 год) 21 Ñент. День победы руÑÑких полков во главе Ñ Ð²ÐµÐ»Ð¸ÐºÐ¸Ð¼ кнÑзем Дмитрием ДонÑким над монголо-татарÑкими войÑками в КуликовÑкой битве (1380 год) - 7 ноÑб. День оÑÐ²Ð¾Ð±Ð¾Ð¶Ð´ÐµÐ½Ð¸Ñ ÐœÐ¾Ñквы Ñилами народного Ð¾Ð¿Ð¾Ð»Ñ‡ÐµÐ½Ð¸Ñ Ð¿Ð¾Ð´ руководÑтвом Кузьмы Минина и Ð”Ð¼Ð¸Ñ‚Ñ€Ð¸Ñ ÐŸÐ¾Ð¶Ð°Ñ€Ñкого от польÑких интервентов (1612 год) + 4 ноÑб. День оÑÐ²Ð¾Ð±Ð¾Ð¶Ð´ÐµÐ½Ð¸Ñ ÐœÐ¾Ñквы Ñилами народного Ð¾Ð¿Ð¾Ð»Ñ‡ÐµÐ½Ð¸Ñ Ð¿Ð¾Ð´ руководÑтвом Кузьмы Минина и Ð”Ð¼Ð¸Ñ‚Ñ€Ð¸Ñ ÐŸÐ¾Ð¶Ð°Ñ€Ñкого от польÑких интервентов (1612 год) 1 дек. День победы руÑÑкой ÑÑкадры под командованием П.С. Ðахимова над турецкой ÑÑкадрой у мыÑа Синоп (1853 год) 5 дек. День начала контрнаÑÑ‚ÑƒÐ¿Ð»ÐµÐ½Ð¸Ñ ÑоветÑких войÑк против немецко-фашиÑÑ‚Ñких войÑк в битве под МоÑквой (1941 год) 24 дек. День взÑÑ‚Ð¸Ñ Ñ‚ÑƒÑ€ÐµÑ†ÐºÐ¾Ð¹ крепоÑти Измаил руÑÑкими войÑками под командованием Ð.Ð’. Суворова (1790 год) From owner-svn-src-all@freebsd.org Thu Aug 18 09:17:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A1E8BBC24F; Thu, 18 Aug 2016 09:17:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66CF515C1; Thu, 18 Aug 2016 09:17:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9GxmN089602; Thu, 18 Aug 2016 09:16:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9Gx9u089601; Thu, 18 Aug 2016 09:16:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180916.u7I9Gx9u089601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:16:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304344 - stable/11/sys/dev/ntb/ntb_hw X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:17:00 -0000 Author: mav Date: Thu Aug 18 09:16:59 2016 New Revision: 304344 URL: https://svnweb.freebsd.org/changeset/base/304344 Log: MFC r302482: Fix NTB_SDOORBELL_LOCKUP workaround. Since SBARxSZ register can be write-once, it can be unusable for disabling the SBAR. For such case also set SBARxBASE to zero to not intersect with config BAR. Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 08:52:55 2016 (r304343) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:16:59 2016 (r304344) @@ -1673,8 +1673,12 @@ xeon_set_sbar_base_and_limit(struct ntb_ uint32_t base_reg, lmt_reg; bar_get_xlat_params(ntb, idx, &base_reg, NULL, &lmt_reg); - if (idx == regbar) - bar_addr += ntb->b2b_off; + if (idx == regbar) { + if (ntb->b2b_off) + bar_addr += ntb->b2b_off; + else + bar_addr = 0; + } /* * Set limit registers first to avoid an errata where setting the base From owner-svn-src-all@freebsd.org Thu Aug 18 09:17:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6185FBBC31B; Thu, 18 Aug 2016 09:17:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B911172C; Thu, 18 Aug 2016 09:17:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9Hd4L089683; Thu, 18 Aug 2016 09:17:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9Hdxt089682; Thu, 18 Aug 2016 09:17:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180917.u7I9Hdxt089682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:17:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304345 - stable/11/sys/dev/ntb/ntb_hw X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:17:40 -0000 Author: mav Date: Thu Aug 18 09:17:39 2016 New Revision: 304345 URL: https://svnweb.freebsd.org/changeset/base/304345 Log: MFC r302483: Remove some dead code found by Clang static analyzer. Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:16:59 2016 (r304344) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:17:39 2016 (r304345) @@ -1352,8 +1352,6 @@ ntb_get_msix_info(struct ntb_softc *ntb) dinfo = device_get_ivars(ntb->device); msix = &dinfo->cfg.msix; - laddr = data = 0; - CTASSERT(XEON_NONLINK_DB_MSIX_BITS == nitems(ntb->msix_data)); for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { @@ -2587,13 +2585,10 @@ ntb_sysctl_init(struct ntb_softc *ntb) static int sysctl_handle_features(SYSCTL_HANDLER_ARGS) { - struct ntb_softc *ntb; + struct ntb_softc *ntb = arg1; struct sbuf sb; int error; - error = 0; - ntb = arg1; - sbuf_new_for_sysctl(&sb, NULL, 256, req); sbuf_printf(&sb, "%b", ntb->features, NTB_FEATURES_STR); @@ -2608,13 +2603,10 @@ sysctl_handle_features(SYSCTL_HANDLER_AR static int sysctl_handle_link_admin(SYSCTL_HANDLER_ARGS) { - struct ntb_softc *ntb; + struct ntb_softc *ntb = arg1; unsigned old, new; int error; - error = 0; - ntb = arg1; - old = ntb_link_enabled(ntb); error = SYSCTL_OUT(req, &old, sizeof(old)); @@ -2638,15 +2630,12 @@ sysctl_handle_link_admin(SYSCTL_HANDLER_ static int sysctl_handle_link_status_human(SYSCTL_HANDLER_ARGS) { - struct ntb_softc *ntb; + struct ntb_softc *ntb = arg1; struct sbuf sb; enum ntb_speed speed; enum ntb_width width; int error; - error = 0; - ntb = arg1; - sbuf_new_for_sysctl(&sb, NULL, 32, req); if (ntb_link_is_up(ntb, &speed, &width)) @@ -2666,13 +2655,10 @@ sysctl_handle_link_status_human(SYSCTL_H static int sysctl_handle_link_status(SYSCTL_HANDLER_ARGS) { - struct ntb_softc *ntb; + struct ntb_softc *ntb = arg1; unsigned res; int error; - error = 0; - ntb = arg1; - res = ntb_link_is_up(ntb, NULL, NULL); error = SYSCTL_OUT(req, &res, sizeof(res)); From owner-svn-src-all@freebsd.org Thu Aug 18 09:18:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB4E8BBC3B3; Thu, 18 Aug 2016 09:18:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 597AE1901; Thu, 18 Aug 2016 09:18:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9INlF089766; Thu, 18 Aug 2016 09:18:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9IN5i089762; Thu, 18 Aug 2016 09:18:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180918.u7I9IN5i089762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304346 - in stable/11/sys: conf dev/ntb dev/ntb/if_ntb dev/ntb/ntb_hw modules/ntb modules/ntb/ntb modules/ntb/ntb_hw modules/ntb/ntb_transport X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:18:24 -0000 Author: mav Date: Thu Aug 18 09:18:23 2016 New Revision: 304346 URL: https://svnweb.freebsd.org/changeset/base/304346 Log: MFC r302484: NewBus'ify NTB subsystem. This follows NTB subsystem modularization in Linux, tuning it to FreeBSD native NewBus interfaces. This change allows to support different types of hardware with different drivers, support multiple NTB instances in a system, ntb_transport module use for needs other then if_ntb, etc. Sponsored by: iXsystems, Inc. Added: stable/11/sys/dev/ntb/ntb.c - copied unchanged from r302484, head/sys/dev/ntb/ntb.c stable/11/sys/dev/ntb/ntb.h - copied unchanged from r302484, head/sys/dev/ntb/ntb.h stable/11/sys/dev/ntb/ntb_if.m - copied unchanged from r302484, head/sys/dev/ntb/ntb_if.m stable/11/sys/dev/ntb/ntb_transport.c - copied unchanged from r302484, head/sys/dev/ntb/ntb_transport.c stable/11/sys/dev/ntb/ntb_transport.h - copied unchanged from r302484, head/sys/dev/ntb/ntb_transport.h stable/11/sys/modules/ntb/ntb/ - copied from r302484, head/sys/modules/ntb/ntb/ stable/11/sys/modules/ntb/ntb_transport/ - copied from r302484, head/sys/modules/ntb/ntb_transport/ Deleted: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.h Modified: stable/11/sys/conf/files.amd64 stable/11/sys/conf/files.i386 stable/11/sys/dev/ntb/if_ntb/if_ntb.c stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c stable/11/sys/dev/ntb/ntb_hw/ntb_regs.h stable/11/sys/modules/ntb/Makefile stable/11/sys/modules/ntb/ntb_hw/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files.amd64 ============================================================================== --- stable/11/sys/conf/files.amd64 Thu Aug 18 09:17:39 2016 (r304345) +++ stable/11/sys/conf/files.amd64 Thu Aug 18 09:18:23 2016 (r304346) @@ -287,7 +287,10 @@ dev/hyperv/vmbus/amd64/hyperv_machdep.c dev/hyperv/vmbus/amd64/vmbus_vector.S optional hyperv dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb -dev/ntb/ntb_hw/ntb_hw.c optional if_ntb | ntb_hw +dev/ntb/ntb_transport.c optional if_ntb +dev/ntb/ntb.c optional if_ntb | ntb_hw +dev/ntb/ntb_if.m optional if_ntb | ntb_hw +dev/ntb/ntb_hw/ntb_hw.c optional ntb_hw dev/nvd/nvd.c optional nvd nvme dev/nvme/nvme.c optional nvme dev/nvme/nvme_ctrlr.c optional nvme Modified: stable/11/sys/conf/files.i386 ============================================================================== --- stable/11/sys/conf/files.i386 Thu Aug 18 09:17:39 2016 (r304345) +++ stable/11/sys/conf/files.i386 Thu Aug 18 09:18:23 2016 (r304346) @@ -277,7 +277,10 @@ dev/mse/mse.c optional mse dev/mse/mse_isa.c optional mse isa dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb -dev/ntb/ntb_hw/ntb_hw.c optional if_ntb | ntb_hw +dev/ntb/ntb_transport.c optional if_ntb +dev/ntb/ntb.c optional if_ntb | ntb_hw +dev/ntb/ntb_if.m optional if_ntb | ntb_hw +dev/ntb/ntb_hw/ntb_hw.c optional ntb_hw dev/nvd/nvd.c optional nvd nvme dev/nvme/nvme.c optional nvme dev/nvme/nvme_ctrlr.c optional nvme Modified: stable/11/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:17:39 2016 (r304345) +++ stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:18:23 2016 (r304346) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2016 Alexander Motin * Copyright (C) 2013 Intel Corporation * Copyright (C) 2015 EMC Corporation * All rights reserved. @@ -25,25 +26,28 @@ * SUCH DAMAGE. */ +/* + * The Non-Transparent Bridge (NTB) is a device that allows you to connect + * two or more systems using a PCI-e links, providing remote memory access. + * + * This module contains a driver for simulated Ethernet device, using + * underlying NTB Transport device. + * + * NOTE: Much of the code in this module is shared with Linux. Any patches may + * be picked up and redistributed in Linux with a dual GPL/BSD license. + */ + #include __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include -#include -#include #include -#include -#include #include #include -#include -#include #include #include @@ -52,249 +56,24 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - #include -#include - -#include -#include -#include "../ntb_hw/ntb_hw.h" - -/* - * The Non-Transparent Bridge (NTB) is a device on some Intel processors that - * allows you to connect two systems using a PCI-e link. - * - * This module contains a protocol for sending and receiving messages, and - * exposes that protocol through a simulated ethernet device called ntb. - * - * NOTE: Much of the code in this module is shared with Linux. Any patches may - * be picked up and redistributed in Linux with a dual GPL/BSD license. - */ - -#define QP_SETSIZE 64 -BITSET_DEFINE(_qpset, QP_SETSIZE); -#define test_bit(pos, addr) BIT_ISSET(QP_SETSIZE, (pos), (addr)) -#define set_bit(pos, addr) BIT_SET(QP_SETSIZE, (pos), (addr)) -#define clear_bit(pos, addr) BIT_CLR(QP_SETSIZE, (pos), (addr)) -#define ffs_bit(addr) BIT_FFS(QP_SETSIZE, (addr)) +#include "../ntb_transport.h" #define KTR_NTB KTR_SPARE3 -#define NTB_TRANSPORT_VERSION 4 -#define NTB_RX_MAX_PKTS 64 -#define NTB_RXQ_SIZE 300 - -enum ntb_link_event { - NTB_LINK_DOWN = 0, - NTB_LINK_UP, -}; - -static SYSCTL_NODE(_hw, OID_AUTO, if_ntb, CTLFLAG_RW, 0, "if_ntb"); - -static unsigned g_if_ntb_debug_level; -SYSCTL_UINT(_hw_if_ntb, OID_AUTO, debug_level, CTLFLAG_RWTUN, - &g_if_ntb_debug_level, 0, "if_ntb log level -- higher is more verbose"); -#define ntb_printf(lvl, ...) do { \ - if ((lvl) <= g_if_ntb_debug_level) { \ - if_printf(nt->ifp, __VA_ARGS__); \ - } \ -} while (0) - -static unsigned transport_mtu = IP_MAXPACKET + ETHER_HDR_LEN + ETHER_CRC_LEN; - -static uint64_t max_mw_size; -SYSCTL_UQUAD(_hw_if_ntb, OID_AUTO, max_mw_size, CTLFLAG_RDTUN, &max_mw_size, 0, - "If enabled (non-zero), limit the size of large memory windows. " - "Both sides of the NTB MUST set the same value here."); - -static unsigned max_num_clients; -SYSCTL_UINT(_hw_if_ntb, OID_AUTO, max_num_clients, CTLFLAG_RDTUN, - &max_num_clients, 0, "Maximum number of NTB transport clients. " - "0 (default) - use all available NTB memory windows; " - "positive integer N - Limit to N memory windows."); - -static unsigned enable_xeon_watchdog; -SYSCTL_UINT(_hw_if_ntb, OID_AUTO, enable_xeon_watchdog, CTLFLAG_RDTUN, - &enable_xeon_watchdog, 0, "If non-zero, write a register every second to " - "keep a watchdog from tearing down the NTB link"); - -STAILQ_HEAD(ntb_queue_list, ntb_queue_entry); - -typedef uint32_t ntb_q_idx_t; - -struct ntb_queue_entry { - /* ntb_queue list reference */ - STAILQ_ENTRY(ntb_queue_entry) entry; - - /* info on data to be transferred */ - void *cb_data; - void *buf; - uint32_t len; - uint32_t flags; - - struct ntb_transport_qp *qp; - struct ntb_payload_header *x_hdr; - ntb_q_idx_t index; -}; - -struct ntb_rx_info { - ntb_q_idx_t entry; -}; - -struct ntb_transport_qp { - struct ntb_transport_ctx *transport; - struct ntb_softc *ntb; - - void *cb_data; - - bool client_ready; - volatile bool link_is_up; - uint8_t qp_num; /* Only 64 QPs are allowed. 0-63 */ - - struct ntb_rx_info *rx_info; - struct ntb_rx_info *remote_rx_info; - - void (*tx_handler)(struct ntb_transport_qp *qp, void *qp_data, - void *data, int len); - struct ntb_queue_list tx_free_q; - struct mtx ntb_tx_free_q_lock; - caddr_t tx_mw; - bus_addr_t tx_mw_phys; - ntb_q_idx_t tx_index; - ntb_q_idx_t tx_max_entry; - uint64_t tx_max_frame; - - void (*rx_handler)(struct ntb_transport_qp *qp, void *qp_data, - void *data, int len); - struct ntb_queue_list rx_post_q; - struct ntb_queue_list rx_pend_q; - /* ntb_rx_q_lock: synchronize access to rx_XXXX_q */ - struct mtx ntb_rx_q_lock; - struct task rx_completion_task; - struct task rxc_db_work; - caddr_t rx_buff; - ntb_q_idx_t rx_index; - ntb_q_idx_t rx_max_entry; - uint64_t rx_max_frame; - - void (*event_handler)(void *data, enum ntb_link_event status); - struct callout link_work; - struct callout queue_full; - struct callout rx_full; - - uint64_t last_rx_no_buf; - - /* Stats */ - uint64_t rx_bytes; - uint64_t rx_pkts; - uint64_t rx_ring_empty; - uint64_t rx_err_no_buf; - uint64_t rx_err_oflow; - uint64_t rx_err_ver; - uint64_t tx_bytes; - uint64_t tx_pkts; - uint64_t tx_ring_full; - uint64_t tx_err_no_buf; -}; - -struct ntb_queue_handlers { - void (*rx_handler)(struct ntb_transport_qp *qp, void *qp_data, - void *data, int len); - void (*tx_handler)(struct ntb_transport_qp *qp, void *qp_data, - void *data, int len); - void (*event_handler)(void *data, enum ntb_link_event status); -}; - -struct ntb_transport_mw { - vm_paddr_t phys_addr; - size_t phys_size; - size_t xlat_align; - size_t xlat_align_size; - bus_addr_t addr_limit; - /* Tx buff is off vbase / phys_addr */ - caddr_t vbase; - size_t xlat_size; - size_t buff_size; - /* Rx buff is off virt_addr / dma_addr */ - caddr_t virt_addr; - bus_addr_t dma_addr; -}; - -struct ntb_transport_ctx { - struct ntb_softc *ntb; +struct ntb_net_ctx { + device_t *dev; struct ifnet *ifp; - struct ntb_transport_mw mw_vec[NTB_MAX_NUM_MW]; - struct ntb_transport_qp *qp_vec; - struct _qpset qp_bitmap; - struct _qpset qp_bitmap_free; - unsigned mw_count; - unsigned qp_count; - volatile bool link_is_up; - struct callout link_work; - struct callout link_watchdog; - struct task link_cleanup; - uint64_t bufsize; + struct ntb_transport_qp *qp; u_char eaddr[ETHER_ADDR_LEN]; struct mtx tx_lock; - struct mtx rx_lock; - - /* The hardcoded single queuepair in ntb_setup_interface() */ - struct ntb_transport_qp *qp; -}; - -static struct ntb_transport_ctx net_softc; - -enum { - IF_NTB_DESC_DONE_FLAG = 1 << 0, - IF_NTB_LINK_DOWN_FLAG = 1 << 1, -}; - -struct ntb_payload_header { - ntb_q_idx_t ver; - uint32_t len; - uint32_t flags; -}; - -enum { - /* - * The order of this enum is part of the if_ntb remote protocol. Do - * not reorder without bumping protocol version (and it's probably best - * to keep the protocol in lock-step with the Linux NTB driver. - */ - IF_NTB_VERSION = 0, - IF_NTB_QP_LINKS, - IF_NTB_NUM_QPS, - IF_NTB_NUM_MWS, - /* - * N.B.: transport_link_work assumes MW1 enums = MW0 + 2. - */ - IF_NTB_MW0_SZ_HIGH, - IF_NTB_MW0_SZ_LOW, - IF_NTB_MW1_SZ_HIGH, - IF_NTB_MW1_SZ_LOW, - IF_NTB_MAX_SPAD, - - /* - * Some NTB-using hardware have a watchdog to work around NTB hangs; if - * a register or doorbell isn't written every few seconds, the link is - * torn down. Write an otherwise unused register every few seconds to - * work around this watchdog. - */ - IF_NTB_WATCHDOG_SPAD = 15 + struct callout queue_full; }; -CTASSERT(IF_NTB_WATCHDOG_SPAD < XEON_SPAD_COUNT && - IF_NTB_WATCHDOG_SPAD < ATOM_SPAD_COUNT); -#define QP_TO_MW(nt, qp) ((qp) % nt->mw_count) -#define NTB_QP_DEF_NUM_ENTRIES 100 -#define NTB_LINK_DOWN_TIMEOUT 10 - -static int ntb_handle_module_events(struct module *m, int what, void *arg); -static int ntb_setup_interface(void); -static int ntb_teardown_interface(void); +static int ntb_net_probe(device_t dev); +static int ntb_net_attach(device_t dev); +static int ntb_net_detach(device_t dev); static void ntb_net_init(void *arg); static int ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data); static void ntb_start(struct ifnet *ifp); @@ -303,165 +82,72 @@ static void ntb_net_tx_handler(struct nt static void ntb_net_rx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); static void ntb_net_event_handler(void *data, enum ntb_link_event status); -static int ntb_transport_probe(struct ntb_softc *ntb); -static void ntb_transport_free(struct ntb_transport_ctx *); -static void ntb_transport_init_queue(struct ntb_transport_ctx *nt, - unsigned int qp_num); -static void ntb_transport_free_queue(struct ntb_transport_qp *qp); -static struct ntb_transport_qp *ntb_transport_create_queue(void *data, - struct ntb_softc *pdev, const struct ntb_queue_handlers *handlers); -static void ntb_transport_link_up(struct ntb_transport_qp *qp); -static int ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, - void *data, unsigned int len); -static int ntb_process_tx(struct ntb_transport_qp *qp, - struct ntb_queue_entry *entry); -static void ntb_memcpy_tx(struct ntb_transport_qp *qp, - struct ntb_queue_entry *entry, void *offset); static void ntb_qp_full(void *arg); -static void ntb_transport_rxc_db(void *arg, int pending); -static int ntb_process_rxc(struct ntb_transport_qp *qp); -static void ntb_memcpy_rx(struct ntb_transport_qp *qp, - struct ntb_queue_entry *entry, void *offset); -static inline void ntb_rx_copy_callback(struct ntb_transport_qp *qp, - void *data); -static void ntb_complete_rxc(void *arg, int pending); -static void ntb_transport_doorbell_callback(void *data, uint32_t vector); -static void ntb_transport_event_callback(void *data); -static void ntb_transport_link_work(void *arg); -static int ntb_set_mw(struct ntb_transport_ctx *, int num_mw, size_t size); -static void ntb_free_mw(struct ntb_transport_ctx *nt, int num_mw); -static int ntb_transport_setup_qp_mw(struct ntb_transport_ctx *nt, - unsigned int qp_num); -static void ntb_qp_link_work(void *arg); -static void ntb_transport_link_cleanup(struct ntb_transport_ctx *nt); -static void ntb_transport_link_cleanup_work(void *, int); -static void ntb_qp_link_down(struct ntb_transport_qp *qp); -static void ntb_qp_link_down_reset(struct ntb_transport_qp *qp); -static void ntb_qp_link_cleanup(struct ntb_transport_qp *qp); -static void ntb_transport_link_down(struct ntb_transport_qp *qp); -static void ntb_send_link_down(struct ntb_transport_qp *qp); -static void ntb_list_add(struct mtx *lock, struct ntb_queue_entry *entry, - struct ntb_queue_list *list); -static struct ntb_queue_entry *ntb_list_rm(struct mtx *lock, - struct ntb_queue_list *list); -static struct ntb_queue_entry *ntb_list_mv(struct mtx *lock, - struct ntb_queue_list *from, struct ntb_queue_list *to); static void create_random_local_eui48(u_char *eaddr); -static unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp); -static void xeon_link_watchdog_hb(void *); - -static const struct ntb_ctx_ops ntb_transport_ops = { - .link_event = ntb_transport_event_callback, - .db_event = ntb_transport_doorbell_callback, -}; - -MALLOC_DEFINE(M_NTB_IF, "if_ntb", "ntb network driver"); - -static inline void -iowrite32(uint32_t val, void *addr) -{ - - bus_space_write_4(X86_BUS_SPACE_MEM, 0/* HACK */, (uintptr_t)addr, - val); -} -/* Module setup and teardown */ static int -ntb_handle_module_events(struct module *m, int what, void *arg) +ntb_net_probe(device_t dev) { - int err = 0; - switch (what) { - case MOD_LOAD: - err = ntb_setup_interface(); - break; - case MOD_UNLOAD: - err = ntb_teardown_interface(); - break; - default: - err = EOPNOTSUPP; - break; - } - return (err); + device_set_desc(dev, "NTB Network Interface"); + return (0); } -static moduledata_t if_ntb_mod = { - "if_ntb", - ntb_handle_module_events, - NULL -}; - -DECLARE_MODULE(if_ntb, if_ntb_mod, SI_SUB_KLD, SI_ORDER_ANY); -MODULE_DEPEND(if_ntb, ntb_hw, 1, 1, 1); - static int -ntb_setup_interface(void) +ntb_net_attach(device_t dev) { + struct ntb_net_ctx *sc = device_get_softc(dev); struct ifnet *ifp; struct ntb_queue_handlers handlers = { ntb_net_rx_handler, ntb_net_tx_handler, ntb_net_event_handler }; - int rc; - net_softc.ntb = devclass_get_softc(devclass_find("ntb_hw"), 0); - if (net_softc.ntb == NULL) { - printf("ntb: Cannot find devclass\n"); - return (ENXIO); - } - - ifp = net_softc.ifp = if_alloc(IFT_ETHER); + ifp = sc->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { - ntb_transport_free(&net_softc); printf("ntb: Cannot allocate ifnet structure\n"); return (ENOMEM); } - if_initname(ifp, "ntb", 0); + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - rc = ntb_transport_probe(net_softc.ntb); - if (rc != 0) { - printf("ntb: Cannot init transport: %d\n", rc); - if_free(net_softc.ifp); - return (rc); - } + mtx_init(&sc->tx_lock, "ntb tx", NULL, MTX_DEF); + callout_init(&sc->queue_full, 1); - net_softc.qp = ntb_transport_create_queue(ifp, net_softc.ntb, + sc->qp = ntb_transport_create_queue(ifp, device_get_parent(dev), &handlers); ifp->if_init = ntb_net_init; - ifp->if_softc = &net_softc; + ifp->if_softc = sc; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ntb_ioctl; ifp->if_start = ntb_start; IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; IFQ_SET_READY(&ifp->if_snd); - create_random_local_eui48(net_softc.eaddr); - ether_ifattach(ifp, net_softc.eaddr); + create_random_local_eui48(sc->eaddr); + ether_ifattach(ifp, sc->eaddr); ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_JUMBO_MTU; ifp->if_capenable = ifp->if_capabilities; - ifp->if_mtu = ntb_transport_max_size(net_softc.qp) - ETHER_HDR_LEN - + ifp->if_mtu = ntb_transport_max_size(sc->qp) - ETHER_HDR_LEN - ETHER_CRC_LEN; - ntb_transport_link_up(net_softc.qp); - net_softc.bufsize = ntb_transport_max_size(net_softc.qp) + - sizeof(struct ether_header); + ntb_transport_link_up(sc->qp); return (0); } static int -ntb_teardown_interface(void) +ntb_net_detach(device_t dev) { + struct ntb_net_ctx *sc = device_get_softc(dev); - if (net_softc.qp != NULL) { - ntb_transport_link_down(net_softc.qp); - - ntb_transport_free_queue(net_softc.qp); - ntb_transport_free(&net_softc); + if (sc->qp != NULL) { + ntb_transport_link_down(sc->qp); + ntb_transport_free_queue(sc->qp); } - if (net_softc.ifp != NULL) { - ether_ifdetach(net_softc.ifp); - if_free(net_softc.ifp); - net_softc.ifp = NULL; + if (sc->ifp != NULL) { + ether_ifdetach(sc->ifp); + if_free(sc->ifp); + sc->ifp = NULL; } + mtx_destroy(&sc->tx_lock); return (0); } @@ -471,8 +157,8 @@ ntb_teardown_interface(void) static void ntb_net_init(void *arg) { - struct ntb_transport_ctx *ntb_softc = arg; - struct ifnet *ifp = ntb_softc->ifp; + struct ntb_net_ctx *sc = arg; + struct ifnet *ifp = sc->ifp; ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -483,14 +169,14 @@ ntb_net_init(void *arg) static int ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { - struct ntb_transport_ctx *nt = ifp->if_softc; + struct ntb_net_ctx *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; int error = 0; switch (command) { case SIOCSIFMTU: { - if (ifr->ifr_mtu > ntb_transport_max_size(nt->qp) - + if (ifr->ifr_mtu > ntb_transport_max_size(sc->qp) - ETHER_HDR_LEN - ETHER_CRC_LEN) { error = EINVAL; break; @@ -512,16 +198,16 @@ static void ntb_start(struct ifnet *ifp) { struct mbuf *m_head; - struct ntb_transport_ctx *nt = ifp->if_softc; + struct ntb_net_ctx *sc = ifp->if_softc; int rc; - mtx_lock(&nt->tx_lock); + mtx_lock(&sc->tx_lock); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; CTR0(KTR_NTB, "TX: ntb_start"); while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); CTR1(KTR_NTB, "TX: start mbuf %p", m_head); - rc = ntb_transport_tx_enqueue(nt->qp, m_head, m_head, + rc = ntb_transport_tx_enqueue(sc->qp, m_head, m_head, m_length(m_head, NULL)); if (rc != 0) { CTR1(KTR_NTB, @@ -530,14 +216,13 @@ ntb_start(struct ifnet *ifp) if (rc == EAGAIN) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - callout_reset(&nt->qp->queue_full, hz / 1000, + callout_reset(&sc->queue_full, hz / 1000, ntb_qp_full, ifp); } break; } - } - mtx_unlock(&nt->tx_lock); + mtx_unlock(&sc->tx_lock); } /* Network Device Callbacks */ @@ -558,6 +243,7 @@ ntb_net_rx_handler(struct ntb_transport_ struct ifnet *ifp = qp_data; CTR0(KTR_NTB, "RX: rx handler"); + m->m_pkthdr.csum_flags = CSUM_IP_CHECKED | CSUM_IP_VALID; (*ifp->if_input)(ifp, m); } @@ -581,444 +267,6 @@ ntb_net_event_handler(void *data, enum n } } -/* Transport Init and teardown */ - -static void -xeon_link_watchdog_hb(void *arg) -{ - struct ntb_transport_ctx *nt; - - nt = arg; - ntb_spad_write(nt->ntb, IF_NTB_WATCHDOG_SPAD, 0); - callout_reset(&nt->link_watchdog, 1 * hz, xeon_link_watchdog_hb, nt); -} - -static int -ntb_transport_probe(struct ntb_softc *ntb) -{ - struct ntb_transport_ctx *nt = &net_softc; - struct ntb_transport_mw *mw; - uint64_t qp_bitmap; - int rc; - unsigned i; - - nt->mw_count = ntb_mw_count(ntb); - for (i = 0; i < nt->mw_count; i++) { - mw = &nt->mw_vec[i]; - - rc = ntb_mw_get_range(ntb, i, &mw->phys_addr, &mw->vbase, - &mw->phys_size, &mw->xlat_align, &mw->xlat_align_size, - &mw->addr_limit); - if (rc != 0) - goto err; - - mw->buff_size = 0; - mw->xlat_size = 0; - mw->virt_addr = NULL; - mw->dma_addr = 0; - - rc = ntb_mw_set_wc(nt->ntb, i, VM_MEMATTR_WRITE_COMBINING); - if (rc) - ntb_printf(0, "Unable to set mw%d caching\n", i); - } - - qp_bitmap = ntb_db_valid_mask(ntb); - nt->qp_count = flsll(qp_bitmap); - KASSERT(nt->qp_count != 0, ("bogus db bitmap")); - nt->qp_count -= 1; - - if (max_num_clients != 0 && max_num_clients < nt->qp_count) - nt->qp_count = max_num_clients; - else if (nt->mw_count < nt->qp_count) - nt->qp_count = nt->mw_count; - KASSERT(nt->qp_count <= QP_SETSIZE, ("invalid qp_count")); - - mtx_init(&nt->tx_lock, "ntb transport tx", NULL, MTX_DEF); - mtx_init(&nt->rx_lock, "ntb transport rx", NULL, MTX_DEF); - - nt->qp_vec = malloc(nt->qp_count * sizeof(*nt->qp_vec), M_NTB_IF, - M_WAITOK | M_ZERO); - - for (i = 0; i < nt->qp_count; i++) { - set_bit(i, &nt->qp_bitmap); - set_bit(i, &nt->qp_bitmap_free); - ntb_transport_init_queue(nt, i); - } - - callout_init(&nt->link_work, 0); - callout_init(&nt->link_watchdog, 0); - TASK_INIT(&nt->link_cleanup, 0, ntb_transport_link_cleanup_work, nt); - - rc = ntb_set_ctx(ntb, nt, &ntb_transport_ops); - if (rc != 0) - goto err; - - nt->link_is_up = false; - ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); - ntb_link_event(ntb); - - callout_reset(&nt->link_work, 0, ntb_transport_link_work, nt); - if (enable_xeon_watchdog != 0) - callout_reset(&nt->link_watchdog, 0, xeon_link_watchdog_hb, nt); - return (0); - -err: - free(nt->qp_vec, M_NTB_IF); - nt->qp_vec = NULL; - return (rc); -} - -static void -ntb_transport_free(struct ntb_transport_ctx *nt) -{ - struct ntb_softc *ntb = nt->ntb; - struct _qpset qp_bitmap_alloc; - uint8_t i; - - ntb_transport_link_cleanup(nt); - taskqueue_drain(taskqueue_swi, &nt->link_cleanup); - callout_drain(&nt->link_work); - callout_drain(&nt->link_watchdog); - - BIT_COPY(QP_SETSIZE, &nt->qp_bitmap, &qp_bitmap_alloc); - BIT_NAND(QP_SETSIZE, &qp_bitmap_alloc, &nt->qp_bitmap_free); - - /* Verify that all the QPs are freed */ - for (i = 0; i < nt->qp_count; i++) - if (test_bit(i, &qp_bitmap_alloc)) - ntb_transport_free_queue(&nt->qp_vec[i]); - - ntb_link_disable(ntb); - ntb_clear_ctx(ntb); - - for (i = 0; i < nt->mw_count; i++) - ntb_free_mw(nt, i); - - free(nt->qp_vec, M_NTB_IF); -} - -static void -ntb_transport_init_queue(struct ntb_transport_ctx *nt, unsigned int qp_num) -{ - struct ntb_transport_mw *mw; - struct ntb_transport_qp *qp; - vm_paddr_t mw_base; - uint64_t mw_size, qp_offset; - size_t tx_size; - unsigned num_qps_mw, mw_num, mw_count; - - mw_count = nt->mw_count; - mw_num = QP_TO_MW(nt, qp_num); - mw = &nt->mw_vec[mw_num]; - - qp = &nt->qp_vec[qp_num]; - qp->qp_num = qp_num; - qp->transport = nt; - qp->ntb = nt->ntb; - qp->client_ready = false; - qp->event_handler = NULL; - ntb_qp_link_down_reset(qp); - - if (nt->qp_count % mw_count && mw_num + 1 < nt->qp_count / mw_count) - num_qps_mw = nt->qp_count / mw_count + 1; - else - num_qps_mw = nt->qp_count / mw_count; - - mw_base = mw->phys_addr; - mw_size = mw->phys_size; - - tx_size = mw_size / num_qps_mw; - qp_offset = tx_size * (qp_num / mw_count); - - qp->tx_mw = mw->vbase + qp_offset; - KASSERT(qp->tx_mw != NULL, ("uh oh?")); - - /* XXX Assumes that a vm_paddr_t is equivalent to bus_addr_t */ - qp->tx_mw_phys = mw_base + qp_offset; - KASSERT(qp->tx_mw_phys != 0, ("uh oh?")); - - tx_size -= sizeof(struct ntb_rx_info); - qp->rx_info = (void *)(qp->tx_mw + tx_size); - - /* Due to house-keeping, there must be at least 2 buffs */ - qp->tx_max_frame = qmin(tx_size / 2, - transport_mtu + sizeof(struct ntb_payload_header)); - qp->tx_max_entry = tx_size / qp->tx_max_frame; - - callout_init(&qp->link_work, 0); - callout_init(&qp->queue_full, 1); - callout_init(&qp->rx_full, 1); - - mtx_init(&qp->ntb_rx_q_lock, "ntb rx q", NULL, MTX_SPIN); - mtx_init(&qp->ntb_tx_free_q_lock, "ntb tx free q", NULL, MTX_SPIN); - TASK_INIT(&qp->rx_completion_task, 0, ntb_complete_rxc, qp); - TASK_INIT(&qp->rxc_db_work, 0, ntb_transport_rxc_db, qp); - - STAILQ_INIT(&qp->rx_post_q); - STAILQ_INIT(&qp->rx_pend_q); - STAILQ_INIT(&qp->tx_free_q); - - callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); -} - -static void -ntb_transport_free_queue(struct ntb_transport_qp *qp) -{ - struct ntb_queue_entry *entry; - - if (qp == NULL) - return; - - callout_drain(&qp->link_work); - - ntb_db_set_mask(qp->ntb, 1ull << qp->qp_num); - taskqueue_drain(taskqueue_swi, &qp->rxc_db_work); - taskqueue_drain(taskqueue_swi, &qp->rx_completion_task); - - qp->cb_data = NULL; - qp->rx_handler = NULL; - qp->tx_handler = NULL; - qp->event_handler = NULL; - - while ((entry = ntb_list_rm(&qp->ntb_rx_q_lock, &qp->rx_pend_q))) - free(entry, M_NTB_IF); - - while ((entry = ntb_list_rm(&qp->ntb_rx_q_lock, &qp->rx_post_q))) - free(entry, M_NTB_IF); - - while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) - free(entry, M_NTB_IF); - - set_bit(qp->qp_num, &qp->transport->qp_bitmap_free); -} - -/** - * ntb_transport_create_queue - Create a new NTB transport layer queue - * @rx_handler: receive callback function - * @tx_handler: transmit callback function - * @event_handler: event callback function - * - * Create a new NTB transport layer queue and provide the queue with a callback - * routine for both transmit and receive. The receive callback routine will be - * used to pass up data when the transport has received it on the queue. The - * transmit callback routine will be called when the transport has completed the - * transmission of the data on the queue and the data is ready to be freed. - * - * RETURNS: pointer to newly created ntb_queue, NULL on error. - */ -static struct ntb_transport_qp * -ntb_transport_create_queue(void *data, struct ntb_softc *ntb, - const struct ntb_queue_handlers *handlers) -{ - struct ntb_queue_entry *entry; - struct ntb_transport_qp *qp; - struct ntb_transport_ctx *nt; - unsigned int free_queue; - int i; - - nt = ntb_get_ctx(ntb, NULL); - KASSERT(nt != NULL, ("bogus")); - - free_queue = ffs_bit(&nt->qp_bitmap); - if (free_queue == 0) - return (NULL); - - /* decrement free_queue to make it zero based */ - free_queue--; - - qp = &nt->qp_vec[free_queue]; - clear_bit(qp->qp_num, &nt->qp_bitmap_free); - qp->cb_data = data; - qp->rx_handler = handlers->rx_handler; - qp->tx_handler = handlers->tx_handler; - qp->event_handler = handlers->event_handler; - - for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { - entry = malloc(sizeof(*entry), M_NTB_IF, M_WAITOK | M_ZERO); - entry->cb_data = nt->ifp; - entry->buf = NULL; - entry->len = transport_mtu; - ntb_list_add(&qp->ntb_rx_q_lock, entry, &qp->rx_pend_q); - } - - for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { - entry = malloc(sizeof(*entry), M_NTB_IF, M_WAITOK | M_ZERO); - ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); - } - - ntb_db_clear(ntb, 1ull << qp->qp_num); - ntb_db_clear_mask(ntb, 1ull << qp->qp_num); - return (qp); -} - -/** - * ntb_transport_link_up - Notify NTB transport of client readiness to use queue - * @qp: NTB transport layer queue to be enabled - * - * Notify NTB transport layer of client readiness to use queue - */ -static void -ntb_transport_link_up(struct ntb_transport_qp *qp) -{ - struct ntb_transport_ctx *nt; - - if (qp == NULL) - return; - - qp->client_ready = true; - - nt = qp->transport; - ntb_printf(2, "qp client ready\n"); - - if (qp->transport->link_is_up) - callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); -} - - - -/* Transport Tx */ - -/** - * ntb_transport_tx_enqueue - Enqueue a new NTB queue entry - * @qp: NTB transport layer queue the entry is to be enqueued on - * @cb: per buffer pointer for callback function to use - * @data: pointer to data buffer that will be sent - * @len: length of the data buffer - * - * Enqueue a new transmit buffer onto the transport queue from which a NTB - * payload will be transmitted. This assumes that a lock is being held to - * serialize access to the qp. - * - * RETURNS: An appropriate ERRNO error value on error, or zero for success. - */ -static int -ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data, - unsigned int len) -{ - struct ntb_queue_entry *entry; - int rc; - - if (qp == NULL || !qp->link_is_up || len == 0) { - CTR0(KTR_NTB, "TX: link not up"); - return (EINVAL); - } - - entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q); - if (entry == NULL) { - CTR0(KTR_NTB, "TX: could not get entry from tx_free_q"); - qp->tx_err_no_buf++; - return (EBUSY); - } - CTR1(KTR_NTB, "TX: got entry %p from tx_free_q", entry); - - entry->cb_data = cb; - entry->buf = data; - entry->len = len; - entry->flags = 0; - - rc = ntb_process_tx(qp, entry); - if (rc != 0) { - ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); - CTR1(KTR_NTB, - "TX: process_tx failed. Returning entry %p to tx_free_q", - entry); - } - return (rc); -} - -static int -ntb_process_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry) -{ - void *offset; - - offset = qp->tx_mw + qp->tx_max_frame * qp->tx_index; - CTR3(KTR_NTB, - "TX: process_tx: tx_pkts=%lu, tx_index=%u, remote entry=%u", - qp->tx_pkts, qp->tx_index, qp->remote_rx_info->entry); - if (qp->tx_index == qp->remote_rx_info->entry) { - CTR0(KTR_NTB, "TX: ring full"); - qp->tx_ring_full++; - return (EAGAIN); - } - - if (entry->len > qp->tx_max_frame - sizeof(struct ntb_payload_header)) { - if (qp->tx_handler != NULL) - qp->tx_handler(qp, qp->cb_data, entry->buf, - EIO); - else - m_freem(entry->buf); - - entry->buf = NULL; - ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); - CTR1(KTR_NTB, - "TX: frame too big. returning entry %p to tx_free_q", - entry); - return (0); - } - CTR2(KTR_NTB, "TX: copying entry %p to offset %p", entry, offset); - ntb_memcpy_tx(qp, entry, offset); - - qp->tx_index++; - qp->tx_index %= qp->tx_max_entry; - - qp->tx_pkts++; - - return (0); -} - -static void -ntb_memcpy_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry, - void *offset) -{ - struct ntb_payload_header *hdr; - - /* This piece is from Linux' ntb_async_tx() */ - hdr = (struct ntb_payload_header *)((char *)offset + qp->tx_max_frame - - sizeof(struct ntb_payload_header)); - entry->x_hdr = hdr; - iowrite32(entry->len, &hdr->len); - iowrite32(qp->tx_pkts, &hdr->ver); - - /* This piece is ntb_memcpy_tx() */ - CTR2(KTR_NTB, "TX: copying %d bytes to offset %p", entry->len, offset); - if (entry->buf != NULL) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 18 09:19:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED621BBC451; Thu, 18 Aug 2016 09:19:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A3B991AAD; Thu, 18 Aug 2016 09:19:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9J1aY089849; Thu, 18 Aug 2016 09:19:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9J1uF089848; Thu, 18 Aug 2016 09:19:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180919.u7I9J1uF089848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:19:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304347 - stable/11/sys/dev/ntb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:19:03 -0000 Author: mav Date: Thu Aug 18 09:19:01 2016 New Revision: 304347 URL: https://svnweb.freebsd.org/changeset/base/304347 Log: MFC r302486: Fix operation with multiple qps. Modified: stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:18:23 2016 (r304346) +++ stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:19:01 2016 (r304347) @@ -470,7 +470,7 @@ ntb_transport_init_queue(struct ntb_tran qp->event_handler = NULL; ntb_qp_link_down_reset(qp); - if (nt->qp_count % mw_count && mw_num + 1 < nt->qp_count / mw_count) + if (mw_num < nt->qp_count % mw_count) num_qps_mw = nt->qp_count / mw_count + 1; else num_qps_mw = nt->qp_count / mw_count; @@ -567,7 +567,7 @@ ntb_transport_create_queue(void *data, d unsigned int free_queue; int i; - free_queue = ffs_bit(&nt->qp_bitmap); + free_queue = ffs_bit(&nt->qp_bitmap_free); if (free_queue == 0) return (NULL); @@ -612,7 +612,7 @@ ntb_transport_link_up(struct ntb_transpo qp->client_ready = true; - ntb_printf(2, "qp client ready\n"); + ntb_printf(2, "qp %d client ready\n", qp->qp_num); if (nt->link_is_up) callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); @@ -1161,7 +1161,7 @@ ntb_transport_setup_qp_mw(struct ntb_tra if (mw->virt_addr == NULL) return (ENOMEM); - if (nt->qp_count % mw_count && mw_num + 1 < nt->qp_count / mw_count) + if (mw_num < nt->qp_count % mw_count) num_qps_mw = nt->qp_count / mw_count + 1; else num_qps_mw = nt->qp_count / mw_count; @@ -1211,7 +1211,7 @@ ntb_qp_link_work(void *arg) /* See if the remote side is up */ if ((val & (1ull << qp->qp_num)) != 0) { - ntb_printf(2, "qp link up\n"); + ntb_printf(2, "qp %d link up\n", qp->qp_num); qp->link_is_up = true; if (qp->event_handler != NULL) From owner-svn-src-all@freebsd.org Thu Aug 18 09:19:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44AC3BBC4E1; Thu, 18 Aug 2016 09:19:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 225EB1C65; Thu, 18 Aug 2016 09:19:51 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9JoaV089937; Thu, 18 Aug 2016 09:19:50 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9JoYU089936; Thu, 18 Aug 2016 09:19:50 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180919.u7I9JoYU089936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304348 - stable/11/sys/dev/ntb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:19:51 -0000 Author: mav Date: Thu Aug 18 09:19:50 2016 New Revision: 304348 URL: https://svnweb.freebsd.org/changeset/base/304348 Log: MFC r302487: Reduce code divergence from Linux, preparing for DMA support. Modified: stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:19:01 2016 (r304347) +++ stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:19:50 2016 (r304348) @@ -264,8 +264,6 @@ static void ntb_transport_init_queue(str unsigned int qp_num); static int ntb_process_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry); -static void ntb_memcpy_tx(struct ntb_transport_qp *qp, - struct ntb_queue_entry *entry, void *offset); static void ntb_transport_rxc_db(void *arg, int pending); static int ntb_process_rxc(struct ntb_transport_qp *qp); static void ntb_memcpy_rx(struct ntb_transport_qp *qp, @@ -586,11 +584,13 @@ ntb_transport_create_queue(void *data, d entry->cb_data = data; entry->buf = NULL; entry->len = transport_mtu; + entry->qp = qp; ntb_list_add(&qp->ntb_rx_q_lock, entry, &qp->rx_pend_q); } for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { entry = malloc(sizeof(*entry), M_NTB_T, M_WAITOK | M_ZERO); + entry->qp = qp; ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); } @@ -672,60 +672,44 @@ ntb_transport_tx_enqueue(struct ntb_tran return (rc); } -static int -ntb_process_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry) +static void +ntb_tx_copy_callback(void *data) { - void *offset; + struct ntb_queue_entry *entry = data; + struct ntb_transport_qp *qp = entry->qp; + struct ntb_payload_header *hdr = entry->x_hdr; - offset = qp->tx_mw + qp->tx_max_frame * qp->tx_index; - CTR3(KTR_NTB, - "TX: process_tx: tx_pkts=%lu, tx_index=%u, remote entry=%u", - qp->tx_pkts, qp->tx_index, qp->remote_rx_info->entry); - if (qp->tx_index == qp->remote_rx_info->entry) { - CTR0(KTR_NTB, "TX: ring full"); - qp->tx_ring_full++; - return (EAGAIN); - } + iowrite32(entry->flags | NTBT_DESC_DONE_FLAG, &hdr->flags); + CTR1(KTR_NTB, "TX: hdr %p set DESC_DONE", hdr); - if (entry->len > qp->tx_max_frame - sizeof(struct ntb_payload_header)) { - if (qp->tx_handler != NULL) + NTB_PEER_DB_SET(qp->ntb, 1ull << qp->qp_num); + + /* + * The entry length can only be zero if the packet is intended to be a + * "link down" or similar. Since no payload is being sent in these + * cases, there is nothing to add to the completion queue. + */ + if (entry->len > 0) { + qp->tx_bytes += entry->len; + + if (qp->tx_handler) qp->tx_handler(qp, qp->cb_data, entry->buf, - EIO); + entry->len); else m_freem(entry->buf); - entry->buf = NULL; - ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); - CTR1(KTR_NTB, - "TX: frame too big. returning entry %p to tx_free_q", - entry); - return (0); } - CTR2(KTR_NTB, "TX: copying entry %p to offset %p", entry, offset); - ntb_memcpy_tx(qp, entry, offset); - - qp->tx_index++; - qp->tx_index %= qp->tx_max_entry; - qp->tx_pkts++; - - return (0); + CTR3(KTR_NTB, + "TX: entry %p sent. hdr->ver = %u, hdr->flags = 0x%x, Returning " + "to tx_free_q", entry, hdr->ver, hdr->flags); + ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); } static void -ntb_memcpy_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry, - void *offset) +ntb_memcpy_tx(struct ntb_queue_entry *entry, void *offset) { - struct ntb_payload_header *hdr; - - /* This piece is from Linux' ntb_async_tx() */ - hdr = (struct ntb_payload_header *)((char *)offset + qp->tx_max_frame - - sizeof(struct ntb_payload_header)); - entry->x_hdr = hdr; - iowrite32(entry->len, &hdr->len); - iowrite32(qp->tx_pkts, &hdr->ver); - /* This piece is ntb_memcpy_tx() */ CTR2(KTR_NTB, "TX: copying %d bytes to offset %p", entry->len, offset); if (entry->buf != NULL) { m_copydata((struct mbuf *)entry->buf, 0, entry->len, offset); @@ -737,32 +721,62 @@ ntb_memcpy_tx(struct ntb_transport_qp *q wmb(); } - /* The rest is ntb_tx_copy_callback() */ - iowrite32(entry->flags | NTBT_DESC_DONE_FLAG, &hdr->flags); - CTR1(KTR_NTB, "TX: hdr %p set DESC_DONE", hdr); + ntb_tx_copy_callback(entry); +} - NTB_PEER_DB_SET(qp->ntb, 1ull << qp->qp_num); +static void +ntb_async_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry) +{ + struct ntb_payload_header *hdr; + void *offset; - /* - * The entry length can only be zero if the packet is intended to be a - * "link down" or similar. Since no payload is being sent in these - * cases, there is nothing to add to the completion queue. - */ - if (entry->len > 0) { - qp->tx_bytes += entry->len; + offset = qp->tx_mw + qp->tx_max_frame * qp->tx_index; + hdr = (struct ntb_payload_header *)((char *)offset + qp->tx_max_frame - + sizeof(struct ntb_payload_header)); + entry->x_hdr = hdr; - if (qp->tx_handler) + iowrite32(entry->len, &hdr->len); + iowrite32(qp->tx_pkts, &hdr->ver); + + ntb_memcpy_tx(entry, offset); +} + +static int +ntb_process_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry) +{ + + CTR3(KTR_NTB, + "TX: process_tx: tx_pkts=%lu, tx_index=%u, remote entry=%u", + qp->tx_pkts, qp->tx_index, qp->remote_rx_info->entry); + if (qp->tx_index == qp->remote_rx_info->entry) { + CTR0(KTR_NTB, "TX: ring full"); + qp->tx_ring_full++; + return (EAGAIN); + } + + if (entry->len > qp->tx_max_frame - sizeof(struct ntb_payload_header)) { + if (qp->tx_handler != NULL) qp->tx_handler(qp, qp->cb_data, entry->buf, - entry->len); + EIO); else m_freem(entry->buf); + entry->buf = NULL; + ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); + CTR1(KTR_NTB, + "TX: frame too big. returning entry %p to tx_free_q", + entry); + return (0); } + CTR2(KTR_NTB, "TX: copying entry %p to index %u", entry, qp->tx_index); + ntb_async_tx(qp, entry); - CTR3(KTR_NTB, - "TX: entry %p sent. hdr->ver = %u, hdr->flags = 0x%x, Returning " - "to tx_free_q", entry, hdr->ver, hdr->flags); - ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); + qp->tx_index++; + qp->tx_index %= qp->tx_max_entry; + + qp->tx_pkts++; + + return (0); } /* Transport Rx */ From owner-svn-src-all@freebsd.org Thu Aug 18 09:20:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2F28BBC55E; Thu, 18 Aug 2016 09:20:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B566D1DC1; Thu, 18 Aug 2016 09:20:26 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9KPtW090044; Thu, 18 Aug 2016 09:20:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9KP7D090043; Thu, 18 Aug 2016 09:20:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180920.u7I9KP7D090043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304349 - stable/11/sys/dev/ntb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:20:27 -0000 Author: mav Date: Thu Aug 18 09:20:25 2016 New Revision: 304349 URL: https://svnweb.freebsd.org/changeset/base/304349 Log: MFC r302488: Remove unneeded RX lock, and make TX lock per-qp. Modified: stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:19:50 2016 (r304348) +++ stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:20:25 2016 (r304349) @@ -181,6 +181,8 @@ struct ntb_transport_qp { uint64_t tx_pkts; uint64_t tx_ring_full; uint64_t tx_err_no_buf; + + struct mtx tx_lock; }; struct ntb_transport_mw { @@ -210,8 +212,6 @@ struct ntb_transport_ctx { struct callout link_work; struct callout link_watchdog; struct task link_cleanup; - struct mtx tx_lock; - struct mtx rx_lock; }; enum { @@ -372,9 +372,6 @@ ntb_transport_attach(device_t dev) nt->qp_count = nt->mw_count; KASSERT(nt->qp_count <= QP_SETSIZE, ("invalid qp_count")); - mtx_init(&nt->tx_lock, "ntb transport tx", NULL, MTX_DEF); - mtx_init(&nt->rx_lock, "ntb transport rx", NULL, MTX_DEF); - nt->qp_vec = malloc(nt->qp_count * sizeof(*nt->qp_vec), M_NTB_T, M_WAITOK | M_ZERO); @@ -499,6 +496,7 @@ ntb_transport_init_queue(struct ntb_tran mtx_init(&qp->ntb_rx_q_lock, "ntb rx q", NULL, MTX_SPIN); mtx_init(&qp->ntb_tx_free_q_lock, "ntb tx free q", NULL, MTX_SPIN); + mtx_init(&qp->tx_lock, "ntb transport tx", NULL, MTX_DEF); TASK_INIT(&qp->rx_completion_task, 0, ntb_complete_rxc, qp); TASK_INIT(&qp->rxc_db_work, 0, ntb_transport_rxc_db, qp); @@ -660,9 +658,9 @@ ntb_transport_tx_enqueue(struct ntb_tran entry->len = len; entry->flags = 0; - mtx_lock(&qp->transport->tx_lock); + mtx_lock(&qp->tx_lock); rc = ntb_process_tx(qp, entry); - mtx_unlock(&qp->transport->tx_lock); + mtx_unlock(&qp->tx_lock); if (rc != 0) { ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); CTR1(KTR_NTB, @@ -792,7 +790,6 @@ ntb_transport_rxc_db(void *arg, int pend * provide fairness to others */ CTR0(KTR_NTB, "RX: transport_rx"); - mtx_lock(&qp->transport->rx_lock); for (i = 0; i < qp->rx_max_entry; i++) { rc = ntb_process_rxc(qp); if (rc != 0) { @@ -800,7 +797,6 @@ ntb_transport_rxc_db(void *arg, int pend break; } } - mtx_unlock(&qp->transport->rx_lock); if (i == qp->rx_max_entry) taskqueue_enqueue(taskqueue_swi, &qp->rxc_db_work); @@ -1386,11 +1382,11 @@ ntb_send_link_down(struct ntb_transport_ entry->len = 0; entry->flags = NTBT_LINK_DOWN_FLAG; - mtx_lock(&qp->transport->tx_lock); + mtx_lock(&qp->tx_lock); rc = ntb_process_tx(qp, entry); + mtx_unlock(&qp->tx_lock); if (rc != 0) printf("ntb: Failed to send link down\n"); - mtx_unlock(&qp->transport->tx_lock); ntb_qp_link_down_reset(qp); } From owner-svn-src-all@freebsd.org Thu Aug 18 09:20:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59BC0BBC5BC; Thu, 18 Aug 2016 09:20:59 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10E551F6C; Thu, 18 Aug 2016 09:20:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9KwZT092110; Thu, 18 Aug 2016 09:20:58 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9Kw9U092109; Thu, 18 Aug 2016 09:20:58 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180920.u7I9Kw9U092109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304350 - stable/11/sys/dev/ntb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:20:59 -0000 Author: mav Date: Thu Aug 18 09:20:58 2016 New Revision: 304350 URL: https://svnweb.freebsd.org/changeset/base/304350 Log: MFC r302489: Remove rx_completion_task taskqueue. It is not needed after RX lock removed in previous commit. Modified: stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:20:25 2016 (r304349) +++ stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:20:58 2016 (r304350) @@ -157,7 +157,6 @@ struct ntb_transport_qp { struct ntb_queue_list rx_pend_q; /* ntb_rx_q_lock: synchronize access to rx_XXXX_q */ struct mtx ntb_rx_q_lock; - struct task rx_completion_task; struct task rxc_db_work; caddr_t rx_buff; ntb_q_idx_t rx_index; @@ -270,7 +269,7 @@ static void ntb_memcpy_rx(struct ntb_tra struct ntb_queue_entry *entry, void *offset); static inline void ntb_rx_copy_callback(struct ntb_transport_qp *qp, void *data); -static void ntb_complete_rxc(void *arg, int pending); +static void ntb_complete_rxc(struct ntb_transport_qp *qp); static void ntb_transport_doorbell_callback(void *data, uint32_t vector); static void ntb_transport_event_callback(void *data); static void ntb_transport_link_work(void *arg); @@ -497,7 +496,6 @@ ntb_transport_init_queue(struct ntb_tran mtx_init(&qp->ntb_rx_q_lock, "ntb rx q", NULL, MTX_SPIN); mtx_init(&qp->ntb_tx_free_q_lock, "ntb tx free q", NULL, MTX_SPIN); mtx_init(&qp->tx_lock, "ntb transport tx", NULL, MTX_DEF); - TASK_INIT(&qp->rx_completion_task, 0, ntb_complete_rxc, qp); TASK_INIT(&qp->rxc_db_work, 0, ntb_transport_rxc_db, qp); STAILQ_INIT(&qp->rx_post_q); @@ -519,7 +517,6 @@ ntb_transport_free_queue(struct ntb_tran NTB_DB_SET_MASK(qp->ntb, 1ull << qp->qp_num); taskqueue_drain(taskqueue_swi, &qp->rxc_db_work); - taskqueue_drain(taskqueue_swi, &qp->rx_completion_task); qp->cb_data = NULL; qp->rx_handler = NULL; @@ -866,7 +863,7 @@ ntb_process_rxc(struct ntb_transport_qp entry->len = -EIO; entry->flags |= NTBT_DESC_DONE_FLAG; - taskqueue_enqueue(taskqueue_swi, &qp->rx_completion_task); + ntb_complete_rxc(qp); } else { qp->rx_bytes += hdr->len; qp->rx_pkts++; @@ -908,13 +905,12 @@ ntb_rx_copy_callback(struct ntb_transpor entry = data; entry->flags |= NTBT_DESC_DONE_FLAG; - taskqueue_enqueue(taskqueue_swi, &qp->rx_completion_task); + ntb_complete_rxc(qp); } static void -ntb_complete_rxc(void *arg, int pending) +ntb_complete_rxc(struct ntb_transport_qp *qp) { - struct ntb_transport_qp *qp = arg; struct ntb_queue_entry *entry; struct mbuf *m; unsigned len; From owner-svn-src-all@freebsd.org Thu Aug 18 09:21:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08992BBC67C; Thu, 18 Aug 2016 09:21:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D8807135B; Thu, 18 Aug 2016 09:21:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9LaJn092842; Thu, 18 Aug 2016 09:21:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9LawA092841; Thu, 18 Aug 2016 09:21:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180921.u7I9LawA092841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304351 - stable/11/sys/dev/ntb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:21:38 -0000 Author: mav Date: Thu Aug 18 09:21:36 2016 New Revision: 304351 URL: https://svnweb.freebsd.org/changeset/base/304351 Log: MFC r302490: Create separate RX taskqueue for each qp. Modified: stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:20:58 2016 (r304350) +++ stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:21:36 2016 (r304351) @@ -158,6 +158,7 @@ struct ntb_transport_qp { /* ntb_rx_q_lock: synchronize access to rx_XXXX_q */ struct mtx ntb_rx_q_lock; struct task rxc_db_work; + struct taskqueue *rxc_tq; caddr_t rx_buff; ntb_q_idx_t rx_index; ntb_q_idx_t rx_max_entry; @@ -200,6 +201,7 @@ struct ntb_transport_mw { }; struct ntb_transport_ctx { + device_t dev; device_t ntb; struct ntb_transport_mw *mw_vec; struct ntb_transport_qp *qp_vec; @@ -337,6 +339,7 @@ ntb_transport_attach(device_t dev) int rc; unsigned i; + nt->dev = dev; nt->ntb = ntb; nt->mw_count = NTB_MW_COUNT(ntb); nt->mw_vec = malloc(nt->mw_count * sizeof(*nt->mw_vec), M_NTB_T, @@ -497,6 +500,10 @@ ntb_transport_init_queue(struct ntb_tran mtx_init(&qp->ntb_tx_free_q_lock, "ntb tx free q", NULL, MTX_SPIN); mtx_init(&qp->tx_lock, "ntb transport tx", NULL, MTX_DEF); TASK_INIT(&qp->rxc_db_work, 0, ntb_transport_rxc_db, qp); + qp->rxc_tq = taskqueue_create("ntbt_rx", M_WAITOK, + taskqueue_thread_enqueue, &qp->rxc_tq); + taskqueue_start_threads(&qp->rxc_tq, 1, PI_NET, "%s rx%d", + device_get_nameunit(nt->dev), qp_num); STAILQ_INIT(&qp->rx_post_q); STAILQ_INIT(&qp->rx_pend_q); @@ -516,7 +523,8 @@ ntb_transport_free_queue(struct ntb_tran callout_drain(&qp->link_work); NTB_DB_SET_MASK(qp->ntb, 1ull << qp->qp_num); - taskqueue_drain(taskqueue_swi, &qp->rxc_db_work); + taskqueue_drain_all(qp->rxc_tq); + taskqueue_free(qp->rxc_tq); qp->cb_data = NULL; qp->rx_handler = NULL; @@ -779,35 +787,18 @@ static void ntb_transport_rxc_db(void *arg, int pending __unused) { struct ntb_transport_qp *qp = arg; - ntb_q_idx_t i; int rc; - /* - * Limit the number of packets processed in a single interrupt to - * provide fairness to others - */ CTR0(KTR_NTB, "RX: transport_rx"); - for (i = 0; i < qp->rx_max_entry; i++) { - rc = ntb_process_rxc(qp); - if (rc != 0) { - CTR0(KTR_NTB, "RX: process_rxc failed"); - break; - } - } +again: + while ((rc = ntb_process_rxc(qp)) == 0) + ; + CTR1(KTR_NTB, "RX: process_rxc returned %d", rc); - if (i == qp->rx_max_entry) - taskqueue_enqueue(taskqueue_swi, &qp->rxc_db_work); - else if ((NTB_DB_READ(qp->ntb) & (1ull << qp->qp_num)) != 0) { - /* If db is set, clear it and read it back to commit clear. */ + if ((NTB_DB_READ(qp->ntb) & (1ull << qp->qp_num)) != 0) { + /* If db is set, clear it and check queue once more. */ NTB_DB_CLEAR(qp->ntb, 1ull << qp->qp_num); - (void)NTB_DB_READ(qp->ntb); - - /* - * An interrupt may have arrived between finishing - * ntb_process_rxc and clearing the doorbell bit: there might - * be some more work to do. - */ - taskqueue_enqueue(taskqueue_swi, &qp->rxc_db_work); + goto again; } } @@ -969,12 +960,14 @@ ntb_transport_doorbell_callback(void *da BIT_NAND(QP_SETSIZE, &db_bits, &nt->qp_bitmap_free); vec_mask = NTB_DB_VECTOR_MASK(nt->ntb, vector); + if ((vec_mask & (vec_mask - 1)) != 0) + vec_mask &= NTB_DB_READ(nt->ntb); while (vec_mask != 0) { qp_num = ffsll(vec_mask) - 1; if (test_bit(qp_num, &db_bits)) { qp = &nt->qp_vec[qp_num]; - taskqueue_enqueue(taskqueue_swi, &qp->rxc_db_work); + taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); } vec_mask &= ~(1ull << qp_num); @@ -1223,7 +1216,7 @@ ntb_qp_link_work(void *arg) if (qp->event_handler != NULL) qp->event_handler(qp->cb_data, NTB_LINK_UP); - taskqueue_enqueue(taskqueue_swi, &qp->rxc_db_work); + taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); } else if (nt->link_is_up) callout_reset(&qp->link_work, NTB_LINK_DOWN_TIMEOUT * hz / 1000, ntb_qp_link_work, qp); From owner-svn-src-all@freebsd.org Thu Aug 18 09:22:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 493FEBBC7CD; Thu, 18 Aug 2016 09:22:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20CE115A5; Thu, 18 Aug 2016 09:22:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9MBwQ092942; Thu, 18 Aug 2016 09:22:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9MBVC092941; Thu, 18 Aug 2016 09:22:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180922.u7I9MBVC092941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304352 - stable/11/sys/dev/ntb/ntb_hw X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:22:12 -0000 Author: mav Date: Thu Aug 18 09:22:11 2016 New Revision: 304352 URL: https://svnweb.freebsd.org/changeset/base/304352 Log: MFC r302491: Switch ctx_lock from mutex to rmlock. It is odd idea to serialize different MSI-X vectors. Use of rmlocks here allows them to execute in parallel, but still protects ctx. If upper layers require any additional serialization -- they can do it by themselves. Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:21:36 2016 (r304351) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:22:11 2016 (r304352) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -220,10 +221,7 @@ struct ntb_softc { void *ntb_ctx; const struct ntb_ctx_ops *ctx_ops; struct ntb_vec *msix_vec; -#define CTX_LOCK(sc) mtx_lock(&(sc)->ctx_lock) -#define CTX_UNLOCK(sc) mtx_unlock(&(sc)->ctx_lock) -#define CTX_ASSERT(sc,f) mtx_assert(&(sc)->ctx_lock, (f)) - struct mtx ctx_lock; + struct rmlock ctx_lock; uint32_t ppd; enum ntb_conn_type conn_type; @@ -657,7 +655,7 @@ ntb_attach(device_t device) callout_init(&ntb->lr_timer, 1); callout_init(&ntb->peer_msix_work, 1); mtx_init(&ntb->db_mask_lock, "ntb hw bits", NULL, MTX_SPIN); - mtx_init(&ntb->ctx_lock, "ntb ctx", NULL, MTX_DEF); + rm_init(&ntb->ctx_lock, "ntb ctx"); if (ntb->type == NTB_ATOM) error = ntb_detect_atom(ntb); @@ -720,7 +718,7 @@ ntb_detach(device_t device) ntb_teardown_interrupts(ntb); mtx_destroy(&ntb->db_mask_lock); - mtx_destroy(&ntb->ctx_lock); + rm_destroy(&ntb->ctx_lock); ntb_unmap_pci_bar(ntb); @@ -2012,17 +2010,15 @@ ntb_set_ctx(device_t dev, void *ctx, con if (ctx == NULL || ops == NULL) return (EINVAL); - if (ntb->ctx_ops != NULL) - return (EINVAL); - CTX_LOCK(ntb); + rm_wlock(&ntb->ctx_lock); if (ntb->ctx_ops != NULL) { - CTX_UNLOCK(ntb); + rm_wunlock(&ntb->ctx_lock); return (EINVAL); } ntb->ntb_ctx = ctx; ntb->ctx_ops = ops; - CTX_UNLOCK(ntb); + rm_wunlock(&ntb->ctx_lock); return (0); } @@ -2047,10 +2043,10 @@ ntb_clear_ctx(device_t dev) { struct ntb_softc *ntb = device_get_softc(dev); - CTX_LOCK(ntb); + rm_wlock(&ntb->ctx_lock); ntb->ntb_ctx = NULL; ntb->ctx_ops = NULL; - CTX_UNLOCK(ntb); + rm_wunlock(&ntb->ctx_lock); } /* @@ -2064,11 +2060,12 @@ static void ntb_link_event(device_t dev) { struct ntb_softc *ntb = device_get_softc(dev); + struct rm_priotracker ctx_tracker; - CTX_LOCK(ntb); + rm_rlock(&ntb->ctx_lock, &ctx_tracker); if (ntb->ctx_ops != NULL && ntb->ctx_ops->link_event != NULL) ntb->ctx_ops->link_event(ntb->ntb_ctx); - CTX_UNLOCK(ntb); + rm_runlock(&ntb->ctx_lock, &ctx_tracker); } /* @@ -2088,11 +2085,12 @@ static void ntb_db_event(device_t dev, uint32_t vec) { struct ntb_softc *ntb = device_get_softc(dev); + struct rm_priotracker ctx_tracker; - CTX_LOCK(ntb); + rm_rlock(&ntb->ctx_lock, &ctx_tracker); if (ntb->ctx_ops != NULL && ntb->ctx_ops->db_event != NULL) ntb->ctx_ops->db_event(ntb->ntb_ctx, vec); - CTX_UNLOCK(ntb); + rm_runlock(&ntb->ctx_lock, &ctx_tracker); } static int From owner-svn-src-all@freebsd.org Thu Aug 18 09:22:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 410DBBBC82A; Thu, 18 Aug 2016 09:22:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDC8A1743; Thu, 18 Aug 2016 09:22:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9Mlhs093594; Thu, 18 Aug 2016 09:22:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9MlRT093593; Thu, 18 Aug 2016 09:22:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180922.u7I9MlRT093593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:22:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304353 - stable/11/sys/dev/ntb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:22:48 -0000 Author: mav Date: Thu Aug 18 09:22:46 2016 New Revision: 304353 URL: https://svnweb.freebsd.org/changeset/base/304353 Log: MFC r302492: Bring some more order into link and qp state handling. Do not touch scratchpad registers until link is reported up. Mask and do not handle doorbell events until respective qp is up. Modified: stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:22:11 2016 (r304352) +++ stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:22:46 2016 (r304353) @@ -508,8 +508,6 @@ ntb_transport_init_queue(struct ntb_tran STAILQ_INIT(&qp->rx_post_q); STAILQ_INIT(&qp->rx_pend_q); STAILQ_INIT(&qp->tx_free_q); - - callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); } void @@ -598,7 +596,6 @@ ntb_transport_create_queue(void *data, d } NTB_DB_CLEAR(ntb, 1ull << qp->qp_num); - NTB_DB_CLEAR_MASK(ntb, 1ull << qp->qp_num); return (qp); } @@ -967,7 +964,8 @@ ntb_transport_doorbell_callback(void *da if (test_bit(qp_num, &db_bits)) { qp = &nt->qp_vec[qp_num]; - taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); + if (qp->link_is_up) + taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); } vec_mask &= ~(1ull << qp_num); @@ -1216,6 +1214,7 @@ ntb_qp_link_work(void *arg) if (qp->event_handler != NULL) qp->event_handler(qp->cb_data, NTB_LINK_UP); + NTB_DB_CLEAR_MASK(ntb, 1ull << qp->qp_num); taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); } else if (nt->link_is_up) callout_reset(&qp->link_work, @@ -1272,6 +1271,7 @@ ntb_qp_link_down_reset(struct ntb_transp { qp->link_is_up = false; + NTB_DB_SET_MASK(qp->ntb, 1ull << qp->qp_num); qp->tx_index = qp->rx_index = 0; qp->tx_bytes = qp->rx_bytes = 0; @@ -1287,17 +1287,12 @@ ntb_qp_link_down_reset(struct ntb_transp static void ntb_qp_link_cleanup(struct ntb_transport_qp *qp) { - struct ntb_transport_ctx *nt = qp->transport; callout_drain(&qp->link_work); ntb_qp_link_down_reset(qp); if (qp->event_handler != NULL) qp->event_handler(qp->cb_data, NTB_LINK_DOWN); - - if (nt->link_is_up) - callout_reset(&qp->link_work, - NTB_LINK_DOWN_TIMEOUT * hz / 1000, ntb_qp_link_work, qp); } /* Link commanded down */ From owner-svn-src-all@freebsd.org Thu Aug 18 09:24:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D2F3BBC8C2; Thu, 18 Aug 2016 09:24:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20AD21903; Thu, 18 Aug 2016 09:24:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9NxeD093711; Thu, 18 Aug 2016 09:23:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9Nxlo093709; Thu, 18 Aug 2016 09:23:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180923.u7I9Nxlo093709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:23:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304354 - in stable/11/sys/dev/ntb: . ntb_hw X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:24:00 -0000 Author: mav Date: Thu Aug 18 09:23:59 2016 New Revision: 304354 URL: https://svnweb.freebsd.org/changeset/base/304354 Log: MFC r302493: Reimplement doorbell register emulation for NTB_SB01BASE_LOCKUP. This allows at least first three doorbells to work very close to normal hardware, properly signaling events to upper layers without spurious or lost events. Doorbells above the first three may still report spurious events due to lack of reliable information, but they are rarely used. Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:22:46 2016 (r304353) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:23:59 2016 (r304354) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -253,6 +254,7 @@ struct ntb_softc { uint64_t db_valid_mask; uint64_t db_link_mask; uint64_t db_mask; + uint64_t fake_db_bell; /* NTB_SB01BASE_LOCKUP*/ int last_ts; /* ticks @ last irq */ @@ -357,7 +359,6 @@ static void xeon_set_pbar_xlat(struct nt enum ntb_bar idx); static int xeon_setup_b2b_mw(struct ntb_softc *, const struct ntb_b2b_addr *addr, const struct ntb_b2b_addr *peer_addr); -static int xeon_setup_msix_bar(struct ntb_softc *); static inline bool link_is_up(struct ntb_softc *ntb); static inline bool _xeon_link_is_up(struct ntb_softc *ntb); static inline bool atom_link_is_err(struct ntb_softc *ntb); @@ -1193,12 +1194,10 @@ ntb_db_set_mask(device_t dev, uint64_t b { struct ntb_softc *ntb = device_get_softc(dev); - if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) - return; - DB_MASK_LOCK(ntb); ntb->db_mask |= bits; - db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); + if (!HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) + db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); DB_MASK_UNLOCK(ntb); } @@ -1206,18 +1205,26 @@ static void ntb_db_clear_mask(device_t dev, uint64_t bits) { struct ntb_softc *ntb = device_get_softc(dev); + uint64_t ibits; + int i; KASSERT((bits & ~ntb->db_valid_mask) == 0, ("%s: Invalid bits 0x%jx (valid: 0x%jx)", __func__, (uintmax_t)(bits & ~ntb->db_valid_mask), (uintmax_t)ntb->db_valid_mask)); - if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) - return; - DB_MASK_LOCK(ntb); + ibits = ntb->fake_db_bell & ntb->db_mask & bits; ntb->db_mask &= ~bits; - db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); + if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { + /* Simulate fake interrupts if unmasked DB bits are set. */ + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + if ((ibits & ntb_db_vector_mask(dev, i)) != 0) + swi_sched(ntb->int_info[i].tag, 0); + } + } else { + db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); + } DB_MASK_UNLOCK(ntb); } @@ -1226,17 +1233,8 @@ ntb_db_read(device_t dev) { struct ntb_softc *ntb = device_get_softc(dev); - if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { - uint64_t res; - unsigned i; - - res = 0; - for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { - if (ntb->msix_vec[i].masked != 0) - res |= ntb_db_vector_mask(dev, i); - } - return (res); - } + if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) + return (ntb->fake_db_bell); return (db_ioread(ntb, ntb->self_reg->db_bell)); } @@ -1252,21 +1250,9 @@ ntb_db_clear(device_t dev, uint64_t bits (uintmax_t)ntb->db_valid_mask)); if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { - unsigned i; - - for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { - if ((bits & ntb_db_vector_mask(dev, i)) != 0) { - DB_MASK_LOCK(ntb); - if (ntb->msix_vec[i].masked != 0) { - /* XXX These need a public API. */ -#if 0 - pci_unmask_msix(ntb->device, i); -#endif - ntb->msix_vec[i].masked = 0; - } - DB_MASK_UNLOCK(ntb); - } - } + DB_MASK_LOCK(ntb); + ntb->fake_db_bell &= ~bits; + DB_MASK_UNLOCK(ntb); return; } @@ -1278,6 +1264,19 @@ ntb_vec_mask(struct ntb_softc *ntb, uint { uint64_t shift, mask; + if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { + /* + * Remap vectors in custom way to make at least first + * three doorbells to not generate stray events. + * This breaks Linux compatibility (if one existed) + * when more then one DB is used (not by if_ntb). + */ + if (db_vector < XEON_NONLINK_DB_MSIX_BITS - 1) + return (1 << db_vector); + if (db_vector == XEON_NONLINK_DB_MSIX_BITS - 1) + return (0x7ffc); + } + shift = ntb->db_vec_shift; mask = (1ull << shift) - 1; return (mask << (shift * db_vector)); @@ -1299,13 +1298,16 @@ ntb_interrupt(struct ntb_softc *ntb, uin if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP) && (vec_mask & ntb->db_link_mask) == 0) { DB_MASK_LOCK(ntb); - if (ntb->msix_vec[vec].masked == 0) { - /* XXX These need a public API. */ -#if 0 - pci_mask_msix(ntb->device, vec); -#endif - ntb->msix_vec[vec].masked = 1; - } + + /* Do not report same DB events again if not cleared yet. */ + vec_mask &= ~ntb->fake_db_bell; + + /* Update our internal doorbell register. */ + ntb->fake_db_bell |= vec_mask; + + /* Do not report masked DB events. */ + vec_mask &= ~ntb->db_mask; + DB_MASK_UNLOCK(ntb); } @@ -1508,6 +1510,7 @@ ntb_xeon_init_dev(struct ntb_softc *ntb) ntb->xlat_reg = &xeon_sec_xlat; if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { + ntb->fake_db_bell = 0; ntb->msix_mw_idx = (ntb->mw_count + g_ntb_msix_idx) % ntb->mw_count; ntb_printf(2, "Setting up MSIX mw idx %d means %u\n", @@ -1564,10 +1567,6 @@ ntb_xeon_init_dev(struct ntb_softc *ntb) db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); DB_MASK_UNLOCK(ntb); - rc = xeon_setup_msix_bar(ntb); - if (rc != 0) - return (rc); - rc = ntb_init_isr(ntb); return (rc); } @@ -1730,19 +1729,6 @@ xeon_set_pbar_xlat(struct ntb_softc *ntb } static int -xeon_setup_msix_bar(struct ntb_softc *ntb) -{ - enum ntb_bar bar_num; - - if (!HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) - return (0); - - bar_num = ntb_mw_to_bar(ntb, ntb->msix_mw_idx); - ntb->peer_lapic_bar = &ntb->bar_info[bar_num]; - return (0); -} - -static int xeon_setup_b2b_mw(struct ntb_softc *ntb, const struct ntb_b2b_addr *addr, const struct ntb_b2b_addr *peer_addr) { @@ -1822,8 +1808,10 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { size_t size, xlatoffset; + enum ntb_bar bar_num; - switch (ntb_mw_to_bar(ntb, ntb->msix_mw_idx)) { + bar_num = ntb_mw_to_bar(ntb, ntb->msix_mw_idx); + switch (bar_num) { case NTB_B2B_BAR_1: size = 8; xlatoffset = XEON_SBAR2XLAT_OFFSET; @@ -1856,6 +1844,8 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, ntb_reg_write(8, xlatoffset, MSI_INTEL_ADDR_BASE); ntb->msix_xlat = ntb_reg_read(8, xlatoffset); } + + ntb->peer_lapic_bar = &ntb->bar_info[bar_num]; } (void)ntb_reg_read(8, XEON_SBAR2XLAT_OFFSET); (void)ntb_reg_read(8, XEON_SBAR4XLAT_OFFSET); Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:22:46 2016 (r304353) +++ stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:23:59 2016 (r304354) @@ -1215,7 +1215,6 @@ ntb_qp_link_work(void *arg) qp->event_handler(qp->cb_data, NTB_LINK_UP); NTB_DB_CLEAR_MASK(ntb, 1ull << qp->qp_num); - taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); } else if (nt->link_is_up) callout_reset(&qp->link_work, NTB_LINK_DOWN_TIMEOUT * hz / 1000, ntb_qp_link_work, qp); From owner-svn-src-all@freebsd.org Thu Aug 18 09:24:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65BB2BBC99F; Thu, 18 Aug 2016 09:24:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 19E4E1B0C; Thu, 18 Aug 2016 09:24:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9OalB093804; Thu, 18 Aug 2016 09:24:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9Oafa093802; Thu, 18 Aug 2016 09:24:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180924.u7I9Oafa093802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304355 - in stable/11/sys/dev/ntb: . if_ntb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:24:37 -0000 Author: mav Date: Thu Aug 18 09:24:36 2016 New Revision: 304355 URL: https://svnweb.freebsd.org/changeset/base/304355 Log: MFC r302494: Synchronize MTU code with Linux. It is mandatory for transport compatibility. Modified: stable/11/sys/dev/ntb/if_ntb/if_ntb.c stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:23:59 2016 (r304354) +++ stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:24:36 2016 (r304355) @@ -125,8 +125,7 @@ ntb_net_attach(device_t dev) ether_ifattach(ifp, sc->eaddr); ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_JUMBO_MTU; ifp->if_capenable = ifp->if_capabilities; - ifp->if_mtu = ntb_transport_max_size(sc->qp) - ETHER_HDR_LEN - - ETHER_CRC_LEN; + ifp->if_mtu = ntb_transport_max_size(sc->qp) - ETHER_HDR_LEN; ntb_transport_link_up(sc->qp); return (0); @@ -177,7 +176,7 @@ ntb_ioctl(struct ifnet *ifp, u_long comm case SIOCSIFMTU: { if (ifr->ifr_mtu > ntb_transport_max_size(sc->qp) - - ETHER_HDR_LEN - ETHER_CRC_LEN) { + ETHER_HDR_LEN) { error = EINVAL; break; } Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:23:59 2016 (r304354) +++ stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:24:36 2016 (r304355) @@ -489,8 +489,7 @@ ntb_transport_init_queue(struct ntb_tran qp->rx_info = (void *)(qp->tx_mw + tx_size); /* Due to house-keeping, there must be at least 2 buffs */ - qp->tx_max_frame = qmin(tx_size / 2, - transport_mtu + sizeof(struct ntb_payload_header)); + qp->tx_max_frame = qmin(transport_mtu, tx_size / 2); qp->tx_max_entry = tx_size / qp->tx_max_frame; callout_init(&qp->link_work, 0); @@ -1170,8 +1169,7 @@ ntb_transport_setup_qp_mw(struct ntb_tra qp->remote_rx_info = (void*)(qp->rx_buff + rx_size); /* Due to house-keeping, there must be at least 2 buffs */ - qp->rx_max_frame = qmin(rx_size / 2, - transport_mtu + sizeof(struct ntb_payload_header)); + qp->rx_max_frame = qmin(transport_mtu, rx_size / 2); qp->rx_max_entry = rx_size / qp->rx_max_frame; qp->rx_index = 0; From owner-svn-src-all@freebsd.org Thu Aug 18 09:25:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35426BBCA16; Thu, 18 Aug 2016 09:25:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 078861C8C; Thu, 18 Aug 2016 09:25:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9PBg8093886; Thu, 18 Aug 2016 09:25:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9PB9v093884; Thu, 18 Aug 2016 09:25:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180925.u7I9PB9v093884@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304356 - in stable/11/sys/dev/ntb: . if_ntb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:25:12 -0000 Author: mav Date: Thu Aug 18 09:25:10 2016 New Revision: 304356 URL: https://svnweb.freebsd.org/changeset/base/304356 Log: MFC r302495: Improve memory allocation errors handling on receive. Modified: stable/11/sys/dev/ntb/if_ntb/if_ntb.c stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:24:36 2016 (r304355) +++ stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:25:10 2016 (r304356) @@ -241,7 +241,12 @@ ntb_net_rx_handler(struct ntb_transport_ struct mbuf *m = data; struct ifnet *ifp = qp_data; - CTR0(KTR_NTB, "RX: rx handler"); + CTR1(KTR_NTB, "RX: rx handler (%d)", len); + if (len < 0) { + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + return; + } + m->m_pkthdr.csum_flags = CSUM_IP_CHECKED | CSUM_IP_VALID; (*ifp->if_input)(ifp, m); } Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:24:36 2016 (r304355) +++ stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:25:10 2016 (r304356) @@ -877,6 +877,8 @@ ntb_memcpy_rx(struct ntb_transport_qp *q CTR2(KTR_NTB, "RX: copying %d bytes from offset %p", len, offset); entry->buf = (void *)m_devget(offset, len, 0, ifp, NULL); + if (entry->buf == NULL) + entry->len = -ENOMEM; /* Ensure that the data is globally visible before clearing the flag */ wmb(); From owner-svn-src-all@freebsd.org Thu Aug 18 09:25:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27AEEBBCAA8; Thu, 18 Aug 2016 09:25:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDFE91DDD; Thu, 18 Aug 2016 09:25:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9Pjpu093963; Thu, 18 Aug 2016 09:25:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9PjnL093962; Thu, 18 Aug 2016 09:25:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180925.u7I9PjnL093962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304357 - stable/11/sys/dev/ntb/if_ntb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:25:46 -0000 Author: mav Date: Thu Aug 18 09:25:45 2016 New Revision: 304357 URL: https://svnweb.freebsd.org/changeset/base/304357 Log: MFC r302496: Rewrite if_ntb to use modern interface KPIs and features. It includes: link state, if_transmit, buf_ring, multiple queues, bpf, etc. Sponsored by: iXsystems, Inc. Modified: stable/11/sys/dev/ntb/if_ntb/if_ntb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:25:10 2016 (r304356) +++ stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:25:45 2016 (r304357) @@ -43,15 +43,19 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include +#include +#include #include #include #include +#include #include #include #include @@ -61,28 +65,50 @@ __FBSDID("$FreeBSD$"); #include "../ntb_transport.h" #define KTR_NTB KTR_SPARE3 +#define NTB_MEDIATYPE (IFM_ETHER | IFM_AUTO | IFM_FDX) -struct ntb_net_ctx { - device_t *dev; - struct ifnet *ifp; +static SYSCTL_NODE(_hw, OID_AUTO, if_ntb, CTLFLAG_RW, 0, "if_ntb"); + +static unsigned g_if_ntb_num_queues = 1; +SYSCTL_UINT(_hw_if_ntb, OID_AUTO, num_queues, CTLFLAG_RWTUN, + &g_if_ntb_num_queues, 0, "Number of queues per interface"); + +struct ntb_net_queue { + struct ntb_net_ctx *sc; + if_t ifp; struct ntb_transport_qp *qp; - u_char eaddr[ETHER_ADDR_LEN]; - struct mtx tx_lock; - struct callout queue_full; + struct buf_ring *br; + struct task tx_task; + struct taskqueue *tx_tq; + struct mtx tx_lock; + struct callout queue_full; +}; + +struct ntb_net_ctx { + if_t ifp; + struct ifmedia media; + u_char eaddr[ETHER_ADDR_LEN]; + int num_queues; + struct ntb_net_queue *queues; + int mtu; }; static int ntb_net_probe(device_t dev); static int ntb_net_attach(device_t dev); static int ntb_net_detach(device_t dev); static void ntb_net_init(void *arg); -static int ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data); -static void ntb_start(struct ifnet *ifp); +static int ntb_ifmedia_upd(struct ifnet *); +static void ntb_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int ntb_ioctl(if_t ifp, u_long command, caddr_t data); +static int ntb_transmit(if_t ifp, struct mbuf *m); static void ntb_net_tx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); static void ntb_net_rx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); static void ntb_net_event_handler(void *data, enum ntb_link_event status); +static void ntb_handle_tx(void *arg, int pending); static void ntb_qp_full(void *arg); +static void ntb_qflush(if_t ifp); static void create_random_local_eui48(u_char *eaddr); static int @@ -97,37 +123,64 @@ static int ntb_net_attach(device_t dev) { struct ntb_net_ctx *sc = device_get_softc(dev); - struct ifnet *ifp; + struct ntb_net_queue *q; + if_t ifp; struct ntb_queue_handlers handlers = { ntb_net_rx_handler, ntb_net_tx_handler, ntb_net_event_handler }; + int i; - ifp = sc->ifp = if_alloc(IFT_ETHER); + ifp = sc->ifp = if_gethandle(IFT_ETHER); if (ifp == NULL) { printf("ntb: Cannot allocate ifnet structure\n"); return (ENOMEM); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + if_setdev(ifp, dev); - mtx_init(&sc->tx_lock, "ntb tx", NULL, MTX_DEF); - callout_init(&sc->queue_full, 1); + sc->num_queues = g_if_ntb_num_queues; + sc->queues = malloc(sc->num_queues * sizeof(struct ntb_net_queue), + M_DEVBUF, M_WAITOK | M_ZERO); + sc->mtu = INT_MAX; + for (i = 0; i < sc->num_queues; i++) { + q = &sc->queues[i]; + q->sc = sc; + q->ifp = ifp; + q->qp = ntb_transport_create_queue(q, + device_get_parent(dev), &handlers); + if (q->qp == NULL) + break; + sc->mtu = imin(sc->mtu, ntb_transport_max_size(q->qp)); + mtx_init(&q->tx_lock, "ntb tx", NULL, MTX_DEF); + q->br = buf_ring_alloc(4096, M_DEVBUF, M_WAITOK, &q->tx_lock); + TASK_INIT(&q->tx_task, 0, ntb_handle_tx, q); + q->tx_tq = taskqueue_create_fast("ntb_txq", M_NOWAIT, + taskqueue_thread_enqueue, &q->tx_tq); + taskqueue_start_threads(&q->tx_tq, 1, PI_NET, "%s txq%d", + device_get_nameunit(dev), i); + callout_init(&q->queue_full, 1); + } + sc->num_queues = i; - sc->qp = ntb_transport_create_queue(ifp, device_get_parent(dev), - &handlers); - ifp->if_init = ntb_net_init; - ifp->if_softc = sc; - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_ioctl = ntb_ioctl; - ifp->if_start = ntb_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; - IFQ_SET_READY(&ifp->if_snd); + if_setinitfn(ifp, ntb_net_init); + if_setsoftc(ifp, sc); + if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); + if_setioctlfn(ifp, ntb_ioctl); + if_settransmitfn(ifp, ntb_transmit); + if_setqflushfn(ifp, ntb_qflush); create_random_local_eui48(sc->eaddr); ether_ifattach(ifp, sc->eaddr); - ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_JUMBO_MTU; - ifp->if_capenable = ifp->if_capabilities; - ifp->if_mtu = ntb_transport_max_size(sc->qp) - ETHER_HDR_LEN; + if_setcapabilities(ifp, IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | + IFCAP_JUMBO_MTU | IFCAP_LINKSTATE); + if_setcapenable(ifp, if_getcapabilities(ifp)); + if_setmtu(ifp, sc->mtu - ETHER_HDR_LEN); + + ifmedia_init(&sc->media, IFM_IMASK, ntb_ifmedia_upd, + ntb_ifmedia_sts); + ifmedia_add(&sc->media, NTB_MEDIATYPE, 0, NULL); + ifmedia_set(&sc->media, NTB_MEDIATYPE); - ntb_transport_link_up(sc->qp); + for (i = 0; i < sc->num_queues; i++) + ntb_transport_link_up(sc->queues[i].qp); return (0); } @@ -135,19 +188,23 @@ static int ntb_net_detach(device_t dev) { struct ntb_net_ctx *sc = device_get_softc(dev); + struct ntb_net_queue *q; + int i; - if (sc->qp != NULL) { - ntb_transport_link_down(sc->qp); - ntb_transport_free_queue(sc->qp); - } - - if (sc->ifp != NULL) { - ether_ifdetach(sc->ifp); - if_free(sc->ifp); - sc->ifp = NULL; + for (i = 0; i < sc->num_queues; i++) + ntb_transport_link_down(sc->queues[i].qp); + ether_ifdetach(sc->ifp); + if_free(sc->ifp); + ifmedia_removeall(&sc->media); + for (i = 0; i < sc->num_queues; i++) { + q = &sc->queues[i]; + ntb_transport_free_queue(q->qp); + buf_ring_free(q->br, M_DEVBUF); + callout_drain(&q->queue_full); + taskqueue_drain_all(q->tx_tq); + mtx_destroy(&q->tx_lock); } - mtx_destroy(&sc->tx_lock); - + free(sc->queues, M_DEVBUF); return (0); } @@ -157,33 +214,37 @@ static void ntb_net_init(void *arg) { struct ntb_net_ctx *sc = arg; - struct ifnet *ifp = sc->ifp; + if_t ifp = sc->ifp; - ifp->if_drv_flags |= IFF_DRV_RUNNING; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - ifp->if_flags |= IFF_UP; - if_link_state_change(ifp, LINK_STATE_UP); + if_setdrvflagbits(ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE); + if_link_state_change(ifp, ntb_transport_link_query(sc->queues[0].qp) ? + LINK_STATE_UP : LINK_STATE_DOWN); } static int -ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data) +ntb_ioctl(if_t ifp, u_long command, caddr_t data) { - struct ntb_net_ctx *sc = ifp->if_softc; + struct ntb_net_ctx *sc = if_getsoftc(ifp); struct ifreq *ifr = (struct ifreq *)data; int error = 0; switch (command) { case SIOCSIFMTU: { - if (ifr->ifr_mtu > ntb_transport_max_size(sc->qp) - - ETHER_HDR_LEN) { + if (ifr->ifr_mtu > sc->mtu - ETHER_HDR_LEN) { error = EINVAL; break; } - ifp->if_mtu = ifr->ifr_mtu; + if_setmtu(ifp, ifr->ifr_mtu); break; } + + case SIOCSIFMEDIA: + case SIOCGIFMEDIA: + error = ifmedia_ioctl(ifp, ifr, &sc->media, command); + break; + default: error = ether_ioctl(ifp, command, data); break; @@ -192,36 +253,131 @@ ntb_ioctl(struct ifnet *ifp, u_long comm return (error); } +static int +ntb_ifmedia_upd(struct ifnet *ifp) +{ + struct ntb_net_ctx *sc = if_getsoftc(ifp); + struct ifmedia *ifm = &sc->media; + + if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) + return (EINVAL); + + return (0); +} static void -ntb_start(struct ifnet *ifp) +ntb_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { - struct mbuf *m_head; - struct ntb_net_ctx *sc = ifp->if_softc; - int rc; - - mtx_lock(&sc->tx_lock); - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - CTR0(KTR_NTB, "TX: ntb_start"); - while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { - IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); - CTR1(KTR_NTB, "TX: start mbuf %p", m_head); - rc = ntb_transport_tx_enqueue(sc->qp, m_head, m_head, - m_length(m_head, NULL)); + struct ntb_net_ctx *sc = if_getsoftc(ifp); + + ifmr->ifm_status = IFM_AVALID; + ifmr->ifm_active = NTB_MEDIATYPE; + if (ntb_transport_link_query(sc->queues[0].qp)) + ifmr->ifm_status |= IFM_ACTIVE; +} + +static void +ntb_transmit_locked(struct ntb_net_queue *q) +{ + if_t ifp = q->ifp; + struct mbuf *m; + int rc, len; + short mflags; + + CTR0(KTR_NTB, "TX: ntb_transmit_locked"); + while ((m = drbr_peek(ifp, q->br)) != NULL) { + CTR1(KTR_NTB, "TX: start mbuf %p", m); + if_etherbpfmtap(ifp, m); + len = m->m_pkthdr.len; + mflags = m->m_flags; + rc = ntb_transport_tx_enqueue(q->qp, m, m, len); if (rc != 0) { - CTR1(KTR_NTB, - "TX: could not tx mbuf %p. Returning to snd q", - m_head); + CTR2(KTR_NTB, "TX: could not tx mbuf %p: %d", m, rc); if (rc == EAGAIN) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - callout_reset(&sc->queue_full, hz / 1000, - ntb_qp_full, ifp); + drbr_putback(ifp, q->br, m); + callout_reset_sbt(&q->queue_full, + SBT_1MS / 4, SBT_1MS / 4, + ntb_qp_full, q, 0); + } else { + m_freem(m); + drbr_advance(ifp, q->br); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } break; } + drbr_advance(ifp, q->br); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_OBYTES, len); + if (mflags & M_MCAST) + if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); + } +} + +static int +ntb_transmit(if_t ifp, struct mbuf *m) +{ + struct ntb_net_ctx *sc = if_getsoftc(ifp); + struct ntb_net_queue *q; + int error, i; + + CTR0(KTR_NTB, "TX: ntb_transmit"); + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) + i = m->m_pkthdr.flowid % sc->num_queues; + else + i = curcpu % sc->num_queues; + q = &sc->queues[i]; + + error = drbr_enqueue(ifp, q->br, m); + if (error) + return (error); + + if (mtx_trylock(&q->tx_lock)) { + ntb_transmit_locked(q); + mtx_unlock(&q->tx_lock); + } else + taskqueue_enqueue(q->tx_tq, &q->tx_task); + return (0); +} + +static void +ntb_handle_tx(void *arg, int pending) +{ + struct ntb_net_queue *q = arg; + + mtx_lock(&q->tx_lock); + ntb_transmit_locked(q); + mtx_unlock(&q->tx_lock); +} + +static void +ntb_qp_full(void *arg) +{ + struct ntb_net_queue *q = arg; + + CTR0(KTR_NTB, "TX: qp_full callout"); + if (ntb_transport_tx_free_entry(q->qp) > 0) + taskqueue_enqueue(q->tx_tq, &q->tx_task); + else + callout_schedule_sbt(&q->queue_full, + SBT_1MS / 4, SBT_1MS / 4, 0); +} + +static void +ntb_qflush(if_t ifp) +{ + struct ntb_net_ctx *sc = if_getsoftc(ifp); + struct ntb_net_queue *q; + struct mbuf *m; + int i; + + for (i = 0; i < sc->num_queues; i++) { + q = &sc->queues[i]; + mtx_lock(&q->tx_lock); + while ((m = buf_ring_dequeue_sc(q->br)) != NULL) + m_freem(m); + mtx_unlock(&q->tx_lock); } - mtx_unlock(&sc->tx_lock); + if_qflush(ifp); } /* Network Device Callbacks */ @@ -238,8 +394,10 @@ static void ntb_net_rx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, int len) { + struct ntb_net_queue *q = qp_data; + struct ntb_net_ctx *sc = q->sc; struct mbuf *m = data; - struct ifnet *ifp = qp_data; + if_t ifp = q->ifp; CTR1(KTR_NTB, "RX: rx handler (%d)", len); if (len < 0) { @@ -247,36 +405,37 @@ ntb_net_rx_handler(struct ntb_transport_ return; } - m->m_pkthdr.csum_flags = CSUM_IP_CHECKED | CSUM_IP_VALID; - (*ifp->if_input)(ifp, m); + m->m_pkthdr.rcvif = ifp; + if (sc->num_queues > 1) { + m->m_pkthdr.flowid = q - sc->queues; + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + } + if ((if_getcapenable(ifp) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) == + (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { + m->m_pkthdr.csum_flags = CSUM_IP_CHECKED | CSUM_IP_VALID; + } + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + if_input(ifp, m); } static void ntb_net_event_handler(void *data, enum ntb_link_event status) { - struct ifnet *ifp; - - ifp = data; - (void)ifp; - - /* XXX The Linux driver munges with the carrier status here. */ + struct ntb_net_queue *q = data; + int new_state; switch (status) { case NTB_LINK_DOWN: + new_state = LINK_STATE_DOWN; break; case NTB_LINK_UP: + new_state = LINK_STATE_UP; break; default: - panic("Bogus ntb_link_event %u\n", status); + new_state = LINK_STATE_UNKNOWN; + break; } -} - -static void -ntb_qp_full(void *arg) -{ - - CTR0(KTR_NTB, "TX: qp_full callout"); - ntb_start(arg); + if_link_state_change(q->ifp, new_state); } /* Helper functions */ From owner-svn-src-all@freebsd.org Thu Aug 18 09:26:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00B22BBCB3D; Thu, 18 Aug 2016 09:26:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D01021F3F; Thu, 18 Aug 2016 09:26:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9QM0V094045; Thu, 18 Aug 2016 09:26:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9QMZw094044; Thu, 18 Aug 2016 09:26:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180926.u7I9QMZw094044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304358 - stable/11/sys/dev/ntb/if_ntb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:26:23 -0000 Author: mav Date: Thu Aug 18 09:26:21 2016 New Revision: 304358 URL: https://svnweb.freebsd.org/changeset/base/304358 Log: MFC r302499: Improve checksum "offload" support. For compatibility reasons make driver not report any checksum offload by default, since there is indeed none. But if administrator knows that interface is used only for local traffic, he can enable fake checksum offload manually on both sides to save some CPU cycles, since the data are already protected by CRC32 of PCIe link. Sponsored by: iXsystems, Inc. Modified: stable/11/sys/dev/ntb/if_ntb/if_ntb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:25:45 2016 (r304357) +++ stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:26:21 2016 (r304358) @@ -67,6 +67,13 @@ __FBSDID("$FreeBSD$"); #define KTR_NTB KTR_SPARE3 #define NTB_MEDIATYPE (IFM_ETHER | IFM_AUTO | IFM_FDX) +#define NTB_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP) +#define NTB_CSUM_FEATURES6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_SCTP_IPV6) +#define NTB_CSUM_SET (CSUM_DATA_VALID | CSUM_DATA_VALID_IPV6 | \ + CSUM_PSEUDO_HDR | \ + CSUM_IP_CHECKED | CSUM_IP_VALID | \ + CSUM_SCTP_VALID) + static SYSCTL_NODE(_hw, OID_AUTO, if_ntb, CTLFLAG_RW, 0, "if_ntb"); static unsigned g_if_ntb_num_queues = 1; @@ -171,7 +178,7 @@ ntb_net_attach(device_t dev) ether_ifattach(ifp, sc->eaddr); if_setcapabilities(ifp, IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | IFCAP_JUMBO_MTU | IFCAP_LINKSTATE); - if_setcapenable(ifp, if_getcapabilities(ifp)); + if_setcapenable(ifp, IFCAP_JUMBO_MTU | IFCAP_LINKSTATE); if_setmtu(ifp, sc->mtu - ETHER_HDR_LEN); ifmedia_init(&sc->media, IFM_IMASK, ntb_ifmedia_upd, @@ -245,6 +252,31 @@ ntb_ioctl(if_t ifp, u_long command, cadd error = ifmedia_ioctl(ifp, ifr, &sc->media, command); break; + case SIOCSIFCAP: + if (ifr->ifr_reqcap & IFCAP_RXCSUM) + if_setcapenablebit(ifp, IFCAP_RXCSUM, 0); + else + if_setcapenablebit(ifp, 0, IFCAP_RXCSUM); + if (ifr->ifr_reqcap & IFCAP_TXCSUM) { + if_setcapenablebit(ifp, IFCAP_TXCSUM, 0); + if_sethwassistbits(ifp, NTB_CSUM_FEATURES, 0); + } else { + if_setcapenablebit(ifp, 0, IFCAP_TXCSUM); + if_sethwassistbits(ifp, 0, NTB_CSUM_FEATURES); + } + if (ifr->ifr_reqcap & IFCAP_RXCSUM_IPV6) + if_setcapenablebit(ifp, IFCAP_RXCSUM_IPV6, 0); + else + if_setcapenablebit(ifp, 0, IFCAP_RXCSUM_IPV6); + if (ifr->ifr_reqcap & IFCAP_TXCSUM_IPV6) { + if_setcapenablebit(ifp, IFCAP_TXCSUM_IPV6, 0); + if_sethwassistbits(ifp, NTB_CSUM_FEATURES6, 0); + } else { + if_setcapenablebit(ifp, 0, IFCAP_TXCSUM_IPV6); + if_sethwassistbits(ifp, 0, NTB_CSUM_FEATURES6); + } + break; + default: error = ether_ioctl(ifp, command, data); break; @@ -398,6 +430,7 @@ ntb_net_rx_handler(struct ntb_transport_ struct ntb_net_ctx *sc = q->sc; struct mbuf *m = data; if_t ifp = q->ifp; + uint16_t proto; CTR1(KTR_NTB, "RX: rx handler (%d)", len); if (len < 0) { @@ -410,9 +443,22 @@ ntb_net_rx_handler(struct ntb_transport_ m->m_pkthdr.flowid = q - sc->queues; M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); } - if ((if_getcapenable(ifp) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) == - (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { - m->m_pkthdr.csum_flags = CSUM_IP_CHECKED | CSUM_IP_VALID; + if (if_getcapenable(ifp) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { + m_copydata(m, 12, 2, (void *)&proto); + switch (ntohs(proto)) { + case ETHERTYPE_IP: + if (if_getcapenable(ifp) & IFCAP_RXCSUM) { + m->m_pkthdr.csum_data = 0xffff; + m->m_pkthdr.csum_flags = NTB_CSUM_SET; + } + break; + case ETHERTYPE_IPV6: + if (if_getcapenable(ifp) & IFCAP_RXCSUM_IPV6) { + m->m_pkthdr.csum_data = 0xffff; + m->m_pkthdr.csum_flags = NTB_CSUM_SET; + } + break; + } } if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if_input(ifp, m); From owner-svn-src-all@freebsd.org Thu Aug 18 09:27:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54384BBCBE3; Thu, 18 Aug 2016 09:27:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 26BCE1219; Thu, 18 Aug 2016 09:27:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9RBwL094141; Thu, 18 Aug 2016 09:27:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9RBlc094140; Thu, 18 Aug 2016 09:27:11 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180927.u7I9RBlc094140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304359 - stable/11/sys/dev/ntb/ntb_hw X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:27:12 -0000 Author: mav Date: Thu Aug 18 09:27:11 2016 New Revision: 304359 URL: https://svnweb.freebsd.org/changeset/base/304359 Log: MFC r302508: Disable SB01BASE_LOCKUP workaround when split BARs disabled. For some reason hack with sending MSI-X interrupts by writing to remote LAPIC memory works only for 32-bit BARs, that are available only if split BARs mode is enabled in BIOS. If it is not, complain loudly and fall back to less efficient workaround. Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:26:21 2016 (r304358) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:27:11 2016 (r304359) @@ -450,7 +450,7 @@ ntb_vm_memattr_to_str(vm_memattr_t pat) } } -static int g_ntb_msix_idx = 0; +static int g_ntb_msix_idx = 1; SYSCTL_INT(_hw_ntb, OID_AUTO, msix_mw_idx, CTLFLAG_RDTUN, &g_ntb_msix_idx, 0, "Use this memory window to access the peer MSIX message complex on " "certain Xeon-based NTB systems, as a workaround for a hardware errata. " @@ -1440,6 +1440,16 @@ ntb_detect_xeon(struct ntb_softc *ntb) if ((ppd & XEON_PPD_SPLIT_BAR) != 0) ntb->features |= NTB_SPLIT_BAR; + if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP) && + !HAS_FEATURE(ntb, NTB_SPLIT_BAR)) { + device_printf(ntb->device, + "Can not apply SB01BASE_LOCKUP workaround " + "with split BARs disabled!\n"); + device_printf(ntb->device, + "Expect system hangs under heavy NTB traffic!\n"); + ntb->features &= ~NTB_SB01BASE_LOCKUP; + } + /* * SDOORBELL errata workaround gets in the way of SB01BASE_LOCKUP * errata workaround; only do one at a time. From owner-svn-src-all@freebsd.org Thu Aug 18 09:27:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9516BBCCA1; Thu, 18 Aug 2016 09:27:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 631EB139F; Thu, 18 Aug 2016 09:27:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9RkW4094216; Thu, 18 Aug 2016 09:27:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9RkTi094215; Thu, 18 Aug 2016 09:27:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180927.u7I9RkTi094215@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304360 - stable/11/sys/dev/ntb/ntb_hw X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:27:47 -0000 Author: mav Date: Thu Aug 18 09:27:46 2016 New Revision: 304360 URL: https://svnweb.freebsd.org/changeset/base/304360 Log: MFC r302510: Simplify MSIX MW BAR xlat setup, and don't forget to unlock its limit. The last fixes SB01BASE_LOCKUP workaround after driver reload. Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:27:11 2016 (r304359) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:27:46 2016 (r304360) @@ -1817,42 +1817,23 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, ntb_reg_write(8, XEON_SBAR4XLAT_OFFSET, 0); if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { - size_t size, xlatoffset; + uint32_t xlat_reg, lmt_reg; enum ntb_bar bar_num; - bar_num = ntb_mw_to_bar(ntb, ntb->msix_mw_idx); - switch (bar_num) { - case NTB_B2B_BAR_1: - size = 8; - xlatoffset = XEON_SBAR2XLAT_OFFSET; - break; - case NTB_B2B_BAR_2: - xlatoffset = XEON_SBAR4XLAT_OFFSET; - if (HAS_FEATURE(ntb, NTB_SPLIT_BAR)) - size = 4; - else - size = 8; - break; - case NTB_B2B_BAR_3: - xlatoffset = XEON_SBAR5XLAT_OFFSET; - size = 4; - break; - default: - KASSERT(false, ("Bogus msix mw idx: %u", - ntb->msix_mw_idx)); - return (EINVAL); - } - /* * We point the chosen MSIX MW BAR xlat to remote LAPIC for * workaround */ - if (size == 4) { - ntb_reg_write(4, xlatoffset, MSI_INTEL_ADDR_BASE); - ntb->msix_xlat = ntb_reg_read(4, xlatoffset); + bar_num = ntb_mw_to_bar(ntb, ntb->msix_mw_idx); + bar_get_xlat_params(ntb, bar_num, NULL, &xlat_reg, &lmt_reg); + if (bar_is_64bit(ntb, bar_num)) { + ntb_reg_write(8, xlat_reg, MSI_INTEL_ADDR_BASE); + ntb->msix_xlat = ntb_reg_read(8, xlat_reg); + ntb_reg_write(8, lmt_reg, 0); } else { - ntb_reg_write(8, xlatoffset, MSI_INTEL_ADDR_BASE); - ntb->msix_xlat = ntb_reg_read(8, xlatoffset); + ntb_reg_write(4, xlat_reg, MSI_INTEL_ADDR_BASE); + ntb->msix_xlat = ntb_reg_read(4, xlat_reg); + ntb_reg_write(8, lmt_reg, 0); } ntb->peer_lapic_bar = &ntb->bar_info[bar_num]; From owner-svn-src-all@freebsd.org Thu Aug 18 09:28:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DC7DBBCD2F; Thu, 18 Aug 2016 09:28:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2B471595; Thu, 18 Aug 2016 09:28:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9SRRx094307; Thu, 18 Aug 2016 09:28:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9SRKv094306; Thu, 18 Aug 2016 09:28:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180928.u7I9SRKv094306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304361 - stable/11/sys/dev/ntb/ntb_hw X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:28:28 -0000 Author: mav Date: Thu Aug 18 09:28:26 2016 New Revision: 304361 URL: https://svnweb.freebsd.org/changeset/base/304361 Log: MFC r302530: Fix wrong copy/paste in r302510. Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:27:46 2016 (r304360) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:28:26 2016 (r304361) @@ -1833,7 +1833,7 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, } else { ntb_reg_write(4, xlat_reg, MSI_INTEL_ADDR_BASE); ntb->msix_xlat = ntb_reg_read(4, xlat_reg); - ntb_reg_write(8, lmt_reg, 0); + ntb_reg_write(4, lmt_reg, 0); } ntb->peer_lapic_bar = &ntb->bar_info[bar_num]; From owner-svn-src-all@freebsd.org Thu Aug 18 09:29:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95F47BBCD9A; Thu, 18 Aug 2016 09:29:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6277216F3; Thu, 18 Aug 2016 09:29:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9SxI9094378; Thu, 18 Aug 2016 09:28:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9SxrT094377; Thu, 18 Aug 2016 09:28:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180928.u7I9SxrT094377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:28:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304362 - stable/11/sys/dev/ntb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:29:00 -0000 Author: mav Date: Thu Aug 18 09:28:59 2016 New Revision: 304362 URL: https://svnweb.freebsd.org/changeset/base/304362 Log: MFC r302529: Remove callout_reset(link_work) from ntb_transport_attach(). At that point link is quite likely not established yet, so messing with scratch registers is premature there. Original commit message mentioned code diff reduction from Linux, but this line is not present in Linux now. Modified: stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:28:26 2016 (r304361) +++ stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:28:59 2016 (r304362) @@ -394,7 +394,6 @@ ntb_transport_attach(device_t dev) nt->link_is_up = false; NTB_LINK_ENABLE(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); - callout_reset(&nt->link_work, 0, ntb_transport_link_work, nt); if (enable_xeon_watchdog != 0) callout_reset(&nt->link_watchdog, 0, xeon_link_watchdog_hb, nt); From owner-svn-src-all@freebsd.org Thu Aug 18 09:29:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FED0BBCE24; Thu, 18 Aug 2016 09:29:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B43401894; Thu, 18 Aug 2016 09:29:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9TZ5M094460; Thu, 18 Aug 2016 09:29:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9TZph094459; Thu, 18 Aug 2016 09:29:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180929.u7I9TZph094459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304363 - stable/11/sys/dev/ntb/ntb_hw X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:29:37 -0000 Author: mav Date: Thu Aug 18 09:29:35 2016 New Revision: 304363 URL: https://svnweb.freebsd.org/changeset/base/304363 Log: MFC r302531: Revert odd change, setting limit registers before base. I don't know what errata is mentioned there, I was unable to find it, but setting limit before the base simply does not work at all. According to specification attempt to set limit out of the present window range resets it to zero, effectively disabling it. And that is what I see in practice. Fixing this properly disables access for remote side to our memory until respective xlat is negotiated and set. As I see, Linux does the same. Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:28:59 2016 (r304362) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:29:35 2016 (r304363) @@ -1699,26 +1699,22 @@ xeon_set_sbar_base_and_limit(struct ntb_ bar_addr = 0; } - /* - * Set limit registers first to avoid an errata where setting the base - * registers locks the limit registers. - */ if (!bar_is_64bit(ntb, idx)) { - ntb_reg_write(4, lmt_reg, bar_addr); - reg_val = ntb_reg_read(4, lmt_reg); - (void)reg_val; - ntb_reg_write(4, base_reg, bar_addr); reg_val = ntb_reg_read(4, base_reg); (void)reg_val; - } else { - ntb_reg_write(8, lmt_reg, bar_addr); - reg_val = ntb_reg_read(8, lmt_reg); - (void)reg_val; + ntb_reg_write(4, lmt_reg, bar_addr); + reg_val = ntb_reg_read(4, lmt_reg); + (void)reg_val; + } else { ntb_reg_write(8, base_reg, bar_addr); reg_val = ntb_reg_read(8, base_reg); (void)reg_val; + + ntb_reg_write(8, lmt_reg, bar_addr); + reg_val = ntb_reg_read(8, lmt_reg); + (void)reg_val; } } From owner-svn-src-all@freebsd.org Thu Aug 18 09:30:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5EA0BBCEC2; Thu, 18 Aug 2016 09:30:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95F601A29; Thu, 18 Aug 2016 09:30:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9ULBH094577; Thu, 18 Aug 2016 09:30:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9UL8a094575; Thu, 18 Aug 2016 09:30:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180930.u7I9UL8a094575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304364 - in stable/11/sys/dev/ntb: . ntb_hw X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:30:22 -0000 Author: mav Date: Thu Aug 18 09:30:21 2016 New Revision: 304364 URL: https://svnweb.freebsd.org/changeset/base/304364 Log: MFC r302622 (by sephe): ntb: Fix LINT Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:29:35 2016 (r304363) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:30:21 2016 (r304364) @@ -617,8 +617,6 @@ SYSCTL_UQUAD(_hw_ntb_xeon_b2b, OID_AUTO, */ MALLOC_DEFINE(M_NTB, "ntb_hw", "ntb_hw driver memory allocations"); -SYSCTL_NODE(_hw, OID_AUTO, ntb, CTLFLAG_RW, 0, "NTB sysctls"); - /* * OS <-> Driver linkage functions */ Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:29:35 2016 (r304363) +++ stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:30:21 2016 (r304364) @@ -882,7 +882,7 @@ ntb_memcpy_rx(struct ntb_transport_qp *q /* Ensure that the data is globally visible before clearing the flag */ wmb(); - CTR2(KTR_NTB, "RX: copied entry %p to mbuf %p.", entry, m); + CTR2(KTR_NTB, "RX: copied entry %p to mbuf %p.", entry, entry->buf); ntb_rx_copy_callback(qp, entry); } From owner-svn-src-all@freebsd.org Thu Aug 18 09:30:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D83D9BBCF4B; Thu, 18 Aug 2016 09:30:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A86C51CF3; Thu, 18 Aug 2016 09:30:56 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9Utaf094753; Thu, 18 Aug 2016 09:30:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9UtAQ094752; Thu, 18 Aug 2016 09:30:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180930.u7I9UtAQ094752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304365 - stable/11/sys/dev/ntb/ntb_hw X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:30:56 -0000 Author: mav Date: Thu Aug 18 09:30:55 2016 New Revision: 304365 URL: https://svnweb.freebsd.org/changeset/base/304365 Log: MFC r303266: Postpone ntb_get_msix_info() till we need to negotiate MSIX. Calling it earlier increases the window when MSIX info may change. This change does not solve the problem completely, but seems logical. Complete solution should probably include link reset in case of MSIX remap to trigger new negotiation, but we have no way to get notified about that now. Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:30:21 2016 (r304364) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:30:55 2016 (r304365) @@ -1084,8 +1084,6 @@ ntb_init_isr(struct ntb_softc *ntb) ntb_create_msix_vec(ntb, num_vectors); rc = ntb_setup_msix(ntb, num_vectors); - if (rc == 0 && HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) - ntb_get_msix_info(ntb); } if (rc != 0) { device_printf(ntb->device, @@ -2715,6 +2713,7 @@ ntb_exchange_msix(void *ctx) if (ntb->peer_msix_done) goto msix_done; + ntb_get_msix_info(ntb); for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { ntb_peer_spad_write(ntb->device, NTB_MSIX_DATA0 + i, ntb->msix_data[i].nmd_data); From owner-svn-src-all@freebsd.org Thu Aug 18 09:33:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3602BBD1CD; Thu, 18 Aug 2016 09:33:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E8CF147E; Thu, 18 Aug 2016 09:33:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9XMLD098541; Thu, 18 Aug 2016 09:33:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9XM4W098537; Thu, 18 Aug 2016 09:33:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180933.u7I9XM4W098537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:33:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304366 - stable/11/share/man/man4 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:33:23 -0000 Author: mav Date: Thu Aug 18 09:33:22 2016 New Revision: 304366 URL: https://svnweb.freebsd.org/changeset/base/304366 Log: MFC r302520: Replace NTB man page with more detailed and up to date. Sponsored by: iXsystems, Inc. Added: stable/11/share/man/man4/if_ntb.4 - copied unchanged from r302520, head/share/man/man4/if_ntb.4 stable/11/share/man/man4/ntb_hw.4 - copied unchanged from r302520, head/share/man/man4/ntb_hw.4 stable/11/share/man/man4/ntb_transport.4 - copied unchanged from r302520, head/share/man/man4/ntb_transport.4 Deleted: stable/11/share/man/man4/ntb.4 Modified: stable/11/share/man/man4/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Thu Aug 18 09:30:55 2016 (r304365) +++ stable/11/share/man/man4/Makefile Thu Aug 18 09:33:22 2016 (r304366) @@ -374,7 +374,9 @@ MAN= aac.4 \ ng_vlan.4 \ nmdm.4 \ nsp.4 \ - ${_ntb.4} \ + ${_ntb_hw.4} \ + ${_ntb_transport.4} \ + ${_if_ntb.4} \ null.4 \ numa.4 \ ${_nvd.4} \ @@ -678,8 +680,7 @@ MLINKS+=netintro.4 net.4 \ netintro.4 networking.4 MLINKS+=${_nfe.4} ${_if_nfe.4} MLINKS+=nge.4 if_nge.4 -MLINKS+=${_ntb.4} ${_if_ntb.4} \ - ${_ntb.4} ${_ntb_hw.4} +MLINKS+=${_ntb_hw.4} ${_ntb.4} MLINKS+=${_nxge.4} ${_if_nxge.4} MLINKS+=ow.4 onewire.4 MLINKS+=patm.4 if_patm.4 @@ -820,6 +821,7 @@ _if_ntb.4= if_ntb.4 _ioat.4= ioat.4 _ntb.4= ntb.4 _ntb_hw.4= ntb_hw.4 +_ntb_transport.4=ntb_transport.4 _qlxge.4= qlxge.4 _qlxgb.4= qlxgb.4 _qlxgbe.4= qlxgbe.4 Copied: stable/11/share/man/man4/if_ntb.4 (from r302520, head/share/man/man4/if_ntb.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/if_ntb.4 Thu Aug 18 09:33:22 2016 (r304366, copy of r302520, head/share/man/man4/if_ntb.4) @@ -0,0 +1,86 @@ +.\" +.\" Copyright (c) 2016 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. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 10, 2016 +.Dt IF_NTB 4 +.Os +.Sh NAME +.Nm if_ntb +.Nd Virtual Ethernet interface for Non-Transparent Bridges +.Sh SYNOPSIS +To compile this driver into your kernel, +place the following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device if_ntb" +.Ed +.Pp +Or, to load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_ntb_load="YES" +.Ed +.Pp +The following tunables are settable from the +.Xr loader 8 : +.Bl -ohang +.It Va hw.if_ntb.num_queues +Number of transport queues to use per interface. +Default is 1. +.El +.Sh DESCRIPTION +The +.Nm +driver attaches on top of the +.Xr ntb_transport 4 +driver to utilize its resources to create virtual Ethernet interface between +the systems. +Interface capabilities depend on the underlying transport. +Typical MTU is about 64KB to reduce overhead. +By default one queue is used, but more may be configured. +The MAC address for interface is randomly generated. +.Pp +The +.Nm +driver does not implement any real hardware offload, but since PCIe link is +protected by CRC32, in some situations it may be possible to save some CPU +cycles by enabling fake checksum offload on both link sides via setting +.Cm rxcsum +and +.Cm txcsum +interface options. +.Sh SEE ALSO +.Xr ntb_transport 4 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was developed by Intel and originally written by +.An Carl Delsey Aq Mt carl@FreeBSD.org . +Later improvements were done by +.An Conrad E. Meyer Aq Mt cem@FreeBSD.org +and +.An Alexander Motin Aq Mt mav@FreeBSD.org . Copied: stable/11/share/man/man4/ntb_hw.4 (from r302520, head/share/man/man4/ntb_hw.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/ntb_hw.4 Thu Aug 18 09:33:22 2016 (r304366, copy of r302520, head/share/man/man4/ntb_hw.4) @@ -0,0 +1,103 @@ +.\" +.\" Copyright (c) 2016 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. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 10, 2016 +.Dt NTB_HW 4 +.Os +.Sh NAME +.Nm ntb , +.Nm ntb_hw +.Nd Intel(R) Non-Transparent Bridge driver +.Sh SYNOPSIS +To compile this driver into your kernel, +place the following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ntb_hw" +.Ed +.Pp +Or, to load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +ntb_hw_load="YES" +.Ed +.Pp +The following tunables are settable from the +.Xr loader 8 : +.Bl -ohang +.It Va hw.ntb.debug_level +Driver debug level. +The default value is 0, higher means more verbose. +.El +.Sh DESCRIPTION +The NTB allows you to connect two computer systems using a PCIe link if they +have the correct equipment and connectors. +The +.Nm ntb_hw +driver provides support for the Non-Transparent Bridge (NTB) in the Intel S1200 +and Xeon E3/E5 processor families. +The +.Nm +driver hides hardware details, exposing memory windows, scratchpads and +doorbells via hardware independent KPI. +.Pp +The hardware provides 2-3 memory windows to the other system's memory, +16 scratchpad registers and 14/34 doorbells to interrupt the other system. +On Xeon processors one of memory windows is typically consumed by the driver +to workaround multiple hardware erratas. +.Sh CONFIGURATION +Tne NTB configuration should be set by BIOS. +It includes enabling NTB, choosing between NTB-to-NTB or NTB-to-Root Port mode, +enabling split BAR mode (one of two 64-bit BARs can be split into two 32-bit +ones) and configuring BAR sizes in bits (from 12 to 29/39) for both NTB sides. +.Pp +The recommended configuration is NTB-to-NTB mode, split bar is enabled and +all BAR sizes are set to 20 (1 MiB). +This needs to be done on both systems. +.Sh SEE ALSO +.Xr ntb_transport 4 , +.Xr if_ntb 4 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was developed by Intel and originally written by +.An Carl Delsey Aq Mt carl@FreeBSD.org . +Later improvements were done by +.An Conrad E. Meyer Aq Mt cem@FreeBSD.org +and +.An Alexander Motin Aq Mt mav@FreeBSD.org . +.Sh BUGS +NTB-to-Root Port mode is not yet supported, but it doesn't look very useful. +.Pp +On Xeon v2/v3/v4 processors split BAR mode should be enabled to allow +SB01BASE_LOCKUP errata workaround to be applied by the driver. +.Pp +There is no way to protect your system from malicious behavior on the other +system once the link is brought up. +Anyone with root or kernel access on the other system can read or write to +any location on your system. +In other words, only connect two systems that completely trust each other. Copied: stable/11/share/man/man4/ntb_transport.4 (from r302520, head/share/man/man4/ntb_transport.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/ntb_transport.4 Thu Aug 18 09:33:22 2016 (r304366, copy of r302520, head/share/man/man4/ntb_transport.4) @@ -0,0 +1,74 @@ +.\" +.\" Copyright (c) 2016 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. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 10, 2016 +.Dt NTB_TRANSPORT 4 +.Os +.Sh NAME +.Nm ntb_transport +.Nd Packet-oriented transport for Non-Transparent Bridges +.Sh SYNOPSIS +To load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +ntb_transport_load="YES" +.Ed +.Pp +The following tunables are settable from the +.Xr loader 8 : +.Bl -ohang +.It Va hw.ntb_transport.debug_level +Driver debug level. +The default value is 0, higher means more verbose. +.It Va hw.ntb_transport.max_num_clients +Number of bidirectional queues to setup. +The default value is 0, that means one queue per available memory window. +Maximal number is limited by number of doorbells. +.El +.Sh DESCRIPTION +The +.Nm +driver attaches on top of the +.Nm ntb +driver to utilize its resources to create set of bidirectional queues, +delivering packets between the systems. +The primary purpose of this is to be used by +.Nm if_ntb +network interface, but other consumers may also be developed using KPI. +.Sh SEE ALSO +.Xr if_ntb 4 , +.Xr ntb_hw 4 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was developed by Intel and originally written by +.An Carl Delsey Aq Mt carl@FreeBSD.org . +Later improvements were done by +.An Conrad E. Meyer Aq Mt cem@FreeBSD.org +and +.An Alexander Motin Aq Mt mav@FreeBSD.org . From owner-svn-src-all@freebsd.org Thu Aug 18 09:34:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AE18BBD2AB; Thu, 18 Aug 2016 09:34:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B221F167D; Thu, 18 Aug 2016 09:34:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9Ye4W098647; Thu, 18 Aug 2016 09:34:40 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9YdQW098642; Thu, 18 Aug 2016 09:34:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180934.u7I9YdQW098642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:34:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304367 - in stable/11: share/man/man4 sys/dev/ntb sys/dev/ntb/ntb_hw X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:34:41 -0000 Author: mav Date: Thu Aug 18 09:34:39 2016 New Revision: 304367 URL: https://svnweb.freebsd.org/changeset/base/304367 Log: MFC r303429, r303437: Once more refactor KPI between NTB hardware and consumers. New design allows hardware resources to be split between several consumers. For example, one BAR can be dedicated for remote memory access, while other resources can be used for packet transport for virtual Ethernet interface. And even without resource split, this code allows to specify which consumer driver should attach the hardware. From some points this makes the code even closer to Linux one, even though Linux does not provide the described flexibility. Modified: stable/11/share/man/man4/ntb_hw.4 stable/11/sys/dev/ntb/ntb.c stable/11/sys/dev/ntb/ntb.h stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c stable/11/sys/dev/ntb/ntb_if.m stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/ntb_hw.4 ============================================================================== --- stable/11/share/man/man4/ntb_hw.4 Thu Aug 18 09:33:22 2016 (r304366) +++ stable/11/share/man/man4/ntb_hw.4 Thu Aug 18 09:34:39 2016 (r304367) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2016 +.Dd July 28, 2016 .Dt NTB_HW 4 .Os .Sh NAME @@ -51,6 +51,20 @@ The following tunables are settable from .It Va hw.ntb.debug_level Driver debug level. The default value is 0, higher means more verbose. +.It Va hint.ntb_hw. Ns Ar X Ns Va .config +Configures NTB resources split between several consumer devices. +Configuration of multiple consumer devices separated by commas. +Each device can be configured as: "[:[:[:]]]", where: +.Va name +is a name of the driver which should attach the device (empty means any), +.Va mw +is a number of memory windows to allocate (empty means all available), +.Va spad +is a number of scratchpad registers to allocate (empty means all available), +.Va db +is a number of doorbells to allocate (empty means all available). +The default configuration is empty string, which means single device +with all available resources allowing any driver attachment. .El .Sh DESCRIPTION The NTB allows you to connect two computer systems using a PCIe link if they @@ -69,7 +83,7 @@ The hardware provides 2-3 memory windows On Xeon processors one of memory windows is typically consumed by the driver to workaround multiple hardware erratas. .Sh CONFIGURATION -Tne NTB configuration should be set by BIOS. +The NTB configuration should be set by BIOS. It includes enabling NTB, choosing between NTB-to-NTB or NTB-to-Root Port mode, enabling split BAR mode (one of two 64-bit BARs can be split into two 32-bit ones) and configuring BAR sizes in bits (from 12 to 29/39) for both NTB sides. Modified: stable/11/sys/dev/ntb/ntb.c ============================================================================== --- stable/11/sys/dev/ntb/ntb.c Thu Aug 18 09:33:22 2016 (r304366) +++ stable/11/sys/dev/ntb/ntb.c Thu Aug 18 09:34:39 2016 (r304367) @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -39,4 +41,422 @@ __FBSDID("$FreeBSD$"); devclass_t ntb_hw_devclass; SYSCTL_NODE(_hw, OID_AUTO, ntb, CTLFLAG_RW, 0, "NTB sysctls"); +struct ntb_child { + device_t dev; + int enabled; + int mwoff; + int mwcnt; + int spadoff; + int spadcnt; + int dboff; + int dbmask; + void *ctx; + const struct ntb_ctx_ops *ctx_ops; + struct rmlock ctx_lock; + struct ntb_child *next; +}; + +int +ntb_register_device(device_t dev) +{ + struct ntb_child **cpp = device_get_softc(dev); + struct ntb_child *nc; + int i, mw, mwu, mwt, spad, spadu, spadt, db, dbu, dbt; + char cfg[128] = ""; + char buf[32]; + char *n, *np, *c, *p, *name; + + mwu = 0; + mwt = NTB_MW_COUNT(dev); + spadu = 0; + spadt = NTB_SPAD_COUNT(dev); + dbu = 0; + dbt = flsll(NTB_DB_VALID_MASK(dev)); + + device_printf(dev, "%d memory windows, %d scratchpads, " + "%d doorbells\n", mwt, spadt, dbt); + + snprintf(buf, sizeof(buf), "hint.%s.%d.config", device_get_name(dev), + device_get_unit(dev)); + TUNABLE_STR_FETCH(buf, cfg, sizeof(cfg)); + n = cfg; + i = 0; + while ((c = strsep(&n, ",")) != NULL) { + np = c; + name = strsep(&np, ":"); + if (name != NULL && name[0] == 0) + name = NULL; + p = strsep(&np, ":"); + mw = (p && p[0] != 0) ? strtol(p, NULL, 10) : mwt - mwu; + p = strsep(&np, ":"); + spad = (p && p[0] != 0) ? strtol(p, NULL, 10) : spadt - spadu; + db = (np && np[0] != 0) ? strtol(np, NULL, 10) : dbt - dbu; + + if (mw > mwt - mwu || spad > spadt - spadu || db > dbt - dbu) { + device_printf(dev, "Not enough resources for config\n"); + break; + } + + nc = malloc(sizeof(*nc), M_DEVBUF, M_WAITOK | M_ZERO); + nc->mwoff = mwu; + nc->mwcnt = mw; + nc->spadoff = spadu; + nc->spadcnt = spad; + nc->dboff = dbu; + nc->dbmask = (db == 0) ? 0 : (0xffffffffffffffff >> (64 - db)); + rm_init(&nc->ctx_lock, "ntb ctx"); + nc->dev = device_add_child(dev, name, -1); + if (nc->dev == NULL) { + ntb_unregister_device(dev); + return (ENOMEM); + } + device_set_ivars(nc->dev, nc); + *cpp = nc; + cpp = &nc->next; + + if (bootverbose) { + device_printf(dev, "%d \"%s\":", i, name); + if (mw > 0) { + printf(" memory windows %d", mwu); + if (mw > 1) + printf("-%d", mwu + mw - 1); + } + if (spad > 0) { + printf(" scratchpads %d", spadu); + if (spad > 1) + printf("-%d", spadu + spad - 1); + } + if (db > 0) { + printf(" doorbells %d", dbu); + if (db > 1) + printf("-%d", dbu + db - 1); + } + printf("\n"); + } + + mwu += mw; + spadu += spad; + dbu += db; + i++; + } + + bus_generic_attach(dev); + return (0); +} + +int +ntb_unregister_device(device_t dev) +{ + struct ntb_child **cpp = device_get_softc(dev); + struct ntb_child *nc; + int error = 0; + + while ((nc = *cpp) != NULL) { + *cpp = (*cpp)->next; + error = device_delete_child(dev, nc->dev); + if (error) + break; + rm_destroy(&nc->ctx_lock); + free(nc, M_DEVBUF); + } + return (error); +} + +void +ntb_link_event(device_t dev) +{ + struct ntb_child **cpp = device_get_softc(dev); + struct ntb_child *nc; + struct rm_priotracker ctx_tracker; + + for (nc = *cpp; nc != NULL; nc = nc->next) { + rm_rlock(&nc->ctx_lock, &ctx_tracker); + if (nc->ctx_ops != NULL && nc->ctx_ops->link_event != NULL) + nc->ctx_ops->link_event(nc->ctx); + rm_runlock(&nc->ctx_lock, &ctx_tracker); + } +} + +void +ntb_db_event(device_t dev, uint32_t vec) +{ + struct ntb_child **cpp = device_get_softc(dev); + struct ntb_child *nc; + struct rm_priotracker ctx_tracker; + + for (nc = *cpp; nc != NULL; nc = nc->next) { + rm_rlock(&nc->ctx_lock, &ctx_tracker); + if (nc->ctx_ops != NULL && nc->ctx_ops->db_event != NULL) + nc->ctx_ops->db_event(nc->ctx, vec); + rm_runlock(&nc->ctx_lock, &ctx_tracker); + } +} + +bool +ntb_link_is_up(device_t ntb, enum ntb_speed *speed, enum ntb_width *width) +{ + + return (NTB_LINK_IS_UP(device_get_parent(ntb), speed, width)); +} + +int +ntb_link_enable(device_t ntb, enum ntb_speed speed, enum ntb_width width) +{ + struct ntb_child *nc = device_get_ivars(ntb); + struct ntb_child **cpp = device_get_softc(device_get_parent(nc->dev)); + struct ntb_child *nc1; + + for (nc1 = *cpp; nc1 != NULL; nc1 = nc->next) { + if (nc1->enabled) { + nc->enabled = 1; + return (0); + } + } + nc->enabled = 1; + return (NTB_LINK_ENABLE(device_get_parent(ntb), speed, width)); +} + +int +ntb_link_disable(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + struct ntb_child **cpp = device_get_softc(device_get_parent(nc->dev)); + struct ntb_child *nc1; + + if (!nc->enabled) + return (0); + nc->enabled = 0; + for (nc1 = *cpp; nc1 != NULL; nc1 = nc->next) { + if (nc1->enabled) + return (0); + } + return (NTB_LINK_DISABLE(device_get_parent(ntb))); +} + +bool +ntb_link_enabled(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (nc->enabled && NTB_LINK_ENABLED(device_get_parent(ntb))); +} + +int +ntb_set_ctx(device_t ntb, void *ctx, const struct ntb_ctx_ops *ctx_ops) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + if (ctx == NULL || ctx_ops == NULL) + return (EINVAL); + + rm_wlock(&nc->ctx_lock); + if (nc->ctx_ops != NULL) { + rm_wunlock(&nc->ctx_lock); + return (EINVAL); + } + nc->ctx = ctx; + nc->ctx_ops = ctx_ops; + rm_wunlock(&nc->ctx_lock); + + return (0); +} + +void * +ntb_get_ctx(device_t ntb, const struct ntb_ctx_ops **ctx_ops) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + KASSERT(nc->ctx != NULL && nc->ctx_ops != NULL, ("bogus")); + if (ctx_ops != NULL) + *ctx_ops = nc->ctx_ops; + return (nc->ctx); +} + +void +ntb_clear_ctx(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + rm_wlock(&nc->ctx_lock); + nc->ctx = NULL; + nc->ctx_ops = NULL; + rm_wunlock(&nc->ctx_lock); +} + +uint8_t +ntb_mw_count(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (nc->mwcnt); +} + +int +ntb_mw_get_range(device_t ntb, unsigned mw_idx, vm_paddr_t *base, + caddr_t *vbase, size_t *size, size_t *align, size_t *align_size, + bus_addr_t *plimit) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_MW_GET_RANGE(device_get_parent(ntb), mw_idx + nc->mwoff, + base, vbase, size, align, align_size, plimit)); +} + +int +ntb_mw_set_trans(device_t ntb, unsigned mw_idx, bus_addr_t addr, size_t size) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_MW_SET_TRANS(device_get_parent(ntb), mw_idx + nc->mwoff, + addr, size)); +} + +int +ntb_mw_clear_trans(device_t ntb, unsigned mw_idx) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_MW_CLEAR_TRANS(device_get_parent(ntb), mw_idx + nc->mwoff)); +} + +int +ntb_mw_get_wc(device_t ntb, unsigned mw_idx, vm_memattr_t *mode) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_MW_GET_WC(device_get_parent(ntb), mw_idx + nc->mwoff, mode)); +} + +int +ntb_mw_set_wc(device_t ntb, unsigned mw_idx, vm_memattr_t mode) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_MW_SET_WC(device_get_parent(ntb), mw_idx + nc->mwoff, mode)); +} + +uint8_t +ntb_spad_count(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (nc->spadcnt); +} + +void +ntb_spad_clear(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + unsigned i; + + for (i = 0; i < nc->spadcnt; i++) + NTB_SPAD_WRITE(device_get_parent(ntb), i + nc->spadoff, 0); +} + +int +ntb_spad_write(device_t ntb, unsigned int idx, uint32_t val) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_SPAD_WRITE(device_get_parent(ntb), idx + nc->spadoff, val)); +} + +int +ntb_spad_read(device_t ntb, unsigned int idx, uint32_t *val) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_SPAD_READ(device_get_parent(ntb), idx + nc->spadoff, val)); +} + +int +ntb_peer_spad_write(device_t ntb, unsigned int idx, uint32_t val) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_PEER_SPAD_WRITE(device_get_parent(ntb), idx + nc->spadoff, + val)); +} + +int +ntb_peer_spad_read(device_t ntb, unsigned int idx, uint32_t *val) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_PEER_SPAD_READ(device_get_parent(ntb), idx + nc->spadoff, + val)); +} + +uint64_t +ntb_db_valid_mask(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (nc->dbmask); +} + +int +ntb_db_vector_count(device_t ntb) +{ + + return (NTB_DB_VECTOR_COUNT(device_get_parent(ntb))); +} + +uint64_t +ntb_db_vector_mask(device_t ntb, uint32_t vector) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return ((NTB_DB_VECTOR_MASK(device_get_parent(ntb), vector) + >> nc->dboff) & nc->dbmask); +} + +int +ntb_peer_db_addr(device_t ntb, bus_addr_t *db_addr, vm_size_t *db_size) +{ + + return (NTB_PEER_DB_ADDR(device_get_parent(ntb), db_addr, db_size)); +} + +void +ntb_db_clear(device_t ntb, uint64_t bits) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_DB_CLEAR(device_get_parent(ntb), bits << nc->dboff)); +} + +void +ntb_db_clear_mask(device_t ntb, uint64_t bits) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_DB_CLEAR_MASK(device_get_parent(ntb), bits << nc->dboff)); +} + +uint64_t +ntb_db_read(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return ((NTB_DB_READ(device_get_parent(ntb)) >> nc->dboff) + & nc->dbmask); +} + +void +ntb_db_set_mask(device_t ntb, uint64_t bits) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_DB_SET_MASK(device_get_parent(ntb), bits << nc->dboff)); +} + +void +ntb_peer_db_set(device_t ntb, uint64_t bits) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_PEER_DB_SET(device_get_parent(ntb), bits << nc->dboff)); +} + MODULE_VERSION(ntb, 1); Modified: stable/11/sys/dev/ntb/ntb.h ============================================================================== --- stable/11/sys/dev/ntb/ntb.h Thu Aug 18 09:33:22 2016 (r304366) +++ stable/11/sys/dev/ntb/ntb.h Thu Aug 18 09:34:39 2016 (r304367) @@ -34,4 +34,376 @@ extern devclass_t ntb_hw_devclass; SYSCTL_DECL(_hw_ntb); +int ntb_register_device(device_t ntb); +int ntb_unregister_device(device_t ntb); + +/* + * ntb_link_event() - notify driver context of a change in link status + * @ntb: NTB device context + * + * Notify the driver context that the link status may have changed. The driver + * should call intb_link_is_up() to get the current status. + */ +void ntb_link_event(device_t ntb); + +/* + * ntb_db_event() - notify driver context of a doorbell event + * @ntb: NTB device context + * @vector: Interrupt vector number + * + * Notify the driver context of a doorbell event. If hardware supports + * multiple interrupt vectors for doorbells, the vector number indicates which + * vector received the interrupt. The vector number is relative to the first + * vector used for doorbells, starting at zero, and must be less than + * ntb_db_vector_count(). The driver may call ntb_db_read() to check which + * doorbell bits need service, and ntb_db_vector_mask() to determine which of + * those bits are associated with the vector number. + */ +void ntb_db_event(device_t ntb, uint32_t vec); + +/* + * ntb_link_is_up() - get the current ntb link state + * @ntb: NTB device context + * @speed: OUT - The link speed expressed as PCIe generation number + * @width: OUT - The link width expressed as the number of PCIe lanes + * + * RETURNS: true or false based on the hardware link state + */ +bool ntb_link_is_up(device_t ntb, enum ntb_speed *speed, enum ntb_width *width); + +/* + * ntb_link_enable() - enable the link on the secondary side of the ntb + * @ntb: NTB device context + * @max_speed: The maximum link speed expressed as PCIe generation number[0] + * @max_width: The maximum link width expressed as the number of PCIe lanes[0] + * + * Enable the link on the secondary side of the ntb. This can only be done + * from the primary side of the ntb in primary or b2b topology. The ntb device + * should train the link to its maximum speed and width, or the requested speed + * and width, whichever is smaller, if supported. + * + * Return: Zero on success, otherwise an error number. + * + * [0]: Only NTB_SPEED_AUTO and NTB_WIDTH_AUTO are valid inputs; other speed + * and width input will be ignored. + */ +int ntb_link_enable(device_t ntb, enum ntb_speed speed, enum ntb_width width); + +/* + * ntb_link_disable() - disable the link on the secondary side of the ntb + * @ntb: NTB device context + * + * Disable the link on the secondary side of the ntb. This can only be done + * from the primary side of the ntb in primary or b2b topology. The ntb device + * should disable the link. Returning from this call must indicate that a + * barrier has passed, though with no more writes may pass in either direction + * across the link, except if this call returns an error number. + * + * Return: Zero on success, otherwise an error number. + */ +int ntb_link_disable(device_t ntb); + +/* + * get enable status of the link on the secondary side of the ntb + */ +bool ntb_link_enabled(device_t ntb); + +/* + * ntb_set_ctx() - associate a driver context with an ntb device + * @ntb: NTB device context + * @ctx: Driver context + * @ctx_ops: Driver context operations + * + * Associate a driver context and operations with a ntb device. The context is + * provided by the client driver, and the driver may associate a different + * context with each ntb device. + * + * Return: Zero if the context is associated, otherwise an error number. + */ +int ntb_set_ctx(device_t ntb, void *ctx, const struct ntb_ctx_ops *ctx_ops); + +/* + * ntb_set_ctx() - get a driver context associated with an ntb device + * @ntb: NTB device context + * @ctx_ops: Driver context operations + * + * Get a driver context and operations associated with a ntb device. + */ +void * ntb_get_ctx(device_t ntb, const struct ntb_ctx_ops **ctx_ops); + +/* + * ntb_clear_ctx() - disassociate any driver context from an ntb device + * @ntb: NTB device context + * + * Clear any association that may exist between a driver context and the ntb + * device. + */ +void ntb_clear_ctx(device_t ntb); + +/* + * ntb_mw_count() - Get the number of memory windows available for KPI + * consumers. + * + * (Excludes any MW wholly reserved for register access.) + */ +uint8_t ntb_mw_count(device_t ntb); + +/* + * ntb_mw_get_range() - get the range of a memory window + * @ntb: NTB device context + * @idx: Memory window number + * @base: OUT - the base address for mapping the memory window + * @size: OUT - the size for mapping the memory window + * @align: OUT - the base alignment for translating the memory window + * @align_size: OUT - the size alignment for translating the memory window + * + * Get the range of a memory window. NULL may be given for any output + * parameter if the value is not needed. The base and size may be used for + * mapping the memory window, to access the peer memory. The alignment and + * size may be used for translating the memory window, for the peer to access + * memory on the local system. + * + * Return: Zero on success, otherwise an error number. + */ +int ntb_mw_get_range(device_t ntb, unsigned mw_idx, vm_paddr_t *base, + caddr_t *vbase, size_t *size, size_t *align, size_t *align_size, + bus_addr_t *plimit); + +/* + * ntb_mw_set_trans() - set the translation of a memory window + * @ntb: NTB device context + * @idx: Memory window number + * @addr: The dma address local memory to expose to the peer + * @size: The size of the local memory to expose to the peer + * + * Set the translation of a memory window. The peer may access local memory + * through the window starting at the address, up to the size. The address + * must be aligned to the alignment specified by ntb_mw_get_range(). The size + * must be aligned to the size alignment specified by ntb_mw_get_range(). The + * address must be below the plimit specified by ntb_mw_get_range() (i.e. for + * 32-bit BARs). + * + * Return: Zero on success, otherwise an error number. + */ +int ntb_mw_set_trans(device_t ntb, unsigned mw_idx, bus_addr_t addr, + size_t size); + +/* + * ntb_mw_clear_trans() - clear the translation of a memory window + * @ntb: NTB device context + * @idx: Memory window number + * + * Clear the translation of a memory window. The peer may no longer access + * local memory through the window. + * + * Return: Zero on success, otherwise an error number. + */ +int ntb_mw_clear_trans(device_t ntb, unsigned mw_idx); + +/* + * ntb_mw_get_wc - Get the write-combine status of a memory window + * + * Returns: Zero on success, setting *wc; otherwise an error number (e.g. if + * idx is an invalid memory window). + * + * Mode is a VM_MEMATTR_* type. + */ +int ntb_mw_get_wc(device_t ntb, unsigned mw_idx, vm_memattr_t *mode); + +/* + * ntb_mw_set_wc - Set the write-combine status of a memory window + * + * If 'mode' matches the current status, this does nothing and succeeds. Mode + * is a VM_MEMATTR_* type. + * + * Returns: Zero on success, setting the caching attribute on the virtual + * mapping of the BAR; otherwise an error number (e.g. if idx is an invalid + * memory window, or if changing the caching attribute fails). + */ +int ntb_mw_set_wc(device_t ntb, unsigned mw_idx, vm_memattr_t mode); + +/* + * ntb_spad_count() - get the total scratch regs usable + * @ntb: pointer to ntb_softc instance + * + * This function returns the max 32bit scratchpad registers usable by the + * upper layer. + * + * RETURNS: total number of scratch pad registers available + */ +uint8_t ntb_spad_count(device_t ntb); + +/* + * ntb_get_max_spads() - zero local scratch registers + * @ntb: pointer to ntb_softc instance + * + * This functions overwrites all local scratchpad registers with zeroes. + */ +void ntb_spad_clear(device_t ntb); + +/* + * ntb_spad_write() - write to the secondary scratchpad register + * @ntb: pointer to ntb_softc instance + * @idx: index to the scratchpad register, 0 based + * @val: the data value to put into the register + * + * This function allows writing of a 32bit value to the indexed scratchpad + * register. The register resides on the secondary (external) side. + * + * RETURNS: An appropriate ERRNO error value on error, or zero for success. + */ +int ntb_spad_write(device_t ntb, unsigned int idx, uint32_t val); + +/* + * ntb_spad_read() - read from the primary scratchpad register + * @ntb: pointer to ntb_softc instance + * @idx: index to scratchpad register, 0 based + * @val: pointer to 32bit integer for storing the register value + * + * This function allows reading of the 32bit scratchpad register on + * the primary (internal) side. + * + * RETURNS: An appropriate ERRNO error value on error, or zero for success. + */ +int ntb_spad_read(device_t ntb, unsigned int idx, uint32_t *val); + +/* + * ntb_peer_spad_write() - write to the secondary scratchpad register + * @ntb: pointer to ntb_softc instance + * @idx: index to the scratchpad register, 0 based + * @val: the data value to put into the register + * + * This function allows writing of a 32bit value to the indexed scratchpad + * register. The register resides on the secondary (external) side. + * + * RETURNS: An appropriate ERRNO error value on error, or zero for success. + */ +int ntb_peer_spad_write(device_t ntb, unsigned int idx, uint32_t val); + +/* + * ntb_peer_spad_read() - read from the primary scratchpad register + * @ntb: pointer to ntb_softc instance + * @idx: index to scratchpad register, 0 based + * @val: pointer to 32bit integer for storing the register value + * + * This function allows reading of the 32bit scratchpad register on + * the primary (internal) side. + * + * RETURNS: An appropriate ERRNO error value on error, or zero for success. + */ +int ntb_peer_spad_read(device_t ntb, unsigned int idx, uint32_t *val); + +/* + * ntb_db_valid_mask() - get a mask of doorbell bits supported by the ntb + * @ntb: NTB device context + * + * Hardware may support different number or arrangement of doorbell bits. + * + * Return: A mask of doorbell bits supported by the ntb. + */ +uint64_t ntb_db_valid_mask(device_t ntb); + +/* + * ntb_db_vector_count() - get the number of doorbell interrupt vectors + * @ntb: NTB device context. + * + * Hardware may support different number of interrupt vectors. + * + * Return: The number of doorbell interrupt vectors. + */ +int ntb_db_vector_count(device_t ntb); + +/* + * ntb_db_vector_mask() - get a mask of doorbell bits serviced by a vector + * @ntb: NTB device context + * @vector: Doorbell vector number + * + * Each interrupt vector may have a different number or arrangement of bits. + * + * Return: A mask of doorbell bits serviced by a vector. + */ +uint64_t ntb_db_vector_mask(device_t ntb, uint32_t vector); + +/* + * ntb_peer_db_addr() - address and size of the peer doorbell register + * @ntb: NTB device context. + * @db_addr: OUT - The address of the peer doorbell register. + * @db_size: OUT - The number of bytes to write the peer doorbell register. + * + * Return the address of the peer doorbell register. This may be used, for + * example, by drivers that offload memory copy operations to a dma engine. + * The drivers may wish to ring the peer doorbell at the completion of memory + * copy operations. For efficiency, and to simplify ordering of operations + * between the dma memory copies and the ringing doorbell, the driver may + * append one additional dma memory copy with the doorbell register as the + * destination, after the memory copy operations. + * + * Return: Zero on success, otherwise an error number. + * + * Note that writing the peer doorbell via a memory window will *not* generate + * an interrupt on the remote host; that must be done separately. + */ +int ntb_peer_db_addr(device_t ntb, bus_addr_t *db_addr, vm_size_t *db_size); + +/* + * ntb_db_clear() - clear bits in the local doorbell register + * @ntb: NTB device context. + * @db_bits: Doorbell bits to clear. + * + * Clear bits in the local doorbell register, arming the bits for the next + * doorbell. + * + * Return: Zero on success, otherwise an error number. + */ +void ntb_db_clear(device_t ntb, uint64_t bits); + +/* + * ntb_db_clear_mask() - clear bits in the local doorbell mask + * @ntb: NTB device context. + * @db_bits: Doorbell bits to clear. + * + * Clear bits in the local doorbell mask register, allowing doorbell interrupts + * from being generated for those doorbell bits. If a doorbell bit is already + * set at the time the mask is cleared, and the corresponding mask bit is + * changed from set to clear, then the ntb driver must ensure that + * ntb_db_event() is called. If the hardware does not generate the interrupt + * on clearing the mask bit, then the driver must call ntb_db_event() anyway. + * + * Return: Zero on success, otherwise an error number. + */ +void ntb_db_clear_mask(device_t ntb, uint64_t bits); + +/* + * ntb_db_read() - read the local doorbell register + * @ntb: NTB device context. + * + * Read the local doorbell register, and return the bits that are set. + * + * Return: The bits currently set in the local doorbell register. + */ +uint64_t ntb_db_read(device_t ntb); + +/* + * ntb_db_set_mask() - set bits in the local doorbell mask + * @ntb: NTB device context. + * @db_bits: Doorbell mask bits to set. + * + * Set bits in the local doorbell mask register, preventing doorbell interrupts + * from being generated for those doorbell bits. Bits that were already set + * must remain set. + * + * Return: Zero on success, otherwise an error number. + */ +void ntb_db_set_mask(device_t ntb, uint64_t bits); + +/* + * ntb_peer_db_set() - Set the doorbell on the secondary/external side + * @ntb: pointer to ntb_softc instance + * @bit: doorbell bits to ring + * + * This function allows triggering of a doorbell on the secondary/external + * side that will initiate an interrupt on the remote host + */ +void ntb_peer_db_set(device_t ntb, uint64_t bits); + #endif /* _NTB_H_ */ Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:33:22 2016 (r304366) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:34:39 2016 (r304367) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -201,6 +200,9 @@ struct ntb_msix_data { }; struct ntb_softc { + /* ntb.c context. Do not move! Must go first! */ + void *ntb_store; + device_t device; enum ntb_device_type type; uint32_t features; @@ -219,10 +221,7 @@ struct ntb_softc { struct callout heartbeat_timer; struct callout lr_timer; - void *ntb_ctx; - const struct ntb_ctx_ops *ctx_ops; struct ntb_vec *msix_vec; - struct rmlock ctx_lock; uint32_t ppd; enum ntb_conn_type conn_type; @@ -284,72 +283,74 @@ bus_space_write_8(bus_space_tag_t tag, b } #endif -#define ntb_bar_read(SIZE, bar, offset) \ +#define intel_ntb_bar_read(SIZE, bar, offset) \ bus_space_read_ ## SIZE (ntb->bar_info[(bar)].pci_bus_tag, \ ntb->bar_info[(bar)].pci_bus_handle, (offset)) -#define ntb_bar_write(SIZE, bar, offset, val) \ +#define intel_ntb_bar_write(SIZE, bar, offset, val) \ bus_space_write_ ## SIZE (ntb->bar_info[(bar)].pci_bus_tag, \ ntb->bar_info[(bar)].pci_bus_handle, (offset), (val)) -#define ntb_reg_read(SIZE, offset) ntb_bar_read(SIZE, NTB_CONFIG_BAR, offset) -#define ntb_reg_write(SIZE, offset, val) \ - ntb_bar_write(SIZE, NTB_CONFIG_BAR, offset, val) -#define ntb_mw_read(SIZE, offset) \ - ntb_bar_read(SIZE, ntb_mw_to_bar(ntb, ntb->b2b_mw_idx), offset) -#define ntb_mw_write(SIZE, offset, val) \ - ntb_bar_write(SIZE, ntb_mw_to_bar(ntb, ntb->b2b_mw_idx), \ +#define intel_ntb_reg_read(SIZE, offset) \ + intel_ntb_bar_read(SIZE, NTB_CONFIG_BAR, offset) +#define intel_ntb_reg_write(SIZE, offset, val) \ + intel_ntb_bar_write(SIZE, NTB_CONFIG_BAR, offset, val) +#define intel_ntb_mw_read(SIZE, offset) \ + intel_ntb_bar_read(SIZE, intel_ntb_mw_to_bar(ntb, ntb->b2b_mw_idx), \ + offset) +#define intel_ntb_mw_write(SIZE, offset, val) \ + intel_ntb_bar_write(SIZE, intel_ntb_mw_to_bar(ntb, ntb->b2b_mw_idx), \ offset, val) -static int ntb_probe(device_t device); -static int ntb_attach(device_t device); -static int ntb_detach(device_t device); -static uint64_t ntb_db_valid_mask(device_t dev); -static void ntb_spad_clear(device_t dev); -static uint64_t ntb_db_vector_mask(device_t dev, uint32_t vector); -static bool ntb_link_is_up(device_t dev, enum ntb_speed *speed, +static int intel_ntb_probe(device_t device); +static int intel_ntb_attach(device_t device); +static int intel_ntb_detach(device_t device); +static uint64_t intel_ntb_db_valid_mask(device_t dev); +static void intel_ntb_spad_clear(device_t dev); +static uint64_t intel_ntb_db_vector_mask(device_t dev, uint32_t vector); +static bool intel_ntb_link_is_up(device_t dev, enum ntb_speed *speed, enum ntb_width *width); -static int ntb_link_enable(device_t dev, enum ntb_speed speed, +static int intel_ntb_link_enable(device_t dev, enum ntb_speed speed, enum ntb_width width); -static int ntb_link_disable(device_t dev); -static int ntb_spad_read(device_t dev, unsigned int idx, uint32_t *val); -static int ntb_peer_spad_write(device_t dev, unsigned int idx, uint32_t val); +static int intel_ntb_link_disable(device_t dev); +static int intel_ntb_spad_read(device_t dev, unsigned int idx, uint32_t *val); +static int intel_ntb_peer_spad_write(device_t dev, unsigned int idx, uint32_t val); -static unsigned ntb_user_mw_to_idx(struct ntb_softc *, unsigned uidx); -static inline enum ntb_bar ntb_mw_to_bar(struct ntb_softc *, unsigned mw); +static unsigned intel_ntb_user_mw_to_idx(struct ntb_softc *, unsigned uidx); +static inline enum ntb_bar intel_ntb_mw_to_bar(struct ntb_softc *, unsigned mw); static inline bool bar_is_64bit(struct ntb_softc *, enum ntb_bar); static inline void bar_get_xlat_params(struct ntb_softc *, enum ntb_bar, uint32_t *base, uint32_t *xlat, uint32_t *lmt); -static int ntb_map_pci_bars(struct ntb_softc *ntb); -static int ntb_mw_set_wc_internal(struct ntb_softc *, unsigned idx, +static int intel_ntb_map_pci_bars(struct ntb_softc *ntb); +static int intel_ntb_mw_set_wc_internal(struct ntb_softc *, unsigned idx, vm_memattr_t); static void print_map_success(struct ntb_softc *, struct ntb_pci_bar_info *, const char *); static int map_mmr_bar(struct ntb_softc *ntb, struct ntb_pci_bar_info *bar); static int map_memory_window_bar(struct ntb_softc *ntb, struct ntb_pci_bar_info *bar); -static void ntb_unmap_pci_bar(struct ntb_softc *ntb); -static int ntb_remap_msix(device_t, uint32_t desired, uint32_t avail); -static int ntb_init_isr(struct ntb_softc *ntb); -static int ntb_setup_legacy_interrupt(struct ntb_softc *ntb); -static int ntb_setup_msix(struct ntb_softc *ntb, uint32_t num_vectors); -static void ntb_teardown_interrupts(struct ntb_softc *ntb); -static inline uint64_t ntb_vec_mask(struct ntb_softc *, uint64_t db_vector); -static void ntb_interrupt(struct ntb_softc *, uint32_t vec); +static void intel_ntb_unmap_pci_bar(struct ntb_softc *ntb); +static int intel_ntb_remap_msix(device_t, uint32_t desired, uint32_t avail); +static int intel_ntb_init_isr(struct ntb_softc *ntb); +static int intel_ntb_setup_legacy_interrupt(struct ntb_softc *ntb); +static int intel_ntb_setup_msix(struct ntb_softc *ntb, uint32_t num_vectors); +static void intel_ntb_teardown_interrupts(struct ntb_softc *ntb); +static inline uint64_t intel_ntb_vec_mask(struct ntb_softc *, uint64_t db_vector); +static void intel_ntb_interrupt(struct ntb_softc *, uint32_t vec); static void ndev_vec_isr(void *arg); static void ndev_irq_isr(void *arg); static inline uint64_t db_ioread(struct ntb_softc *, uint64_t regoff); static inline void db_iowrite(struct ntb_softc *, uint64_t regoff, uint64_t); static inline void db_iowrite_raw(struct ntb_softc *, uint64_t regoff, uint64_t); -static int ntb_create_msix_vec(struct ntb_softc *ntb, uint32_t num_vectors); -static void ntb_free_msix_vec(struct ntb_softc *ntb); -static void ntb_get_msix_info(struct ntb_softc *ntb); -static void ntb_exchange_msix(void *); -static struct ntb_hw_info *ntb_get_device_info(uint32_t device_id); -static void ntb_detect_max_mw(struct ntb_softc *ntb); -static int ntb_detect_xeon(struct ntb_softc *ntb); -static int ntb_detect_atom(struct ntb_softc *ntb); -static int ntb_xeon_init_dev(struct ntb_softc *ntb); -static int ntb_atom_init_dev(struct ntb_softc *ntb); -static void ntb_teardown_xeon(struct ntb_softc *ntb); +static int intel_ntb_create_msix_vec(struct ntb_softc *ntb, uint32_t num_vectors); +static void intel_ntb_free_msix_vec(struct ntb_softc *ntb); +static void intel_ntb_get_msix_info(struct ntb_softc *ntb); +static void intel_ntb_exchange_msix(void *); +static struct ntb_hw_info *intel_ntb_get_device_info(uint32_t device_id); +static void intel_ntb_detect_max_mw(struct ntb_softc *ntb); +static int intel_ntb_detect_xeon(struct ntb_softc *ntb); +static int intel_ntb_detect_atom(struct ntb_softc *ntb); +static int intel_ntb_xeon_init_dev(struct ntb_softc *ntb); +static int intel_ntb_atom_init_dev(struct ntb_softc *ntb); +static void intel_ntb_teardown_xeon(struct ntb_softc *ntb); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 18 09:35:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5F6BBBD32D; Thu, 18 Aug 2016 09:35:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A055C17F8; Thu, 18 Aug 2016 09:35:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9ZVsU098758; Thu, 18 Aug 2016 09:35:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9ZV3Z098752; Thu, 18 Aug 2016 09:35:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180935.u7I9ZV3Z098752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304368 - in stable/11: share/man/man4 sys/dev/ntb sys/dev/ntb/if_ntb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:35:32 -0000 Author: mav Date: Thu Aug 18 09:35:31 2016 New Revision: 304368 URL: https://svnweb.freebsd.org/changeset/base/304368 Log: MFC r303494: Once more refactor KPI between ntb_transport(4) and if_ntb(4). New design allows to attach multiple consumers to ntb_transport(4) instance. Previous design obtained from Linux theoretically allowed that, but was not practically usable (Linux also has only one consumer driver now). Modified: stable/11/share/man/man4/if_ntb.4 stable/11/share/man/man4/ntb_transport.4 stable/11/sys/dev/ntb/if_ntb/if_ntb.c stable/11/sys/dev/ntb/ntb_transport.c stable/11/sys/dev/ntb/ntb_transport.h Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/if_ntb.4 ============================================================================== --- stable/11/share/man/man4/if_ntb.4 Thu Aug 18 09:34:39 2016 (r304367) +++ stable/11/share/man/man4/if_ntb.4 Thu Aug 18 09:35:31 2016 (r304368) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2016 +.Dd July 29, 2016 .Dt IF_NTB 4 .Os .Sh NAME @@ -49,7 +49,7 @@ The following tunables are settable from .Bl -ohang .It Va hw.if_ntb.num_queues Number of transport queues to use per interface. -Default is 1. +Default is unlimited. .El .Sh DESCRIPTION The @@ -84,3 +84,6 @@ Later improvements were done by .An Conrad E. Meyer Aq Mt cem@FreeBSD.org and .An Alexander Motin Aq Mt mav@FreeBSD.org . +.Sh BUGS +Linux supports only one queue per interface, so manual configuration +may be required for compatibility. Modified: stable/11/share/man/man4/ntb_transport.4 ============================================================================== --- stable/11/share/man/man4/ntb_transport.4 Thu Aug 18 09:34:39 2016 (r304367) +++ stable/11/share/man/man4/ntb_transport.4 Thu Aug 18 09:35:31 2016 (r304368) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2016 +.Dd July 29, 2016 .Dt NTB_TRANSPORT 4 .Os .Sh NAME @@ -44,10 +44,15 @@ The following tunables are settable from .It Va hw.ntb_transport.debug_level Driver debug level. The default value is 0, higher means more verbose. -.It Va hw.ntb_transport.max_num_clients -Number of bidirectional queues to setup. -The default value is 0, that means one queue per available memory window. -Maximal number is limited by number of doorbells. +.It Va hint.ntb_transport. Ns Ar X Ns Va .config +Configures queues allocation for consumer devices, separated by commas. +Each device can be configured as: "[:]", where: +.Va name +is a name of the driver which should attach the device (empty means any), +.Va queues +is a number of queues to allocate (empty means automatic), +The default configuration is empty string, which means single device +with one queue per memory window allowing any driver attachment. .El .Sh DESCRIPTION The Modified: stable/11/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:34:39 2016 (r304367) +++ stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:35:31 2016 (r304368) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); static SYSCTL_NODE(_hw, OID_AUTO, if_ntb, CTLFLAG_RW, 0, "if_ntb"); -static unsigned g_if_ntb_num_queues = 1; +static unsigned g_if_ntb_num_queues = UINT_MAX; SYSCTL_UINT(_hw_if_ntb, OID_AUTO, num_queues, CTLFLAG_RWTUN, &g_if_ntb_num_queues, 0, "Number of queues per interface"); @@ -144,7 +144,8 @@ ntb_net_attach(device_t dev) if_initname(ifp, device_get_name(dev), device_get_unit(dev)); if_setdev(ifp, dev); - sc->num_queues = g_if_ntb_num_queues; + sc->num_queues = min(g_if_ntb_num_queues, + ntb_transport_queue_count(dev)); sc->queues = malloc(sc->num_queues * sizeof(struct ntb_net_queue), M_DEVBUF, M_WAITOK | M_ZERO); sc->mtu = INT_MAX; @@ -152,8 +153,7 @@ ntb_net_attach(device_t dev) q = &sc->queues[i]; q->sc = sc; q->ifp = ifp; - q->qp = ntb_transport_create_queue(q, - device_get_parent(dev), &handlers); + q->qp = ntb_transport_create_queue(dev, i, &handlers, q); if (q->qp == NULL) break; sc->mtu = imin(sc->mtu, ntb_transport_max_size(q->qp)); @@ -167,6 +167,7 @@ ntb_net_attach(device_t dev) callout_init(&q->queue_full, 1); } sc->num_queues = i; + device_printf(dev, "%d queue(s)\n", sc->num_queues); if_setinitfn(ifp, ntb_net_init); if_setsoftc(ifp, sc); Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:34:39 2016 (r304367) +++ stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:35:31 2016 (r304368) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -64,13 +63,6 @@ __FBSDID("$FreeBSD$"); #include "ntb.h" #include "ntb_transport.h" -#define QP_SETSIZE 64 -BITSET_DEFINE(_qpset, QP_SETSIZE); -#define test_bit(pos, addr) BIT_ISSET(QP_SETSIZE, (pos), (addr)) -#define set_bit(pos, addr) BIT_SET(QP_SETSIZE, (pos), (addr)) -#define clear_bit(pos, addr) BIT_CLR(QP_SETSIZE, (pos), (addr)) -#define ffs_bit(addr) BIT_FFS(QP_SETSIZE, (addr)) - #define KTR_NTB KTR_SPARE3 #define NTB_TRANSPORT_VERSION 4 @@ -94,12 +86,6 @@ SYSCTL_UQUAD(_hw_ntb_transport, OID_AUTO "If enabled (non-zero), limit the size of large memory windows. " "Both sides of the NTB MUST set the same value here."); -static unsigned max_num_clients; -SYSCTL_UINT(_hw_ntb_transport, OID_AUTO, max_num_clients, CTLFLAG_RDTUN, - &max_num_clients, 0, "Maximum number of NTB transport clients. " - "0 (default) - use all available NTB memory windows; " - "positive integer N - Limit to N memory windows."); - static unsigned enable_xeon_watchdog; SYSCTL_UINT(_hw_ntb_transport, OID_AUTO, enable_xeon_watchdog, CTLFLAG_RDTUN, &enable_xeon_watchdog, 0, "If non-zero, write a register every second to " @@ -200,14 +186,21 @@ struct ntb_transport_mw { bus_addr_t dma_addr; }; +struct ntb_transport_child { + device_t dev; + int qpoff; + int qpcnt; + struct ntb_transport_child *next; +}; + struct ntb_transport_ctx { device_t dev; + struct ntb_transport_child *child; struct ntb_transport_mw *mw_vec; struct ntb_transport_qp *qp_vec; - struct _qpset qp_bitmap; - struct _qpset qp_bitmap_free; unsigned mw_count; unsigned qp_count; + uint64_t qp_bitmap; volatile bool link_is_up; struct callout link_work; struct callout link_watchdog; @@ -242,7 +235,6 @@ enum { NTBT_MW0_SZ_LOW, NTBT_MW1_SZ_HIGH, NTBT_MW1_SZ_LOW, - NTBT_MAX_SPAD, /* * Some NTB-using hardware have a watchdog to work around NTB hangs; if @@ -332,13 +324,44 @@ static int ntb_transport_attach(device_t dev) { struct ntb_transport_ctx *nt = device_get_softc(dev); + struct ntb_transport_child **cpp = &nt->child; + struct ntb_transport_child *nc; struct ntb_transport_mw *mw; - uint64_t qp_bitmap; - int rc; - unsigned i; + uint64_t db_bitmap; + int rc, i, db_count, spad_count, qp, qpu, qpo, qpt; + char cfg[128] = ""; + char buf[32]; + char *n, *np, *c, *name; nt->dev = dev; nt->mw_count = ntb_mw_count(dev); + spad_count = ntb_spad_count(dev); + db_bitmap = ntb_db_valid_mask(dev); + db_count = flsll(db_bitmap); + KASSERT(db_bitmap == (1 << db_count) - 1, + ("Doorbells are not sequential (%jx).\n", db_bitmap)); + + device_printf(dev, "%d memory windows, %d scratchpads, " + "%d doorbells\n", nt->mw_count, spad_count, db_count); + + if (nt->mw_count == 0) { + device_printf(dev, "At least 1 memory window required.\n"); + return (ENXIO); + } + if (spad_count < 6) { + device_printf(dev, "At least 6 scratchpads required.\n"); + return (ENXIO); + } + if (spad_count < 4 + 2 * nt->mw_count) { + nt->mw_count = (spad_count - 4) / 2; + device_printf(dev, "Scratchpads enough only for %d " + "memory windows.\n", nt->mw_count); + } + if (db_bitmap == 0) { + device_printf(dev, "At least one doorbell required.\n"); + return (ENXIO); + } + nt->mw_vec = malloc(nt->mw_count * sizeof(*nt->mw_vec), M_NTB_T, M_WAITOK | M_ZERO); for (i = 0; i < nt->mw_count; i++) { @@ -360,25 +383,59 @@ ntb_transport_attach(device_t dev) ntb_printf(0, "Unable to set mw%d caching\n", i); } - qp_bitmap = ntb_db_valid_mask(dev); - nt->qp_count = flsll(qp_bitmap); - KASSERT(nt->qp_count != 0, ("bogus db bitmap")); - nt->qp_count -= 1; - - if (max_num_clients != 0 && max_num_clients < nt->qp_count) - nt->qp_count = max_num_clients; - else if (nt->mw_count < nt->qp_count) - nt->qp_count = nt->mw_count; - KASSERT(nt->qp_count <= QP_SETSIZE, ("invalid qp_count")); + qpu = 0; + qpo = imin(db_count, nt->mw_count); + qpt = db_count; + + snprintf(buf, sizeof(buf), "hint.%s.%d.config", device_get_name(dev), + device_get_unit(dev)); + TUNABLE_STR_FETCH(buf, cfg, sizeof(cfg)); + n = cfg; + i = 0; + while ((c = strsep(&n, ",")) != NULL) { + np = c; + name = strsep(&np, ":"); + if (name != NULL && name[0] == 0) + name = NULL; + qp = (np && np[0] != 0) ? strtol(np, NULL, 10) : qpo - qpu; + if (qp <= 0) + qp = 1; + + if (qp > qpt - qpu) { + device_printf(dev, "Not enough resources for config\n"); + break; + } + + nc = malloc(sizeof(*nc), M_DEVBUF, M_WAITOK | M_ZERO); + nc->qpoff = qpu; + nc->qpcnt = qp; + nc->dev = device_add_child(dev, name, -1); + if (nc->dev == NULL) { + device_printf(dev, "Can not add child.\n"); + break; + } + device_set_ivars(nc->dev, nc); + *cpp = nc; + cpp = &nc->next; + + if (bootverbose) { + device_printf(dev, "%d \"%s\": queues %d", + i, name, qpu); + if (qp > 1) + printf("-%d", qpu + qp - 1); + printf("\n"); + } + + qpu += qp; + i++; + } + nt->qp_count = qpu; nt->qp_vec = malloc(nt->qp_count * sizeof(*nt->qp_vec), M_NTB_T, M_WAITOK | M_ZERO); - for (i = 0; i < nt->qp_count; i++) { - set_bit(i, &nt->qp_bitmap); - set_bit(i, &nt->qp_bitmap_free); + for (i = 0; i < nt->qp_count; i++) ntb_transport_init_queue(nt, i); - } callout_init(&nt->link_work, 0); callout_init(&nt->link_watchdog, 0); @@ -394,10 +451,7 @@ ntb_transport_attach(device_t dev) if (enable_xeon_watchdog != 0) callout_reset(&nt->link_watchdog, 0, xeon_link_watchdog_hb, nt); - /* Attach children to this transport */ - device_add_child(dev, NULL, -1); bus_generic_attach(dev); - return (0); err: @@ -410,25 +464,25 @@ static int ntb_transport_detach(device_t dev) { struct ntb_transport_ctx *nt = device_get_softc(dev); - struct _qpset qp_bitmap_alloc; - uint8_t i; - - /* Detach & delete all children */ - device_delete_children(dev); + struct ntb_transport_child **cpp = &nt->child; + struct ntb_transport_child *nc; + int error = 0, i; + + while ((nc = *cpp) != NULL) { + *cpp = (*cpp)->next; + error = device_delete_child(dev, nc->dev); + if (error) + break; + free(nc, M_DEVBUF); + } + KASSERT(nt->qp_bitmap == 0, + ("Some queues not freed on detach (%jx)", nt->qp_bitmap)); ntb_transport_link_cleanup(nt); taskqueue_drain(taskqueue_swi, &nt->link_cleanup); callout_drain(&nt->link_work); callout_drain(&nt->link_watchdog); - BIT_COPY(QP_SETSIZE, &nt->qp_bitmap, &qp_bitmap_alloc); - BIT_NAND(QP_SETSIZE, &qp_bitmap_alloc, &nt->qp_bitmap_free); - - /* Verify that all the QPs are freed */ - for (i = 0; i < nt->qp_count; i++) - if (test_bit(i, &qp_bitmap_alloc)) - ntb_transport_free_queue(&nt->qp_vec[i]); - ntb_link_disable(dev); ntb_clear_ctx(dev); @@ -440,6 +494,14 @@ ntb_transport_detach(device_t dev) return (0); } +int +ntb_transport_queue_count(device_t dev) +{ + struct ntb_transport_child *nc = device_get_ivars(dev); + + return (nc->qpcnt); +} + static void ntb_transport_init_queue(struct ntb_transport_ctx *nt, unsigned int qp_num) { @@ -507,6 +569,7 @@ ntb_transport_init_queue(struct ntb_tran void ntb_transport_free_queue(struct ntb_transport_qp *qp) { + struct ntb_transport_ctx *nt = qp->transport; struct ntb_queue_entry *entry; if (qp == NULL) @@ -532,7 +595,7 @@ ntb_transport_free_queue(struct ntb_tran while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) free(entry, M_NTB_T); - set_bit(qp->qp_num, &qp->transport->qp_bitmap_free); + nt->qp_bitmap &= ~(1 << qp->qp_num); } /** @@ -550,24 +613,20 @@ ntb_transport_free_queue(struct ntb_tran * RETURNS: pointer to newly created ntb_queue, NULL on error. */ struct ntb_transport_qp * -ntb_transport_create_queue(void *data, device_t dev, - const struct ntb_queue_handlers *handlers) +ntb_transport_create_queue(device_t dev, int q, + const struct ntb_queue_handlers *handlers, void *data) { - struct ntb_transport_ctx *nt = device_get_softc(dev); + struct ntb_transport_child *nc = device_get_ivars(dev); + struct ntb_transport_ctx *nt = device_get_softc(device_get_parent(dev)); struct ntb_queue_entry *entry; struct ntb_transport_qp *qp; - unsigned int free_queue; int i; - free_queue = ffs_bit(&nt->qp_bitmap_free); - if (free_queue == 0) + if (q < 0 || q >= nc->qpcnt) return (NULL); - /* decrement free_queue to make it zero based */ - free_queue--; - - qp = &nt->qp_vec[free_queue]; - clear_bit(qp->qp_num, &nt->qp_bitmap_free); + qp = &nt->qp_vec[nc->qpoff + q]; + nt->qp_bitmap |= (1 << qp->qp_num); qp->cb_data = data; qp->rx_handler = handlers->rx_handler; qp->tx_handler = handlers->tx_handler; @@ -944,24 +1003,19 @@ ntb_transport_doorbell_callback(void *da { struct ntb_transport_ctx *nt = data; struct ntb_transport_qp *qp; - struct _qpset db_bits; uint64_t vec_mask; unsigned qp_num; - BIT_COPY(QP_SETSIZE, &nt->qp_bitmap, &db_bits); - BIT_NAND(QP_SETSIZE, &db_bits, &nt->qp_bitmap_free); - vec_mask = ntb_db_vector_mask(nt->dev, vector); + vec_mask &= nt->qp_bitmap; if ((vec_mask & (vec_mask - 1)) != 0) vec_mask &= ntb_db_read(nt->dev); while (vec_mask != 0) { qp_num = ffsll(vec_mask) - 1; - if (test_bit(qp_num, &db_bits)) { - qp = &nt->qp_vec[qp_num]; - if (qp->link_is_up) - taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); - } + qp = &nt->qp_vec[qp_num]; + if (qp->link_is_up) + taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); vec_mask &= ~(1ull << qp_num); } @@ -1219,19 +1273,16 @@ static void ntb_transport_link_cleanup(struct ntb_transport_ctx *nt) { struct ntb_transport_qp *qp; - struct _qpset qp_bitmap_alloc; - unsigned i; - - BIT_COPY(QP_SETSIZE, &nt->qp_bitmap, &qp_bitmap_alloc); - BIT_NAND(QP_SETSIZE, &qp_bitmap_alloc, &nt->qp_bitmap_free); + int i; /* Pass along the info to any clients */ - for (i = 0; i < nt->qp_count; i++) - if (test_bit(i, &qp_bitmap_alloc)) { + for (i = 0; i < nt->qp_count; i++) { + if ((nt->qp_bitmap & (1 << i)) != 0) { qp = &nt->qp_vec[i]; ntb_qp_link_cleanup(qp); callout_drain(&qp->link_work); } + } if (!nt->link_is_up) callout_drain(&nt->link_work); @@ -1241,8 +1292,7 @@ ntb_transport_link_cleanup(struct ntb_tr * goes down, blast them now to give them a sane value the next * time they are accessed */ - for (i = 0; i < NTBT_MAX_SPAD; i++) - ntb_spad_write(nt->dev, i, 0); + ntb_spad_clear(nt->dev); } static void Modified: stable/11/sys/dev/ntb/ntb_transport.h ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.h Thu Aug 18 09:34:39 2016 (r304367) +++ stable/11/sys/dev/ntb/ntb_transport.h Thu Aug 18 09:35:31 2016 (r304368) @@ -43,12 +43,13 @@ struct ntb_queue_handlers { void (*event_handler)(void *data, enum ntb_link_event status); }; -unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp); -unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp); +int ntb_transport_queue_count(device_t dev); struct ntb_transport_qp * -ntb_transport_create_queue(void *data, device_t dev, - const struct ntb_queue_handlers *handlers); +ntb_transport_create_queue(device_t dev, int q, + const struct ntb_queue_handlers *handlers, void *data); void ntb_transport_free_queue(struct ntb_transport_qp *qp); +unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp); +unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp); int ntb_transport_rx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data, unsigned int len); int ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data, From owner-svn-src-all@freebsd.org Thu Aug 18 09:36:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A650BBD385; Thu, 18 Aug 2016 09:36:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AE921964; Thu, 18 Aug 2016 09:36:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9a6BQ098834; Thu, 18 Aug 2016 09:36:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9a6oB098833; Thu, 18 Aug 2016 09:36:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180936.u7I9a6oB098833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304369 - stable/11/sys/dev/ntb/ntb_hw X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:36:07 -0000 Author: mav Date: Thu Aug 18 09:36:06 2016 New Revision: 304369 URL: https://svnweb.freebsd.org/changeset/base/304369 Log: MFC r303510: Clear scratchpad after MSIX negotiation to not leak garbage. Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:35:31 2016 (r304368) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:36:06 2016 (r304369) @@ -2649,6 +2649,7 @@ msix_done: if (val != NTB_MSIX_RECEIVED) goto reschedule; + intel_ntb_spad_clear(ntb->device); ntb->peer_msix_good = true; /* Give peer time to see our NTB_MSIX_RECEIVED. */ goto reschedule; From owner-svn-src-all@freebsd.org Thu Aug 18 09:36:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47FF7BBD46D; Thu, 18 Aug 2016 09:36:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 234771B86; Thu, 18 Aug 2016 09:36:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9ajpl098912; Thu, 18 Aug 2016 09:36:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9ajJ6098911; Thu, 18 Aug 2016 09:36:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180936.u7I9ajJ6098911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304370 - stable/11/sys/dev/ntb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:36:46 -0000 Author: mav Date: Thu Aug 18 09:36:45 2016 New Revision: 304370 URL: https://svnweb.freebsd.org/changeset/base/304370 Log: MFC r303514: Fix NTBT_QP_LINKS negotiation. I believe it never worked correctly for more the one queue even in Linux. This fixes case when one of consumer drivers is not loaded on one side, but its queues still announced as ready if something else brought link up. While there, remove some pointless NULL checks. Modified: stable/11/sys/dev/ntb/ntb_transport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:36:06 2016 (r304369) +++ stable/11/sys/dev/ntb/ntb_transport.c Thu Aug 18 09:36:45 2016 (r304370) @@ -572,9 +572,6 @@ ntb_transport_free_queue(struct ntb_tran struct ntb_transport_ctx *nt = qp->transport; struct ntb_queue_entry *entry; - if (qp == NULL) - return; - callout_drain(&qp->link_work); ntb_db_set_mask(qp->dev, 1ull << qp->qp_num); @@ -694,7 +691,7 @@ ntb_transport_tx_enqueue(struct ntb_tran struct ntb_queue_entry *entry; int rc; - if (qp == NULL || !qp->link_is_up || len == 0) { + if (!qp->link_is_up || len == 0) { CTR0(KTR_NTB, "TX: link not up"); return (EINVAL); } @@ -1059,11 +1056,9 @@ ntb_transport_link_work(void *arg) size >> 32); ntb_peer_spad_write(dev, NTBT_MW0_SZ_LOW + (i * 2), size); } - ntb_peer_spad_write(dev, NTBT_NUM_MWS, nt->mw_count); - ntb_peer_spad_write(dev, NTBT_NUM_QPS, nt->qp_count); - + ntb_peer_spad_write(dev, NTBT_QP_LINKS, 0); ntb_peer_spad_write(dev, NTBT_VERSION, NTB_TRANSPORT_VERSION); /* Query the remote side for its info */ @@ -1245,16 +1240,18 @@ ntb_qp_link_work(void *arg) struct ntb_transport_qp *qp = arg; device_t dev = qp->dev; struct ntb_transport_ctx *nt = qp->transport; - uint32_t val, dummy; - - ntb_spad_read(dev, NTBT_QP_LINKS, &val); - - ntb_peer_spad_write(dev, NTBT_QP_LINKS, val | (1ull << qp->qp_num)); + int i; + uint32_t val; - /* query remote spad for qp ready bits */ - ntb_peer_spad_read(dev, NTBT_QP_LINKS, &dummy); + /* Report queues that are up on our side */ + for (i = 0, val = 0; i < nt->qp_count; i++) { + if (nt->qp_vec[i].client_ready) + val |= (1 << i); + } + ntb_peer_spad_write(dev, NTBT_QP_LINKS, val); /* See if the remote side is up */ + ntb_spad_read(dev, NTBT_QP_LINKS, &val); if ((val & (1ull << qp->qp_num)) != 0) { ntb_printf(2, "qp %d link up\n", qp->qp_num); qp->link_is_up = true; @@ -1350,17 +1347,16 @@ ntb_qp_link_cleanup(struct ntb_transport void ntb_transport_link_down(struct ntb_transport_qp *qp) { + struct ntb_transport_ctx *nt = qp->transport; + int i; uint32_t val; - if (qp == NULL) - return; - qp->client_ready = false; - - ntb_spad_read(qp->dev, NTBT_QP_LINKS, &val); - - ntb_peer_spad_write(qp->dev, NTBT_QP_LINKS, - val & ~(1 << qp->qp_num)); + for (i = 0, val = 0; i < nt->qp_count; i++) { + if (nt->qp_vec[i].client_ready) + val |= (1 << i); + } + ntb_peer_spad_write(qp->dev, NTBT_QP_LINKS, val); if (qp->link_is_up) ntb_send_link_down(qp); @@ -1379,8 +1375,6 @@ ntb_transport_link_down(struct ntb_trans bool ntb_transport_link_query(struct ntb_transport_qp *qp) { - if (qp == NULL) - return (false); return (qp->link_is_up); } @@ -1479,8 +1473,6 @@ out: */ unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp) { - if (qp == NULL) - return 0; return (qp->qp_num); } @@ -1497,9 +1489,6 @@ unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp) { - if (qp == NULL) - return (0); - return (qp->tx_max_frame - sizeof(struct ntb_payload_header)); } From owner-svn-src-all@freebsd.org Thu Aug 18 09:37:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DD0FBBD572; Thu, 18 Aug 2016 09:37:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D49851D27; Thu, 18 Aug 2016 09:37:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9bSGv098995; Thu, 18 Aug 2016 09:37:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9bSPS098994; Thu, 18 Aug 2016 09:37:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180937.u7I9bSPS098994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304371 - stable/11/sys/dev/ntb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:37:29 -0000 Author: mav Date: Thu Aug 18 09:37:27 2016 New Revision: 304371 URL: https://svnweb.freebsd.org/changeset/base/304371 Log: MFC r303551: Fix infinite loops introduced at r303429. Modified: stable/11/sys/dev/ntb/ntb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb.c ============================================================================== --- stable/11/sys/dev/ntb/ntb.c Thu Aug 18 09:36:45 2016 (r304370) +++ stable/11/sys/dev/ntb/ntb.c Thu Aug 18 09:37:27 2016 (r304371) @@ -206,7 +206,7 @@ ntb_link_enable(device_t ntb, enum ntb_s struct ntb_child **cpp = device_get_softc(device_get_parent(nc->dev)); struct ntb_child *nc1; - for (nc1 = *cpp; nc1 != NULL; nc1 = nc->next) { + for (nc1 = *cpp; nc1 != NULL; nc1 = nc1->next) { if (nc1->enabled) { nc->enabled = 1; return (0); @@ -226,7 +226,7 @@ ntb_link_disable(device_t ntb) if (!nc->enabled) return (0); nc->enabled = 0; - for (nc1 = *cpp; nc1 != NULL; nc1 = nc->next) { + for (nc1 = *cpp; nc1 != NULL; nc1 = nc1->next) { if (nc1->enabled) return (0); } From owner-svn-src-all@freebsd.org Thu Aug 18 09:38:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65589BBD5D4; Thu, 18 Aug 2016 09:38:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35F481E80; Thu, 18 Aug 2016 09:38:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9c1lv099072; Thu, 18 Aug 2016 09:38:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9c1c7099071; Thu, 18 Aug 2016 09:38:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180938.u7I9c1c7099071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304372 - stable/11/sys/dev/ntb/if_ntb X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:38:02 -0000 Author: mav Date: Thu Aug 18 09:38:01 2016 New Revision: 304372 URL: https://svnweb.freebsd.org/changeset/base/304372 Log: MFC r303553: Make MAC address generation more random. 'ticks' approach does not work at boot time. Modified: stable/11/sys/dev/ntb/if_ntb/if_ntb.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:37:27 2016 (r304371) +++ stable/11/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 09:38:01 2016 (r304372) @@ -493,10 +493,9 @@ static void create_random_local_eui48(u_char *eaddr) { static uint8_t counter = 0; - uint32_t seed = ticks; eaddr[0] = EUI48_LOCALLY_ADMINISTERED; - memcpy(&eaddr[1], &seed, sizeof(uint32_t)); + arc4rand(&eaddr[1], 4, 0); eaddr[5] = counter++; } From owner-svn-src-all@freebsd.org Thu Aug 18 09:39:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3438BBBD680; Thu, 18 Aug 2016 09:39:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0297C1186; Thu, 18 Aug 2016 09:39:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7I9dkXB099177; Thu, 18 Aug 2016 09:39:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7I9dkli099176; Thu, 18 Aug 2016 09:39:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608180939.u7I9dkli099176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 09:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304373 - stable/11/sys/dev/ntb/ntb_hw X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:39:47 -0000 Author: mav Date: Thu Aug 18 09:39:45 2016 New Revision: 304373 URL: https://svnweb.freebsd.org/changeset/base/304373 Log: MFC r303554, r303561: Block MSIX negotiation until SMP started and IRQ reshuffled. Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:38:01 2016 (r304372) +++ stable/11/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 09:39:45 2016 (r304373) @@ -2605,6 +2605,19 @@ intel_ntb_user_mw_to_idx(struct ntb_soft return (uidx); } +#ifndef EARLY_AP_STARTUP +static int msix_ready; + +static void +intel_ntb_msix_ready(void *arg __unused) +{ + + msix_ready = 1; +} +SYSINIT(intel_ntb_msix_ready, SI_SUB_SMP, SI_ORDER_ANY, + intel_ntb_msix_ready, NULL); +#endif + static void intel_ntb_exchange_msix(void *ctx) { @@ -2619,6 +2632,12 @@ intel_ntb_exchange_msix(void *ctx) if (ntb->peer_msix_done) goto msix_done; +#ifndef EARLY_AP_STARTUP + /* Block MSIX negotiation until SMP started and IRQ reshuffled. */ + if (!msix_ready) + goto reschedule; +#endif + intel_ntb_get_msix_info(ntb); for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { intel_ntb_peer_spad_write(ntb->device, NTB_MSIX_DATA0 + i, From owner-svn-src-all@freebsd.org Thu Aug 18 09:52:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6766EBBDC74; Thu, 18 Aug 2016 09:52:17 +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 2F6791BB0; Thu, 18 Aug 2016 09:52:16 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 407982384; Thu, 18 Aug 2016 09:52:10 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id CB73E8F4E; Thu, 18 Aug 2016 11:50:43 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> Date: Thu, 18 Aug 2016 11:50:43 +0200 In-Reply-To: (Nathan Whitehorn's message of "Wed, 17 Aug 2016 09:30:10 -0700") Message-ID: <86fuq24d8s.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 09:52:17 -0000 Nathan Whitehorn writes: > OK. In which configurations? My Dell servers, for instance, don't do > this. How are they set up? What drivers are being used? Is this > something that affects passthrough disks, RAIDs, disk images? Most LSI MegaRAID controllers don't have real passthrough, only JBOD. You can query the drive with "camcontrol identify passX", but the controller does not report a stripe size for the volume (mfidY). > The point is that *if the reported stripe size is wrong*, more things > than partition alignment in the installer will suffer for it. It's not wrong, it's non-existent, and I'm getting really tired of repeating myself. > Fixing the installer with a bandaid in the run-up to a release is > fine, but *we need to fix the underlying problem*. We can't, because hardware sucks, and I'm getting really tired of repeating myself. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@freebsd.org Thu Aug 18 10:18:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAC29BBE713; Thu, 18 Aug 2016 10:18:12 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7B99E1D88; Thu, 18 Aug 2016 10:18:12 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAIBSx014784; Thu, 18 Aug 2016 10:18:11 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAIBnL014783; Thu, 18 Aug 2016 10:18:11 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608181018.u7IAIBnL014783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 18 Aug 2016 10:18:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304374 - head/usr.bin/calendar/calendars/ru_RU.UTF-8 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:18:12 -0000 Author: ache Date: Thu Aug 18 10:18:11 2016 New Revision: 304374 URL: https://svnweb.freebsd.org/changeset/base/304374 Log: Fix TAB replaced with spaces in prev. commit. Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Modified: head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan ============================================================================== --- head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Thu Aug 18 09:39:45 2016 (r304373) +++ head/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Thu Aug 18 10:18:11 2016 (r304374) @@ -35,7 +35,7 @@ Paskha=ПаÑха 14 Ñент. День Волха Змеевича 22 Ñент.* Поворот к зиме (оÑеннее равноденÑтвие) 10 ноÑб. День Макоши -21 ноÑб. День Сварога и Семаргла +21 ноÑб. День Сварога и Семаргла 9 дек. День Дажьбога и Марены #endif /* !_ru_RU_UTF_8_pagan_ */ From owner-svn-src-all@freebsd.org Thu Aug 18 10:23:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6B6BBBE920; Thu, 18 Aug 2016 10:23:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85C3D1341; Thu, 18 Aug 2016 10:23:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IANp9R018309; Thu, 18 Aug 2016 10:23:51 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IANpZI018308; Thu, 18 Aug 2016 10:23:51 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181023.u7IANpZI018308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304375 - stable/10/sys/dev/ntb/if_ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:23:52 -0000 Author: mav Date: Thu Aug 18 10:23:51 2016 New Revision: 304375 URL: https://svnweb.freebsd.org/changeset/base/304375 Log: MFC r302014: Fix if_ntb interface setup to include IFF_MULTICAST. This allows IPv6 link local addresses (and other IPv6 functionality) to work. Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 10:18:11 2016 (r304374) +++ stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 10:23:51 2016 (r304375) @@ -432,7 +432,7 @@ ntb_setup_interface(void) &handlers); ifp->if_init = ntb_net_init; ifp->if_softc = &net_softc; - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ntb_ioctl; ifp->if_start = ntb_start; IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); From owner-svn-src-all@freebsd.org Thu Aug 18 10:24:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7B2CBBE986; Thu, 18 Aug 2016 10:24:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B42111513; Thu, 18 Aug 2016 10:24:32 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAOVYL018388; Thu, 18 Aug 2016 10:24:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAOVjg018387; Thu, 18 Aug 2016 10:24:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181024.u7IAOVjg018387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304376 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:24:33 -0000 Author: mav Date: Thu Aug 18 10:24:31 2016 New Revision: 304376 URL: https://svnweb.freebsd.org/changeset/base/304376 Log: MFC r302482: Fix NTB_SDOORBELL_LOCKUP workaround. Since SBARxSZ register can be write-once, it can be unusable for disabling the SBAR. For such case also set SBARxBASE to zero to not intersect with config BAR. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:23:51 2016 (r304375) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:24:31 2016 (r304376) @@ -1688,8 +1688,12 @@ xeon_set_sbar_base_and_limit(struct ntb_ uint32_t base_reg, lmt_reg; bar_get_xlat_params(ntb, idx, &base_reg, NULL, &lmt_reg); - if (idx == regbar) - bar_addr += ntb->b2b_off; + if (idx == regbar) { + if (ntb->b2b_off) + bar_addr += ntb->b2b_off; + else + bar_addr = 0; + } /* * Set limit registers first to avoid an errata where setting the base From owner-svn-src-all@freebsd.org Thu Aug 18 10:25:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57F31BBEA86; Thu, 18 Aug 2016 10:25:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F00E16AD; Thu, 18 Aug 2016 10:25:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAP7tw018471; Thu, 18 Aug 2016 10:25:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAP7XO018470; Thu, 18 Aug 2016 10:25:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181025.u7IAP7XO018470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:25:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304377 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:25:08 -0000 Author: mav Date: Thu Aug 18 10:25:07 2016 New Revision: 304377 URL: https://svnweb.freebsd.org/changeset/base/304377 Log: MFC r302483: Remove some dead code found by Clang static analyzer. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:24:31 2016 (r304376) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:25:07 2016 (r304377) @@ -1366,8 +1366,6 @@ ntb_get_msix_info(struct ntb_softc *ntb) dinfo = device_get_ivars(ntb->device); msix = &dinfo->cfg.msix; - laddr = data = 0; - CTASSERT(XEON_NONLINK_DB_MSIX_BITS == nitems(ntb->msix_data)); for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { @@ -2606,13 +2604,10 @@ ntb_sysctl_init(struct ntb_softc *ntb) static int sysctl_handle_features(SYSCTL_HANDLER_ARGS) { - struct ntb_softc *ntb; + struct ntb_softc *ntb = arg1; struct sbuf sb; int error; - error = 0; - ntb = arg1; - sbuf_new_for_sysctl(&sb, NULL, 256, req); sbuf_printf(&sb, "%b", ntb->features, NTB_FEATURES_STR); @@ -2627,13 +2622,10 @@ sysctl_handle_features(SYSCTL_HANDLER_AR static int sysctl_handle_link_admin(SYSCTL_HANDLER_ARGS) { - struct ntb_softc *ntb; + struct ntb_softc *ntb = arg1; unsigned old, new; int error; - error = 0; - ntb = arg1; - old = ntb_link_enabled(ntb); error = SYSCTL_OUT(req, &old, sizeof(old)); @@ -2657,15 +2649,12 @@ sysctl_handle_link_admin(SYSCTL_HANDLER_ static int sysctl_handle_link_status_human(SYSCTL_HANDLER_ARGS) { - struct ntb_softc *ntb; + struct ntb_softc *ntb = arg1; struct sbuf sb; enum ntb_speed speed; enum ntb_width width; int error; - error = 0; - ntb = arg1; - sbuf_new_for_sysctl(&sb, NULL, 32, req); if (ntb_link_is_up(ntb, &speed, &width)) @@ -2685,13 +2674,10 @@ sysctl_handle_link_status_human(SYSCTL_H static int sysctl_handle_link_status(SYSCTL_HANDLER_ARGS) { - struct ntb_softc *ntb; + struct ntb_softc *ntb = arg1; unsigned res; int error; - error = 0; - ntb = arg1; - res = ntb_link_is_up(ntb, NULL, NULL); error = SYSCTL_OUT(req, &res, sizeof(res)); From owner-svn-src-all@freebsd.org Thu Aug 18 10:26:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DB04BBEAE6; Thu, 18 Aug 2016 10:26:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EBCF1843; Thu, 18 Aug 2016 10:26:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAQFT6018562; Thu, 18 Aug 2016 10:26:15 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAQFjG018561; Thu, 18 Aug 2016 10:26:15 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201608181026.u7IAQFjG018561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 18 Aug 2016 10:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304378 - head/sys/netpfil/ipfw/nat64 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:26:16 -0000 Author: bz Date: Thu Aug 18 10:26:15 2016 New Revision: 304378 URL: https://svnweb.freebsd.org/changeset/base/304378 Log: Try to fix gcc compilation errors (which are right). nat64_getlasthdr() returns an int, which can be -1 in case of error, storing the result in an uint8_t and then comparing to < 0 is not helpful. Do what is done in the rest of the code and make proto an int here as well. Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c Modified: head/sys/netpfil/ipfw/nat64/nat64_translate.c ============================================================================== --- head/sys/netpfil/ipfw/nat64/nat64_translate.c Thu Aug 18 10:25:07 2016 (r304377) +++ head/sys/netpfil/ipfw/nat64/nat64_translate.c Thu Aug 18 10:26:15 2016 (r304378) @@ -1415,8 +1415,7 @@ nat64_do_handle_ip6(struct mbuf *m, uint struct sockaddr *dst; uint16_t *csum; uint32_t mtu; - int plen, hlen; - uint8_t proto; + int plen, hlen, proto; /* * XXX: we expect ipfw_chk() did m_pullup() up to upper level From owner-svn-src-all@freebsd.org Thu Aug 18 10:37:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 492CFBBEDBB; Thu, 18 Aug 2016 10:37:22 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 112C31E2E; Thu, 18 Aug 2016 10:37:21 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAbLiR022257; Thu, 18 Aug 2016 10:37:21 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAbLie022256; Thu, 18 Aug 2016 10:37:21 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201608181037.u7IAbLie022256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Thu, 18 Aug 2016 10:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304379 - stable/11/usr.bin/calendar/calendars/ru_RU.UTF-8 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:37:22 -0000 Author: ache Date: Thu Aug 18 10:37:20 2016 New Revision: 304379 URL: https://svnweb.freebsd.org/changeset/base/304379 Log: MFC r304374 Fix TAB replaced with spaces in prev. commit. Modified: stable/11/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan ============================================================================== --- stable/11/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Thu Aug 18 10:26:15 2016 (r304378) +++ stable/11/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan Thu Aug 18 10:37:20 2016 (r304379) @@ -35,7 +35,7 @@ Paskha=ПаÑха 14 Ñент. День Волха Змеевича 22 Ñент.* Поворот к зиме (оÑеннее равноденÑтвие) 10 ноÑб. День Макоши -21 ноÑб. День Сварога и Семаргла +21 ноÑб. День Сварога и Семаргла 9 дек. День Дажьбога и Марены #endif /* !_ru_RU_UTF_8_pagan_ */ From owner-svn-src-all@freebsd.org Thu Aug 18 10:39:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBEA3BBEE4E; Thu, 18 Aug 2016 10:39:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A574E1177; Thu, 18 Aug 2016 10:39:01 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAd0At022360; Thu, 18 Aug 2016 10:39:00 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAd0DZ022356; Thu, 18 Aug 2016 10:39:00 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181039.u7IAd0DZ022356@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304380 - in stable/10/sys: conf dev/ntb dev/ntb/if_ntb dev/ntb/ntb_hw modules/ntb modules/ntb/ntb modules/ntb/ntb_hw modules/ntb/ntb_transport X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:39:02 -0000 Author: mav Date: Thu Aug 18 10:39:00 2016 New Revision: 304380 URL: https://svnweb.freebsd.org/changeset/base/304380 Log: MFC r302484: NewBus'ify NTB subsystem. This follows NTB subsystem modularization in Linux, tuning it to FreeBSD native NewBus interfaces. This change allows to support different types of hardware with different drivers, support multiple NTB instances in a system, ntb_transport module use for needs other then if_ntb, etc. Sponsored by: iXsystems, Inc. Added: stable/10/sys/dev/ntb/ntb.c - copied, changed from r302484, head/sys/dev/ntb/ntb.c stable/10/sys/dev/ntb/ntb.h - copied unchanged from r302484, head/sys/dev/ntb/ntb.h stable/10/sys/dev/ntb/ntb_if.m - copied unchanged from r302484, head/sys/dev/ntb/ntb_if.m stable/10/sys/dev/ntb/ntb_transport.c - copied, changed from r302484, head/sys/dev/ntb/ntb_transport.c stable/10/sys/dev/ntb/ntb_transport.h - copied unchanged from r302484, head/sys/dev/ntb/ntb_transport.h stable/10/sys/modules/ntb/ntb/ - copied from r302484, head/sys/modules/ntb/ntb/ stable/10/sys/modules/ntb/ntb_transport/ - copied from r302484, head/sys/modules/ntb/ntb_transport/ Deleted: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.h Modified: stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/dev/ntb/if_ntb/if_ntb.c stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c stable/10/sys/dev/ntb/ntb_hw/ntb_regs.h stable/10/sys/modules/ntb/Makefile stable/10/sys/modules/ntb/ntb/Makefile stable/10/sys/modules/ntb/ntb_hw/Makefile stable/10/sys/modules/ntb/ntb_transport/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.amd64 ============================================================================== --- stable/10/sys/conf/files.amd64 Thu Aug 18 10:37:20 2016 (r304379) +++ stable/10/sys/conf/files.amd64 Thu Aug 18 10:39:00 2016 (r304380) @@ -285,7 +285,10 @@ dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb -dev/ntb/ntb_hw/ntb_hw.c optional if_ntb ntb_hw +dev/ntb/ntb_transport.c optional if_ntb +dev/ntb/ntb.c optional if_ntb | ntb_hw +dev/ntb/ntb_if.m optional if_ntb | ntb_hw +dev/ntb/ntb_hw/ntb_hw.c optional ntb_hw dev/nvd/nvd.c optional nvd nvme dev/nve/if_nve.c optional nve pci dev/nvme/nvme.c optional nvme Modified: stable/10/sys/conf/files.i386 ============================================================================== --- stable/10/sys/conf/files.i386 Thu Aug 18 10:37:20 2016 (r304379) +++ stable/10/sys/conf/files.i386 Thu Aug 18 10:39:00 2016 (r304380) @@ -281,7 +281,10 @@ dev/mse/mse.c optional mse dev/mse/mse_isa.c optional mse isa dev/nfe/if_nfe.c optional nfe pci dev/ntb/if_ntb/if_ntb.c optional if_ntb -dev/ntb/ntb_hw/ntb_hw.c optional if_ntb | ntb_hw +dev/ntb/ntb_transport.c optional if_ntb +dev/ntb/ntb.c optional if_ntb | ntb_hw +dev/ntb/ntb_if.m optional if_ntb | ntb_hw +dev/ntb/ntb_hw/ntb_hw.c optional ntb_hw dev/nvd/nvd.c optional nvd nvme dev/nve/if_nve.c optional nve pci dev/nvme/nvme.c optional nvme Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 10:37:20 2016 (r304379) +++ stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 10:39:00 2016 (r304380) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2016 Alexander Motin * Copyright (C) 2013 Intel Corporation * Copyright (C) 2015 EMC Corporation * All rights reserved. @@ -25,25 +26,28 @@ * SUCH DAMAGE. */ +/* + * The Non-Transparent Bridge (NTB) is a device that allows you to connect + * two or more systems using a PCI-e links, providing remote memory access. + * + * This module contains a driver for simulated Ethernet device, using + * underlying NTB Transport device. + * + * NOTE: Much of the code in this module is shared with Linux. Any patches may + * be picked up and redistributed in Linux with a dual GPL/BSD license. + */ + #include __FBSDID("$FreeBSD$"); #include #include #include -#include #include -#include #include -#include -#include #include -#include -#include #include #include -#include -#include #include #include @@ -52,254 +56,24 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include - #include -#include -#include - -#include -#include -#include "../ntb_hw/ntb_hw.h" - -/* - * The Non-Transparent Bridge (NTB) is a device on some Intel processors that - * allows you to connect two systems using a PCI-e link. - * - * This module contains a protocol for sending and receiving messages, and - * exposes that protocol through a simulated ethernet device called ntb. - * - * NOTE: Much of the code in this module is shared with Linux. Any patches may - * be picked up and redistributed in Linux with a dual GPL/BSD license. - */ - -#define QP_SETSIZE 64 -BITSET_DEFINE(_qpset, QP_SETSIZE); -#define test_bit(pos, addr) BIT_ISSET(QP_SETSIZE, (pos), (addr)) -#define set_bit(pos, addr) BIT_SET(QP_SETSIZE, (pos), (addr)) -#define clear_bit(pos, addr) BIT_CLR(QP_SETSIZE, (pos), (addr)) -#define ffs_bit(addr) BIT_FFS(QP_SETSIZE, (addr)) +#include "../ntb_transport.h" #define KTR_NTB KTR_SPARE3 -#define NTB_TRANSPORT_VERSION 4 -#define NTB_RX_MAX_PKTS 64 -#define NTB_RXQ_SIZE 300 - -enum ntb_link_event { - NTB_LINK_DOWN = 0, - NTB_LINK_UP, -}; - -static SYSCTL_NODE(_hw, OID_AUTO, if_ntb, CTLFLAG_RW, 0, "if_ntb"); - -static unsigned g_if_ntb_debug_level; -TUNABLE_INT("hw.if_ntb.debug_level", &g_if_ntb_debug_level); -SYSCTL_UINT(_hw_if_ntb, OID_AUTO, debug_level, CTLFLAG_RWTUN, - &g_if_ntb_debug_level, 0, "if_ntb log level -- higher is more verbose"); -#define ntb_printf(lvl, ...) do { \ - if ((lvl) <= g_if_ntb_debug_level) { \ - if_printf(nt->ifp, __VA_ARGS__); \ - } \ -} while (0) - -static unsigned transport_mtu = IP_MAXPACKET + ETHER_HDR_LEN + ETHER_CRC_LEN; - -static uint64_t max_mw_size; -TUNABLE_QUAD("hw.if_ntb.max_mw_size", &max_mw_size); -SYSCTL_UQUAD(_hw_if_ntb, OID_AUTO, max_mw_size, CTLFLAG_RDTUN, &max_mw_size, 0, - "If enabled (non-zero), limit the size of large memory windows. " - "Both sides of the NTB MUST set the same value here."); - -static unsigned max_num_clients; -TUNABLE_INT("hw.if_ntb.max_num_clients", &max_num_clients); -SYSCTL_UINT(_hw_if_ntb, OID_AUTO, max_num_clients, CTLFLAG_RDTUN, - &max_num_clients, 0, "Maximum number of NTB transport clients. " - "0 (default) - use all available NTB memory windows; " - "positive integer N - Limit to N memory windows."); - -static unsigned enable_xeon_watchdog; -TUNABLE_INT("hw.if_ntb.enable_xeon_watchdog", &enable_xeon_watchdog); -SYSCTL_UINT(_hw_if_ntb, OID_AUTO, enable_xeon_watchdog, CTLFLAG_RDTUN, - &enable_xeon_watchdog, 0, "If non-zero, write a register every second to " - "keep a watchdog from tearing down the NTB link"); - -STAILQ_HEAD(ntb_queue_list, ntb_queue_entry); - -typedef uint32_t ntb_q_idx_t; - -struct ntb_queue_entry { - /* ntb_queue list reference */ - STAILQ_ENTRY(ntb_queue_entry) entry; - - /* info on data to be transferred */ - void *cb_data; - void *buf; - uint32_t len; - uint32_t flags; - - struct ntb_transport_qp *qp; - struct ntb_payload_header *x_hdr; - ntb_q_idx_t index; -}; - -struct ntb_rx_info { - ntb_q_idx_t entry; -}; - -struct ntb_transport_qp { - struct ntb_transport_ctx *transport; - struct ntb_softc *ntb; - - void *cb_data; - - bool client_ready; - volatile bool link_is_up; - uint8_t qp_num; /* Only 64 QPs are allowed. 0-63 */ - - struct ntb_rx_info *rx_info; - struct ntb_rx_info *remote_rx_info; - - void (*tx_handler)(struct ntb_transport_qp *qp, void *qp_data, - void *data, int len); - struct ntb_queue_list tx_free_q; - struct mtx ntb_tx_free_q_lock; - caddr_t tx_mw; - bus_addr_t tx_mw_phys; - ntb_q_idx_t tx_index; - ntb_q_idx_t tx_max_entry; - uint64_t tx_max_frame; - - void (*rx_handler)(struct ntb_transport_qp *qp, void *qp_data, - void *data, int len); - struct ntb_queue_list rx_post_q; - struct ntb_queue_list rx_pend_q; - /* ntb_rx_q_lock: synchronize access to rx_XXXX_q */ - struct mtx ntb_rx_q_lock; - struct task rx_completion_task; - struct task rxc_db_work; - caddr_t rx_buff; - ntb_q_idx_t rx_index; - ntb_q_idx_t rx_max_entry; - uint64_t rx_max_frame; - - void (*event_handler)(void *data, enum ntb_link_event status); - struct callout link_work; - struct callout queue_full; - struct callout rx_full; - - uint64_t last_rx_no_buf; - - /* Stats */ - uint64_t rx_bytes; - uint64_t rx_pkts; - uint64_t rx_ring_empty; - uint64_t rx_err_no_buf; - uint64_t rx_err_oflow; - uint64_t rx_err_ver; - uint64_t tx_bytes; - uint64_t tx_pkts; - uint64_t tx_ring_full; - uint64_t tx_err_no_buf; -}; - -struct ntb_queue_handlers { - void (*rx_handler)(struct ntb_transport_qp *qp, void *qp_data, - void *data, int len); - void (*tx_handler)(struct ntb_transport_qp *qp, void *qp_data, - void *data, int len); - void (*event_handler)(void *data, enum ntb_link_event status); -}; - -struct ntb_transport_mw { - vm_paddr_t phys_addr; - size_t phys_size; - size_t xlat_align; - size_t xlat_align_size; - bus_addr_t addr_limit; - /* Tx buff is off vbase / phys_addr */ - caddr_t vbase; - size_t xlat_size; - size_t buff_size; - /* Rx buff is off virt_addr / dma_addr */ - caddr_t virt_addr; - bus_addr_t dma_addr; -}; - -struct ntb_transport_ctx { - struct ntb_softc *ntb; +struct ntb_net_ctx { + device_t *dev; struct ifnet *ifp; - struct ntb_transport_mw mw_vec[NTB_MAX_NUM_MW]; - struct ntb_transport_qp *qp_vec; - struct _qpset qp_bitmap; - struct _qpset qp_bitmap_free; - unsigned mw_count; - unsigned qp_count; - volatile bool link_is_up; - struct callout link_work; - struct callout link_watchdog; - struct task link_cleanup; - uint64_t bufsize; + struct ntb_transport_qp *qp; u_char eaddr[ETHER_ADDR_LEN]; struct mtx tx_lock; - struct mtx rx_lock; - - /* The hardcoded single queuepair in ntb_setup_interface() */ - struct ntb_transport_qp *qp; -}; - -static struct ntb_transport_ctx net_softc; - -enum { - IF_NTB_DESC_DONE_FLAG = 1 << 0, - IF_NTB_LINK_DOWN_FLAG = 1 << 1, -}; - -struct ntb_payload_header { - ntb_q_idx_t ver; - uint32_t len; - uint32_t flags; -}; - -enum { - /* - * The order of this enum is part of the if_ntb remote protocol. Do - * not reorder without bumping protocol version (and it's probably best - * to keep the protocol in lock-step with the Linux NTB driver. - */ - IF_NTB_VERSION = 0, - IF_NTB_QP_LINKS, - IF_NTB_NUM_QPS, - IF_NTB_NUM_MWS, - /* - * N.B.: transport_link_work assumes MW1 enums = MW0 + 2. - */ - IF_NTB_MW0_SZ_HIGH, - IF_NTB_MW0_SZ_LOW, - IF_NTB_MW1_SZ_HIGH, - IF_NTB_MW1_SZ_LOW, - IF_NTB_MAX_SPAD, - - /* - * Some NTB-using hardware have a watchdog to work around NTB hangs; if - * a register or doorbell isn't written every few seconds, the link is - * torn down. Write an otherwise unused register every few seconds to - * work around this watchdog. - */ - IF_NTB_WATCHDOG_SPAD = 15 + struct callout queue_full; }; -CTASSERT(IF_NTB_WATCHDOG_SPAD < XEON_SPAD_COUNT && - IF_NTB_WATCHDOG_SPAD < ATOM_SPAD_COUNT); -#define QP_TO_MW(nt, qp) ((qp) % nt->mw_count) -#define NTB_QP_DEF_NUM_ENTRIES 100 -#define NTB_LINK_DOWN_TIMEOUT 10 - -static int ntb_handle_module_events(struct module *m, int what, void *arg); -static int ntb_setup_interface(void); -static int ntb_teardown_interface(void); +static int ntb_net_probe(device_t dev); +static int ntb_net_attach(device_t dev); +static int ntb_net_detach(device_t dev); static void ntb_net_init(void *arg); static int ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data); static void ntb_start(struct ifnet *ifp); @@ -308,165 +82,72 @@ static void ntb_net_tx_handler(struct nt static void ntb_net_rx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); static void ntb_net_event_handler(void *data, enum ntb_link_event status); -static int ntb_transport_probe(struct ntb_softc *ntb); -static void ntb_transport_free(struct ntb_transport_ctx *); -static void ntb_transport_init_queue(struct ntb_transport_ctx *nt, - unsigned int qp_num); -static void ntb_transport_free_queue(struct ntb_transport_qp *qp); -static struct ntb_transport_qp *ntb_transport_create_queue(void *data, - struct ntb_softc *pdev, const struct ntb_queue_handlers *handlers); -static void ntb_transport_link_up(struct ntb_transport_qp *qp); -static int ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, - void *data, unsigned int len); -static int ntb_process_tx(struct ntb_transport_qp *qp, - struct ntb_queue_entry *entry); -static void ntb_memcpy_tx(struct ntb_transport_qp *qp, - struct ntb_queue_entry *entry, void *offset); static void ntb_qp_full(void *arg); -static void ntb_transport_rxc_db(void *arg, int pending); -static int ntb_process_rxc(struct ntb_transport_qp *qp); -static void ntb_memcpy_rx(struct ntb_transport_qp *qp, - struct ntb_queue_entry *entry, void *offset); -static inline void ntb_rx_copy_callback(struct ntb_transport_qp *qp, - void *data); -static void ntb_complete_rxc(void *arg, int pending); -static void ntb_transport_doorbell_callback(void *data, uint32_t vector); -static void ntb_transport_event_callback(void *data); -static void ntb_transport_link_work(void *arg); -static int ntb_set_mw(struct ntb_transport_ctx *, int num_mw, size_t size); -static void ntb_free_mw(struct ntb_transport_ctx *nt, int num_mw); -static int ntb_transport_setup_qp_mw(struct ntb_transport_ctx *nt, - unsigned int qp_num); -static void ntb_qp_link_work(void *arg); -static void ntb_transport_link_cleanup(struct ntb_transport_ctx *nt); -static void ntb_transport_link_cleanup_work(void *, int); -static void ntb_qp_link_down(struct ntb_transport_qp *qp); -static void ntb_qp_link_down_reset(struct ntb_transport_qp *qp); -static void ntb_qp_link_cleanup(struct ntb_transport_qp *qp); -static void ntb_transport_link_down(struct ntb_transport_qp *qp); -static void ntb_send_link_down(struct ntb_transport_qp *qp); -static void ntb_list_add(struct mtx *lock, struct ntb_queue_entry *entry, - struct ntb_queue_list *list); -static struct ntb_queue_entry *ntb_list_rm(struct mtx *lock, - struct ntb_queue_list *list); -static struct ntb_queue_entry *ntb_list_mv(struct mtx *lock, - struct ntb_queue_list *from, struct ntb_queue_list *to); static void create_random_local_eui48(u_char *eaddr); -static unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp); -static void xeon_link_watchdog_hb(void *); - -static const struct ntb_ctx_ops ntb_transport_ops = { - .link_event = ntb_transport_event_callback, - .db_event = ntb_transport_doorbell_callback, -}; - -MALLOC_DEFINE(M_NTB_IF, "if_ntb", "ntb network driver"); - -static inline void -iowrite32(uint32_t val, void *addr) -{ - - bus_space_write_4(X86_BUS_SPACE_MEM, 0/* HACK */, (uintptr_t)addr, - val); -} -/* Module setup and teardown */ static int -ntb_handle_module_events(struct module *m, int what, void *arg) +ntb_net_probe(device_t dev) { - int err = 0; - switch (what) { - case MOD_LOAD: - err = ntb_setup_interface(); - break; - case MOD_UNLOAD: - err = ntb_teardown_interface(); - break; - default: - err = EOPNOTSUPP; - break; - } - return (err); + device_set_desc(dev, "NTB Network Interface"); + return (0); } -static moduledata_t if_ntb_mod = { - "if_ntb", - ntb_handle_module_events, - NULL -}; - -DECLARE_MODULE(if_ntb, if_ntb_mod, SI_SUB_KLD, SI_ORDER_ANY); -MODULE_DEPEND(if_ntb, ntb_hw, 1, 1, 1); - static int -ntb_setup_interface(void) +ntb_net_attach(device_t dev) { + struct ntb_net_ctx *sc = device_get_softc(dev); struct ifnet *ifp; struct ntb_queue_handlers handlers = { ntb_net_rx_handler, ntb_net_tx_handler, ntb_net_event_handler }; - int rc; - net_softc.ntb = devclass_get_softc(devclass_find("ntb_hw"), 0); - if (net_softc.ntb == NULL) { - printf("ntb: Cannot find devclass\n"); - return (ENXIO); - } - - ifp = net_softc.ifp = if_alloc(IFT_ETHER); + ifp = sc->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { - ntb_transport_free(&net_softc); printf("ntb: Cannot allocate ifnet structure\n"); return (ENOMEM); } - if_initname(ifp, "ntb", 0); + if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - rc = ntb_transport_probe(net_softc.ntb); - if (rc != 0) { - printf("ntb: Cannot init transport: %d\n", rc); - if_free(net_softc.ifp); - return (rc); - } + mtx_init(&sc->tx_lock, "ntb tx", NULL, MTX_DEF); + callout_init(&sc->queue_full, 1); - net_softc.qp = ntb_transport_create_queue(ifp, net_softc.ntb, + sc->qp = ntb_transport_create_queue(ifp, device_get_parent(dev), &handlers); ifp->if_init = ntb_net_init; - ifp->if_softc = &net_softc; + ifp->if_softc = sc; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = ntb_ioctl; ifp->if_start = ntb_start; IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; IFQ_SET_READY(&ifp->if_snd); - create_random_local_eui48(net_softc.eaddr); - ether_ifattach(ifp, net_softc.eaddr); + create_random_local_eui48(sc->eaddr); + ether_ifattach(ifp, sc->eaddr); ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_JUMBO_MTU; ifp->if_capenable = ifp->if_capabilities; - ifp->if_mtu = ntb_transport_max_size(net_softc.qp) - ETHER_HDR_LEN - + ifp->if_mtu = ntb_transport_max_size(sc->qp) - ETHER_HDR_LEN - ETHER_CRC_LEN; - ntb_transport_link_up(net_softc.qp); - net_softc.bufsize = ntb_transport_max_size(net_softc.qp) + - sizeof(struct ether_header); + ntb_transport_link_up(sc->qp); return (0); } static int -ntb_teardown_interface(void) +ntb_net_detach(device_t dev) { + struct ntb_net_ctx *sc = device_get_softc(dev); - if (net_softc.qp != NULL) { - ntb_transport_link_down(net_softc.qp); - - ntb_transport_free_queue(net_softc.qp); - ntb_transport_free(&net_softc); + if (sc->qp != NULL) { + ntb_transport_link_down(sc->qp); + ntb_transport_free_queue(sc->qp); } - if (net_softc.ifp != NULL) { - ether_ifdetach(net_softc.ifp); - if_free(net_softc.ifp); - net_softc.ifp = NULL; + if (sc->ifp != NULL) { + ether_ifdetach(sc->ifp); + if_free(sc->ifp); + sc->ifp = NULL; } + mtx_destroy(&sc->tx_lock); return (0); } @@ -476,8 +157,8 @@ ntb_teardown_interface(void) static void ntb_net_init(void *arg) { - struct ntb_transport_ctx *ntb_softc = arg; - struct ifnet *ifp = ntb_softc->ifp; + struct ntb_net_ctx *sc = arg; + struct ifnet *ifp = sc->ifp; ifp->if_drv_flags |= IFF_DRV_RUNNING; ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; @@ -488,14 +169,14 @@ ntb_net_init(void *arg) static int ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { - struct ntb_transport_ctx *nt = ifp->if_softc; + struct ntb_net_ctx *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; int error = 0; switch (command) { case SIOCSIFMTU: { - if (ifr->ifr_mtu > ntb_transport_max_size(nt->qp) - + if (ifr->ifr_mtu > ntb_transport_max_size(sc->qp) - ETHER_HDR_LEN - ETHER_CRC_LEN) { error = EINVAL; break; @@ -517,16 +198,16 @@ static void ntb_start(struct ifnet *ifp) { struct mbuf *m_head; - struct ntb_transport_ctx *nt = ifp->if_softc; + struct ntb_net_ctx *sc = ifp->if_softc; int rc; - mtx_lock(&nt->tx_lock); + mtx_lock(&sc->tx_lock); ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; CTR0(KTR_NTB, "TX: ntb_start"); while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); CTR1(KTR_NTB, "TX: start mbuf %p", m_head); - rc = ntb_transport_tx_enqueue(nt->qp, m_head, m_head, + rc = ntb_transport_tx_enqueue(sc->qp, m_head, m_head, m_length(m_head, NULL)); if (rc != 0) { CTR1(KTR_NTB, @@ -535,14 +216,13 @@ ntb_start(struct ifnet *ifp) if (rc == EAGAIN) { ifp->if_drv_flags |= IFF_DRV_OACTIVE; IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - callout_reset(&nt->qp->queue_full, hz / 1000, + callout_reset(&sc->queue_full, hz / 1000, ntb_qp_full, ifp); } break; } - } - mtx_unlock(&nt->tx_lock); + mtx_unlock(&sc->tx_lock); } /* Network Device Callbacks */ @@ -563,6 +243,7 @@ ntb_net_rx_handler(struct ntb_transport_ struct ifnet *ifp = qp_data; CTR0(KTR_NTB, "RX: rx handler"); + m->m_pkthdr.csum_flags = CSUM_IP_CHECKED | CSUM_IP_VALID; (*ifp->if_input)(ifp, m); } @@ -586,444 +267,6 @@ ntb_net_event_handler(void *data, enum n } } -/* Transport Init and teardown */ - -static void -xeon_link_watchdog_hb(void *arg) -{ - struct ntb_transport_ctx *nt; - - nt = arg; - ntb_spad_write(nt->ntb, IF_NTB_WATCHDOG_SPAD, 0); - callout_reset(&nt->link_watchdog, 1 * hz, xeon_link_watchdog_hb, nt); -} - -static int -ntb_transport_probe(struct ntb_softc *ntb) -{ - struct ntb_transport_ctx *nt = &net_softc; - struct ntb_transport_mw *mw; - uint64_t qp_bitmap; - int rc; - unsigned i; - - nt->mw_count = ntb_mw_count(ntb); - for (i = 0; i < nt->mw_count; i++) { - mw = &nt->mw_vec[i]; - - rc = ntb_mw_get_range(ntb, i, &mw->phys_addr, &mw->vbase, - &mw->phys_size, &mw->xlat_align, &mw->xlat_align_size, - &mw->addr_limit); - if (rc != 0) - goto err; - - mw->buff_size = 0; - mw->xlat_size = 0; - mw->virt_addr = NULL; - mw->dma_addr = 0; - - rc = ntb_mw_set_wc(nt->ntb, i, VM_MEMATTR_WRITE_COMBINING); - if (rc) - ntb_printf(0, "Unable to set mw%d caching\n", i); - } - - qp_bitmap = ntb_db_valid_mask(ntb); - nt->qp_count = flsll(qp_bitmap); - KASSERT(nt->qp_count != 0, ("bogus db bitmap")); - nt->qp_count -= 1; - - if (max_num_clients != 0 && max_num_clients < nt->qp_count) - nt->qp_count = max_num_clients; - else if (nt->mw_count < nt->qp_count) - nt->qp_count = nt->mw_count; - KASSERT(nt->qp_count <= QP_SETSIZE, ("invalid qp_count")); - - mtx_init(&nt->tx_lock, "ntb transport tx", NULL, MTX_DEF); - mtx_init(&nt->rx_lock, "ntb transport rx", NULL, MTX_DEF); - - nt->qp_vec = malloc(nt->qp_count * sizeof(*nt->qp_vec), M_NTB_IF, - M_WAITOK | M_ZERO); - - for (i = 0; i < nt->qp_count; i++) { - set_bit(i, &nt->qp_bitmap); - set_bit(i, &nt->qp_bitmap_free); - ntb_transport_init_queue(nt, i); - } - - callout_init(&nt->link_work, 0); - callout_init(&nt->link_watchdog, 0); - TASK_INIT(&nt->link_cleanup, 0, ntb_transport_link_cleanup_work, nt); - - rc = ntb_set_ctx(ntb, nt, &ntb_transport_ops); - if (rc != 0) - goto err; - - nt->link_is_up = false; - ntb_link_enable(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); - ntb_link_event(ntb); - - callout_reset(&nt->link_work, 0, ntb_transport_link_work, nt); - if (enable_xeon_watchdog != 0) - callout_reset(&nt->link_watchdog, 0, xeon_link_watchdog_hb, nt); - return (0); - -err: - free(nt->qp_vec, M_NTB_IF); - nt->qp_vec = NULL; - return (rc); -} - -static void -ntb_transport_free(struct ntb_transport_ctx *nt) -{ - struct ntb_softc *ntb = nt->ntb; - struct _qpset qp_bitmap_alloc; - uint8_t i; - - ntb_transport_link_cleanup(nt); - taskqueue_drain(taskqueue_swi, &nt->link_cleanup); - callout_drain(&nt->link_work); - callout_drain(&nt->link_watchdog); - - BIT_COPY(QP_SETSIZE, &nt->qp_bitmap, &qp_bitmap_alloc); - BIT_NAND(QP_SETSIZE, &qp_bitmap_alloc, &nt->qp_bitmap_free); - - /* Verify that all the QPs are freed */ - for (i = 0; i < nt->qp_count; i++) - if (test_bit(i, &qp_bitmap_alloc)) - ntb_transport_free_queue(&nt->qp_vec[i]); - - ntb_link_disable(ntb); - ntb_clear_ctx(ntb); - - for (i = 0; i < nt->mw_count; i++) - ntb_free_mw(nt, i); - - free(nt->qp_vec, M_NTB_IF); -} - -static void -ntb_transport_init_queue(struct ntb_transport_ctx *nt, unsigned int qp_num) -{ - struct ntb_transport_mw *mw; - struct ntb_transport_qp *qp; - vm_paddr_t mw_base; - uint64_t mw_size, qp_offset; - size_t tx_size; - unsigned num_qps_mw, mw_num, mw_count; - - mw_count = nt->mw_count; - mw_num = QP_TO_MW(nt, qp_num); - mw = &nt->mw_vec[mw_num]; - - qp = &nt->qp_vec[qp_num]; - qp->qp_num = qp_num; - qp->transport = nt; - qp->ntb = nt->ntb; - qp->client_ready = false; - qp->event_handler = NULL; - ntb_qp_link_down_reset(qp); - - if (nt->qp_count % mw_count && mw_num + 1 < nt->qp_count / mw_count) - num_qps_mw = nt->qp_count / mw_count + 1; - else - num_qps_mw = nt->qp_count / mw_count; - - mw_base = mw->phys_addr; - mw_size = mw->phys_size; - - tx_size = mw_size / num_qps_mw; - qp_offset = tx_size * (qp_num / mw_count); - - qp->tx_mw = mw->vbase + qp_offset; - KASSERT(qp->tx_mw != NULL, ("uh oh?")); - - /* XXX Assumes that a vm_paddr_t is equivalent to bus_addr_t */ - qp->tx_mw_phys = mw_base + qp_offset; - KASSERT(qp->tx_mw_phys != 0, ("uh oh?")); - - tx_size -= sizeof(struct ntb_rx_info); - qp->rx_info = (void *)(qp->tx_mw + tx_size); - - /* Due to house-keeping, there must be at least 2 buffs */ - qp->tx_max_frame = qmin(tx_size / 2, - transport_mtu + sizeof(struct ntb_payload_header)); - qp->tx_max_entry = tx_size / qp->tx_max_frame; - - callout_init(&qp->link_work, 0); - callout_init(&qp->queue_full, CALLOUT_MPSAFE); - callout_init(&qp->rx_full, CALLOUT_MPSAFE); - - mtx_init(&qp->ntb_rx_q_lock, "ntb rx q", NULL, MTX_SPIN); - mtx_init(&qp->ntb_tx_free_q_lock, "ntb tx free q", NULL, MTX_SPIN); - TASK_INIT(&qp->rx_completion_task, 0, ntb_complete_rxc, qp); - TASK_INIT(&qp->rxc_db_work, 0, ntb_transport_rxc_db, qp); - - STAILQ_INIT(&qp->rx_post_q); - STAILQ_INIT(&qp->rx_pend_q); - STAILQ_INIT(&qp->tx_free_q); - - callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); -} - -static void -ntb_transport_free_queue(struct ntb_transport_qp *qp) -{ - struct ntb_queue_entry *entry; - - if (qp == NULL) - return; - - callout_drain(&qp->link_work); - - ntb_db_set_mask(qp->ntb, 1ull << qp->qp_num); - taskqueue_drain(taskqueue_swi, &qp->rxc_db_work); - taskqueue_drain(taskqueue_swi, &qp->rx_completion_task); - - qp->cb_data = NULL; - qp->rx_handler = NULL; - qp->tx_handler = NULL; - qp->event_handler = NULL; - - while ((entry = ntb_list_rm(&qp->ntb_rx_q_lock, &qp->rx_pend_q))) - free(entry, M_NTB_IF); - - while ((entry = ntb_list_rm(&qp->ntb_rx_q_lock, &qp->rx_post_q))) - free(entry, M_NTB_IF); - - while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) - free(entry, M_NTB_IF); - - set_bit(qp->qp_num, &qp->transport->qp_bitmap_free); -} - -/** - * ntb_transport_create_queue - Create a new NTB transport layer queue - * @rx_handler: receive callback function - * @tx_handler: transmit callback function - * @event_handler: event callback function - * - * Create a new NTB transport layer queue and provide the queue with a callback - * routine for both transmit and receive. The receive callback routine will be - * used to pass up data when the transport has received it on the queue. The - * transmit callback routine will be called when the transport has completed the - * transmission of the data on the queue and the data is ready to be freed. - * - * RETURNS: pointer to newly created ntb_queue, NULL on error. - */ -static struct ntb_transport_qp * -ntb_transport_create_queue(void *data, struct ntb_softc *ntb, - const struct ntb_queue_handlers *handlers) -{ - struct ntb_queue_entry *entry; - struct ntb_transport_qp *qp; - struct ntb_transport_ctx *nt; - unsigned int free_queue; - int i; - - nt = ntb_get_ctx(ntb, NULL); - KASSERT(nt != NULL, ("bogus")); - - free_queue = ffs_bit(&nt->qp_bitmap); - if (free_queue == 0) - return (NULL); - - /* decrement free_queue to make it zero based */ - free_queue--; - - qp = &nt->qp_vec[free_queue]; - clear_bit(qp->qp_num, &nt->qp_bitmap_free); - qp->cb_data = data; - qp->rx_handler = handlers->rx_handler; - qp->tx_handler = handlers->tx_handler; - qp->event_handler = handlers->event_handler; - - for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { - entry = malloc(sizeof(*entry), M_NTB_IF, M_WAITOK | M_ZERO); - entry->cb_data = nt->ifp; - entry->buf = NULL; - entry->len = transport_mtu; - ntb_list_add(&qp->ntb_rx_q_lock, entry, &qp->rx_pend_q); - } - - for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { - entry = malloc(sizeof(*entry), M_NTB_IF, M_WAITOK | M_ZERO); - ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); - } - - ntb_db_clear(ntb, 1ull << qp->qp_num); - ntb_db_clear_mask(ntb, 1ull << qp->qp_num); - return (qp); -} - -/** - * ntb_transport_link_up - Notify NTB transport of client readiness to use queue - * @qp: NTB transport layer queue to be enabled - * - * Notify NTB transport layer of client readiness to use queue - */ -static void -ntb_transport_link_up(struct ntb_transport_qp *qp) -{ - struct ntb_transport_ctx *nt; - - if (qp == NULL) - return; - - qp->client_ready = true; - - nt = qp->transport; - ntb_printf(2, "qp client ready\n"); - - if (qp->transport->link_is_up) - callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); -} - - - -/* Transport Tx */ - -/** - * ntb_transport_tx_enqueue - Enqueue a new NTB queue entry - * @qp: NTB transport layer queue the entry is to be enqueued on - * @cb: per buffer pointer for callback function to use - * @data: pointer to data buffer that will be sent - * @len: length of the data buffer - * - * Enqueue a new transmit buffer onto the transport queue from which a NTB - * payload will be transmitted. This assumes that a lock is being held to - * serialize access to the qp. - * - * RETURNS: An appropriate ERRNO error value on error, or zero for success. - */ -static int -ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data, - unsigned int len) -{ - struct ntb_queue_entry *entry; - int rc; - - if (qp == NULL || !qp->link_is_up || len == 0) { - CTR0(KTR_NTB, "TX: link not up"); - return (EINVAL); - } - - entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q); - if (entry == NULL) { - CTR0(KTR_NTB, "TX: could not get entry from tx_free_q"); - qp->tx_err_no_buf++; - return (EBUSY); - } - CTR1(KTR_NTB, "TX: got entry %p from tx_free_q", entry); - - entry->cb_data = cb; - entry->buf = data; - entry->len = len; - entry->flags = 0; - - rc = ntb_process_tx(qp, entry); - if (rc != 0) { - ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); - CTR1(KTR_NTB, - "TX: process_tx failed. Returning entry %p to tx_free_q", - entry); - } - return (rc); -} - -static int -ntb_process_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry) -{ - void *offset; - - offset = qp->tx_mw + qp->tx_max_frame * qp->tx_index; - CTR3(KTR_NTB, - "TX: process_tx: tx_pkts=%lu, tx_index=%u, remote entry=%u", - qp->tx_pkts, qp->tx_index, qp->remote_rx_info->entry); - if (qp->tx_index == qp->remote_rx_info->entry) { - CTR0(KTR_NTB, "TX: ring full"); - qp->tx_ring_full++; - return (EAGAIN); - } - - if (entry->len > qp->tx_max_frame - sizeof(struct ntb_payload_header)) { - if (qp->tx_handler != NULL) - qp->tx_handler(qp, qp->cb_data, entry->buf, - EIO); - else - m_freem(entry->buf); - - entry->buf = NULL; - ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); - CTR1(KTR_NTB, - "TX: frame too big. returning entry %p to tx_free_q", - entry); - return (0); - } - CTR2(KTR_NTB, "TX: copying entry %p to offset %p", entry, offset); - ntb_memcpy_tx(qp, entry, offset); - - qp->tx_index++; - qp->tx_index %= qp->tx_max_entry; - - qp->tx_pkts++; - - return (0); -} - -static void -ntb_memcpy_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry, - void *offset) -{ - struct ntb_payload_header *hdr; - - /* This piece is from Linux' ntb_async_tx() */ - hdr = (struct ntb_payload_header *)((char *)offset + qp->tx_max_frame - - sizeof(struct ntb_payload_header)); - entry->x_hdr = hdr; - iowrite32(entry->len, &hdr->len); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 18 10:39:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40C9ABBEEB3; Thu, 18 Aug 2016 10:39:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA3C012E4; Thu, 18 Aug 2016 10:39:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAdh0r022434; Thu, 18 Aug 2016 10:39:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAdhXP022433; Thu, 18 Aug 2016 10:39:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181039.u7IAdhXP022433@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304381 - stable/10/sys/dev/ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:39:44 -0000 Author: mav Date: Thu Aug 18 10:39:42 2016 New Revision: 304381 URL: https://svnweb.freebsd.org/changeset/base/304381 Log: MFC r302486: Fix operation with multiple qps. Modified: stable/10/sys/dev/ntb/ntb_transport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:39:00 2016 (r304380) +++ stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:39:42 2016 (r304381) @@ -474,7 +474,7 @@ ntb_transport_init_queue(struct ntb_tran qp->event_handler = NULL; ntb_qp_link_down_reset(qp); - if (nt->qp_count % mw_count && mw_num + 1 < nt->qp_count / mw_count) + if (mw_num < nt->qp_count % mw_count) num_qps_mw = nt->qp_count / mw_count + 1; else num_qps_mw = nt->qp_count / mw_count; @@ -571,7 +571,7 @@ ntb_transport_create_queue(void *data, d unsigned int free_queue; int i; - free_queue = ffs_bit(&nt->qp_bitmap); + free_queue = ffs_bit(&nt->qp_bitmap_free); if (free_queue == 0) return (NULL); @@ -616,7 +616,7 @@ ntb_transport_link_up(struct ntb_transpo qp->client_ready = true; - ntb_printf(2, "qp client ready\n"); + ntb_printf(2, "qp %d client ready\n", qp->qp_num); if (nt->link_is_up) callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); @@ -1165,7 +1165,7 @@ ntb_transport_setup_qp_mw(struct ntb_tra if (mw->virt_addr == NULL) return (ENOMEM); - if (nt->qp_count % mw_count && mw_num + 1 < nt->qp_count / mw_count) + if (mw_num < nt->qp_count % mw_count) num_qps_mw = nt->qp_count / mw_count + 1; else num_qps_mw = nt->qp_count / mw_count; @@ -1215,7 +1215,7 @@ ntb_qp_link_work(void *arg) /* See if the remote side is up */ if ((val & (1ull << qp->qp_num)) != 0) { - ntb_printf(2, "qp link up\n"); + ntb_printf(2, "qp %d link up\n", qp->qp_num); qp->link_is_up = true; if (qp->event_handler != NULL) From owner-svn-src-all@freebsd.org Thu Aug 18 10:40:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAB9EBBEF37; Thu, 18 Aug 2016 10:40:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 988EE14BF; Thu, 18 Aug 2016 10:40:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAeIj5022533; Thu, 18 Aug 2016 10:40:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAeI1J022532; Thu, 18 Aug 2016 10:40:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181040.u7IAeI1J022532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:40:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304382 - stable/10/sys/dev/ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:40:19 -0000 Author: mav Date: Thu Aug 18 10:40:18 2016 New Revision: 304382 URL: https://svnweb.freebsd.org/changeset/base/304382 Log: MFC r302487: Reduce code divergence from Linux, preparing for DMA support. Modified: stable/10/sys/dev/ntb/ntb_transport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:39:42 2016 (r304381) +++ stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:40:18 2016 (r304382) @@ -268,8 +268,6 @@ static void ntb_transport_init_queue(str unsigned int qp_num); static int ntb_process_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry); -static void ntb_memcpy_tx(struct ntb_transport_qp *qp, - struct ntb_queue_entry *entry, void *offset); static void ntb_transport_rxc_db(void *arg, int pending); static int ntb_process_rxc(struct ntb_transport_qp *qp); static void ntb_memcpy_rx(struct ntb_transport_qp *qp, @@ -590,11 +588,13 @@ ntb_transport_create_queue(void *data, d entry->cb_data = data; entry->buf = NULL; entry->len = transport_mtu; + entry->qp = qp; ntb_list_add(&qp->ntb_rx_q_lock, entry, &qp->rx_pend_q); } for (i = 0; i < NTB_QP_DEF_NUM_ENTRIES; i++) { entry = malloc(sizeof(*entry), M_NTB_T, M_WAITOK | M_ZERO); + entry->qp = qp; ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); } @@ -676,60 +676,44 @@ ntb_transport_tx_enqueue(struct ntb_tran return (rc); } -static int -ntb_process_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry) +static void +ntb_tx_copy_callback(void *data) { - void *offset; + struct ntb_queue_entry *entry = data; + struct ntb_transport_qp *qp = entry->qp; + struct ntb_payload_header *hdr = entry->x_hdr; - offset = qp->tx_mw + qp->tx_max_frame * qp->tx_index; - CTR3(KTR_NTB, - "TX: process_tx: tx_pkts=%lu, tx_index=%u, remote entry=%u", - qp->tx_pkts, qp->tx_index, qp->remote_rx_info->entry); - if (qp->tx_index == qp->remote_rx_info->entry) { - CTR0(KTR_NTB, "TX: ring full"); - qp->tx_ring_full++; - return (EAGAIN); - } + iowrite32(entry->flags | NTBT_DESC_DONE_FLAG, &hdr->flags); + CTR1(KTR_NTB, "TX: hdr %p set DESC_DONE", hdr); - if (entry->len > qp->tx_max_frame - sizeof(struct ntb_payload_header)) { - if (qp->tx_handler != NULL) + NTB_PEER_DB_SET(qp->ntb, 1ull << qp->qp_num); + + /* + * The entry length can only be zero if the packet is intended to be a + * "link down" or similar. Since no payload is being sent in these + * cases, there is nothing to add to the completion queue. + */ + if (entry->len > 0) { + qp->tx_bytes += entry->len; + + if (qp->tx_handler) qp->tx_handler(qp, qp->cb_data, entry->buf, - EIO); + entry->len); else m_freem(entry->buf); - entry->buf = NULL; - ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); - CTR1(KTR_NTB, - "TX: frame too big. returning entry %p to tx_free_q", - entry); - return (0); } - CTR2(KTR_NTB, "TX: copying entry %p to offset %p", entry, offset); - ntb_memcpy_tx(qp, entry, offset); - - qp->tx_index++; - qp->tx_index %= qp->tx_max_entry; - qp->tx_pkts++; - - return (0); + CTR3(KTR_NTB, + "TX: entry %p sent. hdr->ver = %u, hdr->flags = 0x%x, Returning " + "to tx_free_q", entry, hdr->ver, hdr->flags); + ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); } static void -ntb_memcpy_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry, - void *offset) +ntb_memcpy_tx(struct ntb_queue_entry *entry, void *offset) { - struct ntb_payload_header *hdr; - - /* This piece is from Linux' ntb_async_tx() */ - hdr = (struct ntb_payload_header *)((char *)offset + qp->tx_max_frame - - sizeof(struct ntb_payload_header)); - entry->x_hdr = hdr; - iowrite32(entry->len, &hdr->len); - iowrite32(qp->tx_pkts, &hdr->ver); - /* This piece is ntb_memcpy_tx() */ CTR2(KTR_NTB, "TX: copying %d bytes to offset %p", entry->len, offset); if (entry->buf != NULL) { m_copydata((struct mbuf *)entry->buf, 0, entry->len, offset); @@ -741,32 +725,62 @@ ntb_memcpy_tx(struct ntb_transport_qp *q wmb(); } - /* The rest is ntb_tx_copy_callback() */ - iowrite32(entry->flags | NTBT_DESC_DONE_FLAG, &hdr->flags); - CTR1(KTR_NTB, "TX: hdr %p set DESC_DONE", hdr); + ntb_tx_copy_callback(entry); +} - NTB_PEER_DB_SET(qp->ntb, 1ull << qp->qp_num); +static void +ntb_async_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry) +{ + struct ntb_payload_header *hdr; + void *offset; - /* - * The entry length can only be zero if the packet is intended to be a - * "link down" or similar. Since no payload is being sent in these - * cases, there is nothing to add to the completion queue. - */ - if (entry->len > 0) { - qp->tx_bytes += entry->len; + offset = qp->tx_mw + qp->tx_max_frame * qp->tx_index; + hdr = (struct ntb_payload_header *)((char *)offset + qp->tx_max_frame - + sizeof(struct ntb_payload_header)); + entry->x_hdr = hdr; - if (qp->tx_handler) + iowrite32(entry->len, &hdr->len); + iowrite32(qp->tx_pkts, &hdr->ver); + + ntb_memcpy_tx(entry, offset); +} + +static int +ntb_process_tx(struct ntb_transport_qp *qp, struct ntb_queue_entry *entry) +{ + + CTR3(KTR_NTB, + "TX: process_tx: tx_pkts=%lu, tx_index=%u, remote entry=%u", + qp->tx_pkts, qp->tx_index, qp->remote_rx_info->entry); + if (qp->tx_index == qp->remote_rx_info->entry) { + CTR0(KTR_NTB, "TX: ring full"); + qp->tx_ring_full++; + return (EAGAIN); + } + + if (entry->len > qp->tx_max_frame - sizeof(struct ntb_payload_header)) { + if (qp->tx_handler != NULL) qp->tx_handler(qp, qp->cb_data, entry->buf, - entry->len); + EIO); else m_freem(entry->buf); + entry->buf = NULL; + ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); + CTR1(KTR_NTB, + "TX: frame too big. returning entry %p to tx_free_q", + entry); + return (0); } + CTR2(KTR_NTB, "TX: copying entry %p to index %u", entry, qp->tx_index); + ntb_async_tx(qp, entry); - CTR3(KTR_NTB, - "TX: entry %p sent. hdr->ver = %u, hdr->flags = 0x%x, Returning " - "to tx_free_q", entry, hdr->ver, hdr->flags); - ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); + qp->tx_index++; + qp->tx_index %= qp->tx_max_entry; + + qp->tx_pkts++; + + return (0); } /* Transport Rx */ From owner-svn-src-all@freebsd.org Thu Aug 18 10:41:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6264BBEF89; Thu, 18 Aug 2016 10:41:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88BF21741; Thu, 18 Aug 2016 10:41:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAexVA022612; Thu, 18 Aug 2016 10:40:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAexLp022611; Thu, 18 Aug 2016 10:40:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181040.u7IAexLp022611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304383 - stable/10/sys/dev/ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:41:00 -0000 Author: mav Date: Thu Aug 18 10:40:59 2016 New Revision: 304383 URL: https://svnweb.freebsd.org/changeset/base/304383 Log: MFC r302488: Remove unneeded RX lock, and make TX lock per-qp. Modified: stable/10/sys/dev/ntb/ntb_transport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:40:18 2016 (r304382) +++ stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:40:59 2016 (r304383) @@ -185,6 +185,8 @@ struct ntb_transport_qp { uint64_t tx_pkts; uint64_t tx_ring_full; uint64_t tx_err_no_buf; + + struct mtx tx_lock; }; struct ntb_transport_mw { @@ -214,8 +216,6 @@ struct ntb_transport_ctx { struct callout link_work; struct callout link_watchdog; struct task link_cleanup; - struct mtx tx_lock; - struct mtx rx_lock; }; enum { @@ -376,9 +376,6 @@ ntb_transport_attach(device_t dev) nt->qp_count = nt->mw_count; KASSERT(nt->qp_count <= QP_SETSIZE, ("invalid qp_count")); - mtx_init(&nt->tx_lock, "ntb transport tx", NULL, MTX_DEF); - mtx_init(&nt->rx_lock, "ntb transport rx", NULL, MTX_DEF); - nt->qp_vec = malloc(nt->qp_count * sizeof(*nt->qp_vec), M_NTB_T, M_WAITOK | M_ZERO); @@ -503,6 +500,7 @@ ntb_transport_init_queue(struct ntb_tran mtx_init(&qp->ntb_rx_q_lock, "ntb rx q", NULL, MTX_SPIN); mtx_init(&qp->ntb_tx_free_q_lock, "ntb tx free q", NULL, MTX_SPIN); + mtx_init(&qp->tx_lock, "ntb transport tx", NULL, MTX_DEF); TASK_INIT(&qp->rx_completion_task, 0, ntb_complete_rxc, qp); TASK_INIT(&qp->rxc_db_work, 0, ntb_transport_rxc_db, qp); @@ -664,9 +662,9 @@ ntb_transport_tx_enqueue(struct ntb_tran entry->len = len; entry->flags = 0; - mtx_lock(&qp->transport->tx_lock); + mtx_lock(&qp->tx_lock); rc = ntb_process_tx(qp, entry); - mtx_unlock(&qp->transport->tx_lock); + mtx_unlock(&qp->tx_lock); if (rc != 0) { ntb_list_add(&qp->ntb_tx_free_q_lock, entry, &qp->tx_free_q); CTR1(KTR_NTB, @@ -796,7 +794,6 @@ ntb_transport_rxc_db(void *arg, int pend * provide fairness to others */ CTR0(KTR_NTB, "RX: transport_rx"); - mtx_lock(&qp->transport->rx_lock); for (i = 0; i < qp->rx_max_entry; i++) { rc = ntb_process_rxc(qp); if (rc != 0) { @@ -804,7 +801,6 @@ ntb_transport_rxc_db(void *arg, int pend break; } } - mtx_unlock(&qp->transport->rx_lock); if (i == qp->rx_max_entry) taskqueue_enqueue(taskqueue_swi, &qp->rxc_db_work); @@ -1390,11 +1386,11 @@ ntb_send_link_down(struct ntb_transport_ entry->len = 0; entry->flags = NTBT_LINK_DOWN_FLAG; - mtx_lock(&qp->transport->tx_lock); + mtx_lock(&qp->tx_lock); rc = ntb_process_tx(qp, entry); + mtx_unlock(&qp->tx_lock); if (rc != 0) printf("ntb: Failed to send link down\n"); - mtx_unlock(&qp->transport->tx_lock); ntb_qp_link_down_reset(qp); } From owner-svn-src-all@freebsd.org Thu Aug 18 10:41:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17662BBEFF1; Thu, 18 Aug 2016 10:41:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF9281927; Thu, 18 Aug 2016 10:41:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAfY7x022691; Thu, 18 Aug 2016 10:41:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAfY18022690; Thu, 18 Aug 2016 10:41:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181041.u7IAfY18022690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304384 - stable/10/sys/dev/ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:41:36 -0000 Author: mav Date: Thu Aug 18 10:41:34 2016 New Revision: 304384 URL: https://svnweb.freebsd.org/changeset/base/304384 Log: MFC r302489: Remove rx_completion_task taskqueue. It is not needed after RX lock removed in previous commit. Modified: stable/10/sys/dev/ntb/ntb_transport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:40:59 2016 (r304383) +++ stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:41:34 2016 (r304384) @@ -161,7 +161,6 @@ struct ntb_transport_qp { struct ntb_queue_list rx_pend_q; /* ntb_rx_q_lock: synchronize access to rx_XXXX_q */ struct mtx ntb_rx_q_lock; - struct task rx_completion_task; struct task rxc_db_work; caddr_t rx_buff; ntb_q_idx_t rx_index; @@ -274,7 +273,7 @@ static void ntb_memcpy_rx(struct ntb_tra struct ntb_queue_entry *entry, void *offset); static inline void ntb_rx_copy_callback(struct ntb_transport_qp *qp, void *data); -static void ntb_complete_rxc(void *arg, int pending); +static void ntb_complete_rxc(struct ntb_transport_qp *qp); static void ntb_transport_doorbell_callback(void *data, uint32_t vector); static void ntb_transport_event_callback(void *data); static void ntb_transport_link_work(void *arg); @@ -501,7 +500,6 @@ ntb_transport_init_queue(struct ntb_tran mtx_init(&qp->ntb_rx_q_lock, "ntb rx q", NULL, MTX_SPIN); mtx_init(&qp->ntb_tx_free_q_lock, "ntb tx free q", NULL, MTX_SPIN); mtx_init(&qp->tx_lock, "ntb transport tx", NULL, MTX_DEF); - TASK_INIT(&qp->rx_completion_task, 0, ntb_complete_rxc, qp); TASK_INIT(&qp->rxc_db_work, 0, ntb_transport_rxc_db, qp); STAILQ_INIT(&qp->rx_post_q); @@ -523,7 +521,6 @@ ntb_transport_free_queue(struct ntb_tran NTB_DB_SET_MASK(qp->ntb, 1ull << qp->qp_num); taskqueue_drain(taskqueue_swi, &qp->rxc_db_work); - taskqueue_drain(taskqueue_swi, &qp->rx_completion_task); qp->cb_data = NULL; qp->rx_handler = NULL; @@ -870,7 +867,7 @@ ntb_process_rxc(struct ntb_transport_qp entry->len = -EIO; entry->flags |= NTBT_DESC_DONE_FLAG; - taskqueue_enqueue(taskqueue_swi, &qp->rx_completion_task); + ntb_complete_rxc(qp); } else { qp->rx_bytes += hdr->len; qp->rx_pkts++; @@ -912,13 +909,12 @@ ntb_rx_copy_callback(struct ntb_transpor entry = data; entry->flags |= NTBT_DESC_DONE_FLAG; - taskqueue_enqueue(taskqueue_swi, &qp->rx_completion_task); + ntb_complete_rxc(qp); } static void -ntb_complete_rxc(void *arg, int pending) +ntb_complete_rxc(struct ntb_transport_qp *qp) { - struct ntb_transport_qp *qp = arg; struct ntb_queue_entry *entry; struct mbuf *m; unsigned len; From owner-svn-src-all@freebsd.org Thu Aug 18 10:42:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CC4ABBE054; Thu, 18 Aug 2016 10:42:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 590F11B3A; Thu, 18 Aug 2016 10:42:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAgCnb023350; Thu, 18 Aug 2016 10:42:12 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAgCP3023349; Thu, 18 Aug 2016 10:42:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181042.u7IAgCP3023349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304385 - stable/10/sys/dev/ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:42:13 -0000 Author: mav Date: Thu Aug 18 10:42:12 2016 New Revision: 304385 URL: https://svnweb.freebsd.org/changeset/base/304385 Log: MFC r302490: Create separate RX taskqueue for each qp. Modified: stable/10/sys/dev/ntb/ntb_transport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:41:34 2016 (r304384) +++ stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:42:12 2016 (r304385) @@ -162,6 +162,7 @@ struct ntb_transport_qp { /* ntb_rx_q_lock: synchronize access to rx_XXXX_q */ struct mtx ntb_rx_q_lock; struct task rxc_db_work; + struct taskqueue *rxc_tq; caddr_t rx_buff; ntb_q_idx_t rx_index; ntb_q_idx_t rx_max_entry; @@ -204,6 +205,7 @@ struct ntb_transport_mw { }; struct ntb_transport_ctx { + device_t dev; device_t ntb; struct ntb_transport_mw *mw_vec; struct ntb_transport_qp *qp_vec; @@ -341,6 +343,7 @@ ntb_transport_attach(device_t dev) int rc; unsigned i; + nt->dev = dev; nt->ntb = ntb; nt->mw_count = NTB_MW_COUNT(ntb); nt->mw_vec = malloc(nt->mw_count * sizeof(*nt->mw_vec), M_NTB_T, @@ -501,6 +504,10 @@ ntb_transport_init_queue(struct ntb_tran mtx_init(&qp->ntb_tx_free_q_lock, "ntb tx free q", NULL, MTX_SPIN); mtx_init(&qp->tx_lock, "ntb transport tx", NULL, MTX_DEF); TASK_INIT(&qp->rxc_db_work, 0, ntb_transport_rxc_db, qp); + qp->rxc_tq = taskqueue_create("ntbt_rx", M_WAITOK, + taskqueue_thread_enqueue, &qp->rxc_tq); + taskqueue_start_threads(&qp->rxc_tq, 1, PI_NET, "%s rx%d", + device_get_nameunit(nt->dev), qp_num); STAILQ_INIT(&qp->rx_post_q); STAILQ_INIT(&qp->rx_pend_q); @@ -520,7 +527,8 @@ ntb_transport_free_queue(struct ntb_tran callout_drain(&qp->link_work); NTB_DB_SET_MASK(qp->ntb, 1ull << qp->qp_num); - taskqueue_drain(taskqueue_swi, &qp->rxc_db_work); + taskqueue_drain_all(qp->rxc_tq); + taskqueue_free(qp->rxc_tq); qp->cb_data = NULL; qp->rx_handler = NULL; @@ -783,35 +791,18 @@ static void ntb_transport_rxc_db(void *arg, int pending __unused) { struct ntb_transport_qp *qp = arg; - ntb_q_idx_t i; int rc; - /* - * Limit the number of packets processed in a single interrupt to - * provide fairness to others - */ CTR0(KTR_NTB, "RX: transport_rx"); - for (i = 0; i < qp->rx_max_entry; i++) { - rc = ntb_process_rxc(qp); - if (rc != 0) { - CTR0(KTR_NTB, "RX: process_rxc failed"); - break; - } - } +again: + while ((rc = ntb_process_rxc(qp)) == 0) + ; + CTR1(KTR_NTB, "RX: process_rxc returned %d", rc); - if (i == qp->rx_max_entry) - taskqueue_enqueue(taskqueue_swi, &qp->rxc_db_work); - else if ((NTB_DB_READ(qp->ntb) & (1ull << qp->qp_num)) != 0) { - /* If db is set, clear it and read it back to commit clear. */ + if ((NTB_DB_READ(qp->ntb) & (1ull << qp->qp_num)) != 0) { + /* If db is set, clear it and check queue once more. */ NTB_DB_CLEAR(qp->ntb, 1ull << qp->qp_num); - (void)NTB_DB_READ(qp->ntb); - - /* - * An interrupt may have arrived between finishing - * ntb_process_rxc and clearing the doorbell bit: there might - * be some more work to do. - */ - taskqueue_enqueue(taskqueue_swi, &qp->rxc_db_work); + goto again; } } @@ -973,12 +964,14 @@ ntb_transport_doorbell_callback(void *da BIT_NAND(QP_SETSIZE, &db_bits, &nt->qp_bitmap_free); vec_mask = NTB_DB_VECTOR_MASK(nt->ntb, vector); + if ((vec_mask & (vec_mask - 1)) != 0) + vec_mask &= NTB_DB_READ(nt->ntb); while (vec_mask != 0) { qp_num = ffsll(vec_mask) - 1; if (test_bit(qp_num, &db_bits)) { qp = &nt->qp_vec[qp_num]; - taskqueue_enqueue(taskqueue_swi, &qp->rxc_db_work); + taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); } vec_mask &= ~(1ull << qp_num); @@ -1227,7 +1220,7 @@ ntb_qp_link_work(void *arg) if (qp->event_handler != NULL) qp->event_handler(qp->cb_data, NTB_LINK_UP); - taskqueue_enqueue(taskqueue_swi, &qp->rxc_db_work); + taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); } else if (nt->link_is_up) callout_reset(&qp->link_work, NTB_LINK_DOWN_TIMEOUT * hz / 1000, ntb_qp_link_work, qp); From owner-svn-src-all@freebsd.org Thu Aug 18 10:42:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15432BBE1C4; Thu, 18 Aug 2016 10:42:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E185E1D07; Thu, 18 Aug 2016 10:42:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAgnJP026071; Thu, 18 Aug 2016 10:42:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAgn3N026070; Thu, 18 Aug 2016 10:42:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181042.u7IAgn3N026070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:42:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304386 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:42:50 -0000 Author: mav Date: Thu Aug 18 10:42:48 2016 New Revision: 304386 URL: https://svnweb.freebsd.org/changeset/base/304386 Log: MFC r302491: Switch ctx_lock from mutex to rmlock. It is odd idea to serialize different MSI-X vectors. Use of rmlocks here allows them to execute in parallel, but still protects ctx. If upper layers require any additional serialization -- they can do it by themselves. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:42:12 2016 (r304385) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:42:48 2016 (r304386) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -221,10 +222,7 @@ struct ntb_softc { void *ntb_ctx; const struct ntb_ctx_ops *ctx_ops; struct ntb_vec *msix_vec; -#define CTX_LOCK(sc) mtx_lock(&(sc)->ctx_lock) -#define CTX_UNLOCK(sc) mtx_unlock(&(sc)->ctx_lock) -#define CTX_ASSERT(sc,f) mtx_assert(&(sc)->ctx_lock, (f)) - struct mtx ctx_lock; + struct rmlock ctx_lock; uint32_t ppd; enum ntb_conn_type conn_type; @@ -670,7 +668,7 @@ ntb_attach(device_t device) callout_init(&ntb->lr_timer, CALLOUT_MPSAFE); callout_init(&ntb->peer_msix_work, 1); mtx_init(&ntb->db_mask_lock, "ntb hw bits", NULL, MTX_SPIN); - mtx_init(&ntb->ctx_lock, "ntb ctx", NULL, MTX_DEF); + rm_init(&ntb->ctx_lock, "ntb ctx"); if (ntb->type == NTB_ATOM) error = ntb_detect_atom(ntb); @@ -733,7 +731,7 @@ ntb_detach(device_t device) ntb_teardown_interrupts(ntb); mtx_destroy(&ntb->db_mask_lock); - mtx_destroy(&ntb->ctx_lock); + rm_destroy(&ntb->ctx_lock); ntb_unmap_pci_bar(ntb); @@ -2028,17 +2026,15 @@ ntb_set_ctx(device_t dev, void *ctx, con if (ctx == NULL || ops == NULL) return (EINVAL); - if (ntb->ctx_ops != NULL) - return (EINVAL); - CTX_LOCK(ntb); + rm_wlock(&ntb->ctx_lock); if (ntb->ctx_ops != NULL) { - CTX_UNLOCK(ntb); + rm_wunlock(&ntb->ctx_lock); return (EINVAL); } ntb->ntb_ctx = ctx; ntb->ctx_ops = ops; - CTX_UNLOCK(ntb); + rm_wunlock(&ntb->ctx_lock); return (0); } @@ -2063,10 +2059,10 @@ ntb_clear_ctx(device_t dev) { struct ntb_softc *ntb = device_get_softc(dev); - CTX_LOCK(ntb); + rm_wlock(&ntb->ctx_lock); ntb->ntb_ctx = NULL; ntb->ctx_ops = NULL; - CTX_UNLOCK(ntb); + rm_wunlock(&ntb->ctx_lock); } /* @@ -2080,11 +2076,12 @@ static void ntb_link_event(device_t dev) { struct ntb_softc *ntb = device_get_softc(dev); + struct rm_priotracker ctx_tracker; - CTX_LOCK(ntb); + rm_rlock(&ntb->ctx_lock, &ctx_tracker); if (ntb->ctx_ops != NULL && ntb->ctx_ops->link_event != NULL) ntb->ctx_ops->link_event(ntb->ntb_ctx); - CTX_UNLOCK(ntb); + rm_runlock(&ntb->ctx_lock, &ctx_tracker); } /* @@ -2104,11 +2101,12 @@ static void ntb_db_event(device_t dev, uint32_t vec) { struct ntb_softc *ntb = device_get_softc(dev); + struct rm_priotracker ctx_tracker; - CTX_LOCK(ntb); + rm_rlock(&ntb->ctx_lock, &ctx_tracker); if (ntb->ctx_ops != NULL && ntb->ctx_ops->db_event != NULL) ntb->ctx_ops->db_event(ntb->ntb_ctx, vec); - CTX_UNLOCK(ntb); + rm_runlock(&ntb->ctx_lock, &ctx_tracker); } static int From owner-svn-src-all@freebsd.org Thu Aug 18 10:43:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A535BBE250; Thu, 18 Aug 2016 10:43:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11B471E78; Thu, 18 Aug 2016 10:43:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAhNRG026151; Thu, 18 Aug 2016 10:43:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAhNEv026150; Thu, 18 Aug 2016 10:43:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181043.u7IAhNEv026150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304387 - stable/10/sys/dev/ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:43:24 -0000 Author: mav Date: Thu Aug 18 10:43:23 2016 New Revision: 304387 URL: https://svnweb.freebsd.org/changeset/base/304387 Log: MFC r302492: Bring some more order into link and qp state handling. Do not touch scratchpad registers until link is reported up. Mask and do not handle doorbell events until respective qp is up. Modified: stable/10/sys/dev/ntb/ntb_transport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:42:48 2016 (r304386) +++ stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:43:23 2016 (r304387) @@ -512,8 +512,6 @@ ntb_transport_init_queue(struct ntb_tran STAILQ_INIT(&qp->rx_post_q); STAILQ_INIT(&qp->rx_pend_q); STAILQ_INIT(&qp->tx_free_q); - - callout_reset(&qp->link_work, 0, ntb_qp_link_work, qp); } void @@ -602,7 +600,6 @@ ntb_transport_create_queue(void *data, d } NTB_DB_CLEAR(ntb, 1ull << qp->qp_num); - NTB_DB_CLEAR_MASK(ntb, 1ull << qp->qp_num); return (qp); } @@ -971,7 +968,8 @@ ntb_transport_doorbell_callback(void *da if (test_bit(qp_num, &db_bits)) { qp = &nt->qp_vec[qp_num]; - taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); + if (qp->link_is_up) + taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); } vec_mask &= ~(1ull << qp_num); @@ -1220,6 +1218,7 @@ ntb_qp_link_work(void *arg) if (qp->event_handler != NULL) qp->event_handler(qp->cb_data, NTB_LINK_UP); + NTB_DB_CLEAR_MASK(ntb, 1ull << qp->qp_num); taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); } else if (nt->link_is_up) callout_reset(&qp->link_work, @@ -1276,6 +1275,7 @@ ntb_qp_link_down_reset(struct ntb_transp { qp->link_is_up = false; + NTB_DB_SET_MASK(qp->ntb, 1ull << qp->qp_num); qp->tx_index = qp->rx_index = 0; qp->tx_bytes = qp->rx_bytes = 0; @@ -1291,17 +1291,12 @@ ntb_qp_link_down_reset(struct ntb_transp static void ntb_qp_link_cleanup(struct ntb_transport_qp *qp) { - struct ntb_transport_ctx *nt = qp->transport; callout_drain(&qp->link_work); ntb_qp_link_down_reset(qp); if (qp->event_handler != NULL) qp->event_handler(qp->cb_data, NTB_LINK_DOWN); - - if (nt->link_is_up) - callout_reset(&qp->link_work, - NTB_LINK_DOWN_TIMEOUT * hz / 1000, ntb_qp_link_work, qp); } /* Link commanded down */ From owner-svn-src-all@freebsd.org Thu Aug 18 10:44:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EFDFBBE2A1; Thu, 18 Aug 2016 10:44:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 425581147; Thu, 18 Aug 2016 10:44:00 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAhxSU026225; Thu, 18 Aug 2016 10:43:59 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAhxKO026223; Thu, 18 Aug 2016 10:43:59 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181043.u7IAhxKO026223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304388 - in stable/10/sys/dev/ntb: . ntb_hw X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:44:00 -0000 Author: mav Date: Thu Aug 18 10:43:59 2016 New Revision: 304388 URL: https://svnweb.freebsd.org/changeset/base/304388 Log: MFC r302493: Reimplement doorbell register emulation for NTB_SB01BASE_LOCKUP. This allows at least first three doorbells to work very close to normal hardware, properly signaling events to upper layers without spurious or lost events. Doorbells above the first three may still report spurious events due to lack of reliable information, but they are rarely used. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c stable/10/sys/dev/ntb/ntb_transport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:43:23 2016 (r304387) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:43:59 2016 (r304388) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -254,6 +255,7 @@ struct ntb_softc { uint64_t db_valid_mask; uint64_t db_link_mask; uint64_t db_mask; + uint64_t fake_db_bell; /* NTB_SB01BASE_LOCKUP*/ int last_ts; /* ticks @ last irq */ @@ -358,7 +360,6 @@ static void xeon_set_pbar_xlat(struct nt enum ntb_bar idx); static int xeon_setup_b2b_mw(struct ntb_softc *, const struct ntb_b2b_addr *addr, const struct ntb_b2b_addr *peer_addr); -static int xeon_setup_msix_bar(struct ntb_softc *); static inline bool link_is_up(struct ntb_softc *ntb); static inline bool _xeon_link_is_up(struct ntb_softc *ntb); static inline bool atom_link_is_err(struct ntb_softc *ntb); @@ -1208,12 +1209,10 @@ ntb_db_set_mask(device_t dev, uint64_t b { struct ntb_softc *ntb = device_get_softc(dev); - if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) - return; - DB_MASK_LOCK(ntb); ntb->db_mask |= bits; - db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); + if (!HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) + db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); DB_MASK_UNLOCK(ntb); } @@ -1221,18 +1220,26 @@ static void ntb_db_clear_mask(device_t dev, uint64_t bits) { struct ntb_softc *ntb = device_get_softc(dev); + uint64_t ibits; + int i; KASSERT((bits & ~ntb->db_valid_mask) == 0, ("%s: Invalid bits 0x%jx (valid: 0x%jx)", __func__, (uintmax_t)(bits & ~ntb->db_valid_mask), (uintmax_t)ntb->db_valid_mask)); - if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) - return; - DB_MASK_LOCK(ntb); + ibits = ntb->fake_db_bell & ntb->db_mask & bits; ntb->db_mask &= ~bits; - db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); + if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { + /* Simulate fake interrupts if unmasked DB bits are set. */ + for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { + if ((ibits & ntb_db_vector_mask(dev, i)) != 0) + swi_sched(ntb->int_info[i].tag, 0); + } + } else { + db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); + } DB_MASK_UNLOCK(ntb); } @@ -1241,17 +1248,8 @@ ntb_db_read(device_t dev) { struct ntb_softc *ntb = device_get_softc(dev); - if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { - uint64_t res; - unsigned i; - - res = 0; - for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { - if (ntb->msix_vec[i].masked != 0) - res |= ntb_db_vector_mask(dev, i); - } - return (res); - } + if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) + return (ntb->fake_db_bell); return (db_ioread(ntb, ntb->self_reg->db_bell)); } @@ -1267,21 +1265,9 @@ ntb_db_clear(device_t dev, uint64_t bits (uintmax_t)ntb->db_valid_mask)); if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { - unsigned i; - - for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { - if ((bits & ntb_db_vector_mask(dev, i)) != 0) { - DB_MASK_LOCK(ntb); - if (ntb->msix_vec[i].masked != 0) { - /* XXX These need a public API. */ -#if 0 - pci_unmask_msix(ntb->device, i); -#endif - ntb->msix_vec[i].masked = 0; - } - DB_MASK_UNLOCK(ntb); - } - } + DB_MASK_LOCK(ntb); + ntb->fake_db_bell &= ~bits; + DB_MASK_UNLOCK(ntb); return; } @@ -1293,6 +1279,19 @@ ntb_vec_mask(struct ntb_softc *ntb, uint { uint64_t shift, mask; + if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { + /* + * Remap vectors in custom way to make at least first + * three doorbells to not generate stray events. + * This breaks Linux compatibility (if one existed) + * when more then one DB is used (not by if_ntb). + */ + if (db_vector < XEON_NONLINK_DB_MSIX_BITS - 1) + return (1 << db_vector); + if (db_vector == XEON_NONLINK_DB_MSIX_BITS - 1) + return (0x7ffc); + } + shift = ntb->db_vec_shift; mask = (1ull << shift) - 1; return (mask << (shift * db_vector)); @@ -1314,13 +1313,16 @@ ntb_interrupt(struct ntb_softc *ntb, uin if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP) && (vec_mask & ntb->db_link_mask) == 0) { DB_MASK_LOCK(ntb); - if (ntb->msix_vec[vec].masked == 0) { - /* XXX These need a public API. */ -#if 0 - pci_mask_msix(ntb->device, vec); -#endif - ntb->msix_vec[vec].masked = 1; - } + + /* Do not report same DB events again if not cleared yet. */ + vec_mask &= ~ntb->fake_db_bell; + + /* Update our internal doorbell register. */ + ntb->fake_db_bell |= vec_mask; + + /* Do not report masked DB events. */ + vec_mask &= ~ntb->db_mask; + DB_MASK_UNLOCK(ntb); } @@ -1523,6 +1525,7 @@ ntb_xeon_init_dev(struct ntb_softc *ntb) ntb->xlat_reg = &xeon_sec_xlat; if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { + ntb->fake_db_bell = 0; ntb->msix_mw_idx = (ntb->mw_count + g_ntb_msix_idx) % ntb->mw_count; ntb_printf(2, "Setting up MSIX mw idx %d means %u\n", @@ -1579,10 +1582,6 @@ ntb_xeon_init_dev(struct ntb_softc *ntb) db_iowrite(ntb, ntb->self_reg->db_mask, ntb->db_mask); DB_MASK_UNLOCK(ntb); - rc = xeon_setup_msix_bar(ntb); - if (rc != 0) - return (rc); - rc = ntb_init_isr(ntb); return (rc); } @@ -1746,19 +1745,6 @@ xeon_set_pbar_xlat(struct ntb_softc *ntb } static int -xeon_setup_msix_bar(struct ntb_softc *ntb) -{ - enum ntb_bar bar_num; - - if (!HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) - return (0); - - bar_num = ntb_mw_to_bar(ntb, ntb->msix_mw_idx); - ntb->peer_lapic_bar = &ntb->bar_info[bar_num]; - return (0); -} - -static int xeon_setup_b2b_mw(struct ntb_softc *ntb, const struct ntb_b2b_addr *addr, const struct ntb_b2b_addr *peer_addr) { @@ -1838,8 +1824,10 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { size_t size, xlatoffset; + enum ntb_bar bar_num; - switch (ntb_mw_to_bar(ntb, ntb->msix_mw_idx)) { + bar_num = ntb_mw_to_bar(ntb, ntb->msix_mw_idx); + switch (bar_num) { case NTB_B2B_BAR_1: size = 8; xlatoffset = XEON_SBAR2XLAT_OFFSET; @@ -1872,6 +1860,8 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, ntb_reg_write(8, xlatoffset, MSI_INTEL_ADDR_BASE); ntb->msix_xlat = ntb_reg_read(8, xlatoffset); } + + ntb->peer_lapic_bar = &ntb->bar_info[bar_num]; } (void)ntb_reg_read(8, XEON_SBAR2XLAT_OFFSET); (void)ntb_reg_read(8, XEON_SBAR4XLAT_OFFSET); Modified: stable/10/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:43:23 2016 (r304387) +++ stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:43:59 2016 (r304388) @@ -1219,7 +1219,6 @@ ntb_qp_link_work(void *arg) qp->event_handler(qp->cb_data, NTB_LINK_UP); NTB_DB_CLEAR_MASK(ntb, 1ull << qp->qp_num); - taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); } else if (nt->link_is_up) callout_reset(&qp->link_work, NTB_LINK_DOWN_TIMEOUT * hz / 1000, ntb_qp_link_work, qp); From owner-svn-src-all@freebsd.org Thu Aug 18 10:44:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE429BBE302; Thu, 18 Aug 2016 10:44:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8456D12B0; Thu, 18 Aug 2016 10:44:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAiZrF026322; Thu, 18 Aug 2016 10:44:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAiZab026320; Thu, 18 Aug 2016 10:44:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181044.u7IAiZab026320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304389 - in stable/10/sys/dev/ntb: . if_ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:44:36 -0000 Author: mav Date: Thu Aug 18 10:44:35 2016 New Revision: 304389 URL: https://svnweb.freebsd.org/changeset/base/304389 Log: MFC r302494: Synchronize MTU code with Linux. It is mandatory for transport compatibility. Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c stable/10/sys/dev/ntb/ntb_transport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 10:43:59 2016 (r304388) +++ stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 10:44:35 2016 (r304389) @@ -125,8 +125,7 @@ ntb_net_attach(device_t dev) ether_ifattach(ifp, sc->eaddr); ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_JUMBO_MTU; ifp->if_capenable = ifp->if_capabilities; - ifp->if_mtu = ntb_transport_max_size(sc->qp) - ETHER_HDR_LEN - - ETHER_CRC_LEN; + ifp->if_mtu = ntb_transport_max_size(sc->qp) - ETHER_HDR_LEN; ntb_transport_link_up(sc->qp); return (0); @@ -177,7 +176,7 @@ ntb_ioctl(struct ifnet *ifp, u_long comm case SIOCSIFMTU: { if (ifr->ifr_mtu > ntb_transport_max_size(sc->qp) - - ETHER_HDR_LEN - ETHER_CRC_LEN) { + ETHER_HDR_LEN) { error = EINVAL; break; } Modified: stable/10/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:43:59 2016 (r304388) +++ stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:44:35 2016 (r304389) @@ -493,8 +493,7 @@ ntb_transport_init_queue(struct ntb_tran qp->rx_info = (void *)(qp->tx_mw + tx_size); /* Due to house-keeping, there must be at least 2 buffs */ - qp->tx_max_frame = qmin(tx_size / 2, - transport_mtu + sizeof(struct ntb_payload_header)); + qp->tx_max_frame = qmin(transport_mtu, tx_size / 2); qp->tx_max_entry = tx_size / qp->tx_max_frame; callout_init(&qp->link_work, 0); @@ -1174,8 +1173,7 @@ ntb_transport_setup_qp_mw(struct ntb_tra qp->remote_rx_info = (void*)(qp->rx_buff + rx_size); /* Due to house-keeping, there must be at least 2 buffs */ - qp->rx_max_frame = qmin(rx_size / 2, - transport_mtu + sizeof(struct ntb_payload_header)); + qp->rx_max_frame = qmin(transport_mtu, rx_size / 2); qp->rx_max_entry = rx_size / qp->rx_max_frame; qp->rx_index = 0; From owner-svn-src-all@freebsd.org Thu Aug 18 10:45:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6121BBE38F; Thu, 18 Aug 2016 10:45:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B88D81442; Thu, 18 Aug 2016 10:45:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAjF0R026411; Thu, 18 Aug 2016 10:45:15 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAjFJS026409; Thu, 18 Aug 2016 10:45:15 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181045.u7IAjFJS026409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304390 - in stable/10/sys/dev/ntb: . if_ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:45:17 -0000 Author: mav Date: Thu Aug 18 10:45:15 2016 New Revision: 304390 URL: https://svnweb.freebsd.org/changeset/base/304390 Log: MFC r302495: Improve memory allocation errors handling on receive. Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c stable/10/sys/dev/ntb/ntb_transport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 10:44:35 2016 (r304389) +++ stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 10:45:15 2016 (r304390) @@ -241,7 +241,12 @@ ntb_net_rx_handler(struct ntb_transport_ struct mbuf *m = data; struct ifnet *ifp = qp_data; - CTR0(KTR_NTB, "RX: rx handler"); + CTR1(KTR_NTB, "RX: rx handler (%d)", len); + if (len < 0) { + if_inc_counter(ifp, IFCOUNTER_IERRORS, 1); + return; + } + m->m_pkthdr.csum_flags = CSUM_IP_CHECKED | CSUM_IP_VALID; (*ifp->if_input)(ifp, m); } Modified: stable/10/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:44:35 2016 (r304389) +++ stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:45:15 2016 (r304390) @@ -881,6 +881,8 @@ ntb_memcpy_rx(struct ntb_transport_qp *q CTR2(KTR_NTB, "RX: copying %d bytes from offset %p", len, offset); entry->buf = (void *)m_devget(offset, len, 0, ifp, NULL); + if (entry->buf == NULL) + entry->len = -ENOMEM; /* Ensure that the data is globally visible before clearing the flag */ wmb(); From owner-svn-src-all@freebsd.org Thu Aug 18 10:45:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E7B7BBE3DE; Thu, 18 Aug 2016 10:45:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09147160A; Thu, 18 Aug 2016 10:45:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAjsDA026488; Thu, 18 Aug 2016 10:45:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAjssD026487; Thu, 18 Aug 2016 10:45:54 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181045.u7IAjssD026487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:45:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304391 - stable/10/sys/dev/ntb/if_ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:45:55 -0000 Author: mav Date: Thu Aug 18 10:45:53 2016 New Revision: 304391 URL: https://svnweb.freebsd.org/changeset/base/304391 Log: MFC r302496: Rewrite if_ntb to use modern interface KPIs and features. It includes: link state, if_transmit, buf_ring, multiple queues, bpf, etc. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 10:45:15 2016 (r304390) +++ stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 10:45:53 2016 (r304391) @@ -43,15 +43,19 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include +#include +#include #include #include #include +#include #include #include #include @@ -61,28 +65,50 @@ __FBSDID("$FreeBSD$"); #include "../ntb_transport.h" #define KTR_NTB KTR_SPARE3 +#define NTB_MEDIATYPE (IFM_ETHER | IFM_AUTO | IFM_FDX) -struct ntb_net_ctx { - device_t *dev; - struct ifnet *ifp; +static SYSCTL_NODE(_hw, OID_AUTO, if_ntb, CTLFLAG_RW, 0, "if_ntb"); + +static unsigned g_if_ntb_num_queues = 1; +SYSCTL_UINT(_hw_if_ntb, OID_AUTO, num_queues, CTLFLAG_RWTUN, + &g_if_ntb_num_queues, 0, "Number of queues per interface"); + +struct ntb_net_queue { + struct ntb_net_ctx *sc; + if_t ifp; struct ntb_transport_qp *qp; - u_char eaddr[ETHER_ADDR_LEN]; - struct mtx tx_lock; - struct callout queue_full; + struct buf_ring *br; + struct task tx_task; + struct taskqueue *tx_tq; + struct mtx tx_lock; + struct callout queue_full; +}; + +struct ntb_net_ctx { + if_t ifp; + struct ifmedia media; + u_char eaddr[ETHER_ADDR_LEN]; + int num_queues; + struct ntb_net_queue *queues; + int mtu; }; static int ntb_net_probe(device_t dev); static int ntb_net_attach(device_t dev); static int ntb_net_detach(device_t dev); static void ntb_net_init(void *arg); -static int ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data); -static void ntb_start(struct ifnet *ifp); +static int ntb_ifmedia_upd(struct ifnet *); +static void ntb_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int ntb_ioctl(if_t ifp, u_long command, caddr_t data); +static int ntb_transmit(if_t ifp, struct mbuf *m); static void ntb_net_tx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); static void ntb_net_rx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); static void ntb_net_event_handler(void *data, enum ntb_link_event status); +static void ntb_handle_tx(void *arg, int pending); static void ntb_qp_full(void *arg); +static void ntb_qflush(if_t ifp); static void create_random_local_eui48(u_char *eaddr); static int @@ -97,37 +123,64 @@ static int ntb_net_attach(device_t dev) { struct ntb_net_ctx *sc = device_get_softc(dev); - struct ifnet *ifp; + struct ntb_net_queue *q; + if_t ifp; struct ntb_queue_handlers handlers = { ntb_net_rx_handler, ntb_net_tx_handler, ntb_net_event_handler }; + int i; - ifp = sc->ifp = if_alloc(IFT_ETHER); + ifp = sc->ifp = if_gethandle(IFT_ETHER); if (ifp == NULL) { printf("ntb: Cannot allocate ifnet structure\n"); return (ENOMEM); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); + if_setdev(ifp, dev); - mtx_init(&sc->tx_lock, "ntb tx", NULL, MTX_DEF); - callout_init(&sc->queue_full, 1); + sc->num_queues = g_if_ntb_num_queues; + sc->queues = malloc(sc->num_queues * sizeof(struct ntb_net_queue), + M_DEVBUF, M_WAITOK | M_ZERO); + sc->mtu = INT_MAX; + for (i = 0; i < sc->num_queues; i++) { + q = &sc->queues[i]; + q->sc = sc; + q->ifp = ifp; + q->qp = ntb_transport_create_queue(q, + device_get_parent(dev), &handlers); + if (q->qp == NULL) + break; + sc->mtu = imin(sc->mtu, ntb_transport_max_size(q->qp)); + mtx_init(&q->tx_lock, "ntb tx", NULL, MTX_DEF); + q->br = buf_ring_alloc(4096, M_DEVBUF, M_WAITOK, &q->tx_lock); + TASK_INIT(&q->tx_task, 0, ntb_handle_tx, q); + q->tx_tq = taskqueue_create_fast("ntb_txq", M_NOWAIT, + taskqueue_thread_enqueue, &q->tx_tq); + taskqueue_start_threads(&q->tx_tq, 1, PI_NET, "%s txq%d", + device_get_nameunit(dev), i); + callout_init(&q->queue_full, 1); + } + sc->num_queues = i; - sc->qp = ntb_transport_create_queue(ifp, device_get_parent(dev), - &handlers); - ifp->if_init = ntb_net_init; - ifp->if_softc = sc; - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; - ifp->if_ioctl = ntb_ioctl; - ifp->if_start = ntb_start; - IFQ_SET_MAXLEN(&ifp->if_snd, IFQ_MAXLEN); - ifp->if_snd.ifq_drv_maxlen = IFQ_MAXLEN; - IFQ_SET_READY(&ifp->if_snd); + if_setinitfn(ifp, ntb_net_init); + if_setsoftc(ifp, sc); + if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); + if_setioctlfn(ifp, ntb_ioctl); + if_settransmitfn(ifp, ntb_transmit); + if_setqflushfn(ifp, ntb_qflush); create_random_local_eui48(sc->eaddr); ether_ifattach(ifp, sc->eaddr); - ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_JUMBO_MTU; - ifp->if_capenable = ifp->if_capabilities; - ifp->if_mtu = ntb_transport_max_size(sc->qp) - ETHER_HDR_LEN; + if_setcapabilities(ifp, IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | + IFCAP_JUMBO_MTU | IFCAP_LINKSTATE); + if_setcapenable(ifp, if_getcapabilities(ifp)); + if_setmtu(ifp, sc->mtu - ETHER_HDR_LEN); + + ifmedia_init(&sc->media, IFM_IMASK, ntb_ifmedia_upd, + ntb_ifmedia_sts); + ifmedia_add(&sc->media, NTB_MEDIATYPE, 0, NULL); + ifmedia_set(&sc->media, NTB_MEDIATYPE); - ntb_transport_link_up(sc->qp); + for (i = 0; i < sc->num_queues; i++) + ntb_transport_link_up(sc->queues[i].qp); return (0); } @@ -135,19 +188,23 @@ static int ntb_net_detach(device_t dev) { struct ntb_net_ctx *sc = device_get_softc(dev); + struct ntb_net_queue *q; + int i; - if (sc->qp != NULL) { - ntb_transport_link_down(sc->qp); - ntb_transport_free_queue(sc->qp); - } - - if (sc->ifp != NULL) { - ether_ifdetach(sc->ifp); - if_free(sc->ifp); - sc->ifp = NULL; + for (i = 0; i < sc->num_queues; i++) + ntb_transport_link_down(sc->queues[i].qp); + ether_ifdetach(sc->ifp); + if_free(sc->ifp); + ifmedia_removeall(&sc->media); + for (i = 0; i < sc->num_queues; i++) { + q = &sc->queues[i]; + ntb_transport_free_queue(q->qp); + buf_ring_free(q->br, M_DEVBUF); + callout_drain(&q->queue_full); + taskqueue_drain_all(q->tx_tq); + mtx_destroy(&q->tx_lock); } - mtx_destroy(&sc->tx_lock); - + free(sc->queues, M_DEVBUF); return (0); } @@ -157,33 +214,37 @@ static void ntb_net_init(void *arg) { struct ntb_net_ctx *sc = arg; - struct ifnet *ifp = sc->ifp; + if_t ifp = sc->ifp; - ifp->if_drv_flags |= IFF_DRV_RUNNING; - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - ifp->if_flags |= IFF_UP; - if_link_state_change(ifp, LINK_STATE_UP); + if_setdrvflagbits(ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE); + if_link_state_change(ifp, ntb_transport_link_query(sc->queues[0].qp) ? + LINK_STATE_UP : LINK_STATE_DOWN); } static int -ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data) +ntb_ioctl(if_t ifp, u_long command, caddr_t data) { - struct ntb_net_ctx *sc = ifp->if_softc; + struct ntb_net_ctx *sc = if_getsoftc(ifp); struct ifreq *ifr = (struct ifreq *)data; int error = 0; switch (command) { case SIOCSIFMTU: { - if (ifr->ifr_mtu > ntb_transport_max_size(sc->qp) - - ETHER_HDR_LEN) { + if (ifr->ifr_mtu > sc->mtu - ETHER_HDR_LEN) { error = EINVAL; break; } - ifp->if_mtu = ifr->ifr_mtu; + if_setmtu(ifp, ifr->ifr_mtu); break; } + + case SIOCSIFMEDIA: + case SIOCGIFMEDIA: + error = ifmedia_ioctl(ifp, ifr, &sc->media, command); + break; + default: error = ether_ioctl(ifp, command, data); break; @@ -192,36 +253,131 @@ ntb_ioctl(struct ifnet *ifp, u_long comm return (error); } +static int +ntb_ifmedia_upd(struct ifnet *ifp) +{ + struct ntb_net_ctx *sc = if_getsoftc(ifp); + struct ifmedia *ifm = &sc->media; + + if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) + return (EINVAL); + + return (0); +} static void -ntb_start(struct ifnet *ifp) +ntb_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { - struct mbuf *m_head; - struct ntb_net_ctx *sc = ifp->if_softc; - int rc; - - mtx_lock(&sc->tx_lock); - ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; - CTR0(KTR_NTB, "TX: ntb_start"); - while (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) { - IFQ_DRV_DEQUEUE(&ifp->if_snd, m_head); - CTR1(KTR_NTB, "TX: start mbuf %p", m_head); - rc = ntb_transport_tx_enqueue(sc->qp, m_head, m_head, - m_length(m_head, NULL)); + struct ntb_net_ctx *sc = if_getsoftc(ifp); + + ifmr->ifm_status = IFM_AVALID; + ifmr->ifm_active = NTB_MEDIATYPE; + if (ntb_transport_link_query(sc->queues[0].qp)) + ifmr->ifm_status |= IFM_ACTIVE; +} + +static void +ntb_transmit_locked(struct ntb_net_queue *q) +{ + if_t ifp = q->ifp; + struct mbuf *m; + int rc, len; + short mflags; + + CTR0(KTR_NTB, "TX: ntb_transmit_locked"); + while ((m = drbr_peek(ifp, q->br)) != NULL) { + CTR1(KTR_NTB, "TX: start mbuf %p", m); + if_etherbpfmtap(ifp, m); + len = m->m_pkthdr.len; + mflags = m->m_flags; + rc = ntb_transport_tx_enqueue(q->qp, m, m, len); if (rc != 0) { - CTR1(KTR_NTB, - "TX: could not tx mbuf %p. Returning to snd q", - m_head); + CTR2(KTR_NTB, "TX: could not tx mbuf %p: %d", m, rc); if (rc == EAGAIN) { - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - callout_reset(&sc->queue_full, hz / 1000, - ntb_qp_full, ifp); + drbr_putback(ifp, q->br, m); + callout_reset_sbt(&q->queue_full, + SBT_1MS / 4, SBT_1MS / 4, + ntb_qp_full, q, 0); + } else { + m_freem(m); + drbr_advance(ifp, q->br); + if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } break; } + drbr_advance(ifp, q->br); + if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); + if_inc_counter(ifp, IFCOUNTER_OBYTES, len); + if (mflags & M_MCAST) + if_inc_counter(ifp, IFCOUNTER_OMCASTS, 1); + } +} + +static int +ntb_transmit(if_t ifp, struct mbuf *m) +{ + struct ntb_net_ctx *sc = if_getsoftc(ifp); + struct ntb_net_queue *q; + int error, i; + + CTR0(KTR_NTB, "TX: ntb_transmit"); + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) + i = m->m_pkthdr.flowid % sc->num_queues; + else + i = curcpu % sc->num_queues; + q = &sc->queues[i]; + + error = drbr_enqueue(ifp, q->br, m); + if (error) + return (error); + + if (mtx_trylock(&q->tx_lock)) { + ntb_transmit_locked(q); + mtx_unlock(&q->tx_lock); + } else + taskqueue_enqueue(q->tx_tq, &q->tx_task); + return (0); +} + +static void +ntb_handle_tx(void *arg, int pending) +{ + struct ntb_net_queue *q = arg; + + mtx_lock(&q->tx_lock); + ntb_transmit_locked(q); + mtx_unlock(&q->tx_lock); +} + +static void +ntb_qp_full(void *arg) +{ + struct ntb_net_queue *q = arg; + + CTR0(KTR_NTB, "TX: qp_full callout"); + if (ntb_transport_tx_free_entry(q->qp) > 0) + taskqueue_enqueue(q->tx_tq, &q->tx_task); + else + callout_schedule_sbt(&q->queue_full, + SBT_1MS / 4, SBT_1MS / 4, 0); +} + +static void +ntb_qflush(if_t ifp) +{ + struct ntb_net_ctx *sc = if_getsoftc(ifp); + struct ntb_net_queue *q; + struct mbuf *m; + int i; + + for (i = 0; i < sc->num_queues; i++) { + q = &sc->queues[i]; + mtx_lock(&q->tx_lock); + while ((m = buf_ring_dequeue_sc(q->br)) != NULL) + m_freem(m); + mtx_unlock(&q->tx_lock); } - mtx_unlock(&sc->tx_lock); + if_qflush(ifp); } /* Network Device Callbacks */ @@ -238,8 +394,10 @@ static void ntb_net_rx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, int len) { + struct ntb_net_queue *q = qp_data; + struct ntb_net_ctx *sc = q->sc; struct mbuf *m = data; - struct ifnet *ifp = qp_data; + if_t ifp = q->ifp; CTR1(KTR_NTB, "RX: rx handler (%d)", len); if (len < 0) { @@ -247,36 +405,37 @@ ntb_net_rx_handler(struct ntb_transport_ return; } - m->m_pkthdr.csum_flags = CSUM_IP_CHECKED | CSUM_IP_VALID; - (*ifp->if_input)(ifp, m); + m->m_pkthdr.rcvif = ifp; + if (sc->num_queues > 1) { + m->m_pkthdr.flowid = q - sc->queues; + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); + } + if ((if_getcapenable(ifp) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) == + (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { + m->m_pkthdr.csum_flags = CSUM_IP_CHECKED | CSUM_IP_VALID; + } + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); + if_input(ifp, m); } static void ntb_net_event_handler(void *data, enum ntb_link_event status) { - struct ifnet *ifp; - - ifp = data; - (void)ifp; - - /* XXX The Linux driver munges with the carrier status here. */ + struct ntb_net_queue *q = data; + int new_state; switch (status) { case NTB_LINK_DOWN: + new_state = LINK_STATE_DOWN; break; case NTB_LINK_UP: + new_state = LINK_STATE_UP; break; default: - panic("Bogus ntb_link_event %u\n", status); + new_state = LINK_STATE_UNKNOWN; + break; } -} - -static void -ntb_qp_full(void *arg) -{ - - CTR0(KTR_NTB, "TX: qp_full callout"); - ntb_start(arg); + if_link_state_change(q->ifp, new_state); } /* Helper functions */ From owner-svn-src-all@freebsd.org Thu Aug 18 10:46:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0064BBE43E; Thu, 18 Aug 2016 10:46:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CB5C91776; Thu, 18 Aug 2016 10:46:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAkU2X026566; Thu, 18 Aug 2016 10:46:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAkUhi026565; Thu, 18 Aug 2016 10:46:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181046.u7IAkUhi026565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:46:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304392 - stable/10/sys/dev/ntb/if_ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:46:31 -0000 Author: mav Date: Thu Aug 18 10:46:29 2016 New Revision: 304392 URL: https://svnweb.freebsd.org/changeset/base/304392 Log: MFC r302499: Improve checksum "offload" support. For compatibility reasons make driver not report any checksum offload by default, since there is indeed none. But if administrator knows that interface is used only for local traffic, he can enable fake checksum offload manually on both sides to save some CPU cycles, since the data are already protected by CRC32 of PCIe link. Sponsored by: iXsystems, Inc. Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 10:45:53 2016 (r304391) +++ stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 10:46:29 2016 (r304392) @@ -67,6 +67,13 @@ __FBSDID("$FreeBSD$"); #define KTR_NTB KTR_SPARE3 #define NTB_MEDIATYPE (IFM_ETHER | IFM_AUTO | IFM_FDX) +#define NTB_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_SCTP) +#define NTB_CSUM_FEATURES6 (CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_SCTP_IPV6) +#define NTB_CSUM_SET (CSUM_DATA_VALID | CSUM_DATA_VALID_IPV6 | \ + CSUM_PSEUDO_HDR | \ + CSUM_IP_CHECKED | CSUM_IP_VALID | \ + CSUM_SCTP_VALID) + static SYSCTL_NODE(_hw, OID_AUTO, if_ntb, CTLFLAG_RW, 0, "if_ntb"); static unsigned g_if_ntb_num_queues = 1; @@ -171,7 +178,7 @@ ntb_net_attach(device_t dev) ether_ifattach(ifp, sc->eaddr); if_setcapabilities(ifp, IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | IFCAP_JUMBO_MTU | IFCAP_LINKSTATE); - if_setcapenable(ifp, if_getcapabilities(ifp)); + if_setcapenable(ifp, IFCAP_JUMBO_MTU | IFCAP_LINKSTATE); if_setmtu(ifp, sc->mtu - ETHER_HDR_LEN); ifmedia_init(&sc->media, IFM_IMASK, ntb_ifmedia_upd, @@ -245,6 +252,31 @@ ntb_ioctl(if_t ifp, u_long command, cadd error = ifmedia_ioctl(ifp, ifr, &sc->media, command); break; + case SIOCSIFCAP: + if (ifr->ifr_reqcap & IFCAP_RXCSUM) + if_setcapenablebit(ifp, IFCAP_RXCSUM, 0); + else + if_setcapenablebit(ifp, 0, IFCAP_RXCSUM); + if (ifr->ifr_reqcap & IFCAP_TXCSUM) { + if_setcapenablebit(ifp, IFCAP_TXCSUM, 0); + if_sethwassistbits(ifp, NTB_CSUM_FEATURES, 0); + } else { + if_setcapenablebit(ifp, 0, IFCAP_TXCSUM); + if_sethwassistbits(ifp, 0, NTB_CSUM_FEATURES); + } + if (ifr->ifr_reqcap & IFCAP_RXCSUM_IPV6) + if_setcapenablebit(ifp, IFCAP_RXCSUM_IPV6, 0); + else + if_setcapenablebit(ifp, 0, IFCAP_RXCSUM_IPV6); + if (ifr->ifr_reqcap & IFCAP_TXCSUM_IPV6) { + if_setcapenablebit(ifp, IFCAP_TXCSUM_IPV6, 0); + if_sethwassistbits(ifp, NTB_CSUM_FEATURES6, 0); + } else { + if_setcapenablebit(ifp, 0, IFCAP_TXCSUM_IPV6); + if_sethwassistbits(ifp, 0, NTB_CSUM_FEATURES6); + } + break; + default: error = ether_ioctl(ifp, command, data); break; @@ -398,6 +430,7 @@ ntb_net_rx_handler(struct ntb_transport_ struct ntb_net_ctx *sc = q->sc; struct mbuf *m = data; if_t ifp = q->ifp; + uint16_t proto; CTR1(KTR_NTB, "RX: rx handler (%d)", len); if (len < 0) { @@ -410,9 +443,22 @@ ntb_net_rx_handler(struct ntb_transport_ m->m_pkthdr.flowid = q - sc->queues; M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); } - if ((if_getcapenable(ifp) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) == - (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { - m->m_pkthdr.csum_flags = CSUM_IP_CHECKED | CSUM_IP_VALID; + if (if_getcapenable(ifp) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { + m_copydata(m, 12, 2, (void *)&proto); + switch (ntohs(proto)) { + case ETHERTYPE_IP: + if (if_getcapenable(ifp) & IFCAP_RXCSUM) { + m->m_pkthdr.csum_data = 0xffff; + m->m_pkthdr.csum_flags = NTB_CSUM_SET; + } + break; + case ETHERTYPE_IPV6: + if (if_getcapenable(ifp) & IFCAP_RXCSUM_IPV6) { + m->m_pkthdr.csum_data = 0xffff; + m->m_pkthdr.csum_flags = NTB_CSUM_SET; + } + break; + } } if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); if_input(ifp, m); From owner-svn-src-all@freebsd.org Thu Aug 18 10:47:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CF7FBBE4BB; Thu, 18 Aug 2016 10:47:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AE0A1909; Thu, 18 Aug 2016 10:47:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAlMdJ026639; Thu, 18 Aug 2016 10:47:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAlMRR026638; Thu, 18 Aug 2016 10:47:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181047.u7IAlMRR026638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304393 - stable/10/sys/dev/ntb/if_ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:47:23 -0000 Author: mav Date: Thu Aug 18 10:47:22 2016 New Revision: 304393 URL: https://svnweb.freebsd.org/changeset/base/304393 Log: Direct commit to stable/10 to fix build without newer interface KPIs. Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 10:46:29 2016 (r304392) +++ stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 10:47:22 2016 (r304393) @@ -82,7 +82,7 @@ SYSCTL_UINT(_hw_if_ntb, OID_AUTO, num_qu struct ntb_net_queue { struct ntb_net_ctx *sc; - if_t ifp; + struct ifnet *ifp; struct ntb_transport_qp *qp; struct buf_ring *br; struct task tx_task; @@ -92,7 +92,7 @@ struct ntb_net_queue { }; struct ntb_net_ctx { - if_t ifp; + struct ifnet *ifp; struct ifmedia media; u_char eaddr[ETHER_ADDR_LEN]; int num_queues; @@ -106,8 +106,8 @@ static int ntb_net_detach(device_t dev); static void ntb_net_init(void *arg); static int ntb_ifmedia_upd(struct ifnet *); static void ntb_ifmedia_sts(struct ifnet *, struct ifmediareq *); -static int ntb_ioctl(if_t ifp, u_long command, caddr_t data); -static int ntb_transmit(if_t ifp, struct mbuf *m); +static int ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data); +static int ntb_transmit(struct ifnet *ifp, struct mbuf *m); static void ntb_net_tx_handler(struct ntb_transport_qp *qp, void *qp_data, void *data, int len); static void ntb_net_rx_handler(struct ntb_transport_qp *qp, void *qp_data, @@ -115,7 +115,7 @@ static void ntb_net_rx_handler(struct nt static void ntb_net_event_handler(void *data, enum ntb_link_event status); static void ntb_handle_tx(void *arg, int pending); static void ntb_qp_full(void *arg); -static void ntb_qflush(if_t ifp); +static void ntb_qflush(struct ifnet *ifp); static void create_random_local_eui48(u_char *eaddr); static int @@ -131,18 +131,17 @@ ntb_net_attach(device_t dev) { struct ntb_net_ctx *sc = device_get_softc(dev); struct ntb_net_queue *q; - if_t ifp; + struct ifnet *ifp; struct ntb_queue_handlers handlers = { ntb_net_rx_handler, ntb_net_tx_handler, ntb_net_event_handler }; int i; - ifp = sc->ifp = if_gethandle(IFT_ETHER); + ifp = sc->ifp = if_alloc(IFT_ETHER); if (ifp == NULL) { printf("ntb: Cannot allocate ifnet structure\n"); return (ENOMEM); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - if_setdev(ifp, dev); sc->num_queues = g_if_ntb_num_queues; sc->queues = malloc(sc->num_queues * sizeof(struct ntb_net_queue), @@ -168,18 +167,18 @@ ntb_net_attach(device_t dev) } sc->num_queues = i; - if_setinitfn(ifp, ntb_net_init); - if_setsoftc(ifp, sc); - if_setflags(ifp, IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST); - if_setioctlfn(ifp, ntb_ioctl); - if_settransmitfn(ifp, ntb_transmit); - if_setqflushfn(ifp, ntb_qflush); + ifp->if_init = ntb_net_init; + ifp->if_softc = sc; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_ioctl = ntb_ioctl; + ifp->if_transmit = ntb_transmit; + ifp->if_qflush = ntb_qflush; create_random_local_eui48(sc->eaddr); ether_ifattach(ifp, sc->eaddr); - if_setcapabilities(ifp, IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | - IFCAP_JUMBO_MTU | IFCAP_LINKSTATE); - if_setcapenable(ifp, IFCAP_JUMBO_MTU | IFCAP_LINKSTATE); - if_setmtu(ifp, sc->mtu - ETHER_HDR_LEN); + ifp->if_capabilities = IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6 | + IFCAP_JUMBO_MTU | IFCAP_LINKSTATE; + ifp->if_capenable = IFCAP_JUMBO_MTU | IFCAP_LINKSTATE; + ifp->if_mtu = sc->mtu - ETHER_HDR_LEN; ifmedia_init(&sc->media, IFM_IMASK, ntb_ifmedia_upd, ntb_ifmedia_sts); @@ -221,17 +220,18 @@ static void ntb_net_init(void *arg) { struct ntb_net_ctx *sc = arg; - if_t ifp = sc->ifp; + struct ifnet *ifp = sc->ifp; - if_setdrvflagbits(ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE); + ifp->if_drv_flags |= IFF_DRV_RUNNING; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; if_link_state_change(ifp, ntb_transport_link_query(sc->queues[0].qp) ? LINK_STATE_UP : LINK_STATE_DOWN); } static int -ntb_ioctl(if_t ifp, u_long command, caddr_t data) +ntb_ioctl(struct ifnet *ifp, u_long command, caddr_t data) { - struct ntb_net_ctx *sc = if_getsoftc(ifp); + struct ntb_net_ctx *sc = ifp->if_softc; struct ifreq *ifr = (struct ifreq *)data; int error = 0; @@ -243,7 +243,7 @@ ntb_ioctl(if_t ifp, u_long command, cadd break; } - if_setmtu(ifp, ifr->ifr_mtu); + ifp->if_mtu = ifr->ifr_mtu; break; } @@ -254,26 +254,26 @@ ntb_ioctl(if_t ifp, u_long command, cadd case SIOCSIFCAP: if (ifr->ifr_reqcap & IFCAP_RXCSUM) - if_setcapenablebit(ifp, IFCAP_RXCSUM, 0); + ifp->if_capenable |= IFCAP_RXCSUM; else - if_setcapenablebit(ifp, 0, IFCAP_RXCSUM); + ifp->if_capenable &= ~IFCAP_RXCSUM; if (ifr->ifr_reqcap & IFCAP_TXCSUM) { - if_setcapenablebit(ifp, IFCAP_TXCSUM, 0); - if_sethwassistbits(ifp, NTB_CSUM_FEATURES, 0); + ifp->if_capenable |= IFCAP_TXCSUM; + ifp->if_hwassist |= NTB_CSUM_FEATURES; } else { - if_setcapenablebit(ifp, 0, IFCAP_TXCSUM); - if_sethwassistbits(ifp, 0, NTB_CSUM_FEATURES); + ifp->if_capenable &= ~IFCAP_TXCSUM; + ifp->if_hwassist &= ~NTB_CSUM_FEATURES; } if (ifr->ifr_reqcap & IFCAP_RXCSUM_IPV6) - if_setcapenablebit(ifp, IFCAP_RXCSUM_IPV6, 0); + ifp->if_capenable |= IFCAP_RXCSUM_IPV6; else - if_setcapenablebit(ifp, 0, IFCAP_RXCSUM_IPV6); + ifp->if_capenable &= ~IFCAP_RXCSUM_IPV6; if (ifr->ifr_reqcap & IFCAP_TXCSUM_IPV6) { - if_setcapenablebit(ifp, IFCAP_TXCSUM_IPV6, 0); - if_sethwassistbits(ifp, NTB_CSUM_FEATURES6, 0); + ifp->if_capenable |= IFCAP_TXCSUM_IPV6; + ifp->if_hwassist |= NTB_CSUM_FEATURES6; } else { - if_setcapenablebit(ifp, 0, IFCAP_TXCSUM_IPV6); - if_sethwassistbits(ifp, 0, NTB_CSUM_FEATURES6); + ifp->if_capenable &= ~IFCAP_TXCSUM_IPV6; + ifp->if_hwassist &= ~NTB_CSUM_FEATURES6; } break; @@ -288,7 +288,7 @@ ntb_ioctl(if_t ifp, u_long command, cadd static int ntb_ifmedia_upd(struct ifnet *ifp) { - struct ntb_net_ctx *sc = if_getsoftc(ifp); + struct ntb_net_ctx *sc = ifp->if_softc; struct ifmedia *ifm = &sc->media; if (IFM_TYPE(ifm->ifm_media) != IFM_ETHER) @@ -300,7 +300,7 @@ ntb_ifmedia_upd(struct ifnet *ifp) static void ntb_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) { - struct ntb_net_ctx *sc = if_getsoftc(ifp); + struct ntb_net_ctx *sc = ifp->if_softc; ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = NTB_MEDIATYPE; @@ -311,7 +311,7 @@ ntb_ifmedia_sts(struct ifnet *ifp, struc static void ntb_transmit_locked(struct ntb_net_queue *q) { - if_t ifp = q->ifp; + struct ifnet *ifp = q->ifp; struct mbuf *m; int rc, len; short mflags; @@ -319,7 +319,7 @@ ntb_transmit_locked(struct ntb_net_queue CTR0(KTR_NTB, "TX: ntb_transmit_locked"); while ((m = drbr_peek(ifp, q->br)) != NULL) { CTR1(KTR_NTB, "TX: start mbuf %p", m); - if_etherbpfmtap(ifp, m); + ETHER_BPF_MTAP(ifp, m); len = m->m_pkthdr.len; mflags = m->m_flags; rc = ntb_transport_tx_enqueue(q->qp, m, m, len); @@ -346,9 +346,9 @@ ntb_transmit_locked(struct ntb_net_queue } static int -ntb_transmit(if_t ifp, struct mbuf *m) +ntb_transmit(struct ifnet *ifp, struct mbuf *m) { - struct ntb_net_ctx *sc = if_getsoftc(ifp); + struct ntb_net_ctx *sc = ifp->if_softc; struct ntb_net_queue *q; int error, i; @@ -395,9 +395,9 @@ ntb_qp_full(void *arg) } static void -ntb_qflush(if_t ifp) +ntb_qflush(struct ifnet *ifp) { - struct ntb_net_ctx *sc = if_getsoftc(ifp); + struct ntb_net_ctx *sc = ifp->if_softc; struct ntb_net_queue *q; struct mbuf *m; int i; @@ -429,7 +429,7 @@ ntb_net_rx_handler(struct ntb_transport_ struct ntb_net_queue *q = qp_data; struct ntb_net_ctx *sc = q->sc; struct mbuf *m = data; - if_t ifp = q->ifp; + struct ifnet *ifp = q->ifp; uint16_t proto; CTR1(KTR_NTB, "RX: rx handler (%d)", len); @@ -443,17 +443,17 @@ ntb_net_rx_handler(struct ntb_transport_ m->m_pkthdr.flowid = q - sc->queues; M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); } - if (if_getcapenable(ifp) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { + if (ifp->if_capenable & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) { m_copydata(m, 12, 2, (void *)&proto); switch (ntohs(proto)) { case ETHERTYPE_IP: - if (if_getcapenable(ifp) & IFCAP_RXCSUM) { + if (ifp->if_capenable & IFCAP_RXCSUM) { m->m_pkthdr.csum_data = 0xffff; m->m_pkthdr.csum_flags = NTB_CSUM_SET; } break; case ETHERTYPE_IPV6: - if (if_getcapenable(ifp) & IFCAP_RXCSUM_IPV6) { + if (ifp->if_capenable & IFCAP_RXCSUM_IPV6) { m->m_pkthdr.csum_data = 0xffff; m->m_pkthdr.csum_flags = NTB_CSUM_SET; } @@ -461,7 +461,7 @@ ntb_net_rx_handler(struct ntb_transport_ } } if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); - if_input(ifp, m); + ifp->if_input(ifp, m); } static void From owner-svn-src-all@freebsd.org Thu Aug 18 10:50:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CE7EBBE547; Thu, 18 Aug 2016 10:50:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD5921B38; Thu, 18 Aug 2016 10:50:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAoSuH026808; Thu, 18 Aug 2016 10:50:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAoSL0026807; Thu, 18 Aug 2016 10:50:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181050.u7IAoSL0026807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304394 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:50:29 -0000 Author: mav Date: Thu Aug 18 10:50:27 2016 New Revision: 304394 URL: https://svnweb.freebsd.org/changeset/base/304394 Log: MFC r302508: Disable SB01BASE_LOCKUP workaround when split BARs disabled. For some reason hack with sending MSI-X interrupts by writing to remote LAPIC memory works only for 32-bit BARs, that are available only if split BARs mode is enabled in BIOS. If it is not, complain loudly and fall back to less efficient workaround. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:47:22 2016 (r304393) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:50:27 2016 (r304394) @@ -453,7 +453,7 @@ ntb_vm_memattr_to_str(vm_memattr_t pat) } } -static int g_ntb_msix_idx = 0; +static int g_ntb_msix_idx = 1; TUNABLE_INT("hw.ntb.msix_mw_idx", &g_ntb_msix_idx); SYSCTL_INT(_hw_ntb, OID_AUTO, msix_mw_idx, CTLFLAG_RDTUN, &g_ntb_msix_idx, 0, "Use this memory window to access the peer MSIX message complex on " @@ -1455,6 +1455,16 @@ ntb_detect_xeon(struct ntb_softc *ntb) if ((ppd & XEON_PPD_SPLIT_BAR) != 0) ntb->features |= NTB_SPLIT_BAR; + if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP) && + !HAS_FEATURE(ntb, NTB_SPLIT_BAR)) { + device_printf(ntb->device, + "Can not apply SB01BASE_LOCKUP workaround " + "with split BARs disabled!\n"); + device_printf(ntb->device, + "Expect system hangs under heavy NTB traffic!\n"); + ntb->features &= ~NTB_SB01BASE_LOCKUP; + } + /* * SDOORBELL errata workaround gets in the way of SB01BASE_LOCKUP * errata workaround; only do one at a time. From owner-svn-src-all@freebsd.org Thu Aug 18 10:50:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEC53BBE5AA; Thu, 18 Aug 2016 10:50:42 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86F721D84; Thu, 18 Aug 2016 10:50:42 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAofRU026879; Thu, 18 Aug 2016 10:50:41 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAoeI5026862; Thu, 18 Aug 2016 10:50:40 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201608181050.u7IAoeI5026862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 18 Aug 2016 10:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304395 - in head: lib/libc/aarch64/sys lib/libc/amd64/sys lib/libc/arm/sys lib/libc/i386/sys lib/libc/mips/sys lib/libc/powerpc/sys lib/libc/powerpc64/sys lib/libc/riscv/sys lib/libc/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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:50:42 -0000 Author: gnn Date: Thu Aug 18 10:50:40 2016 New Revision: 304395 URL: https://svnweb.freebsd.org/changeset/base/304395 Log: Remove unusedd and obsolete openbsd_poll system call. (Phase 1) Reported by: brooks Reviewed by: brooks,jhb Differential Revision: https://reviews.freebsd.org/D7548 Modified: head/lib/libc/aarch64/sys/Makefile.inc head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/arm/sys/Makefile.inc head/lib/libc/i386/sys/Makefile.inc head/lib/libc/mips/sys/Makefile.inc head/lib/libc/powerpc/sys/Makefile.inc head/lib/libc/powerpc64/sys/Makefile.inc head/lib/libc/riscv/sys/Makefile.inc head/lib/libc/sparc64/sys/Makefile.inc head/sys/compat/freebsd32/syscalls.master head/sys/kern/capabilities.conf head/sys/kern/sys_generic.c head/sys/kern/syscalls.master head/sys/sys/param.h Modified: head/lib/libc/aarch64/sys/Makefile.inc ============================================================================== --- head/lib/libc/aarch64/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/aarch64/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -15,7 +15,6 @@ MDASM= cerror.S \ NOASM= break.o \ exit.o \ getlogin.o \ - openbsd_poll.o \ sbrk.o \ sstk.o \ vfork.o \ Modified: head/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- head/lib/libc/amd64/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/amd64/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -8,6 +8,6 @@ MDASM= vfork.S brk.S cerror.S exect.S ge sbrk.S setlogin.S sigreturn.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o +NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o PSEUDO= _getlogin.o _exit.o Modified: head/lib/libc/arm/sys/Makefile.inc ============================================================================== --- head/lib/libc/arm/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/arm/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -5,6 +5,6 @@ SRCS+= __vdso_gettc.c MDASM= Ovfork.S brk.S cerror.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o +NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o PSEUDO= _exit.o _getlogin.o Modified: head/lib/libc/i386/sys/Makefile.inc ============================================================================== --- head/lib/libc/i386/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/i386/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -11,7 +11,7 @@ MDASM= Ovfork.S brk.S cerror.S exect.S g sbrk.S setlogin.S sigreturn.S syscall.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o +NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o PSEUDO= _getlogin.o _exit.o Modified: head/lib/libc/mips/sys/Makefile.inc ============================================================================== --- head/lib/libc/mips/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/mips/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -6,6 +6,6 @@ MDASM= Ovfork.S brk.S cerror.S exect.S ptrace.S sbrk.S syscall.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o +NOASM= break.o exit.o getlogin.o sstk.o vfork.o yield.o PSEUDO= _exit.o _getlogin.o Modified: head/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/powerpc/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -3,6 +3,6 @@ MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o +NOASM= break.o exit.o getlogin.o sstk.o yield.o PSEUDO= _getlogin.o _exit.o Modified: head/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc64/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/powerpc64/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -3,6 +3,6 @@ MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o +NOASM= break.o exit.o getlogin.o sstk.o yield.o PSEUDO= _getlogin.o _exit.o Modified: head/lib/libc/riscv/sys/Makefile.inc ============================================================================== --- head/lib/libc/riscv/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/riscv/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -13,7 +13,6 @@ MDASM= cerror.S \ NOASM= break.o \ exit.o \ getlogin.o \ - openbsd_poll.o \ sbrk.o \ sstk.o \ vfork.o \ Modified: head/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/sys/Makefile.inc Thu Aug 18 10:50:27 2016 (r304394) +++ head/lib/libc/sparc64/sys/Makefile.inc Thu Aug 18 10:50:40 2016 (r304395) @@ -15,6 +15,6 @@ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S sigaction1.S # Don't generate default code for these syscalls: -NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o +NOASM= break.o exit.o getlogin.o sstk.o yield.o PSEUDO= _getlogin.o _exit.o Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Thu Aug 18 10:50:27 2016 (r304394) +++ head/sys/compat/freebsd32/syscalls.master Thu Aug 18 10:50:40 2016 (r304395) @@ -474,8 +474,7 @@ 250 AUE_MINHERIT NOPROTO { int minherit(void *addr, size_t len, \ int inherit); } 251 AUE_RFORK NOPROTO { int rfork(int flags); } -252 AUE_POLL NOPROTO { int openbsd_poll(struct pollfd *fds, \ - u_int nfds, int timeout); } +252 AUE_NULL OBSOL openbsd_poll 253 AUE_ISSETUGID NOPROTO { int issetugid(void); } 254 AUE_LCHOWN NOPROTO { int lchown(char *path, int uid, int gid); } 255 AUE_NULL STD { int freebsd32_aio_read( \ Modified: head/sys/kern/capabilities.conf ============================================================================== --- head/sys/kern/capabilities.conf Thu Aug 18 10:50:27 2016 (r304394) +++ head/sys/kern/capabilities.conf Thu Aug 18 10:50:40 2016 (r304395) @@ -463,14 +463,6 @@ utimensat open ## -## Allow poll(2), which will be scoped by capability rights. -## -## XXXRW: Perhaps we don't need the OpenBSD version? -## XXXRW: We don't yet do that scoping. -## -openbsd_poll - -## ## Process descriptor-related system calls are allowed. ## pdfork Modified: head/sys/kern/sys_generic.c ============================================================================== --- head/sys/kern/sys_generic.c Thu Aug 18 10:50:27 2016 (r304394) +++ head/sys/kern/sys_generic.c Thu Aug 18 10:50:40 2016 (r304395) @@ -1608,26 +1608,6 @@ pollscan(td, fds, nfd) } /* - * OpenBSD poll system call. - * - * XXX this isn't quite a true representation.. OpenBSD uses select ops. - */ -#ifndef _SYS_SYSPROTO_H_ -struct openbsd_poll_args { - struct pollfd *fds; - u_int nfds; - int timeout; -}; -#endif -int -sys_openbsd_poll(td, uap) - register struct thread *td; - register struct openbsd_poll_args *uap; -{ - return (sys_poll(td, (struct poll_args *)uap)); -} - -/* * XXX This was created specifically to support netncp and netsmb. This * allows the caller to specify a socket to wait for events on. It returns * 0 if any events matched and an error otherwise. There is no way to Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Thu Aug 18 10:50:27 2016 (r304394) +++ head/sys/kern/syscalls.master Thu Aug 18 10:50:40 2016 (r304395) @@ -472,8 +472,7 @@ 250 AUE_MINHERIT STD { int minherit(void *addr, size_t len, \ int inherit); } 251 AUE_RFORK STD { int rfork(int flags); } -252 AUE_POLL STD { int openbsd_poll(struct pollfd *fds, \ - u_int nfds, int timeout); } +252 AUE_NULL OBSOL openbsd_poll 253 AUE_ISSETUGID STD { int issetugid(void); } 254 AUE_LCHOWN STD { int lchown(char *path, int uid, int gid); } 255 AUE_NULL STD { int aio_read(struct aiocb *aiocbp); } Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Aug 18 10:50:27 2016 (r304394) +++ head/sys/sys/param.h Thu Aug 18 10:50:40 2016 (r304395) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200001 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200002 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Thu Aug 18 10:51:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EA7EBBE607; Thu, 18 Aug 2016 10:51:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44F761F71; Thu, 18 Aug 2016 10:51:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IApIwP027533; Thu, 18 Aug 2016 10:51:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IApI5I027532; Thu, 18 Aug 2016 10:51:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181051.u7IApI5I027532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:51:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304396 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:51:19 -0000 Author: mav Date: Thu Aug 18 10:51:18 2016 New Revision: 304396 URL: https://svnweb.freebsd.org/changeset/base/304396 Log: MFC r302510: Simplify MSIX MW BAR xlat setup, and don't forget to unlock its limit. The last fixes SB01BASE_LOCKUP workaround after driver reload. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:50:40 2016 (r304395) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:51:18 2016 (r304396) @@ -1833,42 +1833,23 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, ntb_reg_write(8, XEON_SBAR4XLAT_OFFSET, 0); if (HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) { - size_t size, xlatoffset; + uint32_t xlat_reg, lmt_reg; enum ntb_bar bar_num; - bar_num = ntb_mw_to_bar(ntb, ntb->msix_mw_idx); - switch (bar_num) { - case NTB_B2B_BAR_1: - size = 8; - xlatoffset = XEON_SBAR2XLAT_OFFSET; - break; - case NTB_B2B_BAR_2: - xlatoffset = XEON_SBAR4XLAT_OFFSET; - if (HAS_FEATURE(ntb, NTB_SPLIT_BAR)) - size = 4; - else - size = 8; - break; - case NTB_B2B_BAR_3: - xlatoffset = XEON_SBAR5XLAT_OFFSET; - size = 4; - break; - default: - KASSERT(false, ("Bogus msix mw idx: %u", - ntb->msix_mw_idx)); - return (EINVAL); - } - /* * We point the chosen MSIX MW BAR xlat to remote LAPIC for * workaround */ - if (size == 4) { - ntb_reg_write(4, xlatoffset, MSI_INTEL_ADDR_BASE); - ntb->msix_xlat = ntb_reg_read(4, xlatoffset); + bar_num = ntb_mw_to_bar(ntb, ntb->msix_mw_idx); + bar_get_xlat_params(ntb, bar_num, NULL, &xlat_reg, &lmt_reg); + if (bar_is_64bit(ntb, bar_num)) { + ntb_reg_write(8, xlat_reg, MSI_INTEL_ADDR_BASE); + ntb->msix_xlat = ntb_reg_read(8, xlat_reg); + ntb_reg_write(8, lmt_reg, 0); } else { - ntb_reg_write(8, xlatoffset, MSI_INTEL_ADDR_BASE); - ntb->msix_xlat = ntb_reg_read(8, xlatoffset); + ntb_reg_write(4, xlat_reg, MSI_INTEL_ADDR_BASE); + ntb->msix_xlat = ntb_reg_read(4, xlat_reg); + ntb_reg_write(8, lmt_reg, 0); } ntb->peer_lapic_bar = &ntb->bar_info[bar_num]; From owner-svn-src-all@freebsd.org Thu Aug 18 10:51:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C625BBBE742; Thu, 18 Aug 2016 10:51:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98DCE1291; Thu, 18 Aug 2016 10:51:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAprYa029783; Thu, 18 Aug 2016 10:51:53 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAprxw029782; Thu, 18 Aug 2016 10:51:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181051.u7IAprxw029782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:51:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304397 - stable/10/sys/dev/ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:51:54 -0000 Author: mav Date: Thu Aug 18 10:51:53 2016 New Revision: 304397 URL: https://svnweb.freebsd.org/changeset/base/304397 Log: MFC r302529: Remove callout_reset(link_work) from ntb_transport_attach(). At that point link is quite likely not established yet, so messing with scratch registers is premature there. Original commit message mentioned code diff reduction from Linux, but this line is not present in Linux now. Modified: stable/10/sys/dev/ntb/ntb_transport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:51:18 2016 (r304396) +++ stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:51:53 2016 (r304397) @@ -398,7 +398,6 @@ ntb_transport_attach(device_t dev) nt->link_is_up = false; NTB_LINK_ENABLE(ntb, NTB_SPEED_AUTO, NTB_WIDTH_AUTO); - callout_reset(&nt->link_work, 0, ntb_transport_link_work, nt); if (enable_xeon_watchdog != 0) callout_reset(&nt->link_watchdog, 0, xeon_link_watchdog_hb, nt); From owner-svn-src-all@freebsd.org Thu Aug 18 10:52:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89861BBE7F5; Thu, 18 Aug 2016 10:52:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4ED1553; Thu, 18 Aug 2016 10:52:30 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAqTfC030510; Thu, 18 Aug 2016 10:52:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAqTa3030509; Thu, 18 Aug 2016 10:52:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181052.u7IAqTa3030509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304398 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:52:30 -0000 Author: mav Date: Thu Aug 18 10:52:29 2016 New Revision: 304398 URL: https://svnweb.freebsd.org/changeset/base/304398 Log: MFC r302530: Fix wrong copy/paste in r302510. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:51:53 2016 (r304397) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:52:29 2016 (r304398) @@ -1849,7 +1849,7 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, } else { ntb_reg_write(4, xlat_reg, MSI_INTEL_ADDR_BASE); ntb->msix_xlat = ntb_reg_read(4, xlat_reg); - ntb_reg_write(8, lmt_reg, 0); + ntb_reg_write(4, lmt_reg, 0); } ntb->peer_lapic_bar = &ntb->bar_info[bar_num]; From owner-svn-src-all@freebsd.org Thu Aug 18 10:53:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18C71BBE87D; Thu, 18 Aug 2016 10:53:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C35A616E4; Thu, 18 Aug 2016 10:53:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAr3vO030590; Thu, 18 Aug 2016 10:53:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAr3PO030589; Thu, 18 Aug 2016 10:53:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181053.u7IAr3PO030589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304399 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:53:05 -0000 Author: mav Date: Thu Aug 18 10:53:03 2016 New Revision: 304399 URL: https://svnweb.freebsd.org/changeset/base/304399 Log: MFC r302531: Revert odd change, setting limit registers before base. I don't know what errata is mentioned there, I was unable to find it, but setting limit before the base simply does not work at all. According to specification attempt to set limit out of the present window range resets it to zero, effectively disabling it. And that is what I see in practice. Fixing this properly disables access for remote side to our memory until respective xlat is negotiated and set. As I see, Linux does the same. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:52:29 2016 (r304398) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:53:03 2016 (r304399) @@ -1715,26 +1715,22 @@ xeon_set_sbar_base_and_limit(struct ntb_ bar_addr = 0; } - /* - * Set limit registers first to avoid an errata where setting the base - * registers locks the limit registers. - */ if (!bar_is_64bit(ntb, idx)) { - ntb_reg_write(4, lmt_reg, bar_addr); - reg_val = ntb_reg_read(4, lmt_reg); - (void)reg_val; - ntb_reg_write(4, base_reg, bar_addr); reg_val = ntb_reg_read(4, base_reg); (void)reg_val; - } else { - ntb_reg_write(8, lmt_reg, bar_addr); - reg_val = ntb_reg_read(8, lmt_reg); - (void)reg_val; + ntb_reg_write(4, lmt_reg, bar_addr); + reg_val = ntb_reg_read(4, lmt_reg); + (void)reg_val; + } else { ntb_reg_write(8, base_reg, bar_addr); reg_val = ntb_reg_read(8, base_reg); (void)reg_val; + + ntb_reg_write(8, lmt_reg, bar_addr); + reg_val = ntb_reg_read(8, lmt_reg); + (void)reg_val; } } From owner-svn-src-all@freebsd.org Thu Aug 18 10:53:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8627BBE8F3; Thu, 18 Aug 2016 10:53:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 768FF1886; Thu, 18 Aug 2016 10:53:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAriPs030671; Thu, 18 Aug 2016 10:53:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAri6N030669; Thu, 18 Aug 2016 10:53:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181053.u7IAri6N030669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:53:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304400 - in stable/10/sys/dev/ntb: . ntb_hw X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:53:45 -0000 Author: mav Date: Thu Aug 18 10:53:44 2016 New Revision: 304400 URL: https://svnweb.freebsd.org/changeset/base/304400 Log: MFC r302622 (by sephe): ntb: Fix LINT Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c stable/10/sys/dev/ntb/ntb_transport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:53:03 2016 (r304399) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:53:44 2016 (r304400) @@ -630,8 +630,6 @@ SYSCTL_UQUAD(_hw_ntb_xeon_b2b, OID_AUTO, */ MALLOC_DEFINE(M_NTB, "ntb_hw", "ntb_hw driver memory allocations"); -SYSCTL_NODE(_hw, OID_AUTO, ntb, CTLFLAG_RW, 0, "NTB sysctls"); - /* * OS <-> Driver linkage functions */ Modified: stable/10/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:53:03 2016 (r304399) +++ stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:53:44 2016 (r304400) @@ -886,7 +886,7 @@ ntb_memcpy_rx(struct ntb_transport_qp *q /* Ensure that the data is globally visible before clearing the flag */ wmb(); - CTR2(KTR_NTB, "RX: copied entry %p to mbuf %p.", entry, m); + CTR2(KTR_NTB, "RX: copied entry %p to mbuf %p.", entry, entry->buf); ntb_rx_copy_callback(qp, entry); } From owner-svn-src-all@freebsd.org Thu Aug 18 10:54:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E000CBBE961; Thu, 18 Aug 2016 10:54:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC6EF19F2; Thu, 18 Aug 2016 10:54:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAsLAB030753; Thu, 18 Aug 2016 10:54:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAsL0C030752; Thu, 18 Aug 2016 10:54:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181054.u7IAsL0C030752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:54:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304401 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:54:23 -0000 Author: mav Date: Thu Aug 18 10:54:21 2016 New Revision: 304401 URL: https://svnweb.freebsd.org/changeset/base/304401 Log: MFC r303266: Postpone ntb_get_msix_info() till we need to negotiate MSIX. Calling it earlier increases the window when MSIX info may change. This change does not solve the problem completely, but seems logical. Complete solution should probably include link reset in case of MSIX remap to trigger new negotiation, but we have no way to get notified about that now. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:53:44 2016 (r304400) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:54:21 2016 (r304401) @@ -1099,8 +1099,6 @@ ntb_init_isr(struct ntb_softc *ntb) ntb_create_msix_vec(ntb, num_vectors); rc = ntb_setup_msix(ntb, num_vectors); - if (rc == 0 && HAS_FEATURE(ntb, NTB_SB01BASE_LOCKUP)) - ntb_get_msix_info(ntb); } if (rc != 0) { device_printf(ntb->device, @@ -2735,6 +2733,7 @@ ntb_exchange_msix(void *ctx) if (ntb->peer_msix_done) goto msix_done; + ntb_get_msix_info(ntb); for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { ntb_peer_spad_write(ntb->device, NTB_MSIX_DATA0 + i, ntb->msix_data[i].nmd_data); From owner-svn-src-all@freebsd.org Thu Aug 18 10:54:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A32D2BBE9C2; Thu, 18 Aug 2016 10:54:41 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7535F1BB4; Thu, 18 Aug 2016 10:54:41 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAseRv030823; Thu, 18 Aug 2016 10:54:40 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAsd6j030811; Thu, 18 Aug 2016 10:54:39 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201608181054.u7IAsd6j030811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Thu, 18 Aug 2016 10:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304402 - in head: . sys/compat/freebsd32 sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:54:41 -0000 Author: gnn Date: Thu Aug 18 10:54:39 2016 New Revision: 304402 URL: https://svnweb.freebsd.org/changeset/base/304402 Log: Remove the obsolete and unused openbsd_poll system call. (Phase 2) Reported by: brooks Reviewed by: brooks, jhb Differential Revision: https://reviews.freebsd.org/D7548 Modified: head/UPDATING head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Aug 18 10:54:21 2016 (r304401) +++ head/UPDATING Thu Aug 18 10:54:39 2016 (r304402) @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160818: + Remove the openbsd_poll system call. + __FreeBSD_version has been bumped because of this. + 20160622: The libc stub for the pipe(2) system call has been replaced with a wrapper that calls the pipe2(2) system call and the pipe(2) Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/compat/freebsd32/freebsd32_proto.h Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ #ifndef _FREEBSD32_SYSPROTO_H_ Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ #define FREEBSD32_SYS_syscall 0 @@ -218,7 +218,7 @@ #define FREEBSD32_SYS_freebsd32_clock_getcpuclockid2 247 #define FREEBSD32_SYS_minherit 250 #define FREEBSD32_SYS_rfork 251 -#define FREEBSD32_SYS_openbsd_poll 252 + /* 252 is obsolete openbsd_poll */ #define FREEBSD32_SYS_issetugid 253 #define FREEBSD32_SYS_lchown 254 #define FREEBSD32_SYS_freebsd32_aio_read 255 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ const char *freebsd32_syscallnames[] = { @@ -262,7 +262,7 @@ const char *freebsd32_syscallnames[] = { "#249", /* 249 = nosys */ "minherit", /* 250 = minherit */ "rfork", /* 251 = rfork */ - "openbsd_poll", /* 252 = openbsd_poll */ + "obs_openbsd_poll", /* 252 = obsolete openbsd_poll */ "issetugid", /* 253 = issetugid */ "lchown", /* 254 = lchown */ "freebsd32_aio_read", /* 255 = freebsd32_aio_read */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ #include "opt_compat.h" @@ -305,7 +305,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 249 = nosys */ { AS(minherit_args), (sy_call_t *)sys_minherit, AUE_MINHERIT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 250 = minherit */ { AS(rfork_args), (sy_call_t *)sys_rfork, AUE_RFORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 251 = rfork */ - { AS(openbsd_poll_args), (sy_call_t *)sys_openbsd_poll, AUE_POLL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 252 = openbsd_poll */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 252 = obsolete openbsd_poll */ { 0, (sy_call_t *)sys_issetugid, AUE_ISSETUGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 253 = issetugid */ { AS(lchown_args), (sy_call_t *)sys_lchown, AUE_LCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = lchown */ { AS(freebsd32_aio_read_args), (sy_call_t *)freebsd32_aio_read, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 255 = freebsd32_aio_read */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Thu Aug 18 10:54:39 2016 (r304402) @@ -1286,15 +1286,6 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } - /* openbsd_poll */ - case 252: { - struct openbsd_poll_args *p = params; - uarg[0] = (intptr_t) p->fds; /* struct pollfd * */ - uarg[1] = p->nfds; /* u_int */ - iarg[2] = p->timeout; /* int */ - *n_args = 3; - break; - } /* issetugid */ case 253: { *n_args = 0; @@ -5357,22 +5348,6 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* openbsd_poll */ - case 252: - switch(ndx) { - case 0: - p = "struct pollfd *"; - break; - case 1: - p = "u_int"; - break; - case 2: - p = "int"; - break; - default: - break; - }; - break; /* issetugid */ case 253: break; @@ -9666,11 +9641,6 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* openbsd_poll */ - case 252: - if (ndx == 0 || ndx == 1) - p = "int"; - break; /* issetugid */ case 253: /* lchown */ Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/kern/init_sysent.c Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/kern/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ #include "opt_compat.h" @@ -298,7 +298,7 @@ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 249 = nosys */ { AS(minherit_args), (sy_call_t *)sys_minherit, AUE_MINHERIT, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 250 = minherit */ { AS(rfork_args), (sy_call_t *)sys_rfork, AUE_RFORK, NULL, 0, 0, 0, SY_THR_STATIC }, /* 251 = rfork */ - { AS(openbsd_poll_args), (sy_call_t *)sys_openbsd_poll, AUE_POLL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 252 = openbsd_poll */ + { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 252 = obsolete openbsd_poll */ { 0, (sy_call_t *)sys_issetugid, AUE_ISSETUGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 253 = issetugid */ { AS(lchown_args), (sy_call_t *)sys_lchown, AUE_LCHOWN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 254 = lchown */ { AS(aio_read_args), (sy_call_t *)sys_aio_read, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 255 = aio_read */ Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/kern/syscalls.c Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/kern/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ const char *syscallnames[] = { @@ -259,7 +259,7 @@ const char *syscallnames[] = { "#249", /* 249 = nosys */ "minherit", /* 250 = minherit */ "rfork", /* 251 = rfork */ - "openbsd_poll", /* 252 = openbsd_poll */ + "obs_openbsd_poll", /* 252 = obsolete openbsd_poll */ "issetugid", /* 253 = issetugid */ "lchown", /* 254 = lchown */ "aio_read", /* 255 = aio_read */ Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/kern/systrace_args.c Thu Aug 18 10:54:39 2016 (r304402) @@ -1322,15 +1322,6 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } - /* openbsd_poll */ - case 252: { - struct openbsd_poll_args *p = params; - uarg[0] = (intptr_t) p->fds; /* struct pollfd * */ - uarg[1] = p->nfds; /* u_int */ - iarg[2] = p->timeout; /* int */ - *n_args = 3; - break; - } /* issetugid */ case 253: { *n_args = 0; @@ -5426,22 +5417,6 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* openbsd_poll */ - case 252: - switch(ndx) { - case 0: - p = "struct pollfd *"; - break; - case 1: - p = "u_int"; - break; - case 2: - p = "int"; - break; - default: - break; - }; - break; /* issetugid */ case 253: break; @@ -9648,11 +9623,6 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* openbsd_poll */ - case 252: - if (ndx == 0 || ndx == 1) - p = "int"; - break; /* issetugid */ case 253: /* lchown */ Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/sys/syscall.h Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/kern/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ #define SYS_syscall 0 @@ -223,7 +223,7 @@ #define SYS_ntp_gettime 248 #define SYS_minherit 250 #define SYS_rfork 251 -#define SYS_openbsd_poll 252 + /* 252 is obsolete openbsd_poll */ #define SYS_issetugid 253 #define SYS_lchown 254 #define SYS_aio_read 255 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/sys/syscall.mk Thu Aug 18 10:54:39 2016 (r304402) @@ -1,7 +1,7 @@ # FreeBSD system call object files. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib +# created from FreeBSD: head/sys/kern/syscalls.master 304395 2016-08-18 10:50:40Z gnn MIASM = \ syscall.o \ exit.o \ @@ -163,7 +163,6 @@ MIASM = \ ntp_gettime.o \ minherit.o \ rfork.o \ - openbsd_poll.o \ issetugid.o \ lchown.o \ aio_read.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Thu Aug 18 10:54:21 2016 (r304401) +++ head/sys/sys/sysproto.h Thu Aug 18 10:54:39 2016 (r304402) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 304176 2016-08-15 19:08:51Z kib + * created from FreeBSD: head/sys/kern/syscalls.master 304395 2016-08-18 10:50:40Z gnn */ #ifndef _SYS_SYSPROTO_H_ @@ -714,11 +714,6 @@ struct minherit_args { struct rfork_args { char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; }; -struct openbsd_poll_args { - char fds_l_[PADL_(struct pollfd *)]; struct pollfd * fds; char fds_r_[PADR_(struct pollfd *)]; - char nfds_l_[PADL_(u_int)]; u_int nfds; char nfds_r_[PADR_(u_int)]; - char timeout_l_[PADL_(int)]; int timeout; char timeout_r_[PADR_(int)]; -}; struct issetugid_args { register_t dummy; }; @@ -1946,7 +1941,6 @@ int sys_clock_getcpuclockid2(struct thre int sys_ntp_gettime(struct thread *, struct ntp_gettime_args *); int sys_minherit(struct thread *, struct minherit_args *); int sys_rfork(struct thread *, struct rfork_args *); -int sys_openbsd_poll(struct thread *, struct openbsd_poll_args *); int sys_issetugid(struct thread *, struct issetugid_args *); int sys_lchown(struct thread *, struct lchown_args *); int sys_aio_read(struct thread *, struct aio_read_args *); @@ -2717,7 +2711,6 @@ int freebsd10_pipe(struct thread *, stru #define SYS_AUE_ntp_gettime AUE_NULL #define SYS_AUE_minherit AUE_MINHERIT #define SYS_AUE_rfork AUE_RFORK -#define SYS_AUE_openbsd_poll AUE_POLL #define SYS_AUE_issetugid AUE_ISSETUGID #define SYS_AUE_lchown AUE_LCHOWN #define SYS_AUE_aio_read AUE_NULL From owner-svn-src-all@freebsd.org Thu Aug 18 10:57:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E036BBEAC6; Thu, 18 Aug 2016 10:57:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 460281D81; Thu, 18 Aug 2016 10:57:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAvJZM031022; Thu, 18 Aug 2016 10:57:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAvJSp031017; Thu, 18 Aug 2016 10:57:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181057.u7IAvJSp031017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:57:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304403 - stable/10/share/man/man4 X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:57:20 -0000 Author: mav Date: Thu Aug 18 10:57:18 2016 New Revision: 304403 URL: https://svnweb.freebsd.org/changeset/base/304403 Log: MFC r302520: Replace NTB man page with more detailed and up to date. Sponsored by: iXsystems, Inc. Added: stable/10/share/man/man4/if_ntb.4 - copied unchanged from r302520, head/share/man/man4/if_ntb.4 stable/10/share/man/man4/ntb_hw.4 - copied unchanged from r302520, head/share/man/man4/ntb_hw.4 stable/10/share/man/man4/ntb_transport.4 - copied unchanged from r302520, head/share/man/man4/ntb_transport.4 Modified: stable/10/share/man/man4/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Thu Aug 18 10:54:39 2016 (r304402) +++ stable/10/share/man/man4/Makefile Thu Aug 18 10:57:18 2016 (r304403) @@ -358,7 +358,9 @@ MAN= aac.4 \ ng_vlan.4 \ nmdm.4 \ nsp.4 \ - ${_ntb.4} \ + ${_ntb_hw.4} \ + ${_ntb_transport.4} \ + ${_if_ntb.4} \ null.4 \ ${_nvd.4} \ ${_nve.4} \ @@ -656,8 +658,7 @@ MLINKS+=netintro.4 net.4 \ netintro.4 networking.4 MLINKS+=${_nfe.4} ${_if_nfe.4} MLINKS+=nge.4 if_nge.4 -MLINKS+=${_ntb.4} ${_if_ntb.4} \ - ${_ntb.4} ${_ntb_hw.4} +MLINKS+=${_ntb_hw.4} ${_ntb.4} MLINKS+=${_nve.4} ${_if_nve.4} MLINKS+=${_nxge.4} ${_if_nxge.4} MLINKS+=patm.4 if_patm.4 @@ -801,6 +802,7 @@ _if_ntb.4= if_ntb.4 _ioat.4= ioat.4 _ntb.4= ntb.4 _ntb_hw.4= ntb_hw.4 +_ntb_transport.4=ntb_transport.4 _qlxge.4= qlxge.4 _qlxgb.4= qlxgb.4 _qlxgbe.4= qlxgbe.4 Copied: stable/10/share/man/man4/if_ntb.4 (from r302520, head/share/man/man4/if_ntb.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/if_ntb.4 Thu Aug 18 10:57:18 2016 (r304403, copy of r302520, head/share/man/man4/if_ntb.4) @@ -0,0 +1,86 @@ +.\" +.\" Copyright (c) 2016 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. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 10, 2016 +.Dt IF_NTB 4 +.Os +.Sh NAME +.Nm if_ntb +.Nd Virtual Ethernet interface for Non-Transparent Bridges +.Sh SYNOPSIS +To compile this driver into your kernel, +place the following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device if_ntb" +.Ed +.Pp +Or, to load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_ntb_load="YES" +.Ed +.Pp +The following tunables are settable from the +.Xr loader 8 : +.Bl -ohang +.It Va hw.if_ntb.num_queues +Number of transport queues to use per interface. +Default is 1. +.El +.Sh DESCRIPTION +The +.Nm +driver attaches on top of the +.Xr ntb_transport 4 +driver to utilize its resources to create virtual Ethernet interface between +the systems. +Interface capabilities depend on the underlying transport. +Typical MTU is about 64KB to reduce overhead. +By default one queue is used, but more may be configured. +The MAC address for interface is randomly generated. +.Pp +The +.Nm +driver does not implement any real hardware offload, but since PCIe link is +protected by CRC32, in some situations it may be possible to save some CPU +cycles by enabling fake checksum offload on both link sides via setting +.Cm rxcsum +and +.Cm txcsum +interface options. +.Sh SEE ALSO +.Xr ntb_transport 4 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was developed by Intel and originally written by +.An Carl Delsey Aq Mt carl@FreeBSD.org . +Later improvements were done by +.An Conrad E. Meyer Aq Mt cem@FreeBSD.org +and +.An Alexander Motin Aq Mt mav@FreeBSD.org . Copied: stable/10/share/man/man4/ntb_hw.4 (from r302520, head/share/man/man4/ntb_hw.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/ntb_hw.4 Thu Aug 18 10:57:18 2016 (r304403, copy of r302520, head/share/man/man4/ntb_hw.4) @@ -0,0 +1,103 @@ +.\" +.\" Copyright (c) 2016 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. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 10, 2016 +.Dt NTB_HW 4 +.Os +.Sh NAME +.Nm ntb , +.Nm ntb_hw +.Nd Intel(R) Non-Transparent Bridge driver +.Sh SYNOPSIS +To compile this driver into your kernel, +place the following lines in your kernel configuration file: +.Bd -ragged -offset indent +.Cd "device ntb_hw" +.Ed +.Pp +Or, to load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +ntb_hw_load="YES" +.Ed +.Pp +The following tunables are settable from the +.Xr loader 8 : +.Bl -ohang +.It Va hw.ntb.debug_level +Driver debug level. +The default value is 0, higher means more verbose. +.El +.Sh DESCRIPTION +The NTB allows you to connect two computer systems using a PCIe link if they +have the correct equipment and connectors. +The +.Nm ntb_hw +driver provides support for the Non-Transparent Bridge (NTB) in the Intel S1200 +and Xeon E3/E5 processor families. +The +.Nm +driver hides hardware details, exposing memory windows, scratchpads and +doorbells via hardware independent KPI. +.Pp +The hardware provides 2-3 memory windows to the other system's memory, +16 scratchpad registers and 14/34 doorbells to interrupt the other system. +On Xeon processors one of memory windows is typically consumed by the driver +to workaround multiple hardware erratas. +.Sh CONFIGURATION +Tne NTB configuration should be set by BIOS. +It includes enabling NTB, choosing between NTB-to-NTB or NTB-to-Root Port mode, +enabling split BAR mode (one of two 64-bit BARs can be split into two 32-bit +ones) and configuring BAR sizes in bits (from 12 to 29/39) for both NTB sides. +.Pp +The recommended configuration is NTB-to-NTB mode, split bar is enabled and +all BAR sizes are set to 20 (1 MiB). +This needs to be done on both systems. +.Sh SEE ALSO +.Xr ntb_transport 4 , +.Xr if_ntb 4 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was developed by Intel and originally written by +.An Carl Delsey Aq Mt carl@FreeBSD.org . +Later improvements were done by +.An Conrad E. Meyer Aq Mt cem@FreeBSD.org +and +.An Alexander Motin Aq Mt mav@FreeBSD.org . +.Sh BUGS +NTB-to-Root Port mode is not yet supported, but it doesn't look very useful. +.Pp +On Xeon v2/v3/v4 processors split BAR mode should be enabled to allow +SB01BASE_LOCKUP errata workaround to be applied by the driver. +.Pp +There is no way to protect your system from malicious behavior on the other +system once the link is brought up. +Anyone with root or kernel access on the other system can read or write to +any location on your system. +In other words, only connect two systems that completely trust each other. Copied: stable/10/share/man/man4/ntb_transport.4 (from r302520, head/share/man/man4/ntb_transport.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/share/man/man4/ntb_transport.4 Thu Aug 18 10:57:18 2016 (r304403, copy of r302520, head/share/man/man4/ntb_transport.4) @@ -0,0 +1,74 @@ +.\" +.\" Copyright (c) 2016 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. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd July 10, 2016 +.Dt NTB_TRANSPORT 4 +.Os +.Sh NAME +.Nm ntb_transport +.Nd Packet-oriented transport for Non-Transparent Bridges +.Sh SYNOPSIS +To load the driver as a module at boot, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +ntb_transport_load="YES" +.Ed +.Pp +The following tunables are settable from the +.Xr loader 8 : +.Bl -ohang +.It Va hw.ntb_transport.debug_level +Driver debug level. +The default value is 0, higher means more verbose. +.It Va hw.ntb_transport.max_num_clients +Number of bidirectional queues to setup. +The default value is 0, that means one queue per available memory window. +Maximal number is limited by number of doorbells. +.El +.Sh DESCRIPTION +The +.Nm +driver attaches on top of the +.Nm ntb +driver to utilize its resources to create set of bidirectional queues, +delivering packets between the systems. +The primary purpose of this is to be used by +.Nm if_ntb +network interface, but other consumers may also be developed using KPI. +.Sh SEE ALSO +.Xr if_ntb 4 , +.Xr ntb_hw 4 +.Sh AUTHORS +.An -nosplit +The +.Nm +driver was developed by Intel and originally written by +.An Carl Delsey Aq Mt carl@FreeBSD.org . +Later improvements were done by +.An Conrad E. Meyer Aq Mt cem@FreeBSD.org +and +.An Alexander Motin Aq Mt mav@FreeBSD.org . From owner-svn-src-all@freebsd.org Thu Aug 18 10:59:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FB7ABBEC47; Thu, 18 Aug 2016 10:59:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B21E71F99; Thu, 18 Aug 2016 10:59:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IAxDUO031161; Thu, 18 Aug 2016 10:59:13 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IAxCx6031156; Thu, 18 Aug 2016 10:59:12 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181059.u7IAxCx6031156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 10:59:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304404 - in stable/10: share/man/man4 sys/dev/ntb sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 10:59:14 -0000 Author: mav Date: Thu Aug 18 10:59:12 2016 New Revision: 304404 URL: https://svnweb.freebsd.org/changeset/base/304404 Log: MFC r303429, r303437, r303551: Once more refactor KPI between NTB hardware and consumers. New design allows hardware resources to be split between several consumers. For example, one BAR can be dedicated for remote memory access, while other resources can be used for packet transport for virtual Ethernet interface. And even without resource split, this code allows to specify which consumer driver should attach the hardware. From some points this makes the code even closer to Linux one, even though Linux does not provide the described flexibility. Modified: stable/10/share/man/man4/ntb_hw.4 stable/10/sys/dev/ntb/ntb.c stable/10/sys/dev/ntb/ntb.h stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c stable/10/sys/dev/ntb/ntb_if.m stable/10/sys/dev/ntb/ntb_transport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/ntb_hw.4 ============================================================================== --- stable/10/share/man/man4/ntb_hw.4 Thu Aug 18 10:57:18 2016 (r304403) +++ stable/10/share/man/man4/ntb_hw.4 Thu Aug 18 10:59:12 2016 (r304404) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2016 +.Dd July 28, 2016 .Dt NTB_HW 4 .Os .Sh NAME @@ -51,6 +51,20 @@ The following tunables are settable from .It Va hw.ntb.debug_level Driver debug level. The default value is 0, higher means more verbose. +.It Va hint.ntb_hw. Ns Ar X Ns Va .config +Configures NTB resources split between several consumer devices. +Configuration of multiple consumer devices separated by commas. +Each device can be configured as: "[:[:[:]]]", where: +.Va name +is a name of the driver which should attach the device (empty means any), +.Va mw +is a number of memory windows to allocate (empty means all available), +.Va spad +is a number of scratchpad registers to allocate (empty means all available), +.Va db +is a number of doorbells to allocate (empty means all available). +The default configuration is empty string, which means single device +with all available resources allowing any driver attachment. .El .Sh DESCRIPTION The NTB allows you to connect two computer systems using a PCIe link if they @@ -69,7 +83,7 @@ The hardware provides 2-3 memory windows On Xeon processors one of memory windows is typically consumed by the driver to workaround multiple hardware erratas. .Sh CONFIGURATION -Tne NTB configuration should be set by BIOS. +The NTB configuration should be set by BIOS. It includes enabling NTB, choosing between NTB-to-NTB or NTB-to-Root Port mode, enabling split BAR mode (one of two 64-bit BARs can be split into two 32-bit ones) and configuring BAR sizes in bits (from 12 to 29/39) for both NTB sides. Modified: stable/10/sys/dev/ntb/ntb.c ============================================================================== --- stable/10/sys/dev/ntb/ntb.c Thu Aug 18 10:57:18 2016 (r304403) +++ stable/10/sys/dev/ntb/ntb.c Thu Aug 18 10:59:12 2016 (r304404) @@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -40,4 +42,422 @@ __FBSDID("$FreeBSD$"); devclass_t ntb_hw_devclass; SYSCTL_NODE(_hw, OID_AUTO, ntb, CTLFLAG_RW, 0, "NTB sysctls"); +struct ntb_child { + device_t dev; + int enabled; + int mwoff; + int mwcnt; + int spadoff; + int spadcnt; + int dboff; + int dbmask; + void *ctx; + const struct ntb_ctx_ops *ctx_ops; + struct rmlock ctx_lock; + struct ntb_child *next; +}; + +int +ntb_register_device(device_t dev) +{ + struct ntb_child **cpp = device_get_softc(dev); + struct ntb_child *nc; + int i, mw, mwu, mwt, spad, spadu, spadt, db, dbu, dbt; + char cfg[128] = ""; + char buf[32]; + char *n, *np, *c, *p, *name; + + mwu = 0; + mwt = NTB_MW_COUNT(dev); + spadu = 0; + spadt = NTB_SPAD_COUNT(dev); + dbu = 0; + dbt = flsll(NTB_DB_VALID_MASK(dev)); + + device_printf(dev, "%d memory windows, %d scratchpads, " + "%d doorbells\n", mwt, spadt, dbt); + + snprintf(buf, sizeof(buf), "hint.%s.%d.config", device_get_name(dev), + device_get_unit(dev)); + TUNABLE_STR_FETCH(buf, cfg, sizeof(cfg)); + n = cfg; + i = 0; + while ((c = strsep(&n, ",")) != NULL) { + np = c; + name = strsep(&np, ":"); + if (name != NULL && name[0] == 0) + name = NULL; + p = strsep(&np, ":"); + mw = (p && p[0] != 0) ? strtol(p, NULL, 10) : mwt - mwu; + p = strsep(&np, ":"); + spad = (p && p[0] != 0) ? strtol(p, NULL, 10) : spadt - spadu; + db = (np && np[0] != 0) ? strtol(np, NULL, 10) : dbt - dbu; + + if (mw > mwt - mwu || spad > spadt - spadu || db > dbt - dbu) { + device_printf(dev, "Not enough resources for config\n"); + break; + } + + nc = malloc(sizeof(*nc), M_DEVBUF, M_WAITOK | M_ZERO); + nc->mwoff = mwu; + nc->mwcnt = mw; + nc->spadoff = spadu; + nc->spadcnt = spad; + nc->dboff = dbu; + nc->dbmask = (db == 0) ? 0 : (0xffffffffffffffff >> (64 - db)); + rm_init(&nc->ctx_lock, "ntb ctx"); + nc->dev = device_add_child(dev, name, -1); + if (nc->dev == NULL) { + ntb_unregister_device(dev); + return (ENOMEM); + } + device_set_ivars(nc->dev, nc); + *cpp = nc; + cpp = &nc->next; + + if (bootverbose) { + device_printf(dev, "%d \"%s\":", i, name); + if (mw > 0) { + printf(" memory windows %d", mwu); + if (mw > 1) + printf("-%d", mwu + mw - 1); + } + if (spad > 0) { + printf(" scratchpads %d", spadu); + if (spad > 1) + printf("-%d", spadu + spad - 1); + } + if (db > 0) { + printf(" doorbells %d", dbu); + if (db > 1) + printf("-%d", dbu + db - 1); + } + printf("\n"); + } + + mwu += mw; + spadu += spad; + dbu += db; + i++; + } + + bus_generic_attach(dev); + return (0); +} + +int +ntb_unregister_device(device_t dev) +{ + struct ntb_child **cpp = device_get_softc(dev); + struct ntb_child *nc; + int error = 0; + + while ((nc = *cpp) != NULL) { + *cpp = (*cpp)->next; + error = device_delete_child(dev, nc->dev); + if (error) + break; + rm_destroy(&nc->ctx_lock); + free(nc, M_DEVBUF); + } + return (error); +} + +void +ntb_link_event(device_t dev) +{ + struct ntb_child **cpp = device_get_softc(dev); + struct ntb_child *nc; + struct rm_priotracker ctx_tracker; + + for (nc = *cpp; nc != NULL; nc = nc->next) { + rm_rlock(&nc->ctx_lock, &ctx_tracker); + if (nc->ctx_ops != NULL && nc->ctx_ops->link_event != NULL) + nc->ctx_ops->link_event(nc->ctx); + rm_runlock(&nc->ctx_lock, &ctx_tracker); + } +} + +void +ntb_db_event(device_t dev, uint32_t vec) +{ + struct ntb_child **cpp = device_get_softc(dev); + struct ntb_child *nc; + struct rm_priotracker ctx_tracker; + + for (nc = *cpp; nc != NULL; nc = nc->next) { + rm_rlock(&nc->ctx_lock, &ctx_tracker); + if (nc->ctx_ops != NULL && nc->ctx_ops->db_event != NULL) + nc->ctx_ops->db_event(nc->ctx, vec); + rm_runlock(&nc->ctx_lock, &ctx_tracker); + } +} + +bool +ntb_link_is_up(device_t ntb, enum ntb_speed *speed, enum ntb_width *width) +{ + + return (NTB_LINK_IS_UP(device_get_parent(ntb), speed, width)); +} + +int +ntb_link_enable(device_t ntb, enum ntb_speed speed, enum ntb_width width) +{ + struct ntb_child *nc = device_get_ivars(ntb); + struct ntb_child **cpp = device_get_softc(device_get_parent(nc->dev)); + struct ntb_child *nc1; + + for (nc1 = *cpp; nc1 != NULL; nc1 = nc1->next) { + if (nc1->enabled) { + nc->enabled = 1; + return (0); + } + } + nc->enabled = 1; + return (NTB_LINK_ENABLE(device_get_parent(ntb), speed, width)); +} + +int +ntb_link_disable(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + struct ntb_child **cpp = device_get_softc(device_get_parent(nc->dev)); + struct ntb_child *nc1; + + if (!nc->enabled) + return (0); + nc->enabled = 0; + for (nc1 = *cpp; nc1 != NULL; nc1 = nc1->next) { + if (nc1->enabled) + return (0); + } + return (NTB_LINK_DISABLE(device_get_parent(ntb))); +} + +bool +ntb_link_enabled(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (nc->enabled && NTB_LINK_ENABLED(device_get_parent(ntb))); +} + +int +ntb_set_ctx(device_t ntb, void *ctx, const struct ntb_ctx_ops *ctx_ops) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + if (ctx == NULL || ctx_ops == NULL) + return (EINVAL); + + rm_wlock(&nc->ctx_lock); + if (nc->ctx_ops != NULL) { + rm_wunlock(&nc->ctx_lock); + return (EINVAL); + } + nc->ctx = ctx; + nc->ctx_ops = ctx_ops; + rm_wunlock(&nc->ctx_lock); + + return (0); +} + +void * +ntb_get_ctx(device_t ntb, const struct ntb_ctx_ops **ctx_ops) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + KASSERT(nc->ctx != NULL && nc->ctx_ops != NULL, ("bogus")); + if (ctx_ops != NULL) + *ctx_ops = nc->ctx_ops; + return (nc->ctx); +} + +void +ntb_clear_ctx(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + rm_wlock(&nc->ctx_lock); + nc->ctx = NULL; + nc->ctx_ops = NULL; + rm_wunlock(&nc->ctx_lock); +} + +uint8_t +ntb_mw_count(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (nc->mwcnt); +} + +int +ntb_mw_get_range(device_t ntb, unsigned mw_idx, vm_paddr_t *base, + caddr_t *vbase, size_t *size, size_t *align, size_t *align_size, + bus_addr_t *plimit) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_MW_GET_RANGE(device_get_parent(ntb), mw_idx + nc->mwoff, + base, vbase, size, align, align_size, plimit)); +} + +int +ntb_mw_set_trans(device_t ntb, unsigned mw_idx, bus_addr_t addr, size_t size) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_MW_SET_TRANS(device_get_parent(ntb), mw_idx + nc->mwoff, + addr, size)); +} + +int +ntb_mw_clear_trans(device_t ntb, unsigned mw_idx) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_MW_CLEAR_TRANS(device_get_parent(ntb), mw_idx + nc->mwoff)); +} + +int +ntb_mw_get_wc(device_t ntb, unsigned mw_idx, vm_memattr_t *mode) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_MW_GET_WC(device_get_parent(ntb), mw_idx + nc->mwoff, mode)); +} + +int +ntb_mw_set_wc(device_t ntb, unsigned mw_idx, vm_memattr_t mode) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_MW_SET_WC(device_get_parent(ntb), mw_idx + nc->mwoff, mode)); +} + +uint8_t +ntb_spad_count(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (nc->spadcnt); +} + +void +ntb_spad_clear(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + unsigned i; + + for (i = 0; i < nc->spadcnt; i++) + NTB_SPAD_WRITE(device_get_parent(ntb), i + nc->spadoff, 0); +} + +int +ntb_spad_write(device_t ntb, unsigned int idx, uint32_t val) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_SPAD_WRITE(device_get_parent(ntb), idx + nc->spadoff, val)); +} + +int +ntb_spad_read(device_t ntb, unsigned int idx, uint32_t *val) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_SPAD_READ(device_get_parent(ntb), idx + nc->spadoff, val)); +} + +int +ntb_peer_spad_write(device_t ntb, unsigned int idx, uint32_t val) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_PEER_SPAD_WRITE(device_get_parent(ntb), idx + nc->spadoff, + val)); +} + +int +ntb_peer_spad_read(device_t ntb, unsigned int idx, uint32_t *val) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_PEER_SPAD_READ(device_get_parent(ntb), idx + nc->spadoff, + val)); +} + +uint64_t +ntb_db_valid_mask(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (nc->dbmask); +} + +int +ntb_db_vector_count(device_t ntb) +{ + + return (NTB_DB_VECTOR_COUNT(device_get_parent(ntb))); +} + +uint64_t +ntb_db_vector_mask(device_t ntb, uint32_t vector) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return ((NTB_DB_VECTOR_MASK(device_get_parent(ntb), vector) + >> nc->dboff) & nc->dbmask); +} + +int +ntb_peer_db_addr(device_t ntb, bus_addr_t *db_addr, vm_size_t *db_size) +{ + + return (NTB_PEER_DB_ADDR(device_get_parent(ntb), db_addr, db_size)); +} + +void +ntb_db_clear(device_t ntb, uint64_t bits) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_DB_CLEAR(device_get_parent(ntb), bits << nc->dboff)); +} + +void +ntb_db_clear_mask(device_t ntb, uint64_t bits) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_DB_CLEAR_MASK(device_get_parent(ntb), bits << nc->dboff)); +} + +uint64_t +ntb_db_read(device_t ntb) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return ((NTB_DB_READ(device_get_parent(ntb)) >> nc->dboff) + & nc->dbmask); +} + +void +ntb_db_set_mask(device_t ntb, uint64_t bits) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_DB_SET_MASK(device_get_parent(ntb), bits << nc->dboff)); +} + +void +ntb_peer_db_set(device_t ntb, uint64_t bits) +{ + struct ntb_child *nc = device_get_ivars(ntb); + + return (NTB_PEER_DB_SET(device_get_parent(ntb), bits << nc->dboff)); +} + MODULE_VERSION(ntb, 1); Modified: stable/10/sys/dev/ntb/ntb.h ============================================================================== --- stable/10/sys/dev/ntb/ntb.h Thu Aug 18 10:57:18 2016 (r304403) +++ stable/10/sys/dev/ntb/ntb.h Thu Aug 18 10:59:12 2016 (r304404) @@ -34,4 +34,376 @@ extern devclass_t ntb_hw_devclass; SYSCTL_DECL(_hw_ntb); +int ntb_register_device(device_t ntb); +int ntb_unregister_device(device_t ntb); + +/* + * ntb_link_event() - notify driver context of a change in link status + * @ntb: NTB device context + * + * Notify the driver context that the link status may have changed. The driver + * should call intb_link_is_up() to get the current status. + */ +void ntb_link_event(device_t ntb); + +/* + * ntb_db_event() - notify driver context of a doorbell event + * @ntb: NTB device context + * @vector: Interrupt vector number + * + * Notify the driver context of a doorbell event. If hardware supports + * multiple interrupt vectors for doorbells, the vector number indicates which + * vector received the interrupt. The vector number is relative to the first + * vector used for doorbells, starting at zero, and must be less than + * ntb_db_vector_count(). The driver may call ntb_db_read() to check which + * doorbell bits need service, and ntb_db_vector_mask() to determine which of + * those bits are associated with the vector number. + */ +void ntb_db_event(device_t ntb, uint32_t vec); + +/* + * ntb_link_is_up() - get the current ntb link state + * @ntb: NTB device context + * @speed: OUT - The link speed expressed as PCIe generation number + * @width: OUT - The link width expressed as the number of PCIe lanes + * + * RETURNS: true or false based on the hardware link state + */ +bool ntb_link_is_up(device_t ntb, enum ntb_speed *speed, enum ntb_width *width); + +/* + * ntb_link_enable() - enable the link on the secondary side of the ntb + * @ntb: NTB device context + * @max_speed: The maximum link speed expressed as PCIe generation number[0] + * @max_width: The maximum link width expressed as the number of PCIe lanes[0] + * + * Enable the link on the secondary side of the ntb. This can only be done + * from the primary side of the ntb in primary or b2b topology. The ntb device + * should train the link to its maximum speed and width, or the requested speed + * and width, whichever is smaller, if supported. + * + * Return: Zero on success, otherwise an error number. + * + * [0]: Only NTB_SPEED_AUTO and NTB_WIDTH_AUTO are valid inputs; other speed + * and width input will be ignored. + */ +int ntb_link_enable(device_t ntb, enum ntb_speed speed, enum ntb_width width); + +/* + * ntb_link_disable() - disable the link on the secondary side of the ntb + * @ntb: NTB device context + * + * Disable the link on the secondary side of the ntb. This can only be done + * from the primary side of the ntb in primary or b2b topology. The ntb device + * should disable the link. Returning from this call must indicate that a + * barrier has passed, though with no more writes may pass in either direction + * across the link, except if this call returns an error number. + * + * Return: Zero on success, otherwise an error number. + */ +int ntb_link_disable(device_t ntb); + +/* + * get enable status of the link on the secondary side of the ntb + */ +bool ntb_link_enabled(device_t ntb); + +/* + * ntb_set_ctx() - associate a driver context with an ntb device + * @ntb: NTB device context + * @ctx: Driver context + * @ctx_ops: Driver context operations + * + * Associate a driver context and operations with a ntb device. The context is + * provided by the client driver, and the driver may associate a different + * context with each ntb device. + * + * Return: Zero if the context is associated, otherwise an error number. + */ +int ntb_set_ctx(device_t ntb, void *ctx, const struct ntb_ctx_ops *ctx_ops); + +/* + * ntb_set_ctx() - get a driver context associated with an ntb device + * @ntb: NTB device context + * @ctx_ops: Driver context operations + * + * Get a driver context and operations associated with a ntb device. + */ +void * ntb_get_ctx(device_t ntb, const struct ntb_ctx_ops **ctx_ops); + +/* + * ntb_clear_ctx() - disassociate any driver context from an ntb device + * @ntb: NTB device context + * + * Clear any association that may exist between a driver context and the ntb + * device. + */ +void ntb_clear_ctx(device_t ntb); + +/* + * ntb_mw_count() - Get the number of memory windows available for KPI + * consumers. + * + * (Excludes any MW wholly reserved for register access.) + */ +uint8_t ntb_mw_count(device_t ntb); + +/* + * ntb_mw_get_range() - get the range of a memory window + * @ntb: NTB device context + * @idx: Memory window number + * @base: OUT - the base address for mapping the memory window + * @size: OUT - the size for mapping the memory window + * @align: OUT - the base alignment for translating the memory window + * @align_size: OUT - the size alignment for translating the memory window + * + * Get the range of a memory window. NULL may be given for any output + * parameter if the value is not needed. The base and size may be used for + * mapping the memory window, to access the peer memory. The alignment and + * size may be used for translating the memory window, for the peer to access + * memory on the local system. + * + * Return: Zero on success, otherwise an error number. + */ +int ntb_mw_get_range(device_t ntb, unsigned mw_idx, vm_paddr_t *base, + caddr_t *vbase, size_t *size, size_t *align, size_t *align_size, + bus_addr_t *plimit); + +/* + * ntb_mw_set_trans() - set the translation of a memory window + * @ntb: NTB device context + * @idx: Memory window number + * @addr: The dma address local memory to expose to the peer + * @size: The size of the local memory to expose to the peer + * + * Set the translation of a memory window. The peer may access local memory + * through the window starting at the address, up to the size. The address + * must be aligned to the alignment specified by ntb_mw_get_range(). The size + * must be aligned to the size alignment specified by ntb_mw_get_range(). The + * address must be below the plimit specified by ntb_mw_get_range() (i.e. for + * 32-bit BARs). + * + * Return: Zero on success, otherwise an error number. + */ +int ntb_mw_set_trans(device_t ntb, unsigned mw_idx, bus_addr_t addr, + size_t size); + +/* + * ntb_mw_clear_trans() - clear the translation of a memory window + * @ntb: NTB device context + * @idx: Memory window number + * + * Clear the translation of a memory window. The peer may no longer access + * local memory through the window. + * + * Return: Zero on success, otherwise an error number. + */ +int ntb_mw_clear_trans(device_t ntb, unsigned mw_idx); + +/* + * ntb_mw_get_wc - Get the write-combine status of a memory window + * + * Returns: Zero on success, setting *wc; otherwise an error number (e.g. if + * idx is an invalid memory window). + * + * Mode is a VM_MEMATTR_* type. + */ +int ntb_mw_get_wc(device_t ntb, unsigned mw_idx, vm_memattr_t *mode); + +/* + * ntb_mw_set_wc - Set the write-combine status of a memory window + * + * If 'mode' matches the current status, this does nothing and succeeds. Mode + * is a VM_MEMATTR_* type. + * + * Returns: Zero on success, setting the caching attribute on the virtual + * mapping of the BAR; otherwise an error number (e.g. if idx is an invalid + * memory window, or if changing the caching attribute fails). + */ +int ntb_mw_set_wc(device_t ntb, unsigned mw_idx, vm_memattr_t mode); + +/* + * ntb_spad_count() - get the total scratch regs usable + * @ntb: pointer to ntb_softc instance + * + * This function returns the max 32bit scratchpad registers usable by the + * upper layer. + * + * RETURNS: total number of scratch pad registers available + */ +uint8_t ntb_spad_count(device_t ntb); + +/* + * ntb_get_max_spads() - zero local scratch registers + * @ntb: pointer to ntb_softc instance + * + * This functions overwrites all local scratchpad registers with zeroes. + */ +void ntb_spad_clear(device_t ntb); + +/* + * ntb_spad_write() - write to the secondary scratchpad register + * @ntb: pointer to ntb_softc instance + * @idx: index to the scratchpad register, 0 based + * @val: the data value to put into the register + * + * This function allows writing of a 32bit value to the indexed scratchpad + * register. The register resides on the secondary (external) side. + * + * RETURNS: An appropriate ERRNO error value on error, or zero for success. + */ +int ntb_spad_write(device_t ntb, unsigned int idx, uint32_t val); + +/* + * ntb_spad_read() - read from the primary scratchpad register + * @ntb: pointer to ntb_softc instance + * @idx: index to scratchpad register, 0 based + * @val: pointer to 32bit integer for storing the register value + * + * This function allows reading of the 32bit scratchpad register on + * the primary (internal) side. + * + * RETURNS: An appropriate ERRNO error value on error, or zero for success. + */ +int ntb_spad_read(device_t ntb, unsigned int idx, uint32_t *val); + +/* + * ntb_peer_spad_write() - write to the secondary scratchpad register + * @ntb: pointer to ntb_softc instance + * @idx: index to the scratchpad register, 0 based + * @val: the data value to put into the register + * + * This function allows writing of a 32bit value to the indexed scratchpad + * register. The register resides on the secondary (external) side. + * + * RETURNS: An appropriate ERRNO error value on error, or zero for success. + */ +int ntb_peer_spad_write(device_t ntb, unsigned int idx, uint32_t val); + +/* + * ntb_peer_spad_read() - read from the primary scratchpad register + * @ntb: pointer to ntb_softc instance + * @idx: index to scratchpad register, 0 based + * @val: pointer to 32bit integer for storing the register value + * + * This function allows reading of the 32bit scratchpad register on + * the primary (internal) side. + * + * RETURNS: An appropriate ERRNO error value on error, or zero for success. + */ +int ntb_peer_spad_read(device_t ntb, unsigned int idx, uint32_t *val); + +/* + * ntb_db_valid_mask() - get a mask of doorbell bits supported by the ntb + * @ntb: NTB device context + * + * Hardware may support different number or arrangement of doorbell bits. + * + * Return: A mask of doorbell bits supported by the ntb. + */ +uint64_t ntb_db_valid_mask(device_t ntb); + +/* + * ntb_db_vector_count() - get the number of doorbell interrupt vectors + * @ntb: NTB device context. + * + * Hardware may support different number of interrupt vectors. + * + * Return: The number of doorbell interrupt vectors. + */ +int ntb_db_vector_count(device_t ntb); + +/* + * ntb_db_vector_mask() - get a mask of doorbell bits serviced by a vector + * @ntb: NTB device context + * @vector: Doorbell vector number + * + * Each interrupt vector may have a different number or arrangement of bits. + * + * Return: A mask of doorbell bits serviced by a vector. + */ +uint64_t ntb_db_vector_mask(device_t ntb, uint32_t vector); + +/* + * ntb_peer_db_addr() - address and size of the peer doorbell register + * @ntb: NTB device context. + * @db_addr: OUT - The address of the peer doorbell register. + * @db_size: OUT - The number of bytes to write the peer doorbell register. + * + * Return the address of the peer doorbell register. This may be used, for + * example, by drivers that offload memory copy operations to a dma engine. + * The drivers may wish to ring the peer doorbell at the completion of memory + * copy operations. For efficiency, and to simplify ordering of operations + * between the dma memory copies and the ringing doorbell, the driver may + * append one additional dma memory copy with the doorbell register as the + * destination, after the memory copy operations. + * + * Return: Zero on success, otherwise an error number. + * + * Note that writing the peer doorbell via a memory window will *not* generate + * an interrupt on the remote host; that must be done separately. + */ +int ntb_peer_db_addr(device_t ntb, bus_addr_t *db_addr, vm_size_t *db_size); + +/* + * ntb_db_clear() - clear bits in the local doorbell register + * @ntb: NTB device context. + * @db_bits: Doorbell bits to clear. + * + * Clear bits in the local doorbell register, arming the bits for the next + * doorbell. + * + * Return: Zero on success, otherwise an error number. + */ +void ntb_db_clear(device_t ntb, uint64_t bits); + +/* + * ntb_db_clear_mask() - clear bits in the local doorbell mask + * @ntb: NTB device context. + * @db_bits: Doorbell bits to clear. + * + * Clear bits in the local doorbell mask register, allowing doorbell interrupts + * from being generated for those doorbell bits. If a doorbell bit is already + * set at the time the mask is cleared, and the corresponding mask bit is + * changed from set to clear, then the ntb driver must ensure that + * ntb_db_event() is called. If the hardware does not generate the interrupt + * on clearing the mask bit, then the driver must call ntb_db_event() anyway. + * + * Return: Zero on success, otherwise an error number. + */ +void ntb_db_clear_mask(device_t ntb, uint64_t bits); + +/* + * ntb_db_read() - read the local doorbell register + * @ntb: NTB device context. + * + * Read the local doorbell register, and return the bits that are set. + * + * Return: The bits currently set in the local doorbell register. + */ +uint64_t ntb_db_read(device_t ntb); + +/* + * ntb_db_set_mask() - set bits in the local doorbell mask + * @ntb: NTB device context. + * @db_bits: Doorbell mask bits to set. + * + * Set bits in the local doorbell mask register, preventing doorbell interrupts + * from being generated for those doorbell bits. Bits that were already set + * must remain set. + * + * Return: Zero on success, otherwise an error number. + */ +void ntb_db_set_mask(device_t ntb, uint64_t bits); + +/* + * ntb_peer_db_set() - Set the doorbell on the secondary/external side + * @ntb: pointer to ntb_softc instance + * @bit: doorbell bits to ring + * + * This function allows triggering of a doorbell on the secondary/external + * side that will initiate an interrupt on the remote host + */ +void ntb_peer_db_set(device_t ntb, uint64_t bits); + #endif /* _NTB_H_ */ Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:57:18 2016 (r304403) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 10:59:12 2016 (r304404) @@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -202,6 +201,9 @@ struct ntb_msix_data { }; struct ntb_softc { + /* ntb.c context. Do not move! Must go first! */ + void *ntb_store; + device_t device; enum ntb_device_type type; uint32_t features; @@ -220,10 +222,7 @@ struct ntb_softc { struct callout heartbeat_timer; struct callout lr_timer; - void *ntb_ctx; - const struct ntb_ctx_ops *ctx_ops; struct ntb_vec *msix_vec; - struct rmlock ctx_lock; uint32_t ppd; enum ntb_conn_type conn_type; @@ -285,72 +284,74 @@ bus_space_write_8(bus_space_tag_t tag, b } #endif -#define ntb_bar_read(SIZE, bar, offset) \ +#define intel_ntb_bar_read(SIZE, bar, offset) \ bus_space_read_ ## SIZE (ntb->bar_info[(bar)].pci_bus_tag, \ ntb->bar_info[(bar)].pci_bus_handle, (offset)) -#define ntb_bar_write(SIZE, bar, offset, val) \ +#define intel_ntb_bar_write(SIZE, bar, offset, val) \ bus_space_write_ ## SIZE (ntb->bar_info[(bar)].pci_bus_tag, \ ntb->bar_info[(bar)].pci_bus_handle, (offset), (val)) -#define ntb_reg_read(SIZE, offset) ntb_bar_read(SIZE, NTB_CONFIG_BAR, offset) -#define ntb_reg_write(SIZE, offset, val) \ - ntb_bar_write(SIZE, NTB_CONFIG_BAR, offset, val) -#define ntb_mw_read(SIZE, offset) \ - ntb_bar_read(SIZE, ntb_mw_to_bar(ntb, ntb->b2b_mw_idx), offset) -#define ntb_mw_write(SIZE, offset, val) \ - ntb_bar_write(SIZE, ntb_mw_to_bar(ntb, ntb->b2b_mw_idx), \ +#define intel_ntb_reg_read(SIZE, offset) \ + intel_ntb_bar_read(SIZE, NTB_CONFIG_BAR, offset) +#define intel_ntb_reg_write(SIZE, offset, val) \ + intel_ntb_bar_write(SIZE, NTB_CONFIG_BAR, offset, val) +#define intel_ntb_mw_read(SIZE, offset) \ + intel_ntb_bar_read(SIZE, intel_ntb_mw_to_bar(ntb, ntb->b2b_mw_idx), \ + offset) +#define intel_ntb_mw_write(SIZE, offset, val) \ + intel_ntb_bar_write(SIZE, intel_ntb_mw_to_bar(ntb, ntb->b2b_mw_idx), \ offset, val) -static int ntb_probe(device_t device); -static int ntb_attach(device_t device); -static int ntb_detach(device_t device); -static uint64_t ntb_db_valid_mask(device_t dev); -static void ntb_spad_clear(device_t dev); -static uint64_t ntb_db_vector_mask(device_t dev, uint32_t vector); -static bool ntb_link_is_up(device_t dev, enum ntb_speed *speed, +static int intel_ntb_probe(device_t device); +static int intel_ntb_attach(device_t device); +static int intel_ntb_detach(device_t device); +static uint64_t intel_ntb_db_valid_mask(device_t dev); +static void intel_ntb_spad_clear(device_t dev); +static uint64_t intel_ntb_db_vector_mask(device_t dev, uint32_t vector); +static bool intel_ntb_link_is_up(device_t dev, enum ntb_speed *speed, enum ntb_width *width); -static int ntb_link_enable(device_t dev, enum ntb_speed speed, +static int intel_ntb_link_enable(device_t dev, enum ntb_speed speed, enum ntb_width width); -static int ntb_link_disable(device_t dev); -static int ntb_spad_read(device_t dev, unsigned int idx, uint32_t *val); -static int ntb_peer_spad_write(device_t dev, unsigned int idx, uint32_t val); +static int intel_ntb_link_disable(device_t dev); +static int intel_ntb_spad_read(device_t dev, unsigned int idx, uint32_t *val); +static int intel_ntb_peer_spad_write(device_t dev, unsigned int idx, uint32_t val); -static unsigned ntb_user_mw_to_idx(struct ntb_softc *, unsigned uidx); -static inline enum ntb_bar ntb_mw_to_bar(struct ntb_softc *, unsigned mw); +static unsigned intel_ntb_user_mw_to_idx(struct ntb_softc *, unsigned uidx); +static inline enum ntb_bar intel_ntb_mw_to_bar(struct ntb_softc *, unsigned mw); static inline bool bar_is_64bit(struct ntb_softc *, enum ntb_bar); static inline void bar_get_xlat_params(struct ntb_softc *, enum ntb_bar, uint32_t *base, uint32_t *xlat, uint32_t *lmt); -static int ntb_map_pci_bars(struct ntb_softc *ntb); -static int ntb_mw_set_wc_internal(struct ntb_softc *, unsigned idx, +static int intel_ntb_map_pci_bars(struct ntb_softc *ntb); +static int intel_ntb_mw_set_wc_internal(struct ntb_softc *, unsigned idx, vm_memattr_t); static void print_map_success(struct ntb_softc *, struct ntb_pci_bar_info *, const char *); static int map_mmr_bar(struct ntb_softc *ntb, struct ntb_pci_bar_info *bar); static int map_memory_window_bar(struct ntb_softc *ntb, struct ntb_pci_bar_info *bar); -static void ntb_unmap_pci_bar(struct ntb_softc *ntb); -static int ntb_remap_msix(device_t, uint32_t desired, uint32_t avail); -static int ntb_init_isr(struct ntb_softc *ntb); -static int ntb_setup_legacy_interrupt(struct ntb_softc *ntb); -static int ntb_setup_msix(struct ntb_softc *ntb, uint32_t num_vectors); -static void ntb_teardown_interrupts(struct ntb_softc *ntb); -static inline uint64_t ntb_vec_mask(struct ntb_softc *, uint64_t db_vector); -static void ntb_interrupt(struct ntb_softc *, uint32_t vec); +static void intel_ntb_unmap_pci_bar(struct ntb_softc *ntb); +static int intel_ntb_remap_msix(device_t, uint32_t desired, uint32_t avail); +static int intel_ntb_init_isr(struct ntb_softc *ntb); +static int intel_ntb_setup_legacy_interrupt(struct ntb_softc *ntb); +static int intel_ntb_setup_msix(struct ntb_softc *ntb, uint32_t num_vectors); +static void intel_ntb_teardown_interrupts(struct ntb_softc *ntb); +static inline uint64_t intel_ntb_vec_mask(struct ntb_softc *, uint64_t db_vector); +static void intel_ntb_interrupt(struct ntb_softc *, uint32_t vec); static void ndev_vec_isr(void *arg); static void ndev_irq_isr(void *arg); static inline uint64_t db_ioread(struct ntb_softc *, uint64_t regoff); static inline void db_iowrite(struct ntb_softc *, uint64_t regoff, uint64_t); static inline void db_iowrite_raw(struct ntb_softc *, uint64_t regoff, uint64_t); -static int ntb_create_msix_vec(struct ntb_softc *ntb, uint32_t num_vectors); -static void ntb_free_msix_vec(struct ntb_softc *ntb); -static void ntb_get_msix_info(struct ntb_softc *ntb); -static void ntb_exchange_msix(void *); -static struct ntb_hw_info *ntb_get_device_info(uint32_t device_id); -static void ntb_detect_max_mw(struct ntb_softc *ntb); -static int ntb_detect_xeon(struct ntb_softc *ntb); -static int ntb_detect_atom(struct ntb_softc *ntb); -static int ntb_xeon_init_dev(struct ntb_softc *ntb); -static int ntb_atom_init_dev(struct ntb_softc *ntb); -static void ntb_teardown_xeon(struct ntb_softc *ntb); +static int intel_ntb_create_msix_vec(struct ntb_softc *ntb, uint32_t num_vectors); +static void intel_ntb_free_msix_vec(struct ntb_softc *ntb); +static void intel_ntb_get_msix_info(struct ntb_softc *ntb); +static void intel_ntb_exchange_msix(void *); +static struct ntb_hw_info *intel_ntb_get_device_info(uint32_t device_id); +static void intel_ntb_detect_max_mw(struct ntb_softc *ntb); +static int intel_ntb_detect_xeon(struct ntb_softc *ntb); +static int intel_ntb_detect_atom(struct ntb_softc *ntb); +static int intel_ntb_xeon_init_dev(struct ntb_softc *ntb); +static int intel_ntb_atom_init_dev(struct ntb_softc *ntb); +static void intel_ntb_teardown_xeon(struct ntb_softc *ntb); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Aug 18 11:00:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C91AEBBECEA; Thu, 18 Aug 2016 11:00:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9689B1364; Thu, 18 Aug 2016 11:00:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IB0m4S033306; Thu, 18 Aug 2016 11:00:48 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IB0mgC033301; Thu, 18 Aug 2016 11:00:48 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181100.u7IB0mgC033301@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304405 - in stable/10: share/man/man4 sys/dev/ntb sys/dev/ntb/if_ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:00:49 -0000 Author: mav Date: Thu Aug 18 11:00:48 2016 New Revision: 304405 URL: https://svnweb.freebsd.org/changeset/base/304405 Log: MFC r303494: Once more refactor KPI between ntb_transport(4) and if_ntb(4). New design allows to attach multiple consumers to ntb_transport(4) instance. Previous design obtained from Linux theoretically allowed that, but was not practically usable (Linux also has only one consumer driver now). Modified: stable/10/share/man/man4/if_ntb.4 stable/10/share/man/man4/ntb_transport.4 stable/10/sys/dev/ntb/if_ntb/if_ntb.c stable/10/sys/dev/ntb/ntb_transport.c stable/10/sys/dev/ntb/ntb_transport.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/if_ntb.4 ============================================================================== --- stable/10/share/man/man4/if_ntb.4 Thu Aug 18 10:59:12 2016 (r304404) +++ stable/10/share/man/man4/if_ntb.4 Thu Aug 18 11:00:48 2016 (r304405) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2016 +.Dd July 29, 2016 .Dt IF_NTB 4 .Os .Sh NAME @@ -49,7 +49,7 @@ The following tunables are settable from .Bl -ohang .It Va hw.if_ntb.num_queues Number of transport queues to use per interface. -Default is 1. +Default is unlimited. .El .Sh DESCRIPTION The @@ -84,3 +84,6 @@ Later improvements were done by .An Conrad E. Meyer Aq Mt cem@FreeBSD.org and .An Alexander Motin Aq Mt mav@FreeBSD.org . +.Sh BUGS +Linux supports only one queue per interface, so manual configuration +may be required for compatibility. Modified: stable/10/share/man/man4/ntb_transport.4 ============================================================================== --- stable/10/share/man/man4/ntb_transport.4 Thu Aug 18 10:59:12 2016 (r304404) +++ stable/10/share/man/man4/ntb_transport.4 Thu Aug 18 11:00:48 2016 (r304405) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2016 +.Dd July 29, 2016 .Dt NTB_TRANSPORT 4 .Os .Sh NAME @@ -44,10 +44,15 @@ The following tunables are settable from .It Va hw.ntb_transport.debug_level Driver debug level. The default value is 0, higher means more verbose. -.It Va hw.ntb_transport.max_num_clients -Number of bidirectional queues to setup. -The default value is 0, that means one queue per available memory window. -Maximal number is limited by number of doorbells. +.It Va hint.ntb_transport. Ns Ar X Ns Va .config +Configures queues allocation for consumer devices, separated by commas. +Each device can be configured as: "[:]", where: +.Va name +is a name of the driver which should attach the device (empty means any), +.Va queues +is a number of queues to allocate (empty means automatic), +The default configuration is empty string, which means single device +with one queue per memory window allowing any driver attachment. .El .Sh DESCRIPTION The Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 10:59:12 2016 (r304404) +++ stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 11:00:48 2016 (r304405) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); static SYSCTL_NODE(_hw, OID_AUTO, if_ntb, CTLFLAG_RW, 0, "if_ntb"); -static unsigned g_if_ntb_num_queues = 1; +static unsigned g_if_ntb_num_queues = UINT_MAX; SYSCTL_UINT(_hw_if_ntb, OID_AUTO, num_queues, CTLFLAG_RWTUN, &g_if_ntb_num_queues, 0, "Number of queues per interface"); @@ -143,7 +143,8 @@ ntb_net_attach(device_t dev) } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - sc->num_queues = g_if_ntb_num_queues; + sc->num_queues = min(g_if_ntb_num_queues, + ntb_transport_queue_count(dev)); sc->queues = malloc(sc->num_queues * sizeof(struct ntb_net_queue), M_DEVBUF, M_WAITOK | M_ZERO); sc->mtu = INT_MAX; @@ -151,8 +152,7 @@ ntb_net_attach(device_t dev) q = &sc->queues[i]; q->sc = sc; q->ifp = ifp; - q->qp = ntb_transport_create_queue(q, - device_get_parent(dev), &handlers); + q->qp = ntb_transport_create_queue(dev, i, &handlers, q); if (q->qp == NULL) break; sc->mtu = imin(sc->mtu, ntb_transport_max_size(q->qp)); @@ -166,6 +166,7 @@ ntb_net_attach(device_t dev) callout_init(&q->queue_full, 1); } sc->num_queues = i; + device_printf(dev, "%d queue(s)\n", sc->num_queues); ifp->if_init = ntb_net_init; ifp->if_softc = sc; Modified: stable/10/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 10:59:12 2016 (r304404) +++ stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 11:00:48 2016 (r304405) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -64,13 +63,6 @@ __FBSDID("$FreeBSD$"); #include "ntb.h" #include "ntb_transport.h" -#define QP_SETSIZE 64 -BITSET_DEFINE(_qpset, QP_SETSIZE); -#define test_bit(pos, addr) BIT_ISSET(QP_SETSIZE, (pos), (addr)) -#define set_bit(pos, addr) BIT_SET(QP_SETSIZE, (pos), (addr)) -#define clear_bit(pos, addr) BIT_CLR(QP_SETSIZE, (pos), (addr)) -#define ffs_bit(addr) BIT_FFS(QP_SETSIZE, (addr)) - #define KTR_NTB KTR_SPARE3 #define NTB_TRANSPORT_VERSION 4 @@ -96,13 +88,6 @@ SYSCTL_UQUAD(_hw_ntb_transport, OID_AUTO "If enabled (non-zero), limit the size of large memory windows. " "Both sides of the NTB MUST set the same value here."); -static unsigned max_num_clients; -TUNABLE_INT("hw.ntb_transport.max_num_clients", &max_num_clients); -SYSCTL_UINT(_hw_ntb_transport, OID_AUTO, max_num_clients, CTLFLAG_RDTUN, - &max_num_clients, 0, "Maximum number of NTB transport clients. " - "0 (default) - use all available NTB memory windows; " - "positive integer N - Limit to N memory windows."); - static unsigned enable_xeon_watchdog; TUNABLE_INT("hw.ntb_transport.enable_xeon_watchdog", &enable_xeon_watchdog); SYSCTL_UINT(_hw_ntb_transport, OID_AUTO, enable_xeon_watchdog, CTLFLAG_RDTUN, @@ -204,14 +189,21 @@ struct ntb_transport_mw { bus_addr_t dma_addr; }; +struct ntb_transport_child { + device_t dev; + int qpoff; + int qpcnt; + struct ntb_transport_child *next; +}; + struct ntb_transport_ctx { device_t dev; + struct ntb_transport_child *child; struct ntb_transport_mw *mw_vec; struct ntb_transport_qp *qp_vec; - struct _qpset qp_bitmap; - struct _qpset qp_bitmap_free; unsigned mw_count; unsigned qp_count; + uint64_t qp_bitmap; volatile bool link_is_up; struct callout link_work; struct callout link_watchdog; @@ -246,7 +238,6 @@ enum { NTBT_MW0_SZ_LOW, NTBT_MW1_SZ_HIGH, NTBT_MW1_SZ_LOW, - NTBT_MAX_SPAD, /* * Some NTB-using hardware have a watchdog to work around NTB hangs; if @@ -336,13 +327,44 @@ static int ntb_transport_attach(device_t dev) { struct ntb_transport_ctx *nt = device_get_softc(dev); + struct ntb_transport_child **cpp = &nt->child; + struct ntb_transport_child *nc; struct ntb_transport_mw *mw; - uint64_t qp_bitmap; - int rc; - unsigned i; + uint64_t db_bitmap; + int rc, i, db_count, spad_count, qp, qpu, qpo, qpt; + char cfg[128] = ""; + char buf[32]; + char *n, *np, *c, *name; nt->dev = dev; nt->mw_count = ntb_mw_count(dev); + spad_count = ntb_spad_count(dev); + db_bitmap = ntb_db_valid_mask(dev); + db_count = flsll(db_bitmap); + KASSERT(db_bitmap == (1 << db_count) - 1, + ("Doorbells are not sequential (%jx).\n", db_bitmap)); + + device_printf(dev, "%d memory windows, %d scratchpads, " + "%d doorbells\n", nt->mw_count, spad_count, db_count); + + if (nt->mw_count == 0) { + device_printf(dev, "At least 1 memory window required.\n"); + return (ENXIO); + } + if (spad_count < 6) { + device_printf(dev, "At least 6 scratchpads required.\n"); + return (ENXIO); + } + if (spad_count < 4 + 2 * nt->mw_count) { + nt->mw_count = (spad_count - 4) / 2; + device_printf(dev, "Scratchpads enough only for %d " + "memory windows.\n", nt->mw_count); + } + if (db_bitmap == 0) { + device_printf(dev, "At least one doorbell required.\n"); + return (ENXIO); + } + nt->mw_vec = malloc(nt->mw_count * sizeof(*nt->mw_vec), M_NTB_T, M_WAITOK | M_ZERO); for (i = 0; i < nt->mw_count; i++) { @@ -364,25 +386,59 @@ ntb_transport_attach(device_t dev) ntb_printf(0, "Unable to set mw%d caching\n", i); } - qp_bitmap = ntb_db_valid_mask(dev); - nt->qp_count = flsll(qp_bitmap); - KASSERT(nt->qp_count != 0, ("bogus db bitmap")); - nt->qp_count -= 1; - - if (max_num_clients != 0 && max_num_clients < nt->qp_count) - nt->qp_count = max_num_clients; - else if (nt->mw_count < nt->qp_count) - nt->qp_count = nt->mw_count; - KASSERT(nt->qp_count <= QP_SETSIZE, ("invalid qp_count")); + qpu = 0; + qpo = imin(db_count, nt->mw_count); + qpt = db_count; + + snprintf(buf, sizeof(buf), "hint.%s.%d.config", device_get_name(dev), + device_get_unit(dev)); + TUNABLE_STR_FETCH(buf, cfg, sizeof(cfg)); + n = cfg; + i = 0; + while ((c = strsep(&n, ",")) != NULL) { + np = c; + name = strsep(&np, ":"); + if (name != NULL && name[0] == 0) + name = NULL; + qp = (np && np[0] != 0) ? strtol(np, NULL, 10) : qpo - qpu; + if (qp <= 0) + qp = 1; + + if (qp > qpt - qpu) { + device_printf(dev, "Not enough resources for config\n"); + break; + } + + nc = malloc(sizeof(*nc), M_DEVBUF, M_WAITOK | M_ZERO); + nc->qpoff = qpu; + nc->qpcnt = qp; + nc->dev = device_add_child(dev, name, -1); + if (nc->dev == NULL) { + device_printf(dev, "Can not add child.\n"); + break; + } + device_set_ivars(nc->dev, nc); + *cpp = nc; + cpp = &nc->next; + + if (bootverbose) { + device_printf(dev, "%d \"%s\": queues %d", + i, name, qpu); + if (qp > 1) + printf("-%d", qpu + qp - 1); + printf("\n"); + } + + qpu += qp; + i++; + } + nt->qp_count = qpu; nt->qp_vec = malloc(nt->qp_count * sizeof(*nt->qp_vec), M_NTB_T, M_WAITOK | M_ZERO); - for (i = 0; i < nt->qp_count; i++) { - set_bit(i, &nt->qp_bitmap); - set_bit(i, &nt->qp_bitmap_free); + for (i = 0; i < nt->qp_count; i++) ntb_transport_init_queue(nt, i); - } callout_init(&nt->link_work, 0); callout_init(&nt->link_watchdog, 0); @@ -398,10 +454,7 @@ ntb_transport_attach(device_t dev) if (enable_xeon_watchdog != 0) callout_reset(&nt->link_watchdog, 0, xeon_link_watchdog_hb, nt); - /* Attach children to this transport */ - device_add_child(dev, NULL, -1); bus_generic_attach(dev); - return (0); err: @@ -414,25 +467,25 @@ static int ntb_transport_detach(device_t dev) { struct ntb_transport_ctx *nt = device_get_softc(dev); - struct _qpset qp_bitmap_alloc; - uint8_t i; - - /* Detach & delete all children */ - device_delete_children(dev); + struct ntb_transport_child **cpp = &nt->child; + struct ntb_transport_child *nc; + int error = 0, i; + + while ((nc = *cpp) != NULL) { + *cpp = (*cpp)->next; + error = device_delete_child(dev, nc->dev); + if (error) + break; + free(nc, M_DEVBUF); + } + KASSERT(nt->qp_bitmap == 0, + ("Some queues not freed on detach (%jx)", nt->qp_bitmap)); ntb_transport_link_cleanup(nt); taskqueue_drain(taskqueue_swi, &nt->link_cleanup); callout_drain(&nt->link_work); callout_drain(&nt->link_watchdog); - BIT_COPY(QP_SETSIZE, &nt->qp_bitmap, &qp_bitmap_alloc); - BIT_NAND(QP_SETSIZE, &qp_bitmap_alloc, &nt->qp_bitmap_free); - - /* Verify that all the QPs are freed */ - for (i = 0; i < nt->qp_count; i++) - if (test_bit(i, &qp_bitmap_alloc)) - ntb_transport_free_queue(&nt->qp_vec[i]); - ntb_link_disable(dev); ntb_clear_ctx(dev); @@ -444,6 +497,14 @@ ntb_transport_detach(device_t dev) return (0); } +int +ntb_transport_queue_count(device_t dev) +{ + struct ntb_transport_child *nc = device_get_ivars(dev); + + return (nc->qpcnt); +} + static void ntb_transport_init_queue(struct ntb_transport_ctx *nt, unsigned int qp_num) { @@ -511,6 +572,7 @@ ntb_transport_init_queue(struct ntb_tran void ntb_transport_free_queue(struct ntb_transport_qp *qp) { + struct ntb_transport_ctx *nt = qp->transport; struct ntb_queue_entry *entry; if (qp == NULL) @@ -536,7 +598,7 @@ ntb_transport_free_queue(struct ntb_tran while ((entry = ntb_list_rm(&qp->ntb_tx_free_q_lock, &qp->tx_free_q))) free(entry, M_NTB_T); - set_bit(qp->qp_num, &qp->transport->qp_bitmap_free); + nt->qp_bitmap &= ~(1 << qp->qp_num); } /** @@ -554,24 +616,20 @@ ntb_transport_free_queue(struct ntb_tran * RETURNS: pointer to newly created ntb_queue, NULL on error. */ struct ntb_transport_qp * -ntb_transport_create_queue(void *data, device_t dev, - const struct ntb_queue_handlers *handlers) +ntb_transport_create_queue(device_t dev, int q, + const struct ntb_queue_handlers *handlers, void *data) { - struct ntb_transport_ctx *nt = device_get_softc(dev); + struct ntb_transport_child *nc = device_get_ivars(dev); + struct ntb_transport_ctx *nt = device_get_softc(device_get_parent(dev)); struct ntb_queue_entry *entry; struct ntb_transport_qp *qp; - unsigned int free_queue; int i; - free_queue = ffs_bit(&nt->qp_bitmap_free); - if (free_queue == 0) + if (q < 0 || q >= nc->qpcnt) return (NULL); - /* decrement free_queue to make it zero based */ - free_queue--; - - qp = &nt->qp_vec[free_queue]; - clear_bit(qp->qp_num, &nt->qp_bitmap_free); + qp = &nt->qp_vec[nc->qpoff + q]; + nt->qp_bitmap |= (1 << qp->qp_num); qp->cb_data = data; qp->rx_handler = handlers->rx_handler; qp->tx_handler = handlers->tx_handler; @@ -948,24 +1006,19 @@ ntb_transport_doorbell_callback(void *da { struct ntb_transport_ctx *nt = data; struct ntb_transport_qp *qp; - struct _qpset db_bits; uint64_t vec_mask; unsigned qp_num; - BIT_COPY(QP_SETSIZE, &nt->qp_bitmap, &db_bits); - BIT_NAND(QP_SETSIZE, &db_bits, &nt->qp_bitmap_free); - vec_mask = ntb_db_vector_mask(nt->dev, vector); + vec_mask &= nt->qp_bitmap; if ((vec_mask & (vec_mask - 1)) != 0) vec_mask &= ntb_db_read(nt->dev); while (vec_mask != 0) { qp_num = ffsll(vec_mask) - 1; - if (test_bit(qp_num, &db_bits)) { - qp = &nt->qp_vec[qp_num]; - if (qp->link_is_up) - taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); - } + qp = &nt->qp_vec[qp_num]; + if (qp->link_is_up) + taskqueue_enqueue(qp->rxc_tq, &qp->rxc_db_work); vec_mask &= ~(1ull << qp_num); } @@ -1223,19 +1276,16 @@ static void ntb_transport_link_cleanup(struct ntb_transport_ctx *nt) { struct ntb_transport_qp *qp; - struct _qpset qp_bitmap_alloc; - unsigned i; - - BIT_COPY(QP_SETSIZE, &nt->qp_bitmap, &qp_bitmap_alloc); - BIT_NAND(QP_SETSIZE, &qp_bitmap_alloc, &nt->qp_bitmap_free); + int i; /* Pass along the info to any clients */ - for (i = 0; i < nt->qp_count; i++) - if (test_bit(i, &qp_bitmap_alloc)) { + for (i = 0; i < nt->qp_count; i++) { + if ((nt->qp_bitmap & (1 << i)) != 0) { qp = &nt->qp_vec[i]; ntb_qp_link_cleanup(qp); callout_drain(&qp->link_work); } + } if (!nt->link_is_up) callout_drain(&nt->link_work); @@ -1245,8 +1295,7 @@ ntb_transport_link_cleanup(struct ntb_tr * goes down, blast them now to give them a sane value the next * time they are accessed */ - for (i = 0; i < NTBT_MAX_SPAD; i++) - ntb_spad_write(nt->dev, i, 0); + ntb_spad_clear(nt->dev); } static void Modified: stable/10/sys/dev/ntb/ntb_transport.h ============================================================================== --- stable/10/sys/dev/ntb/ntb_transport.h Thu Aug 18 10:59:12 2016 (r304404) +++ stable/10/sys/dev/ntb/ntb_transport.h Thu Aug 18 11:00:48 2016 (r304405) @@ -43,12 +43,13 @@ struct ntb_queue_handlers { void (*event_handler)(void *data, enum ntb_link_event status); }; -unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp); -unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp); +int ntb_transport_queue_count(device_t dev); struct ntb_transport_qp * -ntb_transport_create_queue(void *data, device_t dev, - const struct ntb_queue_handlers *handlers); +ntb_transport_create_queue(device_t dev, int q, + const struct ntb_queue_handlers *handlers, void *data); void ntb_transport_free_queue(struct ntb_transport_qp *qp); +unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp); +unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp); int ntb_transport_rx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data, unsigned int len); int ntb_transport_tx_enqueue(struct ntb_transport_qp *qp, void *cb, void *data, From owner-svn-src-all@freebsd.org Thu Aug 18 11:01:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38F65BBEE5E; Thu, 18 Aug 2016 11:01:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0838C15D7; Thu, 18 Aug 2016 11:01:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IB1RDA033974; Thu, 18 Aug 2016 11:01:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IB1R0J033973; Thu, 18 Aug 2016 11:01:27 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181101.u7IB1R0J033973@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:01:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304406 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:01:28 -0000 Author: mav Date: Thu Aug 18 11:01:26 2016 New Revision: 304406 URL: https://svnweb.freebsd.org/changeset/base/304406 Log: MFC r303510: Clear scratchpad after MSIX negotiation to not leak garbage. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 11:00:48 2016 (r304405) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 11:01:26 2016 (r304406) @@ -2669,6 +2669,7 @@ msix_done: if (val != NTB_MSIX_RECEIVED) goto reschedule; + intel_ntb_spad_clear(ntb->device); ntb->peer_msix_good = true; /* Give peer time to see our NTB_MSIX_RECEIVED. */ goto reschedule; From owner-svn-src-all@freebsd.org Thu Aug 18 11:02:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A9D8BBEEB9; Thu, 18 Aug 2016 11:02:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 361A71798; Thu, 18 Aug 2016 11:02:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IB218M034797; Thu, 18 Aug 2016 11:02:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IB214S034796; Thu, 18 Aug 2016 11:02:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181102.u7IB214S034796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:02:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304407 - stable/10/sys/dev/ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:02:02 -0000 Author: mav Date: Thu Aug 18 11:02:01 2016 New Revision: 304407 URL: https://svnweb.freebsd.org/changeset/base/304407 Log: MFC r303514: Fix NTBT_QP_LINKS negotiation. I believe it never worked correctly for more the one queue even in Linux. This fixes case when one of consumer drivers is not loaded on one side, but its queues still announced as ready if something else brought link up. While there, remove some pointless NULL checks. Modified: stable/10/sys/dev/ntb/ntb_transport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_transport.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 11:01:26 2016 (r304406) +++ stable/10/sys/dev/ntb/ntb_transport.c Thu Aug 18 11:02:01 2016 (r304407) @@ -575,9 +575,6 @@ ntb_transport_free_queue(struct ntb_tran struct ntb_transport_ctx *nt = qp->transport; struct ntb_queue_entry *entry; - if (qp == NULL) - return; - callout_drain(&qp->link_work); ntb_db_set_mask(qp->dev, 1ull << qp->qp_num); @@ -697,7 +694,7 @@ ntb_transport_tx_enqueue(struct ntb_tran struct ntb_queue_entry *entry; int rc; - if (qp == NULL || !qp->link_is_up || len == 0) { + if (!qp->link_is_up || len == 0) { CTR0(KTR_NTB, "TX: link not up"); return (EINVAL); } @@ -1062,11 +1059,9 @@ ntb_transport_link_work(void *arg) size >> 32); ntb_peer_spad_write(dev, NTBT_MW0_SZ_LOW + (i * 2), size); } - ntb_peer_spad_write(dev, NTBT_NUM_MWS, nt->mw_count); - ntb_peer_spad_write(dev, NTBT_NUM_QPS, nt->qp_count); - + ntb_peer_spad_write(dev, NTBT_QP_LINKS, 0); ntb_peer_spad_write(dev, NTBT_VERSION, NTB_TRANSPORT_VERSION); /* Query the remote side for its info */ @@ -1248,16 +1243,18 @@ ntb_qp_link_work(void *arg) struct ntb_transport_qp *qp = arg; device_t dev = qp->dev; struct ntb_transport_ctx *nt = qp->transport; - uint32_t val, dummy; - - ntb_spad_read(dev, NTBT_QP_LINKS, &val); - - ntb_peer_spad_write(dev, NTBT_QP_LINKS, val | (1ull << qp->qp_num)); + int i; + uint32_t val; - /* query remote spad for qp ready bits */ - ntb_peer_spad_read(dev, NTBT_QP_LINKS, &dummy); + /* Report queues that are up on our side */ + for (i = 0, val = 0; i < nt->qp_count; i++) { + if (nt->qp_vec[i].client_ready) + val |= (1 << i); + } + ntb_peer_spad_write(dev, NTBT_QP_LINKS, val); /* See if the remote side is up */ + ntb_spad_read(dev, NTBT_QP_LINKS, &val); if ((val & (1ull << qp->qp_num)) != 0) { ntb_printf(2, "qp %d link up\n", qp->qp_num); qp->link_is_up = true; @@ -1353,17 +1350,16 @@ ntb_qp_link_cleanup(struct ntb_transport void ntb_transport_link_down(struct ntb_transport_qp *qp) { + struct ntb_transport_ctx *nt = qp->transport; + int i; uint32_t val; - if (qp == NULL) - return; - qp->client_ready = false; - - ntb_spad_read(qp->dev, NTBT_QP_LINKS, &val); - - ntb_peer_spad_write(qp->dev, NTBT_QP_LINKS, - val & ~(1 << qp->qp_num)); + for (i = 0, val = 0; i < nt->qp_count; i++) { + if (nt->qp_vec[i].client_ready) + val |= (1 << i); + } + ntb_peer_spad_write(qp->dev, NTBT_QP_LINKS, val); if (qp->link_is_up) ntb_send_link_down(qp); @@ -1382,8 +1378,6 @@ ntb_transport_link_down(struct ntb_trans bool ntb_transport_link_query(struct ntb_transport_qp *qp) { - if (qp == NULL) - return (false); return (qp->link_is_up); } @@ -1482,8 +1476,6 @@ out: */ unsigned char ntb_transport_qp_num(struct ntb_transport_qp *qp) { - if (qp == NULL) - return 0; return (qp->qp_num); } @@ -1500,9 +1492,6 @@ unsigned int ntb_transport_max_size(struct ntb_transport_qp *qp) { - if (qp == NULL) - return (0); - return (qp->tx_max_frame - sizeof(struct ntb_payload_header)); } From owner-svn-src-all@freebsd.org Thu Aug 18 11:02:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C3B0BBEF24; Thu, 18 Aug 2016 11:02:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E1561976; Thu, 18 Aug 2016 11:02:43 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IB2gFN034872; Thu, 18 Aug 2016 11:02:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IB2gwc034871; Thu, 18 Aug 2016 11:02:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181102.u7IB2gwc034871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304408 - stable/10/sys/dev/ntb/if_ntb X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:02:43 -0000 Author: mav Date: Thu Aug 18 11:02:42 2016 New Revision: 304408 URL: https://svnweb.freebsd.org/changeset/base/304408 Log: MFC r303553: Make MAC address generation more random. 'ticks' approach does not work at boot time. Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/if_ntb/if_ntb.c ============================================================================== --- stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 11:02:01 2016 (r304407) +++ stable/10/sys/dev/ntb/if_ntb/if_ntb.c Thu Aug 18 11:02:42 2016 (r304408) @@ -493,10 +493,9 @@ static void create_random_local_eui48(u_char *eaddr) { static uint8_t counter = 0; - uint32_t seed = ticks; eaddr[0] = EUI48_LOCALLY_ADMINISTERED; - memcpy(&eaddr[1], &seed, sizeof(uint32_t)); + arc4rand(&eaddr[1], 4, 0); eaddr[5] = counter++; } From owner-svn-src-all@freebsd.org Thu Aug 18 11:03:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8132BBEF79; Thu, 18 Aug 2016 11:03:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A9DD1B1D; Thu, 18 Aug 2016 11:03:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IB3LE4034951; Thu, 18 Aug 2016 11:03:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IB3LXr034950; Thu, 18 Aug 2016 11:03:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181103.u7IB3LXr034950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304409 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:03:22 -0000 Author: mav Date: Thu Aug 18 11:03:21 2016 New Revision: 304409 URL: https://svnweb.freebsd.org/changeset/base/304409 Log: MFC r303554: Block MSIX negotiation until SMP started and IRQ reshuffled. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 11:02:42 2016 (r304408) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 11:03:21 2016 (r304409) @@ -2625,6 +2625,17 @@ intel_ntb_user_mw_to_idx(struct ntb_soft return (uidx); } +static int msix_ready; + +static void +intel_ntb_msix_ready(void *arg __unused) +{ + + msix_ready = 1; +} +SYSINIT(intel_ntb_msix_ready, SI_SUB_SMP, SI_ORDER_ANY, + intel_ntb_msix_ready, NULL); + static void intel_ntb_exchange_msix(void *ctx) { @@ -2639,6 +2650,10 @@ intel_ntb_exchange_msix(void *ctx) if (ntb->peer_msix_done) goto msix_done; + /* Block MSIX negotiation until SMP started and IRQ reshuffled. */ + if (!msix_ready) + goto reschedule; + intel_ntb_get_msix_info(ntb); for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { intel_ntb_peer_spad_write(ntb->device, NTB_MSIX_DATA0 + i, From owner-svn-src-all@freebsd.org Thu Aug 18 11:09:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4524BBE041; Thu, 18 Aug 2016 11:09:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B200A1D11; Thu, 18 Aug 2016 11:09:44 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IB9hdJ035229; Thu, 18 Aug 2016 11:09:43 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IB9hmk035228; Thu, 18 Aug 2016 11:09:43 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181109.u7IB9hmk035228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304410 - stable/10/sys/dev/ntb/ntb_hw X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:09:45 -0000 Author: mav Date: Thu Aug 18 11:09:43 2016 New Revision: 304410 URL: https://svnweb.freebsd.org/changeset/base/304410 Log: MFC r303561: Wrap previous MSIX workaround into #ifndef EARLY_AP_STARTUP. With EARLY_AP_STARTUP we can successfully negotiate MSIX earlier. Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c ============================================================================== --- stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 11:03:21 2016 (r304409) +++ stable/10/sys/dev/ntb/ntb_hw/ntb_hw.c Thu Aug 18 11:09:43 2016 (r304410) @@ -2625,6 +2625,7 @@ intel_ntb_user_mw_to_idx(struct ntb_soft return (uidx); } +#ifndef EARLY_AP_STARTUP static int msix_ready; static void @@ -2635,6 +2636,7 @@ intel_ntb_msix_ready(void *arg __unused) } SYSINIT(intel_ntb_msix_ready, SI_SUB_SMP, SI_ORDER_ANY, intel_ntb_msix_ready, NULL); +#endif static void intel_ntb_exchange_msix(void *ctx) @@ -2650,9 +2652,11 @@ intel_ntb_exchange_msix(void *ctx) if (ntb->peer_msix_done) goto msix_done; +#ifndef EARLY_AP_STARTUP /* Block MSIX negotiation until SMP started and IRQ reshuffled. */ if (!msix_ready) goto reschedule; +#endif intel_ntb_get_msix_info(ntb); for (i = 0; i < XEON_NONLINK_DB_MSIX_BITS; i++) { From owner-svn-src-all@freebsd.org Thu Aug 18 11:14:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C751CBBE250; Thu, 18 Aug 2016 11:14:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 941E31338; Thu, 18 Aug 2016 11:14:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IBEvEm038863; Thu, 18 Aug 2016 11:14:57 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBEvpP038862; Thu, 18 Aug 2016 11:14:57 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181114.u7IBEvpP038862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:14:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304411 - stable/11/sys/dev/ahci X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:14:58 -0000 Author: mav Date: Thu Aug 18 11:14:57 2016 New Revision: 304411 URL: https://svnweb.freebsd.org/changeset/base/304411 Log: MFC r302946: Do not consider the last interrupt shared if there are enough interrupts for all channels. Modified: stable/11/sys/dev/ahci/ahci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ahci/ahci.c ============================================================================== --- stable/11/sys/dev/ahci/ahci.c Thu Aug 18 11:09:43 2016 (r304410) +++ stable/11/sys/dev/ahci/ahci.c Thu Aug 18 11:14:57 2016 (r304411) @@ -416,7 +416,8 @@ ahci_setup_interrupt(device_t dev) else if (ctlr->numirqs == 1 || i >= ctlr->channels || (ctlr->ccc && i == ctlr->cccv)) ctlr->irqs[i].mode = AHCI_IRQ_MODE_ALL; - else if (i == ctlr->numirqs - 1) + else if (ctlr->channels > ctlr->numirqs && + i == ctlr->numirqs - 1) ctlr->irqs[i].mode = AHCI_IRQ_MODE_AFTER; else ctlr->irqs[i].mode = AHCI_IRQ_MODE_ONE; From owner-svn-src-all@freebsd.org Thu Aug 18 11:15:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83CF8BBE2A5; Thu, 18 Aug 2016 11:15:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 566E314E0; Thu, 18 Aug 2016 11:15:36 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IBFZTp038950; Thu, 18 Aug 2016 11:15:35 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBFZAQ038949; Thu, 18 Aug 2016 11:15:35 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181115.u7IBFZAQ038949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304412 - stable/11/sys/dev/ahci X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:15:36 -0000 Author: mav Date: Thu Aug 18 11:15:35 2016 New Revision: 304412 URL: https://svnweb.freebsd.org/changeset/base/304412 Log: MFC r302947: In AHCI_IRQ_MODE_AFTER mode do not clear interrupts below. This is probably a NOP change since IS register is not activery used for interrupts below the shared, but it looked odd to clear interrupts we did not handle. Modified: stable/11/sys/dev/ahci/ahci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ahci/ahci.c ============================================================================== --- stable/11/sys/dev/ahci/ahci.c Thu Aug 18 11:14:57 2016 (r304411) +++ stable/11/sys/dev/ahci/ahci.c Thu Aug 18 11:15:35 2016 (r304412) @@ -466,6 +466,7 @@ ahci_intr(void *data) } else { /* AHCI_IRQ_MODE_AFTER */ unit = irq->r_irq_rid - 1; is = ATA_INL(ctlr->r_mem, AHCI_IS); + is &= (0xffffffff << unit); } /* CCC interrupt is edge triggered. */ if (ctlr->ccc) From owner-svn-src-all@freebsd.org Thu Aug 18 11:17:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70273BBE351; Thu, 18 Aug 2016 11:17:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 42C6016A2; Thu, 18 Aug 2016 11:17:02 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IBH1RK039062; Thu, 18 Aug 2016 11:17:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBH1Ue039061; Thu, 18 Aug 2016 11:17:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181117.u7IBH1Ue039061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304413 - stable/10/sys/dev/ahci X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:17:02 -0000 Author: mav Date: Thu Aug 18 11:17:01 2016 New Revision: 304413 URL: https://svnweb.freebsd.org/changeset/base/304413 Log: MFC r302946: Do not consider the last interrupt shared if there are enough interrupts for all channels. Modified: stable/10/sys/dev/ahci/ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci.c Thu Aug 18 11:15:35 2016 (r304412) +++ stable/10/sys/dev/ahci/ahci.c Thu Aug 18 11:17:01 2016 (r304413) @@ -373,7 +373,8 @@ ahci_setup_interrupt(device_t dev) else if (ctlr->numirqs == 1 || i >= ctlr->channels || (ctlr->ccc && i == ctlr->cccv)) ctlr->irqs[i].mode = AHCI_IRQ_MODE_ALL; - else if (i == ctlr->numirqs - 1) + else if (ctlr->channels > ctlr->numirqs && + i == ctlr->numirqs - 1) ctlr->irqs[i].mode = AHCI_IRQ_MODE_AFTER; else ctlr->irqs[i].mode = AHCI_IRQ_MODE_ONE; From owner-svn-src-all@freebsd.org Thu Aug 18 11:17:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57D0FBBE3AF; Thu, 18 Aug 2016 11:17:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27F481815; Thu, 18 Aug 2016 11:17:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IBHag4039135; Thu, 18 Aug 2016 11:17:36 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBHaqn039134; Thu, 18 Aug 2016 11:17:36 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181117.u7IBHaqn039134@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304414 - stable/10/sys/dev/ahci X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:17:37 -0000 Author: mav Date: Thu Aug 18 11:17:36 2016 New Revision: 304414 URL: https://svnweb.freebsd.org/changeset/base/304414 Log: MFC r302947: In AHCI_IRQ_MODE_AFTER mode do not clear interrupts below. This is probably a NOP change since IS register is not activery used for interrupts below the shared, but it looked odd to clear interrupts we did not handle. Modified: stable/10/sys/dev/ahci/ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci.c Thu Aug 18 11:17:01 2016 (r304413) +++ stable/10/sys/dev/ahci/ahci.c Thu Aug 18 11:17:36 2016 (r304414) @@ -423,6 +423,7 @@ ahci_intr(void *data) } else { /* AHCI_IRQ_MODE_AFTER */ unit = irq->r_irq_rid - 1; is = ATA_INL(ctlr->r_mem, AHCI_IS); + is &= (0xffffffff << unit); } /* CCC interrupt is edge triggered. */ if (ctlr->ccc) From owner-svn-src-all@freebsd.org Thu Aug 18 11:23:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAF45BBE597; Thu, 18 Aug 2016 11:23:03 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD57C1CAE; Thu, 18 Aug 2016 11:23:03 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IBN2KZ042632; Thu, 18 Aug 2016 11:23:02 GMT (envelope-from oleg@FreeBSD.org) Received: (from oleg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBN2xw042631; Thu, 18 Aug 2016 11:23:02 GMT (envelope-from oleg@FreeBSD.org) Message-Id: <201608181123.u7IBN2xw042631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oleg set sender to oleg@FreeBSD.org using -f From: Oleg Bulyzhin Date: Thu, 18 Aug 2016 11:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304415 - stable/11/sys/netpfil/ipfw X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:23:04 -0000 Author: oleg Date: Thu Aug 18 11:23:02 2016 New Revision: 304415 URL: https://svnweb.freebsd.org/changeset/base/304415 Log: MFC r304154 Fix command: ipfw set (enable|disable) N (where N > 4). Modified: stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Thu Aug 18 11:17:36 2016 (r304414) +++ stable/11/sys/netpfil/ipfw/ip_fw_sockopt.c Thu Aug 18 11:23:02 2016 (r304415) @@ -1414,8 +1414,10 @@ manage_sets(struct ip_fw_chain *chain, i if (rh->range.head.length != sizeof(ipfw_range_tlv)) return (1); - if (rh->range.set >= IPFW_MAX_SETS || - rh->range.new_set >= IPFW_MAX_SETS) + /* enable_sets() expects bitmasks. */ + if (op3->opcode != IP_FW_SET_ENABLE && + (rh->range.set >= IPFW_MAX_SETS || + rh->range.new_set >= IPFW_MAX_SETS)) return (EINVAL); ret = 0; From owner-svn-src-all@freebsd.org Thu Aug 18 11:37:39 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55A66BBECB4; Thu, 18 Aug 2016 11:37:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B3CE1A83; Thu, 18 Aug 2016 11:37:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IBbcLp046921; Thu, 18 Aug 2016 11:37:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBbcku046919; Thu, 18 Aug 2016 11:37:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181137.u7IBbcku046919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:37:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304416 - stable/10/sys/dev/isp X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:37:39 -0000 Author: mav Date: Thu Aug 18 11:37:38 2016 New Revision: 304416 URL: https://svnweb.freebsd.org/changeset/base/304416 Log: MFC r300222: Fix delaying requests to unknown virtual ports 2s after init. This code was originally implemented 7 years ago, but never really worked due to trivial error. I think this functionality may be not required. Initiators supporting optional periodic command status checks detected those terminated commands and retried them 3 seconds later. But thinking about less featured initiators and the fact that it is our race makes virtual ports "unknown" it may be good to have this feature. Modified: stable/10/sys/dev/isp/isp.c stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Thu Aug 18 11:23:02 2016 (r304415) +++ stable/10/sys/dev/isp/isp.c Thu Aug 18 11:37:38 2016 (r304416) @@ -2431,6 +2431,7 @@ isp_fc_enable_vp(ispsoftc_t *isp, int ch __func__, chan, vp.vp_mod_hdr.rqs_flags, vp.vp_mod_status); return (EIO); } + GET_NANOTIME(&isp->isp_init_time); return (0); } @@ -5865,6 +5866,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * These are broadcast events that have to be sent across * all active channels. */ + GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); int topo = fcp->isp_topo; @@ -5921,6 +5923,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * This is a broadcast event that has to be sent across * all active channels. */ + GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) @@ -5964,6 +5967,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint * This is a broadcast event that has to be sent across * all active channels. */ + GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) @@ -6162,6 +6166,7 @@ isp_handle_other_response(ispsoftc_t *is portid = (uint32_t)rid.ridacq_vp_port_hi << 16 | rid.ridacq_vp_port_lo; if (rid.ridacq_format == 0) { + GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcparam *fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Thu Aug 18 11:23:02 2016 (r304415) +++ stable/10/sys/dev/isp/isp_freebsd.c Thu Aug 18 11:37:38 2016 (r304416) @@ -2055,7 +2055,7 @@ isp_handle_platform_atio7(ispsoftc_t *is * It's a bit tricky here as we need to stash this command *somewhere*. */ GET_NANOTIME(&now); - if (NANOTIME_SUB(&isp->isp_init_time, &now) > 2000000000ULL) { + if (NANOTIME_SUB(&now, &isp->isp_init_time) > 2000000000ULL) { isp_prt(isp, ISP_LOGWARN, "%s: [RX_ID 0x%x] D_ID %x not found on any channel- dropping", __func__, aep->at_rxid, did); isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, ECMD_TERMINATE, 0); return; From owner-svn-src-all@freebsd.org Thu Aug 18 11:38:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 023D2BBED48; Thu, 18 Aug 2016 11:38:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B45001C4C; Thu, 18 Aug 2016 11:38:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IBclre047013; Thu, 18 Aug 2016 11:38:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBclvi047010; Thu, 18 Aug 2016 11:38:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181138.u7IBclvi047010@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:38:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304417 - in stable/10/sys: cam cam/ctl dev/isp X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:38:49 -0000 Author: mav Date: Thu Aug 18 11:38:47 2016 New Revision: 304417 URL: https://svnweb.freebsd.org/changeset/base/304417 Log: MFC r300293: Pass task management response information from CTL through CAM to isp(4), utilizing previously unused arg field of struct ccb_notify_acknowledge. This makes new QUERY TASK, QUERY TASK SET and QUERY ASYNC EVENT requests really functional for CAM target mode drivers. Modified: stable/10/sys/cam/cam_ccb.h stable/10/sys/cam/ctl/scsi_ctl.c stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/cam_ccb.h ============================================================================== --- stable/10/sys/cam/cam_ccb.h Thu Aug 18 11:37:38 2016 (r304416) +++ stable/10/sys/cam/cam_ccb.h Thu Aug 18 11:38:47 2016 (r304417) @@ -1084,7 +1084,17 @@ struct ccb_notify_acknowledge { u_int tag_id; /* Tag for immediate notify */ u_int seq_id; /* Tar for target of notify */ u_int initiator_id; /* Initiator Identifier */ - u_int arg; /* Function specific */ + u_int arg; /* Response information */ + /* + * Lower byte of arg is one of RESPONSE CODE values defined below + * (subset of response codes from SPL-4 and FCP-4 specifications), + * upper 3 bytes is code-specific ADDITIONAL RESPONSE INFORMATION. + */ +#define CAM_RSP_TMF_COMPLETE 0x00 +#define CAM_RSP_TMF_REJECTED 0x04 +#define CAM_RSP_TMF_FAILED 0x05 +#define CAM_RSP_TMF_SUCCEEDED 0x08 +#define CAM_RSP_TMF_INCORRECT_LUN 0x09 }; /* HBA engine structures. */ Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Thu Aug 18 11:37:38 2016 (r304416) +++ stable/10/sys/cam/ctl/scsi_ctl.c Thu Aug 18 11:38:47 2016 (r304417) @@ -1552,6 +1552,7 @@ ctlfedone(struct cam_periph *periph, uni /* * Queue this back down to the SIM as an immediate notify. */ + done_ccb->ccb_h.status = CAM_REQ_INPROG; done_ccb->ccb_h.func_code = XPT_IMMEDIATE_NOTIFY; xpt_action(done_ccb); break; @@ -2040,6 +2041,28 @@ ctlfe_done(union ctl_io *io) */ ccb->ccb_h.status = CAM_REQ_INPROG; ccb->ccb_h.func_code = XPT_NOTIFY_ACKNOWLEDGE; + switch (io->taskio.task_status) { + case CTL_TASK_FUNCTION_COMPLETE: + ccb->cna2.arg = CAM_RSP_TMF_COMPLETE; + break; + case CTL_TASK_FUNCTION_SUCCEEDED: + ccb->cna2.arg = CAM_RSP_TMF_SUCCEEDED; + ccb->ccb_h.flags |= CAM_SEND_STATUS; + break; + case CTL_TASK_FUNCTION_REJECTED: + ccb->cna2.arg = CAM_RSP_TMF_REJECTED; + ccb->ccb_h.flags |= CAM_SEND_STATUS; + break; + case CTL_TASK_LUN_DOES_NOT_EXIST: + ccb->cna2.arg = CAM_RSP_TMF_INCORRECT_LUN; + ccb->ccb_h.flags |= CAM_SEND_STATUS; + break; + case CTL_TASK_FUNCTION_NOT_SUPPORTED: + ccb->cna2.arg = CAM_RSP_TMF_FAILED; + ccb->ccb_h.flags |= CAM_SEND_STATUS; + break; + } + ccb->cna2.arg |= scsi_3btoul(io->taskio.task_resp) << 8; xpt_action(ccb); } else if (io->io_hdr.flags & CTL_FLAG_STATUS_SENT) { if (softc->flags & CTLFE_LUN_WILDCARD) { Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Thu Aug 18 11:37:38 2016 (r304416) +++ stable/10/sys/dev/isp/isp_freebsd.c Thu Aug 18 11:38:47 2016 (r304417) @@ -856,7 +856,7 @@ static void isp_handle_platform_atio7(is static void isp_handle_platform_ctio(ispsoftc_t *, void *); static void isp_handle_platform_notify_fc(ispsoftc_t *, in_fcentry_t *); static void isp_handle_platform_notify_24xx(ispsoftc_t *, in_fcentry_24xx_t *); -static int isp_handle_platform_target_notify_ack(ispsoftc_t *, isp_notify_t *); +static int isp_handle_platform_target_notify_ack(ispsoftc_t *, isp_notify_t *, uint32_t rsp); static void isp_handle_platform_target_tmf(ispsoftc_t *, isp_notify_t *); static void isp_target_mark_aborted(ispsoftc_t *, union ccb *); static void isp_target_mark_aborted_early(ispsoftc_t *, tstate_t *, uint32_t); @@ -2761,7 +2761,7 @@ isp_handle_platform_notify_24xx(ispsoftc } static int -isp_handle_platform_target_notify_ack(ispsoftc_t *isp, isp_notify_t *mp) +isp_handle_platform_target_notify_ack(ispsoftc_t *isp, isp_notify_t *mp, uint32_t rsp) { if (isp->isp_state != ISP_RUNSTATE) { @@ -2796,6 +2796,15 @@ isp_handle_platform_target_notify_ack(is cto->ct_oxid = aep->at_hdr.ox_id; cto->ct_flags = CT7_SENDSTATUS|CT7_NOACK|CT7_NO_DATA|CT7_FLAG_MODE1; cto->ct_flags |= (aep->at_ta_len >> 12) << CT7_TASK_ATTR_SHIFT; + if (rsp != 0) { + cto->ct_scsi_status |= (FCP_RSPLEN_VALID << 8); + cto->rsp.m1.ct_resplen = 4; + ISP_MEMZERO(cto->rsp.m1.ct_resp, sizeof (cto->rsp.m1.ct_resp)); + cto->rsp.m1.ct_resp[0] = rsp & 0xff; + cto->rsp.m1.ct_resp[1] = (rsp >> 8) & 0xff; + cto->rsp.m1.ct_resp[2] = (rsp >> 16) & 0xff; + cto->rsp.m1.ct_resp[3] = (rsp >> 24) & 0xff; + } return (isp_target_put_entry(isp, &local)); } @@ -3642,7 +3651,8 @@ isp_action(struct cam_sim *sim, union cc xpt_done(ccb); break; } - if (isp_handle_platform_target_notify_ack(isp, &ntp->rd.nt)) { + if (isp_handle_platform_target_notify_ack(isp, &ntp->rd.nt, + (ccb->ccb_h.flags & CAM_SEND_STATUS) ? ccb->cna2.arg : 0)) { rls_lun_statep(isp, tptr); cam_freeze_devq(ccb->ccb_h.path); cam_release_devq(ccb->ccb_h.path, RELSIM_RELEASE_AFTER_TIMEOUT, 0, 1000, 0); @@ -4407,11 +4417,11 @@ changed: /* * This is device arrival/departure notification */ - isp_handle_platform_target_notify_ack(isp, notify); + isp_handle_platform_target_notify_ack(isp, notify, 0); break; default: isp_prt(isp, ISP_LOGALL, "target notify code 0x%x", notify->nt_ncode); - isp_handle_platform_target_notify_ack(isp, notify); + isp_handle_platform_target_notify_ack(isp, notify, 0); break; } break; From owner-svn-src-all@freebsd.org Thu Aug 18 11:39:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED7B2BBEDB1; Thu, 18 Aug 2016 11:39:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C02741DCE; Thu, 18 Aug 2016 11:39:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IBdVaV047096; Thu, 18 Aug 2016 11:39:31 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBdV77047095; Thu, 18 Aug 2016 11:39:31 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181139.u7IBdV77047095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304418 - stable/10/sys/dev/isp X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:39:32 -0000 Author: mav Date: Thu Aug 18 11:39:30 2016 New Revision: 304418 URL: https://svnweb.freebsd.org/changeset/base/304418 Log: MFC r300296: Pass proper for 23xx arguments to isp_endcmd(). Modified: stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Thu Aug 18 11:38:47 2016 (r304417) +++ stable/10/sys/dev/isp/isp_freebsd.c Thu Aug 18 11:39:30 2016 (r304418) @@ -2003,7 +2003,7 @@ noresrc: ntp = isp_get_ntpd(isp, tptr); if (ntp == NULL) { rls_lun_statep(isp, tptr); - isp_endcmd(isp, aep, nphdl, 0, SCSI_STATUS_BUSY, 0); + isp_endcmd(isp, aep, SCSI_STATUS_BUSY, 0); return; } memcpy(ntp->rd.data, aep, QENTRY_LEN); From owner-svn-src-all@freebsd.org Thu Aug 18 11:41:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2986BBEFB2; Thu, 18 Aug 2016 11:41:59 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A6CAF1313; Thu, 18 Aug 2016 11:41:59 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IBfwKF050485; Thu, 18 Aug 2016 11:41:58 GMT (envelope-from oleg@FreeBSD.org) Received: (from oleg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBfwV6050484; Thu, 18 Aug 2016 11:41:58 GMT (envelope-from oleg@FreeBSD.org) Message-Id: <201608181141.u7IBfwV6050484@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oleg set sender to oleg@FreeBSD.org using -f From: Oleg Bulyzhin Date: Thu, 18 Aug 2016 11:41:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304419 - stable/11 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:42:00 -0000 Author: oleg Date: Thu Aug 18 11:41:58 2016 New Revision: 304419 URL: https://svnweb.freebsd.org/changeset/base/304419 Log: Fix directory properties missing in previous (r304415) commit. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Thu Aug 18 11:45:04 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F4A6BBE162; Thu, 18 Aug 2016 11:45:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DAF1E163D; Thu, 18 Aug 2016 11:45:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IBj3B7050725; Thu, 18 Aug 2016 11:45:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBj2Q5050723; Thu, 18 Aug 2016 11:45:02 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181145.u7IBj2Q5050723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304420 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:45:04 -0000 Author: mav Date: Thu Aug 18 11:45:02 2016 New Revision: 304420 URL: https://svnweb.freebsd.org/changeset/base/304420 Log: MFC r302459: Allow AHCI controller to support up to 32 arbitrary devices. While old syntax is still supported, new syntax looks like this: -s 3,ahci,hd:/dev/zvol/XXX,hd:/dev/zvol/YYY,cd:/storage/ZZZ.iso Sponsored by: iXsystems, Inc. Modified: stable/10/usr.sbin/bhyve/bhyve.8 stable/10/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/10/usr.sbin/bhyve/bhyve.8 Thu Aug 18 11:41:58 2016 (r304419) +++ stable/10/usr.sbin/bhyve/bhyve.8 Thu Aug 18 11:45:02 2016 (r304420) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 7, 2015 +.Dd July 8, 2016 .Dt BHYVE 8 .Os .Sh NAME @@ -168,6 +168,8 @@ Virtio network interface. Virtio block storage interface. .It Li virtio-rnd Virtio RNG interface. +.It Li ahci +AHCI controller attached to arbitraty devices. .It Li ahci-cd AHCI controller attached to an ATAPI CD/DVD. .It Li ahci-hd @@ -323,15 +325,11 @@ null-modem device. .Bd -literal -offset indent bhyve -c 4 \\ -s 0,amd_hostbridge -s 1,lpc \\ - -s 1:0,ahci-hd,/images/disk.1 \\ - -s 1:1,ahci-hd,/images/disk.2 \\ - -s 1:2,ahci-hd,/images/disk.3 \\ - -s 1:3,ahci-hd,/images/disk.4 \\ - -s 1:4,ahci-hd,/images/disk.5 \\ - -s 1:5,ahci-hd,/images/disk.6 \\ - -s 1:6,ahci-hd,/images/disk.7 \\ - -s 1:7,ahci-hd,/images/disk.8 \\ - -s 2,ahci-cd,/images/install.iso \\ + -s 1:0,ahci,hd:/images/disk.1,hd:/images/disk.2,\\ +hd:/images/disk.3,hd:/images/disk.4,\\ +hd:/images/disk.5,hd:/images/disk.6,\\ +hd:/images/disk.7,hd:/images/disk.8,\\ +cd:/images/install.iso \\ -s 3,virtio-net,tap0 \\ -l com1,/dev/nmdm0A \\ -A -H -P -m 8G Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Thu Aug 18 11:41:58 2016 (r304419) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Thu Aug 18 11:45:02 2016 (r304420) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013 Zhixiang Yu + * Copyright (c) 2015-2016 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,7 +58,8 @@ __FBSDID("$FreeBSD$"); #include "ahci.h" #include "block_if.h" -#define MAX_PORTS 6 /* Intel ICH8 AHCI supports 6 ports */ +#define DEF_PORTS 6 /* Intel ICH8 AHCI supports 6 ports */ +#define MAX_PORTS 32 /* AHCI supports 32 ports */ #define PxSIG_ATA 0x00000101 /* ATA drive */ #define PxSIG_ATAPI 0xeb140101 /* ATAPI drive */ @@ -2236,20 +2238,16 @@ pci_ahci_read(struct vmctx *ctx, int vcp static int pci_ahci_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts, int atapi) { - char bident[sizeof("XX:X:X")]; + char bident[sizeof("XX:XX:XX")]; struct blockif_ctxt *bctxt; struct pci_ahci_softc *sc; - int ret, slots; + int ret, slots, p; MD5_CTX mdctx; u_char digest[16]; + char *next, *next2; ret = 0; - if (opts == NULL) { - fprintf(stderr, "pci_ahci: backing device required\n"); - return (1); - } - #ifdef AHCI_DEBUG dbg = fopen("/tmp/log", "w+"); #endif @@ -2257,58 +2255,83 @@ pci_ahci_init(struct vmctx *ctx, struct sc = calloc(1, sizeof(struct pci_ahci_softc)); pi->pi_arg = sc; sc->asc_pi = pi; - sc->ports = MAX_PORTS; + pthread_mutex_init(&sc->mtx, NULL); + sc->ports = 0; + sc->pi = 0; + slots = 32; + + for (p = 0; p < MAX_PORTS && opts != NULL; p++, opts = next) { + /* Identify and cut off type of present port. */ + if (strncmp(opts, "hd:", 3) == 0) { + atapi = 0; + opts += 3; + } else if (strncmp(opts, "cd:", 3) == 0) { + atapi = 1; + opts += 3; + } + + /* Find and cut off the next port options. */ + next = strstr(opts, ",hd:"); + next2 = strstr(opts, ",cd:"); + if (next == NULL || (next2 != NULL && next2 < next)) + next = next2; + if (next != NULL) { + next[0] = 0; + next++; + } - /* - * Only use port 0 for a backing device. All other ports will be - * marked as unused - */ - sc->port[0].atapi = atapi; + if (opts[0] == 0) + continue; - /* - * Attempt to open the backing image. Use the PCI - * slot/func for the identifier string. - */ - snprintf(bident, sizeof(bident), "%d:%d", pi->pi_slot, pi->pi_func); - bctxt = blockif_open(opts, bident); - if (bctxt == NULL) { - ret = 1; - goto open_fail; - } - sc->port[0].bctx = bctxt; - sc->port[0].pr_sc = sc; + /* + * Attempt to open the backing image. Use the PCI slot/func + * and the port number for the identifier string. + */ + snprintf(bident, sizeof(bident), "%d:%d:%d", pi->pi_slot, + pi->pi_func, p); + bctxt = blockif_open(opts, bident); + if (bctxt == NULL) { + sc->ports = p; + ret = 1; + goto open_fail; + } + sc->port[p].bctx = bctxt; + sc->port[p].pr_sc = sc; + sc->port[p].atapi = atapi; - /* - * Create an identifier for the backing file. Use parts of the - * md5 sum of the filename - */ - MD5Init(&mdctx); - MD5Update(&mdctx, opts, strlen(opts)); - MD5Final(digest, &mdctx); - sprintf(sc->port[0].ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", - digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); + /* + * Create an identifier for the backing file. + * Use parts of the md5 sum of the filename + */ + MD5Init(&mdctx); + MD5Update(&mdctx, opts, strlen(opts)); + MD5Final(digest, &mdctx); + sprintf(sc->port[p].ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", + digest[0], digest[1], digest[2], digest[3], digest[4], + digest[5]); - /* - * Allocate blockif request structures and add them - * to the free list - */ - pci_ahci_ioreq_init(&sc->port[0]); + /* + * Allocate blockif request structures and add them + * to the free list + */ + pci_ahci_ioreq_init(&sc->port[p]); - pthread_mutex_init(&sc->mtx, NULL); + sc->pi |= (1 << p); + if (sc->port[p].ioqsz < slots) + slots = sc->port[p].ioqsz; + } + sc->ports = p; /* Intel ICH8 AHCI */ - slots = sc->port[0].ioqsz; - if (slots > 32) - slots = 32; --slots; + if (sc->ports < DEF_PORTS) + sc->ports = DEF_PORTS; sc->cap = AHCI_CAP_64BIT | AHCI_CAP_SNCQ | AHCI_CAP_SSNTF | AHCI_CAP_SMPS | AHCI_CAP_SSS | AHCI_CAP_SALP | AHCI_CAP_SAL | AHCI_CAP_SCLO | (0x3 << AHCI_CAP_ISS_SHIFT)| AHCI_CAP_PMD | AHCI_CAP_SSC | AHCI_CAP_PSC | (slots << AHCI_CAP_NCS_SHIFT) | AHCI_CAP_SXS | (sc->ports - 1); - /* Only port 0 implemented */ - sc->pi = 1; sc->vs = 0x10300; sc->cap2 = AHCI_CAP2_APST; ahci_reset(sc); @@ -2326,8 +2349,10 @@ pci_ahci_init(struct vmctx *ctx, struct open_fail: if (ret) { - if (sc->port[0].bctx != NULL) - blockif_close(sc->port[0].bctx); + for (p = 0; p < sc->ports; p++) { + if (sc->port[p].bctx != NULL) + blockif_close(sc->port[p].bctx); + } free(sc); } @@ -2351,6 +2376,14 @@ pci_ahci_atapi_init(struct vmctx *ctx, s /* * Use separate emulation names to distinguish drive and atapi devices */ +struct pci_devemu pci_de_ahci = { + .pe_emu = "ahci", + .pe_init = pci_ahci_hd_init, + .pe_barwrite = pci_ahci_write, + .pe_barread = pci_ahci_read +}; +PCI_EMUL_SET(pci_de_ahci); + struct pci_devemu pci_de_ahci_hd = { .pe_emu = "ahci-hd", .pe_init = pci_ahci_hd_init, From owner-svn-src-all@freebsd.org Thu Aug 18 11:45:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 354D6BBE1BD; Thu, 18 Aug 2016 11:45:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09EEE179F; Thu, 18 Aug 2016 11:45:47 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IBjllK050805; Thu, 18 Aug 2016 11:45:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBjlbP050803; Thu, 18 Aug 2016 11:45:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181145.u7IBjlbP050803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:45:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304421 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:45:48 -0000 Author: mav Date: Thu Aug 18 11:45:46 2016 New Revision: 304421 URL: https://svnweb.freebsd.org/changeset/base/304421 Log: MFC r302460: Add emulation for multiple (up to 16) MSI vectors for AHCI. It was useless before, but may improve performance now if multiple devices are configured and guest supports this feature. Sponsored by: iXsystems, Inc. Modified: stable/10/usr.sbin/bhyve/pci_ahci.c stable/10/usr.sbin/bhyve/pci_emul.h Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/10/usr.sbin/bhyve/pci_ahci.c Thu Aug 18 11:45:02 2016 (r304420) +++ stable/10/usr.sbin/bhyve/pci_ahci.c Thu Aug 18 11:45:46 2016 (r304421) @@ -135,6 +135,7 @@ struct ahci_port { uint8_t *cmd_lst; uint8_t *rfis; char ident[20 + 1]; + int port; int atapi; int reset; int waitforclear; @@ -219,47 +220,95 @@ static inline void lba_to_msf(uint8_t *b } /* - * generate HBA intr depending on whether or not ports within - * the controller have an interrupt pending. + * Generate HBA interrupts on global IS register write. */ static void -ahci_generate_intr(struct pci_ahci_softc *sc) +ahci_generate_intr(struct pci_ahci_softc *sc, uint32_t mask) { - struct pci_devinst *pi; - int i; - - pi = sc->asc_pi; + struct pci_devinst *pi = sc->asc_pi; + struct ahci_port *p; + int i, nmsg; + uint32_t mmask; + /* Update global IS from PxIS/PxIE. */ for (i = 0; i < sc->ports; i++) { - struct ahci_port *pr; - pr = &sc->port[i]; - if (pr->is & pr->ie) + p = &sc->port[i]; + if (p->is & p->ie) sc->is |= (1 << i); } + DPRINTF("%s(%08x) %08x\n", __func__, mask, sc->is); - DPRINTF("%s %x\n", __func__, sc->is); + /* If there is nothing enabled -- clear legacy interrupt and exit. */ + if (sc->is == 0 || (sc->ghc & AHCI_GHC_IE) == 0) { + if (sc->lintr) { + pci_lintr_deassert(pi); + sc->lintr = 0; + } + return; + } - if (sc->is && (sc->ghc & AHCI_GHC_IE)) { - if (pci_msi_enabled(pi)) { - /* - * Generate an MSI interrupt on every edge - */ - pci_generate_msi(pi, 0); - } else if (!sc->lintr) { - /* - * Only generate a pin-based interrupt if one wasn't - * in progress - */ + /* If there is anything and no MSI -- assert legacy interrupt. */ + nmsg = pci_msi_maxmsgnum(pi); + if (nmsg == 0) { + if (!sc->lintr) { sc->lintr = 1; pci_lintr_assert(pi); } - } else if (sc->lintr) { - /* - * No interrupts: deassert pin-based signal if it had - * been asserted - */ - pci_lintr_deassert(pi); - sc->lintr = 0; + return; + } + + /* Assert respective MSIs for ports that were touched. */ + for (i = 0; i < nmsg; i++) { + if (sc->ports <= nmsg || i < nmsg - 1) + mmask = 1 << i; + else + mmask = 0xffffffff << i; + if (sc->is & mask && mmask & mask) + pci_generate_msi(pi, i); + } +} + +/* + * Generate HBA interrupt on specific port event. + */ +static void +ahci_port_intr(struct ahci_port *p) +{ + struct pci_ahci_softc *sc = p->pr_sc; + struct pci_devinst *pi = sc->asc_pi; + int nmsg; + + DPRINTF("%s(%d) %08x/%08x %08x\n", __func__, + p->port, p->is, p->ie, sc->is); + + /* If there is nothing enabled -- we are done. */ + if ((p->is & p->ie) == 0) + return; + + /* In case of non-shared MSI always generate interrupt. */ + nmsg = pci_msi_maxmsgnum(pi); + if (sc->ports <= nmsg || p->port < nmsg - 1) { + sc->is |= (1 << p->port); + if ((sc->ghc & AHCI_GHC_IE) == 0) + return; + pci_generate_msi(pi, p->port); + return; + } + + /* If IS for this port is already set -- do nothing. */ + if (sc->is & (1 << p->port)) + return; + + sc->is |= (1 << p->port); + + /* If interrupts are enabled -- generate one. */ + if ((sc->ghc & AHCI_GHC_IE) == 0) + return; + if (nmsg > 0) { + pci_generate_msi(pi, nmsg - 1); + } else if (!sc->lintr) { + sc->lintr = 1; + pci_lintr_assert(pi); } } @@ -297,8 +346,10 @@ ahci_write_fis(struct ahci_port *p, enum } memcpy(p->rfis + offset, fis, len); if (irq) { - p->is |= irq; - ahci_generate_intr(p->pr_sc); + if (~p->is & irq) { + p->is |= irq; + ahci_port_intr(p); + } } } @@ -1740,7 +1791,7 @@ ahci_handle_slot(struct ahci_port *p, in struct pci_ahci_softc *sc; uint8_t *cfis; #ifdef AHCI_DEBUG - int cfl; + int cfl, i; #endif sc = p->pr_sc; @@ -2001,10 +2052,11 @@ pci_ahci_port_write(struct pci_ahci_soft break; case AHCI_P_IS: p->is &= ~value; + ahci_port_intr(p); break; case AHCI_P_IE: p->ie = value & 0xFDC000FF; - ahci_generate_intr(sc); + ahci_port_intr(p); break; case AHCI_P_CMD: { @@ -2094,16 +2146,19 @@ pci_ahci_host_write(struct pci_ahci_soft DPRINTF("pci_ahci_host: read only registers 0x%"PRIx64"\n", offset); break; case AHCI_GHC: - if (value & AHCI_GHC_HR) + if (value & AHCI_GHC_HR) { ahci_reset(sc); - else if (value & AHCI_GHC_IE) { - sc->ghc |= AHCI_GHC_IE; - ahci_generate_intr(sc); + break; } + if (value & AHCI_GHC_IE) + sc->ghc |= AHCI_GHC_IE; + else + sc->ghc &= ~AHCI_GHC_IE; + ahci_generate_intr(sc, 0xffffffff); break; case AHCI_IS: sc->is &= ~value; - ahci_generate_intr(sc); + ahci_generate_intr(sc, value); break; default: break; @@ -2297,6 +2352,7 @@ pci_ahci_init(struct vmctx *ctx, struct } sc->port[p].bctx = bctxt; sc->port[p].pr_sc = sc; + sc->port[p].port = p; sc->port[p].atapi = atapi; /* @@ -2341,7 +2397,9 @@ pci_ahci_init(struct vmctx *ctx, struct pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_STORAGE); pci_set_cfgdata8(pi, PCIR_SUBCLASS, PCIS_STORAGE_SATA); pci_set_cfgdata8(pi, PCIR_PROGIF, PCIP_STORAGE_SATA_AHCI_1_0); - pci_emul_add_msicap(pi, 1); + p = MIN(sc->ports, 16); + p = flsl(p) - ((p & (p - 1)) ? 0 : 1); + pci_emul_add_msicap(pi, 1 << p); pci_emul_alloc_bar(pi, 5, PCIBAR_MEM32, AHCI_OFFSET + sc->ports * AHCI_STEP); Modified: stable/10/usr.sbin/bhyve/pci_emul.h ============================================================================== --- stable/10/usr.sbin/bhyve/pci_emul.h Thu Aug 18 11:45:02 2016 (r304420) +++ stable/10/usr.sbin/bhyve/pci_emul.h Thu Aug 18 11:45:46 2016 (r304421) @@ -230,7 +230,7 @@ int pci_msi_enabled(struct pci_devinst * int pci_msix_enabled(struct pci_devinst *pi); int pci_msix_table_bar(struct pci_devinst *pi); int pci_msix_pba_bar(struct pci_devinst *pi); -int pci_msi_msgnum(struct pci_devinst *pi); +int pci_msi_maxmsgnum(struct pci_devinst *pi); int pci_parse_slot(char *opt); void pci_populate_msicap(struct msicap *cap, int msgs, int nextptr); int pci_emul_add_msixcap(struct pci_devinst *pi, int msgnum, int barnum); From owner-svn-src-all@freebsd.org Thu Aug 18 11:49:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5F63BBE2B7; Thu, 18 Aug 2016 11:49:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A131519AF; Thu, 18 Aug 2016 11:49:17 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IBnG3W051007; Thu, 18 Aug 2016 11:49:16 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBnGt0051005; Thu, 18 Aug 2016 11:49:16 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181149.u7IBnGt0051005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304422 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:49:17 -0000 Author: mav Date: Thu Aug 18 11:49:16 2016 New Revision: 304422 URL: https://svnweb.freebsd.org/changeset/base/304422 Log: MFC r302459: Allow AHCI controller to support up to 32 arbitrary devices. While old syntax is still supported, new syntax looks like this: -s 3,ahci,hd:/dev/zvol/XXX,hd:/dev/zvol/YYY,cd:/storage/ZZZ.iso Sponsored by: iXsystems, Inc. Modified: stable/11/usr.sbin/bhyve/bhyve.8 stable/11/usr.sbin/bhyve/pci_ahci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/11/usr.sbin/bhyve/bhyve.8 Thu Aug 18 11:45:46 2016 (r304421) +++ stable/11/usr.sbin/bhyve/bhyve.8 Thu Aug 18 11:49:16 2016 (r304422) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 24, 2016 +.Dd July 8, 2016 .Dt BHYVE 8 .Os .Sh NAME @@ -171,6 +171,8 @@ Virtio network interface. Virtio block storage interface. .It Li virtio-rnd Virtio RNG interface. +.It Li ahci +AHCI controller attached to arbitraty devices. .It Li ahci-cd AHCI controller attached to an ATAPI CD/DVD. .It Li ahci-hd @@ -347,15 +349,11 @@ null-modem device. .Bd -literal -offset indent bhyve -c 4 \\ -s 0,amd_hostbridge -s 1,lpc \\ - -s 1:0,ahci-hd,/images/disk.1 \\ - -s 1:1,ahci-hd,/images/disk.2 \\ - -s 1:2,ahci-hd,/images/disk.3 \\ - -s 1:3,ahci-hd,/images/disk.4 \\ - -s 1:4,ahci-hd,/images/disk.5 \\ - -s 1:5,ahci-hd,/images/disk.6 \\ - -s 1:6,ahci-hd,/images/disk.7 \\ - -s 1:7,ahci-hd,/images/disk.8 \\ - -s 2,ahci-cd,/images/install.iso \\ + -s 1:0,ahci,hd:/images/disk.1,hd:/images/disk.2,\\ +hd:/images/disk.3,hd:/images/disk.4,\\ +hd:/images/disk.5,hd:/images/disk.6,\\ +hd:/images/disk.7,hd:/images/disk.8,\\ +cd:/images/install.iso \\ -s 3,virtio-net,tap0 \\ -l com1,/dev/nmdm0A \\ -A -H -P -m 8G Modified: stable/11/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_ahci.c Thu Aug 18 11:45:46 2016 (r304421) +++ stable/11/usr.sbin/bhyve/pci_ahci.c Thu Aug 18 11:49:16 2016 (r304422) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2013 Zhixiang Yu + * Copyright (c) 2015-2016 Alexander Motin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -57,7 +58,8 @@ __FBSDID("$FreeBSD$"); #include "ahci.h" #include "block_if.h" -#define MAX_PORTS 6 /* Intel ICH8 AHCI supports 6 ports */ +#define DEF_PORTS 6 /* Intel ICH8 AHCI supports 6 ports */ +#define MAX_PORTS 32 /* AHCI supports 32 ports */ #define PxSIG_ATA 0x00000101 /* ATA drive */ #define PxSIG_ATAPI 0xeb140101 /* ATAPI drive */ @@ -2229,20 +2231,16 @@ pci_ahci_read(struct vmctx *ctx, int vcp static int pci_ahci_init(struct vmctx *ctx, struct pci_devinst *pi, char *opts, int atapi) { - char bident[sizeof("XX:X:X")]; + char bident[sizeof("XX:XX:XX")]; struct blockif_ctxt *bctxt; struct pci_ahci_softc *sc; - int ret, slots; + int ret, slots, p; MD5_CTX mdctx; u_char digest[16]; + char *next, *next2; ret = 0; - if (opts == NULL) { - fprintf(stderr, "pci_ahci: backing device required\n"); - return (1); - } - #ifdef AHCI_DEBUG dbg = fopen("/tmp/log", "w+"); #endif @@ -2250,58 +2248,83 @@ pci_ahci_init(struct vmctx *ctx, struct sc = calloc(1, sizeof(struct pci_ahci_softc)); pi->pi_arg = sc; sc->asc_pi = pi; - sc->ports = MAX_PORTS; + pthread_mutex_init(&sc->mtx, NULL); + sc->ports = 0; + sc->pi = 0; + slots = 32; + + for (p = 0; p < MAX_PORTS && opts != NULL; p++, opts = next) { + /* Identify and cut off type of present port. */ + if (strncmp(opts, "hd:", 3) == 0) { + atapi = 0; + opts += 3; + } else if (strncmp(opts, "cd:", 3) == 0) { + atapi = 1; + opts += 3; + } + + /* Find and cut off the next port options. */ + next = strstr(opts, ",hd:"); + next2 = strstr(opts, ",cd:"); + if (next == NULL || (next2 != NULL && next2 < next)) + next = next2; + if (next != NULL) { + next[0] = 0; + next++; + } - /* - * Only use port 0 for a backing device. All other ports will be - * marked as unused - */ - sc->port[0].atapi = atapi; + if (opts[0] == 0) + continue; - /* - * Attempt to open the backing image. Use the PCI - * slot/func for the identifier string. - */ - snprintf(bident, sizeof(bident), "%d:%d", pi->pi_slot, pi->pi_func); - bctxt = blockif_open(opts, bident); - if (bctxt == NULL) { - ret = 1; - goto open_fail; - } - sc->port[0].bctx = bctxt; - sc->port[0].pr_sc = sc; + /* + * Attempt to open the backing image. Use the PCI slot/func + * and the port number for the identifier string. + */ + snprintf(bident, sizeof(bident), "%d:%d:%d", pi->pi_slot, + pi->pi_func, p); + bctxt = blockif_open(opts, bident); + if (bctxt == NULL) { + sc->ports = p; + ret = 1; + goto open_fail; + } + sc->port[p].bctx = bctxt; + sc->port[p].pr_sc = sc; + sc->port[p].atapi = atapi; - /* - * Create an identifier for the backing file. Use parts of the - * md5 sum of the filename - */ - MD5Init(&mdctx); - MD5Update(&mdctx, opts, strlen(opts)); - MD5Final(digest, &mdctx); - sprintf(sc->port[0].ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", - digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); + /* + * Create an identifier for the backing file. + * Use parts of the md5 sum of the filename + */ + MD5Init(&mdctx); + MD5Update(&mdctx, opts, strlen(opts)); + MD5Final(digest, &mdctx); + sprintf(sc->port[p].ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", + digest[0], digest[1], digest[2], digest[3], digest[4], + digest[5]); - /* - * Allocate blockif request structures and add them - * to the free list - */ - pci_ahci_ioreq_init(&sc->port[0]); + /* + * Allocate blockif request structures and add them + * to the free list + */ + pci_ahci_ioreq_init(&sc->port[p]); - pthread_mutex_init(&sc->mtx, NULL); + sc->pi |= (1 << p); + if (sc->port[p].ioqsz < slots) + slots = sc->port[p].ioqsz; + } + sc->ports = p; /* Intel ICH8 AHCI */ - slots = sc->port[0].ioqsz; - if (slots > 32) - slots = 32; --slots; + if (sc->ports < DEF_PORTS) + sc->ports = DEF_PORTS; sc->cap = AHCI_CAP_64BIT | AHCI_CAP_SNCQ | AHCI_CAP_SSNTF | AHCI_CAP_SMPS | AHCI_CAP_SSS | AHCI_CAP_SALP | AHCI_CAP_SAL | AHCI_CAP_SCLO | (0x3 << AHCI_CAP_ISS_SHIFT)| AHCI_CAP_PMD | AHCI_CAP_SSC | AHCI_CAP_PSC | (slots << AHCI_CAP_NCS_SHIFT) | AHCI_CAP_SXS | (sc->ports - 1); - /* Only port 0 implemented */ - sc->pi = 1; sc->vs = 0x10300; sc->cap2 = AHCI_CAP2_APST; ahci_reset(sc); @@ -2319,8 +2342,10 @@ pci_ahci_init(struct vmctx *ctx, struct open_fail: if (ret) { - if (sc->port[0].bctx != NULL) - blockif_close(sc->port[0].bctx); + for (p = 0; p < sc->ports; p++) { + if (sc->port[p].bctx != NULL) + blockif_close(sc->port[p].bctx); + } free(sc); } @@ -2344,6 +2369,14 @@ pci_ahci_atapi_init(struct vmctx *ctx, s /* * Use separate emulation names to distinguish drive and atapi devices */ +struct pci_devemu pci_de_ahci = { + .pe_emu = "ahci", + .pe_init = pci_ahci_hd_init, + .pe_barwrite = pci_ahci_write, + .pe_barread = pci_ahci_read +}; +PCI_EMUL_SET(pci_de_ahci); + struct pci_devemu pci_de_ahci_hd = { .pe_emu = "ahci-hd", .pe_init = pci_ahci_hd_init, From owner-svn-src-all@freebsd.org Thu Aug 18 11:49:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3EC2BBE3C9; Thu, 18 Aug 2016 11:49:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E3851B78; Thu, 18 Aug 2016 11:49:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IBnnb2051081; Thu, 18 Aug 2016 11:49:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBnnwn051079; Thu, 18 Aug 2016 11:49:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181149.u7IBnnwn051079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304423 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:49:50 -0000 Author: mav Date: Thu Aug 18 11:49:49 2016 New Revision: 304423 URL: https://svnweb.freebsd.org/changeset/base/304423 Log: MFC r302460: Add emulation for multiple (up to 16) MSI vectors for AHCI. It was useless before, but may improve performance now if multiple devices are configured and guest supports this feature. Sponsored by: iXsystems, Inc. Modified: stable/11/usr.sbin/bhyve/pci_ahci.c stable/11/usr.sbin/bhyve/pci_emul.h Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_ahci.c Thu Aug 18 11:49:16 2016 (r304422) +++ stable/11/usr.sbin/bhyve/pci_ahci.c Thu Aug 18 11:49:49 2016 (r304423) @@ -135,6 +135,7 @@ struct ahci_port { uint8_t *cmd_lst; uint8_t *rfis; char ident[20 + 1]; + int port; int atapi; int reset; int waitforclear; @@ -219,47 +220,95 @@ static inline void lba_to_msf(uint8_t *b } /* - * generate HBA intr depending on whether or not ports within - * the controller have an interrupt pending. + * Generate HBA interrupts on global IS register write. */ static void -ahci_generate_intr(struct pci_ahci_softc *sc) +ahci_generate_intr(struct pci_ahci_softc *sc, uint32_t mask) { - struct pci_devinst *pi; - int i; - - pi = sc->asc_pi; + struct pci_devinst *pi = sc->asc_pi; + struct ahci_port *p; + int i, nmsg; + uint32_t mmask; + /* Update global IS from PxIS/PxIE. */ for (i = 0; i < sc->ports; i++) { - struct ahci_port *pr; - pr = &sc->port[i]; - if (pr->is & pr->ie) + p = &sc->port[i]; + if (p->is & p->ie) sc->is |= (1 << i); } + DPRINTF("%s(%08x) %08x\n", __func__, mask, sc->is); - DPRINTF("%s %x\n", __func__, sc->is); + /* If there is nothing enabled -- clear legacy interrupt and exit. */ + if (sc->is == 0 || (sc->ghc & AHCI_GHC_IE) == 0) { + if (sc->lintr) { + pci_lintr_deassert(pi); + sc->lintr = 0; + } + return; + } - if (sc->is && (sc->ghc & AHCI_GHC_IE)) { - if (pci_msi_enabled(pi)) { - /* - * Generate an MSI interrupt on every edge - */ - pci_generate_msi(pi, 0); - } else if (!sc->lintr) { - /* - * Only generate a pin-based interrupt if one wasn't - * in progress - */ + /* If there is anything and no MSI -- assert legacy interrupt. */ + nmsg = pci_msi_maxmsgnum(pi); + if (nmsg == 0) { + if (!sc->lintr) { sc->lintr = 1; pci_lintr_assert(pi); } - } else if (sc->lintr) { - /* - * No interrupts: deassert pin-based signal if it had - * been asserted - */ - pci_lintr_deassert(pi); - sc->lintr = 0; + return; + } + + /* Assert respective MSIs for ports that were touched. */ + for (i = 0; i < nmsg; i++) { + if (sc->ports <= nmsg || i < nmsg - 1) + mmask = 1 << i; + else + mmask = 0xffffffff << i; + if (sc->is & mask && mmask & mask) + pci_generate_msi(pi, i); + } +} + +/* + * Generate HBA interrupt on specific port event. + */ +static void +ahci_port_intr(struct ahci_port *p) +{ + struct pci_ahci_softc *sc = p->pr_sc; + struct pci_devinst *pi = sc->asc_pi; + int nmsg; + + DPRINTF("%s(%d) %08x/%08x %08x\n", __func__, + p->port, p->is, p->ie, sc->is); + + /* If there is nothing enabled -- we are done. */ + if ((p->is & p->ie) == 0) + return; + + /* In case of non-shared MSI always generate interrupt. */ + nmsg = pci_msi_maxmsgnum(pi); + if (sc->ports <= nmsg || p->port < nmsg - 1) { + sc->is |= (1 << p->port); + if ((sc->ghc & AHCI_GHC_IE) == 0) + return; + pci_generate_msi(pi, p->port); + return; + } + + /* If IS for this port is already set -- do nothing. */ + if (sc->is & (1 << p->port)) + return; + + sc->is |= (1 << p->port); + + /* If interrupts are enabled -- generate one. */ + if ((sc->ghc & AHCI_GHC_IE) == 0) + return; + if (nmsg > 0) { + pci_generate_msi(pi, nmsg - 1); + } else if (!sc->lintr) { + sc->lintr = 1; + pci_lintr_assert(pi); } } @@ -297,8 +346,10 @@ ahci_write_fis(struct ahci_port *p, enum } memcpy(p->rfis + offset, fis, len); if (irq) { - p->is |= irq; - ahci_generate_intr(p->pr_sc); + if (~p->is & irq) { + p->is |= irq; + ahci_port_intr(p); + } } } @@ -1733,7 +1784,7 @@ ahci_handle_slot(struct ahci_port *p, in struct pci_ahci_softc *sc; uint8_t *cfis; #ifdef AHCI_DEBUG - int cfl; + int cfl, i; #endif sc = p->pr_sc; @@ -1994,10 +2045,11 @@ pci_ahci_port_write(struct pci_ahci_soft break; case AHCI_P_IS: p->is &= ~value; + ahci_port_intr(p); break; case AHCI_P_IE: p->ie = value & 0xFDC000FF; - ahci_generate_intr(sc); + ahci_port_intr(p); break; case AHCI_P_CMD: { @@ -2087,16 +2139,19 @@ pci_ahci_host_write(struct pci_ahci_soft DPRINTF("pci_ahci_host: read only registers 0x%"PRIx64"\n", offset); break; case AHCI_GHC: - if (value & AHCI_GHC_HR) + if (value & AHCI_GHC_HR) { ahci_reset(sc); - else if (value & AHCI_GHC_IE) { - sc->ghc |= AHCI_GHC_IE; - ahci_generate_intr(sc); + break; } + if (value & AHCI_GHC_IE) + sc->ghc |= AHCI_GHC_IE; + else + sc->ghc &= ~AHCI_GHC_IE; + ahci_generate_intr(sc, 0xffffffff); break; case AHCI_IS: sc->is &= ~value; - ahci_generate_intr(sc); + ahci_generate_intr(sc, value); break; default: break; @@ -2290,6 +2345,7 @@ pci_ahci_init(struct vmctx *ctx, struct } sc->port[p].bctx = bctxt; sc->port[p].pr_sc = sc; + sc->port[p].port = p; sc->port[p].atapi = atapi; /* @@ -2334,7 +2390,9 @@ pci_ahci_init(struct vmctx *ctx, struct pci_set_cfgdata8(pi, PCIR_CLASS, PCIC_STORAGE); pci_set_cfgdata8(pi, PCIR_SUBCLASS, PCIS_STORAGE_SATA); pci_set_cfgdata8(pi, PCIR_PROGIF, PCIP_STORAGE_SATA_AHCI_1_0); - pci_emul_add_msicap(pi, 1); + p = MIN(sc->ports, 16); + p = flsl(p) - ((p & (p - 1)) ? 0 : 1); + pci_emul_add_msicap(pi, 1 << p); pci_emul_alloc_bar(pi, 5, PCIBAR_MEM32, AHCI_OFFSET + sc->ports * AHCI_STEP); Modified: stable/11/usr.sbin/bhyve/pci_emul.h ============================================================================== --- stable/11/usr.sbin/bhyve/pci_emul.h Thu Aug 18 11:49:16 2016 (r304422) +++ stable/11/usr.sbin/bhyve/pci_emul.h Thu Aug 18 11:49:49 2016 (r304423) @@ -230,7 +230,7 @@ int pci_msi_enabled(struct pci_devinst * int pci_msix_enabled(struct pci_devinst *pi); int pci_msix_table_bar(struct pci_devinst *pi); int pci_msix_pba_bar(struct pci_devinst *pi); -int pci_msi_msgnum(struct pci_devinst *pi); +int pci_msi_maxmsgnum(struct pci_devinst *pi); int pci_parse_slot(char *opt); void pci_populate_msicap(struct msicap *cap, int msgs, int nextptr); int pci_emul_add_msixcap(struct pci_devinst *pi, int msgnum, int barnum); From owner-svn-src-all@freebsd.org Thu Aug 18 11:51:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BD2FBBE43A; Thu, 18 Aug 2016 11:51:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 674D81DAC; Thu, 18 Aug 2016 11:51:15 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IBpEhN051867; Thu, 18 Aug 2016 11:51:14 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBpE83051864; Thu, 18 Aug 2016 11:51:14 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181151.u7IBpE83051864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:51:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304424 - stable/11/usr.sbin/bhyve X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:51:15 -0000 Author: mav Date: Thu Aug 18 11:51:14 2016 New Revision: 304424 URL: https://svnweb.freebsd.org/changeset/base/304424 Log: MFC r302504, r302666, r302668, r302932, r302933: Add emulation for Intel e1000 (e82545) network adapter. The code was successfully tested with FreeBSD, Linux, Solaris and Windows guests. This interface is predictably slower (about 2x) then virtio-net, but it is very helpful for guests not supporting virtio-net by default. Thanks to Jeremiah Lott and Peter Grehan for doing original heavy lifting. Added: stable/11/usr.sbin/bhyve/pci_e82545.c - copied, changed from r302504, head/usr.sbin/bhyve/pci_e82545.c Modified: stable/11/usr.sbin/bhyve/Makefile stable/11/usr.sbin/bhyve/bhyve.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bhyve/Makefile ============================================================================== --- stable/11/usr.sbin/bhyve/Makefile Thu Aug 18 11:49:49 2016 (r304423) +++ stable/11/usr.sbin/bhyve/Makefile Thu Aug 18 11:51:14 2016 (r304424) @@ -28,6 +28,7 @@ SRCS= \ mevent.c \ mptbl.c \ pci_ahci.c \ + pci_e82545.c \ pci_emul.c \ pci_fbuf.c \ pci_hostbridge.c \ @@ -61,6 +62,8 @@ SRCS+= vmm_instruction_emul.c LIBADD= vmmapi md pthread z +CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/e1000 +CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/mii CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/usb/controller WARNS?= 2 Modified: stable/11/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/11/usr.sbin/bhyve/bhyve.8 Thu Aug 18 11:49:49 2016 (r304423) +++ stable/11/usr.sbin/bhyve/bhyve.8 Thu Aug 18 11:51:14 2016 (r304424) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 8, 2016 +.Dd July 9, 2016 .Dt BHYVE 8 .Os .Sh NAME @@ -177,6 +177,8 @@ AHCI controller attached to arbitraty de AHCI controller attached to an ATAPI CD/DVD. .It Li ahci-hd AHCI controller attached to a SATA hard-drive. +.It Li e1000 +Intel e82545 network interface. .It Li uart PCI 16550 serial device. .It Li lpc Copied and modified: stable/11/usr.sbin/bhyve/pci_e82545.c (from r302504, head/usr.sbin/bhyve/pci_e82545.c) ============================================================================== --- head/usr.sbin/bhyve/pci_e82545.c Sat Jul 9 20:41:59 2016 (r302504, copy source) +++ stable/11/usr.sbin/bhyve/pci_e82545.c Thu Aug 18 11:51:14 2016 (r304424) @@ -109,12 +109,8 @@ __FBSDID("$FreeBSD$"); #define E1000_ICR_SRPD 0x00010000 -/* - * XXX does this actually have a limit on the 82545 ? - * There is a limit on the max number of bytes, but perhaps not - * on descriptors ?? - */ -#define I82545_MAX_TXSEGS 20 +/* This is an arbitrary number. There is no hard limit on the chip. */ +#define I82545_MAX_TXSEGS 64 /* Legacy receive descriptor */ struct e1000_rx_desc { @@ -1050,15 +1046,18 @@ e82545_transmit_backend(struct e82545_so } static void -e82545_transmit_done(struct e82545_softc *sc, union e1000_tx_udesc **txwb, - int nwb) +e82545_transmit_done(struct e82545_softc *sc, uint16_t head, uint16_t tail, + uint16_t dsize, int *tdwb) { - int i; + union e1000_tx_udesc *dsc; - /* Write-back tx descriptor status */ - for (i = 0; i < nwb; i++) - txwb[i]->td.upper.data |= E1000_TXD_STAT_DD; - /* XXX wmb() */ + for ( ; head != tail; head = (head + 1) % dsize) { + dsc = &sc->esc_txdesc[head]; + if (dsc->td.lower.data & E1000_TXD_CMD_RS) { + dsc->td.upper.data |= E1000_TXD_STAT_DD; + *tdwb = 1; + } + } } static int @@ -1068,22 +1067,21 @@ e82545_transmit(struct e82545_softc *sc, uint8_t *hdr, *hdrp; struct iovec iovb[I82545_MAX_TXSEGS + 2]; struct iovec tiov[I82545_MAX_TXSEGS + 2]; - union e1000_tx_udesc *txwb[I82545_MAX_TXSEGS]; struct e1000_context_desc *cd; struct ck_info ckinfo[2]; struct iovec *iov; union e1000_tx_udesc *dsc; - int desc, dtype, len, ntype, nwb, iovcnt, tlen, hdrlen, vlen, tcp, tso; + int desc, dtype, len, ntype, iovcnt, tlen, hdrlen, vlen, tcp, tso; int mss, paylen, seg, tiovcnt, left, now, nleft, nnow, pv, pvoff; uint32_t tcpsum, tcpseq; - uint16_t ipcs, tcpcs, ipid; + uint16_t ipcs, tcpcs, ipid, ohead; ckinfo[0].ck_valid = ckinfo[1].ck_valid = 0; iovcnt = 0; tlen = 0; - nwb = 0; ntype = 0; tso = 0; + ohead = head; /* iovb[0/1] may be used for writable copy of headers. */ iov = &iovb[2]; @@ -1104,11 +1102,8 @@ e82545_transmit(struct e82545_softc *sc, head, dsc->td.buffer_addr, dsc->td.upper.data, dsc->td.lower.data); /* Save context and return */ - /* XXX ignore DD processing here */ sc->esc_txctx = dsc->cd; - *rhead = (head + 1) % dsize; - return (1); - break; + goto done; case E1000_TXD_TYP_L: DPRINTF("tx legacy desc idx %d: %08x%08x\r\n", head, dsc->td.upper.data, dsc->td.lower.data); @@ -1142,16 +1137,14 @@ e82545_transmit(struct e82545_softc *sc, (dsc->td.lower.data & E1000_TXD_CMD_IFCS) == 0) len -= 2; tlen += len; - iov[iovcnt].iov_base = paddr_guest2host(sc->esc_ctx, - dsc->td.buffer_addr, len); - iov[iovcnt].iov_len = len; + if (iovcnt < I82545_MAX_TXSEGS) { + iov[iovcnt].iov_base = paddr_guest2host( + sc->esc_ctx, dsc->td.buffer_addr, len); + iov[iovcnt].iov_len = len; + } iovcnt++; } - /* Record the descriptor addres if write-back requested */ - if (dsc->td.lower.data & E1000_TXD_CMD_RS) - txwb[nwb++] = dsc; - /* * Pull out info that is valid in the final descriptor * and exit descriptor loop. @@ -1197,6 +1190,12 @@ e82545_transmit(struct e82545_softc *sc, } } + if (iovcnt > I82545_MAX_TXSEGS) { + WPRINTF("tx too many descriptors (%d > %d) -- dropped\r\n", + iovcnt, I82545_MAX_TXSEGS); + goto done; + } + hdrlen = vlen = 0; /* Estimate writable space for VLAN header insertion. */ if ((sc->esc_CTRL & E1000_CTRL_VME) && @@ -1356,12 +1355,10 @@ e82545_transmit(struct e82545_softc *sc, } done: - /* Record if tx descs were written back */ - e82545_transmit_done(sc, txwb, nwb); - if (nwb) - *tdwb = 1; + head = (head + 1) % dsize; + e82545_transmit_done(sc, ohead, head, dsize, tdwb); - *rhead = (head + 1) % dsize; + *rhead = head; return (desc + 1); } @@ -2000,6 +1997,7 @@ e82545_read_register(struct e82545_softc break; default: DPRINTF("Unknown read register: 0x%x\r\n", offset); + retval = 0; break; } @@ -2040,6 +2038,7 @@ e82545_write(struct vmctx *ctx, int vcpu DPRINTF("Unknown io bar write offset:0x%lx value:0x%lx size:%d\r\n", offset, value, size); break; } + break; case E82545_BAR_REGISTER: if (size != 4) { DPRINTF("Wrong register write size:%d offset:0x%lx value:0x%lx\r\n", size, offset, value); @@ -2092,6 +2091,7 @@ e82545_read(struct vmctx *ctx, int vcpu, offset, size); break; } + break; case E82545_BAR_REGISTER: if (size != 4) { DPRINTF("Wrong register read size:%d offset:0x%lx\r\n", From owner-svn-src-all@freebsd.org Thu Aug 18 11:56:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE921BBE732; Thu, 18 Aug 2016 11:56:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA8F41345; Thu, 18 Aug 2016 11:56:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IBu7wG054698; Thu, 18 Aug 2016 11:56:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IBu7OL054695; Thu, 18 Aug 2016 11:56:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181156.u7IBu7OL054695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 11:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304425 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 11:56:09 -0000 Author: mav Date: Thu Aug 18 11:56:07 2016 New Revision: 304425 URL: https://svnweb.freebsd.org/changeset/base/304425 Log: MFC r302504, r302666, r302668, r302932, r302933: Add emulation for Intel e1000 (e82545) network adapter. The code was successfully tested with FreeBSD, Linux, Solaris and Windows guests. This interface is predictably slower (about 2x) then virtio-net, but it is very helpful for guests not supporting virtio-net by default. Thanks to Jeremiah Lott and Peter Grehan for doing original heavy lifting. Added: stable/10/usr.sbin/bhyve/pci_e82545.c - copied, changed from r302504, head/usr.sbin/bhyve/pci_e82545.c Modified: stable/10/usr.sbin/bhyve/Makefile stable/10/usr.sbin/bhyve/bhyve.8 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/Makefile ============================================================================== --- stable/10/usr.sbin/bhyve/Makefile Thu Aug 18 11:51:14 2016 (r304424) +++ stable/10/usr.sbin/bhyve/Makefile Thu Aug 18 11:56:07 2016 (r304425) @@ -23,6 +23,7 @@ SRCS= \ mevent.c \ mptbl.c \ pci_ahci.c \ + pci_e82545.c \ pci_emul.c \ pci_hostbridge.c \ pci_irq.c \ @@ -48,6 +49,10 @@ SRCS+= vmm_instruction_emul.c DPADD= ${LIBVMMAPI} ${LIBMD} ${LIBUTIL} ${LIBPTHREAD} LDADD= -lvmmapi -lmd -lutil -lpthread +CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/e1000 +CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/mii +CFLAGS+= -I${BHYVE_SYSDIR}/sys/dev/usb/controller + WARNS?= 2 .include Modified: stable/10/usr.sbin/bhyve/bhyve.8 ============================================================================== --- stable/10/usr.sbin/bhyve/bhyve.8 Thu Aug 18 11:51:14 2016 (r304424) +++ stable/10/usr.sbin/bhyve/bhyve.8 Thu Aug 18 11:56:07 2016 (r304425) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 8, 2016 +.Dd July 9, 2016 .Dt BHYVE 8 .Os .Sh NAME @@ -174,6 +174,8 @@ AHCI controller attached to arbitraty de AHCI controller attached to an ATAPI CD/DVD. .It Li ahci-hd AHCI controller attached to a SATA hard-drive. +.It Li e1000 +Intel e82545 network interface. .It Li uart PCI 16550 serial device. .It Li lpc Copied and modified: stable/10/usr.sbin/bhyve/pci_e82545.c (from r302504, head/usr.sbin/bhyve/pci_e82545.c) ============================================================================== --- head/usr.sbin/bhyve/pci_e82545.c Sat Jul 9 20:41:59 2016 (r302504, copy source) +++ stable/10/usr.sbin/bhyve/pci_e82545.c Thu Aug 18 11:56:07 2016 (r304425) @@ -109,12 +109,8 @@ __FBSDID("$FreeBSD$"); #define E1000_ICR_SRPD 0x00010000 -/* - * XXX does this actually have a limit on the 82545 ? - * There is a limit on the max number of bytes, but perhaps not - * on descriptors ?? - */ -#define I82545_MAX_TXSEGS 20 +/* This is an arbitrary number. There is no hard limit on the chip. */ +#define I82545_MAX_TXSEGS 64 /* Legacy receive descriptor */ struct e1000_rx_desc { @@ -1050,15 +1046,18 @@ e82545_transmit_backend(struct e82545_so } static void -e82545_transmit_done(struct e82545_softc *sc, union e1000_tx_udesc **txwb, - int nwb) +e82545_transmit_done(struct e82545_softc *sc, uint16_t head, uint16_t tail, + uint16_t dsize, int *tdwb) { - int i; + union e1000_tx_udesc *dsc; - /* Write-back tx descriptor status */ - for (i = 0; i < nwb; i++) - txwb[i]->td.upper.data |= E1000_TXD_STAT_DD; - /* XXX wmb() */ + for ( ; head != tail; head = (head + 1) % dsize) { + dsc = &sc->esc_txdesc[head]; + if (dsc->td.lower.data & E1000_TXD_CMD_RS) { + dsc->td.upper.data |= E1000_TXD_STAT_DD; + *tdwb = 1; + } + } } static int @@ -1068,22 +1067,21 @@ e82545_transmit(struct e82545_softc *sc, uint8_t *hdr, *hdrp; struct iovec iovb[I82545_MAX_TXSEGS + 2]; struct iovec tiov[I82545_MAX_TXSEGS + 2]; - union e1000_tx_udesc *txwb[I82545_MAX_TXSEGS]; struct e1000_context_desc *cd; struct ck_info ckinfo[2]; struct iovec *iov; union e1000_tx_udesc *dsc; - int desc, dtype, len, ntype, nwb, iovcnt, tlen, hdrlen, vlen, tcp, tso; + int desc, dtype, len, ntype, iovcnt, tlen, hdrlen, vlen, tcp, tso; int mss, paylen, seg, tiovcnt, left, now, nleft, nnow, pv, pvoff; uint32_t tcpsum, tcpseq; - uint16_t ipcs, tcpcs, ipid; + uint16_t ipcs, tcpcs, ipid, ohead; ckinfo[0].ck_valid = ckinfo[1].ck_valid = 0; iovcnt = 0; tlen = 0; - nwb = 0; ntype = 0; tso = 0; + ohead = head; /* iovb[0/1] may be used for writable copy of headers. */ iov = &iovb[2]; @@ -1104,11 +1102,8 @@ e82545_transmit(struct e82545_softc *sc, head, dsc->td.buffer_addr, dsc->td.upper.data, dsc->td.lower.data); /* Save context and return */ - /* XXX ignore DD processing here */ sc->esc_txctx = dsc->cd; - *rhead = (head + 1) % dsize; - return (1); - break; + goto done; case E1000_TXD_TYP_L: DPRINTF("tx legacy desc idx %d: %08x%08x\r\n", head, dsc->td.upper.data, dsc->td.lower.data); @@ -1142,16 +1137,14 @@ e82545_transmit(struct e82545_softc *sc, (dsc->td.lower.data & E1000_TXD_CMD_IFCS) == 0) len -= 2; tlen += len; - iov[iovcnt].iov_base = paddr_guest2host(sc->esc_ctx, - dsc->td.buffer_addr, len); - iov[iovcnt].iov_len = len; + if (iovcnt < I82545_MAX_TXSEGS) { + iov[iovcnt].iov_base = paddr_guest2host( + sc->esc_ctx, dsc->td.buffer_addr, len); + iov[iovcnt].iov_len = len; + } iovcnt++; } - /* Record the descriptor addres if write-back requested */ - if (dsc->td.lower.data & E1000_TXD_CMD_RS) - txwb[nwb++] = dsc; - /* * Pull out info that is valid in the final descriptor * and exit descriptor loop. @@ -1197,6 +1190,12 @@ e82545_transmit(struct e82545_softc *sc, } } + if (iovcnt > I82545_MAX_TXSEGS) { + WPRINTF("tx too many descriptors (%d > %d) -- dropped\r\n", + iovcnt, I82545_MAX_TXSEGS); + goto done; + } + hdrlen = vlen = 0; /* Estimate writable space for VLAN header insertion. */ if ((sc->esc_CTRL & E1000_CTRL_VME) && @@ -1356,12 +1355,10 @@ e82545_transmit(struct e82545_softc *sc, } done: - /* Record if tx descs were written back */ - e82545_transmit_done(sc, txwb, nwb); - if (nwb) - *tdwb = 1; + head = (head + 1) % dsize; + e82545_transmit_done(sc, ohead, head, dsize, tdwb); - *rhead = (head + 1) % dsize; + *rhead = head; return (desc + 1); } @@ -2000,6 +1997,7 @@ e82545_read_register(struct e82545_softc break; default: DPRINTF("Unknown read register: 0x%x\r\n", offset); + retval = 0; break; } @@ -2040,6 +2038,7 @@ e82545_write(struct vmctx *ctx, int vcpu DPRINTF("Unknown io bar write offset:0x%lx value:0x%lx size:%d\r\n", offset, value, size); break; } + break; case E82545_BAR_REGISTER: if (size != 4) { DPRINTF("Wrong register write size:%d offset:0x%lx value:0x%lx\r\n", size, offset, value); @@ -2092,6 +2091,7 @@ e82545_read(struct vmctx *ctx, int vcpu, offset, size); break; } + break; case E82545_BAR_REGISTER: if (size != 4) { DPRINTF("Wrong register read size:%d offset:0x%lx\r\n", From owner-svn-src-all@freebsd.org Thu Aug 18 12:08:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5412BBC454; Thu, 18 Aug 2016 12:08:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77CDA1D11; Thu, 18 Aug 2016 12:08:40 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IC8dtP058544; Thu, 18 Aug 2016 12:08:39 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IC8dYZ058543; Thu, 18 Aug 2016 12:08:39 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181208.u7IC8dYZ058543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 12:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304426 - stable/11/sys/net X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 12:08:40 -0000 Author: mav Date: Thu Aug 18 12:08:39 2016 New Revision: 304426 URL: https://svnweb.freebsd.org/changeset/base/304426 Log: MFC r303009: Negotiate/disable TXCSUM_IPV6 same as TXCSUM. Modified: stable/11/sys/net/if_bridge.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_bridge.c ============================================================================== --- stable/11/sys/net/if_bridge.c Thu Aug 18 11:56:07 2016 (r304425) +++ stable/11/sys/net/if_bridge.c Thu Aug 18 12:08:39 2016 (r304426) @@ -166,7 +166,8 @@ __FBSDID("$FreeBSD$"); /* * List of capabilities to possibly mask on the member interface. */ -#define BRIDGE_IFCAPS_MASK (IFCAP_TOE|IFCAP_TSO|IFCAP_TXCSUM) +#define BRIDGE_IFCAPS_MASK (IFCAP_TOE|IFCAP_TSO|IFCAP_TXCSUM|\ + IFCAP_TXCSUM_IPV6) /* * List of capabilities to strip From owner-svn-src-all@freebsd.org Thu Aug 18 12:09:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B9AEBBC4E7; Thu, 18 Aug 2016 12:09:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E1791E93; Thu, 18 Aug 2016 12:09:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IC9Kma058629; Thu, 18 Aug 2016 12:09:20 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IC9KDt058628; Thu, 18 Aug 2016 12:09:20 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201608181209.u7IC9KDt058628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 18 Aug 2016 12:09:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304427 - stable/10/sys/net X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 12:09:21 -0000 Author: mav Date: Thu Aug 18 12:09:20 2016 New Revision: 304427 URL: https://svnweb.freebsd.org/changeset/base/304427 Log: MFC r303009: Negotiate/disable TXCSUM_IPV6 same as TXCSUM. Modified: stable/10/sys/net/if_bridge.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if_bridge.c ============================================================================== --- stable/10/sys/net/if_bridge.c Thu Aug 18 12:08:39 2016 (r304426) +++ stable/10/sys/net/if_bridge.c Thu Aug 18 12:09:20 2016 (r304427) @@ -165,7 +165,8 @@ __FBSDID("$FreeBSD$"); /* * List of capabilities to possibly mask on the member interface. */ -#define BRIDGE_IFCAPS_MASK (IFCAP_TOE|IFCAP_TSO|IFCAP_TXCSUM) +#define BRIDGE_IFCAPS_MASK (IFCAP_TOE|IFCAP_TSO|IFCAP_TXCSUM|\ + IFCAP_TXCSUM_IPV6) /* * List of capabilities to strip From owner-svn-src-all@freebsd.org Thu Aug 18 12:51:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BFE9BBD819; Thu, 18 Aug 2016 12:51:28 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D28DC1873; Thu, 18 Aug 2016 12:51:27 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7ICpRhl076725; Thu, 18 Aug 2016 12:51:27 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ICpRtn076724; Thu, 18 Aug 2016 12:51:27 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608181251.u7ICpRtn076724@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 18 Aug 2016 12:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304428 - stable/11/sys/netinet X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 12:51:28 -0000 Author: tuexen Date: Thu Aug 18 12:51:26 2016 New Revision: 304428 URL: https://svnweb.freebsd.org/changeset/base/304428 Log: MFC r304146: Ensure that sctp_it_ctl.cur_it does not point to a free object (during a small time window). Thanks to Byron Campen for reporting the issue and suggesting a fix. Modified: stable/11/sys/netinet/sctputil.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/sctputil.c ============================================================================== --- stable/11/sys/netinet/sctputil.c Thu Aug 18 12:09:20 2016 (r304427) +++ stable/11/sys/netinet/sctputil.c Thu Aug 18 12:51:26 2016 (r304428) @@ -1280,6 +1280,7 @@ sctp_iterator_work(struct sctp_iterator SCTP_INP_INFO_RLOCK(); SCTP_ITERATOR_LOCK(); + sctp_it_ctl.cur_it = it; if (it->inp) { SCTP_INP_RLOCK(it->inp); SCTP_INP_DECR_REF(it->inp); @@ -1287,6 +1288,7 @@ sctp_iterator_work(struct sctp_iterator if (it->inp == NULL) { /* iterator is complete */ done_with_iterator: + sctp_it_ctl.cur_it = NULL; SCTP_ITERATOR_UNLOCK(); SCTP_INP_INFO_RUNLOCK(); if (it->function_atend != NULL) { @@ -1427,13 +1429,11 @@ sctp_iterator_worker(void) sctp_it_ctl.iterator_running = 1; TAILQ_FOREACH_SAFE(it, &sctp_it_ctl.iteratorhead, sctp_nxt_itr, nit) { - sctp_it_ctl.cur_it = it; /* now lets work on this one */ TAILQ_REMOVE(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); SCTP_IPI_ITERATOR_WQ_UNLOCK(); CURVNET_SET(it->vn); sctp_iterator_work(it); - sctp_it_ctl.cur_it = NULL; CURVNET_RESTORE(); SCTP_IPI_ITERATOR_WQ_LOCK(); /* sa_ignore FREED_MEMORY */ From owner-svn-src-all@freebsd.org Thu Aug 18 12:56:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8295EBBD8C2; Thu, 18 Aug 2016 12:56:59 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 627F51C26; Thu, 18 Aug 2016 12:56:58 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from T530-Allan.ScaleEngine.net (unknown [37.205.61.203]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id C13F81B32; Thu, 18 Aug 2016 12:56:56 +0000 (UTC) Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , Nathan Whitehorn References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Allan Jude Message-ID: <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> Date: Thu, 18 Aug 2016 08:56:55 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <86fuq24d8s.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 12:56:59 -0000 On 08/18/16 05:50 AM, Dag-Erling Smørgrav wrote: > Nathan Whitehorn writes: >> OK. In which configurations? My Dell servers, for instance, don't do >> this. How are they set up? What drivers are being used? Is this >> something that affects passthrough disks, RAIDs, disk images? > > Most LSI MegaRAID controllers don't have real passthrough, only JBOD. > You can query the drive with "camcontrol identify passX", but the > controller does not report a stripe size for the volume (mfidY). > >> The point is that *if the reported stripe size is wrong*, more things >> than partition alignment in the installer will suffer for it. > > It's not wrong, it's non-existent, and I'm getting really tired of > repeating myself. > >> Fixing the installer with a bandaid in the run-up to a release is >> fine, but *we need to fix the underlying problem*. > > We can't, because hardware sucks, and I'm getting really tired of > repeating myself. > > DES > Which makes more sense: A) If stripesize == 0, use some sane value like 4096 B) Some other combination that uses the reported stripe size, unless it is 0, in which case it uses 4096 (or some other value controlled by a different new sysctl) C) create kern.geom.min_stripe_size with a default of 512, but users can set 4096 if they use only 4k devices. (doesn't really solve the problem for the installer) -- Allan Jude From owner-svn-src-all@freebsd.org Thu Aug 18 13:23:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E3858BBDEE9; Thu, 18 Aug 2016 13:23:42 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9FDFC1C06; Thu, 18 Aug 2016 13:23:42 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1baNIJ-000AlV-1x; Thu, 18 Aug 2016 16:23:39 +0300 Date: Thu, 18 Aug 2016 16:23:39 +0300 From: Slawa Olhovchenkov To: Allan Jude Cc: Dag-Erling =?utf-8?B?U23DuHJncmF2?= , Nathan Whitehorn , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit Message-ID: <20160818132338.GN22212@zxy.spb.ru> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 13:23:43 -0000 On Thu, Aug 18, 2016 at 08:56:55AM -0400, Allan Jude wrote: > A) If stripesize == 0, use some sane value like 4096 > > B) Some other combination that uses the reported stripe size, unless it > is 0, in which case it uses 4096 (or some other value controlled by a > different new sysctl) > > C) create kern.geom.min_stripe_size with a default of 512, but users can > set 4096 if they use only 4k devices. (doesn't really solve the problem > for the installer) As I am already pointed default mus be 4096, user can reduce to 512 (or 256/128). From owner-svn-src-all@freebsd.org Thu Aug 18 14:10:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 385D6BBE84D; Thu, 18 Aug 2016 14:10:38 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08A401501; Thu, 18 Aug 2016 14:10:37 +0000 (UTC) (envelope-from badger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IEAbJP003653; Thu, 18 Aug 2016 14:10:37 GMT (envelope-from badger@FreeBSD.org) Received: (from badger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IEAasN003647; Thu, 18 Aug 2016 14:10:36 GMT (envelope-from badger@FreeBSD.org) Message-Id: <201608181410.u7IEAasN003647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: badger set sender to badger@FreeBSD.org using -f From: Eric Badger Date: Thu, 18 Aug 2016 14:10:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304429 - in stable/11/sys: amd64/amd64 i386/i386 kern sys x86/x86 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 14:10:38 -0000 Author: badger Date: Thu Aug 18 14:10:36 2016 New Revision: 304429 URL: https://svnweb.freebsd.org/changeset/base/304429 Log: MFC r302783: Add explicit detection of KVM hypervisor Set vm_guest to a new enum value (VM_GUEST_KVM) when kvm is detected and use vm_guest in conditionals testing for KVM. Also, fix a conditional checking if we're running in a VM which caught only the generic VM case, but not more specific VMs (KVM, VMWare, etc.). (Spotted by: vangyzen). Sponsored by: Dell Inc. Approved by: vangyzen (mentor) Modified: stable/11/sys/amd64/amd64/pmap.c stable/11/sys/i386/i386/pmap.c stable/11/sys/kern/subr_param.c stable/11/sys/sys/systm.h stable/11/sys/x86/x86/identcpu.c stable/11/sys/x86/x86/local_apic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/pmap.c ============================================================================== --- stable/11/sys/amd64/amd64/pmap.c Thu Aug 18 12:51:26 2016 (r304428) +++ stable/11/sys/amd64/amd64/pmap.c Thu Aug 18 14:10:36 2016 (r304429) @@ -1224,7 +1224,7 @@ pmap_init(void) * include at least one feature that is only supported by older Intel * or newer AMD processors. */ - if (vm_guest == VM_GUEST_VM && (cpu_feature & CPUID_SS) == 0 && + if (vm_guest != VM_GUEST_NO && (cpu_feature & CPUID_SS) == 0 && (cpu_feature2 & (CPUID2_SSSE3 | CPUID2_SSE41 | CPUID2_AESNI | CPUID2_AVX | CPUID2_XSAVE)) == 0 && (amd_feature2 & (AMDID2_XOP | AMDID2_FMA4)) == 0) Modified: stable/11/sys/i386/i386/pmap.c ============================================================================== --- stable/11/sys/i386/i386/pmap.c Thu Aug 18 12:51:26 2016 (r304428) +++ stable/11/sys/i386/i386/pmap.c Thu Aug 18 14:10:36 2016 (r304429) @@ -794,7 +794,7 @@ pmap_init(void) * include at least one feature that is only supported by older Intel * or newer AMD processors. */ - if (vm_guest == VM_GUEST_VM && (cpu_feature & CPUID_SS) == 0 && + if (vm_guest != VM_GUEST_NO && (cpu_feature & CPUID_SS) == 0 && (cpu_feature2 & (CPUID2_SSSE3 | CPUID2_SSE41 | CPUID2_AESNI | CPUID2_AVX | CPUID2_XSAVE)) == 0 && (amd_feature2 & (AMDID2_XOP | AMDID2_FMA4)) == 0) Modified: stable/11/sys/kern/subr_param.c ============================================================================== --- stable/11/sys/kern/subr_param.c Thu Aug 18 12:51:26 2016 (r304428) +++ stable/11/sys/kern/subr_param.c Thu Aug 18 14:10:36 2016 (r304429) @@ -148,6 +148,7 @@ static const char *const vm_guest_sysctl "xen", "hv", "vmware", + "kvm", NULL }; CTASSERT(nitems(vm_guest_sysctl_names) - 1 == VM_LAST); Modified: stable/11/sys/sys/systm.h ============================================================================== --- stable/11/sys/sys/systm.h Thu Aug 18 12:51:26 2016 (r304428) +++ stable/11/sys/sys/systm.h Thu Aug 18 14:10:36 2016 (r304429) @@ -74,7 +74,7 @@ extern int vm_guest; /* Running as virt * Keep in sync with vm_guest_sysctl_names[]. */ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV, - VM_GUEST_VMWARE, VM_LAST }; + VM_GUEST_VMWARE, VM_GUEST_KVM, VM_LAST }; #if defined(WITNESS) || defined(INVARIANT_SUPPORT) void kassert_panic(const char *fmt, ...) __printflike(1, 2); Modified: stable/11/sys/x86/x86/identcpu.c ============================================================================== --- stable/11/sys/x86/x86/identcpu.c Thu Aug 18 12:51:26 2016 (r304428) +++ stable/11/sys/x86/x86/identcpu.c Thu Aug 18 14:10:36 2016 (r304429) @@ -1300,6 +1300,8 @@ identify_hypervisor(void) vm_guest = VM_GUEST_VMWARE; else if (strcmp(hv_vendor, "Microsoft Hv") == 0) vm_guest = VM_GUEST_HV; + else if (strcmp(hv_vendor, "KVMKVMKVM") == 0) + vm_guest = VM_GUEST_KVM; } return; } Modified: stable/11/sys/x86/x86/local_apic.c ============================================================================== --- stable/11/sys/x86/x86/local_apic.c Thu Aug 18 12:51:26 2016 (r304428) +++ stable/11/sys/x86/x86/local_apic.c Thu Aug 18 14:10:36 2016 (r304429) @@ -499,8 +499,7 @@ native_lapic_init(vm_paddr_t addr) ver = lapic_read32(LAPIC_VERSION); if ((ver & APIC_VER_EOI_SUPPRESSION) != 0) { lapic_eoi_suppression = 1; - if (vm_guest == VM_GUEST_VM && - !strcmp(hv_vendor, "KVMKVMKVM")) { + if (vm_guest == VM_GUEST_KVM) { if (bootverbose) printf( "KVM -- disabling lapic eoi suppression\n"); From owner-svn-src-all@freebsd.org Thu Aug 18 15:02:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 169B0BBDD47; Thu, 18 Aug 2016 15:02:44 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0130117C3; Thu, 18 Aug 2016 15:02:43 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7IF2cNI031156 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 18 Aug 2016 08:02:39 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: <544c64f4-693a-c5bc-1fb2-e696589583b3@freebsd.org> Date: Thu, 18 Aug 2016 08:02:38 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <86fuq24d8s.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVZiw3lp/x93PsK+cJvbsJ38gzyLnyx5VDHwJa7dJAXKcGFy+krTGExz0+ktgYwTSfI5BntWbKSgUfvXHyeN6s/fC1a8sPA+GQo= X-Sonic-ID: C;nHnUzVRl5hG3q6/hcgQksw== M;imYmzlRl5hG3q6/hcgQksw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 15:02:44 -0000 On 08/18/16 02:50, Dag-Erling Smørgrav wrote: > Nathan Whitehorn writes: >> OK. In which configurations? My Dell servers, for instance, don't do >> this. How are they set up? What drivers are being used? Is this >> something that affects passthrough disks, RAIDs, disk images? > Most LSI MegaRAID controllers don't have real passthrough, only JBOD. > You can query the drive with "camcontrol identify passX", but the > controller does not report a stripe size for the volume (mfidY). OK, so it's mfid. That's good to know. > >> The point is that *if the reported stripe size is wrong*, more things >> than partition alignment in the installer will suffer for it. > It's not wrong, it's non-existent, and I'm getting really tired of > repeating myself. For some drivers, this interface is not implemented. This is a bug, which should be fixed. > >> Fixing the installer with a bandaid in the run-up to a release is >> fine, but *we need to fix the underlying problem*. > We can't, because hardware sucks, and I'm getting really tired of > repeating myself. > > DES As am I. Here's the point: We have a mechanism (GEOM stripe size) for drivers to supply a default alignment to userland. If we think we can get that right, great. If we don't think we can get it right, the default system policy in the absence of real information from drivers should be modified to report a number that we think is more likely to be safe than the current defaults (the logical sector size, usually 512 bytes) and potentially tunable by the user. Hacking the userland tools one-by-one to impose their own default policies to override the systemwide one is, while a perfectly valid stopgap right before a release, a ridiculous long-term solution. Do you disagree with any of that? -Nathan From owner-svn-src-all@freebsd.org Thu Aug 18 15:13:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B04CEBBDFBE; Thu, 18 Aug 2016 15:13:36 +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 6A8C41E99; Thu, 18 Aug 2016 15:13:35 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 899096741; Thu, 18 Aug 2016 15:13:34 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 31DCA8F76; Thu, 18 Aug 2016 17:12:08 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <544c64f4-693a-c5bc-1fb2-e696589583b3@freebsd.org> Date: Thu, 18 Aug 2016 17:12:08 +0200 In-Reply-To: <544c64f4-693a-c5bc-1fb2-e696589583b3@freebsd.org> (Nathan Whitehorn's message of "Thu, 18 Aug 2016 08:02:38 -0700") Message-ID: <867fbe3yd3.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 15:13:36 -0000 Nathan Whitehorn writes: > We have a mechanism (GEOM stripe size) for drivers to supply a default > alignment to userland. If we think we can get that right, great. If we > don't think we can get it right, the default system policy in the > absence of real information from drivers should be modified to report > a number that we think is more likely to be safe than the current > defaults (the logical sector size, usually 512 bytes) and potentially > tunable by the user. Hacking the userland tools one-by-one to impose > their own default policies to override the systemwide one is, while a > perfectly valid stopgap right before a release, a ridiculous long-term > solution. Do you disagree with any of that? I'll tell you whether I agree or disagree when you stop putting words in my mouth. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@freebsd.org Thu Aug 18 15:42:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB77ABBE6CD; Thu, 18 Aug 2016 15:42:19 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 954F41CFF; Thu, 18 Aug 2016 15:42:19 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7IFg8mv013316 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 18 Aug 2016 08:42:09 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Allan Jude , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: <97b0baf3-94f6-2572-65c8-4cb614448307@freebsd.org> Date: Thu, 18 Aug 2016 08:42:08 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVaEMksO9UNn/zdRmusFPb5n2JLyxE45Vtn1taEGnBhqA4pG9fJIs/WE1tCPayWSqvngIS7eOaoPxNPBhgIg9YEOqZD8n/OK0zo= X-Sonic-ID: C;RI1rUlpl5hGwT6Dx2xNB0g== M;nh7LUlpl5hGwT6Dx2xNB0g== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 15:42:19 -0000 On 08/18/16 05:56, Allan Jude wrote: > On 08/18/16 05:50 AM, Dag-Erling Smørgrav wrote: >> Nathan Whitehorn writes: >>> OK. In which configurations? My Dell servers, for instance, don't do >>> this. How are they set up? What drivers are being used? Is this >>> something that affects passthrough disks, RAIDs, disk images? >> Most LSI MegaRAID controllers don't have real passthrough, only JBOD. >> You can query the drive with "camcontrol identify passX", but the >> controller does not report a stripe size for the volume (mfidY). >> >>> The point is that *if the reported stripe size is wrong*, more things >>> than partition alignment in the installer will suffer for it. >> It's not wrong, it's non-existent, and I'm getting really tired of >> repeating myself. >> >>> Fixing the installer with a bandaid in the run-up to a release is >>> fine, but *we need to fix the underlying problem*. >> We can't, because hardware sucks, and I'm getting really tired of >> repeating myself. >> >> DES >> > Which makes more sense: > > A) If stripesize == 0, use some sane value like 4096 > > B) Some other combination that uses the reported stripe size, unless it > is 0, in which case it uses 4096 (or some other value controlled by a > different new sysctl) > > C) create kern.geom.min_stripe_size with a default of 512, but users can > set 4096 if they use only 4k devices. (doesn't really solve the problem > for the installer) I think "B" does what we want here best, but any of these approaches would work well. -Nathan From owner-svn-src-all@freebsd.org Thu Aug 18 16:22:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 503DBBBE154; Thu, 18 Aug 2016 16:22:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23460130D; Thu, 18 Aug 2016 16:22:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IGMena055856; Thu, 18 Aug 2016 16:22:40 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IGMeoq055855; Thu, 18 Aug 2016 16:22:40 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201608181622.u7IGMeoq055855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 18 Aug 2016 16:22:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304430 - head/sys/dev/vt 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 16:22:41 -0000 Author: emaste Date: Thu Aug 18 16:22:40 2016 New Revision: 304430 URL: https://svnweb.freebsd.org/changeset/base/304430 Log: vt: fix old keyboard release in CONS_SETKBD On the first switch we previously released the newly allocated keyboard instead of the old one. Keyboard state was very confused afterwards for further keyboard switches. Submitted by: bde Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Thu Aug 18 14:10:36 2016 (r304429) +++ head/sys/dev/vt/vt_core.c Thu Aug 18 16:22:40 2016 (r304430) @@ -2359,6 +2359,7 @@ skip_thunk: (void *)vd, vt_kbdevent, vd); if (i >= 0) { if (vd->vd_keyboard != -1) { + kbd = kbd_get_keyboard(vd->vd_keyboard); vt_save_kbd_state(vd->vd_curwindow, kbd); kbd_release(kbd, (void *)vd); } From owner-svn-src-all@freebsd.org Thu Aug 18 16:44:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9414BBBE6C9; Thu, 18 Aug 2016 16:44:45 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 22B901D48; Thu, 18 Aug 2016 16:44:43 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) 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 1E43A25D38A5; Thu, 18 Aug 2016 16:44:35 +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 3C164D1F8E3; Thu, 18 Aug 2016 16:44:34 +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 ArOOsJTTbGLe; Thu, 18 Aug 2016 16:44:31 +0000 (UTC) Received: from [10.248.105.13] (fresh-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4920:2ef0:eeff:fe03:ee34]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 0D219D1F890; Thu, 18 Aug 2016 16:44:30 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Pyun YongHyeon" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304326 - head/sys/dev/usb/net Date: Thu, 18 Aug 2016 16:44:29 +0000 Message-ID: In-Reply-To: <201608180507.u7I572ZI096519@repo.freebsd.org> References: <201608180507.u7I572ZI096519@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Mailer: MailMate (2.0BETAr6051) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 16:44:45 -0000 On 18 Aug 2016, at 5:07, Pyun YongHyeon wrote: > Author: yongari > Date: Thu Aug 18 05:07:02 2016 > New Revision: 304326 > URL: https://svnweb.freebsd.org/changeset/base/304326 > > Log: > Switch to TX header format rather than directly manipulating header > structures. This simplifies mbuf copy operation to USB buffers as > well as improving readability. The controller supports Microsoft > LSOv1(aka TSO) but this change set does not include the support due > to copying overhead to USB buffers and large amount of memory waste. > > Remove useless ZLP padding which seems to come from Linux. Required > bits the code tried to set was not copied into USB buffer so it had > no effect. Unlike Linux, FreeBSD USB stack automatically generates > ZLP so no explicit padding is required in driver.[1] > > Micro-optimize updating IFCOUNTER_OPACKETS counter by moving it out > of TX loop since updating counter is not cheap operation as it did > long time ago and we already know how many number of packets were > queued after exiting the loop. > > While here, fix a checksum offloading bug which will happen when > upper stack computes checksum while H/W checksum offloading is > active. The controller should be notified to not recompute the > checksum in this case. > > Reviewed by: kevlo (initial version), hselasky > Pointed out by: hselasky [1] > > Modified: > head/sys/dev/usb/net/if_axge.c > head/sys/dev/usb/net/if_axgereg.h > > Modified: head/sys/dev/usb/net/if_axge.c > ============================================================================== > --- head/sys/dev/usb/net/if_axge.c Thu Aug 18 04:25:17 2016 (r304325) > +++ head/sys/dev/usb/net/if_axge.c Thu Aug 18 05:07:02 2016 (r304326) > @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -144,8 +145,8 @@ static const struct usb_config axge_conf > .type = UE_BULK, > .endpoint = UE_ADDR_ANY, > .direction = UE_DIR_OUT, > - .frames = 16, > - .bufsize = 16 * MCLBYTES, > + .frames = AXGE_N_FRAMES, > + .bufsize = AXGE_N_FRAMES * MCLBYTES, > .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, > .callback = axge_bulk_write_callback, > .timeout = 10000, /* 10 seconds */ > @@ -630,7 +631,7 @@ axge_bulk_write_callback(struct usb_xfer > struct ifnet *ifp; > struct usb_page_cache *pc; > struct mbuf *m; > - uint32_t txhdr; > + struct axge_frame_txhdr txhdr; > int nframes, pos; > > sc = usbd_xfer_softc(xfer); > @@ -651,36 +652,25 @@ tr_setup: > return; > } > > - for (nframes = 0; nframes < 16 && > + for (nframes = 0; nframes < AXGE_N_FRAMES && > !IFQ_DRV_IS_EMPTY(&ifp->if_snd); nframes++) { > IFQ_DRV_DEQUEUE(&ifp->if_snd, m); > if (m == NULL) > break; > usbd_xfer_set_frame_offset(xfer, nframes * MCLBYTES, > - nframes); > - pos = 0; > + nframes); > pc = usbd_xfer_get_frame(xfer, nframes); > - txhdr = htole32(m->m_pkthdr.len); > - usbd_copy_in(pc, 0, &txhdr, sizeof(txhdr)); > - txhdr = 0; > - txhdr = htole32(txhdr); > - usbd_copy_in(pc, 4, &txhdr, sizeof(txhdr)); > - pos += 8; > + txhdr.mss = 0; > + txhdr.len = htole32(AXGE_TXBYTES(m->m_pkthdr.len)); > + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0 && > + (m->m_pkthdr.csum_flags & AXGE_CSUM_FEATURES) == 0) > + txhdr.len |= htole32(AXGE_CSUM_DISABLE); > + > + pos = 0; > + usbd_copy_in(pc, pos, &txhdr, sizeof(txhdr)); > + pos += sizeof(txhdr); > usbd_m_copy_in(pc, pos, m, 0, m->m_pkthdr.len); > pos += m->m_pkthdr.len; > - if ((pos % usbd_xfer_max_framelen(xfer)) == 0) > - txhdr |= 0x80008000; > - > - /* > - * XXX > - * Update TX packet counter here. This is not > - * correct way but it seems that there is no way > - * to know how many packets are sent at the end > - * of transfer because controller combines > - * multiple writes into single one if there is > - * room in TX buffer of controller. > - */ > - if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1); > > /* > * if there's a BPF listener, bounce a copy > @@ -694,6 +684,16 @@ tr_setup: > usbd_xfer_set_frame_len(xfer, nframes, pos); > } > if (nframes != 0) { > + /* > + * XXX > + * Update TX packet counter here. This is not > + * correct way but it seems that there is no way > + * to know how many packets are sent at the end > + * of transfer because controller combines > + * multiple writes into single one if there is > + * room in TX buffer of controller. > + */ > + if_inc_counter(ifp, IFCOUNTER_OPACKETS, nframes); > usbd_xfer_set_frames(xfer, nframes); > usbd_transfer_submit(xfer); > ifp->if_drv_flags |= IFF_DRV_OACTIVE; > > Modified: head/sys/dev/usb/net/if_axgereg.h > ============================================================================== > --- head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 04:25:17 > 2016 (r304325) > +++ head/sys/dev/usb/net/if_axgereg.h Thu Aug 18 05:07:02 > 2016 (r304326) > @@ -159,6 +159,26 @@ enum { > AXGE_N_TRANSFER, > }; > > +#define AXGE_N_FRAMES 16 > + > +struct axge_frame_txhdr { > +#if BYTE_ORDER == LITTLE_ENDIAN > + uint32_t len; > +#define AXGE_TXLEN_MASK 0x0001FFFF > +#define AXGE_VLAN_INSERT 0x20000000 > +#define AXGE_CSUM_DISABLE 0x80000000 > + uint32_t mss; > +#define AXGE_MSS_MASK 0x00003FFF > +#define AXGE_PADDING 0x80008000 > +#define AXGE_VLAN_TAG_MASK 0xFFFF0000 > +#else > + uint32_t mss; > + uint32_t len; > +#endif > +} __packed; > + > +#define AXGE_TXBYTES(x) ((x) & AXGE_TXLEN_MASK) AXGE_TXLEN_MASK is only defined for LITTLE_ENDIAN and thus breaks builds on others. AXGE_CSUM_DISABLE as well .. > + > #define AXGE_PHY_ADDR 3 > > struct axge_softc { > From owner-svn-src-all@freebsd.org Thu Aug 18 17:28:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18C2DBBE53D; Thu, 18 Aug 2016 17:28:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C552619B4; Thu, 18 Aug 2016 17:27:59 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IHRxQO078722; Thu, 18 Aug 2016 17:27:59 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IHRxZf078721; Thu, 18 Aug 2016 17:27:59 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608181727.u7IHRxZf078721@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 18 Aug 2016 17:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304431 - head/cddl/contrib/opensolaris/cmd/dtrace 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 17:28:00 -0000 Author: markj Date: Thu Aug 18 17:27:58 2016 New Revision: 304431 URL: https://svnweb.freebsd.org/changeset/base/304431 Log: Add a SIGINFO handler for dtrace(1). Have it print the contents of aggregations, if any. Otherwise, one needs to kill the running script to view the collected data, or add code to periodically print it. Discussed with: gnn MFC after: 1 month Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Modified: head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Thu Aug 18 16:22:40 2016 (r304430) +++ head/cddl/contrib/opensolaris/cmd/dtrace/dtrace.c Thu Aug 18 17:27:58 2016 (r304431) @@ -93,6 +93,9 @@ static int g_flowindent; static int g_intr; static int g_impatient; static int g_newline; +#ifdef __FreeBSD__ +static int g_siginfo; +#endif static int g_total; static int g_cflags; static int g_oflags; @@ -1260,6 +1263,16 @@ intr(int signo) g_impatient = 1; } +#ifdef __FreeBSD__ +static void +siginfo(int signo __unused) +{ + + g_siginfo++; + g_newline = 1; +} +#endif + static void installsighands(void) { @@ -1275,12 +1288,16 @@ installsighands(void) if (sigaction(SIGTERM, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) (void) sigaction(SIGTERM, &act, NULL); -#ifndef illumos +#ifdef __FreeBSD__ if (sigaction(SIGPIPE, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) (void) sigaction(SIGPIPE, &act, NULL); if (sigaction(SIGUSR1, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) (void) sigaction(SIGUSR1, &act, NULL); + + act.sa_handler = siginfo; + if (sigaction(SIGINFO, NULL, &oact) == 0 && oact.sa_handler != SIG_IGN) + (void) sigaction(SIGINFO, &act, NULL); #endif } @@ -1944,6 +1961,13 @@ main(int argc, char *argv[]) if (!g_intr && !done) dtrace_sleep(g_dtp); +#ifdef __FreeBSD__ + if (g_siginfo) { + (void)dtrace_aggregate_print(g_dtp, g_ofp, NULL); + g_siginfo = 0; + } +#endif + if (g_newline) { /* * Output a newline just to make the output look From owner-svn-src-all@freebsd.org Thu Aug 18 18:35:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D59BBBE321; Thu, 18 Aug 2016 18:35:25 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A5D21A3D; Thu, 18 Aug 2016 18:35:24 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7IIZISQ008154 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 18 Aug 2016 11:35:19 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <544c64f4-693a-c5bc-1fb2-e696589583b3@freebsd.org> <867fbe3yd3.fsf@desk.des.no> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Nathan Whitehorn Message-ID: <4d097835-66ce-72b6-c774-a87e38d88625@freebsd.org> Date: Thu, 18 Aug 2016 11:35:18 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <867fbe3yd3.fsf@desk.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVY+PfC1Zk3fvRZt5VHY2S2InuksnGWzfztin2dMLgz9BcMgUM/UW6wRlOr8+w2xCoN8RuxLFXUncP+NebpMRweg0QILodJ8QZk= X-Sonic-ID: C;mOmZg3Jl5hGzSaDx2xNB0g== M;ND3mg3Jl5hGzSaDx2xNB0g== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 18:35:25 -0000 On 08/18/16 08:12, Dag-Erling Smørgrav wrote: > Nathan Whitehorn writes: >> We have a mechanism (GEOM stripe size) for drivers to supply a default >> alignment to userland. If we think we can get that right, great. If we >> don't think we can get it right, the default system policy in the >> absence of real information from drivers should be modified to report >> a number that we think is more likely to be safe than the current >> defaults (the logical sector size, usually 512 bytes) and potentially >> tunable by the user. Hacking the userland tools one-by-one to impose >> their own default policies to override the systemwide one is, while a >> perfectly valid stopgap right before a release, a ridiculous long-term >> solution. Do you disagree with any of that? > I'll tell you whether I agree or disagree when you stop putting words in > my mouth. > > DES This is ridiculous. I've asked a series of technical questions about generalizing a patch you made and that I think is a good idea. In response, those questions have been met with a non-stop torrent of insults and abuse instead of answers, with only one eventual nugget of information in response to one of them -- that you ran into problems with mfid -- to redeem it. I'm done with this discussion. Hopefully we can have a real conversation about this at this some point after the release. -Nathan From owner-svn-src-all@freebsd.org Thu Aug 18 19:18:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 873DFBBEB89; Thu, 18 Aug 2016 19:18:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A3BA1014; Thu, 18 Aug 2016 19:18:41 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IJIe56019687; Thu, 18 Aug 2016 19:18:40 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IJIeUV019686; Thu, 18 Aug 2016 19:18:40 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608181918.u7IJIeUV019686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 18 Aug 2016 19:18:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304432 - releng/11.0/sys/netinet X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 19:18:41 -0000 Author: tuexen Date: Thu Aug 18 19:18:40 2016 New Revision: 304432 URL: https://svnweb.freebsd.org/changeset/base/304432 Log: MFC r304428: Ensure that sctp_it_ctl.cur_it does not point to a free object (during a small time window). Thanks to Byron Campen for reporting the issue and suggesting a fix. Approved by: re (kib) Modified: releng/11.0/sys/netinet/sctputil.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/sys/netinet/sctputil.c ============================================================================== --- releng/11.0/sys/netinet/sctputil.c Thu Aug 18 17:27:58 2016 (r304431) +++ releng/11.0/sys/netinet/sctputil.c Thu Aug 18 19:18:40 2016 (r304432) @@ -1280,6 +1280,7 @@ sctp_iterator_work(struct sctp_iterator SCTP_INP_INFO_RLOCK(); SCTP_ITERATOR_LOCK(); + sctp_it_ctl.cur_it = it; if (it->inp) { SCTP_INP_RLOCK(it->inp); SCTP_INP_DECR_REF(it->inp); @@ -1287,6 +1288,7 @@ sctp_iterator_work(struct sctp_iterator if (it->inp == NULL) { /* iterator is complete */ done_with_iterator: + sctp_it_ctl.cur_it = NULL; SCTP_ITERATOR_UNLOCK(); SCTP_INP_INFO_RUNLOCK(); if (it->function_atend != NULL) { @@ -1427,13 +1429,11 @@ sctp_iterator_worker(void) sctp_it_ctl.iterator_running = 1; TAILQ_FOREACH_SAFE(it, &sctp_it_ctl.iteratorhead, sctp_nxt_itr, nit) { - sctp_it_ctl.cur_it = it; /* now lets work on this one */ TAILQ_REMOVE(&sctp_it_ctl.iteratorhead, it, sctp_nxt_itr); SCTP_IPI_ITERATOR_WQ_UNLOCK(); CURVNET_SET(it->vn); sctp_iterator_work(it); - sctp_it_ctl.cur_it = NULL; CURVNET_RESTORE(); SCTP_IPI_ITERATOR_WQ_LOCK(); /* sa_ignore FREED_MEMORY */ From owner-svn-src-all@freebsd.org Thu Aug 18 21:39:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA62ABBFB40; Thu, 18 Aug 2016 21:39:45 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 94FD61531; Thu, 18 Aug 2016 21:39:45 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 8F008358C5F; Thu, 18 Aug 2016 23:39:42 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 48E8228494; Thu, 18 Aug 2016 23:39:42 +0200 (CEST) Date: Thu, 18 Aug 2016 23:39:42 +0200 From: Jilles Tjoelker To: Konstantin Belousov Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304176 - in head: include lib/libc/sys sys/compat/freebsd32 sys/kern Message-ID: <20160818213941.GA1539@stack.nl> References: <201608151908.u7FJ8phh091939@repo.freebsd.org> <20160817202040.GA21263@stack.nl> <20160818075316.GW83214@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160818075316.GW83214@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 21:39:45 -0000 On Thu, Aug 18, 2016 at 10:53:16AM +0300, Konstantin Belousov wrote: > On Wed, Aug 17, 2016 at 10:20:40PM +0200, Jilles Tjoelker wrote: > > On Mon, Aug 15, 2016 at 07:08:51PM +0000, Konstantin Belousov wrote: > > > /* ISO/IEC 9945-1: 1996 */ > > > #if __POSIX_VISIBLE >= 199506 || __XSI_VISIBLE > > > int fsync(int); > > > +int fdatasync(int); > > > > > > /* > > > * ftruncate() was in the POSIX Realtime Extension (it's used for shared > > Apparently these functions were added closely enough in time that they > > can stay together here :) > Is this a form of suggestion to use other value for POSIX_VISIBLE ? No, no change is necessary. > > > +#if 0 > > > + if (!fullsync) > > > + /* XXXKIB: compete outstanding aio writes */; > > Under the _POSIX_SYNCHRONIZED_IO option, completing outstanding I/O > > requests is in fact required for fsync() as well. The fdatasync() > > function is completely under the _POSIX_SYNCHRONIZED_IO option. > > We do not implement this option, but keeping fdatasync()'s guarantees a > > subset of fsync()'s guarantees seems sensible. > I will consider this if and when the AIO flush would be implemented. > I looked at the AIO code to estimate the needed work, but did not started > coding and quite possible it would be postponed. OK. > > > +%% fdatasync vp L L L > > > + > > > +vop_fdatasync { > > > + IN struct vnode *vp; > > > + IN struct thread *td; > > > +}; > > A waitfor parameter like in vop_fsync may be useful to implement > > aio_fsync(O_DSYNC) later on. > I really do not see how would it be. aio_fsync(O_DSYNC) is equivalent > to fdatasync(2) in the async context. Completion of the aio request > indicates that virtual fdatasync(2) execution did finished in that > context. The use of waitfor in the VOP_FSYNC() is to allow syncer > to initiate flush without waiting, or getting notification for the > completion. > Could you, please, elaborate ? If the KPI change is needed there, it > is obviously desirable to make it right before MFC to stable. Oh, you're right. No change is needed. A MNT_NOWAIT fsync operation does not provide any feedback when it is complete, so it is not useful for AIO. In fact, aio_fsync() eventually calls VOP_FSYNC with MNT_WAIT on a worker thread. -- Jilles Tjoelker From owner-svn-src-all@freebsd.org Thu Aug 18 21:47:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 954C6BBFE26; Thu, 18 Aug 2016 21:47:01 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 572781C7D; Thu, 18 Aug 2016 21:47:01 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7ILl083075369; Thu, 18 Aug 2016 21:47:00 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7ILl0H8075368; Thu, 18 Aug 2016 21:47:00 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201608182147.u7ILl0H8075368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 18 Aug 2016 21:47:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304433 - stable/11/sys/dev/pci X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 21:47:01 -0000 Author: vangyzen Date: Thu Aug 18 21:47:00 2016 New Revision: 304433 URL: https://svnweb.freebsd.org/changeset/base/304433 Log: MFC r304246 PCIe HotPlug: Detect bridges that are not really HotPlug capable Some devices report that they have an MRL when they actually do not. Since they always report that the MRL is open, child devices would be ignored. Try to detect these devices and ignore their claim of HotPlug support. Specifically, if there is an open MRL but the Data Link Layer is active, the MRL is not real. Revert r303645 to re-enable HotPlug support for slots with power controllers, since it works correctly in my testing. Start the DLL state-change timer if Presence /or/ MRL state changes, along with other conditions. Previously, we started the timer iff Presence changed. If there is an MRL, it must be closed for power to be turned on, so Presence is unlikely to change on an MRL-close event. Add a printf() of interesting registers on HotPlug interrupts and commands (one from erj@). These were very useful for debugging. Guard them with bootverbose, since they're spam in normal operation. In collaboration with: jhb Relnotes: yes (re-enable HotPlug support for slots with power controllers) Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D7509 Modified: stable/11/sys/dev/pci/pci_pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/pci/pci_pci.c ============================================================================== --- stable/11/sys/dev/pci/pci_pci.c Thu Aug 18 19:18:40 2016 (r304432) +++ stable/11/sys/dev/pci/pci_pci.c Thu Aug 18 21:47:00 2016 (r304433) @@ -918,6 +918,7 @@ static void pcib_probe_hotplug(struct pcib_softc *sc) { device_t dev; + uint16_t link_sta, slot_sta; if (!pci_enable_pcie_hp) return; @@ -932,15 +933,29 @@ pcib_probe_hotplug(struct pcib_softc *sc sc->pcie_link_cap = pcie_read_config(dev, PCIER_LINK_CAP, 4); sc->pcie_slot_cap = pcie_read_config(dev, PCIER_SLOT_CAP, 4); + if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC) == 0) + return; + /* - * XXX: Handling of slots with a power controller needs to be - * reexamined. Ignore hotplug on such slots for now. + * Some devices report that they have an MRL when they actually + * do not. Since they always report that the MRL is open, child + * devices would be ignored. Try to detect these devices and + * ignore their claim of HotPlug support. + * + * If there is an open MRL but the Data Link Layer is active, + * the MRL is not real. */ - if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_PCP) - return; - - if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC) - sc->flags |= PCIB_HOTPLUG; + if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_MRLSP) != 0 && + (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) != 0) { + link_sta = pcie_read_config(dev, PCIER_LINK_STA, 2); + slot_sta = pcie_read_config(dev, PCIER_SLOT_STA, 2); + if ((slot_sta & PCIEM_SLOT_STA_MRLSS) != 0 && + (link_sta & PCIEM_LINK_STA_DL_ACTIVE) != 0) { + return; + } + } + + sc->flags |= PCIB_HOTPLUG; } /* @@ -966,6 +981,8 @@ pcib_pcie_hotplug_command(struct pcib_so new = (ctl & ~mask) | val; if (new == ctl) return; + if (bootverbose) + device_printf(dev, "HotPlug command: %04x -> %04x\n", ctl, new); pcie_write_config(dev, PCIER_SLOT_CTL, new, 2); if (!(sc->pcie_slot_cap & PCIEM_SLOT_CAP_NCCS) && (ctl & new) & PCIEM_SLOT_CTL_CCIE) { @@ -1028,9 +1045,6 @@ pcib_hotplug_inserted(struct pcib_softc static int pcib_hotplug_present(struct pcib_softc *sc) { - device_t dev; - - dev = sc->dev; /* Card must be inserted. */ if (!pcib_hotplug_inserted(sc)) @@ -1059,7 +1073,7 @@ pcib_pcie_hotplug_update(struct pcib_sof { bool card_inserted, ei_engaged; - /* Clear DETACHING if Present Detect has cleared. */ + /* Clear DETACHING if Presence Detect has cleared. */ if ((sc->pcie_slot_sta & (PCIEM_SLOT_STA_PDC | PCIEM_SLOT_STA_PDS)) == PCIEM_SLOT_STA_PDC) sc->flags &= ~PCIB_DETACHING; @@ -1101,14 +1115,15 @@ pcib_pcie_hotplug_update(struct pcib_sof /* * Start a timer to see if the Data Link Layer times out. - * Note that we only start the timer if Presence Detect + * Note that we only start the timer if Presence Detect or MRL Sensor * changed on this interrupt. Stop any scheduled timer if * the Data Link Layer is active. */ if (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) { if (card_inserted && !(sc->pcie_link_sta & PCIEM_LINK_STA_DL_ACTIVE) && - sc->pcie_slot_sta & PCIEM_SLOT_STA_PDC) { + sc->pcie_slot_sta & + (PCIEM_SLOT_STA_MRLSC | PCIEM_SLOT_STA_PDC)) { if (cold) device_printf(sc->dev, "Data Link Layer inactive\n"); @@ -1144,6 +1159,10 @@ pcib_pcie_intr(void *arg) /* Clear the events just reported. */ pcie_write_config(dev, PCIER_SLOT_STA, sc->pcie_slot_sta, 2); + if (bootverbose) + device_printf(dev, "HotPlug interrupt: %#x\n", + sc->pcie_slot_sta); + if (sc->pcie_slot_sta & PCIEM_SLOT_STA_ABP) { if (sc->flags & PCIB_DETACH_PENDING) { device_printf(dev, @@ -1165,7 +1184,7 @@ pcib_pcie_intr(void *arg) sc->pcie_slot_sta & PCIEM_SLOT_STA_MRLSS ? "open" : "closed"); if (bootverbose && sc->pcie_slot_sta & PCIEM_SLOT_STA_PDC) - device_printf(dev, "Present Detect Changed to %s\n", + device_printf(dev, "Presence Detect Changed to %s\n", sc->pcie_slot_sta & PCIEM_SLOT_STA_PDS ? "card present" : "empty"); if (sc->pcie_slot_sta & PCIEM_SLOT_STA_CC) @@ -1234,7 +1253,7 @@ pcib_pcie_cc_timeout(void *arg) sta = pcie_read_config(dev, PCIER_SLOT_STA, 2); if (!(sta & PCIEM_SLOT_STA_CC)) { device_printf(dev, - "Hotplug Command Timed Out - forcing detach\n"); + "HotPlug Command Timed Out - forcing detach\n"); sc->flags &= ~(PCIB_HOTPLUG_CMD_PENDING | PCIB_DETACH_PENDING); sc->flags |= PCIB_DETACHING; pcib_pcie_hotplug_update(sc, 0, 0, true); From owner-svn-src-all@freebsd.org Thu Aug 18 22:01:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 976FFBBE2D6; Thu, 18 Aug 2016 22:01:53 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54EB31571; Thu, 18 Aug 2016 22:01:53 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IM1qxv082061; Thu, 18 Aug 2016 22:01:52 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IM1qhx082060; Thu, 18 Aug 2016 22:01:52 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201608182201.u7IM1qhx082060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Thu, 18 Aug 2016 22:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304434 - releng/11.0/sys/dev/pci X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 22:01:53 -0000 Author: vangyzen Date: Thu Aug 18 22:01:52 2016 New Revision: 304434 URL: https://svnweb.freebsd.org/changeset/base/304434 Log: MFC r304433 PCIe HotPlug: Detect bridges that are not really HotPlug capable Some devices report that they have an MRL when they actually do not. Since they always report that the MRL is open, child devices would be ignored. Try to detect these devices and ignore their claim of HotPlug support. Specifically, if there is an open MRL but the Data Link Layer is active, the MRL is not real. Revert r303645 to re-enable HotPlug support for slots with power controllers, since it works correctly in my testing. Start the DLL state-change timer if Presence /or/ MRL state changes, along with other conditions. Previously, we started the timer iff Presence changed. If there is an MRL, it must be closed for power to be turned on, so Presence is unlikely to change on an MRL-close event. Add a printf() of interesting registers on HotPlug interrupts and commands (one from erj@). These were very useful for debugging. Guard them with bootverbose, since they're spam in normal operation. In collaboration with: jhb Relnotes: yes (re-enable HotPlug support for slots with power controllers) Approved by: re (gjb) Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D7509 Modified: releng/11.0/sys/dev/pci/pci_pci.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/sys/dev/pci/pci_pci.c ============================================================================== --- releng/11.0/sys/dev/pci/pci_pci.c Thu Aug 18 21:47:00 2016 (r304433) +++ releng/11.0/sys/dev/pci/pci_pci.c Thu Aug 18 22:01:52 2016 (r304434) @@ -918,6 +918,7 @@ static void pcib_probe_hotplug(struct pcib_softc *sc) { device_t dev; + uint16_t link_sta, slot_sta; if (!pci_enable_pcie_hp) return; @@ -932,15 +933,29 @@ pcib_probe_hotplug(struct pcib_softc *sc sc->pcie_link_cap = pcie_read_config(dev, PCIER_LINK_CAP, 4); sc->pcie_slot_cap = pcie_read_config(dev, PCIER_SLOT_CAP, 4); + if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC) == 0) + return; + /* - * XXX: Handling of slots with a power controller needs to be - * reexamined. Ignore hotplug on such slots for now. + * Some devices report that they have an MRL when they actually + * do not. Since they always report that the MRL is open, child + * devices would be ignored. Try to detect these devices and + * ignore their claim of HotPlug support. + * + * If there is an open MRL but the Data Link Layer is active, + * the MRL is not real. */ - if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_PCP) - return; - - if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC) - sc->flags |= PCIB_HOTPLUG; + if ((sc->pcie_slot_cap & PCIEM_SLOT_CAP_MRLSP) != 0 && + (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) != 0) { + link_sta = pcie_read_config(dev, PCIER_LINK_STA, 2); + slot_sta = pcie_read_config(dev, PCIER_SLOT_STA, 2); + if ((slot_sta & PCIEM_SLOT_STA_MRLSS) != 0 && + (link_sta & PCIEM_LINK_STA_DL_ACTIVE) != 0) { + return; + } + } + + sc->flags |= PCIB_HOTPLUG; } /* @@ -966,6 +981,8 @@ pcib_pcie_hotplug_command(struct pcib_so new = (ctl & ~mask) | val; if (new == ctl) return; + if (bootverbose) + device_printf(dev, "HotPlug command: %04x -> %04x\n", ctl, new); pcie_write_config(dev, PCIER_SLOT_CTL, new, 2); if (!(sc->pcie_slot_cap & PCIEM_SLOT_CAP_NCCS) && (ctl & new) & PCIEM_SLOT_CTL_CCIE) { @@ -1028,9 +1045,6 @@ pcib_hotplug_inserted(struct pcib_softc static int pcib_hotplug_present(struct pcib_softc *sc) { - device_t dev; - - dev = sc->dev; /* Card must be inserted. */ if (!pcib_hotplug_inserted(sc)) @@ -1059,7 +1073,7 @@ pcib_pcie_hotplug_update(struct pcib_sof { bool card_inserted, ei_engaged; - /* Clear DETACHING if Present Detect has cleared. */ + /* Clear DETACHING if Presence Detect has cleared. */ if ((sc->pcie_slot_sta & (PCIEM_SLOT_STA_PDC | PCIEM_SLOT_STA_PDS)) == PCIEM_SLOT_STA_PDC) sc->flags &= ~PCIB_DETACHING; @@ -1101,14 +1115,15 @@ pcib_pcie_hotplug_update(struct pcib_sof /* * Start a timer to see if the Data Link Layer times out. - * Note that we only start the timer if Presence Detect + * Note that we only start the timer if Presence Detect or MRL Sensor * changed on this interrupt. Stop any scheduled timer if * the Data Link Layer is active. */ if (sc->pcie_link_cap & PCIEM_LINK_CAP_DL_ACTIVE) { if (card_inserted && !(sc->pcie_link_sta & PCIEM_LINK_STA_DL_ACTIVE) && - sc->pcie_slot_sta & PCIEM_SLOT_STA_PDC) { + sc->pcie_slot_sta & + (PCIEM_SLOT_STA_MRLSC | PCIEM_SLOT_STA_PDC)) { if (cold) device_printf(sc->dev, "Data Link Layer inactive\n"); @@ -1144,6 +1159,10 @@ pcib_pcie_intr(void *arg) /* Clear the events just reported. */ pcie_write_config(dev, PCIER_SLOT_STA, sc->pcie_slot_sta, 2); + if (bootverbose) + device_printf(dev, "HotPlug interrupt: %#x\n", + sc->pcie_slot_sta); + if (sc->pcie_slot_sta & PCIEM_SLOT_STA_ABP) { if (sc->flags & PCIB_DETACH_PENDING) { device_printf(dev, @@ -1165,7 +1184,7 @@ pcib_pcie_intr(void *arg) sc->pcie_slot_sta & PCIEM_SLOT_STA_MRLSS ? "open" : "closed"); if (bootverbose && sc->pcie_slot_sta & PCIEM_SLOT_STA_PDC) - device_printf(dev, "Present Detect Changed to %s\n", + device_printf(dev, "Presence Detect Changed to %s\n", sc->pcie_slot_sta & PCIEM_SLOT_STA_PDS ? "card present" : "empty"); if (sc->pcie_slot_sta & PCIEM_SLOT_STA_CC) @@ -1234,7 +1253,7 @@ pcib_pcie_cc_timeout(void *arg) sta = pcie_read_config(dev, PCIER_SLOT_STA, 2); if (!(sta & PCIEM_SLOT_STA_CC)) { device_printf(dev, - "Hotplug Command Timed Out - forcing detach\n"); + "HotPlug Command Timed Out - forcing detach\n"); sc->flags &= ~(PCIB_HOTPLUG_CMD_PENDING | PCIB_DETACH_PENDING); sc->flags |= PCIB_DETACHING; pcib_pcie_hotplug_update(sc, 0, 0, true); From owner-svn-src-all@freebsd.org Thu Aug 18 22:59:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2BF0BBEF94; Thu, 18 Aug 2016 22:59:01 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DCCD1249; Thu, 18 Aug 2016 22:59:01 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IMx0Ir001970; Thu, 18 Aug 2016 22:59:00 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IMx0bx001967; Thu, 18 Aug 2016 22:59:00 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201608182259.u7IMx0bx001967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 18 Aug 2016 22:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304435 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 22:59:01 -0000 Author: rstone Date: Thu Aug 18 22:59:00 2016 New Revision: 304435 URL: https://svnweb.freebsd.org/changeset/base/304435 Log: Don't iterate over the ifnet addr list in ip_output() For almost every packet that is transmitted through ip_output(), a call to in_broadcast() was made to decide if the destination IP was a broadcast address. in_broadcast() iterates over the ifnet's address to find a source IP matching the subnet of the destination IP, and then checks if the IP is a broadcast in that subnet. This is completely redundant as we have already performed the route lookup, so the source IP is already known. Just use that address to directly check whether the destination IP is a broadcast address or not. MFC after: 2 months Sponsored By: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7266 Modified: head/sys/netinet/in.c head/sys/netinet/in.h head/sys/netinet/ip_output.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Thu Aug 18 22:01:52 2016 (r304434) +++ head/sys/netinet/in.c Thu Aug 18 22:59:00 2016 (r304435) @@ -928,6 +928,25 @@ in_ifscrub_all(void) IFNET_RUNLOCK(); } +int +in_ifaddr_broadcast(struct in_addr in, struct in_ifaddr *ia) +{ + + return ((in.s_addr == ia->ia_broadaddr.sin_addr.s_addr || + /* + * Check for old-style (host 0) broadcast, but + * taking into account that RFC 3021 obsoletes it. + */ + (ia->ia_subnetmask != IN_RFC3021_MASK && + ntohl(in.s_addr) == ia->ia_subnet)) && + /* + * Check for an all one subnetmask. These + * only exist when an interface gets a secondary + * address. + */ + ia->ia_subnetmask != (u_long)0xffffffff); +} + /* * Return 1 if the address might be a local broadcast address. */ @@ -935,37 +954,21 @@ int in_broadcast(struct in_addr in, struct ifnet *ifp) { register struct ifaddr *ifa; - u_long t; if (in.s_addr == INADDR_BROADCAST || in.s_addr == INADDR_ANY) return (1); if ((ifp->if_flags & IFF_BROADCAST) == 0) return (0); - t = ntohl(in.s_addr); /* * Look through the list of addresses for a match * with a broadcast address. */ -#define ia ((struct in_ifaddr *)ifa) TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) if (ifa->ifa_addr->sa_family == AF_INET && - (in.s_addr == ia->ia_broadaddr.sin_addr.s_addr || - /* - * Check for old-style (host 0) broadcast, but - * taking into account that RFC 3021 obsoletes it. - */ - (ia->ia_subnetmask != IN_RFC3021_MASK && - t == ia->ia_subnet)) && - /* - * Check for an all one subnetmask. These - * only exist when an interface gets a secondary - * address. - */ - ia->ia_subnetmask != (u_long)0xffffffff) + in_ifaddr_broadcast(in, (struct in_ifaddr *)ifa)) return (1); return (0); -#undef ia } /* Modified: head/sys/netinet/in.h ============================================================================== --- head/sys/netinet/in.h Thu Aug 18 22:01:52 2016 (r304434) +++ head/sys/netinet/in.h Thu Aug 18 22:59:00 2016 (r304435) @@ -637,8 +637,10 @@ int getsourcefilter(int, uint32_t, struc #ifdef _KERNEL struct ifnet; struct mbuf; /* forward declarations for Standard C */ +struct in_ifaddr; int in_broadcast(struct in_addr, struct ifnet *); +int in_ifaddr_broadcast(struct in_addr, struct in_ifaddr *); int in_canforward(struct in_addr); int in_localaddr(struct in_addr); int in_localip(struct in_addr); Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Thu Aug 18 22:01:52 2016 (r304434) +++ head/sys/netinet/ip_output.c Thu Aug 18 22:59:00 2016 (r304435) @@ -350,7 +350,7 @@ again: have_ia_ref = 1; ifp = ia->ia_ifp; ip->ip_ttl = 1; - isbroadcast = in_broadcast(dst->sin_addr, ifp); + isbroadcast = in_ifaddr_broadcast(dst->sin_addr, ia); } else if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) && imo != NULL && imo->imo_multicast_ifp != NULL) { /* @@ -404,7 +404,7 @@ again: if (rte->rt_flags & RTF_HOST) isbroadcast = (rte->rt_flags & RTF_BROADCAST); else - isbroadcast = in_broadcast(gw->sin_addr, ifp); + isbroadcast = in_ifaddr_broadcast(gw->sin_addr, ia); } /* From owner-svn-src-all@freebsd.org Thu Aug 18 22:59:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FA0DBBEFC8; Thu, 18 Aug 2016 22:59:07 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9CDD12A8; Thu, 18 Aug 2016 22:59:06 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IMx56K002020; Thu, 18 Aug 2016 22:59:05 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IMx5oW002018; Thu, 18 Aug 2016 22:59:05 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201608182259.u7IMx5oW002018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 18 Aug 2016 22:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304436 - in head: . sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 22:59:07 -0000 Author: rstone Date: Thu Aug 18 22:59:05 2016 New Revision: 304436 URL: https://svnweb.freebsd.org/changeset/base/304436 Log: Don't check for broadcast IPs on non-bcast pkts in_broadcast() can be quite expensive, so skip calling it if the incoming mbuf wasn't sent to a broadcast L2 address in the first place. Reviewed by: gnn MFC after: 2 months Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7309 Modified: head/UPDATING head/sys/netinet/udp_usrreq.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Aug 18 22:59:00 2016 (r304435) +++ head/UPDATING Thu Aug 18 22:59:05 2016 (r304436) @@ -32,6 +32,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20160818: + The UDP receive code has been updated to only treat incoming UDP + packets that were addressed to an L2 broadcast address as L3 + broadcast packets. It is not expected that this will affect any + standards-conforming UDP application. The new behaviour can be + disabled by setting the sysctl net.inet.udp.require_l2_bcast to + 0. + +20160818: Remove the openbsd_poll system call. __FreeBSD_version has been bumped because of this. Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Aug 18 22:59:00 2016 (r304435) +++ head/sys/netinet/udp_usrreq.c Thu Aug 18 22:59:05 2016 (r304436) @@ -126,6 +126,11 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, blac &VNET_NAME(udp_blackhole), 0, "Do not send port unreachables for refused connects"); +static VNET_DEFINE(int, udp_require_l2_bcast) = 1; +SYSCTL_INT(_net_inet_udp, OID_AUTO, require_l2_bcast, CTLFLAG_VNET | CTLFLAG_RW, + &VNET_NAME(udp_require_l2_bcast), 0, + "Only treat packets sent to an L2 broadcast address as broadcast packets"); + u_long udp_sendspace = 9216; /* really max datagram size */ SYSCTL_ULONG(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW, &udp_sendspace, 0, "Maximum outgoing UDP datagram size"); @@ -523,7 +528,8 @@ udp_input(struct mbuf **mp, int *offp, i pcbinfo = udp_get_inpcbinfo(proto); if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || - in_broadcast(ip->ip_dst, ifp)) { + ((!VNET_NAME(udp_require_l2_bcast) || m->m_flags & M_BCAST) && + in_broadcast(ip->ip_dst, ifp))) { struct inpcb *last; struct inpcbhead *pcblist; struct ip_moptions *imo; From owner-svn-src-all@freebsd.org Thu Aug 18 22:59:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE5B5BBEFFD; Thu, 18 Aug 2016 22:59:11 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEA4C13DE; Thu, 18 Aug 2016 22:59:11 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7IMxAVZ002068; Thu, 18 Aug 2016 22:59:10 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7IMxAbm002067; Thu, 18 Aug 2016 22:59:10 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201608182259.u7IMxAbm002067@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Thu, 18 Aug 2016 22:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304437 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 18 Aug 2016 22:59:12 -0000 Author: rstone Date: Thu Aug 18 22:59:10 2016 New Revision: 304437 URL: https://svnweb.freebsd.org/changeset/base/304437 Log: Fix unlocked access to ifnet address list in_broadcast() was iterating over the ifnet address list without first taking an IF_ADDR_RLOCK. This could cause a panic if a concurrent operation modified the list. Reviewed by: bz MFC after: 2 months Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D7227 Modified: head/sys/netinet/in.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Thu Aug 18 22:59:05 2016 (r304436) +++ head/sys/netinet/in.c Thu Aug 18 22:59:10 2016 (r304437) @@ -954,21 +954,27 @@ int in_broadcast(struct in_addr in, struct ifnet *ifp) { register struct ifaddr *ifa; + int found; if (in.s_addr == INADDR_BROADCAST || in.s_addr == INADDR_ANY) return (1); if ((ifp->if_flags & IFF_BROADCAST) == 0) return (0); + found = 0; /* * Look through the list of addresses for a match * with a broadcast address. */ + IF_ADDR_RLOCK(ifp); TAILQ_FOREACH(ifa, &ifp->if_addrhead, ifa_link) if (ifa->ifa_addr->sa_family == AF_INET && - in_ifaddr_broadcast(in, (struct in_ifaddr *)ifa)) - return (1); - return (0); + in_ifaddr_broadcast(in, (struct in_ifaddr *)ifa)) { + found = 1; + break; + } + IF_ADDR_RUNLOCK(ifp); + return (found); } /* From owner-svn-src-all@freebsd.org Fri Aug 19 00:03:43 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88E37BBE866; Fri, 19 Aug 2016 00:03:43 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 489A31190; Fri, 19 Aug 2016 00:03:43 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J03gO0027942; Fri, 19 Aug 2016 00:03:42 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J03g80027938; Fri, 19 Aug 2016 00:03:42 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201608190003.u7J03g80027938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 19 Aug 2016 00:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304438 - head/sbin/fsck_ffs 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 00:03:43 -0000 Author: mckusick Date: Fri Aug 19 00:03:41 2016 New Revision: 304438 URL: https://svnweb.freebsd.org/changeset/base/304438 Log: Fsck_ufs was using an int rather than a ufs2_daddr_t to store the alternate superblock location when given in the -b option. When int is 32-bits, block numbers larger than 2^32 would get truncated. This commit changes the storage fpr the alternate superblock location to a ufs2_daddr_t. Submitted by: Dmitry Sivachenko Modified: head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/globs.c head/sbin/fsck_ffs/main.c head/sbin/fsck_ffs/setup.c Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Thu Aug 18 22:59:10 2016 (r304437) +++ head/sbin/fsck_ffs/fsck.h Fri Aug 19 00:03:41 2016 (r304438) @@ -305,7 +305,7 @@ extern u_int real_dev_bsize; /* actual extern char nflag; /* assume a no response */ extern char yflag; /* assume a yes response */ extern int bkgrdflag; /* use a snapshot to run on an active system */ -extern int bflag; /* location of alternate super block */ +extern ufs2_daddr_t bflag; /* location of alternate super block */ extern int debug; /* output debugging info */ extern int Eflag; /* delete empty data blocks */ extern int Zflag; /* zero empty data blocks */ Modified: head/sbin/fsck_ffs/globs.c ============================================================================== --- head/sbin/fsck_ffs/globs.c Thu Aug 18 22:59:10 2016 (r304437) +++ head/sbin/fsck_ffs/globs.c Fri Aug 19 00:03:41 2016 (r304438) @@ -77,7 +77,7 @@ u_int real_dev_bsize; /* actual disk se char nflag; /* assume a no response */ char yflag; /* assume a yes response */ int bkgrdflag; /* use a snapshot to run on an active system */ -int bflag; /* location of alternate super block */ +ufs2_daddr_t bflag; /* location of alternate super block */ int debug; /* output debugging info */ int Eflag; /* delete empty data blocks */ int Zflag; /* zero empty data blocks */ Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Thu Aug 18 22:59:10 2016 (r304437) +++ head/sbin/fsck_ffs/main.c Fri Aug 19 00:03:41 2016 (r304438) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -68,7 +69,7 @@ __FBSDID("$FreeBSD$"); int restarts; static void usage(void) __dead2; -static int argtoi(int flag, const char *req, const char *str, int base); +static intmax_t argtoimax(int flag, const char *req, const char *str, int base); static int checkfilesys(char *filesys); static int chkdoreload(struct statfs *mntp); static struct statfs *getmntpt(const char *); @@ -88,8 +89,8 @@ main(int argc, char *argv[]) switch (ch) { case 'b': skipclean = 0; - bflag = argtoi('b', "number", optarg, 10); - printf("Alternate super block location: %d\n", bflag); + bflag = argtoimax('b', "number", optarg, 10); + printf("Alternate super block location: %jd\n", bflag); break; case 'B': @@ -98,7 +99,8 @@ main(int argc, char *argv[]) case 'c': skipclean = 0; - cvtlevel = argtoi('c', "conversion level", optarg, 10); + cvtlevel = argtoimax('c', "conversion level", optarg, + 10); if (cvtlevel < 3) errx(EEXIT, "cannot do level %d conversion", cvtlevel); @@ -121,7 +123,7 @@ main(int argc, char *argv[]) break; case 'm': - lfmode = argtoi('m', "mode", optarg, 8); + lfmode = argtoimax('m', "mode", optarg, 8); if (lfmode &~ 07777) errx(EEXIT, "bad mode to -m: %o", lfmode); printf("** lost+found creation mode %o\n", lfmode); @@ -203,13 +205,13 @@ main(int argc, char *argv[]) exit(ret); } -static int -argtoi(int flag, const char *req, const char *str, int base) +static intmax_t +argtoimax(int flag, const char *req, const char *str, int base) { char *cp; - int ret; + intmax_t ret; - ret = (int)strtol(str, &cp, base); + ret = strtoimax(str, &cp, base); if (cp == str || *cp) errx(EEXIT, "-%c flag requires a %s", flag, req); return (ret); Modified: head/sbin/fsck_ffs/setup.c ============================================================================== --- head/sbin/fsck_ffs/setup.c Thu Aug 18 22:59:10 2016 (r304437) +++ head/sbin/fsck_ffs/setup.c Fri Aug 19 00:03:41 2016 (r304438) @@ -196,7 +196,7 @@ setup(char *dev) bflag = 0; return(0); } - pwarn("USING ALTERNATE SUPERBLOCK AT %d\n", bflag); + pwarn("USING ALTERNATE SUPERBLOCK AT %jd\n", bflag); bflag = 0; } if (skipclean && ckclean && sblock.fs_clean) { @@ -329,7 +329,7 @@ readsb(int listerr) } if (sblock.fs_magic != FS_UFS1_MAGIC && sblock.fs_magic != FS_UFS2_MAGIC) { - fprintf(stderr, "%d is not a file system superblock\n", + fprintf(stderr, "%jd is not a file system superblock\n", bflag); return (0); } From owner-svn-src-all@freebsd.org Fri Aug 19 00:50:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5307BBF45D; Fri, 19 Aug 2016 00:50:33 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 780E3168E; Fri, 19 Aug 2016 00:50:33 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J0oWV6043172; Fri, 19 Aug 2016 00:50:32 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J0oWkW043171; Fri, 19 Aug 2016 00:50:32 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608190050.u7J0oWkW043171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Fri, 19 Aug 2016 00:50:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304439 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 00:50:33 -0000 Author: yongari Date: Fri Aug 19 00:50:32 2016 New Revision: 304439 URL: https://svnweb.freebsd.org/changeset/base/304439 Log: Fix build on big-endian systems. Reported by: bz Modified: head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axgereg.h ============================================================================== --- head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:03:41 2016 (r304438) +++ head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:50:32 2016 (r304439) @@ -156,19 +156,20 @@ enum { struct axge_frame_txhdr { #if BYTE_ORDER == LITTLE_ENDIAN uint32_t len; -#define AXGE_TXLEN_MASK 0x0001FFFF -#define AXGE_VLAN_INSERT 0x20000000 -#define AXGE_CSUM_DISABLE 0x80000000 uint32_t mss; -#define AXGE_MSS_MASK 0x00003FFF -#define AXGE_PADDING 0x80008000 -#define AXGE_VLAN_TAG_MASK 0xFFFF0000 #else uint32_t mss; uint32_t len; #endif } __packed; +#define AXGE_TXLEN_MASK 0x0001FFFF +#define AXGE_VLAN_INSERT 0x20000000 +#define AXGE_CSUM_DISABLE 0x80000000 +#define AXGE_MSS_MASK 0x00003FFF +#define AXGE_PADDING 0x80008000 +#define AXGE_VLAN_TAG_MASK 0xFFFF0000 + #define AXGE_TXBYTES(x) ((x) & AXGE_TXLEN_MASK) #define AXGE_PHY_ADDR 3 From owner-svn-src-all@freebsd.org Fri Aug 19 00:52:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 415B7BBF584; Fri, 19 Aug 2016 00:52:35 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pf0-x232.google.com (mail-pf0-x232.google.com [IPv6:2607:f8b0:400e:c00::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F8211A48; Fri, 19 Aug 2016 00:52:35 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by mail-pf0-x232.google.com with SMTP id p64so3571131pfb.1; Thu, 18 Aug 2016 17:52:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=z35zIDMNVqrVL1pPSopQWkffNi9B1esU733WVr/lGVE=; b=cNRrdKSl+KlKVCVw2cCGFScnat8tA6AS300wCdfjqLC4o8jGmlClUmgpORxIb+kItS 6O5aXYX2GezsDEf9/KN0ybqgK2IjiBPM2P631f25NgWq3X+rkhh77hkN9a7gaLmqVS9Z jdkDIoIqzflOKP7HBsgen7toIb09+iltUOrv/VV90g7Ya5Z7IFOsqx0xXChyyc9PQslu 3gVPwSYlJyZAJoJFg199cHDsbVlV2deY/YxstxzbH+j1Hb2Xb0IKkJTWeQoXEg4by4f7 njYnVAyyG6BlyViWLnSAz3cu7ivvOcP/n4u9L160mg4i8V8PoseOdRII4eMR+zYi6UKp kWvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=z35zIDMNVqrVL1pPSopQWkffNi9B1esU733WVr/lGVE=; b=IXogO3zDX/JCnlsc6xNd+1Ir1tJ0r2Gx6DJd6gzIt8ANSZ2/m2C7rjzbwGUIWFP47c vbj4eQ0JpMela8Xp3/rc0jDQJIgQoJrmJ0/jJSwaTJpCAeMX/WsRjDLi7R1FLUrwDJF9 6/P7VuHLBwQnBCHx4t5FiWH8ptgeRX8yjkVKmFsg/vaSidQcvrt8714o+DnmzsZrPT3a eRoPdyVVA0/vt8elZsPXpCEH9xZYXoD7YCmyKJAcI7wzhFxghWTO814wwaMZ9pxSynwQ 8rrRvPfKQ+SsDDDzJtGoI1RIM46RKvmptM7ImZlZYpD5qHB8QmgXP4vyAXoapzVeXYmR wGbQ== X-Gm-Message-State: AEkoouvH0lbcq1DVIJ0JcZzJYt/ojZdpS+1bUz+7PSYDQlIITQ4B2ueCSFIKsBnA5TAfWQ== X-Received: by 10.98.18.221 with SMTP id 90mr9243526pfs.3.1471567954616; Thu, 18 Aug 2016 17:52:34 -0700 (PDT) Received: from localhost ([106.247.248.2]) by smtp.gmail.com with ESMTPSA id y9sm6458108pay.25.2016.08.18.17.52.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Aug 2016 17:52:31 -0700 (PDT) From: YongHyeon PYUN X-Google-Original-From: "YongHyeon PYUN" Received: by localhost (sSMTP sendmail emulation); Fri, 19 Aug 2016 09:52:25 +0900 Date: Fri, 19 Aug 2016 09:52:25 +0900 To: "Bjoern A. Zeeb" Cc: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304326 - head/sys/dev/usb/net Message-ID: <20160819005225.GA1234@michelle.fasterthan.co.kr> Reply-To: pyunyh@gmail.com References: <201608180507.u7I572ZI096519@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 00:52:35 -0000 On Thu, Aug 18, 2016 at 04:44:29PM +0000, Bjoern A. Zeeb wrote: > On 18 Aug 2016, at 5:07, Pyun YongHyeon wrote: > > >Author: yongari > >Date: Thu Aug 18 05:07:02 2016 > >New Revision: 304326 > >URL: https://svnweb.freebsd.org/changeset/base/304326 > > [...] > >+struct axge_frame_txhdr { > >+#if BYTE_ORDER == LITTLE_ENDIAN > >+ uint32_t len; > >+#define AXGE_TXLEN_MASK 0x0001FFFF > >+#define AXGE_VLAN_INSERT 0x20000000 > >+#define AXGE_CSUM_DISABLE 0x80000000 > >+ uint32_t mss; > >+#define AXGE_MSS_MASK 0x00003FFF > >+#define AXGE_PADDING 0x80008000 > >+#define AXGE_VLAN_TAG_MASK 0xFFFF0000 > >+#else > >+ uint32_t mss; > >+ uint32_t len; > >+#endif > >+} __packed; > >+ > >+#define AXGE_TXBYTES(x) ((x) & AXGE_TXLEN_MASK) > > > AXGE_TXLEN_MASK is only defined for LITTLE_ENDIAN and thus breaks builds > on others. > > AXGE_CSUM_DISABLE as well .. > Oops, fixed in r304439. Thanks. From owner-svn-src-all@freebsd.org Fri Aug 19 01:27:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39A91BBFC41; Fri, 19 Aug 2016 01:27:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 090FE1B7D; Fri, 19 Aug 2016 01:27:24 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J1RO0i057998; Fri, 19 Aug 2016 01:27:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J1ROOq057997; Fri, 19 Aug 2016 01:27:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608190127.u7J1ROOq057997@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Aug 2016 01:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304440 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 01:27:25 -0000 Author: markj Date: Fri Aug 19 01:27:24 2016 New Revision: 304440 URL: https://svnweb.freebsd.org/changeset/base/304440 Log: Correct a check for P2_PTRACE_FSTP in ptracestop(). MFC after: 1 day Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Fri Aug 19 00:50:32 2016 (r304439) +++ head/sys/kern/kern_sig.c Fri Aug 19 01:27:24 2016 (r304440) @@ -2537,7 +2537,7 @@ ptracestop(struct thread *td, int sig) * a chance to report itself upon the next iteration. */ if ((td->td_dbgflags & TDB_FSTP) != 0 || - ((p->p_flag & P2_PTRACE_FSTP) == 0 && + ((p->p_flag2 & P2_PTRACE_FSTP) == 0 && p->p_xthread == NULL)) { p->p_xsig = sig; p->p_xthread = td; From owner-svn-src-all@freebsd.org Fri Aug 19 03:28:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD62ABBF6B5 for ; Fri, 19 Aug 2016 03:28:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x243.google.com (mail-it0-x243.google.com [IPv6:2607:f8b0:4001:c0b::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 908941869 for ; Fri, 19 Aug 2016 03:28:58 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x243.google.com with SMTP id e63so844344ith.1 for ; Thu, 18 Aug 2016 20:28:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=NTanaiVjvrtP3VCPIm9mlNsY9Ob+83e+XZDe2wlZvKM=; b=jHLPATfY1unby5UD+nw0F9fF1mXEmFE4EpmyOP2cIJOpFbqdWLN6OJaUB3BUbYyWrX Lp3kLRS37uwcTEC+Nv+zsyQKu2XaSa7cnibRWqlj6toTiDOJgr9DMZN75o33HCj01Y+n AWUI/TNkktkHYPjTuqTHMoPPME/12ibP8WIwh99gidl/OH/PcC2ynIpc/AIynHWTnyQW rnrdbBgewxNITItPJIFf5JP/6Z9QMkIBSFAu8VeQ4zdrRp2AXf2zPI3QlDNkSEPtQUih O7Ek9a9/n4c/5OqRgF6iAQxckySSlZFLAAmGBy5C5CGagftLticJ2B3fIILpgCfklnw/ VGng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=NTanaiVjvrtP3VCPIm9mlNsY9Ob+83e+XZDe2wlZvKM=; b=j6QF245noHlQ7sjh6I6eGRf7DLJhQk4vEDO9VN6JoTpuOh+Jz+s5zW+v/r7vRyjH3P 8PfIO0jWxNRA5hxwpQfohaHCiZv6FQDof/HOKeumFW79Cgbn/IpAXqrJ8wrUYWQBHYiV PxBFoH5Up2Ew4aREpyiG+W/dxHEuL4XZkqQ08pI8CEzXdIYwh2oU9bi5yLmCjOGnork+ FC74YGbM6MN+MN2zcGR3U//lcUJTIEwrGxP08VdC4R0xRzp6eazC2Q/Z2w9VFi7pi63O jrRPwG/yjFU23lEgM6ZSVWKSZGnoopPpDYRh5TmX/RZVFb1niGGW8yrMsz8/VlpFURUV N8Vw== X-Gm-Message-State: AEkoouvW6Gc74MxLsH2iK/4kVe4cqQb8LpntAcjU3tHdfxI78u3g2kPPRV1afki36rqVNrwWjUEDXEY7VhCyew== X-Received: by 10.36.149.193 with SMTP id m184mr3680559itd.94.1471577337707; Thu, 18 Aug 2016 20:28:57 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Thu, 18 Aug 2016 20:28:57 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> From: Warner Losh Date: Thu, 18 Aug 2016 21:28:57 -0600 X-Google-Sender-Auth: 3LzdAaRGVF3reeQGMZ4CC4gFNp8 Message-ID: Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd To: Julian Elischer Cc: John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 03:28:58 -0000 On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer wrote: > On 16/08/2016 4:54 AM, John Baldwin wrote: >> >> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >>> >>> Author: jhb >>> Date: Mon Aug 15 20:38:02 2016 >>> New Revision: 304187 >>> URL: https://svnweb.freebsd.org/changeset/base/304187 >>> >>> Log: >>> Remove the mcd(4) driver for Mitsumi CD-ROM players. >>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in >>> the manpage, this driver is only useful as a backend to cdcontrol to >>> play audio CDs since it doesn't use DMA, so its data performance is >>> "abysmal" (and that was true in the mid 90's). >> >> No one stepped up to test patches for it either when I last posted patches >> to >> convert it from timeout(9) to callout(9). I have a few more drivers that >> are >> both very old and that people have no business using in 12 (think ISA >> adapters that don't do DMA and can't be used with pccard) that I will be >> removing over the next little while. I brought up a list of drivers on >> arch@ >> a couple of years ago and the conversation drifted off into the weeds >> about >> trimming GENERIC, etc. No one objected to the specific drivers I listed >> though (and I got a few pleas of "please remove"). If someone shows up >> desperately clutching an ISA adapter they can always dig up the source >> from >> svn and deal with forward porting it for whatever API changes have >> happened >> since it was removed. > > > I would imagine any machine still holding one of these probably has not > enough memory to run FreeBSD. > > would we still run in 2MB? With insane levels of tuning, we can run in 32MB userland that can do things. Even 64MB is tight w/o some tuning. 16MB is almost certainly right out except for very specialized situations. 2MB? We can't even load the loader in that :(. Oh, and all these memory configs are only possible if you tweak the loader's block cache... Warner From owner-svn-src-all@freebsd.org Fri Aug 19 03:32:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94180BBF741; Fri, 19 Aug 2016 03:32:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45AC11C06; Fri, 19 Aug 2016 03:32:06 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J3W5xe007060; Fri, 19 Aug 2016 03:32:05 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J3W5hm007056; Fri, 19 Aug 2016 03:32:05 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608190332.u7J3W5hm007056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 19 Aug 2016 03:32:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304441 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 03:32:06 -0000 Author: sephe Date: Fri Aug 19 03:32:04 2016 New Revision: 304441 URL: https://svnweb.freebsd.org/changeset/base/304441 Log: hyperv/hn: Move NVS version to softc MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7553 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 19 01:27:24 2016 (r304440) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 19 03:32:04 2016 (r304441) @@ -593,10 +593,11 @@ hv_nv_connect_to_vsp(struct hn_softc *sc for (i = protocol_number - 1; i >= 0; i--) { if (hv_nv_negotiate_nvsp_protocol(sc, net_dev, protocol_list[i]) == 0) { - net_dev->nvsp_version = protocol_list[i]; - if (bootverbose) - device_printf(dev, "Netvsc: got version 0x%x\n", - net_dev->nvsp_version); + sc->hn_nvs_ver = protocol_list[i]; + if (bootverbose) { + device_printf(dev, "NVS version 0x%x\n", + sc->hn_nvs_ver); + } break; } } @@ -612,7 +613,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc * Set the MTU if supported by this NVSP protocol version * This needs to be right after the NVSP init message per Haiyang */ - if (net_dev->nvsp_version >= NVSP_PROTOCOL_VERSION_2) + if (sc->hn_nvs_ver >= NVSP_PROTOCOL_VERSION_2) ret = hv_nv_send_ndis_config(sc, ifp->if_mtu); /* @@ -622,7 +623,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc memset(&ndis, 0, sizeof(ndis)); ndis.nvs_type = HN_NVS_TYPE_NDIS_INIT; ndis.nvs_ndis_major = NDIS_VERSION_MAJOR_6; - if (net_dev->nvsp_version <= NVSP_PROTOCOL_VERSION_4) + if (sc->hn_nvs_ver <= NVSP_PROTOCOL_VERSION_4) ndis.nvs_ndis_minor = NDIS_VERSION_MINOR_1; else ndis.nvs_ndis_minor = NDIS_VERSION_MINOR_30; @@ -636,7 +637,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc } /* Post the big receive buffer to NetVSP */ - if (net_dev->nvsp_version <= NVSP_PROTOCOL_VERSION_2) + if (sc->hn_nvs_ver <= NVSP_PROTOCOL_VERSION_2) net_dev->rx_buf_size = NETVSC_RECEIVE_BUFFER_SIZE_LEGACY; else net_dev->rx_buf_size = NETVSC_RECEIVE_BUFFER_SIZE; Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 01:27:24 2016 (r304440) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 03:32:04 2016 (r304441) @@ -237,8 +237,6 @@ typedef struct netvsc_dev_ { void *extension; uint8_t destroy; - /* Negotiated NVSP version */ - uint32_t nvsp_version; uint32_t num_channel; @@ -400,6 +398,7 @@ typedef struct hn_softc { struct sysctl_oid *hn_tx_sysctl_tree; struct sysctl_oid *hn_rx_sysctl_tree; struct vmbus_xact_ctx *hn_xact; + uint32_t hn_nvs_ver; } hn_softc_t; /* Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Aug 19 01:27:24 2016 (r304440) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Aug 19 03:32:04 2016 (r304441) @@ -611,6 +611,10 @@ netvsc_attach(device_t dev) hn_tx_chimney_size < sc->hn_tx_chimney_max) hn_set_tx_chimney_size(sc, hn_tx_chimney_size); + SYSCTL_ADD_UINT(device_get_sysctl_ctx(dev), + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, + "nvs_version", CTLFLAG_RD, &sc->hn_nvs_ver, 0, "NVS version"); + return (0); failed: hn_destroy_tx_data(sc); Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Aug 19 01:27:24 2016 (r304440) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Aug 19 03:32:04 2016 (r304441) @@ -349,11 +349,10 @@ hv_rf_send_offload_request(struct hn_sof rndis_device *rndis_dev; device_t dev = sc->hn_dev; netvsc_dev *net_dev = sc->net_dev; - uint32_t vsp_version = net_dev->nvsp_version; uint32_t extlen = sizeof(rndis_offload_params); int ret; - if (vsp_version <= NVSP_PROTOCOL_VERSION_4) { + if (sc->hn_nvs_ver <= NVSP_PROTOCOL_VERSION_4) { extlen = VERSION_4_OFFLOAD_SIZE; /* On NVSP_PROTOCOL_VERSION_4 and below, we do not support * UDP checksum offload. @@ -1116,7 +1115,7 @@ hv_rf_on_device_add(struct hn_softc *sc, dev_info->link_state = rndis_dev->link_status; net_dev->num_channel = 1; - if (net_dev->nvsp_version < NVSP_PROTOCOL_VERSION_5 || nchan == 1) + if (sc->hn_nvs_ver < NVSP_PROTOCOL_VERSION_5 || nchan == 1) return (0); memset(&rsscaps, 0, rsscaps_size); From owner-svn-src-all@freebsd.org Fri Aug 19 04:15:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9D30BBD2F5 for ; Fri, 19 Aug 2016 04:15:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-ua0-x236.google.com (mail-ua0-x236.google.com [IPv6:2607:f8b0:400c:c08::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DA6D113B for ; Fri, 19 Aug 2016 04:15:14 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-ua0-x236.google.com with SMTP id 74so61670538uau.0 for ; Thu, 18 Aug 2016 21:15:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=iQ3YGGCdF+pAGNH7dNeoOcCqy3PJOVkUhFdPBrtmodQ=; b=OOfvKdy8ZCLij1L0Di5HwXqkCVfAl158iiokVGIPgKKeWLF4d1gtobCzrA4TUigrn8 i/tBDG0SGWB2y2/1PUtREubMPdGcGHCR+NQcuDQ6XGWC3opNWXRgJPYbw6X+cb0857ln UCVl3y5Tyqo9XqPkd4Gl9SKRmAu25fvsgdugKzNmv6Ja7B3rGrIUVf7PFFCPuCQ8b/sK R+oJ9slMeErvuTbjLQxjRbWKWoH5LL/VF11YjCDIK3rIhuhfSLV/A784bWC5oOYXeUfq LTPesbF0xeYB5cO5qxUzM01a+LIR+isC+UZnM8Gs3qiWrBFGlU276Gtluw9+WT6vxkJ+ pDzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=iQ3YGGCdF+pAGNH7dNeoOcCqy3PJOVkUhFdPBrtmodQ=; b=V3lDeOJgkcRIvvKG6dhAVeZAwgjlt0vD3aUGLfn/N57HFyT4/l5dUAEkCp4PVQNPCj fgpKsvv9F6shu88qfUqXcKhEOrzsIEVdItxtN9acWgPPYi7wLTiv1VSC+bQ15o948u7j wHSiCgxlG3g43A5QyDj+TAevfyVJlP+f6VoqrC1RsnTNLN2xg3eN13XBTlLCHpomt6xE 6JO1NG4EX+otiJhpiYaIQZHxTM2Il1wHNirQXn8l5c9Nbkh0FglCbjI49OWcni6P7eJM 9bMs1ajeBCTSs6VkSjvDhUB3J2btAAIaQ1DbfFJrvlUjuXQpyxq1Hr6dwUz4C5BFKDgO W9lQ== X-Gm-Message-State: AEkoouv/T8TyOKeXaxqxOpC+1B2kHCSD9RPMRg/HZShhar4F9YlUEPntGVXF8I41NvcsyoCc6UHdzbbXUX1MVw== X-Received: by 10.176.1.69 with SMTP id 63mr2635301uak.54.1471580113525; Thu, 18 Aug 2016 21:15:13 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.103.0.84 with HTTP; Thu, 18 Aug 2016 21:15:12 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> From: Warner Losh Date: Thu, 18 Aug 2016 22:15:12 -0600 X-Google-Sender-Auth: EOoSBzZl5a8HyLOEO4kcFamTsuI Message-ID: Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Allan Jude Cc: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= , Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 04:15:15 -0000 On Thu, Aug 18, 2016 at 6:56 AM, Allan Jude wrote: > On 08/18/16 05:50 AM, Dag-Erling Sm=C3=B8rgrav wrote: >> Nathan Whitehorn writes: >>> OK. In which configurations? My Dell servers, for instance, don't do >>> this. How are they set up? What drivers are being used? Is this >>> something that affects passthrough disks, RAIDs, disk images? >> >> Most LSI MegaRAID controllers don't have real passthrough, only JBOD. >> You can query the drive with "camcontrol identify passX", but the >> controller does not report a stripe size for the volume (mfidY). >> >>> The point is that *if the reported stripe size is wrong*, more things >>> than partition alignment in the installer will suffer for it. >> >> It's not wrong, it's non-existent, and I'm getting really tired of >> repeating myself. >> >>> Fixing the installer with a bandaid in the run-up to a release is >>> fine, but *we need to fix the underlying problem*. >> >> We can't, because hardware sucks, and I'm getting really tired of >> repeating myself. >> >> DES >> > > Which makes more sense: > > A) If stripesize =3D=3D 0, use some sane value like 4096 I don't like this. > B) Some other combination that uses the reported stripe size, unless it > is 0, in which case it uses 4096 (or some other value controlled by a > different new sysctl) Don't like this so much. > C) create kern.geom.min_stripe_size with a default of 512, but users can > set 4096 if they use only 4k devices. (doesn't really solve the problem > for the installer) Default it to 4k, and allow users to set it to 512. If the drive reports < this value report this value instead. You'll need to make this a tunable. Then the upp= er layers wouldn't care. There's a small chance that some SD cards might be reporting values that are too large. But I think it is confined to SD cards= and if I see too many more I'll do something specific in the SD driver. Warner From owner-svn-src-all@freebsd.org Fri Aug 19 04:30:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1891BBD7B4; Fri, 19 Aug 2016 04:30:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73D351997; Fri, 19 Aug 2016 04:30:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J4UUwq025925; Fri, 19 Aug 2016 04:30:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J4UTqU025924; Fri, 19 Aug 2016 04:30:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201608190430.u7J4UTqU025924@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 19 Aug 2016 04:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304443 - head/sys/cam 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 04:30:31 -0000 Author: imp Date: Fri Aug 19 04:30:29 2016 New Revision: 304443 URL: https://svnweb.freebsd.org/changeset/base/304443 Log: Improve the pattern matching so that internal *'s work, as well as [set] notation. This fixes pattern matching for recently added drives that would set the NCQ Trim being broken incorrectly. PR: 210686 Tested-by: Tomoaki AOKI MFC After: 3 days Modified: head/sys/cam/cam.c Modified: head/sys/cam/cam.c ============================================================================== --- head/sys/cam/cam.c Fri Aug 19 04:21:16 2016 (r304442) +++ head/sys/cam/cam.c Fri Aug 19 04:30:29 2016 (r304443) @@ -207,32 +207,72 @@ cam_strvis_sbuf(struct sbuf *sb, const u /* * Compare string with pattern, returning 0 on match. * Short pattern matches trailing blanks in name, - * wildcard '*' in pattern matches rest of name, - * wildcard '?' matches a single non-space character. + * Shell globbing rules apply: * matches 0 or more characters, + * ? matchces one character, [...] denotes a set to match one char, + * [^...] denotes a complimented set to match one character. + * Spaces in str used to match anything in the pattern string + * but was removed because it's a bug. No current patterns require + * it, as far as I know, but it's impossible to know what drives + * returned. + * + * Each '*' generates recursion, so keep the number of * in check. */ int cam_strmatch(const u_int8_t *str, const u_int8_t *pattern, int str_len) { - while (*pattern != '\0'&& str_len > 0) { - + while (*pattern != '\0' && str_len > 0) { if (*pattern == '*') { - return (0); - } - if ((*pattern != *str) - && (*pattern != '?' || *str == ' ')) { + pattern++; + if (*pattern == '\0') + return (0); + do { + if (cam_strmatch(str, pattern, str_len) == 0) + return (0); + str++; + str_len--; + } while (str_len > 0); return (1); + } else if (*pattern == '[') { + int negate_range, ok; + uint8_t pc, sc; + + ok = 0; + sc = *str++; + str_len--; + if ((negate_range = (*pattern == '^')) != 0) + pattern++; + while (((pc = *pattern) != ']') && *pattern != '\0') { + pattern++; + if (*pattern == '-') { + if (pattern[1] == '\0') /* Bad pattern */ + return (1); + if (sc >= pc && sc <= pattern[1]) + ok = 1; + pattern += 2; + } else if (pc == sc) + ok = 1; + } + if (ok == negate_range) + return (1); + } else if (*pattern == '?') { + /* NB: || *str == ' ' of the old code is a bug and was removed */ + /* if you add it back, keep this the last if before the naked else */ + pattern++; + str++; + str_len--; + } else { + if (*str != *pattern) + return (1); + pattern++; + str++; + str_len--; } - pattern++; - str++; - str_len--; } while (str_len > 0 && *str == ' ') { str++; str_len--; } - if (str_len > 0 && *str == 0) - str_len = 0; return (str_len); } From owner-svn-src-all@freebsd.org Fri Aug 19 05:20:13 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74292BBE289; Fri, 19 Aug 2016 05:20:13 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 433B61D67; Fri, 19 Aug 2016 05:20:13 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J5KCr5044633; Fri, 19 Aug 2016 05:20:12 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J5KC4l044631; Fri, 19 Aug 2016 05:20:12 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608190520.u7J5KC4l044631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 19 Aug 2016 05:20:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304444 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 05:20:13 -0000 Author: sephe Date: Fri Aug 19 05:20:12 2016 New Revision: 304444 URL: https://svnweb.freebsd.org/changeset/base/304444 Log: hyperv/hn: Remove assign-only struct field MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7554 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 19 04:30:29 2016 (r304443) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 19 05:20:12 2016 (r304444) @@ -88,7 +88,6 @@ hv_nv_alloc_net_device(struct hn_softc * net_dev = malloc(sizeof(netvsc_dev), M_NETVSC, M_WAITOK | M_ZERO); net_dev->sc = sc; - net_dev->destroy = FALSE; sc->net_dev = net_dev; return (net_dev); @@ -734,9 +733,6 @@ hv_nv_on_device_remove(struct hn_softc * { netvsc_dev *net_dev = sc->net_dev;; - /* Stop outbound traffic ie sends and receives completions */ - net_dev->destroy = TRUE; - hv_nv_disconnect_from_vsp(net_dev); /* At this point, no one should be accessing net_dev except in here */ Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 04:30:29 2016 (r304443) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 05:20:12 2016 (r304444) @@ -236,8 +236,6 @@ typedef struct netvsc_dev_ { /* Holds rndis device info */ void *extension; - uint8_t destroy; - uint32_t num_channel; struct hyperv_dma rxbuf_dma; From owner-svn-src-all@freebsd.org Fri Aug 19 05:21:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC48ABBE3AB; Fri, 19 Aug 2016 05:21:11 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F5E011AE; Fri, 19 Aug 2016 05:21:11 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7J5L4wL010396 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Thu, 18 Aug 2016 22:21:05 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Warner Losh , Allan Jude References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Nathan Whitehorn Message-ID: <081362ef-ff4a-61d5-46e4-9a4cf8b699ee@freebsd.org> Date: Thu, 18 Aug 2016 22:21:04 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVaAVGTML+dYPQh1Or1JSc7OEKqc6YVveMKxkVEmIOUxXNT5gzDB0bI/PeH4Ia2xtpiCzxzNQg7WXO0RDYals0byGoo744SXVmo= X-Sonic-ID: C;hI6+ucxl5hG5EqDx2xNB0g== M;eIcmusxl5hG5EqDx2xNB0g== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 05:21:11 -0000 On 08/18/16 21:15, Warner Losh wrote: > On Thu, Aug 18, 2016 at 6:56 AM, Allan Jude wrote: >> On 08/18/16 05:50 AM, Dag-Erling Smørgrav wrote: >>> Nathan Whitehorn writes: >>>> OK. In which configurations? My Dell servers, for instance, don't do >>>> this. How are they set up? What drivers are being used? Is this >>>> something that affects passthrough disks, RAIDs, disk images? >>> Most LSI MegaRAID controllers don't have real passthrough, only JBOD. >>> You can query the drive with "camcontrol identify passX", but the >>> controller does not report a stripe size for the volume (mfidY). >>> >>>> The point is that *if the reported stripe size is wrong*, more things >>>> than partition alignment in the installer will suffer for it. >>> It's not wrong, it's non-existent, and I'm getting really tired of >>> repeating myself. >>> >>>> Fixing the installer with a bandaid in the run-up to a release is >>>> fine, but *we need to fix the underlying problem*. >>> We can't, because hardware sucks, and I'm getting really tired of >>> repeating myself. >>> >>> DES >>> >> Which makes more sense: >> >> A) If stripesize == 0, use some sane value like 4096 > I don't like this. > >> B) Some other combination that uses the reported stripe size, unless it >> is 0, in which case it uses 4096 (or some other value controlled by a >> different new sysctl) > Don't like this so much. > >> C) create kern.geom.min_stripe_size with a default of 512, but users can >> set 4096 if they use only 4k devices. (doesn't really solve the problem >> for the installer) > Default it to 4k, and allow users to set it to 512. If the drive > reports < this value > report this value instead. You'll need to make this a tunable. Then the upper > layers wouldn't care. There's a small chance that some SD cards might be > reporting values that are too large. But I think it is confined to SD cards and > if I see too many more I'll do something specific in the SD driver. > > Warner > > That sounds good to me and I think can clean up a lot of code and potential foot-shooting. Who is planning to make the patch? I'm happy to do anything that would be helpful. -Nathan From owner-svn-src-all@freebsd.org Fri Aug 19 05:30:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0F03BBE63F; Fri, 19 Aug 2016 05:30:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78A35164E; Fri, 19 Aug 2016 05:30:40 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J5Ud9A048990; Fri, 19 Aug 2016 05:30:39 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J5UdUn048986; Fri, 19 Aug 2016 05:30:39 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608190530.u7J5UdUn048986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 19 Aug 2016 05:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304446 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 05:30:40 -0000 Author: sephe Date: Fri Aug 19 05:30:39 2016 New Revision: 304446 URL: https://svnweb.freebsd.org/changeset/base/304446 Log: hyperv/hn: Remove the useless num_channel MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7555 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.c head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 05:30:02 2016 (r304445) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 05:30:39 2016 (r304446) @@ -236,8 +236,6 @@ typedef struct netvsc_dev_ { /* Holds rndis device info */ void *extension; - uint32_t num_channel; - struct hyperv_dma rxbuf_dma; struct hyperv_dma txbuf_dma; } netvsc_dev; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Aug 19 05:30:02 2016 (r304445) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Aug 19 05:30:39 2016 (r304446) @@ -551,26 +551,25 @@ netvsc_attach(device_t dev) if (sc->hn_xact == NULL) goto failed; - error = hv_rf_on_device_add(sc, &device_info, ring_cnt, + error = hv_rf_on_device_add(sc, &device_info, &ring_cnt, &sc->hn_rx_ring[0]); if (error) goto failed; - KASSERT(sc->net_dev->num_channel > 0 && - sc->net_dev->num_channel <= sc->hn_rx_ring_inuse, - ("invalid channel count %u, should be less than %d", - sc->net_dev->num_channel, sc->hn_rx_ring_inuse)); + KASSERT(ring_cnt > 0 && ring_cnt <= sc->hn_rx_ring_inuse, + ("invalid channel count %d, should be less than %d", + ring_cnt, sc->hn_rx_ring_inuse)); /* * Set the # of TX/RX rings that could be used according to * the # of channels that host offered. */ - if (sc->hn_tx_ring_inuse > sc->net_dev->num_channel) - sc->hn_tx_ring_inuse = sc->net_dev->num_channel; - sc->hn_rx_ring_inuse = sc->net_dev->num_channel; + if (sc->hn_tx_ring_inuse > ring_cnt) + sc->hn_tx_ring_inuse = ring_cnt; + sc->hn_rx_ring_inuse = ring_cnt; device_printf(dev, "%d TX ring, %d RX ring\n", sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse); - if (sc->net_dev->num_channel > 1) + if (sc->hn_rx_ring_inuse > 1) hn_subchan_setup(sc); #if __FreeBSD_version >= 1100099 @@ -1511,7 +1510,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, struct ifaddr *ifa = (struct ifaddr *)data; #endif netvsc_device_info device_info; - int mask, error = 0; + int mask, error = 0, ring_cnt; int retry_cnt = 500; switch(cmd) { @@ -1585,18 +1584,20 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, /* Wait for subchannels to be destroyed */ vmbus_subchan_drain(sc->hn_prichan); - error = hv_rf_on_device_add(sc, &device_info, - sc->hn_rx_ring_inuse, &sc->hn_rx_ring[0]); + ring_cnt = sc->hn_rx_ring_inuse; + error = hv_rf_on_device_add(sc, &device_info, &ring_cnt, + &sc->hn_rx_ring[0]); if (error) { NV_LOCK(sc); sc->temp_unusable = FALSE; NV_UNLOCK(sc); break; } - KASSERT(sc->hn_rx_ring_cnt == sc->net_dev->num_channel, + /* # of channels can _not_ be changed */ + KASSERT(sc->hn_rx_ring_inuse == ring_cnt, ("RX ring count %d and channel count %u mismatch", - sc->hn_rx_ring_cnt, sc->net_dev->num_channel)); - if (sc->net_dev->num_channel > 1) { + sc->hn_rx_ring_cnt, ring_cnt)); + if (sc->hn_rx_ring_inuse > 1) { int r; /* @@ -2966,7 +2967,7 @@ static void hn_subchan_setup(struct hn_softc *sc) { struct vmbus_channel **subchans; - int subchan_cnt = sc->net_dev->num_channel - 1; + int subchan_cnt = sc->hn_rx_ring_inuse - 1; int i; /* Wait for sub-channels setup to complete. */ Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Aug 19 05:30:02 2016 (r304445) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.c Fri Aug 19 05:30:39 2016 (r304446) @@ -1035,7 +1035,7 @@ hv_rf_close_device(rndis_device *device) */ int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, - int nchan, struct hn_rx_ring *rxr) + int *nchan0, struct hn_rx_ring *rxr) { struct hn_send_ctx sndc; int ret; @@ -1051,6 +1051,7 @@ hv_rf_on_device_add(struct hn_softc *sc, size_t resp_len; struct vmbus_xact *xact; uint32_t status, nsubch; + int nchan = *nchan0; rndis_dev = hv_get_rndis_device(); if (rndis_dev == NULL) { @@ -1114,7 +1115,6 @@ hv_rf_on_device_add(struct hn_softc *sc, dev_info->link_state = rndis_dev->link_status; - net_dev->num_channel = 1; if (sc->hn_nvs_ver < NVSP_PROTOCOL_VERSION_5 || nchan == 1) return (0); @@ -1131,10 +1131,9 @@ hv_rf_on_device_add(struct hn_softc *sc, rsscaps.num_recv_que, nchan); if (nchan > rsscaps.num_recv_que) nchan = rsscaps.num_recv_que; - net_dev->num_channel = nchan; - if (net_dev->num_channel == 1) { - device_printf(dev, "net_dev->num_channel == 1 under VRSS\n"); + if (nchan == 1) { + device_printf(dev, "only 1 channel is supported, no vRSS\n"); goto out; } @@ -1151,7 +1150,7 @@ hv_rf_on_device_add(struct hn_softc *sc, req = vmbus_xact_req_data(xact); req->nvs_type = HN_NVS_TYPE_SUBCH_REQ; req->nvs_op = HN_NVS_SUBCH_OP_ALLOC; - req->nvs_nsubch = net_dev->num_channel - 1; + req->nvs_nsubch = nchan - 1; hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); vmbus_xact_activate(xact); @@ -1190,19 +1189,16 @@ hv_rf_on_device_add(struct hn_softc *sc, ret = EIO; goto out; } - if (nsubch > net_dev->num_channel - 1) { + if (nsubch > nchan - 1) { if_printf(sc->hn_ifp, "%u subchans are allocated, requested %u\n", - nsubch, net_dev->num_channel - 1); - nsubch = net_dev->num_channel - 1; + nsubch, nchan - 1); + nsubch = nchan - 1; } - net_dev->num_channel = nsubch + 1; - - ret = hv_rf_set_rss_param(rndis_dev, net_dev->num_channel); + nchan = nsubch + 1; + ret = hv_rf_set_rss_param(rndis_dev, nchan); + *nchan0 = nchan; out: - if (ret) - net_dev->num_channel = 1; - return (ret); } Modified: head/sys/dev/hyperv/netvsc/hv_rndis_filter.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Fri Aug 19 05:30:02 2016 (r304445) +++ head/sys/dev/hyperv/netvsc/hv_rndis_filter.h Fri Aug 19 05:30:39 2016 (r304446) @@ -119,7 +119,7 @@ int hv_rf_on_receive(netvsc_dev *net_dev const void *data, int dlen); void hv_rf_receive_rollup(netvsc_dev *net_dev); void hv_rf_channel_rollup(struct hn_rx_ring *rxr, struct hn_tx_ring *txr); -int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, int nchan, +int hv_rf_on_device_add(struct hn_softc *sc, void *additl_info, int *nchan, struct hn_rx_ring *rxr); int hv_rf_on_device_remove(struct hn_softc *sc, boolean_t destroy_channel); int hv_rf_on_open(struct hn_softc *sc); From owner-svn-src-all@freebsd.org Fri Aug 19 05:33:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AED22BBE794 for ; Fri, 19 Aug 2016 05:33:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pf0-x22c.google.com (mail-pf0-x22c.google.com [IPv6:2607:f8b0:400e:c00::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 689311A08 for ; Fri, 19 Aug 2016 05:33:40 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-pf0-x22c.google.com with SMTP id y134so5851241pfg.0 for ; Thu, 18 Aug 2016 22:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=Jx1mP6I5p+T7MOiWki8kiNSqTNOblyPuppv3sU8Nlr4=; b=w/G6Qod0HiO25lpPbt5HIOYSgXaVXh8W6b6+1HawdlkKRW9VI3iQQ5utZsr7v/0bDu vEgtVSbjcZftyew660VfchIw2lKueNXMOwb+EJ7nGGC/BkkW7EDj69WArpRM1pP2dBK/ 9Mk3G9nqJran+3xGy1z6vyZ5NZaUvvmyJCye1eugUf2CekjLQC/4YnItEIn3L+Tj8+eQ emArG/4zvle9P/JtMM8yucNs0SD2f0G32mz1P2Ct09jf5dyI4pkLk8+3TAM8R5NCIoiS 5IFfxkia98BLTnCPEqzLY9QSy7Gw9UGMdo97ZC84h0gTL3goiR8I2aRKLglrRZNAWc1P x7Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=Jx1mP6I5p+T7MOiWki8kiNSqTNOblyPuppv3sU8Nlr4=; b=S0Tn7wqeFRGjz+3ERQHKXEeRZVUlkw16MpQYuOVGOoxp7V+ZbmL26ccPhkcKpubzdf EhJ9V0dYJaB3b47/hV0wq4AvqwCWnKJntgwph8xUQ79+mCVtTX7A8RFQ6GnfCO7KGTu9 pfogPUsfP8HfWzhOAhuWAsQf/qzMAvG2K+Uwpx7i8zOntGcta9f5ISG2sBovkulgYtJh P6ofZMLrYkZMv7oWL5O0aoYWnC+qQ3SAa5wr+6Ix7QJrOQ4Gzf1+aqtYXTxc/iFhUzPl qw5663vLlY20xOSVTxDqfFLooOQ5N92x2TIVED/FrCimp/o7OP6fZz47SfHLWFAG4i4x OYYA== X-Gm-Message-State: AEkooutVctHCH4rPgu09hkMAKZ1IqnlgiPzSilyJ14o8yiedX8ICjqT5uHN59NZs4HUmwA== X-Received: by 10.98.210.69 with SMTP id c66mr10909746pfg.71.1471584819461; Thu, 18 Aug 2016 22:33:39 -0700 (PDT) Received: from [100.127.66.142] ([69.53.245.200]) by smtp.gmail.com with ESMTPSA id n80sm2805889pfi.19.2016.08.18.22.33.37 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Aug 2016 22:33:38 -0700 (PDT) Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_57E9FE32-7095-4F78-A44E-0613250B6CE9"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: Warner Losh In-Reply-To: <081362ef-ff4a-61d5-46e4-9a4cf8b699ee@freebsd.org> Date: Thu, 18 Aug 2016 23:33:36 -0600 Cc: Warner Losh , Allan Jude , =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <880977BE-F00F-4188-A978-F292AB452C79@bsdimp.com> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> <081362ef-ff4a-61d5-46e4-9a4cf8b699ee@freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 05:33:40 -0000 --Apple-Mail=_57E9FE32-7095-4F78-A44E-0613250B6CE9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Aug 18, 2016, at 11:21 PM, Nathan Whitehorn = wrote: >=20 >=20 >=20 > On 08/18/16 21:15, Warner Losh wrote: >> On Thu, Aug 18, 2016 at 6:56 AM, Allan Jude = wrote: >>> On 08/18/16 05:50 AM, Dag-Erling Sm=C3=B8rgrav wrote: >>>> Nathan Whitehorn writes: >>>>> OK. In which configurations? My Dell servers, for instance, don't = do >>>>> this. How are they set up? What drivers are being used? Is this >>>>> something that affects passthrough disks, RAIDs, disk images? >>>> Most LSI MegaRAID controllers don't have real passthrough, only = JBOD. >>>> You can query the drive with "camcontrol identify passX", but the >>>> controller does not report a stripe size for the volume (mfidY). >>>>=20 >>>>> The point is that *if the reported stripe size is wrong*, more = things >>>>> than partition alignment in the installer will suffer for it. >>>> It's not wrong, it's non-existent, and I'm getting really tired of >>>> repeating myself. >>>>=20 >>>>> Fixing the installer with a bandaid in the run-up to a release is >>>>> fine, but *we need to fix the underlying problem*. >>>> We can't, because hardware sucks, and I'm getting really tired of >>>> repeating myself. >>>>=20 >>>> DES >>>>=20 >>> Which makes more sense: >>>=20 >>> A) If stripesize =3D=3D 0, use some sane value like 4096 >> I don't like this. >>=20 >>> B) Some other combination that uses the reported stripe size, unless = it >>> is 0, in which case it uses 4096 (or some other value controlled by = a >>> different new sysctl) >> Don't like this so much. >>=20 >>> C) create kern.geom.min_stripe_size with a default of 512, but users = can >>> set 4096 if they use only 4k devices. (doesn't really solve the = problem >>> for the installer) >> Default it to 4k, and allow users to set it to 512. If the drive >> reports < this value >> report this value instead. You'll need to make this a tunable. Then = the upper >> layers wouldn't care. There's a small chance that some SD cards might = be >> reporting values that are too large. But I think it is confined to SD = cards and >> if I see too many more I'll do something specific in the SD driver. >>=20 >> Warner >>=20 >>=20 >=20 > That sounds good to me and I think can clean up a lot of code and = potential foot-shooting. Who is planning to make the patch? I'm happy to = do anything that would be helpful. The patch is super-easy, but I need to get the concept validated and = make sure that it does not have unintended side effects. Warner --Apple-Mail=_57E9FE32-7095-4F78-A44E-0613250B6CE9 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----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXtpowAAoJEGwc0Sh9sBEAim0QAK13yHj3lbOzgRjx2Nh+FVAY BCLWRCEZC06sZ2cSxYi0LuTqgArYOKOXcgOacDDM2EbQz55Gj8SPWUenTIk0OVt/ 8BKnIytKqrv6mganZ7Rgyq0JLYmdcohAmqTDivrkx5Z983nwoMbYkAafrPKpjpL/ 3awi6+yUMw1s82jmQ3XbzDT8kfSI2aExgnJa9YRJ8R/oRZpVIWKJTY27lQHzDef/ OsTOtC/OjRQ7V7WHacyL2Pfm0XOFTM0JjPp0GK9BZy8LrtEle9ybRg4fnCo1wdwp dx2evQX6jmxG1mzHiMElpm6bN4A4PpWzjrSOQ4PO+1Ep4yd/OieDH5JmPoiGYywg qSssFUAyunf+4qW97pjwa7o+epR4iub7ITBaPyQgfFQvzn0BOnhNRCvVrTmxwcKN 6gDuwgFoaEIVP6bWlYENKMZsUtnqYzYyazEDT2pptE4wpjerw7i8LGC53f0Pz21+ /N5+hSnqZ3EvuQKX4FUKoiAl0x/1OASYYdjOCsq2sv3HZ04u7Mrbusjxk8eWGrLb 2od39bX9Ew4RhCFMxUNL4z0hci1LRTHWFnjhajXyDmX/rns8BuhFCHvtoohG4N6j C8uT14L6Oczlh1hc0GPfxyFeUCjSxX30OAiLvrHAnatGML+XQ1x/WSjWg+kmVmXd 4y4qoA5bnwxHL1GILyir =smyh -----END PGP SIGNATURE----- --Apple-Mail=_57E9FE32-7095-4F78-A44E-0613250B6CE9-- From owner-svn-src-all@freebsd.org Fri Aug 19 05:43:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 057C5BBE9C8; Fri, 19 Aug 2016 05:43:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0D901E87; Fri, 19 Aug 2016 05:43:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J5hSKv055334; Fri, 19 Aug 2016 05:43:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J5hSJi055331; Fri, 19 Aug 2016 05:43:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201608190543.u7J5hSJi055331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 19 Aug 2016 05:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304447 - head/sys/dev/hyperv/netvsc 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 05:43:30 -0000 Author: sephe Date: Fri Aug 19 05:43:28 2016 New Revision: 304447 URL: https://svnweb.freebsd.org/changeset/base/304447 Log: hyperv/hn: Move RXBUF to hn_softc And don't recreate RXBUF for each primary channel open, it is now created in device_attach DEVMETHOD and destroyed in device_detach DEVMETHOD. MFC after: 1 week Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7556 Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 19 05:30:39 2016 (r304446) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Fri Aug 19 05:43:28 2016 (r304447) @@ -59,9 +59,9 @@ MALLOC_DEFINE(M_NETVSC, "netvsc", "Hyper static void hv_nv_on_channel_callback(struct vmbus_channel *chan, void *xrxr); static int hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc); -static int hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *); +static int hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *, int); static int hv_nv_destroy_send_buffer(netvsc_dev *net_dev); -static int hv_nv_destroy_rx_buffer(netvsc_dev *net_dev); +static int hv_nv_destroy_rx_buffer(struct hn_softc *sc); static int hv_nv_connect_to_vsp(struct hn_softc *sc); static void hv_nv_on_send_completion(netvsc_dev *net_dev, struct vmbus_channel *, const struct vmbus_chanpkt_hdr *pkt); @@ -146,29 +146,18 @@ hv_nv_get_next_send_section(netvsc_dev * * Hyper-V extensible switch and the synthetic data path. */ static int -hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *sc) +hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *sc, int rxbuf_size) { struct vmbus_xact *xact; struct hn_nvs_rxbuf_conn *conn; const struct hn_nvs_rxbuf_connresp *resp; size_t resp_len; struct hn_send_ctx sndc; - netvsc_dev *net_dev; uint32_t status; int error; - net_dev = hv_nv_get_outbound_net_device(sc); - if (!net_dev) { - return (ENODEV); - } - - net_dev->rx_buf = hyperv_dmamem_alloc(bus_get_dma_tag(sc->hn_dev), - PAGE_SIZE, 0, net_dev->rx_buf_size, &net_dev->rxbuf_dma, - BUS_DMA_WAITOK | BUS_DMA_ZERO); - if (net_dev->rx_buf == NULL) { - device_printf(sc->hn_dev, "allocate rxbuf failed\n"); - return (ENOMEM); - } + KASSERT(rxbuf_size <= NETVSC_RECEIVE_BUFFER_SIZE, + ("invalid rxbuf size %d", rxbuf_size)); /* * Connect the RXBUF GPADL to the primary channel. @@ -178,8 +167,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct * just share this RXBUF. */ error = vmbus_chan_gpadl_connect(sc->hn_prichan, - net_dev->rxbuf_dma.hv_paddr, net_dev->rx_buf_size, - &net_dev->rx_buf_gpadl_handle); + sc->hn_rxbuf_dma.hv_paddr, rxbuf_size, &sc->hn_rxbuf_gpadl); if (error) { if_printf(sc->hn_ifp, "rxbuf gpadl connect failed: %d\n", error); @@ -199,7 +187,7 @@ hv_nv_init_rx_buffer_with_net_vsp(struct conn = vmbus_xact_req_data(xact); conn->nvs_type = HN_NVS_TYPE_RXBUF_CONN; - conn->nvs_gpadl = net_dev->rx_buf_gpadl_handle; + conn->nvs_gpadl = sc->hn_rxbuf_gpadl; conn->nvs_sig = HN_NVS_RXBUF_SIG; hn_send_ctx_init_simple(&sndc, hn_nvs_sent_xact, xact); @@ -239,12 +227,12 @@ hv_nv_init_rx_buffer_with_net_vsp(struct error = EIO; goto cleanup; } - net_dev->rx_section_count = 1; + sc->hn_flags |= HN_FLAG_RXBUF_CONNECTED; return (0); cleanup: - hv_nv_destroy_rx_buffer(net_dev); + hv_nv_destroy_rx_buffer(sc); return (error); } @@ -376,11 +364,11 @@ cleanup: * Net VSC destroy receive buffer */ static int -hv_nv_destroy_rx_buffer(netvsc_dev *net_dev) +hv_nv_destroy_rx_buffer(struct hn_softc *sc) { int ret = 0; - if (net_dev->rx_section_count) { + if (sc->hn_flags & HN_FLAG_RXBUF_CONNECTED) { struct hn_nvs_rxbuf_disconn disconn; /* @@ -391,37 +379,30 @@ hv_nv_destroy_rx_buffer(netvsc_dev *net_ disconn.nvs_sig = HN_NVS_RXBUF_SIG; /* NOTE: No response. */ - ret = hn_nvs_send(net_dev->sc->hn_prichan, + ret = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_NONE, &disconn, sizeof(disconn), &hn_send_ctx_none); if (ret != 0) { - if_printf(net_dev->sc->hn_ifp, + if_printf(sc->hn_ifp, "send rxbuf disconn failed: %d\n", ret); return (ret); } - net_dev->rx_section_count = 0; + sc->hn_flags &= ~HN_FLAG_RXBUF_CONNECTED; } - /* Tear down the gpadl on the vsp end */ - if (net_dev->rx_buf_gpadl_handle) { - ret = vmbus_chan_gpadl_disconnect(net_dev->sc->hn_prichan, - net_dev->rx_buf_gpadl_handle); + if (sc->hn_rxbuf_gpadl != 0) { /* - * If we failed here, we might as well return and have a leak - * rather than continue and a bugchk + * Disconnect RXBUF from primary channel. */ + ret = vmbus_chan_gpadl_disconnect(sc->hn_prichan, + sc->hn_rxbuf_gpadl); if (ret != 0) { + if_printf(sc->hn_ifp, + "rxbuf disconn failed: %d\n", ret); return (ret); } - net_dev->rx_buf_gpadl_handle = 0; + sc->hn_rxbuf_gpadl = 0; } - - if (net_dev->rx_buf) { - /* Free up the receive buffer */ - hyperv_dmamem_free(&net_dev->rxbuf_dma, net_dev->rx_buf); - net_dev->rx_buf = NULL; - } - return (ret); } @@ -583,6 +564,7 @@ hv_nv_connect_to_vsp(struct hn_softc *sc device_t dev = sc->hn_dev; struct ifnet *ifp = sc->hn_ifp; struct hn_nvs_ndis_init ndis; + int rxbuf_size; net_dev = hv_nv_get_outbound_net_device(sc); @@ -637,12 +619,12 @@ hv_nv_connect_to_vsp(struct hn_softc *sc /* Post the big receive buffer to NetVSP */ if (sc->hn_nvs_ver <= NVSP_PROTOCOL_VERSION_2) - net_dev->rx_buf_size = NETVSC_RECEIVE_BUFFER_SIZE_LEGACY; + rxbuf_size = NETVSC_RECEIVE_BUFFER_SIZE_LEGACY; else - net_dev->rx_buf_size = NETVSC_RECEIVE_BUFFER_SIZE; + rxbuf_size = NETVSC_RECEIVE_BUFFER_SIZE; net_dev->send_buf_size = NETVSC_SEND_BUFFER_SIZE; - ret = hv_nv_init_rx_buffer_with_net_vsp(sc); + ret = hv_nv_init_rx_buffer_with_net_vsp(sc, rxbuf_size); if (ret == 0) ret = hv_nv_init_send_buffer_with_net_vsp(sc); @@ -654,10 +636,10 @@ cleanup: * Net VSC disconnect from VSP */ static void -hv_nv_disconnect_from_vsp(netvsc_dev *net_dev) +hv_nv_disconnect_from_vsp(struct hn_softc *sc) { - hv_nv_destroy_rx_buffer(net_dev); - hv_nv_destroy_send_buffer(net_dev); + hv_nv_destroy_rx_buffer(sc); + hv_nv_destroy_send_buffer(sc->net_dev); } void @@ -731,17 +713,14 @@ cleanup: int hv_nv_on_device_remove(struct hn_softc *sc, boolean_t destroy_channel) { - netvsc_dev *net_dev = sc->net_dev;; - hv_nv_disconnect_from_vsp(net_dev); - - /* At this point, no one should be accessing net_dev except in here */ + hv_nv_disconnect_from_vsp(sc); /* Now, we can close the channel safely */ vmbus_chan_close(sc->hn_prichan); - free(net_dev, M_NETVSC); + free(sc->net_dev, M_NETVSC); return (0); } @@ -865,7 +844,7 @@ hv_nv_on_receive(netvsc_dev *net_dev, st /* Each range represents 1 RNDIS pkt that contains 1 Ethernet frame */ for (i = 0; i < count; i++) { hv_rf_on_receive(net_dev, rxr, - (const uint8_t *)net_dev->rx_buf + pkt->cp_rxbuf[i].rb_ofs, + rxr->hn_rxbuf + pkt->cp_rxbuf[i].rb_ofs, pkt->cp_rxbuf[i].rb_len); } Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 05:30:39 2016 (r304446) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Fri Aug 19 05:43:28 2016 (r304447) @@ -227,16 +227,9 @@ typedef struct netvsc_dev_ { unsigned long bitsmap_words; unsigned long *send_section_bitsmap; - /* Receive buffer allocated by us but managed by NetVSP */ - void *rx_buf; - uint32_t rx_buf_size; - uint32_t rx_buf_gpadl_handle; - uint32_t rx_section_count; - /* Holds rndis device info */ void *extension; - struct hyperv_dma rxbuf_dma; struct hyperv_dma txbuf_dma; } netvsc_dev; @@ -286,6 +279,7 @@ struct hn_rx_ring { struct ifnet *hn_ifp; struct hn_tx_ring *hn_txr; void *hn_rdbuf; + uint8_t *hn_rxbuf; /* shadow sc->hn_rxbuf */ int hn_rx_idx; /* Trust csum verification on host side */ @@ -395,8 +389,15 @@ typedef struct hn_softc { struct sysctl_oid *hn_rx_sysctl_tree; struct vmbus_xact_ctx *hn_xact; uint32_t hn_nvs_ver; + + uint32_t hn_flags; + void *hn_rxbuf; + uint32_t hn_rxbuf_gpadl; + struct hyperv_dma hn_rxbuf_dma; } hn_softc_t; +#define HN_FLAG_RXBUF_CONNECTED 0x0001 + /* * Externs */ Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Aug 19 05:30:39 2016 (r304446) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Fri Aug 19 05:43:28 2016 (r304447) @@ -342,7 +342,7 @@ static void hn_start_taskfunc(void *, in static void hn_start_txeof_taskfunc(void *, int); static void hn_stop_tx_tasks(struct hn_softc *); static int hn_encap(struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **); -static void hn_create_rx_data(struct hn_softc *sc, int); +static int hn_create_rx_data(struct hn_softc *sc, int); static void hn_destroy_rx_data(struct hn_softc *sc); static void hn_set_tx_chimney_size(struct hn_softc *, int); static void hn_channel_attach(struct hn_softc *, struct vmbus_channel *); @@ -504,7 +504,9 @@ netvsc_attach(device_t dev) error = hn_create_tx_data(sc, tx_ring_cnt); if (error) goto failed; - hn_create_rx_data(sc, ring_cnt); + error = hn_create_rx_data(sc, ring_cnt); + if (error) + goto failed; /* * Associate the first TX/RX ring w/ the primary channel. @@ -2176,7 +2178,7 @@ hn_check_iplen(const struct mbuf *m, int return ip->ip_p; } -static void +static int hn_create_rx_data(struct hn_softc *sc, int ring_cnt) { struct sysctl_oid_list *child; @@ -2189,6 +2191,22 @@ hn_create_rx_data(struct hn_softc *sc, i #endif int i; + /* + * Create RXBUF for reception. + * + * NOTE: + * - It is shared by all channels. + * - A large enough buffer is allocated, certain version of NVSes + * may further limit the usable space. + */ + sc->hn_rxbuf = hyperv_dmamem_alloc(bus_get_dma_tag(dev), + PAGE_SIZE, 0, NETVSC_RECEIVE_BUFFER_SIZE, &sc->hn_rxbuf_dma, + BUS_DMA_WAITOK | BUS_DMA_ZERO); + if (sc->hn_rxbuf == NULL) { + device_printf(sc->hn_dev, "allocate rxbuf failed\n"); + return (ENOMEM); + } + sc->hn_rx_ring_cnt = ring_cnt; sc->hn_rx_ring_inuse = sc->hn_rx_ring_cnt; @@ -2225,6 +2243,7 @@ hn_create_rx_data(struct hn_softc *sc, i rxr->hn_txr = &sc->hn_tx_ring[i]; rxr->hn_rdbuf = malloc(NETVSC_PACKET_SIZE, M_NETVSC, M_WAITOK); rxr->hn_rx_idx = i; + rxr->hn_rxbuf = sc->hn_rxbuf; /* * Initialize LRO. @@ -2331,6 +2350,8 @@ hn_create_rx_data(struct hn_softc *sc, i CTLFLAG_RD, &sc->hn_rx_ring_cnt, 0, "# created RX rings"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rx_ring_inuse", CTLFLAG_RD, &sc->hn_rx_ring_inuse, 0, "# used RX rings"); + + return (0); } static void @@ -2354,6 +2375,11 @@ hn_destroy_rx_data(struct hn_softc *sc) sc->hn_rx_ring_cnt = 0; sc->hn_rx_ring_inuse = 0; + + if (sc->hn_rxbuf != NULL) { + hyperv_dmamem_free(&sc->hn_rxbuf_dma, sc->hn_rxbuf); + sc->hn_rxbuf = NULL; + } } static int From owner-svn-src-all@freebsd.org Fri Aug 19 05:50:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54AE0BBEC01; Fri, 19 Aug 2016 05:50:51 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.fer.hr", Issuer "TERENA SSL CA 3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A7A371366; Fri, 19 Aug 2016 05:50:49 +0000 (UTC) (envelope-from zec@fer.hr) Received: from x23 (31.147.40.243) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server (TLS) id 14.3.279.2; Fri, 19 Aug 2016 07:49:31 +0200 Date: Fri, 19 Aug 2016 07:49:20 +0200 From: Marko Zec To: Ryan Stone CC: , , Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160819074920.52c46f57@x23> In-Reply-To: <201608182259.u7IMx5oW002018@repo.freebsd.org> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd10.1) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [31.147.40.243] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 05:50:51 -0000 On Thu, 18 Aug 2016 22:59:05 +0000 Ryan Stone wrote: > Author: rstone > Date: Thu Aug 18 22:59:05 2016 > New Revision: 304436 > URL: https://svnweb.freebsd.org/changeset/base/304436 > > Log: > Don't check for broadcast IPs on non-bcast pkts > > in_broadcast() can be quite expensive, so skip calling it if the > incoming mbuf wasn't sent to a broadcast L2 address in the first > place. > > Reviewed by: gnn > MFC after: 2 months > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D7309 > > Modified: > head/UPDATING > head/sys/netinet/udp_usrreq.c > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Thu Aug 18 22:59:00 2016 (r304435) > +++ head/UPDATING Thu Aug 18 22:59:05 2016 (r304436) > @@ -32,6 +32,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > 20160818: > + The UDP receive code has been updated to only treat incoming > UDP > + packets that were addressed to an L2 broadcast address as L3 > + broadcast packets. It is not expected that this will affect > any > + standards-conforming UDP application. The new behaviour can > be > + disabled by setting the sysctl net.inet.udp.require_l2_bcast > to > + 0. > + > +20160818: > Remove the openbsd_poll system call. > __FreeBSD_version has been bumped because of this. > > > Modified: head/sys/netinet/udp_usrreq.c > ============================================================================== > --- head/sys/netinet/udp_usrreq.c Thu Aug 18 22:59:00 > 2016 (r304435) +++ head/sys/netinet/udp_usrreq.c Thu > Aug 18 22:59:05 2016 (r304436) @@ -126,6 +126,11 @@ > SYSCTL_INT(_net_inet_udp, OID_AUTO, blac &VNET_NAME(udp_blackhole), 0, > "Do not send port unreachables for refused connects"); > > +static VNET_DEFINE(int, udp_require_l2_bcast) = 1; > +SYSCTL_INT(_net_inet_udp, OID_AUTO, require_l2_bcast, CTLFLAG_VNET | > CTLFLAG_RW, > + &VNET_NAME(udp_require_l2_bcast), 0, > + "Only treat packets sent to an L2 broadcast address as broadcast > packets"); + > u_long udp_sendspace = 9216; /* really max > datagram size */ SYSCTL_ULONG(_net_inet_udp, UDPCTL_MAXDGRAM, > maxdgram, CTLFLAG_RW, &udp_sendspace, 0, "Maximum outgoing UDP > datagram size"); @@ -523,7 +528,8 @@ udp_input(struct mbuf **mp, int > *offp, i > pcbinfo = udp_get_inpcbinfo(proto); > if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || > - in_broadcast(ip->ip_dst, ifp)) { > + ((!VNET_NAME(udp_require_l2_bcast) || m->m_flags & > M_BCAST) && > + in_broadcast(ip->ip_dst, ifp))) { > struct inpcb *last; > struct inpcbhead *pcblist; > struct ip_moptions *imo; > VNET_NAME() macros should be used only within SYSCTL_* macros, otherwise (if I recall it correctly) this won't work with options VIMAGE enabled, so please don't use VNET_NAME() inside function bodies, or anywhere else. An accessor macro needs to resolve the variable inside the curvnet, and VNET() is the macro which accomplishes that, while VNET_NAME() doesn't. The norm is to declare an abbreviated accessor macro along the VNET_DEFINE() variable declaration, such as: #define V_udp_require_l2_bcast VNET(udp_require_l2_bcast) and then to use that accessor macro throught the rest of the code. Marko From owner-svn-src-all@freebsd.org Fri Aug 19 06:21:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9BB1BBF0DA for ; Fri, 19 Aug 2016 06:21:08 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 714A91E32; Fri, 19 Aug 2016 06:21:07 +0000 (UTC) (envelope-from freebsd@omnilan.de) Received: from mh0.gentlemail.de (ezra.dcm1.omnilan.net [IPv6:2a00:e10:2800::a135]) by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id u7J6L4f9079880; Fri, 19 Aug 2016 08:21:04 +0200 (CEST) (envelope-from freebsd@omnilan.de) Received: from titan.inop.mo1.omnilan.net (titan.inop.mo1.omnilan.net [IPv6:2001:a60:f0bb:1::3:1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mh0.gentlemail.de (Postfix) with ESMTPSA id 4980E5DE; Fri, 19 Aug 2016 08:21:04 +0200 (CEST) Message-ID: <57B6A54F.5020505@omnilan.de> Date: Fri, 19 Aug 2016 08:21:03 +0200 From: Harry Schmalzbauer Organization: OmniLAN User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE; rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2 MIME-Version: 1.0 To: John Baldwin CC: src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r298950 - head/sys/dev/pci References: <201605030035.u430ZBkH006797@repo.freebsd.org> In-Reply-To: <201605030035.u430ZBkH006797@repo.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130]); Fri, 19 Aug 2016 08:21:04 +0200 (CEST) X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: ; Sender-helo: mh0.gentlemail.de; ) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 06:21:08 -0000 Bezüglich John Baldwin's Nachricht vom 03.05.2016 02:35 (localtime): > Author: jhb > Date: Tue May 3 00:35:11 2016 > New Revision: 298950 > URL: https://svnweb.freebsd.org/changeset/base/298950 > > Log: > Fix an off by one error when remapping MSI-X vectors. > > pci_remap_msix() can be used to alter the mapping of allocated > MSI-X vectors to the MSI-X table. The code had an off by one error > when adding the IRQ resources after performing a remap. This was > fatal for any vectors in the table that used the "last" valid IRQ as > those vectors were assigned a garbage IRQ value. > > MFC after: 3 days Was this superseded by any other merge? As far as I saw, it's missing in stable/10? Thanks, -Harry From owner-svn-src-all@freebsd.org Fri Aug 19 06:23:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AAF3BBF212; Fri, 19 Aug 2016 06:23:18 +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 C4FB212A9; Fri, 19 Aug 2016 06:23:17 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 1CE23492B; Fri, 19 Aug 2016 06:23:16 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 04B588FEE; Fri, 19 Aug 2016 08:21:50 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Nathan Whitehorn Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <544c64f4-693a-c5bc-1fb2-e696589583b3@freebsd.org> <867fbe3yd3.fsf@desk.des.no> <4d097835-66ce-72b6-c774-a87e38d88625@freebsd.org> Date: Fri, 19 Aug 2016 08:21:49 +0200 In-Reply-To: <4d097835-66ce-72b6-c774-a87e38d88625@freebsd.org> (Nathan Whitehorn's message of "Thu, 18 Aug 2016 11:35:18 -0700") Message-ID: <86mvk9cm82.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 06:23:18 -0000 Nathan Whitehorn writes: > This is ridiculous. I've asked a series of technical questions about > generalizing a patch you made and that I think is a good idea. In > response, those questions have been met with a non-stop torrent of > insults and abuse instead of answers, with only one eventual nugget of > information in response to one of them -- that you ran into problems > with mfid -- to redeem it. I'm done with this discussion. I suggest you go and read through the discussion again. I gave you plenty of information, mentioning LSI and hypervisors, for instance, and even, as I grew increasingly frustrated by your stonewalling, showed you how to inspect the code to confirm that most RAID drivers do not even try to report a stripe size. Meanwhile, you steadfastedly refused to address my arguments, simply repeating your position again and again, and insisting that the fact that you have never encountered any systems that get the stripe size wrong (which I don't believe, but I'm willing to believe that you've never noticed) invalidates the fact that I have. Not to mention your steadfast defense of the non-existent purity of the installer. When Warner finally intervened, you switched to setting up strawmen, asking me to pick and defend one of two positions which I've never held. I'm not going to play that game. > Hopefully we can have a real conversation about this at this some > point after the release. Likewise, but I'm not holding my breath. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@freebsd.org Fri Aug 19 06:44:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2BE69BBF5C3; Fri, 19 Aug 2016 06:44:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 10BD21ABA; Fri, 19 Aug 2016 06:44:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id 58BA7163D; Fri, 19 Aug 2016 06:44:17 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Fri, 19 Aug 2016 06:44:15 +0000 From: Glen Barber To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Cc: Nathan Whitehorn , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit Message-ID: <20160819064415.GB765@FreeBSD.org> References: <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <544c64f4-693a-c5bc-1fb2-e696589583b3@freebsd.org> <867fbe3yd3.fsf@desk.des.no> <4d097835-66ce-72b6-c774-a87e38d88625@freebsd.org> <86mvk9cm82.fsf@desk.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Rln2GmQ7CFmDhc9B" Content-Disposition: inline In-Reply-To: <86mvk9cm82.fsf@desk.des.no> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 06:44:18 -0000 --Rln2GmQ7CFmDhc9B Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 19, 2016 at 08:21:49AM +0200, Dag-Erling Sm=F8rgrav wrote: > Nathan Whitehorn writes: > > This is ridiculous. I've asked a series of technical questions about > > generalizing a patch you made and that I think is a good idea. In > > response, those questions have been met with a non-stop torrent of > > insults and abuse instead of answers, with only one eventual nugget of > > information in response to one of them -- that you ran into problems > > with mfid -- to redeem it. I'm done with this discussion. >=20 > I suggest you go and read through the discussion again. I gave you > plenty of information, mentioning LSI and hypervisors, for instance, and > even, as I grew increasingly frustrated by your stonewalling, showed you > how to inspect the code to confirm that most RAID drivers do not even > try to report a stripe size. Meanwhile, you steadfastedly refused to > address my arguments, simply repeating your position again and again, > and insisting that the fact that you have never encountered any systems > that get the stripe size wrong (which I don't believe, but I'm willing > to believe that you've never noticed) invalidates the fact that I have. > Not to mention your steadfast defense of the non-existent purity of the > installer. When Warner finally intervened, you switched to setting up > strawmen, asking me to pick and defend one of two positions which I've > never held. I'm not going to play that game. >=20 > > Hopefully we can have a real conversation about this at this some > > point after the release. >=20 > Likewise, but I'm not holding my breath. >=20 I'll mediate this then. Not right now. I think everyone needs to step back for a bit. Glen --Rln2GmQ7CFmDhc9B Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXtqq/AAoJEAMUWKVHj+KTYtYP/2BlDNU4cSPylfQ7LRQ2wr2t VW3IOgQa/weH6GF0+7suo/CLnOAS08sb38YsAf3V6AA3KlcatU/HNhvgJ8u8NHUC ULT15coffzQzMcfsLLK2zeWV7etElPNbWtu3y9LbYWafJcjqMYMMREDMn0nYr30X oXcUC1nv7ArM9xM1jUVERC0Va1/ZNr0O4adicVSxHL5PwnKTvguCAGz1ma+VFELy ggaMy14Id38N9bCp7uOyq3TDc9I8GRSERDcbbhf5xWqdb+7UJl5uUzuSTcNdxli+ Zi3fKmy9MsuKaQnHQL+5EiH+VZzmye2UzG8vBpG+hJlY0ump6TwGG4ew1dWinBPP 8RWCybkyuwDL0q6Kj1QVa7BRg653DW2KQRz2LZWlJRk0Hu9Tv99Ertd+kHZrfUqi x1MltUnyOUM+QPSoOLcfrjaMeh7Yw29ATCbxMhCyynO3USKyh9zUj4HwnbaBUn7A tly2VcRSOXUuCZ8OffjmuD1NYFCnSEfE0UE69i28CyT1NF49Yk7vkME4tiUw/Qgs E2pGsvpBe+pHS1b0XD/37zObd/2LB4YGq1Ng+FWvSIV2YJbC5LuwerI3WSlpho2Y i0J9zf6yWIIddji5TFRV60C40oyHs9JnSq4r60JS9pdkP4rkxm7acLfoX/j7J70t SJ62Pkze2omoyB8ngmUj =i5oO -----END PGP SIGNATURE----- --Rln2GmQ7CFmDhc9B-- From owner-svn-src-all@freebsd.org Fri Aug 19 06:52:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 395E4BBF813; Fri, 19 Aug 2016 06:52:29 +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 EE3E51181; Fri, 19 Aug 2016 06:52:28 +0000 (UTC) (envelope-from des@des.no) Received: from desk.des.no (smtp.des.no [194.63.250.102]) by smtp.des.no (Postfix) with ESMTP id 32E5F496D; Fri, 19 Aug 2016 06:52:27 +0000 (UTC) Received: by desk.des.no (Postfix, from userid 1001) id 1E18B8FF3; Fri, 19 Aug 2016 08:51:01 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Warner Losh Cc: Allan Jude , Nathan Whitehorn , src-committers , "svn-src-all\@freebsd.org" , "svn-src-head\@freebsd.org" Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> Date: Fri, 19 Aug 2016 08:51:01 +0200 In-Reply-To: (Warner Losh's message of "Thu, 18 Aug 2016 22:15:12 -0600") Message-ID: <86inuxckve.fsf@desk.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 06:52:29 -0000 Warner Losh writes: > Allan Jude writes: > > Which makes more sense: > > > > A) If stripesize =3D=3D 0, use some sane value like 4096 > > I don't like this. > > > B) Some other combination that uses the reported stripe size, unless it > > is 0, in which case it uses 4096 (or some other value controlled by a > > different new sysctl) > > Don't like this so much. > > > C) create kern.geom.min_stripe_size with a default of 512, but users can > > set 4096 if they use only 4k devices. (doesn't really solve the problem > > for the installer) > > Default it to 4k, and allow users to set it to 512. If the drive > reports < this value > report this value instead. I don't like either option. Option D (which I don't like either, but which should at least work in most cases) is a sysctl that specifies a minimum factor, and set the reported stripe size to the least common multiple of that number and the actual stripe or sector size. This is what my bsdinstall patch does. However, I think that pushing this down to a layer where it will affect all applications is a terrible idea, because we have no way of knowing what will break[*], and it can seriously mislead users and hinder troubleshooting - especially if it is enabled by default rather than only when necessary. I don't think it's a good idea to enforce stripe alignment everywhere, either. It works for partitions because they are very large relative to the stripe size, and at worst we will waste a few millionths of the disk on inter-partition gaps, which should only occur between the partition table and the boot partition, and possibly, if the stripe size is very large, between the boot partition and the swap partition. But forcing filesystems to respect the stripe size will lead to no end of trouble, because RAID volumes can have stripe sizes of 16 kB or more. I think it is important to align partitions during installation because of the huge performance impact of misaligned partitions on AF disks, but despite what Nathan claims, I never advocated applying the same logic everywhere. [*] Apart from audio CDs. We already know that it will break those. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-all@freebsd.org Fri Aug 19 07:05:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 239AFBBFB04; Fri, 19 Aug 2016 07:05:36 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDA8517D1; Fri, 19 Aug 2016 07:05:35 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J75Z5E084835; Fri, 19 Aug 2016 07:05:35 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J75Z0w084834; Fri, 19 Aug 2016 07:05:35 GMT (envelope-from des@FreeBSD.org) Message-Id: <201608190705.u7J75Z0w084834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 19 Aug 2016 07:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304448 - stable/11/usr.sbin/bsdinstall/partedit X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 07:05:36 -0000 Author: des Date: Fri Aug 19 07:05:34 2016 New Revision: 304448 URL: https://svnweb.freebsd.org/changeset/base/304448 Log: MFH (r304142): ensure stripe size is non-zero multiple of 4096 PR: 211361 Modified: stable/11/usr.sbin/bsdinstall/partedit/gpart_ops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- stable/11/usr.sbin/bsdinstall/partedit/gpart_ops.c Fri Aug 19 05:43:28 2016 (r304447) +++ stable/11/usr.sbin/bsdinstall/partedit/gpart_ops.c Fri Aug 19 07:05:34 2016 (r304448) @@ -795,6 +795,7 @@ gpart_max_free(struct ggeom *geom, intma { struct gconfig *gc; struct gprovider *pp, **providers; + intmax_t sectorsize, stripesize, offset; intmax_t lastend; intmax_t start, end; intmax_t maxsize, maxstart; @@ -845,12 +846,25 @@ gpart_max_free(struct ggeom *geom, intma pp = LIST_FIRST(&geom->lg_consumer)->lg_provider; - /* Compute beginning of new partition and maximum available space */ - if (pp->lg_stripesize > 0 && - (maxstart*pp->lg_sectorsize % pp->lg_stripesize) != 0) { - intmax_t offset = (pp->lg_stripesize - - ((maxstart*pp->lg_sectorsize) % pp->lg_stripesize)) / - pp->lg_sectorsize; + /* + * Round the start and size of the largest available space up to + * the nearest multiple of the adjusted stripe size. + * + * The adjusted stripe size is the least common multiple of the + * actual stripe size, or the sector size if no stripe size was + * reported, and 4096. The reason for this is that contemporary + * disks often have 4096-byte physical sectors but report 512 + * bytes instead for compatibility with older / broken operating + * systems and BIOSes. For the same reasons, virtualized storage + * may also report a 512-byte stripe size, or none at all. + */ + sectorsize = pp->lg_sectorsize; + if ((stripesize = pp->lg_stripesize) == 0) + stripesize = sectorsize; + while (stripesize % 4096 != 0) + stripesize *= 2; + if ((offset = maxstart * sectorsize % stripesize) != 0) { + offset = (stripesize - offset) / sectorsize; maxstart += offset; maxsize -= offset; } From owner-svn-src-all@freebsd.org Fri Aug 19 07:40:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C7EFBBF080; Fri, 19 Aug 2016 07:40:03 +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-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAF0516F1; Fri, 19 Aug 2016 07:40:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7J7dti7018946 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 19 Aug 2016 10:39:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7J7dti7018946 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7J7dt9G018945; Fri, 19 Aug 2016 10:39:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 19 Aug 2016 10:39:55 +0300 From: Konstantin Belousov To: Warner Losh Cc: Julian Elischer , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd Message-ID: <20160819073955.GC83214@kib.kiev.ua> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 07:40:03 -0000 On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: > On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer wrote: > > On 16/08/2016 4:54 AM, John Baldwin wrote: > >> > >> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: > >>> > >>> Author: jhb > >>> Date: Mon Aug 15 20:38:02 2016 > >>> New Revision: 304187 > >>> URL: https://svnweb.freebsd.org/changeset/base/304187 > >>> > >>> Log: > >>> Remove the mcd(4) driver for Mitsumi CD-ROM players. > >>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in > >>> the manpage, this driver is only useful as a backend to cdcontrol to > >>> play audio CDs since it doesn't use DMA, so its data performance is > >>> "abysmal" (and that was true in the mid 90's). > >> > >> No one stepped up to test patches for it either when I last posted patches > >> to > >> convert it from timeout(9) to callout(9). I have a few more drivers that > >> are > >> both very old and that people have no business using in 12 (think ISA > >> adapters that don't do DMA and can't be used with pccard) that I will be > >> removing over the next little while. I brought up a list of drivers on > >> arch@ > >> a couple of years ago and the conversation drifted off into the weeds > >> about > >> trimming GENERIC, etc. No one objected to the specific drivers I listed > >> though (and I got a few pleas of "please remove"). If someone shows up > >> desperately clutching an ISA adapter they can always dig up the source > >> from > >> svn and deal with forward porting it for whatever API changes have > >> happened > >> since it was removed. > > > > > > I would imagine any machine still holding one of these probably has not > > enough memory to run FreeBSD. > > > > would we still run in 2MB? > > With insane levels of tuning, we can run in 32MB userland that can do > things. Even 64MB is tight w/o some tuning. 16MB is almost certainly > right out except for very specialized situations. 2MB? We can't even > load the loader in that :(. Oh, and all these memory configs are only > possible if you tweak the loader's block cache... > 32MB is quite usable. Without any tuning, you get slightly less than 10MB for userspace, which is enough to for many things, and plenty if swap is added. Note that you cannot boot on such configurations since loader was broken, but if you do manage to jump to kernel, things were fine several months ago. I tested my relatively recent OOM changes on 32MB qemu config. > Warner From owner-svn-src-all@freebsd.org Fri Aug 19 07:48:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7F56BBF2B1; Fri, 19 Aug 2016 07:48:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96C901BAE; Fri, 19 Aug 2016 07:48:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J7mWf9099293; Fri, 19 Aug 2016 07:48:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J7mWeZ099292; Fri, 19 Aug 2016 07:48:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608190748.u7J7mWeZ099292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Aug 2016 07:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304449 - stable/11/usr.bin/kdump X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 07:48:34 -0000 Author: kib Date: Fri Aug 19 07:48:32 2016 New Revision: 304449 URL: https://svnweb.freebsd.org/changeset/base/304449 Log: MFC r303990: Remove unused prototypes. Modified: stable/11/usr.bin/kdump/kdump.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/kdump/kdump.c ============================================================================== --- stable/11/usr.bin/kdump/kdump.c Fri Aug 19 07:05:34 2016 (r304448) +++ stable/11/usr.bin/kdump/kdump.c Fri Aug 19 07:48:32 2016 (r304449) @@ -105,8 +105,6 @@ void ktrgenio(struct ktr_genio *, int); void ktrpsig(struct ktr_psig *); void ktrcsw(struct ktr_csw *); void ktrcsw_old(struct ktr_csw_old *); -void ktruser_malloc(void *); -void ktruser_rtld(int, void *); void ktruser(int, void *); void ktrcaprights(cap_rights_t *); void ktritimerval(struct itimerval *it); From owner-svn-src-all@freebsd.org Fri Aug 19 07:56:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E1F5BBF45C; Fri, 19 Aug 2016 07:56:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFFF61F5A; Fri, 19 Aug 2016 07:56:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J7u8TG003060; Fri, 19 Aug 2016 07:56:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J7u8ia003059; Fri, 19 Aug 2016 07:56:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608190756.u7J7u8ia003059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Aug 2016 07:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304450 - stable/11/lib/libsysdecode X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 07:56:09 -0000 Author: kib Date: Fri Aug 19 07:56:07 2016 New Revision: 304450 URL: https://svnweb.freebsd.org/changeset/base/304450 Log: MFC r303991: Decode 32bit utrace records on the 64bit host. Modified: stable/11/lib/libsysdecode/utrace.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libsysdecode/utrace.c ============================================================================== --- stable/11/lib/libsysdecode/utrace.c Fri Aug 19 07:48:32 2016 (r304449) +++ stable/11/lib/libsysdecode/utrace.c Fri Aug 19 07:56:07 2016 (r304450) @@ -33,7 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include #include #define UTRACE_DLOPEN_START 1 @@ -59,6 +59,18 @@ struct utrace_rtld { char name[MAXPATHLEN]; }; +#ifdef __LP64__ +struct utrace_rtld32 { + char sig[4]; /* 'RTLD' */ + int event; + uint32_t handle; + uint32_t mapbase; + uint32_t mapsize; + int refcnt; + char name[MAXPATHLEN]; +}; +#endif + static int print_utrace_rtld(FILE *fp, void *p) { @@ -145,6 +157,14 @@ struct utrace_malloc { void *r; }; +#ifdef __LP64__ +struct utrace_malloc32 { + uint32_t p; + uint32_t s; + uint32_t r; +}; +#endif + static void print_utrace_malloc(FILE *fp, void *p) { @@ -163,6 +183,12 @@ print_utrace_malloc(FILE *fp, void *p) int sysdecode_utrace(FILE *fp, void *p, size_t len) { +#ifdef __LP64__ + struct utrace_rtld ur; + struct utrace_rtld32 *pr; + struct utrace_malloc um; + struct utrace_malloc32 *pm; +#endif if (len == sizeof(struct utrace_rtld) && bcmp(p, "RTLD", 4) == 0) { return (print_utrace_rtld(fp, p)); @@ -172,6 +198,32 @@ sysdecode_utrace(FILE *fp, void *p, size print_utrace_malloc(fp, p); return (1); } - + +#ifdef __LP64__ + if (len == sizeof(struct utrace_rtld32) && bcmp(p, "RTLD", 4) == 0) { + pr = p; + memset(&ur, 0, sizeof(ur)); + memcpy(ur.sig, pr->sig, sizeof(ur.sig)); + ur.event = pr->event; + ur.handle = (void *)(uintptr_t)pr->handle; + ur.mapbase = (void *)(uintptr_t)pr->mapbase; + ur.mapsize = pr->mapsize; + ur.refcnt = pr->refcnt; + memcpy(ur.name, pr->name, sizeof(ur.name)); + return (print_utrace_rtld(fp, &ur)); + } + + if (len == sizeof(struct utrace_malloc32)) { + pm = p; + memset(&um, 0, sizeof(um)); + um.p = pm->p == (uint32_t)-1 ? (void *)(intptr_t)-1 : + (void *)(uintptr_t)pm->p; + um.s = pm->s; + um.r = (void *)(uintptr_t)pm->r; + print_utrace_malloc(fp, &um); + return (1); + } +#endif + return (0); } From owner-svn-src-all@freebsd.org Fri Aug 19 07:57:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70604BBF51D; Fri, 19 Aug 2016 07:57:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2655512C8; Fri, 19 Aug 2016 07:57:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J7vhN9003160; Fri, 19 Aug 2016 07:57:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J7vheO003159; Fri, 19 Aug 2016 07:57:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608190757.u7J7vheO003159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Aug 2016 07:57:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304451 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 07:57:44 -0000 Author: kib Date: Fri Aug 19 07:57:43 2016 New Revision: 304451 URL: https://svnweb.freebsd.org/changeset/base/304451 Log: MFC r304011: Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf. Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Fri Aug 19 07:56:07 2016 (r304450) +++ stable/11/libexec/rtld-elf/rtld.c Fri Aug 19 07:57:43 2016 (r304451) @@ -2164,8 +2164,7 @@ load_needed_objects(Obj_Entry *first, in { Obj_Entry *obj; - obj = first; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (obj = first; obj != NULL; obj = TAILQ_NEXT(obj, next)) { if (obj->marker) continue; if (process_needed(obj, obj->needed, flags) == -1) @@ -2769,9 +2768,8 @@ relocate_objects(Obj_Entry *first, bool Obj_Entry *obj; int error; - error = 0; - obj = first; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (error = 0, obj = first; obj != NULL; + obj = TAILQ_NEXT(obj, next)) { if (obj->marker) continue; error = relocate_object(obj, bind_now, rtldobj, flags, @@ -2811,8 +2809,7 @@ resolve_objects_ifunc(Obj_Entry *first, { Obj_Entry *obj; - obj = first; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (obj = first; obj != NULL; obj = TAILQ_NEXT(obj, next)) { if (obj->marker) continue; if (resolve_object_ifunc(obj, bind_now, flags, lockstate) == -1) @@ -4316,7 +4313,7 @@ trace_loaded_objects(Obj_Entry *obj) list_containers = getenv(_LD("TRACE_LOADED_OBJECTS_ALL")); - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (; obj != NULL; obj = TAILQ_NEXT(obj, next)) { Needed_Entry *needed; char *name, *path; bool is_lib; @@ -4661,8 +4658,7 @@ allocate_tls(Obj_Entry *objs, void *oldt */ free_tls(oldtls, 2*sizeof(Elf_Addr), sizeof(Elf_Addr)); } else { - obj = objs; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (obj = objs; obj != NULL; obj = TAILQ_NEXT(obj, next)) { if (obj->marker || obj->tlsoffset == 0) continue; addr = segbase - obj->tlsoffset; From owner-svn-src-all@freebsd.org Fri Aug 19 07:59:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CBEDBBF57E; Fri, 19 Aug 2016 07:59:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EE9B145D; Fri, 19 Aug 2016 07:59:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J7x09e003259; Fri, 19 Aug 2016 07:59:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J7x0pq003258; Fri, 19 Aug 2016 07:59:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608190759.u7J7x0pq003258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Aug 2016 07:59:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304452 - stable/11/libexec/rtld-elf X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 07:59:01 -0000 Author: kib Date: Fri Aug 19 07:59:00 2016 New Revision: 304452 URL: https://svnweb.freebsd.org/changeset/base/304452 Log: MFC r304012: Fill phdr and phsize for rtld object. Modified: stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Fri Aug 19 07:57:43 2016 (r304451) +++ stable/11/libexec/rtld-elf/rtld.c Fri Aug 19 07:59:00 2016 (r304452) @@ -1916,6 +1916,7 @@ static void init_rtld(caddr_t mapbase, Elf_Auxinfo **aux_info) { Obj_Entry objtmp; /* Temporary rtld object */ + const Elf_Ehdr *ehdr; const Elf_Dyn *dyn_rpath; const Elf_Dyn *dyn_soname; const Elf_Dyn *dyn_runpath; @@ -1954,6 +1955,9 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * relocate_objects(&objtmp, true, &objtmp, 0, NULL); } + ehdr = (Elf_Ehdr *)mapbase; + objtmp.phdr = (Elf_Phdr *)((char *)mapbase + ehdr->e_phoff); + objtmp.phsize = ehdr->e_phnum * sizeof(objtmp.phdr[0]); /* Initialize the object list. */ TAILQ_INIT(&obj_list); From owner-svn-src-all@freebsd.org Fri Aug 19 08:00:49 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D22A5BBF83F; Fri, 19 Aug 2016 08:00:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA6B117A6; Fri, 19 Aug 2016 08:00:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J80m3V003417; Fri, 19 Aug 2016 08:00:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J80mWN003413; Fri, 19 Aug 2016 08:00:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608190800.u7J80mWN003413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Aug 2016 08:00:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304453 - in stable/11: lib/libsysdecode libexec/rtld-elf X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 08:00:49 -0000 Author: kib Date: Fri Aug 19 08:00:48 2016 New Revision: 304453 URL: https://svnweb.freebsd.org/changeset/base/304453 Log: MFC r304016: Move defines common between rtld and libsysdecode into the header. Added: stable/11/libexec/rtld-elf/rtld_utrace.h - copied unchanged from r304016, head/libexec/rtld-elf/rtld_utrace.h Modified: stable/11/lib/libsysdecode/Makefile stable/11/lib/libsysdecode/utrace.c stable/11/libexec/rtld-elf/rtld.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libsysdecode/Makefile ============================================================================== --- stable/11/lib/libsysdecode/Makefile Fri Aug 19 07:59:00 2016 (r304452) +++ stable/11/lib/libsysdecode/Makefile Fri Aug 19 08:00:48 2016 (r304453) @@ -9,6 +9,7 @@ SRCS= errno.c ioctl.c syscallnames.c utr INCS= sysdecode.h CFLAGS+= -I${.CURDIR}/../../sys +CFLAGS+= -I${.CURDIR}/../../libexec/rtld-elf MAN+= sysdecode.3 \ sysdecode_abi_to_freebsd_errno.3 \ Modified: stable/11/lib/libsysdecode/utrace.c ============================================================================== --- stable/11/lib/libsysdecode/utrace.c Fri Aug 19 07:59:00 2016 (r304452) +++ stable/11/lib/libsysdecode/utrace.c Fri Aug 19 08:00:48 2016 (r304453) @@ -35,33 +35,11 @@ __FBSDID("$FreeBSD$"); #include #include #include - -#define UTRACE_DLOPEN_START 1 -#define UTRACE_DLOPEN_STOP 2 -#define UTRACE_DLCLOSE_START 3 -#define UTRACE_DLCLOSE_STOP 4 -#define UTRACE_LOAD_OBJECT 5 -#define UTRACE_UNLOAD_OBJECT 6 -#define UTRACE_ADD_RUNDEP 7 -#define UTRACE_PRELOAD_FINISHED 8 -#define UTRACE_INIT_CALL 9 -#define UTRACE_FINI_CALL 10 -#define UTRACE_DLSYM_START 11 -#define UTRACE_DLSYM_STOP 12 - -struct utrace_rtld { - char sig[4]; /* 'RTLD' */ - int event; - void *handle; - void *mapbase; - size_t mapsize; - int refcnt; - char name[MAXPATHLEN]; -}; +#include "rtld_utrace.h" #ifdef __LP64__ struct utrace_rtld32 { - char sig[4]; /* 'RTLD' */ + char sig[4]; int event; uint32_t handle; uint32_t mapbase; @@ -189,10 +167,11 @@ sysdecode_utrace(FILE *fp, void *p, size struct utrace_malloc um; struct utrace_malloc32 *pm; #endif + static const char rtld_utrace_sig[RTLD_UTRACE_SIG_SZ] = RTLD_UTRACE_SIG; - if (len == sizeof(struct utrace_rtld) && bcmp(p, "RTLD", 4) == 0) { + if (len == sizeof(struct utrace_rtld) && bcmp(p, rtld_utrace_sig, + sizeof(rtld_utrace_sig)) == 0) return (print_utrace_rtld(fp, p)); - } if (len == sizeof(struct utrace_malloc)) { print_utrace_malloc(fp, p); @@ -200,7 +179,8 @@ sysdecode_utrace(FILE *fp, void *p, size } #ifdef __LP64__ - if (len == sizeof(struct utrace_rtld32) && bcmp(p, "RTLD", 4) == 0) { + if (len == sizeof(struct utrace_rtld32) && bcmp(p, rtld_utrace_sig, + sizeof(rtld_utrace_sig)) == 0) { pr = p; memset(&ur, 0, sizeof(ur)); memcpy(ur.sig, pr->sig, sizeof(ur.sig)); Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Fri Aug 19 07:59:00 2016 (r304452) +++ stable/11/libexec/rtld-elf/rtld.c Fri Aug 19 08:00:48 2016 (r304453) @@ -59,6 +59,7 @@ #include "paths.h" #include "rtld_tls.h" #include "rtld_printf.h" +#include "rtld_utrace.h" #include "notes.h" /* Types. */ @@ -273,29 +274,6 @@ char *ld_env_prefix = LD_; (dlp)->num_alloc = obj_count, \ (dlp)->num_used = 0) -#define UTRACE_DLOPEN_START 1 -#define UTRACE_DLOPEN_STOP 2 -#define UTRACE_DLCLOSE_START 3 -#define UTRACE_DLCLOSE_STOP 4 -#define UTRACE_LOAD_OBJECT 5 -#define UTRACE_UNLOAD_OBJECT 6 -#define UTRACE_ADD_RUNDEP 7 -#define UTRACE_PRELOAD_FINISHED 8 -#define UTRACE_INIT_CALL 9 -#define UTRACE_FINI_CALL 10 -#define UTRACE_DLSYM_START 11 -#define UTRACE_DLSYM_STOP 12 - -struct utrace_rtld { - char sig[4]; /* 'RTLD' */ - int event; - void *handle; - void *mapbase; /* Used for 'parent' and 'init/fini' */ - size_t mapsize; - int refcnt; /* Used for 'mode' */ - char name[MAXPATHLEN]; -}; - #define LD_UTRACE(e, h, mb, ms, r, n) do { \ if (ld_utrace != NULL) \ ld_utrace_log(e, h, mb, ms, r, n); \ @@ -306,11 +284,9 @@ ld_utrace_log(int event, void *handle, v int refcnt, const char *name) { struct utrace_rtld ut; + static const char rtld_utrace_sig[RTLD_UTRACE_SIG_SZ] = RTLD_UTRACE_SIG; - ut.sig[0] = 'R'; - ut.sig[1] = 'T'; - ut.sig[2] = 'L'; - ut.sig[3] = 'D'; + memcpy(ut.sig, rtld_utrace_sig, sizeof(ut.sig)); ut.event = event; ut.handle = handle; ut.mapbase = mapbase; Copied: stable/11/libexec/rtld-elf/rtld_utrace.h (from r304016, head/libexec/rtld-elf/rtld_utrace.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/libexec/rtld-elf/rtld_utrace.h Fri Aug 19 08:00:48 2016 (r304453, copy of r304016, head/libexec/rtld-elf/rtld_utrace.h) @@ -0,0 +1,62 @@ +/*- + * Copyright (c) 2007 John Baldwin + * + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef RTLD_UTRACE_H +#define RTLD_UTRACE_H + +#include + +#define UTRACE_DLOPEN_START 1 +#define UTRACE_DLOPEN_STOP 2 +#define UTRACE_DLCLOSE_START 3 +#define UTRACE_DLCLOSE_STOP 4 +#define UTRACE_LOAD_OBJECT 5 +#define UTRACE_UNLOAD_OBJECT 6 +#define UTRACE_ADD_RUNDEP 7 +#define UTRACE_PRELOAD_FINISHED 8 +#define UTRACE_INIT_CALL 9 +#define UTRACE_FINI_CALL 10 +#define UTRACE_DLSYM_START 11 +#define UTRACE_DLSYM_STOP 12 + +#define RTLD_UTRACE_SIG_SZ 4 +#define RTLD_UTRACE_SIG "RTLD" + +struct utrace_rtld { + char sig[RTLD_UTRACE_SIG_SZ]; + int event; + void *handle; + void *mapbase; /* Used for 'parent' and 'init/fini' */ + size_t mapsize; + int refcnt; /* Used for 'mode' */ + char name[MAXPATHLEN]; +}; + +#endif From owner-svn-src-all@freebsd.org Fri Aug 19 08:05:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9656CBBFA07; Fri, 19 Aug 2016 08:05:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D2C51AA3; Fri, 19 Aug 2016 08:05:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J858Ae006838; Fri, 19 Aug 2016 08:05:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J858Vo006837; Fri, 19 Aug 2016 08:05:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608190805.u7J858Vo006837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Aug 2016 08:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304454 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 08:05:10 -0000 Author: kib Date: Fri Aug 19 08:05:08 2016 New Revision: 304454 URL: https://svnweb.freebsd.org/changeset/base/304454 Log: MFC r304011: Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf. Modified: stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Fri Aug 19 08:00:48 2016 (r304453) +++ stable/10/libexec/rtld-elf/rtld.c Fri Aug 19 08:05:08 2016 (r304454) @@ -2120,8 +2120,7 @@ load_needed_objects(Obj_Entry *first, in { Obj_Entry *obj; - obj = first; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (obj = first; obj != NULL; obj = TAILQ_NEXT(obj, next)) { if (obj->marker) continue; if (process_needed(obj, obj->needed, flags) == -1) @@ -2720,9 +2719,8 @@ relocate_objects(Obj_Entry *first, bool Obj_Entry *obj; int error; - error = 0; - obj = first; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (error = 0, obj = first; obj != NULL; + obj = TAILQ_NEXT(obj, next)) { if (obj->marker) continue; error = relocate_object(obj, bind_now, rtldobj, flags, @@ -2762,8 +2760,7 @@ resolve_objects_ifunc(Obj_Entry *first, { Obj_Entry *obj; - obj = first; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (obj = first; obj != NULL; obj = TAILQ_NEXT(obj, next)) { if (obj->marker) continue; if (resolve_object_ifunc(obj, bind_now, flags, lockstate) == -1) @@ -4213,7 +4210,7 @@ trace_loaded_objects(Obj_Entry *obj) list_containers = getenv(LD_ "TRACE_LOADED_OBJECTS_ALL"); - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (; obj != NULL; obj = TAILQ_NEXT(obj, next)) { Needed_Entry *needed; char *name, *path; bool is_lib; @@ -4557,8 +4554,7 @@ allocate_tls(Obj_Entry *objs, void *oldt */ free_tls(oldtls, 2*sizeof(Elf_Addr), sizeof(Elf_Addr)); } else { - obj = objs; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (obj = objs; obj != NULL; obj = TAILQ_NEXT(obj, next)) { if (obj->marker || obj->tlsoffset == 0) continue; addr = segbase - obj->tlsoffset; From owner-svn-src-all@freebsd.org Fri Aug 19 08:07:05 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68868BBFA74; Fri, 19 Aug 2016 08:07:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38DAF1C7E; Fri, 19 Aug 2016 08:07:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J874YH006953; Fri, 19 Aug 2016 08:07:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J874u0006952; Fri, 19 Aug 2016 08:07:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608190807.u7J874u0006952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Aug 2016 08:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304455 - stable/10/libexec/rtld-elf X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 08:07:05 -0000 Author: kib Date: Fri Aug 19 08:07:04 2016 New Revision: 304455 URL: https://svnweb.freebsd.org/changeset/base/304455 Log: MFC r304012: Fill phdr and phsize for rtld object. Modified: stable/10/libexec/rtld-elf/rtld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/rtld-elf/rtld.c ============================================================================== --- stable/10/libexec/rtld-elf/rtld.c Fri Aug 19 08:05:08 2016 (r304454) +++ stable/10/libexec/rtld-elf/rtld.c Fri Aug 19 08:07:04 2016 (r304455) @@ -1872,6 +1872,7 @@ static void init_rtld(caddr_t mapbase, Elf_Auxinfo **aux_info) { Obj_Entry objtmp; /* Temporary rtld object */ + const Elf_Ehdr *ehdr; const Elf_Dyn *dyn_rpath; const Elf_Dyn *dyn_soname; const Elf_Dyn *dyn_runpath; @@ -1910,6 +1911,9 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * relocate_objects(&objtmp, true, &objtmp, 0, NULL); } + ehdr = (Elf_Ehdr *)mapbase; + objtmp.phdr = (Elf_Phdr *)((char *)mapbase + ehdr->e_phoff); + objtmp.phsize = ehdr->e_phnum * sizeof(objtmp.phdr[0]); /* Initialize the object list. */ TAILQ_INIT(&obj_list); From owner-svn-src-all@freebsd.org Fri Aug 19 08:44:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76386BBE4D9; Fri, 19 Aug 2016 08:44:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37DF0124B; Fri, 19 Aug 2016 08:44:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J8ibwl021522; Fri, 19 Aug 2016 08:44:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J8ib6s021521; Fri, 19 Aug 2016 08:44:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608190844.u7J8ib6s021521@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 19 Aug 2016 08:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304456 - releng/11.0/libexec/rtld-elf X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 08:44:38 -0000 Author: kib Date: Fri Aug 19 08:44:37 2016 New Revision: 304456 URL: https://svnweb.freebsd.org/changeset/base/304456 Log: MFC r304011: Remove all remaining uses of TAILQ_FOREACH_FROM() from rtld-elf. MFC r304012: Fill phdr and phsize for rtld object. Approved by: re (gjb) Modified: releng/11.0/libexec/rtld-elf/rtld.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/libexec/rtld-elf/rtld.c ============================================================================== --- releng/11.0/libexec/rtld-elf/rtld.c Fri Aug 19 08:07:04 2016 (r304455) +++ releng/11.0/libexec/rtld-elf/rtld.c Fri Aug 19 08:44:37 2016 (r304456) @@ -1916,6 +1916,7 @@ static void init_rtld(caddr_t mapbase, Elf_Auxinfo **aux_info) { Obj_Entry objtmp; /* Temporary rtld object */ + const Elf_Ehdr *ehdr; const Elf_Dyn *dyn_rpath; const Elf_Dyn *dyn_soname; const Elf_Dyn *dyn_runpath; @@ -1954,6 +1955,9 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * relocate_objects(&objtmp, true, &objtmp, 0, NULL); } + ehdr = (Elf_Ehdr *)mapbase; + objtmp.phdr = (Elf_Phdr *)((char *)mapbase + ehdr->e_phoff); + objtmp.phsize = ehdr->e_phnum * sizeof(objtmp.phdr[0]); /* Initialize the object list. */ TAILQ_INIT(&obj_list); @@ -2164,8 +2168,7 @@ load_needed_objects(Obj_Entry *first, in { Obj_Entry *obj; - obj = first; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (obj = first; obj != NULL; obj = TAILQ_NEXT(obj, next)) { if (obj->marker) continue; if (process_needed(obj, obj->needed, flags) == -1) @@ -2769,9 +2772,8 @@ relocate_objects(Obj_Entry *first, bool Obj_Entry *obj; int error; - error = 0; - obj = first; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (error = 0, obj = first; obj != NULL; + obj = TAILQ_NEXT(obj, next)) { if (obj->marker) continue; error = relocate_object(obj, bind_now, rtldobj, flags, @@ -2811,8 +2813,7 @@ resolve_objects_ifunc(Obj_Entry *first, { Obj_Entry *obj; - obj = first; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (obj = first; obj != NULL; obj = TAILQ_NEXT(obj, next)) { if (obj->marker) continue; if (resolve_object_ifunc(obj, bind_now, flags, lockstate) == -1) @@ -4316,7 +4317,7 @@ trace_loaded_objects(Obj_Entry *obj) list_containers = getenv(_LD("TRACE_LOADED_OBJECTS_ALL")); - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (; obj != NULL; obj = TAILQ_NEXT(obj, next)) { Needed_Entry *needed; char *name, *path; bool is_lib; @@ -4661,8 +4662,7 @@ allocate_tls(Obj_Entry *objs, void *oldt */ free_tls(oldtls, 2*sizeof(Elf_Addr), sizeof(Elf_Addr)); } else { - obj = objs; - TAILQ_FOREACH_FROM(obj, &obj_list, next) { + for (obj = objs; obj != NULL; obj = TAILQ_NEXT(obj, next)) { if (obj->marker || obj->tlsoffset == 0) continue; addr = segbase - obj->tlsoffset; From owner-svn-src-all@freebsd.org Fri Aug 19 08:46:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 891ECBBE6BC; Fri, 19 Aug 2016 08:46:20 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53A1816D7; Fri, 19 Aug 2016 08:46:20 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 463F91FE023; Fri, 19 Aug 2016 10:46:18 +0200 (CEST) Subject: Re: svn commit: r304439 - head/sys/dev/usb/net To: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608190050.u7J0oWkW043171@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> Date: Fri, 19 Aug 2016 10:50:47 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201608190050.u7J0oWkW043171@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 08:46:20 -0000 On 08/19/16 02:50, Pyun YongHyeon wrote: > Modified: head/sys/dev/usb/net/if_axgereg.h > ============================================================================== > --- head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:03:41 2016 (r304438) > +++ head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:50:32 2016 (r304439) > @@ -156,19 +156,20 @@ enum { > struct axge_frame_txhdr { > #if BYTE_ORDER == LITTLE_ENDIAN > uint32_t len; > -#define AXGE_TXLEN_MASK 0x0001FFFF > -#define AXGE_VLAN_INSERT 0x20000000 > -#define AXGE_CSUM_DISABLE 0x80000000 > uint32_t mss; > -#define AXGE_MSS_MASK 0x00003FFF > -#define AXGE_PADDING 0x80008000 > -#define AXGE_VLAN_TAG_MASK 0xFFFF0000 > #else > uint32_t mss; > uint32_t len; > #endif > } __packed; > Hi, Is it correct to switch the order of mss and len variables for bit/little endian? Looks buggy to me. --HPS From owner-svn-src-all@freebsd.org Fri Aug 19 08:48:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB653BBE733; Fri, 19 Aug 2016 08:48:54 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-ua0-x232.google.com (mail-ua0-x232.google.com [IPv6:2607:f8b0:400c:c08::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77A0C1871; Fri, 19 Aug 2016 08:48:54 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-ua0-x232.google.com with SMTP id 74so69335284uau.0; Fri, 19 Aug 2016 01:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=XgJJBoLT8Eilx3lX4NSIJ2hCmPe08Eoi3Gcb4LrUeMo=; b=QwqFQ/4cIdyq6h9C14Jrt0QB3knr+g/2Yrx9RTx2KF3TRUkHWpfh2ZQ6hFvOgmxO3t Z+AuULDmilgYvVrFVkpp1iG4fQfwnzbhlEM/Tw+nuU6aS/eLGfe+OvTDqUMZufp9V6HT 7DeLLWWedJ5JLdPn5Sp0vIsAqkipJnBDYK4xqesfWvAtf02zDgIjOfpEsqmce8DDuJUV E5TcCDfdTjGyye/v5P7AhfJ1Wfed7080UqyZITcvwHe4rx0t5NFl+ynx7eHMkEL48t20 htHcHHUn9G42zmhqaPiSGBqjAKn3AP8z5hNh20Dsn51Rp8GkYGExRIcyYP8k00ZxRP3q XtRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=XgJJBoLT8Eilx3lX4NSIJ2hCmPe08Eoi3Gcb4LrUeMo=; b=gV02Kkog5HeoRkK0RjKBJN2vD0pfRrUYnHFJRJMueVSvcXZQ/QVUoccLR0lSCTPIUB 6oyliP7ZMCm4PvpdgHKA6TDPyNunPSccy00gtE4j/GMolrqiXsgvLE1axn8Lbm1p06eC hFShfkoRZhw9dthyOZcDP4kNi1kPzOatc/BbrGJfl3VEOSlJxGe+Wlp+bGLd2Py0+QLU Hb7fjQxZv7iasZzch0ctg8DgHtGPtjHjfae0RS0K5eYqMjA9kSxBDXdNSmBYOoBhTymX LedUG8LIYjiKQO1cMCST3GbcqU4kHLbntI3Gjusdmt29aeGkg9qxophYmHqnuQWVxfox eopw== X-Gm-Message-State: AEkoouu3iHkwN/z00M3I0u7stXnlLdnKvO49TcxWn/7VSFHB7BDF0pmG6qO26HvOJOkKwjYhEKzTJN2WtqRR5g== X-Received: by 10.176.0.115 with SMTP id 106mr3554940uai.43.1471596533535; Fri, 19 Aug 2016 01:48:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.176.1.54 with HTTP; Fri, 19 Aug 2016 01:48:53 -0700 (PDT) In-Reply-To: <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> References: <201608190050.u7J0oWkW043171@repo.freebsd.org> <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> From: Sepherosa Ziehau Date: Fri, 19 Aug 2016 16:48:53 +0800 Message-ID: Subject: Re: svn commit: r304439 - head/sys/dev/usb/net To: Hans Petter Selasky Cc: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 08:48:54 -0000 On Fri, Aug 19, 2016 at 4:50 PM, Hans Petter Selasky wrote: > On 08/19/16 02:50, Pyun YongHyeon wrote: >> >> Modified: head/sys/dev/usb/net/if_axgereg.h >> >> ============================================================================== >> --- head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:03:41 2016 >> (r304438) >> +++ head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:50:32 2016 >> (r304439) >> @@ -156,19 +156,20 @@ enum { >> struct axge_frame_txhdr { >> #if BYTE_ORDER == LITTLE_ENDIAN >> uint32_t len; >> -#define AXGE_TXLEN_MASK 0x0001FFFF >> -#define AXGE_VLAN_INSERT 0x20000000 >> -#define AXGE_CSUM_DISABLE 0x80000000 >> uint32_t mss; >> -#define AXGE_MSS_MASK 0x00003FFF >> -#define AXGE_PADDING 0x80008000 >> -#define AXGE_VLAN_TAG_MASK 0xFFFF0000 >> #else >> uint32_t mss; >> uint32_t len; >> #endif >> } __packed; >> > > Hi, > > Is it correct to switch the order of mss and len variables for bit/little > endian? Looks buggy to me. It probably is a 64bits field. IMHO, using a 64bits field and mask/shift-op probably will be better here. Thanks, sephe -- Tomorrow Will Never Die From owner-svn-src-all@freebsd.org Fri Aug 19 08:50:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFA39BBE876; Fri, 19 Aug 2016 08:50:45 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp004.me.com (st13p35im-asmtp004.me.com [17.164.199.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C39591ACC; Fri, 19 Aug 2016 08:50:45 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp004.me.com by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OC500H00EWOGM00@st13p35im-asmtp004.me.com>; Fri, 19 Aug 2016 08:50:39 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1471596639; bh=Qn2zRAbUldPkiw3VAJBhJSvOLsuK4ZF7r/VRJIhyp14=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=bpQv2ld4eAm/smsz3OUEU+tTMtRxJ83gl5gBN/ey78sOezV7Srq66mDWb6tb3IxO0 JXOa+Rx2WTeDS9R8jdnNGqyXh6f1sBmqLjJhi1BcUgCv3mjwo7WuPlm+m/cWoT4PDy UGmDs356ElYkijpRyd8Ylt9+EBIXW+pt0i3uuTXsLjlizNI8SL2GxezIAh7VJhC6QK X64JnvWCUeFMnjZieH9SSQH1xXkExQaEcafwDjc46Cr72+iG9Cdlo5MidtzGBsYeUX QvlJxztq3g7B1OIebA1rVxXbbWZz49ElrSAAKDeEjpaAodimDi2O9lEx3gKxGhv1aX gc5DqWg5gWtpw== Received: from [88.196.10.181] (181-10-196-88.dyn.estpak.ee [88.196.10.181]) by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OC5000O1F8BK040@st13p35im-asmtp004.me.com>; Fri, 19 Aug 2016 08:50:39 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-19_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1011 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1608190115 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd From: Toomas Soome In-reply-to: <20160819073955.GC83214@kib.kiev.ua> Date: Fri, 19 Aug 2016 11:50:35 +0300 Cc: Warner Losh , Julian Elischer , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-transfer-encoding: quoted-printable Message-id: <50AAF049-C8A7-4C69-A206-C3983FFA7867@me.com> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 08:50:46 -0000 > On 19. aug 2016, at 10:39, Konstantin Belousov = wrote: >=20 > On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: >> On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer = wrote: >>> On 16/08/2016 4:54 AM, John Baldwin wrote: >>>>=20 >>>> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >>>>>=20 >>>>> Author: jhb >>>>> Date: Mon Aug 15 20:38:02 2016 >>>>> New Revision: 304187 >>>>> URL: https://svnweb.freebsd.org/changeset/base/304187 >>>>>=20 >>>>> Log: >>>>> Remove the mcd(4) driver for Mitsumi CD-ROM players. >>>>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted = in >>>>> the manpage, this driver is only useful as a backend to cdcontrol = to >>>>> play audio CDs since it doesn't use DMA, so its data performance = is >>>>> "abysmal" (and that was true in the mid 90's). >>>>=20 >>>> No one stepped up to test patches for it either when I last posted = patches >>>> to >>>> convert it from timeout(9) to callout(9). I have a few more = drivers that >>>> are >>>> both very old and that people have no business using in 12 (think = ISA >>>> adapters that don't do DMA and can't be used with pccard) that I = will be >>>> removing over the next little while. I brought up a list of = drivers on >>>> arch@ >>>> a couple of years ago and the conversation drifted off into the = weeds >>>> about >>>> trimming GENERIC, etc. No one objected to the specific drivers I = listed >>>> though (and I got a few pleas of "please remove"). If someone = shows up >>>> desperately clutching an ISA adapter they can always dig up the = source >>>> from >>>> svn and deal with forward porting it for whatever API changes have >>>> happened >>>> since it was removed. >>>=20 >>>=20 >>> I would imagine any machine still holding one of these probably has = not >>> enough memory to run FreeBSD. >>>=20 >>> would we still run in 2MB? >>=20 >> With insane levels of tuning, we can run in 32MB userland that can do >> things. Even 64MB is tight w/o some tuning. 16MB is almost certainly >> right out except for very specialized situations. 2MB? We can't even >> load the loader in that :(. Oh, and all these memory configs are only >> possible if you tweak the loader's block cache... >>=20 >=20 > 32MB is quite usable. Without any tuning, you get slightly less than = 10MB > for userspace, which is enough to for many things, and plenty if swap = is > added. >=20 > Note that you cannot boot on such configurations since loader was = broken, > but if you do manage to jump to kernel, things were fine several = months > ago. I tested my relatively recent OOM changes on 32MB qemu config. >> Warner >=20 If the target is to go as low memory as possible, sure, you can strip = all off, from boot loader point, you should load kernel from stage2 and = not use loader at all (you can load and jump kernel even now from = stage2, assuming it wont need any special configuration from loader = config) etc etc. This means highly specialized build and has nothing to = do with generic all purpose system. Also at some point, there is an question about how reasonable it is to = have such configuration as part of generic code base for special bits = like boot loader itself, as the problem is, testing all those variants = is becoming impossible and even keeping reasonable code base in all of = the #if #else #endif spaghetti is getting quite hard and error prone. =46rom developers point of view, it is not really encouraging to have = possible feedback like =E2=80=9Coh, but you did break my 32MB system = boot=E2=80=9D ;) This does bring back some memories however. For first 2 = unix systems I was dealing with, one had 8MB and another had 12MB of = memory=E2=80=A6 it was ~ 1992-1993;) Right now the loader and stage2 are set to use 64MB heap to make it = possible to implement zfs feature support and later on, for more = features. Also note that UEFI setups are much harder to deal with regard of memory = management, because as long as BS are in control, you can not really = control the memory management there and can end up with fragmented = unusable (for kernel loading) layout. This is especially nasty as = apparently some (buggy) systems actually have runtime services using = boot services memory areas, so you can end up in setup where you can not = re-use BS memory and those chunks can be all over the low memory address = space=E2=80=A6=20 rgds, toomas= From owner-svn-src-all@freebsd.org Fri Aug 19 08:55:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09C3EBBEBF7; Fri, 19 Aug 2016 08:55:20 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pf0-x22e.google.com (mail-pf0-x22e.google.com [IPv6:2607:f8b0:400e:c00::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C88C01F6D; Fri, 19 Aug 2016 08:55:19 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by mail-pf0-x22e.google.com with SMTP id h186so7562989pfg.3; Fri, 19 Aug 2016 01:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=YfXQLXhfCrtbL9hEECbiVbiA7IuOyD4cPqW29dbz7Ko=; b=Yu9dTA5Yv5SFV4LsRGAckowTahqB2IMPbod+UCsv8Pl0qNWzY1jJ6f8mvdtU+Dcan2 eBl1/D2yY8XFJMgx53Fb8er3yTav5sLAzfwWXDKnwin1Iq5bNHoZlyrWpshszGrKdxbt Vko8Q/Y9PyZqjFZjoAZfac/EOyP81/GC2FQQu/vRWIntGbfiWaLKqIWlvvTIalCgSJMx LXIGvg6HQvS4CvKzH8Q3lJtq5+gpbhZtRCZ0iber8VXmaFWJgmqmOz5/CgVatJ/vOd7k qwvqVRLj6+XF5ArS69JVfyLpA+AgTNH/8c7M1aHnJH/w/WixRigN4KlNhUCugdC29a8y fmeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=YfXQLXhfCrtbL9hEECbiVbiA7IuOyD4cPqW29dbz7Ko=; b=O7lnY1vCa5lEPZG/ZoaezAP3jlWMit4kpTtQXSOnqELJ3bjNYOwIWFmjb5dgdvMwiz zSDQDOSVaVBmDOcBi+qI1GpbuKd1OBZ6WPjaE8nCKyK+n6vkKcDfyYR0GCJlnY39ZC3N lQEXABZN/bPSbrg6n9H/6e7kCdgWwYyS3WGv2uJLex/2jH7KuP/j5PZljFPjRXJtt4u4 5YsC0TRd6FGZ10On3UyhEqUE8mRYUuajR1TN54k1p0OgscquOFQuglPD6G2A9xVQ9ZPT el7MRHU7R4Kysa9Ch3TBWsxLMn+W1yCkw/6DB0zesUBOVxrNCAAYmxxpLNtcEQ4xOSI4 bGeQ== X-Gm-Message-State: AEkoouutN/LHwyPp7MkndgVeprwsHPX1hUpKLeJ3FEtpGrKz58vJ+UjzrWpZ0ydf6m5fRQ== X-Received: by 10.98.11.86 with SMTP id t83mr12085175pfi.51.1471596919354; Fri, 19 Aug 2016 01:55:19 -0700 (PDT) Received: from localhost ([106.247.248.2]) by smtp.gmail.com with ESMTPSA id xv9sm9514248pab.36.2016.08.19.01.55.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Aug 2016 01:55:18 -0700 (PDT) From: YongHyeon PYUN X-Google-Original-From: "YongHyeon PYUN" Received: by localhost (sSMTP sendmail emulation); Fri, 19 Aug 2016 17:55:11 +0900 Date: Fri, 19 Aug 2016 17:55:11 +0900 To: Hans Petter Selasky Cc: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304439 - head/sys/dev/usb/net Message-ID: <20160819085511.GF1186@michelle.fasterthan.co.kr> Reply-To: pyunyh@gmail.com References: <201608190050.u7J0oWkW043171@repo.freebsd.org> <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> User-Agent: Mutt/1.4.2.3i X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 08:55:20 -0000 On Fri, Aug 19, 2016 at 10:50:47AM +0200, Hans Petter Selasky wrote: > On 08/19/16 02:50, Pyun YongHyeon wrote: > >Modified: head/sys/dev/usb/net/if_axgereg.h > >============================================================================== > >--- head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:03:41 2016 (r304438) > >+++ head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 00:50:32 2016 (r304439) > >@@ -156,19 +156,20 @@ enum { > > struct axge_frame_txhdr { > > #if BYTE_ORDER == LITTLE_ENDIAN > > uint32_t len; > >-#define AXGE_TXLEN_MASK 0x0001FFFF > >-#define AXGE_VLAN_INSERT 0x20000000 > >-#define AXGE_CSUM_DISABLE 0x80000000 > > uint32_t mss; > >-#define AXGE_MSS_MASK 0x00003FFF > >-#define AXGE_PADDING 0x80008000 > >-#define AXGE_VLAN_TAG_MASK 0xFFFF0000 > > #else > > uint32_t mss; > > uint32_t len; > > #endif > > } __packed; > > > > Hi, > > Is it correct to switch the order of mss and len variables for > bit/little endian? Looks buggy to me. > I think the order is right but it was not tested on big-endian systems. From owner-svn-src-all@freebsd.org Fri Aug 19 09:07:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0590BBEFD8; Fri, 19 Aug 2016 09:07:28 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9949164F; Fri, 19 Aug 2016 09:07:28 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 037D01FE023; Fri, 19 Aug 2016 11:07:26 +0200 (CEST) Subject: Re: svn commit: r304439 - head/sys/dev/usb/net To: pyunyh@gmail.com References: <201608190050.u7J0oWkW043171@repo.freebsd.org> <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> <20160819085511.GF1186@michelle.fasterthan.co.kr> Cc: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <2e8143d4-eb32-693d-e5a4-49c380c100df@selasky.org> Date: Fri, 19 Aug 2016 11:11:56 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160819085511.GF1186@michelle.fasterthan.co.kr> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 09:07:29 -0000 On 08/19/16 10:55, YongHyeon PYUN wrote: > I think the order is right but it was not tested on big-endian > systems. Hi, I'm pretty sure the ifdef is wrong, because you write the fields one at a time, using htole32(): txhdr.mss = 0; txhdr.len = htole32(AXGE_TXBYTES(m->m_pkthdr.len)); Big endian machines don't re-order variables like this. You should remove the #else part. --HPS From owner-svn-src-all@freebsd.org Fri Aug 19 09:11:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6211BBF1EA; Fri, 19 Aug 2016 09:11:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9C64B1A59; Fri, 19 Aug 2016 09:11:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7J9BoLb032103; Fri, 19 Aug 2016 09:11:50 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7J9Boh4032102; Fri, 19 Aug 2016 09:11:50 GMT (envelope-from des@FreeBSD.org) Message-Id: <201608190911.u7J9Boh4032102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Fri, 19 Aug 2016 09:11:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304457 - releng/11.0/usr.sbin/bsdinstall/partedit X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 09:11:52 -0000 Author: des Date: Fri Aug 19 09:11:50 2016 New Revision: 304457 URL: https://svnweb.freebsd.org/changeset/base/304457 Log: MFH (r304142): ensure stripe size is non-zero multiple of 4096 PR: 211361 Approved by: re (gjb) Modified: releng/11.0/usr.sbin/bsdinstall/partedit/gpart_ops.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- releng/11.0/usr.sbin/bsdinstall/partedit/gpart_ops.c Fri Aug 19 08:44:37 2016 (r304456) +++ releng/11.0/usr.sbin/bsdinstall/partedit/gpart_ops.c Fri Aug 19 09:11:50 2016 (r304457) @@ -795,6 +795,7 @@ gpart_max_free(struct ggeom *geom, intma { struct gconfig *gc; struct gprovider *pp, **providers; + intmax_t sectorsize, stripesize, offset; intmax_t lastend; intmax_t start, end; intmax_t maxsize, maxstart; @@ -845,12 +846,25 @@ gpart_max_free(struct ggeom *geom, intma pp = LIST_FIRST(&geom->lg_consumer)->lg_provider; - /* Compute beginning of new partition and maximum available space */ - if (pp->lg_stripesize > 0 && - (maxstart*pp->lg_sectorsize % pp->lg_stripesize) != 0) { - intmax_t offset = (pp->lg_stripesize - - ((maxstart*pp->lg_sectorsize) % pp->lg_stripesize)) / - pp->lg_sectorsize; + /* + * Round the start and size of the largest available space up to + * the nearest multiple of the adjusted stripe size. + * + * The adjusted stripe size is the least common multiple of the + * actual stripe size, or the sector size if no stripe size was + * reported, and 4096. The reason for this is that contemporary + * disks often have 4096-byte physical sectors but report 512 + * bytes instead for compatibility with older / broken operating + * systems and BIOSes. For the same reasons, virtualized storage + * may also report a 512-byte stripe size, or none at all. + */ + sectorsize = pp->lg_sectorsize; + if ((stripesize = pp->lg_stripesize) == 0) + stripesize = sectorsize; + while (stripesize % 4096 != 0) + stripesize *= 2; + if ((offset = maxstart * sectorsize % stripesize) != 0) { + offset = (stripesize - offset) / sectorsize; maxstart += offset; maxsize -= offset; } From owner-svn-src-all@freebsd.org Fri Aug 19 09:22:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 645DCBBF638; Fri, 19 Aug 2016 09:22:31 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pf0-x22d.google.com (mail-pf0-x22d.google.com [IPv6:2607:f8b0:400e:c00::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 327D5131F; Fri, 19 Aug 2016 09:22:31 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by mail-pf0-x22d.google.com with SMTP id p64so7855288pfb.1; Fri, 19 Aug 2016 02:22:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0tKUFsMP5VZ1nsYqsK9YkXZpIeXOKGbKlv7vxxzCCzo=; b=E1x9GsDmXf0QPqquGOnOwbXMJKTlbuhjWQxze7GKdxeFePtsANfdxxdJQnd+IqkRvh eBe9QyorMXNwuvi79x2shrb0Lljf3wPMgvEJMiScUYOWcmU8208Dk+bKH/AdrUeffaoO d3Cc411P9XEPPepTLvEbCluuEMoCcDSN+AdKViTfK9Y1PgEjbhyS/DxPjd7fkszBmMdZ J7tkYdngg0zHH5W1ByU2FoH62tjoPxxwqt4mAWFyM1x1etJJcldj7Jj6CL4cvfi4SNnI GjgafaSJlDBTiUShsxu06C6AkOag0+r0GOEHvcfGwJ1C6/tioA3ecoOFae+XaYrNaQ1i cbNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=0tKUFsMP5VZ1nsYqsK9YkXZpIeXOKGbKlv7vxxzCCzo=; b=KKv6WRHhcUiaAkWUdpqVaR/KmX6A2HbN9fxTmS2FqzU1giTgXYXVulLsxFEzae7Lwj bWFJF9yHe/1nwvdmGO7k8vGTM4P4Gu+0zUKdF8zefJ5EgIfToAnsshxfg6RJfKY9Co5x M5vEPQWbkMh+5bWAZNTd+ym+udFTgugSCXspLOYp75uc8z5r1Ei7GlPWhdKKRc91uJUi ugkZfbvvBmtQ9H6UacqDevTPvuCV55ucMB9c1Ng25hQYUmAU8pX93x8CdQG5sTDOcT9P Nl5uVpZKk7qEpGZ15ivyYOh/6ATf/4Z0YwnTH1lBQm1eyN6PMcsq0s9tEjjc9KsYW3lq hVew== X-Gm-Message-State: AEkoousbK+tLTBptLiuhAGUT1h9i8KYoA19jqqJ8r37JbuNhYUfw/azfzNNuv4n6kYGguQ== X-Received: by 10.98.22.212 with SMTP id 203mr12477907pfw.74.1471598550845; Fri, 19 Aug 2016 02:22:30 -0700 (PDT) Received: from localhost ([106.247.248.2]) by smtp.gmail.com with ESMTPSA id y2sm9756929pan.31.2016.08.19.02.22.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Aug 2016 02:22:30 -0700 (PDT) From: YongHyeon PYUN X-Google-Original-From: "YongHyeon PYUN" Received: by localhost (sSMTP sendmail emulation); Fri, 19 Aug 2016 18:22:23 +0900 Date: Fri, 19 Aug 2016 18:22:23 +0900 To: Hans Petter Selasky Cc: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304439 - head/sys/dev/usb/net Message-ID: <20160819092223.GG1186@michelle.fasterthan.co.kr> Reply-To: pyunyh@gmail.com References: <201608190050.u7J0oWkW043171@repo.freebsd.org> <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> <20160819085511.GF1186@michelle.fasterthan.co.kr> <2e8143d4-eb32-693d-e5a4-49c380c100df@selasky.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2e8143d4-eb32-693d-e5a4-49c380c100df@selasky.org> User-Agent: Mutt/1.4.2.3i X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 09:22:31 -0000 On Fri, Aug 19, 2016 at 11:11:56AM +0200, Hans Petter Selasky wrote: > On 08/19/16 10:55, YongHyeon PYUN wrote: > >I think the order is right but it was not tested on big-endian > >systems. > > Hi, > > I'm pretty sure the ifdef is wrong, because you write the fields one at > a time, using htole32(): > > txhdr.mss = 0; > txhdr.len = htole32(AXGE_TXBYTES(m->m_pkthdr.len)); > > Big endian machines don't re-order variables like this. > > You should remove the #else part. Wouldn't USB stack pass txhdr structure without any modification? And controller want to see len (low 32bits address) first and then mss (high 32bits address). On big endian systems I guess this should be reversed in host memory layout. This is so confusing so I could be wrong. From owner-svn-src-all@freebsd.org Fri Aug 19 09:24:30 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C3DFBBF76F; Fri, 19 Aug 2016 09:24:30 +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-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BCC51606; Fri, 19 Aug 2016 09:24:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7J9OOr7050606 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 19 Aug 2016 12:24:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7J9OOr7050606 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7J9OOur050605; Fri, 19 Aug 2016 12:24:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 19 Aug 2016 12:24:24 +0300 From: Konstantin Belousov To: Toomas Soome Cc: Warner Losh , Julian Elischer , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd Message-ID: <20160819092424.GE83214@kib.kiev.ua> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> <50AAF049-C8A7-4C69-A206-C3983FFA7867@me.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50AAF049-C8A7-4C69-A206-C3983FFA7867@me.com> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 09:24:30 -0000 On Fri, Aug 19, 2016 at 11:50:35AM +0300, Toomas Soome wrote: > > > On 19. aug 2016, at 10:39, Konstantin Belousov wrote: > > > > On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: > >> On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer wrote: > >>> On 16/08/2016 4:54 AM, John Baldwin wrote: > >>>> > >>>> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: > >>>>> > >>>>> Author: jhb > >>>>> Date: Mon Aug 15 20:38:02 2016 > >>>>> New Revision: 304187 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/304187 > >>>>> > >>>>> Log: > >>>>> Remove the mcd(4) driver for Mitsumi CD-ROM players. > >>>>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in > >>>>> the manpage, this driver is only useful as a backend to cdcontrol to > >>>>> play audio CDs since it doesn't use DMA, so its data performance is > >>>>> "abysmal" (and that was true in the mid 90's). > >>>> > >>>> No one stepped up to test patches for it either when I last posted patches > >>>> to > >>>> convert it from timeout(9) to callout(9). I have a few more drivers that > >>>> are > >>>> both very old and that people have no business using in 12 (think ISA > >>>> adapters that don't do DMA and can't be used with pccard) that I will be > >>>> removing over the next little while. I brought up a list of drivers on > >>>> arch@ > >>>> a couple of years ago and the conversation drifted off into the weeds > >>>> about > >>>> trimming GENERIC, etc. No one objected to the specific drivers I listed > >>>> though (and I got a few pleas of "please remove"). If someone shows up > >>>> desperately clutching an ISA adapter they can always dig up the source > >>>> from > >>>> svn and deal with forward porting it for whatever API changes have > >>>> happened > >>>> since it was removed. > >>> > >>> > >>> I would imagine any machine still holding one of these probably has not > >>> enough memory to run FreeBSD. > >>> > >>> would we still run in 2MB? > >> > >> With insane levels of tuning, we can run in 32MB userland that can do > >> things. Even 64MB is tight w/o some tuning. 16MB is almost certainly > >> right out except for very specialized situations. 2MB? We can't even > >> load the loader in that :(. Oh, and all these memory configs are only > >> possible if you tweak the loader's block cache... > >> > > > > 32MB is quite usable. Without any tuning, you get slightly less than 10MB > > for userspace, which is enough to for many things, and plenty if swap is > > added. > > > > Note that you cannot boot on such configurations since loader was broken, > > but if you do manage to jump to kernel, things were fine several months > > ago. I tested my relatively recent OOM changes on 32MB qemu config. > >> Warner > > > > If the target is to go as low memory as possible, sure, you can strip all off, from boot loader point, you should load kernel from stage2 and not use loader at all (you can load and jump kernel even now from stage2, assuming it wont need any special configuration from loader config) etc etc. This means highly specialized build and has nothing to do with generic all purpose system. > Why you describe this as an 'alternative' ? Before that loader changes, I regularly tested on 32MB qemy i386 image and 64MB amd64 image. I do not see anything extreme in these configs. They use normal boot path, which provides kernels with debugging symbols, metadata, loaded modules etc. Why should I use deficient boot2-only loading, which, additionally, cannot work on amd64 ? More, this is the only reasonable way for most developers to ensure that system is still usable on tiny configs found on embedded devices. Right now the min which I have to set up is 128MB, and VM changes are simply not tested on anything smaller. It is guaranteed that small systems will grow regressions fast. And I will not jump through the hoops to mitigate breakage induced by other people' changes. > Also at some point, there is an question about how reasonable it is to have such configuration as part of generic code base for special bits like boot loader itself, as the problem is, testing all those variants is becoming impossible and even keeping reasonable code base in all of the #if #else #endif spaghetti is getting quite hard and error prone. > > >From developers point of view, it is not really encouraging to have possible feedback like ???oh, but you did break my 32MB system boot??? ;) This does bring back some memories however. For first 2 unix systems I was dealing with, one had 8MB and another had 12MB of memory??? it was ~ 1992-1993;) > Not mine, but you (?) indirectly broke system for people who do use 32MB on other arches, since low memory config on dev systems become 128MB. I cared about 32MB before, but not any longer. > Right now the loader and stage2 are set to use 64MB heap to make it possible to implement zfs feature support and later on, for more features. > > Also note that UEFI setups are much harder to deal with regard of memory management, because as long as BS are in control, you can not really control the memory management there and can end up with fragmented unusable (for kernel loading) layout. This is especially nasty as apparently some (buggy) systems actually have runtime services using boot services memory areas, so you can end up in setup where you can not re-use BS memory and those chunks can be all over the low memory address space??? Yes, I do suspect that eventually systems appear where our default layout of the kernel physical segments is not workable and both loader and kernel bootstrap would need to grow much more flexibility. Initial 1GB-idmap page table structure and kernel page table would need to handle this, and we will need a kernel relocator either in loader or in kernel itself. From owner-svn-src-all@freebsd.org Fri Aug 19 09:35:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89A10BBFA8A; Fri, 19 Aug 2016 09:35:35 +0000 (UTC) (envelope-from tsoome@me.com) Received: from st13p35im-asmtp004.me.com (st13p35im-asmtp004.me.com [17.164.199.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CA381CCC; Fri, 19 Aug 2016 09:35:35 +0000 (UTC) (envelope-from tsoome@me.com) Received: from process-dkim-sign-daemon.st13p35im-asmtp004.me.com by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) id <0OC500N00GZUON00@st13p35im-asmtp004.me.com>; Fri, 19 Aug 2016 09:35:34 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=4d515a; t=1471599334; bh=m2j7mQzR1uPalnh8tIjmkZPL2B345cMzYeS0VhsT6qw=; h=Content-type:MIME-version:Subject:From:Date:Message-id:To; b=kqSjg6pFmykO+7l//pw19lQ3df9mbMag/+/KQXs1IrsoLD//lW7/PRKUixnzzaRks +yR5T8dFNBDMIbYCxPw2B4gODQWIoRlj4/aEw/0LLlZFvzXKA5QAfgsOy8rFyn/LeI VDbq9E3wQZUGAWkG2Ez456vcEF0tgwvqUxdGcxS5OQ3LFL95Cn2iRIu2vUDMX6aIqC DCglSHQetlfOO2AeEoGVWWAq6hVQGgs69yLclSCzPzQoSWosuY7MqJF5v+P68xiJXL AJP6GenJ0V0HBs4rPjA7zWOKx+PWoMFL73aaApc4nJYsLP96BH9Ipd3aItl5EPZbLO fdUyeeuswv8OA== Received: from [88.196.10.181] (181-10-196-88.dyn.estpak.ee [88.196.10.181]) by st13p35im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.38.0 64bit (built Feb 26 2016)) with ESMTPSA id <0OC5002VVHB6Z210@st13p35im-asmtp004.me.com>; Fri, 19 Aug 2016 09:35:34 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-19_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1608190124 Content-type: text/plain; charset=utf-8 MIME-version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd From: Toomas Soome In-reply-to: <20160819092424.GE83214@kib.kiev.ua> Date: Fri, 19 Aug 2016 12:35:30 +0300 Cc: Warner Losh , Julian Elischer , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-transfer-encoding: quoted-printable Message-id: <514987E4-B953-467C-B53B-824B172A5211@me.com> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> <50AAF049-C8A7-4C69-A206-C3983FFA7867@me.com> <20160819092424.GE83214@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 09:35:35 -0000 > On 19. aug 2016, at 12:24, Konstantin Belousov = wrote: >=20 > On Fri, Aug 19, 2016 at 11:50:35AM +0300, Toomas Soome wrote: >>=20 >>> On 19. aug 2016, at 10:39, Konstantin Belousov = wrote: >>>=20 >>> On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: >>>> On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer = wrote: >>>>> On 16/08/2016 4:54 AM, John Baldwin wrote: >>>>>>=20 >>>>>> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >>>>>>>=20 >>>>>>> Author: jhb >>>>>>> Date: Mon Aug 15 20:38:02 2016 >>>>>>> New Revision: 304187 >>>>>>> URL: https://svnweb.freebsd.org/changeset/base/304187 >>>>>>>=20 >>>>>>> Log: >>>>>>> Remove the mcd(4) driver for Mitsumi CD-ROM players. >>>>>>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As = noted in >>>>>>> the manpage, this driver is only useful as a backend to = cdcontrol to >>>>>>> play audio CDs since it doesn't use DMA, so its data performance = is >>>>>>> "abysmal" (and that was true in the mid 90's). >>>>>>=20 >>>>>> No one stepped up to test patches for it either when I last = posted patches >>>>>> to >>>>>> convert it from timeout(9) to callout(9). I have a few more = drivers that >>>>>> are >>>>>> both very old and that people have no business using in 12 (think = ISA >>>>>> adapters that don't do DMA and can't be used with pccard) that I = will be >>>>>> removing over the next little while. I brought up a list of = drivers on >>>>>> arch@ >>>>>> a couple of years ago and the conversation drifted off into the = weeds >>>>>> about >>>>>> trimming GENERIC, etc. No one objected to the specific drivers I = listed >>>>>> though (and I got a few pleas of "please remove"). If someone = shows up >>>>>> desperately clutching an ISA adapter they can always dig up the = source >>>>>> from >>>>>> svn and deal with forward porting it for whatever API changes = have >>>>>> happened >>>>>> since it was removed. >>>>>=20 >>>>>=20 >>>>> I would imagine any machine still holding one of these probably = has not >>>>> enough memory to run FreeBSD. >>>>>=20 >>>>> would we still run in 2MB? >>>>=20 >>>> With insane levels of tuning, we can run in 32MB userland that can = do >>>> things. Even 64MB is tight w/o some tuning. 16MB is almost = certainly >>>> right out except for very specialized situations. 2MB? We can't = even >>>> load the loader in that :(. Oh, and all these memory configs are = only >>>> possible if you tweak the loader's block cache... >>>>=20 >>>=20 >>> 32MB is quite usable. Without any tuning, you get slightly less = than 10MB >>> for userspace, which is enough to for many things, and plenty if = swap is >>> added. >>>=20 >>> Note that you cannot boot on such configurations since loader was = broken, >>> but if you do manage to jump to kernel, things were fine several = months >>> ago. I tested my relatively recent OOM changes on 32MB qemu config. >>>> Warner >>>=20 >>=20 >> If the target is to go as low memory as possible, sure, you can strip = all off, from boot loader point, you should load kernel from stage2 and = not use loader at all (you can load and jump kernel even now from = stage2, assuming it wont need any special configuration from loader = config) etc etc. This means highly specialized build and has nothing to = do with generic all purpose system. >>=20 > Why you describe this as an 'alternative' ? Before that loader = changes, > I regularly tested on 32MB qemy i386 image and 64MB amd64 image. I do > not see anything extreme in these configs. They use normal boot path, > which provides kernels with debugging symbols, metadata, loaded = modules > etc. Why should I use deficient boot2-only loading, which, = additionally, > cannot work on amd64 ? >=20 > More, this is the only reasonable way for most developers to ensure = that > system is still usable on tiny configs found on embedded devices. = Right > now the min which I have to set up is 128MB, and VM changes are simply = not > tested on anything smaller. It is guaranteed that small systems will = grow > regressions fast. And I will not jump through the hoops to mitigate > breakage induced by other people' changes. >=20 >> Also at some point, there is an question about how reasonable it is = to have such configuration as part of generic code base for special bits = like boot loader itself, as the problem is, testing all those variants = is becoming impossible and even keeping reasonable code base in all of = the #if #else #endif spaghetti is getting quite hard and error prone. >>=20 >>> =46rom developers point of view, it is not really encouraging to = have possible feedback like ???oh, but you did break my 32MB system = boot??? ;) This does bring back some memories however. For first 2 unix = systems I was dealing with, one had 8MB and another had 12MB of = memory??? it was ~ 1992-1993;) >>=20 > Not mine, but you (?) indirectly broke system for people who do use = 32MB > on other arches, since low memory config on dev systems become 128MB. > I cared about 32MB before, but not any longer. Yep, I did set it to 64MB. And this is exactly why I wrote that small = systems do need special approaches, because getting updates for new = features and keeping tiny systems functional are conflicting options. So = far freebsd boot loader has managed this in some extent by massive = amount of preprocessor conditions and the result is insane list of = different boot programs in /boot - this is the price to pay. Even to = install the boot program you need to know when to use gpart and when = dd=E2=80=A6 rgds, toomas >=20 >> Right now the loader and stage2 are set to use 64MB heap to make it = possible to implement zfs feature support and later on, for more = features. >>=20 >> Also note that UEFI setups are much harder to deal with regard of = memory management, because as long as BS are in control, you can not = really control the memory management there and can end up with = fragmented unusable (for kernel loading) layout. This is especially = nasty as apparently some (buggy) systems actually have runtime services = using boot services memory areas, so you can end up in setup where you = can not re-use BS memory and those chunks can be all over the low memory = address space???=20 >=20 > Yes, I do suspect that eventually systems appear where our default > layout of the kernel physical segments is not workable and both loader > and kernel bootstrap would need to grow much more flexibility. Initial > 1GB-idmap page table structure and kernel page table would need to = handle > this, and we will need a kernel relocator either in loader or in = kernel > itself. From owner-svn-src-all@freebsd.org Fri Aug 19 10:35:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54F3FBBFC53; Fri, 19 Aug 2016 10:35:37 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B37F1453; Fri, 19 Aug 2016 10:35:36 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 62E191FE023; Fri, 19 Aug 2016 12:35:28 +0200 (CEST) Subject: Re: svn commit: r304439 - head/sys/dev/usb/net To: pyunyh@gmail.com References: <201608190050.u7J0oWkW043171@repo.freebsd.org> <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> <20160819085511.GF1186@michelle.fasterthan.co.kr> <2e8143d4-eb32-693d-e5a4-49c380c100df@selasky.org> <20160819092223.GG1186@michelle.fasterthan.co.kr> Cc: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <63a25b6b-4503-b136-7765-7744108db1a1@selasky.org> Date: Fri, 19 Aug 2016 12:39:58 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <20160819092223.GG1186@michelle.fasterthan.co.kr> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 10:35:37 -0000 On 08/19/16 11:22, YongHyeon PYUN wrote: > On Fri, Aug 19, 2016 at 11:11:56AM +0200, Hans Petter Selasky wrote: >> On 08/19/16 10:55, YongHyeon PYUN wrote: >>> I think the order is right but it was not tested on big-endian >>> systems. >> >> Hi, >> >> I'm pretty sure the ifdef is wrong, because you write the fields one at >> a time, using htole32(): >> >> txhdr.mss = 0; >> txhdr.len = htole32(AXGE_TXBYTES(m->m_pkthdr.len)); >> >> Big endian machines don't re-order variables like this. >> >> You should remove the #else part. > > Wouldn't USB stack pass txhdr structure without any > modification? And controller want to see len (low 32bits address) > first and then mss (high 32bits address). On big endian systems I > guess this should be reversed in host memory layout. This is so > confusing so I could be wrong. The USB stack passes TXHDR as-is and the host controller is byte oriented, not 64-bit word oriented. That's why the layout is the same as long as you assign per 32-bit field. --HPS From owner-svn-src-all@freebsd.org Fri Aug 19 10:51:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACA43BBF03E; Fri, 19 Aug 2016 10:51:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79A221BE0; Fri, 19 Aug 2016 10:51:31 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JApUov066830; Fri, 19 Aug 2016 10:51:30 GMT (envelope-from yongari@FreeBSD.org) Received: (from yongari@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JApUKh066829; Fri, 19 Aug 2016 10:51:30 GMT (envelope-from yongari@FreeBSD.org) Message-Id: <201608191051.u7JApUKh066829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yongari set sender to yongari@FreeBSD.org using -f From: Pyun YongHyeon Date: Fri, 19 Aug 2016 10:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304458 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 10:51:31 -0000 Author: yongari Date: Fri Aug 19 10:51:30 2016 New Revision: 304458 URL: https://svnweb.freebsd.org/changeset/base/304458 Log: Host controller is byte oriented. Fix wrong assumption on big-endian systems. Pointed out by: hselasky Modified: head/sys/dev/usb/net/if_axgereg.h Modified: head/sys/dev/usb/net/if_axgereg.h ============================================================================== --- head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 09:11:50 2016 (r304457) +++ head/sys/dev/usb/net/if_axgereg.h Fri Aug 19 10:51:30 2016 (r304458) @@ -154,21 +154,15 @@ enum { #define AXGE_N_FRAMES 16 struct axge_frame_txhdr { -#if BYTE_ORDER == LITTLE_ENDIAN uint32_t len; - uint32_t mss; -#else - uint32_t mss; - uint32_t len; -#endif -} __packed; - #define AXGE_TXLEN_MASK 0x0001FFFF #define AXGE_VLAN_INSERT 0x20000000 #define AXGE_CSUM_DISABLE 0x80000000 + uint32_t mss; #define AXGE_MSS_MASK 0x00003FFF #define AXGE_PADDING 0x80008000 #define AXGE_VLAN_TAG_MASK 0xFFFF0000 +} __packed; #define AXGE_TXBYTES(x) ((x) & AXGE_TXLEN_MASK) From owner-svn-src-all@freebsd.org Fri Aug 19 10:52:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51FE6BBF0C7; Fri, 19 Aug 2016 10:52:42 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CAC71F07; Fri, 19 Aug 2016 10:52:42 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JAqfDl070264; Fri, 19 Aug 2016 10:52:41 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JAqdPq070244; Fri, 19 Aug 2016 10:52:39 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201608191052.u7JAqdPq070244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Aug 2016 10:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304459 - in head/sys: arm/arm arm/nvidia arm/ti/omap4 arm64/arm64 dev/fdt dev/gpio dev/iicbus dev/ofw dev/pci dev/vnic kern mips/mips 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 10:52:42 -0000 Author: mmel Date: Fri Aug 19 10:52:39 2016 New Revision: 304459 URL: https://svnweb.freebsd.org/changeset/base/304459 Log: INTRNG: Rework handling with resources. Partially revert r301453. - Read interrupt properties at bus enumeration time and store it into global mapping table. - At bus_activate_resource() time, given mapping entry is resolved and connected to real interrupt source. A copy of mapping entry is attached to given resource. - At bus_setup_intr() time, mapping entry stored in resource is used for delivery of requested interrupt configuration. - For MSI/MSIX interrupts, mapping entry is created within pci_alloc_msi()/pci_alloc_msix() call. - For legacy PCI interrupts, mapping entry must be created within pcib_route_interrupt() by pcib driver itself. Reviewed by: nwhitehorn, andrew Differential Revision: https://reviews.freebsd.org/D7493 Modified: head/sys/arm/arm/nexus.c head/sys/arm/nvidia/tegra_lic.c head/sys/arm/ti/omap4/omap4_wugen.c head/sys/arm64/arm64/nexus.c head/sys/dev/fdt/simplebus.c head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h head/sys/dev/gpio/ofw_gpiobus.c head/sys/dev/iicbus/ofw_iicbus.c head/sys/dev/ofw/ofw_bus_subr.c head/sys/dev/ofw/ofw_bus_subr.h head/sys/dev/ofw/ofwbus.c head/sys/dev/pci/pci_host_generic.c head/sys/dev/vnic/mrml_bridge.c head/sys/dev/vnic/thunder_mdio_fdt.c head/sys/kern/bus_if.m head/sys/kern/pic_if.m head/sys/kern/subr_bus.c head/sys/kern/subr_intr.c head/sys/mips/mips/nexus.c head/sys/sys/bus.h head/sys/sys/intr.h Modified: head/sys/arm/arm/nexus.c ============================================================================== --- head/sys/arm/arm/nexus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/arm/arm/nexus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #ifdef FDT #include +#include #include "ofw_bus_if.h" #endif @@ -379,6 +380,11 @@ nexus_activate_resource(device_t bus, de #endif rman_set_virtual(r, (void *)vaddr); rman_set_bushandle(r, vaddr); + return (0); + } else if (type == SYS_RES_IRQ) { +#ifdef INTRNG + intr_activate_irq(child, r); +#endif } return (0); } @@ -390,17 +396,23 @@ nexus_deactivate_resource(device_t bus, bus_size_t psize; bus_space_handle_t vaddr; - psize = (bus_size_t)rman_get_size(r); - vaddr = rman_get_bushandle(r); + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + psize = (bus_size_t)rman_get_size(r); + vaddr = rman_get_bushandle(r); - if (vaddr != 0) { + if (vaddr != 0) { #ifdef FDT - bus_space_unmap(fdtbus_bs_tag, vaddr, psize); + bus_space_unmap(fdtbus_bs_tag, vaddr, psize); #else - pmap_unmapdev((vm_offset_t)vaddr, (vm_size_t)psize); + pmap_unmapdev((vm_offset_t)vaddr, (vm_size_t)psize); +#endif + rman_set_virtual(r, NULL); + rman_set_bushandle(r, 0); + } + } else if (type == SYS_RES_IRQ) { +#ifdef INTRNG + intr_deactivate_irq(child, r); #endif - rman_set_virtual(r, NULL); - rman_set_bushandle(r, 0); } return (rman_deactivate_resource(r)); @@ -411,11 +423,22 @@ static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells, pcell_t *intr) { - -#ifdef INTRNG - return (INTR_IRQ_INVALID); -#else +#ifndef INTRNG return (intr_fdt_map_irq(iparent, intr, icells)); -#endif +#else + u_int irq; + struct intr_map_data_fdt *fdt_data; + size_t len; + + len = sizeof(*fdt_data) + icells * sizeof(pcell_t); + fdt_data = (struct intr_map_data_fdt *)intr_alloc_map_data( + INTR_MAP_DATA_FDT, len, M_WAITOK | M_ZERO); + fdt_data->iparent = iparent; + fdt_data->ncells = icells; + memcpy(fdt_data->cells, intr, icells * sizeof(pcell_t)); + irq = intr_map_irq(NULL, iparent, (struct intr_map_data *)fdt_data); + return (irq); +#endif /* INTRNG */ } -#endif +#endif /* FDT */ + Modified: head/sys/arm/nvidia/tegra_lic.c ============================================================================== --- head/sys/arm/nvidia/tegra_lic.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/arm/nvidia/tegra_lic.c Fri Aug 19 10:52:39 2016 (r304459) @@ -88,12 +88,12 @@ struct tegra_lic_sc { }; static int -tegra_lic_alloc_intr(device_t dev, struct intr_irqsrc *isrc, +tegra_lic_activate_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { struct tegra_lic_sc *sc = device_get_softc(dev); - return (PIC_ALLOC_INTR(sc->parent, isrc, res, data)); + return (PIC_ACTIVATE_INTR(sc->parent, isrc, res, data)); } static void @@ -122,12 +122,12 @@ tegra_lic_map_intr(device_t dev, struct } static int -tegra_lic_release_intr(device_t dev, struct intr_irqsrc *isrc, +tegra_lic_deactivate_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { struct tegra_lic_sc *sc = device_get_softc(dev); - return (PIC_RELEASE_INTR(sc->parent, isrc, res, data)); + return (PIC_DEACTIVATE_INTR(sc->parent, isrc, res, data)); } static int @@ -266,11 +266,11 @@ static device_method_t tegra_lic_methods DEVMETHOD(device_detach, tegra_lic_detach), /* Interrupt controller interface */ - DEVMETHOD(pic_alloc_intr, tegra_lic_alloc_intr), + DEVMETHOD(pic_activate_intr, tegra_lic_activate_intr), DEVMETHOD(pic_disable_intr, tegra_lic_disable_intr), DEVMETHOD(pic_enable_intr, tegra_lic_enable_intr), DEVMETHOD(pic_map_intr, tegra_lic_map_intr), - DEVMETHOD(pic_release_intr, tegra_lic_release_intr), + DEVMETHOD(pic_deactivate_intr, tegra_lic_deactivate_intr), DEVMETHOD(pic_setup_intr, tegra_lic_setup_intr), DEVMETHOD(pic_teardown_intr, tegra_lic_teardown_intr), DEVMETHOD(pic_pre_ithread, tegra_lic_pre_ithread), Modified: head/sys/arm/ti/omap4/omap4_wugen.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_wugen.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/arm/ti/omap4/omap4_wugen.c Fri Aug 19 10:52:39 2016 (r304459) @@ -57,12 +57,12 @@ struct omap4_wugen_sc { }; static int -omap4_wugen_alloc_intr(device_t dev, struct intr_irqsrc *isrc, +omap4_wugen_activate_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { struct omap4_wugen_sc *sc = device_get_softc(dev); - return (PIC_ALLOC_INTR(sc->sc_parent, isrc, res, data)); + return (PIC_ACTIVATE_INTR(sc->sc_parent, isrc, res, data)); } static void @@ -91,12 +91,12 @@ omap4_wugen_map_intr(device_t dev, struc } static int -omap4_wugen_release_intr(device_t dev, struct intr_irqsrc *isrc, +omap4_wugen_deactivate_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { struct omap4_wugen_sc *sc = device_get_softc(dev); - return (PIC_RELEASE_INTR(sc->sc_parent, isrc, res, data)); + return (PIC_DEACTIVATE_INTR(sc->sc_parent, isrc, res, data)); } static int @@ -227,11 +227,11 @@ static device_method_t omap4_wugen_metho DEVMETHOD(device_detach, omap4_wugen_detach), /* Interrupt controller interface */ - DEVMETHOD(pic_alloc_intr, omap4_wugen_alloc_intr), + DEVMETHOD(pic_activate_intr, omap4_wugen_activate_intr), DEVMETHOD(pic_disable_intr, omap4_wugen_disable_intr), DEVMETHOD(pic_enable_intr, omap4_wugen_enable_intr), DEVMETHOD(pic_map_intr, omap4_wugen_map_intr), - DEVMETHOD(pic_release_intr, omap4_wugen_release_intr), + DEVMETHOD(pic_deactivate_intr, omap4_wugen_deactivate_intr), DEVMETHOD(pic_setup_intr, omap4_wugen_setup_intr), DEVMETHOD(pic_teardown_intr, omap4_wugen_teardown_intr), DEVMETHOD(pic_pre_ithread, omap4_wugen_pre_ithread), Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/arm64/arm64/nexus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef FDT +#include #include #include "ofw_bus_if.h" #endif @@ -345,6 +346,8 @@ nexus_activate_resource(device_t bus, de rman_set_bustag(r, &memmap_bus); rman_set_virtual(r, (void *)vaddr); rman_set_bushandle(r, vaddr); + } else if (type == SYS_RES_IRQ) { + intr_activate_irq(child, r); } return (0); } @@ -378,13 +381,17 @@ nexus_deactivate_resource(device_t bus, bus_size_t psize; bus_space_handle_t vaddr; - psize = (bus_size_t)rman_get_size(r); - vaddr = rman_get_bushandle(r); + if (type == SYS_RES_MEMORY || type == SYS_RES_IOPORT) { + psize = (bus_size_t)rman_get_size(r); + vaddr = rman_get_bushandle(r); - if (vaddr != 0) { - bus_space_unmap(&memmap_bus, vaddr, psize); - rman_set_virtual(r, NULL); - rman_set_bushandle(r, 0); + if (vaddr != 0) { + bus_space_unmap(&memmap_bus, vaddr, psize); + rman_set_virtual(r, NULL); + rman_set_bushandle(r, 0); + } + } else if (type == SYS_RES_IRQ) { + intr_deactivate_irq(child, r); } return (rman_deactivate_resource(r)); @@ -431,8 +438,18 @@ static int nexus_ofw_map_intr(device_t dev, device_t child, phandle_t iparent, int icells, pcell_t *intr) { - - return (INTR_IRQ_INVALID); + u_int irq; + struct intr_map_data_fdt *fdt_data; + size_t len; + + len = sizeof(*fdt_data) + icells * sizeof(pcell_t); + fdt_data = (struct intr_map_data_fdt *)intr_alloc_map_data( + INTR_MAP_DATA_FDT, len, M_WAITOK | M_ZERO); + fdt_data->iparent = iparent; + fdt_data->ncells = icells; + memcpy(fdt_data->cells, intr, icells * sizeof(pcell_t)); + irq = intr_map_irq(NULL, iparent, (struct intr_map_data *)fdt_data); + return (irq); } #endif Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/fdt/simplebus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -251,9 +251,7 @@ simplebus_setup_dinfo(device_t dev, phan resource_list_init(&ndi->rl); ofw_bus_reg_to_rl(dev, node, sc->acells, sc->scells, &ndi->rl); -#ifndef INTRNG ofw_bus_intr_to_rl(dev, node, &ndi->rl, NULL); -#endif return (ndi); } Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/gpio/gpiobus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -31,7 +31,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef INTRNG #include +#endif #include #include #include @@ -79,43 +81,26 @@ static int gpiobus_pin_toggle(device_t, * data will be moved into struct resource. */ #ifdef INTRNG -static void -gpio_destruct_map_data(struct intr_map_data *map_data) -{ - - KASSERT(map_data->type == INTR_MAP_DATA_GPIO, - ("%s: bad map_data type %d", __func__, map_data->type)); - - free(map_data, M_DEVBUF); -} struct resource * gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags, gpio_pin_t pin, uint32_t intr_mode) { - int rv; u_int irq; struct intr_map_data_gpio *gpio_data; struct resource *res; - gpio_data = malloc(sizeof(*gpio_data), M_DEVBUF, M_WAITOK | M_ZERO); - gpio_data->hdr.type = INTR_MAP_DATA_GPIO; - gpio_data->hdr.destruct = gpio_destruct_map_data; + gpio_data = (struct intr_map_data_gpio *)intr_alloc_map_data( + INTR_MAP_DATA_GPIO, sizeof(*gpio_data), M_WAITOK | M_ZERO); gpio_data->gpio_pin_num = pin->pin; gpio_data->gpio_pin_flags = pin->flags; gpio_data->gpio_intr_mode = intr_mode; - rv = intr_map_irq(pin->dev, 0, (struct intr_map_data *)gpio_data, - &irq); - if (rv != 0) { - gpio_destruct_map_data((struct intr_map_data *)gpio_data); - return (NULL); - } - + irq = intr_map_irq(pin->dev, 0, (struct intr_map_data *)gpio_data); res = bus_alloc_resource(consumer_dev, SYS_RES_IRQ, rid, irq, irq, 1, alloc_flags); if (res == NULL) { - gpio_destruct_map_data((struct intr_map_data *)gpio_data); + intr_free_intr_map_data((struct intr_map_data *)gpio_data); return (NULL); } rman_set_virtual(res, gpio_data); Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/gpio/gpiobusvar.h Fri Aug 19 10:52:39 2016 (r304459) @@ -70,12 +70,14 @@ struct gpiobus_pin_data char *name; /* pin name. */ }; +#ifdef INTRNG struct intr_map_data_gpio { struct intr_map_data hdr; u_int gpio_pin_num; u_int gpio_pin_flags; u_int gpio_intr_mode; }; +#endif struct gpiobus_softc { Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/gpio/ofw_gpiobus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -321,13 +321,11 @@ ofw_gpiobus_setup_devinfo(device_t bus, devi->pins[i] = pins[i].pin; } free(pins, M_DEVBUF); -#ifndef INTRNG /* Parse the interrupt resources. */ if (ofw_bus_intr_to_rl(bus, node, &dinfo->opd_dinfo.rl, NULL) != 0) { ofw_gpiobus_destroy_devinfo(bus, dinfo); return (NULL); } -#endif device_set_ivars(child, dinfo); return (dinfo); Modified: head/sys/dev/iicbus/ofw_iicbus.c ============================================================================== --- head/sys/dev/iicbus/ofw_iicbus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/iicbus/ofw_iicbus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -187,10 +187,8 @@ ofw_iicbus_attach(device_t dev) childdev = device_add_child(dev, NULL, -1); resource_list_init(&dinfo->opd_dinfo.rl); -#ifndef INTRNG ofw_bus_intr_to_rl(childdev, child, &dinfo->opd_dinfo.rl, NULL); -#endif device_set_ivars(childdev, dinfo); } Modified: head/sys/dev/ofw/ofw_bus_subr.c ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/ofw/ofw_bus_subr.c Fri Aug 19 10:52:39 2016 (r304459) @@ -516,7 +516,6 @@ ofw_bus_find_iparent(phandle_t node) return (iparent); } -#ifndef INTRNG int ofw_bus_intr_to_rl(device_t dev, phandle_t node, struct resource_list *rl, int *rlen) @@ -582,7 +581,6 @@ ofw_bus_intr_to_rl(device_t dev, phandle free(intr, M_OFWPROP); return (err); } -#endif int ofw_bus_intr_by_rid(device_t dev, phandle_t node, int wanted_rid, Modified: head/sys/dev/ofw/ofw_bus_subr.h ============================================================================== --- head/sys/dev/ofw/ofw_bus_subr.h Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/ofw/ofw_bus_subr.h Fri Aug 19 10:52:39 2016 (r304459) @@ -32,7 +32,9 @@ #define _DEV_OFW_OFW_BUS_SUBR_H_ #include - +#ifdef INTRNG +#include +#endif #include #include "ofw_bus_if.h" @@ -52,12 +54,14 @@ struct ofw_compat_data { uintptr_t ocd_data; }; +#ifdef INTRNG struct intr_map_data_fdt { struct intr_map_data hdr; phandle_t iparent; u_int ncells; - pcell_t *cells; + pcell_t cells[]; }; +#endif #define SIMPLEBUS_PNP_DESCR "Z:compat;P:private;" #define SIMPLEBUS_PNP_INFO(t) \ @@ -89,9 +93,7 @@ int ofw_bus_msimap(phandle_t, uint16_t, /* Routines for parsing device-tree data into resource lists. */ int ofw_bus_reg_to_rl(device_t, phandle_t, pcell_t, pcell_t, struct resource_list *); -#ifndef INTRNG int ofw_bus_intr_to_rl(device_t, phandle_t, struct resource_list *, int *); -#endif int ofw_bus_intr_by_rid(device_t, phandle_t, int, phandle_t *, int *, pcell_t **); Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/ofw/ofwbus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -80,9 +80,6 @@ static device_attach_t ofwbus_attach; static bus_alloc_resource_t ofwbus_alloc_resource; static bus_adjust_resource_t ofwbus_adjust_resource; static bus_release_resource_t ofwbus_release_resource; -#ifdef INTRNG -static bus_map_intr_t ofwbus_map_intr; -#endif static device_method_t ofwbus_methods[] = { /* Device interface */ @@ -96,9 +93,6 @@ static device_method_t ofwbus_methods[] DEVMETHOD(bus_alloc_resource, ofwbus_alloc_resource), DEVMETHOD(bus_adjust_resource, ofwbus_adjust_resource), DEVMETHOD(bus_release_resource, ofwbus_release_resource), -#ifdef INTRNG - DEVMETHOD(bus_map_intr, ofwbus_map_intr), -#endif DEVMETHOD_END }; @@ -299,53 +293,3 @@ ofwbus_release_resource(device_t bus, de } return (rman_release_resource(r)); } - -#ifdef INTRNG -static void -ofwbus_destruct_map_data(struct intr_map_data *map_data) -{ - struct intr_map_data_fdt *fdt_map_data; - - KASSERT(map_data->type == INTR_MAP_DATA_FDT, - ("%s: bad map_data type %d", __func__, map_data->type)); - - fdt_map_data = (struct intr_map_data_fdt *)map_data; - OF_prop_free(fdt_map_data->cells); - free(fdt_map_data, M_OFWPROP); -} - -static int -ofwbus_map_intr(device_t bus, device_t child, int *rid, rman_res_t *start, - rman_res_t *end, rman_res_t *count, struct intr_map_data **imd) -{ - phandle_t iparent, node; - pcell_t *cells; - int ncells, rv; - u_int irq; - struct intr_map_data_fdt *fdt_data; - - node = ofw_bus_get_node(child); - rv = ofw_bus_intr_by_rid(child, node, *rid, &iparent, &ncells, &cells); - if (rv != 0) - return (rv); - - fdt_data = malloc(sizeof(*fdt_data), M_OFWPROP, M_WAITOK | M_ZERO); - fdt_data->hdr.type = INTR_MAP_DATA_FDT; - fdt_data->hdr.destruct = ofwbus_destruct_map_data; - fdt_data->iparent = iparent; - fdt_data->ncells = ncells; - fdt_data->cells = cells; - rv = intr_map_irq(NULL, iparent, (struct intr_map_data *)fdt_data, - &irq); - if (rv != 0) { - ofwbus_destruct_map_data((struct intr_map_data *)fdt_data); - return (rv); - } - - *start = irq; - *end = irq; - *count = 1; - *imd = (struct intr_map_data *)fdt_data; - return (0); -} -#endif Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/pci/pci_host_generic.c Fri Aug 19 10:52:39 2016 (r304459) @@ -939,9 +939,7 @@ generic_pcie_ofw_bus_attach(device_t dev resource_list_init(&di->di_rl); ofw_bus_reg_to_rl(dev, node, addr_cells, size_cells, &di->di_rl); -#ifndef INTRNG ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); -#endif /* Add newbus device for this FDT node */ child = device_add_child(dev, NULL, -1); Modified: head/sys/dev/vnic/mrml_bridge.c ============================================================================== --- head/sys/dev/vnic/mrml_bridge.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/vnic/mrml_bridge.c Fri Aug 19 10:52:39 2016 (r304459) @@ -263,9 +263,7 @@ mrmlb_ofw_bus_attach(device_t dev) resource_list_init(&di->di_rl); ofw_bus_reg_to_rl(dev, node, sc->acells, sc->scells, &di->di_rl); -#ifndef INTRNG ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); -#endif /* Add newbus device for this FDT node */ child = device_add_child(dev, NULL, -1); Modified: head/sys/dev/vnic/thunder_mdio_fdt.c ============================================================================== --- head/sys/dev/vnic/thunder_mdio_fdt.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/dev/vnic/thunder_mdio_fdt.c Fri Aug 19 10:52:39 2016 (r304459) @@ -271,9 +271,7 @@ mdionexus_ofw_bus_attach(device_t dev) resource_list_init(&di->di_rl); ofw_bus_reg_to_rl(dev, node, sc->acells, sc->scells, &di->di_rl); -#ifndef INTRNG ofw_bus_intr_to_rl(dev, node, &di->di_rl, NULL); -#endif /* Add newbus device for this FDT node */ child = device_add_child(dev, NULL, -1); Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/kern/bus_if.m Fri Aug 19 10:52:39 2016 (r304459) @@ -418,35 +418,6 @@ METHOD int release_resource { }; /** - * @brief Map an interrupt - * - * This method is used to get an interrupt mapping data according to provided - * hints. The hints could be modified afterwards, but only if mapping data was - * allocated. This method is intended to be called before BUS_ALLOC_RESOURCE(). - * - * @param _dev the parent device of @p _child - * @param _child the device which is requesting an allocation - * @param _rid a pointer to the resource identifier - * @param _start a pointer to the hint at the start of the resource - * range - pass @c 0 for any start address - * @param _end a pointer to the hint at the end of the resource - * range - pass @c ~0 for any end address - * @param _count a pointer to the hint at the size of resource - * range required - pass @c 1 for any size - * @param _imd a pointer to the interrupt mapping data which was - * allocated - */ -METHOD int map_intr { - device_t _dev; - device_t _child; - int *_rid; - rman_res_t *_start; - rman_res_t *_end; - rman_res_t *_count; - struct intr_map_data **_imd; -} DEFAULT bus_generic_map_intr; - -/** * @brief Install an interrupt handler * * This method is used to associate an interrupt handler function with Modified: head/sys/kern/pic_if.m ============================================================================== --- head/sys/kern/pic_if.m Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/kern/pic_if.m Fri Aug 19 10:52:39 2016 (r304459) @@ -43,7 +43,7 @@ CODE { } static int - null_pic_alloc_intr(device_t dev, struct intr_irqsrc *isrc, + null_pic_activate_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { @@ -51,7 +51,7 @@ CODE { } static int - null_pic_release_intr(device_t dev, struct intr_irqsrc *isrc, + null_pic_deactivate_intr(device_t dev, struct intr_irqsrc *isrc, struct resource *res, struct intr_map_data *data) { @@ -92,12 +92,12 @@ CODE { } }; -METHOD int alloc_intr { +METHOD int activate_intr { device_t dev; struct intr_irqsrc *isrc; struct resource *res; struct intr_map_data *data; -} DEFAULT null_pic_alloc_intr; +} DEFAULT null_pic_activate_intr; METHOD int bind_intr { device_t dev; @@ -120,12 +120,12 @@ METHOD int map_intr { struct intr_irqsrc **isrcp; }; -METHOD int release_intr { +METHOD int deactivate_intr { device_t dev; struct intr_irqsrc *isrc; struct resource *res; struct intr_map_data *data; -} DEFAULT null_pic_release_intr; +} DEFAULT null_pic_deactivate_intr; METHOD int setup_intr { device_t dev; Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/kern/subr_bus.c Fri Aug 19 10:52:39 2016 (r304459) @@ -3951,23 +3951,6 @@ bus_generic_new_pass(device_t dev) } /** - * @brief Helper function for implementing BUS_MAP_INTR(). - * - * This simple implementation of BUS_MAP_INTR() simply calls the - * BUS_MAP_INTR() method of the parent of @p dev. - */ -int -bus_generic_map_intr(device_t dev, device_t child, int *rid, rman_res_t *start, - rman_res_t *end, rman_res_t *count, struct intr_map_data **imd) -{ - /* Propagate up the bus hierarchy until someone handles it. */ - if (dev->parent) - return (BUS_MAP_INTR(dev->parent, child, rid, start, end, count, - imd)); - return (EINVAL); -} - -/** * @brief Helper function for implementing BUS_SETUP_INTR(). * * This simple implementation of BUS_SETUP_INTR() simply calls the @@ -4422,41 +4405,6 @@ bus_release_resources(device_t dev, cons } } -#ifdef INTRNG -/** - * @internal - * - * This can be converted to bus method later. (XXX) - */ -static struct intr_map_data * -bus_extend_resource(device_t dev, int type, int *rid, rman_res_t *start, - rman_res_t *end, rman_res_t *count) -{ - struct intr_map_data *imd; - struct resource_list *rl; - int rv; - - if (dev->parent == NULL) - return (NULL); - if (type != SYS_RES_IRQ) - return (NULL); - - if (!RMAN_IS_DEFAULT_RANGE(*start, *end)) - return (NULL); - rl = BUS_GET_RESOURCE_LIST(dev->parent, dev); - if (rl != NULL) { - if (resource_list_find(rl, type, *rid) != NULL) - return (NULL); - } - rv = BUS_MAP_INTR(dev->parent, dev, rid, start, end, count, &imd); - if (rv != 0) - return (NULL); - if (rl != NULL) - resource_list_add(rl, type, *rid, *start, *end, *count); - return (imd); -} -#endif - /** * @brief Wrapper function for BUS_ALLOC_RESOURCE(). * @@ -4468,26 +4416,11 @@ bus_alloc_resource(device_t dev, int typ rman_res_t end, rman_res_t count, u_int flags) { struct resource *res; -#ifdef INTRNG - struct intr_map_data *imd; -#endif if (dev->parent == NULL) return (NULL); - -#ifdef INTRNG - imd = bus_extend_resource(dev, type, rid, &start, &end, &count); -#endif res = BUS_ALLOC_RESOURCE(dev->parent, dev, type, rid, start, end, count, flags); -#ifdef INTRNG - if (imd != NULL) { - if (res != NULL && rman_get_virtual(res) == NULL) - rman_set_virtual(res, imd); - else - imd->destruct(imd); - } -#endif return (res); } @@ -4574,21 +4507,10 @@ int bus_release_resource(device_t dev, int type, int rid, struct resource *r) { int rv; -#ifdef INTRNG - struct intr_map_data *imd; -#endif if (dev->parent == NULL) return (EINVAL); - -#ifdef INTRNG - imd = (type == SYS_RES_IRQ) ? rman_get_virtual(r) : NULL; -#endif rv = BUS_RELEASE_RESOURCE(dev->parent, dev, type, rid, r); -#ifdef INTRNG - if (imd != NULL) - imd->destruct(imd); -#endif return (rv); } Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Fri Aug 19 10:51:30 2016 (r304458) +++ head/sys/kern/subr_intr.c Fri Aug 19 10:52:39 2016 (r304459) @@ -31,8 +31,9 @@ __FBSDID("$FreeBSD$"); /* * New-style Interrupt Framework * - * TODO: - to support IPI (PPI) enabling on other CPUs if already started - * - to complete things for removable PICs + * TODO: - add support for disconnected PICs. + * - to support IPI (PPI) enabling on other CPUs if already started. + * - to complete things for removable PICs. */ #include "opt_ddb.h" @@ -142,6 +143,11 @@ size_t sintrcnt = sizeof(intrcnt); size_t sintrnames = sizeof(intrnames); static u_int intrcnt_index; +static struct intr_irqsrc *intr_map_get_isrc(u_int res_id); +static void intr_map_set_isrc(u_int res_id, struct intr_irqsrc *isrc); +static void intr_map_copy_map_data(u_int res_id, device_t *dev, intptr_t *xref, + struct intr_map_data **data); + /* * Interrupt framework initialization routine. */ @@ -414,18 +420,6 @@ isrc_free_irq(struct intr_irqsrc *isrc) } /* - * Lookup interrupt source by interrupt number (resource handle). - */ -static inline struct intr_irqsrc * -isrc_lookup(u_int irq) -{ - - if (irq < nitems(irq_sources)) - return (irq_sources[irq]); - return (NULL); -} - -/* * Initialize interrupt source and register it into global interrupt table. */ int @@ -899,13 +893,12 @@ intr_pic_add_handler(device_t parent, st return (pic); } -int -intr_map_irq(device_t dev, intptr_t xref, struct intr_map_data *data, - u_int *irqp) +static int +intr_resolve_irq(device_t dev, intptr_t xref, struct intr_map_data *data, + struct intr_irqsrc **isrc) { - int error; - struct intr_irqsrc *isrc; struct intr_pic *pic; + struct intr_map_data_msi *msi; if (data == NULL) return (EINVAL); @@ -914,48 +907,77 @@ intr_map_irq(device_t dev, intptr_t xref if (pic == NULL) return (ESRCH); - KASSERT((pic->pic_flags & FLAG_PIC) != 0, - ("%s: Found a non-PIC controller: %s", __func__, - device_get_name(pic->pic_dev))); + switch (data->type) { + case INTR_MAP_DATA_MSI: + KASSERT((pic->pic_flags & FLAG_MSI) != 0, + ("%s: Found a non-MSI controller: %s", __func__, + device_get_name(pic->pic_dev))); + msi = (struct intr_map_data_msi *)data; + *isrc = msi->isrc; + return (0); - error = PIC_MAP_INTR(pic->pic_dev, data, &isrc); - if (error == 0) - *irqp = isrc->isrc_irq; - return (error); + default: + KASSERT((pic->pic_flags & FLAG_PIC) != 0, + ("%s: Found a non-PIC controller: %s", __func__, + device_get_name(pic->pic_dev))); + return (PIC_MAP_INTR(pic->pic_dev, data, isrc)); + + } } int -intr_alloc_irq(device_t dev, struct resource *res) +intr_activate_irq(device_t dev, struct resource *res) { + device_t map_dev; + intptr_t map_xref; struct intr_map_data *data; struct intr_irqsrc *isrc; + u_int res_id; + int error; KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = isrc_lookup(rman_get_start(res)); - if (isrc == NULL) - return (EINVAL); - - data = rman_get_virtual(res); - return (PIC_ALLOC_INTR(isrc->isrc_dev, isrc, res, data)); + res_id = (u_int)rman_get_start(res); + if (intr_map_get_isrc(res_id) != NULL) + panic("Attempt to double activation of resource id: %u\n", + res_id); + intr_map_copy_map_data(res_id, &map_dev, &map_xref, &data); + error = intr_resolve_irq(map_dev, map_xref, data, &isrc); + if (error != 0) { + free(data, M_INTRNG); + /* XXX TODO DISCONECTED PICs */ + /* if (error == EINVAL) return(0); */ + return (error); + } + intr_map_set_isrc(res_id, isrc); + rman_set_virtual(res, data); + return (PIC_ACTIVATE_INTR(isrc->isrc_dev, isrc, res, data)); } int -intr_release_irq(device_t dev, struct resource *res) +intr_deactivate_irq(device_t dev, struct resource *res) { struct intr_map_data *data; struct intr_irqsrc *isrc; + u_int res_id; + int error; KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = isrc_lookup(rman_get_start(res)); + res_id = (u_int)rman_get_start(res); + isrc = intr_map_get_isrc(res_id); if (isrc == NULL) - return (EINVAL); + panic("Attempt to deactivate non-active resource id: %u\n", + res_id); data = rman_get_virtual(res); - return (PIC_RELEASE_INTR(isrc->isrc_dev, isrc, res, data)); + error = PIC_DEACTIVATE_INTR(isrc->isrc_dev, isrc, res, data); + intr_map_set_isrc(res_id, NULL); + rman_set_virtual(res, NULL); + free(data, M_INTRNG); + return (error); } int @@ -966,13 +988,17 @@ intr_setup_irq(device_t dev, struct reso struct intr_map_data *data; struct intr_irqsrc *isrc; const char *name; + u_int res_id; KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = isrc_lookup(rman_get_start(res)); - if (isrc == NULL) + res_id = (u_int)rman_get_start(res); + isrc = intr_map_get_isrc(res_id); + if (isrc == NULL) { + /* XXX TODO DISCONECTED PICs */ return (EINVAL); + } data = rman_get_virtual(res); name = device_get_nameunit(dev); @@ -1027,11 +1053,13 @@ intr_teardown_irq(device_t dev, struct r int error; struct intr_map_data *data; struct intr_irqsrc *isrc; + u_int res_id; KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = isrc_lookup(rman_get_start(res)); + res_id = (u_int)rman_get_start(res); + isrc = intr_map_get_isrc(res_id); if (isrc == NULL || isrc->isrc_handlers == 0) return (EINVAL); @@ -1075,11 +1103,13 @@ intr_describe_irq(device_t dev, struct r { int error; struct intr_irqsrc *isrc; + u_int res_id; KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = isrc_lookup(rman_get_start(res)); + res_id = (u_int)rman_get_start(res); + isrc = intr_map_get_isrc(res_id); if (isrc == NULL || isrc->isrc_handlers == 0) return (EINVAL); #ifdef INTR_SOLO @@ -1107,11 +1137,13 @@ int intr_bind_irq(device_t dev, struct resource *res, int cpu) { struct intr_irqsrc *isrc; + u_int res_id; KASSERT(rman_get_start(res) == rman_get_end(res), ("%s: more interrupts in resource", __func__)); - isrc = isrc_lookup(rman_get_start(res)); + res_id = (u_int)rman_get_start(res); + isrc = intr_map_get_isrc(res_id); if (isrc == NULL || isrc->isrc_handlers == 0) return (EINVAL); #ifdef INTR_SOLO @@ -1191,6 +1223,28 @@ intr_irq_next_cpu(u_int current_cpu, cpu #endif /* + * Allocate memory for new intr_map_data structure. + * Initialize common fields. + */ +struct intr_map_data * +intr_alloc_map_data(enum intr_map_data_type type, size_t len, int flags) +{ + struct intr_map_data *data; + + data = malloc(len, M_INTRNG, flags); + data->type = type; + data->len = len; + return (data); +} + +void intr_free_intr_map_data(struct intr_map_data *data) +{ + + free(data, M_INTRNG); +} + + +/* * Register a MSI/MSI-X interrupt controller */ int @@ -1218,6 +1272,7 @@ intr_alloc_msi(device_t pci, device_t ch struct intr_irqsrc **isrc; struct intr_pic *pic; device_t pdev; + struct intr_map_data_msi *msi; int err, i; pic = pic_lookup(NULL, xref); @@ -1230,12 +1285,19 @@ intr_alloc_msi(device_t pci, device_t ch isrc = malloc(sizeof(*isrc) * count, M_INTRNG, M_WAITOK); err = MSI_ALLOC_MSI(pic->pic_dev, child, count, maxcount, &pdev, isrc); - if (err == 0) { - for (i = 0; i < count; i++) { - irqs[i] = isrc[i]->isrc_irq; - } + if (err != 0) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Aug 19 10:53:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDFF3BBF13E; Fri, 19 Aug 2016 10:53:18 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBB231221; Fri, 19 Aug 2016 10:53:18 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JArIeY070327; Fri, 19 Aug 2016 10:53:18 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JArIkg070326; Fri, 19 Aug 2016 10:53:18 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201608191053.u7JArIkg070326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Aug 2016 10:53:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304460 - head/sys/arm/nvidia 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 10:53:19 -0000 Author: mmel Date: Fri Aug 19 10:53:17 2016 New Revision: 304460 URL: https://svnweb.freebsd.org/changeset/base/304460 Log: TEGRA: Implement MSI/MSIX interrupts for pcie controller. Modified: head/sys/arm/nvidia/tegra_pcie.c Modified: head/sys/arm/nvidia/tegra_pcie.c ============================================================================== --- head/sys/arm/nvidia/tegra_pcie.c Fri Aug 19 10:52:39 2016 (r304459) +++ head/sys/arm/nvidia/tegra_pcie.c Fri Aug 19 10:53:17 2016 (r304460) @@ -33,20 +33,20 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include -#include #include #include #include -#include -#include #include -#include -#include #include #include +#include +#include #include #include @@ -68,8 +68,9 @@ __FBSDID("$FreeBSD$"); #include #include "ofw_bus_if.h" +#include "msi_if.h" #include "pcib_if.h" - +#include "pic_if.h" #define AFI_AXI_BAR0_SZ 0x000 @@ -93,17 +94,10 @@ __FBSDID("$FreeBSD$"); #define AFI_MSI_BAR_SZ 0x060 #define AFI_MSI_FPCI_BAR_ST 0x064 #define AFI_MSI_AXI_BAR_ST 0x068 - - -#define AFI_AXI_BAR6_SZ 0x134 -#define AFI_AXI_BAR7_SZ 0x138 -#define AFI_AXI_BAR8_SZ 0x13c -#define AFI_AXI_BAR6_START 0x140 -#define AFI_AXI_BAR7_START 0x144 -#define AFI_AXI_BAR8_START 0x148 -#define AFI_FPCI_BAR6 0x14c -#define AFI_FPCI_BAR7 0x150 -#define AFI_FPCI_BAR8 0x154 +#define AFI_MSI_VEC(x) (0x06c + 4 * (x)) +#define AFI_MSI_EN_VEC(x) (0x08c + 4 * (x)) +#define AFI_MSI_INTR_IN_REG 32 +#define AFI_MSI_REGS 8 #define AFI_CONFIGURATION 0x0ac #define AFI_CONFIGURATION_EN_FPCI (1 << 0) @@ -209,6 +203,8 @@ __FBSDID("$FreeBSD$"); #define TEGRA_PCIE_LINKUP_TIMEOUT 200 +#define TEGRA_PCIB_MSI_ENABLE + #define DEBUG #ifdef DEBUG #define debugf(fmt, args...) do { printf(fmt,##args); } while (0) @@ -258,6 +254,13 @@ static struct ofw_compat_data compat_dat {NULL, 0}, }; +#define TEGRA_FLAG_MSI_USED 0x0001 +struct tegra_pcib_irqsrc { + struct intr_irqsrc isrc; + u_int irq; + u_int flags; +}; + struct tegra_pcib_port { int enabled; int port_idx; /* chip port index */ @@ -271,6 +274,7 @@ struct tegra_pcib_port { }; #define TEGRA_PCIB_MAX_PORTS 3 +#define TEGRA_PCIB_MAX_MSI AFI_MSI_INTR_IN_REG * AFI_MSI_REGS struct tegra_pcib_softc { struct ofw_pci_softc ofw_pci; device_t dev; @@ -303,7 +307,7 @@ struct tegra_pcib_softc { regulator_t supply_vddio_pex_ctl; regulator_t supply_avdd_pll_erefe; - uint32_t msi_bitmap; + vm_offset_t msi_page; /* VA of MSI page */ bus_addr_t cfg_base_addr; /* base address of config */ bus_size_t cfg_cur_offs; /* currently mapped window */ bus_space_handle_t cfg_handle; /* handle of config window */ @@ -311,9 +315,9 @@ struct tegra_pcib_softc { int lanes_cfg; int num_ports; struct tegra_pcib_port *ports[TEGRA_PCIB_MAX_PORTS]; + struct tegra_pcib_irqsrc *isrcs; }; - static int tegra_pcib_maxslots(device_t dev) { @@ -324,13 +328,15 @@ static int tegra_pcib_route_interrupt(device_t bus, device_t dev, int pin) { struct tegra_pcib_softc *sc; + u_int irq; sc = device_get_softc(bus); - device_printf(bus, "route pin %d for device %d.%d to %ju\n", + irq = intr_map_clone_irq(rman_get_start(sc->irq_res)); + device_printf(bus, "route pin %d for device %d.%d to %u\n", pin, pci_get_slot(dev), pci_get_function(dev), - rman_get_start(sc->irq_res)); + irq); - return (rman_get_start(sc->irq_res)); + return (irq); } static int @@ -471,84 +477,320 @@ static int tegra_pci_intr(void *arg) return (FILTER_HANDLED); } -#if defined(TEGRA_PCI_MSI) +/* ----------------------------------------------------------------------- + * + * PCI MSI interface + */ +static int +tegra_pcib_alloc_msi(device_t pci, device_t child, int count, int maxcount, + int *irqs) +{ + phandle_t msi_parent; + + /* XXXX ofw_bus_msimap() don't works for Tegra DT. + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + */ + msi_parent = OF_xref_from_node(ofw_bus_get_node(pci)); + return (intr_alloc_msi(pci, child, msi_parent, count, maxcount, + irqs)); +} + static int -tegra_pcib_map_msi(device_t dev, device_t child, int irq, uint64_t *addr, +tegra_pcib_release_msi(device_t pci, device_t child, int count, int *irqs) +{ + phandle_t msi_parent; + + /* XXXX ofw_bus_msimap() don't works for Tegra DT. + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + */ + msi_parent = OF_xref_from_node(ofw_bus_get_node(pci)); + return (intr_release_msi(pci, child, msi_parent, count, irqs)); +} + +static int +tegra_pcib_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, uint32_t *data) { + phandle_t msi_parent; + + /* XXXX ofw_bus_msimap() don't works for Tegra DT. + ofw_bus_msimap(ofw_bus_get_node(pci), pci_get_rid(child), &msi_parent, + NULL); + */ + msi_parent = OF_xref_from_node(ofw_bus_get_node(pci)); + return (intr_map_msi(pci, child, msi_parent, irq, addr, data)); +} + +#ifdef TEGRA_PCIB_MSI_ENABLE + +/* -------------------------------------------------------------------------- + * + * Interrupts + * + */ + +static inline void +tegra_pcib_isrc_mask(struct tegra_pcib_softc *sc, + struct tegra_pcib_irqsrc *tgi, uint32_t val) +{ + uint32_t reg; + int offs, bit; + + offs = tgi->irq / AFI_MSI_INTR_IN_REG; + bit = 1 << (tgi->irq % AFI_MSI_INTR_IN_REG); + + if (val != 0) + AFI_WR4(sc, AFI_MSI_VEC(offs), bit); + reg = AFI_RD4(sc, AFI_MSI_EN_VEC(offs)); + if (val != 0) + reg |= bit; + else + reg &= ~bit; + AFI_WR4(sc, AFI_MSI_EN_VEC(offs), reg); +} + +static int +tegra_pcib_msi_intr(void *arg) +{ + u_int irq, i, bit, reg; struct tegra_pcib_softc *sc; + struct trapframe *tf; + struct tegra_pcib_irqsrc *tgi; - sc = device_get_softc(dev); - irq = irq - MSI_IRQ; + sc = (struct tegra_pcib_softc *)arg; + tf = curthread->td_intr_frame; + + for (i = 0; i < AFI_MSI_REGS; i++) { + reg = AFI_RD4(sc, AFI_MSI_VEC(i)); + /* Handle one vector. */ + while (reg != 0) { + bit = ffs(reg) - 1; +//printf("%s: i: %d, reg: 0x%08X, bit: 0x%08X, addr: 0x%08llX\n", __func__, i, reg, bit, rman_get_start(sc->afi_mem_res)); + /* Send EOI */ + AFI_WR4(sc, AFI_MSI_VEC(i), 1 << bit); + irq = i * AFI_MSI_INTR_IN_REG + bit; + tgi = &sc->isrcs[irq]; + if (intr_isrc_dispatch(&tgi->isrc, tf) != 0) { + /* Disable stray. */ + tegra_pcib_isrc_mask(sc, tgi, 0); + device_printf(sc->dev, + "Stray irq %u disabled\n", irq); + } + reg = AFI_RD4(sc, AFI_MSI_VEC(i)); + } + } + return (FILTER_HANDLED); +} - /* validate parameters */ - if (isclr(&sc->msi_bitmap, irq)) { - device_printf(dev, "invalid MSI 0x%x\n", irq); - return (EINVAL); +static int +tegra_pcib_msi_attach(struct tegra_pcib_softc *sc) +{ + int error; + uint32_t irq; + const char *name; + + sc->isrcs = malloc(sizeof(*sc->isrcs) * TEGRA_PCIB_MAX_MSI, M_DEVBUF, + M_WAITOK | M_ZERO); + + name = device_get_nameunit(sc->dev); + for (irq = 0; irq < TEGRA_PCIB_MAX_MSI; irq++) { + sc->isrcs[irq].irq = irq; + error = intr_isrc_register(&sc->isrcs[irq].isrc, + sc->dev, 0, "%s,%u", name, irq); + if (error != 0) + return (error); /* XXX deregister ISRCs */ } + if (intr_msi_register(sc->dev, + OF_xref_from_node(ofw_bus_get_node(sc->dev))) != 0) + return (ENXIO); + + return (0); +} + +static int +tegra_pcib_msi_detach(struct tegra_pcib_softc *sc) +{ + + /* + * There has not been established any procedure yet + * how to detach PIC from living system correctly. + */ + device_printf(sc->dev, "%s: not implemented yet\n", __func__); + return (EBUSY); +} + + +static void +tegra_pcib_msi_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct tegra_pcib_softc *sc; + struct tegra_pcib_irqsrc *tgi; + + sc = device_get_softc(dev); + tgi = (struct tegra_pcib_irqsrc *)isrc; + tegra_pcib_isrc_mask(sc, tgi, 0); +} + +static void +tegra_pcib_msi_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct tegra_pcib_softc *sc; + struct tegra_pcib_irqsrc *tgi; + + sc = device_get_softc(dev); + tgi = (struct tegra_pcib_irqsrc *)isrc; + tegra_pcib_isrc_mask(sc, tgi, 1); +} + +/* MSI interrupts are edge trigered -> do nothing */ +static void +tegra_pcib_msi_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ +} + +static void +tegra_pcib_msi_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ +} + +static void +tegra_pcib_msi_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ +} + +static int +tegra_pcib_msi_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct tegra_pcib_softc *sc; + struct tegra_pcib_irqsrc *tgi; - tegra_msi_data(irq, addr, data); + sc = device_get_softc(dev); + tgi = (struct tegra_pcib_irqsrc *)isrc; - debugf("%s: irq: %d addr: %jx data: %x\n", - __func__, irq, *addr, *data); + if (data == NULL || data->type != INTR_MAP_DATA_MSI) + return (ENOTSUP); + + if (isrc->isrc_handlers == 0) + tegra_pcib_msi_enable_intr(dev, isrc); return (0); } static int -tegra_pcib_alloc_msi(device_t dev, device_t child, int count, - int maxcount __unused, int *irqs) +tegra_pcib_msi_teardown_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) { struct tegra_pcib_softc *sc; - u_int start = 0, i; + struct tegra_pcib_irqsrc *tgi; - if (powerof2(count) == 0 || count > MSI_IRQ_NUM) - return (EINVAL); + sc = device_get_softc(dev); + tgi = (struct tegra_pcib_irqsrc *)isrc; + + if (isrc->isrc_handlers == 0) + tegra_pcib_isrc_mask(sc, tgi, 0); + return (0); +} + + +static int +tegra_pcib_msi_alloc_msi(device_t dev, device_t child, int count, int maxcount, + device_t *pic, struct intr_irqsrc **srcs) +{ + struct tegra_pcib_softc *sc; + int i, irq, end_irq; + bool found; + + KASSERT(powerof2(count), ("%s: bad count", __func__)); + KASSERT(powerof2(maxcount), ("%s: bad maxcount", __func__)); sc = device_get_softc(dev); mtx_lock(&sc->mtx); - for (start = 0; (start + count) < MSI_IRQ_NUM; start++) { - for (i = start; i < start + count; i++) { - if (isset(&sc->msi_bitmap, i)) + found = false; + for (irq = 0; irq < TEGRA_PCIB_MAX_MSI && !found; irq++) { + /* Start on an aligned interrupt */ + if ((irq & (maxcount - 1)) != 0) + continue; + + /* Assume we found a valid range until shown otherwise */ + found = true; + + /* Check this range is valid */ + for (end_irq = irq; end_irq != irq + count - 1; end_irq++) { + /* No free interrupts */ + if (end_irq == (TEGRA_PCIB_MAX_MSI - 1)) { + found = false; + break; + } + + /* This is already used */ + if ((sc->isrcs[irq].flags & TEGRA_FLAG_MSI_USED) == + TEGRA_FLAG_MSI_USED) { + found = false; break; + } } - if (i == start + count) - break; } - if ((start + count) == MSI_IRQ_NUM) { + /* Not enough interrupts were found */ + if (!found || irq == (TEGRA_PCIB_MAX_MSI - 1)) { mtx_unlock(&sc->mtx); return (ENXIO); } - for (i = start; i < start + count; i++) { - setbit(&sc->msi_bitmap, i); - irqs[i] = MSI_IRQ + i; - } - debugf("%s: start: %x count: %x\n", __func__, start, count); + for (i = 0; i < count; i++) { + /* Mark the interrupt as used */ + sc->isrcs[irq + i].flags |= TEGRA_FLAG_MSI_USED; + } mtx_unlock(&sc->mtx); + + for (i = 0; i < count; i++) + srcs[i] = (struct intr_irqsrc *)&sc->isrcs[irq + i]; + *pic = device_get_parent(dev); return (0); } static int -tegra_pcib_release_msi(device_t dev, device_t child, int count, int *irqs) +tegra_pcib_msi_release_msi(device_t dev, device_t child, int count, + struct intr_irqsrc **isrc) { struct tegra_pcib_softc *sc; - u_int i; + struct tegra_pcib_irqsrc *ti; + int i; sc = device_get_softc(dev); mtx_lock(&sc->mtx); + for (i = 0; i < count; i++) { + ti = (struct tegra_pcib_irqsrc *)isrc; - for (i = 0; i < count; i++) - clrbit(&sc->msi_bitmap, irqs[i] - MSI_IRQ); + KASSERT((ti->flags & TEGRA_FLAG_MSI_USED) == TEGRA_FLAG_MSI_USED, + ("%s: Trying to release an unused MSI-X interrupt", + __func__)); - mtx_unlock(&sc->mtx); + ti->flags &= ~TEGRA_FLAG_MSI_USED; + mtx_unlock(&sc->mtx); + } + return (0); +} + +static int +tegra_pcib_msi_map_msi(device_t dev, device_t child, struct intr_irqsrc *isrc, + uint64_t *addr, uint32_t *data) +{ + struct tegra_pcib_softc *sc = device_get_softc(dev); + struct tegra_pcib_irqsrc *ti = (struct tegra_pcib_irqsrc *)isrc; + + *addr = vtophys(sc->msi_page); + *data = ti->irq; return (0); } #endif +/* ------------------------------------------------------------------- */ static bus_size_t tegra_pcib_pex_ctrl(struct tegra_pcib_softc *sc, int port) { @@ -1137,6 +1379,52 @@ tegra_pcib_enable(struct tegra_pcib_soft return(0); } +#ifdef TEGRA_PCIB_MSI_ENABLE +static int +tegra_pcib_attach_msi(device_t dev) +{ + struct tegra_pcib_softc *sc; + uint32_t reg; + int i, rv; + + sc = device_get_softc(dev); + + sc->msi_page = kmem_alloc_contig(kernel_arena, PAGE_SIZE, M_WAITOK, + 0, BUS_SPACE_MAXADDR, PAGE_SIZE, 0, VM_MEMATTR_DEFAULT); + + /* MSI BAR */ + tegra_pcib_set_bar(sc, 9, vtophys(sc->msi_page), vtophys(sc->msi_page), + PAGE_SIZE, 0); + + /* Disble and clear all interrupts. */ + for (i = 0; i < AFI_MSI_REGS; i++) { + AFI_WR4(sc, AFI_MSI_EN_VEC(i), 0); + AFI_WR4(sc, AFI_MSI_VEC(i), 0xFFFFFFFF); + } + rv = bus_setup_intr(dev, sc->msi_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + tegra_pcib_msi_intr, NULL, sc, &sc->msi_intr_cookie); + if (rv != 0) { + device_printf(dev, "cannot setup MSI interrupt handler\n"); + rv = ENXIO; + goto out; + } + + if (tegra_pcib_msi_attach(sc) != 0) { + device_printf(dev, "WARNING: unable to attach PIC\n"); + tegra_pcib_msi_detach(sc); + goto out; + } + + /* Unmask MSI interrupt. */ + reg = AFI_RD4(sc, AFI_INTR_MASK); + reg |= AFI_INTR_MASK_MSI_MASK; + AFI_WR4(sc, AFI_INTR_MASK, reg); + +out: + return (rv); +} +#endif + static int tegra_pcib_probe(device_t dev) { @@ -1254,7 +1542,7 @@ tegra_pcib_attach(device_t dev) goto out; if (bus_setup_intr(dev, sc->irq_res, INTR_TYPE_BIO | INTR_MPSAFE, - tegra_pci_intr, NULL, sc, &sc->intr_cookie)) { + tegra_pci_intr, NULL, sc, &sc->intr_cookie)) { device_printf(dev, "cannot setup interrupt handler\n"); rv = ENXIO; goto out; @@ -1275,6 +1563,11 @@ tegra_pcib_attach(device_t dev) tegra_pcib_port_disable(sc, i); } +#ifdef TEGRA_PCIB_MSI_ENABLE + rv = tegra_pcib_attach_msi(dev); + if (rv != 0) + goto out; +#endif device_add_child(dev, "pci", -1); return (bus_generic_attach(dev)); @@ -1299,11 +1592,24 @@ static device_method_t tegra_pcib_method DEVMETHOD(pcib_read_config, tegra_pcib_read_config), DEVMETHOD(pcib_write_config, tegra_pcib_write_config), DEVMETHOD(pcib_route_interrupt, tegra_pcib_route_interrupt), - -#if defined(TEGRA_PCI_MSI) DEVMETHOD(pcib_alloc_msi, tegra_pcib_alloc_msi), DEVMETHOD(pcib_release_msi, tegra_pcib_release_msi), DEVMETHOD(pcib_map_msi, tegra_pcib_map_msi), + +#ifdef TEGRA_PCIB_MSI_ENABLE + /* MSI/MSI-X */ + DEVMETHOD(msi_alloc_msi, tegra_pcib_msi_alloc_msi), + DEVMETHOD(msi_release_msi, tegra_pcib_msi_release_msi), + DEVMETHOD(msi_map_msi, tegra_pcib_msi_map_msi), + + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, tegra_pcib_msi_disable_intr), + DEVMETHOD(pic_enable_intr, tegra_pcib_msi_enable_intr), + DEVMETHOD(pic_setup_intr, tegra_pcib_msi_setup_intr), + DEVMETHOD(pic_teardown_intr, tegra_pcib_msi_teardown_intr), + DEVMETHOD(pic_post_filter, tegra_pcib_msi_post_filter), + DEVMETHOD(pic_post_ithread, tegra_pcib_msi_post_ithread), + DEVMETHOD(pic_pre_ithread, tegra_pcib_msi_pre_ithread), #endif /* OFW bus interface */ From owner-svn-src-all@freebsd.org Fri Aug 19 10:53:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D86FCBBF1B5; Fri, 19 Aug 2016 10:53:57 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A5AE51396; Fri, 19 Aug 2016 10:53:57 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by mail-pf0-x231.google.com with SMTP id p64so8584373pfb.1; Fri, 19 Aug 2016 03:53:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DUsprsfJ5orhssKgeIBNIS2lU+o4fO28+dew68RxHd0=; b=hkIlqssN8HDDCi7Pien8rfTJNIcYZgG+Fk+ZQGwxtTY+0NonckkAHxFM2jmp3ehNii llid1p01u9ZcF+O1Jvif4m+YEHNK5RoHIF/87rlwtUeUeXlE+ZXyI7K3oWRgGpjNZeOw BculfPDLWlugNssPrCvl8ASqAMFy7Q976sruJxum7PRfvSQZmapwQjoNZcqSbULlo89m JaCW5mSJLo8BiQibBK5wayfVddlsraGyImKxl/iIUWlUcmt33T0Uj3AgyciD2nu5HPeb L79S3pLEi8wH2ZMbQP1N043vM5O/XDrTp8Zz3G/G9PptpMgsZmtpXoeEtcZ1s1MFeqgu oNSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=DUsprsfJ5orhssKgeIBNIS2lU+o4fO28+dew68RxHd0=; b=FiXD1V526YFo7ghfULyhQBdZswt8lrZC5iQ7mhpqG88EeRn57zeodenyWtoxXdGQ6U JAMyINMqQ0QAiQfy34CDYexFJOY0gN9yJ7J8gHtx/etuc5W0hr6Pqpogj05Pl8g3FmFn 8UFIlJ1+WbSRnC85rDigfi0TZfVtS/RTIXMm5OTJsZNO9FQu9gBG+k3SH3xQkJQ6t4AL BWJVGMntEwiprvNkcpaUkz7Qq45HWNiIOC6wuvWu77oFOx1BULcr4eeOGSKBhLdYMFOA kF8LUGG/ADEKTu0NvEfxahbvMEJ7VSjPnSU+jv9vOb3GU5Gq2iP+US5bkc7Z/BLng2lo nDSA== X-Gm-Message-State: AEkoousMYTmmj+PUGWktrlotMOQJbgmVMbRMyB0RcdG7K832UJZnAl8W7YKAogVbgBs8bg== X-Received: by 10.98.131.8 with SMTP id h8mr13181633pfe.124.1471604037307; Fri, 19 Aug 2016 03:53:57 -0700 (PDT) Received: from localhost ([106.247.248.2]) by smtp.gmail.com with ESMTPSA id g21sm5554805pfj.88.2016.08.19.03.53.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Aug 2016 03:53:56 -0700 (PDT) From: YongHyeon PYUN X-Google-Original-From: "YongHyeon PYUN" Received: by localhost (sSMTP sendmail emulation); Fri, 19 Aug 2016 19:53:49 +0900 Date: Fri, 19 Aug 2016 19:53:49 +0900 To: Hans Petter Selasky Cc: Pyun YongHyeon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304439 - head/sys/dev/usb/net Message-ID: <20160819105349.GJ1186@michelle.fasterthan.co.kr> Reply-To: pyunyh@gmail.com References: <201608190050.u7J0oWkW043171@repo.freebsd.org> <464a63e6-e96c-a2d5-099d-ae9059fa0877@selasky.org> <20160819085511.GF1186@michelle.fasterthan.co.kr> <2e8143d4-eb32-693d-e5a4-49c380c100df@selasky.org> <20160819092223.GG1186@michelle.fasterthan.co.kr> <63a25b6b-4503-b136-7765-7744108db1a1@selasky.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <63a25b6b-4503-b136-7765-7744108db1a1@selasky.org> User-Agent: Mutt/1.4.2.3i X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 10:53:57 -0000 On Fri, Aug 19, 2016 at 12:39:58PM +0200, Hans Petter Selasky wrote: > On 08/19/16 11:22, YongHyeon PYUN wrote: > >On Fri, Aug 19, 2016 at 11:11:56AM +0200, Hans Petter Selasky wrote: > >>On 08/19/16 10:55, YongHyeon PYUN wrote: > >>>I think the order is right but it was not tested on big-endian > >>>systems. > >> > >>Hi, > >> > >>I'm pretty sure the ifdef is wrong, because you write the fields one at > >>a time, using htole32(): > >> > >> txhdr.mss = 0; > >> txhdr.len = > >> htole32(AXGE_TXBYTES(m->m_pkthdr.len)); > >> > >>Big endian machines don't re-order variables like this. > >> > >>You should remove the #else part. > > > >Wouldn't USB stack pass txhdr structure without any > >modification? And controller want to see len (low 32bits address) > >first and then mss (high 32bits address). On big endian systems I > >guess this should be reversed in host memory layout. This is so > >confusing so I could be wrong. > > The USB stack passes TXHDR as-is and the host controller is byte > oriented, not 64-bit word oriented. That's why the layout is the same as > long as you assign per 32-bit field. > Ok, fixed in r304458. Thanks for pointing it out! From owner-svn-src-all@freebsd.org Fri Aug 19 11:13:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D846BBBF926; Fri, 19 Aug 2016 11:13:00 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB3AD1F16; Fri, 19 Aug 2016 11:13:00 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JBCxIx077775; Fri, 19 Aug 2016 11:12:59 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JBCxd6077774; Fri, 19 Aug 2016 11:12:59 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201608191112.u7JBCxd6077774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 19 Aug 2016 11:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304461 - head/sys/arm/nvidia 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 11:13:00 -0000 Author: mmel Date: Fri Aug 19 11:12:59 2016 New Revision: 304461 URL: https://svnweb.freebsd.org/changeset/base/304461 Log: TEGRA: Remove forgotten debug printf. Modified: head/sys/arm/nvidia/tegra_pcie.c Modified: head/sys/arm/nvidia/tegra_pcie.c ============================================================================== --- head/sys/arm/nvidia/tegra_pcie.c Fri Aug 19 10:53:17 2016 (r304460) +++ head/sys/arm/nvidia/tegra_pcie.c Fri Aug 19 11:12:59 2016 (r304461) @@ -567,7 +567,6 @@ tegra_pcib_msi_intr(void *arg) /* Handle one vector. */ while (reg != 0) { bit = ffs(reg) - 1; -//printf("%s: i: %d, reg: 0x%08X, bit: 0x%08X, addr: 0x%08llX\n", __func__, i, reg, bit, rman_get_start(sc->afi_mem_res)); /* Send EOI */ AFI_WR4(sc, AFI_MSI_VEC(i), 1 << bit); irq = i * AFI_MSI_INTR_IN_REG + bit; From owner-svn-src-all@freebsd.org Fri Aug 19 11:13:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31571BBF99F; Fri, 19 Aug 2016 11:13:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id CF1A811F7; Fri, 19 Aug 2016 11:13:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id E735FD66D23; Fri, 19 Aug 2016 21:12:53 +1000 (AEST) Date: Fri, 19 Aug 2016 21:12:53 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Warner Losh , Julian Elischer , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd In-Reply-To: <20160819073955.GC83214@kib.kiev.ua> Message-ID: <20160819202010.Y2407@besplex.bde.org> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=EfU1O6SC c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=hW_HMr3p4KBcaiv7OY0A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 11:13:31 -0000 On Fri, 19 Aug 2016, Konstantin Belousov wrote: > On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: >> On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer wrote: >>> On 16/08/2016 4:54 AM, John Baldwin wrote: >>>> >>>> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >>>>> ,,, >>>>> Log: >>>>> Remove the mcd(4) driver for Mitsumi CD-ROM players. >>>>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in >>>>> the manpage, this driver is only useful as a backend to cdcontrol to >>>>> play audio CDs since it doesn't use DMA, so its data performance is >>>>> "abysmal" (and that was true in the mid 90's). >>>> >>>> No one stepped up to test patches for it either when I last posted patches >>>> to >>>> convert it from timeout(9) to callout(9). I have a few more drivers that >>>> are >>>> ... >>> >>> I would imagine any machine still holding one of these probably has not >>> enough memory to run FreeBSD. >>> >>> would we still run in 2MB? >> >> With insane levels of tuning, we can run in 32MB userland that can do >> things. Even 64MB is tight w/o some tuning. 16MB is almost certainly >> right out except for very specialized situations. 2MB? We can't even >> load the loader in that :(. Oh, and all these memory configs are only >> possible if you tweak the loader's block cache... > > 32MB is quite usable. Without any tuning, you get slightly less than 10MB > for userspace, which is enough to for many things, and plenty if swap is > added. No, 32MB needs lots of needs tuning. -current seems to need about 16MB more than just a few months ago when I last discussed this with you. My i386 system doesn't have many drivers or a bloated userland (*), but it took the following tuning plus my PAE tuning fixes to boot in 32MB: - disable [l]em1 - reduce tx and buffers to 256 for em0. They default to 4096 for em. That is something like 8K * 1500 bytes = 12MB for em0 alone. lem[1] wants another 12MB. I think this is not all statically allocated, but the drivers hang onto that much. This now longer works. -current without my PAE tuning fixes hangs mounting root or in usb initialization with this tuning and 40MB. -current with my PAE tuning fixes hangs similarly with 32MB; with 40MB it boots to the start of multiuser but then hangs (it starts 1 getty, then 2 sendmails and kills them with "out of swap space") and 1 rpcbind (also killed). I don't use swap, but it was needed 20 years ago on a system that actually had 32MB of memory. (*) /bin/sh doing nothing much in -current i386: size 6532K res 1924K /bin/sh in my ~5.2 i386: size 864K res 592K The kernel size is 5.5MB text 370K data 2.2MB bss (lots of bloat in bss for debugging and vt). In single user mode, with 40MB to start, there is 22116K wired and 2516K free. A few programs can be run in 2516K without swap if they have res 592K and not 1924K. > Note that you cannot boot on such configurations since loader was broken, > but if you do manage to jump to kernel, things were fine several months > ago. I tested my relatively recent OOM changes on 32MB qemu config. I have no problems booting such configuratations since I don't use the current loader and only use old loader to change the environment to set up special configurations like this. I use my version of biosboot for boot2. This requires fixing 2 layers of complicated breakage in init386(). vm86 is now used before the TSS and PIC resources that it uses are initialized, but only in paths that are not normally used because they are for memory sizing that is normally done by loader :-(. I normally use my version of biosboot for boot2. I improved its caching just a couple of years ago. It was using 9K buffer optimized for 1440K floppies. Now it uses a 32K buffer. Booting a 5.5MB kernel takes a fraction of a second. Of course I don't use modules, so not many seeks are needed. Bruce From owner-svn-src-all@freebsd.org Fri Aug 19 11:27:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E8E7BBFC7D; Fri, 19 Aug 2016 11:27:55 +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-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17FE116F3; Fri, 19 Aug 2016 11:27:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u7JBRdY8081111 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 19 Aug 2016 14:27:39 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u7JBRdY8081111 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u7JBRTo2081107; Fri, 19 Aug 2016 14:27:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 19 Aug 2016 14:27:29 +0300 From: Konstantin Belousov To: Bruce Evans Cc: Warner Losh , Julian Elischer , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd Message-ID: <20160819112729.GH83214@kib.kiev.ua> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> <20160819202010.Y2407@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160819202010.Y2407@besplex.bde.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 11:27:55 -0000 On Fri, Aug 19, 2016 at 09:12:53PM +1000, Bruce Evans wrote: > On Fri, 19 Aug 2016, Konstantin Belousov wrote: > > > On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: > >> On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer wrote: > >>> On 16/08/2016 4:54 AM, John Baldwin wrote: > >>>> > >>>> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: > >>>>> ,,, > >>>>> Log: > >>>>> Remove the mcd(4) driver for Mitsumi CD-ROM players. > >>>>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in > >>>>> the manpage, this driver is only useful as a backend to cdcontrol to > >>>>> play audio CDs since it doesn't use DMA, so its data performance is > >>>>> "abysmal" (and that was true in the mid 90's). > >>>> > >>>> No one stepped up to test patches for it either when I last posted patches > >>>> to > >>>> convert it from timeout(9) to callout(9). I have a few more drivers that > >>>> are > >>>> ... > >>> > >>> I would imagine any machine still holding one of these probably has not > >>> enough memory to run FreeBSD. > >>> > >>> would we still run in 2MB? > >> > >> With insane levels of tuning, we can run in 32MB userland that can do > >> things. Even 64MB is tight w/o some tuning. 16MB is almost certainly > >> right out except for very specialized situations. 2MB? We can't even > >> load the loader in that :(. Oh, and all these memory configs are only > >> possible if you tweak the loader's block cache... > > > > 32MB is quite usable. Without any tuning, you get slightly less than 10MB > > for userspace, which is enough to for many things, and plenty if swap is > > added. > > No, 32MB needs lots of needs tuning. -current seems to need about 16MB > more than just a few months ago when I last discussed this with you. > My i386 system doesn't have many drivers or a bloated userland (*), > but it took the following tuning plus my PAE tuning fixes to boot in > 32MB: > - disable [l]em1 > - reduce tx and buffers to 256 for em0. They default to 4096 for em. That > is something like 8K * 1500 bytes = 12MB for em0 alone. lem[1] wants > another 12MB. I think this is not all statically allocated, but the > drivers hang onto that much. > This now longer works. -current without my PAE tuning fixes hangs mounting > root or in usb initialization with this tuning and 40MB. -current with my > PAE tuning fixes hangs similarly with 32MB; with 40MB it boots to the > start of multiuser but then hangs (it starts 1 getty, then 2 sendmails > and kills them with "out of swap space") and 1 rpcbind (also killed). I > don't use swap, but it was needed 20 years ago on a system that actually > had 32MB of memory. > > (*) /bin/sh doing nothing much in -current i386: size 6532K res 1924K > /bin/sh in my ~5.2 i386: size 864K res 592K > > The kernel size is 5.5MB text 370K data 2.2MB bss (lots of bloat in bss > for debugging and vt). In single user mode, with 40MB to start, there > is 22116K wired and 2516K free. A few programs can be run in 2516K > without swap if they have res 592K and not 1924K. > > > Note that you cannot boot on such configurations since loader was broken, > > but if you do manage to jump to kernel, things were fine several months > > ago. I tested my relatively recent OOM changes on 32MB qemu config. > > I have no problems booting such configuratations since I don't use the > current loader and only use old loader to change the environment to > set up special configurations like this. I use my version of biosboot > for boot2. This requires fixing 2 layers of complicated breakage in > init386(). vm86 is now used before the TSS and PIC resources that it > uses are initialized, but only in paths that are not normally used > because they are for memory sizing that is normally done by loader > :-(. > > I normally use my version of biosboot for boot2. I improved its caching > just a couple of years ago. It was using 9K buffer optimized for 1440K > floppies. Now it uses a 32K buffer. Booting a 5.5MB kernel takes a > fraction of a second. Of course I don't use modules, so not many seeks > are needed. Of course I use modules and do not use GENERIC. I just tried: with today HEAD, and old loader on 32MB VM, I get 11MB free in single-user mode. Active+inactive is ~4MB, and 1M is eaten by buffers, which is about right for init+/bin/sh+top idle system. Anyway, judging from the other responses, this is the lost case. From owner-svn-src-all@freebsd.org Fri Aug 19 11:31:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88C25BBFD49; Fri, 19 Aug 2016 11:31:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4DFBD196C; Fri, 19 Aug 2016 11:31:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JBVU29084611; Fri, 19 Aug 2016 11:31:30 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JBVUnK084610; Fri, 19 Aug 2016 11:31:30 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201608191131.u7JBVUnK084610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 19 Aug 2016 11:31:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304462 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 11:31:31 -0000 Author: kp Date: Fri Aug 19 11:31:30 2016 New Revision: 304462 URL: https://svnweb.freebsd.org/changeset/base/304462 Log: MFC r304152: pf: Add missing byte-order swap to pf_match_addr_range Without this, rules using address ranges (e.g. "10.1.1.1 - 10.1.1.5") did not match addresses correctly on little-endian systems. PR: 211796 Obtained from: OpenBSD (sthen) Modified: stable/11/sys/netpfil/pf/pf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf.c ============================================================================== --- stable/11/sys/netpfil/pf/pf.c Fri Aug 19 11:12:59 2016 (r304461) +++ stable/11/sys/netpfil/pf/pf.c Fri Aug 19 11:31:30 2016 (r304462) @@ -2600,8 +2600,8 @@ pf_match_addr_range(struct pf_addr *b, s switch (af) { #ifdef INET case AF_INET: - if ((a->addr32[0] < b->addr32[0]) || - (a->addr32[0] > e->addr32[0])) + if ((ntohl(a->addr32[0]) < ntohl(b->addr32[0])) || + (ntohl(a->addr32[0]) > ntohl(e->addr32[0]))) return (0); break; #endif /* INET */ @@ -2611,15 +2611,15 @@ pf_match_addr_range(struct pf_addr *b, s /* check a >= b */ for (i = 0; i < 4; ++i) - if (a->addr32[i] > b->addr32[i]) + if (ntohl(a->addr32[i]) > ntohl(b->addr32[i])) break; - else if (a->addr32[i] < b->addr32[i]) + else if (ntohl(a->addr32[i]) < ntohl(b->addr32[i])) return (0); /* check a <= e */ for (i = 0; i < 4; ++i) - if (a->addr32[i] < e->addr32[i]) + if (ntohl(a->addr32[i]) < ntohl(e->addr32[i])) break; - else if (a->addr32[i] > e->addr32[i]) + else if (ntohl(a->addr32[i]) > ntohl(e->addr32[i])) return (0); break; } From owner-svn-src-all@freebsd.org Fri Aug 19 11:36:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6945DBBFF53; Fri, 19 Aug 2016 11:36:01 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E8051DE4; Fri, 19 Aug 2016 11:36:01 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JBa0eH085502; Fri, 19 Aug 2016 11:36:00 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JBa0CR085501; Fri, 19 Aug 2016 11:36:00 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201608191136.u7JBa0CR085501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 19 Aug 2016 11:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304463 - stable/10/sys/netpfil/pf X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 11:36:01 -0000 Author: kp Date: Fri Aug 19 11:36:00 2016 New Revision: 304463 URL: https://svnweb.freebsd.org/changeset/base/304463 Log: MFC r304152: pf: Add missing byte-order swap to pf_match_addr_range Without this, rules using address ranges (e.g. "10.1.1.1 - 10.1.1.5") did not match addresses correctly on little-endian systems. PR: 211796 Obtained from: OpenBSD (sthen) Modified: stable/10/sys/netpfil/pf/pf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netpfil/pf/pf.c ============================================================================== --- stable/10/sys/netpfil/pf/pf.c Fri Aug 19 11:31:30 2016 (r304462) +++ stable/10/sys/netpfil/pf/pf.c Fri Aug 19 11:36:00 2016 (r304463) @@ -2564,8 +2564,8 @@ pf_match_addr_range(struct pf_addr *b, s switch (af) { #ifdef INET case AF_INET: - if ((a->addr32[0] < b->addr32[0]) || - (a->addr32[0] > e->addr32[0])) + if ((ntohl(a->addr32[0]) < ntohl(b->addr32[0])) || + (ntohl(a->addr32[0]) > ntohl(e->addr32[0]))) return (0); break; #endif /* INET */ @@ -2575,15 +2575,15 @@ pf_match_addr_range(struct pf_addr *b, s /* check a >= b */ for (i = 0; i < 4; ++i) - if (a->addr32[i] > b->addr32[i]) + if (ntohl(a->addr32[i]) > ntohl(b->addr32[i])) break; - else if (a->addr32[i] < b->addr32[i]) + else if (ntohl(a->addr32[i]) < ntohl(b->addr32[i])) return (0); /* check a <= e */ for (i = 0; i < 4; ++i) - if (a->addr32[i] < e->addr32[i]) + if (ntohl(a->addr32[i]) < ntohl(e->addr32[i])) break; - else if (a->addr32[i] > e->addr32[i]) + else if (ntohl(a->addr32[i]) > ntohl(e->addr32[i])) return (0); break; } From owner-svn-src-all@freebsd.org Fri Aug 19 12:48:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5753BBE53A; Fri, 19 Aug 2016 12:48:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7788F1FDC; Fri, 19 Aug 2016 12:48:33 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JCmWjm011785; Fri, 19 Aug 2016 12:48:32 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JCmWOM011783; Fri, 19 Aug 2016 12:48:32 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608191248.u7JCmWOM011783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Aug 2016 12:48:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304464 - in head/sys/arm/allwinner: . a10 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 12:48:33 -0000 Author: manu Date: Fri Aug 19 12:48:32 2016 New Revision: 304464 URL: https://svnweb.freebsd.org/changeset/base/304464 Log: Allwinner: Move a10_padconf.c into a10 subdirectory. Added: head/sys/arm/allwinner/a10/a10_padconf.c - copied unchanged from r304463, head/sys/arm/allwinner/a10_padconf.c Deleted: head/sys/arm/allwinner/a10_padconf.c Modified: head/sys/arm/allwinner/a10/files.a10 Copied: head/sys/arm/allwinner/a10/a10_padconf.c (from r304463, head/sys/arm/allwinner/a10_padconf.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/a10/a10_padconf.c Fri Aug 19 12:48:32 2016 (r304464, copy of r304463, head/sys/arm/allwinner/a10_padconf.c) @@ -0,0 +1,231 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include + +#ifdef SOC_ALLWINNER_A10 + +const static struct allwinner_pins a10_pins[] = { + {"PA0", 0, 0, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, + {"PA1", 0, 1, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, + {"PA2", 0, 2, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, + {"PA3", 0, 3, {"gpio_in", "gpio_out", "emac", "spi1", "uart2", NULL, NULL, NULL}}, + {"PA4", 0, 4, {"gpio_in", "gpio_out", "emac", "spi1", NULL, NULL, NULL, NULL}}, + {"PA5", 0, 5, {"gpio_in", "gpio_out", "emac", "spi3", NULL, NULL, NULL, NULL}}, + {"PA6", 0, 6, {"gpio_in", "gpio_out", "emac", "spi3", NULL, NULL, NULL, NULL}}, + {"PA7", 0, 7, {"gpio_in", "gpio_out", "emac", "spi3", NULL, NULL, NULL, NULL}}, + {"PA8", 0, 8, {"gpio_in", "gpio_out", "emac", "spi3", NULL, NULL, NULL, NULL}}, + {"PA9", 0, 9, {"gpio_in", "gpio_out", "emac", "spi3", NULL, NULL, NULL, NULL}}, + {"PA10", 0, 10, {"gpio_in", "gpio_out", "emac", NULL, "uart1", NULL, NULL, NULL}}, + {"PA11", 0, 11, {"gpio_in", "gpio_out", "emac", NULL, "uart1", NULL, NULL, NULL}}, + {"PA12", 0, 12, {"gpio_in", "gpio_out", "emac", "uart6", "uart1", NULL, NULL, NULL}}, + {"PA13", 0, 13, {"gpio_in", "gpio_out", "emac", "uart6", "uart1", NULL, NULL, NULL}}, + {"PA14", 0, 14, {"gpio_in", "gpio_out", "emac", "uart7", "uart1", NULL, NULL, NULL}}, + {"PA15", 0, 15, {"gpio_in", "gpio_out", "emac", "uart7", "uart1", NULL, NULL, NULL}}, + {"PA16", 0, 16, {"gpio_in", "gpio_out", NULL, "can", "uart1", NULL, NULL, NULL}}, + {"PA17", 0, 17, {"gpio_in", "gpio_out", NULL, "can", "uart1", NULL, NULL, NULL}}, + + {"PB0", 1, 0, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, + {"PB1", 1, 1, {"gpio_in", "gpio_out", "i2c0", NULL, NULL, NULL, NULL, NULL}}, + {"PB2", 1, 2, {"gpio_in", "gpio_out", "pwm", NULL, NULL, NULL, NULL, NULL}}, + {"PB3", 1, 3, {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, NULL, NULL}}, + {"PB4", 1, 4, {"gpio_in", "gpio_out", "ir0", NULL, NULL, NULL, NULL, NULL}}, + {"PB5", 1, 5, {"gpio_in", "gpio_out", "i2s", "ac97", NULL, NULL, NULL, NULL}}, + {"PB6", 1, 6, {"gpio_in", "gpio_out", "i2s", "ac97", NULL, NULL, NULL, NULL}}, + {"PB7", 1, 7, {"gpio_in", "gpio_out", "i2s", "ac97", NULL, NULL, NULL, NULL}}, + {"PB8", 1, 8, {"gpio_in", "gpio_out", "i2s", "ac97", NULL, NULL, NULL, NULL}}, + {"PB9", 1, 9, {"gpio_in", "gpio_out", "i2s", NULL, NULL, NULL, NULL, NULL}}, + {"PB10", 1, 10, {"gpio_in", "gpio_out", "i2s", NULL, NULL, NULL, NULL, NULL}}, + {"PB11", 1, 11, {"gpio_in", "gpio_out", "i2s", NULL, NULL, NULL, NULL, NULL}}, + {"PB12", 1, 12, {"gpio_in", "gpio_out", "i2s", "ac97", NULL, NULL, NULL, NULL}}, + {"PB13", 1, 13, {"gpio_in", "gpio_out", "spi2", NULL, NULL, NULL, NULL, NULL}}, + {"PB14", 1, 14, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB15", 1, 15, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB16", 1, 16, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB17", 1, 17, {"gpio_in", "gpio_out", "spi2", "jtag", NULL, NULL, NULL, NULL}}, + {"PB18", 1, 18, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB19", 1, 19, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB20", 1, 20, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB21", 1, 21, {"gpio_in", "gpio_out", "i2c1", NULL, NULL, NULL, NULL, NULL}}, + {"PB22", 1, 22, {"gpio_in", "gpio_out", "uart0", "ir1", NULL, NULL, NULL, NULL}}, + {"PB23", 1, 23, {"gpio_in", "gpio_out", "uart0", "ir1", NULL, NULL, NULL, NULL}}, + + {"PC0", 2, 0, {"gpio_in", "gpio_out", "nand", "spi0", NULL, NULL, NULL, NULL}}, + {"PC1", 2, 1, {"gpio_in", "gpio_out", "nand", "spi0", NULL, NULL, NULL, NULL}}, + {"PC2", 2, 2, {"gpio_in", "gpio_out", "nand", "spi0", NULL, NULL, NULL, NULL}}, + {"PC3", 2, 3, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC4", 2, 4, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC5", 2, 5, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC6", 2, 6, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC7", 2, 7, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC8", 2, 8, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC9", 2, 9, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC10", 2, 10, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC11", 2, 11, {"gpio_in", "gpio_out", "nand", "mmc2", NULL, NULL, NULL, NULL}}, + {"PC12", 2, 12, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC13", 2, 13, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC14", 2, 14, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC15", 2, 15, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC16", 2, 16, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC17", 2, 17, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC18", 2, 18, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + {"PC19", 2, 19, {"gpio_in", "gpio_out", "nand", "spi2", NULL, NULL, NULL, NULL}}, + {"PC20", 2, 20, {"gpio_in", "gpio_out", "nand", "spi2", NULL, NULL, NULL, NULL}}, + {"PC21", 2, 21, {"gpio_in", "gpio_out", "nand", "spi2", NULL, NULL, NULL, NULL}}, + {"PC22", 2, 22, {"gpio_in", "gpio_out", "nand", "spi2", NULL, NULL, NULL, NULL}}, + {"PC23", 2, 23, {"gpio_in", "gpio_out", "spi0", NULL, NULL, NULL, NULL, NULL}}, + {"PC24", 2, 24, {"gpio_in", "gpio_out", "nand", NULL, NULL, NULL, NULL, NULL}}, + + {"PD0", 3, 0, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD1", 3, 1, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD2", 3, 2, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD3", 3, 3, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD4", 3, 4, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD5", 3, 5, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD6", 3, 6, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD7", 3, 7, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD8", 3, 8, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD9", 3, 9, {"gpio_in", "gpio_out", "lcd0", "lvds0", NULL, NULL, NULL, NULL}}, + {"PD10", 3, 10, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD11", 3, 11, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD12", 3, 12, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD13", 3, 13, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD14", 3, 14, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD15", 3, 15, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD16", 3, 16, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD17", 3, 17, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD18", 3, 18, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD19", 3, 19, {"gpio_in", "gpio_out", "lcd0", "lvds1", NULL, NULL, NULL, NULL}}, + {"PD20", 3, 20, {"gpio_in", "gpio_out", "lcd0", "csi1", NULL, NULL, NULL, NULL}}, + {"PD21", 3, 21, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD22", 3, 22, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD23", 3, 23, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD24", 3, 24, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD25", 3, 25, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD26", 3, 26, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + {"PD27", 3, 27, {"gpio_in", "gpio_out", "lcd0", "sim", NULL, NULL, NULL, NULL}}, + + {"PE0", 4, 0, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE1", 4, 1, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE2", 4, 2, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE3", 4, 3, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE4", 4, 4, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE5", 4, 5, {"gpio_in", "gpio_out", "ts0", "csi0", "sim", NULL, NULL, NULL}}, + {"PE6", 4, 6, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE7", 4, 7, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE8", 4, 8, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE9", 4, 9, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE10", 4, 10, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + {"PE11", 4, 11, {"gpio_in", "gpio_out", "ts0", "csi0", NULL, NULL, NULL, NULL}}, + + {"PF0", 5, 0, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF1", 5, 1, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF2", 5, 2, {"gpio_in", "gpio_out", "mmc0", NULL, "uart0", NULL, NULL, NULL}}, + {"PF3", 5, 3, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF4", 5, 4, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + {"PF5", 5, 5, {"gpio_in", "gpio_out", "mmc0", NULL, "jtag", NULL, NULL, NULL}}, + + {"PG0", 6, 0, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG1", 6, 1, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG2", 6, 2, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG3", 6, 3, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", NULL, NULL, NULL}}, + {"PG4", 6, 4, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", "csi0", NULL, NULL}}, + {"PG5", 6, 5, {"gpio_in", "gpio_out", "ts1", "csi1", "mmc1", "csi0", NULL, NULL}}, + {"PG6", 6, 6, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG7", 6, 7, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG8", 6, 8, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG9", 6, 9, {"gpio_in", "gpio_out", "ts1", "csi1", "uart3", "csi0", NULL, NULL}}, + {"PG10", 6, 10, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, + {"PG11", 6, 11, {"gpio_in", "gpio_out", "ts1", "csi1", "uart4", "csi0", NULL, NULL}}, + + {"PH0", 7, 0, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}}, + {"PH1", 7, 1, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}}, + {"PH2", 7, 2, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}}, + {"PH3", 7, 3, {"gpio_in", "gpio_out", "lcd1", "pata", "uart3", NULL, "eint", "csi1"}}, + {"PH4", 7, 4, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint", "csi1"}}, + {"PH5", 7, 5, {"gpio_in", "gpio_out", "lcd1", "pata", "uart4", NULL, "eint", "csi1"}}, + {"PH6", 7, 6, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint", "csi1"}}, + {"PH7", 7, 7, {"gpio_in", "gpio_out", "lcd1", "pata", "uart5", "ms", "eint", "csi1"}}, + {"PH8", 7, 8, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}}, + {"PH9", 7, 9, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}}, + {"PH10", 7, 10, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}}, + {"PH11", 7, 11, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "ms", "eint", "csi1"}}, + {"PH12", 7, 12, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", NULL, "eint", "csi1"}}, + {"PH13", 7, 13, {"gpio_in", "gpio_out", "lcd1", "pata", "ps2", "sim", "eint", "csi1"}}, + {"PH14", 7, 14, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}}, + {"PH15", 7, 15, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}}, + {"PH16", 7, 16, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", NULL, "eint", "csi1"}}, + {"PH17", 7, 17, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}}, + {"PH18", 7, 18, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}}, + {"PH19", 7, 19, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "sim", "eint", "csi1"}}, + {"PH20", 7, 20, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint", "csi1"}}, + {"PH21", 7, 21, {"gpio_in", "gpio_out", "lcd1", "pata", "can", NULL, "eint", "csi1"}}, + {"PH22", 7, 22, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + {"PH23", 7, 23, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + {"PH24", 7, 24, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + {"PH25", 7, 25, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + {"PH26", 7, 26, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + {"PH27", 7, 27, {"gpio_in", "gpio_out", "lcd1", "pata", "keypad", "mmc1", NULL, "csi1"}}, + + {"PI0", 8, 0, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PI1", 8, 1, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PI2", 8, 2, {"gpio_in", "gpio_out", NULL, NULL, NULL, NULL, NULL, NULL}}, + {"PI3", 8, 3, {"gpio_in", "gpio_out", "pwm", NULL, NULL, NULL, NULL, NULL}}, + {"PI4", 8, 4, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI5", 8, 5, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI6", 8, 6, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI7", 8, 7, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI8", 8, 8, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI9", 8, 9, {"gpio_in", "gpio_out", "mmc3", NULL, NULL, NULL, NULL, NULL}}, + {"PI10", 8, 10, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint", NULL}}, + {"PI11", 8, 11, {"gpio_in", "gpio_out", "spi0", "uart5", NULL, NULL, "eint", NULL}}, + {"PI12", 8, 12, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "eint", NULL}}, + {"PI13", 8, 13, {"gpio_in", "gpio_out", "spi0", "uart6", NULL, NULL, "eint", NULL}}, + {"PI14", 8, 14, {"gpio_in", "gpio_out", "spi0", "ps2", "timer4", NULL, "eint", NULL}}, + {"PI15", 8, 15, {"gpio_in", "gpio_out", "spi1", "ps2", "timer5", NULL, "eint", NULL}}, + {"PI16", 8, 16, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI17", 8, 17, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI18", 8, 18, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI19", 8, 19, {"gpio_in", "gpio_out", "spi1", "uart2", NULL, NULL, "eint", NULL}}, + {"PI20", 8, 20, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, + {"PI21", 8, 21, {"gpio_in", "gpio_out", "ps2", "uart7", "hdmi", NULL, NULL, NULL}}, +}; + +const struct allwinner_padconf a10_padconf = { + .npins = sizeof(a10_pins) / sizeof(struct allwinner_pins), + .pins = a10_pins, +}; + +#endif /* SOC_ALLWINNER_A10 */ Modified: head/sys/arm/allwinner/a10/files.a10 ============================================================================== --- head/sys/arm/allwinner/a10/files.a10 Fri Aug 19 11:36:00 2016 (r304463) +++ head/sys/arm/allwinner/a10/files.a10 Fri Aug 19 12:48:32 2016 (r304464) @@ -1,4 +1,4 @@ # $FreeBSD$ arm/allwinner/a10/a10_intc.c standard -arm/allwinner/a10_padconf.c standard +arm/allwinner/a10/a10_padconf.c standard From owner-svn-src-all@freebsd.org Fri Aug 19 13:39:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00262BBF59B; Fri, 19 Aug 2016 13:39:15 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id E4FD41735; Fri, 19 Aug 2016 13:39:15 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id E30E818D8; Fri, 19 Aug 2016 13:39:15 +0000 (UTC) Date: Fri, 19 Aug 2016 13:39:15 +0000 From: Alexey Dokuchaev To: Bruce Evans Cc: Konstantin Belousov , src-committers , John Baldwin , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Julian Elischer , Warner Losh Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd Message-ID: <20160819133915.GA8791@FreeBSD.org> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> <20160819202010.Y2407@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160819202010.Y2407@besplex.bde.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 13:39:16 -0000 On Fri, Aug 19, 2016 at 09:12:53PM +1000, Bruce Evans wrote: > I normally use my version of biosboot for boot2. I improved its caching > just a couple of years ago. It was using 9K buffer optimized for 1440K > floppies. Now it uses a 32K buffer. Booting a 5.5MB kernel takes a > fraction of a second. That looks like change that everyone would benefit from. Consider posting a patch or committing it yourself. ;-) > Of course I don't use modules, so not many seeks are needed. Why not, they're convenient (apart from "kernel version mismatch" crap that I keep hitting now and then)? AFAIR they were slow to load at some point but that was (not so) recently fixed. ./danfe From owner-svn-src-all@freebsd.org Fri Aug 19 13:39:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3102DBBF608; Fri, 19 Aug 2016 13:39:38 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 010AD18C2; Fri, 19 Aug 2016 13:39:37 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JDdbC5030371; Fri, 19 Aug 2016 13:39:37 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JDdboG030370; Fri, 19 Aug 2016 13:39:37 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201608191339.u7JDdboG030370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 19 Aug 2016 13:39:37 +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: r304466 - stable/9/sys/contrib/pf/net 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 13:39:38 -0000 Author: kp Date: Fri Aug 19 13:39:36 2016 New Revision: 304466 URL: https://svnweb.freebsd.org/changeset/base/304466 Log: MFC r304152: pf: Add missing byte-order swap to pf_match_addr_range Without this, rules using address ranges (e.g. "10.1.1.1 - 10.1.1.5") did not match addresses correctly on little-endian systems. PR: 211796 Obtained from: OpenBSD (sthen) Modified: stable/9/sys/contrib/pf/net/pf.c Modified: stable/9/sys/contrib/pf/net/pf.c ============================================================================== --- stable/9/sys/contrib/pf/net/pf.c Fri Aug 19 13:12:57 2016 (r304465) +++ stable/9/sys/contrib/pf/net/pf.c Fri Aug 19 13:39:36 2016 (r304466) @@ -2691,8 +2691,8 @@ pf_match_addr_range(struct pf_addr *b, s switch (af) { #ifdef INET case AF_INET: - if ((a->addr32[0] < b->addr32[0]) || - (a->addr32[0] > e->addr32[0])) + if ((ntohl(a->addr32[0]) < ntohl(b->addr32[0])) || + (ntohl(a->addr32[0]) > ntohl(e->addr32[0]))) return (0); break; #endif /* INET */ @@ -2702,15 +2702,15 @@ pf_match_addr_range(struct pf_addr *b, s /* check a >= b */ for (i = 0; i < 4; ++i) - if (a->addr32[i] > b->addr32[i]) + if (ntohl(a->addr32[i]) > ntohl(b->addr32[i])) break; - else if (a->addr32[i] < b->addr32[i]) + else if (ntohl(a->addr32[i]) < ntohl(b->addr32[i])) return (0); /* check a <= e */ for (i = 0; i < 4; ++i) - if (a->addr32[i] < e->addr32[i]) + if (ntohl(a->addr32[i]) < ntohl(e->addr32[i])) break; - else if (a->addr32[i] > e->addr32[i]) + else if (ntohl(a->addr32[i]) > ntohl(e->addr32[i])) return (0); break; } From owner-svn-src-all@freebsd.org Fri Aug 19 14:13:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 248AFBBE4EF for ; Fri, 19 Aug 2016 14:13:51 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E0CD8199F for ; Fri, 19 Aug 2016 14:13:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x230.google.com with SMTP id b62so49261920iod.3 for ; Fri, 19 Aug 2016 07:13:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=i/l9y0cd+WJ0StxFQT7PRdsgnq1drneC5zZXUyUN4EI=; b=h3VI5Z15zKUhIuFHcB604BR38Y6impG5WVCTwG6h3jxnuPA+R9OFt8iEPkCYQpDqHT Q0X/KMODso2LganiDn3eyH6f/yo3Z6MN3O+z9L+e/5WN8DQgzJ+zPhSxBvsdoUHPf3Hu GB9e+gjD9G8dTXN9JWRJ4HsR9RzVGBNgkOtR/vWWJIOSy9mnpBOdF4CBsxwgN06FCv55 dzk3VcPCIjA3NODSY0ZNWVzwmTHCXuZClRgGwNDYqdvE3YJ6TA/vIFCqf0q3C5J0471B /Vfiz019zx9kuFog53DWEfkVcnLyBQkIsdKFUhFs4Fri+o45tHi0/QdH9QumcHn/lSil Uo6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=i/l9y0cd+WJ0StxFQT7PRdsgnq1drneC5zZXUyUN4EI=; b=SdGA6jh50XgVFlNb76LBEE6j9Y2PU3WKhkj0WqcKi+lOC5GC24vzTfIX/+NBFI1Crc p7YL2FkDIgw4Aefk3qJSZZZss3uy0Hci/VVsgY84FnG6KbLy7LAkflrGhnclTp4qYSZy MOS39c/mxMiY33zetI1txoGcKWQBZT/JCpckngQ4cMPLf2Byx6jM6Tu0Gfc65qa4sAsW 9Fqak2U8SMdlflHXfp++zywmBF1GHUnbZzQ8eAMgh+auaP268ZZtDpE6ECgLesF9dzWy Tsc5p0oUI7faoGtCIqm1TJGmxhiTs9IftdtUg8bMYzEL6Vpzn/0UNhjbg4wfPf44D2h2 wSDg== X-Gm-Message-State: AEkoouvDgXvd8yYvJIf1UFi6dgF1gg/++mY9DmDGL1C2ZjVCxR6Qf5b0AuPmT71ikh3vtS31s5pFF+7m1gJngg== X-Received: by 10.107.145.214 with SMTP id t205mr9727255iod.135.1471616029242; Fri, 19 Aug 2016 07:13:49 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Fri, 19 Aug 2016 07:13:48 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <86inuxckve.fsf@desk.des.no> References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> <86inuxckve.fsf@desk.des.no> From: Warner Losh Date: Fri, 19 Aug 2016 08:13:48 -0600 X-Google-Sender-Auth: -ojWIqbLySqMO4LZPvT22rT1mWY Message-ID: Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Cc: Allan Jude , Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 14:13:51 -0000 On Fri, Aug 19, 2016 at 12:51 AM, Dag-Erling Sm=C3=B8rgrav wro= te: > Warner Losh writes: >> Allan Jude writes: >> > Which makes more sense: >> > >> > A) If stripesize =3D=3D 0, use some sane value like 4096 >> >> I don't like this. >> >> > B) Some other combination that uses the reported stripe size, unless i= t >> > is 0, in which case it uses 4096 (or some other value controlled by a >> > different new sysctl) >> >> Don't like this so much. >> >> > C) create kern.geom.min_stripe_size with a default of 512, but users c= an >> > set 4096 if they use only 4k devices. (doesn't really solve the proble= m >> > for the installer) >> >> Default it to 4k, and allow users to set it to 512. If the drive >> reports < this value >> report this value instead. > > I don't like either option. Option D (which I don't like either, but > which should at least work in most cases) is a sysctl that specifies a > minimum factor, and set the reported stripe size to the least common > multiple of that number and the actual stripe or sector size. This is > what my bsdinstall patch does. However, I think that pushing this down > to a layer where it will affect all applications is a terrible idea, > because we have no way of knowing what will break[*], and it can > seriously mislead users and hinder troubleshooting - especially if it is > enabled by default rather than only when necessary. I took a look into the implications of doing a 4k stripesize 'automatically= ' this morning. I found a few places in g_part where it would actively hurt when coupled with gpart's insistence on aligning things. So I now think it's a bad idea. This will make it harder for FreeBSD to generate arbitrary disk layouts. And I'm not too sure about what things like gstripe would report as a result and if this would actually interfere if you had a large, but not power of two stripe size. > I don't think it's a good idea to enforce stripe alignment everywhere, > either. It works for partitions because they are very large relative to > the stripe size, and at worst we will waste a few millionths of the disk > on inter-partition gaps, which should only occur between the partition > table and the boot partition, and possibly, if the stripe size is very > large, between the boot partition and the swap partition. But forcing > filesystems to respect the stripe size will lead to no end of trouble, > because RAID volumes can have stripe sizes of 16 kB or more. I think it > is important to align partitions during installation because of the huge > performance impact of misaligned partitions on AF disks, but despite > what Nathan claims, I never advocated applying the same logic > everywhere. Yea, having poked at it for just a little while, I agree. The installer is = the right place to make sure we don't cross-thread the 4k sectors. Stripe size means too many other things to have it be useful in that context. Warner From owner-svn-src-all@freebsd.org Fri Aug 19 14:23:33 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8C59BBE717 for ; Fri, 19 Aug 2016 14:23:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE2901F92 for ; Fri, 19 Aug 2016 14:23:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22b.google.com with SMTP id 38so49719833iol.0 for ; Fri, 19 Aug 2016 07:23:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=zLVgCSfTZmemUtK+6Izrubttf8rBWRaCRFnMQRY18PY=; b=MAS2yod/C7uyF/Pf6SmxDkTwFNV39XCXP3GYo/6PCqMJj2laQz3ZD/GNItETZQejez Cift6Yl21n54oPT/u4VtVePdIeoR5OI1LJ7kyTjG1sE4dDhgKBp8wzLUYwSQKJjJVTs9 +uHFBuEs/1rkyGsqR+svnO6H+TOkywCACXzHnMO4S9bc/dMd1s6lnH7neSQ32mWUHXQy QyYQ/k4jR5Fg1LNDyrvNRPElZIT29RNzenCvydNSo3ayBxXjqdy15IRcLMXwHzIXMzot +cc35fLGH5FIe4AC2icC0feFSBTjOearEtUbkW+i8dQyGeq+eDWFDSMfRPW2nN2oGqgk QUiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=zLVgCSfTZmemUtK+6Izrubttf8rBWRaCRFnMQRY18PY=; b=MwOwJcT8a7zf+0ThQ9d3UkeAFiHvIvYNrfnfIuJvlV8O9LBhsDG3GLTQS9nmdOXbMm tkUnAYVLGLobEkXkBKUPO1jqnaLwXoXNkDjMcgFN2/cebFlycGDjL7dh4pt7KoCnCAlc 8y4imyna3W5ymoEvjffnTh/JRGbp0qf1Oxffd8MNQPNP2Bgatsdx3NRAtkIBfahQUg8z Rg5BjG2fC9rn4t3pXAvhepVzoQQlU9CUmmC3elgJwRlZB+75obpmR1pEQsl/aF1lrnA3 XE+6uXAt5RN/Ev7MpgVOz4dOaSY4MQ5t/sPIVyJUCjn2M5qGXjz30kQwMkyidaGM+SPt ZmwQ== X-Gm-Message-State: AEkoouvewSlFQROsiiyQbL9oPJZcA83QgPkwJCZZ0VvZnnpPVcx3vQ9j7cFUhz8F11UBKxaMoWvsQplQP5drRg== X-Received: by 10.107.21.134 with SMTP id 128mr9765364iov.59.1471616613066; Fri, 19 Aug 2016 07:23:33 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Fri, 19 Aug 2016 07:23:32 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <20160819112729.GH83214@kib.kiev.ua> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> <20160819202010.Y2407@besplex.bde.org> <20160819112729.GH83214@kib.kiev.ua> From: Warner Losh Date: Fri, 19 Aug 2016 08:23:32 -0600 X-Google-Sender-Auth: cXFAmKjKlxTW8VfMOC6WvJUMggg Message-ID: Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd To: Konstantin Belousov Cc: Bruce Evans , Julian Elischer , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 14:23:34 -0000 On Fri, Aug 19, 2016 at 5:27 AM, Konstantin Belousov wrote: > On Fri, Aug 19, 2016 at 09:12:53PM +1000, Bruce Evans wrote: >> On Fri, 19 Aug 2016, Konstantin Belousov wrote: >> >> > On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: >> >> On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer wrote: >> >>> On 16/08/2016 4:54 AM, John Baldwin wrote: >> >>>> >> >>>> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >> >>>>> ,,, >> >>>>> Log: >> >>>>> Remove the mcd(4) driver for Mitsumi CD-ROM players. >> >>>>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted in >> >>>>> the manpage, this driver is only useful as a backend to cdcontrol to >> >>>>> play audio CDs since it doesn't use DMA, so its data performance is >> >>>>> "abysmal" (and that was true in the mid 90's). >> >>>> >> >>>> No one stepped up to test patches for it either when I last posted patches >> >>>> to >> >>>> convert it from timeout(9) to callout(9). I have a few more drivers that >> >>>> are >> >>>> ... >> >>> >> >>> I would imagine any machine still holding one of these probably has not >> >>> enough memory to run FreeBSD. >> >>> >> >>> would we still run in 2MB? >> >> >> >> With insane levels of tuning, we can run in 32MB userland that can do >> >> things. Even 64MB is tight w/o some tuning. 16MB is almost certainly >> >> right out except for very specialized situations. 2MB? We can't even >> >> load the loader in that :(. Oh, and all these memory configs are only >> >> possible if you tweak the loader's block cache... >> > >> > 32MB is quite usable. Without any tuning, you get slightly less than 10MB >> > for userspace, which is enough to for many things, and plenty if swap is >> > added. >> >> No, 32MB needs lots of needs tuning. -current seems to need about 16MB >> more than just a few months ago when I last discussed this with you. >> My i386 system doesn't have many drivers or a bloated userland (*), >> but it took the following tuning plus my PAE tuning fixes to boot in >> 32MB: >> - disable [l]em1 >> - reduce tx and buffers to 256 for em0. They default to 4096 for em. That >> is something like 8K * 1500 bytes = 12MB for em0 alone. lem[1] wants >> another 12MB. I think this is not all statically allocated, but the >> drivers hang onto that much. >> This now longer works. -current without my PAE tuning fixes hangs mounting >> root or in usb initialization with this tuning and 40MB. -current with my >> PAE tuning fixes hangs similarly with 32MB; with 40MB it boots to the >> start of multiuser but then hangs (it starts 1 getty, then 2 sendmails >> and kills them with "out of swap space") and 1 rpcbind (also killed). I >> don't use swap, but it was needed 20 years ago on a system that actually >> had 32MB of memory. >> >> (*) /bin/sh doing nothing much in -current i386: size 6532K res 1924K >> /bin/sh in my ~5.2 i386: size 864K res 592K >> >> The kernel size is 5.5MB text 370K data 2.2MB bss (lots of bloat in bss >> for debugging and vt). In single user mode, with 40MB to start, there >> is 22116K wired and 2516K free. A few programs can be run in 2516K >> without swap if they have res 592K and not 1924K. >> >> > Note that you cannot boot on such configurations since loader was broken, >> > but if you do manage to jump to kernel, things were fine several months >> > ago. I tested my relatively recent OOM changes on 32MB qemu config. >> >> I have no problems booting such configuratations since I don't use the >> current loader and only use old loader to change the environment to >> set up special configurations like this. I use my version of biosboot >> for boot2. This requires fixing 2 layers of complicated breakage in >> init386(). vm86 is now used before the TSS and PIC resources that it >> uses are initialized, but only in paths that are not normally used >> because they are for memory sizing that is normally done by loader >> :-(. >> >> I normally use my version of biosboot for boot2. I improved its caching >> just a couple of years ago. It was using 9K buffer optimized for 1440K >> floppies. Now it uses a 32K buffer. Booting a 5.5MB kernel takes a >> fraction of a second. Of course I don't use modules, so not many seeks >> are needed. > > Of course I use modules and do not use GENERIC. I just tried: with today > HEAD, and old loader on 32MB VM, I get 11MB free in single-user mode. > Active+inactive is ~4MB, and 1M is eaten by buffers, which is about right > for init+/bin/sh+top idle system. The situation on x86 must be a lot better than arm. My old Atmel boards with 32MB have < 1MB free when booted to the login prompt (more at single user) and need special tuning to reduce the 5MB of network buffers allocated to be anything approaching useful. Warner From owner-svn-src-all@freebsd.org Fri Aug 19 14:27:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8458BBE7BF for ; Fri, 19 Aug 2016 14:27:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BE6612C6 for ; Fri, 19 Aug 2016 14:27:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x229.google.com with SMTP id 38so49820349iol.0 for ; Fri, 19 Aug 2016 07:27:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=dRNBAs+LP5n3I7fl627FF2bmDIn0xYhOgVBikW6pGFw=; b=DhWQBOWKkV0fy4eFhioznjwdUQOQa/IRQt5GXdAAnDO+eRpQpIAQcwRu3gSYuD3Te+ WLZHWNNSHqgMJE8yyxE9hL2UWKdR0FzEOZg2OceS6guhVwq6IP/KpFWtBtGY4LBPWJsp Ajdgyu601YU6paKeAZl28Pe8T4mLUeiQ71tSrfibWH9KgAseFhp/gdf37JuY2Yr88kH5 ONj/Bq0w2zplTUpKbPtSGWDXkewgydIiBFlj/rnjgQQdZok1SfDhCQwNdDYDdpsmQQNa zODvb3WvP0XNJfXqHaEOlfiSrHu+m/NoolZxAjuezX3RHCI7k26BupsXxKOtB3Pol6hF fuPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=dRNBAs+LP5n3I7fl627FF2bmDIn0xYhOgVBikW6pGFw=; b=AtHtbEKnrQWhN+Tnn8q8U3POq6KK+Jbd4kI7n4fAZeDMxlvDzQWup/jV9/kg9Q9pBc HVJyqf9Ls6hO5rWe7qQfSU7WBOU+LvhjJGn7rFv2wy8PhuzL5IMRLRzIaEgIn5tvnfS1 crQnGi5Kmu05zcNN0SKtiQGA7w4y+3k95KJ9xuB2fVvHrHGvjkyO9cFDCYrXgNDVXUlY /gJqtsstH9HMU3OAUu2iCtnHjAdeY9+biZaAa2Ju657H7fG/KsFrakcz2pEYW0cr8AAr j8yblNxQiEBsHqqtejCKQbS9YPJ4xmD3qfSQvStp99FNNaveugsEdtQI3KEnbKgKOHd+ 2bWQ== X-Gm-Message-State: AEkoouuVB/uElQ7AyygeF8tRdBGROOMItVh6QlIIe3S8xOE+EuJvtsv5VJWrWiQTFRBg0Wr+0C1JOjRuJKHDPA== X-Received: by 10.107.145.214 with SMTP id t205mr9805219iod.135.1471616822697; Fri, 19 Aug 2016 07:27:02 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Fri, 19 Aug 2016 07:27:02 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <514987E4-B953-467C-B53B-824B172A5211@me.com> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> <50AAF049-C8A7-4C69-A206-C3983FFA7867@me.com> <20160819092424.GE83214@kib.kiev.ua> <514987E4-B953-467C-B53B-824B172A5211@me.com> From: Warner Losh Date: Fri, 19 Aug 2016 08:27:02 -0600 X-Google-Sender-Auth: bWHWVvzGc435-D3-ZAwd_VO3p4E Message-ID: Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd To: Toomas Soome Cc: Konstantin Belousov , Julian Elischer , John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 14:27:03 -0000 On Fri, Aug 19, 2016 at 3:35 AM, Toomas Soome wrote: > >> On 19. aug 2016, at 12:24, Konstantin Belousov wro= te: >> >> On Fri, Aug 19, 2016 at 11:50:35AM +0300, Toomas Soome wrote: >>> >>>> On 19. aug 2016, at 10:39, Konstantin Belousov w= rote: >>>> >>>> On Thu, Aug 18, 2016 at 09:28:57PM -0600, Warner Losh wrote: >>>>> On Thu, Aug 18, 2016 at 12:50 AM, Julian Elischer wrote: >>>>>> On 16/08/2016 4:54 AM, John Baldwin wrote: >>>>>>> >>>>>>> On Monday, August 15, 2016 08:38:02 PM John Baldwin wrote: >>>>>>>> >>>>>>>> Author: jhb >>>>>>>> Date: Mon Aug 15 20:38:02 2016 >>>>>>>> New Revision: 304187 >>>>>>>> URL: https://svnweb.freebsd.org/changeset/base/304187 >>>>>>>> >>>>>>>> Log: >>>>>>>> Remove the mcd(4) driver for Mitsumi CD-ROM players. >>>>>>>> This is a driver for a pre-ATAPI ISA CD-ROM adapter. As noted = in >>>>>>>> the manpage, this driver is only useful as a backend to cdcontrol = to >>>>>>>> play audio CDs since it doesn't use DMA, so its data performance i= s >>>>>>>> "abysmal" (and that was true in the mid 90's). >>>>>>> >>>>>>> No one stepped up to test patches for it either when I last posted = patches >>>>>>> to >>>>>>> convert it from timeout(9) to callout(9). I have a few more driver= s that >>>>>>> are >>>>>>> both very old and that people have no business using in 12 (think I= SA >>>>>>> adapters that don't do DMA and can't be used with pccard) that I wi= ll be >>>>>>> removing over the next little while. I brought up a list of driver= s on >>>>>>> arch@ >>>>>>> a couple of years ago and the conversation drifted off into the wee= ds >>>>>>> about >>>>>>> trimming GENERIC, etc. No one objected to the specific drivers I l= isted >>>>>>> though (and I got a few pleas of "please remove"). If someone show= s up >>>>>>> desperately clutching an ISA adapter they can always dig up the sou= rce >>>>>>> from >>>>>>> svn and deal with forward porting it for whatever API changes have >>>>>>> happened >>>>>>> since it was removed. >>>>>> >>>>>> >>>>>> I would imagine any machine still holding one of these probably has = not >>>>>> enough memory to run FreeBSD. >>>>>> >>>>>> would we still run in 2MB? >>>>> >>>>> With insane levels of tuning, we can run in 32MB userland that can do >>>>> things. Even 64MB is tight w/o some tuning. 16MB is almost certainly >>>>> right out except for very specialized situations. 2MB? We can't even >>>>> load the loader in that :(. Oh, and all these memory configs are only >>>>> possible if you tweak the loader's block cache... >>>>> >>>> >>>> 32MB is quite usable. Without any tuning, you get slightly less than = 10MB >>>> for userspace, which is enough to for many things, and plenty if swap = is >>>> added. >>>> >>>> Note that you cannot boot on such configurations since loader was brok= en, >>>> but if you do manage to jump to kernel, things were fine several month= s >>>> ago. I tested my relatively recent OOM changes on 32MB qemu config. >>>>> Warner >>>> >>> >>> If the target is to go as low memory as possible, sure, you can strip a= ll off, from boot loader point, you should load kernel from stage2 and not = use loader at all (you can load and jump kernel even now from stage2, assum= ing it wont need any special configuration from loader config) etc etc. Thi= s means highly specialized build and has nothing to do with generic all pur= pose system. >>> >> Why you describe this as an 'alternative' ? Before that loader changes, >> I regularly tested on 32MB qemy i386 image and 64MB amd64 image. I do >> not see anything extreme in these configs. They use normal boot path, >> which provides kernels with debugging symbols, metadata, loaded modules >> etc. Why should I use deficient boot2-only loading, which, additionally, >> cannot work on amd64 ? >> >> More, this is the only reasonable way for most developers to ensure that >> system is still usable on tiny configs found on embedded devices. Right >> now the min which I have to set up is 128MB, and VM changes are simply n= ot >> tested on anything smaller. It is guaranteed that small systems will gro= w >> regressions fast. And I will not jump through the hoops to mitigate >> breakage induced by other people' changes. >> >>> Also at some point, there is an question about how reasonable it is to = have such configuration as part of generic code base for special bits like = boot loader itself, as the problem is, testing all those variants is becomi= ng impossible and even keeping reasonable code base in all of the #if #else= #endif spaghetti is getting quite hard and error prone. >>> >>>> From developers point of view, it is not really encouraging to have po= ssible feedback like ???oh, but you did break my 32MB system boot??? ;) Thi= s does bring back some memories however. For first 2 unix systems I was dea= ling with, one had 8MB and another had 12MB of memory??? it was ~ 1992-1993= ;) >>> >> Not mine, but you (?) indirectly broke system for people who do use 32MB >> on other arches, since low memory config on dev systems become 128MB. >> I cared about 32MB before, but not any longer. > > > Yep, I did set it to 64MB. And this is exactly why I wrote that small sys= tems do need special approaches, because getting updates for new features a= nd keeping tiny systems functional are conflicting options. So far freebsd = boot loader has managed this in some extent by massive amount of preprocess= or conditions and the result is insane list of different boot programs in There's only one boot program that's bloated recently, and that's /boot/loader. the static allocation of large buffers because malloc isn't working well is the problem. This isn't a small system vs large system problem, but a convenience vs complexity problem. Installing the base boot loader (that loads /boot/loader or kernel) is and always will be system dependent with very real constraints. Warner From owner-svn-src-all@freebsd.org Fri Aug 19 14:45:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F2C9BBEEB1; Fri, 19 Aug 2016 14:45:37 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 448BA1D0A; Fri, 19 Aug 2016 14:45:36 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 531D5D66ED6; Sat, 20 Aug 2016 00:45:31 +1000 (AEST) Date: Sat, 20 Aug 2016 00:45:31 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alexey Dokuchaev cc: Bruce Evans , Konstantin Belousov , src-committers , John Baldwin , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Julian Elischer , Warner Losh Subject: Re: svn commit: r304187 - in head: . share/man/man4 sys/conf sys/dev/mcd sys/modules sys/modules/mcd In-Reply-To: <20160819133915.GA8791@FreeBSD.org> Message-ID: <20160820000234.W3223@besplex.bde.org> References: <201608152038.u7FKc2NL026330@repo.freebsd.org> <2065331.KaGOSftJhd@ralph.baldwin.cx> <0d6c2e45-e4da-9bb7-a50c-212135d9ac4f@freebsd.org> <20160819073955.GC83214@kib.kiev.ua> <20160819202010.Y2407@besplex.bde.org> <20160819133915.GA8791@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=VIkg5I7X c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=kt6ZAA2GVHG-pnxd31oA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 14:45:37 -0000 On Fri, 19 Aug 2016, Alexey Dokuchaev wrote: > On Fri, Aug 19, 2016 at 09:12:53PM +1000, Bruce Evans wrote: >> I normally use my version of biosboot for boot2. I improved its caching >> just a couple of years ago. It was using 9K buffer optimized for 1440K >> floppies. Now it uses a 32K buffer. Booting a 5.5MB kernel takes a >> fraction of a second. > > That looks like change that everyone would benefit from. Consider posting > a patch or committing it yourself. ;-) Oops, it is actually loading that takes a fraction of a second. Not much different than with -current boot2 or old loader. -current boot2 also works for me, but I managed to squeeze more of the features that I want into biosboot (everything except ufs2). Booting from the boot1 prompt takes 20-25 seconds here. >> Of course I don't use modules, so not many seeks are needed. > > Why not, they're convenient (apart from "kernel version mismatch" crap > that I keep hitting now and then)? AFAIR they were slow to load at some > point but that was (not so) recently fixed. Same reason that I don't use shared libraries if possible - they are larger, slower and more difficult to debug. For kernel development, the version control problem is large. Modules are good for avoiding rebooting when developing something in a single module, but I usually work on either small changes that panic often or system wide-changes that need recompiling everything. Both require rebooting a lot to test, and I can rebuild a kernel and without modules and reboot it almost faster than I can remember where the modules directories are. Bruce From owner-svn-src-all@freebsd.org Fri Aug 19 15:54:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87252BBDFA0; Fri, 19 Aug 2016 15:54:01 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D0241202; Fri, 19 Aug 2016 15:54:01 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 9C6101D60; Fri, 19 Aug 2016 15:53:54 +0000 (UTC) Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Warner Losh References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Allan Jude Message-ID: <2c942f49-b90c-58eb-159f-4c4e62624bac@freebsd.org> Date: Fri, 19 Aug 2016 11:53:42 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3vJ9Ixf52qiPb3wJHq6RTu3p9IpOuxluR" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 15:54:01 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --3vJ9Ixf52qiPb3wJHq6RTu3p9IpOuxluR Content-Type: multipart/mixed; boundary="sxpS8TNfnWpFWDHAo0LUfWPwPtRHSisr1" From: Allan Jude To: Warner Losh Cc: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: <2c942f49-b90c-58eb-159f-4c4e62624bac@freebsd.org> Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> In-Reply-To: --sxpS8TNfnWpFWDHAo0LUfWPwPtRHSisr1 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-08-19 00:15, Warner Losh wrote: >> Which makes more sense: >> >> A) If stripesize =3D=3D 0, use some sane value like 4096 >=20 > I don't like this. >=20 >> B) Some other combination that uses the reported stripe size, unless i= t >> is 0, in which case it uses 4096 (or some other value controlled by a >> different new sysctl) >=20 > Don't like this so much. >=20 >> C) create kern.geom.min_stripe_size with a default of 512, but users c= an >> set 4096 if they use only 4k devices. (doesn't really solve the proble= m >> for the installer) >=20 > Default it to 4k, and allow users to set it to 512. If the drive > reports < this value > report this value instead. You'll need to make this a tunable. Then the= upper > layers wouldn't care. There's a small chance that some SD cards might b= e > reporting values that are too large. But I think it is confined to SD c= ards and > if I see too many more I'll do something specific in the SD driver. >=20 > Warner >=20 I think I mentioned this earlier in the thread,, but I do have a USB thumbstick that reports an 8mb stripe size. But I agree, I think a sysctl where you set the minimum (default 4096, but settable to 512), that is a tunable that can be overwritten in loader.conf What do we want for the logic as to what values it can be set to? Any power of 2 greater than or equal to 512? --=20 Allan Jude --sxpS8TNfnWpFWDHAo0LUfWPwPtRHSisr1-- --3vJ9Ixf52qiPb3wJHq6RTu3p9IpOuxluR 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.22 (MingW32) iQIcBAEBAgAGBQJXtyuSAAoJEBmVNT4SmAt+iUEP/Raxai9knKnFs6fsTxwaTKDF T1PeDFetotiNtYqQMlvbOVyEissp1HfYfhMSF0ON8Q6Pk4PzLA/eBveIzMB9dMqo /7jc66atNRP7WX7WB1zK/bbAxk7TQ1HbRztk7bTnHlTJNJbxfbAo6yfUwwzJQOYQ Lm8IMD2gURcWek0qVs0hFfjhZ73wi5ZiHbcHOzQ9Z4b6M0g/buU7/DwLkLFxGsOy UKdQQmi32BRqiFoQRfeRq7urF48yQHzYcKy3b8b0DoltYZjR3KYJrIoZX9qF/qOt rTyTHJeYWwLeZQ6+SGa1YtTU4omb1JLRDAFa7EDpbML4Rl9xHWVjQ2OMXcN2GUHH QHV+Iug+FitVIL5y9KiGYTw0N4xspVc6qfkbiNOkBb/9Xr8SX1Fj8W1ssqffOhp0 4Ve2upnbDuEJvHz+31CwkFP2M4C0uf8/7B4dA+P1gk1TwJXoXbX1gaVFemsVx0lk k4PhMh2y9wRchKvpS4hDv7zmYxxdD3QEtgzwRa2G5oYKvJwB9EHsP+MGhlGFBUsr L7YGwGC0UwCBm81SUYt5un7fO/cE0LiXLc2AF1g6yysoJmQjc6F2h+/mApxy3Qjz T4PyY6vrdr8mJGL0jmmKhZ/Mc87cEjmUDqlAyF/9+29IBEodfQmrIP+9jNRk1wlY 7Cb9OEHWn2SbxaGuaSFM =rTGD -----END PGP SIGNATURE----- --3vJ9Ixf52qiPb3wJHq6RTu3p9IpOuxluR-- From owner-svn-src-all@freebsd.org Fri Aug 19 15:57:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF150BBF025; Fri, 19 Aug 2016 15:57:25 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 835B213E0; Fri, 19 Aug 2016 15:57:25 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 6D2161D74; Fri, 19 Aug 2016 15:57:24 +0000 (UTC) Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Warner Losh , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> <86inuxckve.fsf@desk.des.no> Cc: Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Allan Jude Message-ID: Date: Fri, 19 Aug 2016 11:57:23 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HBoKUtE0wg8OgvF8HaIeneDahTDhXpNSt" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 15:57:25 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --HBoKUtE0wg8OgvF8HaIeneDahTDhXpNSt Content-Type: multipart/mixed; boundary="jAP4CfVQqcvQPCnoNDJvL0XrEI6hqrdEk" From: Allan Jude To: Warner Losh , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Cc: Nathan Whitehorn , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> <86inuxckve.fsf@desk.des.no> In-Reply-To: --jAP4CfVQqcvQPCnoNDJvL0XrEI6hqrdEk Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2016-08-19 10:13, Warner Losh wrote: > On Fri, Aug 19, 2016 at 12:51 AM, Dag-Erling Sm=C3=B8rgrav = wrote: >> Warner Losh writes: >>> Allan Jude writes: >>>> Which makes more sense: >>>> >>>> A) If stripesize =3D=3D 0, use some sane value like 4096 >>> >>> I don't like this. >>> >>>> B) Some other combination that uses the reported stripe size, unless= it >>>> is 0, in which case it uses 4096 (or some other value controlled by = a >>>> different new sysctl) >>> >>> Don't like this so much. >>> >>>> C) create kern.geom.min_stripe_size with a default of 512, but users= can >>>> set 4096 if they use only 4k devices. (doesn't really solve the prob= lem >>>> for the installer) >>> >>> Default it to 4k, and allow users to set it to 512. If the drive >>> reports < this value >>> report this value instead. >> >> I don't like either option. Option D (which I don't like either, but >> which should at least work in most cases) is a sysctl that specifies a= >> minimum factor, and set the reported stripe size to the least common >> multiple of that number and the actual stripe or sector size. This is= >> what my bsdinstall patch does. However, I think that pushing this dow= n >> to a layer where it will affect all applications is a terrible idea, >> because we have no way of knowing what will break[*], and it can >> seriously mislead users and hinder troubleshooting - especially if it = is >> enabled by default rather than only when necessary. >=20 > I took a look into the implications of doing a 4k stripesize 'automatic= ally' > this morning. I found a few places in g_part where it would actively > hurt when coupled with gpart's insistence on aligning things. So I > now think it's a bad idea. This will make it harder for FreeBSD to > generate arbitrary disk layouts. And I'm not too sure about what > things like gstripe would report as a result and if this would actually= > interfere if you had a large, but not power of two stripe size. >=20 >> I don't think it's a good idea to enforce stripe alignment everywhere,= >> either. It works for partitions because they are very large relative = to >> the stripe size, and at worst we will waste a few millionths of the di= sk >> on inter-partition gaps, which should only occur between the partition= >> table and the boot partition, and possibly, if the stripe size is very= >> large, between the boot partition and the swap partition. But forcing= >> filesystems to respect the stripe size will lead to no end of trouble,= >> because RAID volumes can have stripe sizes of 16 kB or more. I think = it >> is important to align partitions during installation because of the hu= ge >> performance impact of misaligned partitions on AF disks, but despite >> what Nathan claims, I never advocated applying the same logic >> everywhere. >=20 > Yea, having poked at it for just a little while, I agree. The installer= is the > right place to make sure we don't cross-thread the 4k sectors. Stripe s= ize > means too many other things to have it be useful in that context. >=20 > Warner >=20 Maybe instead we just change gpart to default to 4k alignment, but users can always override with -a 512 or some other value? Then the installer behaves the same as a user typing 'gpart', but we don't mess with the entire geom layer? --=20 Allan Jude --jAP4CfVQqcvQPCnoNDJvL0XrEI6hqrdEk-- --HBoKUtE0wg8OgvF8HaIeneDahTDhXpNSt 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.22 (MingW32) iQIcBAEBAgAGBQJXtyxkAAoJEBmVNT4SmAt+aHsQALZH84SBlTJAX36cnNuq8/vZ Iy/NGS364jYsz/rwT1mTLqaB5e+Iiu9ZCF8dkDocAr9X4EqfuxWKuI0pZoPzxJtI zjgxwuWMU21UoSBffpncK3R/iHw1faz2Xq4lV+IKKyS22U9XJGmr3uC+k6Lu3J2m ja7uFKdVaBSNH0FG4+HygUGyRtL4vUZiAa9whe/u/hgxVv/JQCZTwQ86DTSzjEYz volBGOb1ooiVPBDqm/WP53SJCL/5nSUthMxn2NdK1scD7LlYNKXAS6dC1Lgf942c KSZ9c+noIppz/OQovkmGzCepRKvcWSHm+NIcEVXCrFj8oaVH8ys8/i9DMPhDbdD+ CeIpOTYB+yiGFCiWp07y5yTLtOAcH1873zoy/yB6iNadSuCVgKDvqO3dEe1cEJcL O7cl2lOoWJwYHRbfZuPvATc4X91suhO0KQfZJ9+GeXpUIrvl/TCXMFYrRfM+8nPK hK4bdvLVrmSOS1eiU0cZIIvrxgJ1mjtHARW9sBBLVowN+gJ1lQ8U+u93PFfncJ7K YQ+m0/s8AGg406uud68H5Xn9I1FdYBXDoT+P1iayiqFJ7mEllFgaxpH5zlzWODZT KImo0lDRly2DcGcgyWDsFxYjSvPtDnbTdc0zntMCHXblH2ZoAdutil00mD/SJGya TssJryhudabz40FIFTXR =3kd0 -----END PGP SIGNATURE----- --HBoKUtE0wg8OgvF8HaIeneDahTDhXpNSt-- From owner-svn-src-all@freebsd.org Fri Aug 19 16:31:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1606DBBF8EA; Fri, 19 Aug 2016 16:31:48 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1E7E16CD; Fri, 19 Aug 2016 16:31:47 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7JGVYS7013718 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 19 Aug 2016 09:31:35 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Warner Losh References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> <081362ef-ff4a-61d5-46e4-9a4cf8b699ee@freebsd.org> <880977BE-F00F-4188-A978-F292AB452C79@bsdimp.com> Cc: Warner Losh , Allan Jude , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Nathan Whitehorn Message-ID: <16daa43f-fe4f-d191-b18f-da4ae3e690f5@freebsd.org> Date: Fri, 19 Aug 2016 09:31:34 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <880977BE-F00F-4188-A978-F292AB452C79@bsdimp.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVYrmu75wg1SZTo2Cfybe/4EHQ+tKEjyQsDtgDtuaOX2tXPvIg3zZA+WeTWl3LTT+tlOFXZLUu2gl6/djTC2DuQCGGD7gLJvsIM= X-Sonic-ID: C;VI7gZCpm5hGVEKDx2xNB0g== M;fEpCZSpm5hGVEKDx2xNB0g== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 16:31:48 -0000 On 08/18/16 22:33, Warner Losh wrote: >> On Aug 18, 2016, at 11:21 PM, Nathan Whitehorn wrote: >> >> >> >> On 08/18/16 21:15, Warner Losh wrote: >>> On Thu, Aug 18, 2016 at 6:56 AM, Allan Jude wrote: >>>> On 08/18/16 05:50 AM, Dag-Erling Smørgrav wrote: >>>>> Nathan Whitehorn writes: >>>>>> OK. In which configurations? My Dell servers, for instance, don't do >>>>>> this. How are they set up? What drivers are being used? Is this >>>>>> something that affects passthrough disks, RAIDs, disk images? >>>>> Most LSI MegaRAID controllers don't have real passthrough, only JBOD. >>>>> You can query the drive with "camcontrol identify passX", but the >>>>> controller does not report a stripe size for the volume (mfidY). >>>>> >>>>>> The point is that *if the reported stripe size is wrong*, more things >>>>>> than partition alignment in the installer will suffer for it. >>>>> It's not wrong, it's non-existent, and I'm getting really tired of >>>>> repeating myself. >>>>> >>>>>> Fixing the installer with a bandaid in the run-up to a release is >>>>>> fine, but *we need to fix the underlying problem*. >>>>> We can't, because hardware sucks, and I'm getting really tired of >>>>> repeating myself. >>>>> >>>>> DES >>>>> >>>> Which makes more sense: >>>> >>>> A) If stripesize == 0, use some sane value like 4096 >>> I don't like this. >>> >>>> B) Some other combination that uses the reported stripe size, unless it >>>> is 0, in which case it uses 4096 (or some other value controlled by a >>>> different new sysctl) >>> Don't like this so much. >>> >>>> C) create kern.geom.min_stripe_size with a default of 512, but users can >>>> set 4096 if they use only 4k devices. (doesn't really solve the problem >>>> for the installer) >>> Default it to 4k, and allow users to set it to 512. If the drive >>> reports < this value >>> report this value instead. You'll need to make this a tunable. Then the upper >>> layers wouldn't care. There's a small chance that some SD cards might be >>> reporting values that are too large. But I think it is confined to SD cards and >>> if I see too many more I'll do something specific in the SD driver. >>> >>> Warner >>> >>> >> That sounds good to me and I think can clean up a lot of code and potential foot-shooting. Who is planning to make the patch? I'm happy to do anything that would be helpful. > The patch is super-easy, but I need to get the concept validated and make sure that it does not have unintended side effects. > > Warner > Sounds great. There is no urgency here -- we have a good solution for 11.0 already -- so taking time to do it right sounds good. I believe stripesize is only consumed by disk formatting tools, so unintended side effects at least should be minimal. -Nathan From owner-svn-src-all@freebsd.org Fri Aug 19 16:37:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AA8BBBF96B; Fri, 19 Aug 2016 16:37:28 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0253119D7; Fri, 19 Aug 2016 16:37:27 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from zeppelin.tachypleus.net (75-101-50-44.static.sonic.net [75.101.50.44]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id u7JGbNcn019863 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 19 Aug 2016 09:37:23 -0700 Subject: Re: svn commit: r304142 - head/usr.sbin/bsdinstall/partedit To: Allan Jude , Warner Losh , =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= References: <201608150930.u7F9UL1V069576@repo.freebsd.org> <861t1n6749.fsf@desk.des.no> <581c856c-826b-529e-c9c6-a397fb679708@freebsd.org> <86wpjf4eun.fsf@desk.des.no> <8cb3fa1a-50cb-e238-d006-b98a628d446d@freebsd.org> <86k2ff4cxs.fsf@desk.des.no> <86fuq24d8s.fsf@desk.des.no> <2f9fb04c-7ec4-be40-8fcb-0cf74bb56859@freebsd.org> <86inuxckve.fsf@desk.des.no> Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Nathan Whitehorn Message-ID: <0c319857-77cf-76de-0e82-08bc989713a0@freebsd.org> Date: Fri, 19 Aug 2016 09:37:23 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Sonic-CAuth: UmFuZG9tSVbcZXulEIHbegWGALzasNF46nhhHfD3HfhLw3kEQyI+/2JW+gQqerXDadJCQQMjfn5IogqlJlj+5zGIEIU8/+haOtsP5U637ag= X-Sonic-ID: C;uuh3NCtm5hGi9KDx2xNB0g== M;4n+zNCtm5hGi9KDx2xNB0g== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 16:37:28 -0000 On 08/19/16 08:57, Allan Jude wrote: > On 2016-08-19 10:13, Warner Losh wrote: >> On Fri, Aug 19, 2016 at 12:51 AM, Dag-Erling Smørgrav wrote: >>> Warner Losh writes: >>>> Allan Jude writes: >>>>> Which makes more sense: >>>>> >>>>> A) If stripesize == 0, use some sane value like 4096 >>>> I don't like this. >>>> >>>>> B) Some other combination that uses the reported stripe size, unless it >>>>> is 0, in which case it uses 4096 (or some other value controlled by a >>>>> different new sysctl) >>>> Don't like this so much. >>>> >>>>> C) create kern.geom.min_stripe_size with a default of 512, but users can >>>>> set 4096 if they use only 4k devices. (doesn't really solve the problem >>>>> for the installer) >>>> Default it to 4k, and allow users to set it to 512. If the drive >>>> reports < this value >>>> report this value instead. >>> I don't like either option. Option D (which I don't like either, but >>> which should at least work in most cases) is a sysctl that specifies a >>> minimum factor, and set the reported stripe size to the least common >>> multiple of that number and the actual stripe or sector size. This is >>> what my bsdinstall patch does. However, I think that pushing this down >>> to a layer where it will affect all applications is a terrible idea, >>> because we have no way of knowing what will break[*], and it can >>> seriously mislead users and hinder troubleshooting - especially if it is >>> enabled by default rather than only when necessary. >> I took a look into the implications of doing a 4k stripesize 'automatically' >> this morning. I found a few places in g_part where it would actively >> hurt when coupled with gpart's insistence on aligning things. So I >> now think it's a bad idea. This will make it harder for FreeBSD to >> generate arbitrary disk layouts. And I'm not too sure about what >> things like gstripe would report as a result and if this would actually >> interfere if you had a large, but not power of two stripe size. >> >>> I don't think it's a good idea to enforce stripe alignment everywhere, >>> either. It works for partitions because they are very large relative to >>> the stripe size, and at worst we will waste a few millionths of the disk >>> on inter-partition gaps, which should only occur between the partition >>> table and the boot partition, and possibly, if the stripe size is very >>> large, between the boot partition and the swap partition. But forcing >>> filesystems to respect the stripe size will lead to no end of trouble, >>> because RAID volumes can have stripe sizes of 16 kB or more. I think it >>> is important to align partitions during installation because of the huge >>> performance impact of misaligned partitions on AF disks, but despite >>> what Nathan claims, I never advocated applying the same logic >>> everywhere. >> Yea, having poked at it for just a little while, I agree. The installer is the >> right place to make sure we don't cross-thread the 4k sectors. Stripe size >> means too many other things to have it be useful in that context. >> >> Warner >> > Maybe instead we just change gpart to default to 4k alignment, but users > can always override with -a 512 or some other value? > > Then the installer behaves the same as a user typing 'gpart', but we > don't mess with the entire geom layer? > ZFS also looks at this, so we would need it there, and there might be a few others. At the very least, gpart and the installer should have the same behavior. Warner, could you elaborate on what you mean by "cross-threading"? Are you worried about nested partition tables in which the outer one is misaligned? Having the disk drivers report a 4K stripesize seems to have worked so far; I'm not sure how reporting it more often would cause problems. You wouldn't want all drivers, or all GEOM layers, to do this, of course. If the problem is that "stripe size" has an overloaded meaning, we could easily add another GEOM property. -Nathan From owner-svn-src-all@freebsd.org Fri Aug 19 16:56:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B054EBBFC73; Fri, 19 Aug 2016 16:56:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D541153D; Fri, 19 Aug 2016 16:56:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JGuqrN007122; Fri, 19 Aug 2016 16:56:52 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JGuqsD007121; Fri, 19 Aug 2016 16:56:52 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608191656.u7JGuqsD007121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Aug 2016 16:56:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304469 - stable/11/usr.bin/xinstall X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 16:56:53 -0000 Author: bdrewery Date: Fri Aug 19 16:56:52 2016 New Revision: 304469 URL: https://svnweb.freebsd.org/changeset/base/304469 Log: MFC r303929,r303930,r303931,r303932,r303933: r303929: Fix -S with -b not atomically updating the destination file. r303930: Support -v for -l. r303931: Fix -S with -l not being atomic. r303932: Fix -b failure not restoring flags on the destination file. r303933: Squelch a false-positive Clang static analyzer warning. Modified: stable/11/usr.bin/xinstall/xinstall.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/xinstall/xinstall.c ============================================================================== --- stable/11/usr.bin/xinstall/xinstall.c Fri Aug 19 16:45:21 2016 (r304468) +++ stable/11/usr.bin/xinstall/xinstall.c Fri Aug 19 16:56:52 2016 (r304469) @@ -149,6 +149,7 @@ main(int argc, char *argv[]) char *p; const char *to_name; + fset = 0; iflags = 0; group = owner = NULL; while ((ch = getopt(argc, argv, "B:bCcD:df:g:h:l:M:m:N:o:pSsT:Uv")) != @@ -533,7 +534,9 @@ do_link(const char *from_name, const cha if (target_sb->st_flags & NOCHANGEBITS) (void)chflags(to_name, target_sb->st_flags & ~NOCHANGEBITS); - unlink(to_name); + if (verbose) + printf("install: link %s -> %s\n", + from_name, to_name); ret = rename(tmpl, to_name); /* * If rename has posix semantics, then the temporary @@ -543,8 +546,12 @@ do_link(const char *from_name, const cha (void)unlink(tmpl); } return (ret); - } else + } else { + if (verbose) + printf("install: link %s -> %s\n", + from_name, to_name); return (link(from_name, to_name)); + } } /* @@ -573,14 +580,18 @@ do_symlink(const char *from_name, const if (target_sb->st_flags & NOCHANGEBITS) (void)chflags(to_name, target_sb->st_flags & ~NOCHANGEBITS); - unlink(to_name); - + if (verbose) + printf("install: symlink %s -> %s\n", + from_name, to_name); if (rename(tmpl, to_name) == -1) { /* Remove temporary link before exiting. */ (void)unlink(tmpl); err(EX_OSERR, "%s: rename", to_name); } } else { + if (verbose) + printf("install: symlink %s -> %s\n", + from_name, to_name); if (symlink(from_name, to_name) == -1) err(EX_OSERR, "symlink %s -> %s", from_name, to_name); } @@ -886,11 +897,21 @@ install(const char *from_name, const cha } if (verbose) (void)printf("install: %s -> %s\n", to_name, backup); - if (rename(to_name, backup) < 0) { + if (unlink(backup) < 0 && errno != ENOENT) { + serrno = errno; + if (to_sb.st_flags & NOCHANGEBITS) + (void)chflags(to_name, to_sb.st_flags); + unlink(tempfile); + errno = serrno; + err(EX_OSERR, "unlink: %s", backup); + } + if (link(to_name, backup) < 0) { serrno = errno; unlink(tempfile); + if (to_sb.st_flags & NOCHANGEBITS) + (void)chflags(to_name, to_sb.st_flags); errno = serrno; - err(EX_OSERR, "rename: %s to %s", to_name, + err(EX_OSERR, "link: %s to %s", to_name, backup); } } @@ -1111,16 +1132,26 @@ create_newfile(const char *path, int tar if (dobackup) { if ((size_t)snprintf(backup, MAXPATHLEN, "%s%s", - path, suffix) != strlen(path) + strlen(suffix)) + path, suffix) != strlen(path) + strlen(suffix)) { + saved_errno = errno; + if (sbp->st_flags & NOCHANGEBITS) + (void)chflags(path, sbp->st_flags); + errno = saved_errno; errx(EX_OSERR, "%s: backup filename too long", path); + } (void)snprintf(backup, MAXPATHLEN, "%s%s", path, suffix); if (verbose) (void)printf("install: %s -> %s\n", path, backup); - if (rename(path, backup) < 0) + if (rename(path, backup) < 0) { + saved_errno = errno; + if (sbp->st_flags & NOCHANGEBITS) + (void)chflags(path, sbp->st_flags); + errno = saved_errno; err(EX_OSERR, "rename: %s to %s", path, backup); + } } else if (unlink(path) < 0) saved_errno = errno; From owner-svn-src-all@freebsd.org Fri Aug 19 16:59:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B600BBFCFC; Fri, 19 Aug 2016 16:59:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFD9716DD; Fri, 19 Aug 2016 16:59:02 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JGx2SB007255; Fri, 19 Aug 2016 16:59:02 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JGx2NJ007254; Fri, 19 Aug 2016 16:59:02 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608191659.u7JGx2NJ007254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Aug 2016 16:59:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304470 - stable/11/sys/conf X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 16:59:03 -0000 Author: bdrewery Date: Fri Aug 19 16:59:01 2016 New Revision: 304470 URL: https://svnweb.freebsd.org/changeset/base/304470 Log: MFC r304005: PORTS_MODULES: Don't leak in CC/CXX/CPP. Modified: stable/11/sys/conf/kern.post.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/kern.post.mk ============================================================================== --- stable/11/sys/conf/kern.post.mk Fri Aug 19 16:56:52 2016 (r304469) +++ stable/11/sys/conf/kern.post.mk Fri Aug 19 16:59:01 2016 (r304470) @@ -65,6 +65,10 @@ OSRELDATE!= awk '/^\#define[[:space:]]*_ # Keep the related ports builds in the obj directory so that they are only rebuilt once per kernel build WRKDIRPREFIX?= ${MAKEOBJDIRPREFIX}${SRC_BASE}/sys/${KERNCONF} PORTSMODULESENV=\ + env \ + -u CC \ + -u CXX \ + -u CPP \ PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \ SRC_BASE=${SRC_BASE} \ OSVERSION=${OSRELDATE} \ From owner-svn-src-all@freebsd.org Fri Aug 19 16:59:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D57E1BBFD43; Fri, 19 Aug 2016 16:59:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B34CE1842; Fri, 19 Aug 2016 16:59:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JGxGDc007306; Fri, 19 Aug 2016 16:59:16 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JGxGMk007305; Fri, 19 Aug 2016 16:59:16 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608191659.u7JGxGMk007305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Aug 2016 16:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304471 - stable/10/usr.bin/xinstall X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 16:59:17 -0000 Author: bdrewery Date: Fri Aug 19 16:59:16 2016 New Revision: 304471 URL: https://svnweb.freebsd.org/changeset/base/304471 Log: MFC r303929,r303930,r303931,r303932,r303933: r303929: Fix -S with -b not atomically updating the destination file. r303930: Support -v for -l. r303931: Fix -S with -l not being atomic. r303932: Fix -b failure not restoring flags on the destination file. r303933: Squelch a false-positive Clang static analyzer warning. Modified: stable/10/usr.bin/xinstall/xinstall.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/xinstall/xinstall.c ============================================================================== --- stable/10/usr.bin/xinstall/xinstall.c Fri Aug 19 16:59:01 2016 (r304470) +++ stable/10/usr.bin/xinstall/xinstall.c Fri Aug 19 16:59:16 2016 (r304471) @@ -151,6 +151,7 @@ main(int argc, char *argv[]) char *p; const char *to_name; + fset = 0; iflags = 0; group = owner = NULL; while ((ch = getopt(argc, argv, "B:bCcD:df:g:h:l:M:m:N:o:pSsT:Uv")) != @@ -535,7 +536,9 @@ do_link(const char *from_name, const cha if (target_sb->st_flags & NOCHANGEBITS) (void)chflags(to_name, target_sb->st_flags & ~NOCHANGEBITS); - unlink(to_name); + if (verbose) + printf("install: link %s -> %s\n", + from_name, to_name); ret = rename(tmpl, to_name); /* * If rename has posix semantics, then the temporary @@ -545,8 +548,12 @@ do_link(const char *from_name, const cha (void)unlink(tmpl); } return (ret); - } else + } else { + if (verbose) + printf("install: link %s -> %s\n", + from_name, to_name); return (link(from_name, to_name)); + } } /* @@ -575,14 +582,18 @@ do_symlink(const char *from_name, const if (target_sb->st_flags & NOCHANGEBITS) (void)chflags(to_name, target_sb->st_flags & ~NOCHANGEBITS); - unlink(to_name); - + if (verbose) + printf("install: symlink %s -> %s\n", + from_name, to_name); if (rename(tmpl, to_name) == -1) { /* Remove temporary link before exiting. */ (void)unlink(tmpl); err(EX_OSERR, "%s: rename", to_name); } } else { + if (verbose) + printf("install: symlink %s -> %s\n", + from_name, to_name); if (symlink(from_name, to_name) == -1) err(EX_OSERR, "symlink %s -> %s", from_name, to_name); } @@ -882,11 +893,21 @@ install(const char *from_name, const cha } if (verbose) (void)printf("install: %s -> %s\n", to_name, backup); - if (rename(to_name, backup) < 0) { + if (unlink(backup) < 0 && errno != ENOENT) { + serrno = errno; + if (to_sb.st_flags & NOCHANGEBITS) + (void)chflags(to_name, to_sb.st_flags); + unlink(tempfile); + errno = serrno; + err(EX_OSERR, "unlink: %s", backup); + } + if (link(to_name, backup) < 0) { serrno = errno; unlink(tempfile); + if (to_sb.st_flags & NOCHANGEBITS) + (void)chflags(to_name, to_sb.st_flags); errno = serrno; - err(EX_OSERR, "rename: %s to %s", to_name, + err(EX_OSERR, "link: %s to %s", to_name, backup); } } @@ -1109,16 +1130,26 @@ create_newfile(const char *path, int tar if (dobackup) { if ((size_t)snprintf(backup, MAXPATHLEN, "%s%s", - path, suffix) != strlen(path) + strlen(suffix)) + path, suffix) != strlen(path) + strlen(suffix)) { + saved_errno = errno; + if (sbp->st_flags & NOCHANGEBITS) + (void)chflags(path, sbp->st_flags); + errno = saved_errno; errx(EX_OSERR, "%s: backup filename too long", path); + } (void)snprintf(backup, MAXPATHLEN, "%s%s", path, suffix); if (verbose) (void)printf("install: %s -> %s\n", path, backup); - if (rename(path, backup) < 0) + if (rename(path, backup) < 0) { + saved_errno = errno; + if (sbp->st_flags & NOCHANGEBITS) + (void)chflags(path, sbp->st_flags); + errno = saved_errno; err(EX_OSERR, "rename: %s to %s", path, backup); + } } else if (unlink(path) < 0) saved_errno = errno; From owner-svn-src-all@freebsd.org Fri Aug 19 17:01:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22359BBFF4F; Fri, 19 Aug 2016 17:01:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2EE01A88; Fri, 19 Aug 2016 17:01:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JH1EPS010094; Fri, 19 Aug 2016 17:01:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JH1D6M010092; Fri, 19 Aug 2016 17:01:13 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608191701.u7JH1D6M010092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Aug 2016 17:01:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304472 - stable/11 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 17:01:15 -0000 Author: bdrewery Date: Fri Aug 19 17:01:13 2016 New Revision: 304472 URL: https://svnweb.freebsd.org/changeset/base/304472 Log: MFC r304006: Avoid showing the bootstrap make command for check-old, etc. Modified: stable/11/Makefile stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile ============================================================================== --- stable/11/Makefile Fri Aug 19 16:59:16 2016 (r304471) +++ stable/11/Makefile Fri Aug 19 17:01:13 2016 (r304472) @@ -209,7 +209,8 @@ SUB_MAKE= `test -x ${MYMAKE} && echo ${M SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk .endif -_MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} +_MAKE= PATH=${PATH} MAKE_CMD=${MAKE} ${SUB_MAKE} -f Makefile.inc1 \ + TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} # Only allow meta mode for the whitelisted targets. See META_TGT_WHITELIST # above. Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Fri Aug 19 16:59:16 2016 (r304471) +++ stable/11/Makefile.inc1 Fri Aug 19 17:01:13 2016 (r304472) @@ -2372,11 +2372,11 @@ check-old-dirs: .PHONY done delete-old: delete-old-files delete-old-dirs .PHONY - @echo "To remove old libraries run '${MAKE} delete-old-libs'." + @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'." check-old: check-old-files check-old-libs check-old-dirs .PHONY - @echo "To remove old files and directories run '${MAKE} delete-old'." - @echo "To remove old libraries run '${MAKE} delete-old-libs'." + @echo "To remove old files and directories run '${MAKE_CMD} delete-old'." + @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'." .endif From owner-svn-src-all@freebsd.org Fri Aug 19 17:02:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 419A3BBFFCF; Fri, 19 Aug 2016 17:02:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 142121DA3; Fri, 19 Aug 2016 17:02:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JH25E2010741; Fri, 19 Aug 2016 17:02:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JH25aC010740; Fri, 19 Aug 2016 17:02:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608191702.u7JH25aC010740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Aug 2016 17:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304473 - stable/10/sys/dev/filemon X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 17:02:06 -0000 Author: bdrewery Date: Fri Aug 19 17:02:05 2016 New Revision: 304473 URL: https://svnweb.freebsd.org/changeset/base/304473 Log: MFC r304008: Avoid taking PROC_LOCK in syscalls if not being traced. Modified: stable/10/sys/dev/filemon/filemon.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/filemon/filemon.c ============================================================================== --- stable/10/sys/dev/filemon/filemon.c Fri Aug 19 17:01:13 2016 (r304472) +++ stable/10/sys/dev/filemon/filemon.c Fri Aug 19 17:02:05 2016 (r304473) @@ -137,6 +137,8 @@ filemon_proc_get(struct proc *p) { struct filemon *filemon; + if (p->p_filemon == NULL) + return (NULL); PROC_LOCK(p); filemon = filemon_acquire(p->p_filemon); PROC_UNLOCK(p); From owner-svn-src-all@freebsd.org Fri Aug 19 17:02:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6BDABBF00E; Fri, 19 Aug 2016 17:02:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEBBF1ECE; Fri, 19 Aug 2016 17:02:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JH2EY8010789; Fri, 19 Aug 2016 17:02:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JH2EnF010788; Fri, 19 Aug 2016 17:02:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608191702.u7JH2EnF010788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Aug 2016 17:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304474 - stable/11/sys/dev/filemon X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 17:02:16 -0000 Author: bdrewery Date: Fri Aug 19 17:02:14 2016 New Revision: 304474 URL: https://svnweb.freebsd.org/changeset/base/304474 Log: MFC r304008: Avoid taking PROC_LOCK in syscalls if not being traced. Modified: stable/11/sys/dev/filemon/filemon.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/filemon/filemon.c ============================================================================== --- stable/11/sys/dev/filemon/filemon.c Fri Aug 19 17:02:05 2016 (r304473) +++ stable/11/sys/dev/filemon/filemon.c Fri Aug 19 17:02:14 2016 (r304474) @@ -137,6 +137,8 @@ filemon_proc_get(struct proc *p) { struct filemon *filemon; + if (p->p_filemon == NULL) + return (NULL); PROC_LOCK(p); filemon = filemon_acquire(p->p_filemon); PROC_UNLOCK(p); From owner-svn-src-all@freebsd.org Fri Aug 19 17:03:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58997BBF0BA; Fri, 19 Aug 2016 17:03:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2879C126B; Fri, 19 Aug 2016 17:03:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JH3Eq7010861; Fri, 19 Aug 2016 17:03:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JH3EwW010860; Fri, 19 Aug 2016 17:03:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608191703.u7JH3EwW010860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Aug 2016 17:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304475 - stable/11 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 17:03:15 -0000 Author: bdrewery Date: Fri Aug 19 17:03:14 2016 New Revision: 304475 URL: https://svnweb.freebsd.org/changeset/base/304475 Log: MFC r304217: Trim unneeded bootstrap after r301470 made 9.1 the minimum supported release. Modified: stable/11/Makefile.inc1 Directory Properties: stable/11/ (props changed) Modified: stable/11/Makefile.inc1 ============================================================================== --- stable/11/Makefile.inc1 Fri Aug 19 17:02:14 2016 (r304474) +++ stable/11/Makefile.inc1 Fri Aug 19 17:03:14 2016 (r304475) @@ -1579,10 +1579,6 @@ _groff= gnu/usr.bin/groff \ _vtfontcvt= usr.bin/vtfontcvt .endif -.if ${BOOTSTRAPPING} < 900002 -_sed= usr.bin/sed -.endif - .if ${BOOTSTRAPPING} < 1000033 _libopenbsd= lib/libopenbsd _m4= usr.bin/m4 @@ -1621,10 +1617,6 @@ _crunchide= usr.sbin/crunch/crunchide _crunchgen= usr.sbin/crunch/crunchgen .endif -.if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 -_awk= usr.bin/awk -.endif - # r296926 -P keymap search path, MFC to stable/10 in r298297 .if ${BOOTSTRAPPING} < 1003501 || \ (${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103) @@ -1692,7 +1684,6 @@ bootstrap-tools: .PHONY ${_gperf} \ ${_groff} \ ${_dtc} \ - ${_awk} \ ${_cat} \ ${_dd} \ ${_kbdcontrol} \ @@ -1700,7 +1691,6 @@ bootstrap-tools: .PHONY ${_libopenbsd} \ ${_makewhatis} \ usr.bin/rpcgen \ - ${_sed} \ ${_yacc} \ ${_m4} \ ${_lex} \ From owner-svn-src-all@freebsd.org Fri Aug 19 17:37:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66D06BBF7EE; Fri, 19 Aug 2016 17:37:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 412DE1699; Fri, 19 Aug 2016 17:37:34 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JHbXKm022189; Fri, 19 Aug 2016 17:37:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHbXd7022185; Fri, 19 Aug 2016 17:37:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608191737.u7JHbXd7022185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 17:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304476 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 17:37:34 -0000 Author: jhb Date: Fri Aug 19 17:37:32 2016 New Revision: 304476 URL: https://svnweb.freebsd.org/changeset/base/304476 Log: Fix various nits in the aio operation manpages. - Avoid double use of "request" in a single sentence. Instead, describe aio_sigevent as being used to request notification of the associated operation's completion. This matches the language used to describe aio_sigevent in aio(4). - Simplify the prohibition on modifying buffers while requests are in flight. - Fix case mismatch. - Drop note about not using stack variables. C programmers should be able to figure out if a stack variable is safe based on the later warning about the life cycle requirements of control blocks. - Remove prohibition on modifying the I/O buffer for aio_fsync() since it does not use an I/O buffer. For aio_mlock(), prohibit modifications to the mapping (e.g. due to mprotect, munmap, mmap, etc.) but do not prohibit modifications to the memory backing the buffer (stores into the pages backing the buffer). Requested by: wblock (1,2), kib (4) Reviewed by: kib, rpokala, wblock MFC after: 3 days Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7462 Modified: head/lib/libc/sys/aio_fsync.2 head/lib/libc/sys/aio_mlock.2 head/lib/libc/sys/aio_read.2 head/lib/libc/sys/aio_write.2 Modified: head/lib/libc/sys/aio_fsync.2 ============================================================================== --- head/lib/libc/sys/aio_fsync.2 Fri Aug 19 17:03:14 2016 (r304475) +++ head/lib/libc/sys/aio_fsync.2 Fri Aug 19 17:37:32 2016 (r304476) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2016 +.Dd August 19, 2016 .Dt AIO_FSYNC 2 .Os .Sh NAME @@ -74,16 +74,14 @@ the call returns without having enqueued .Pp The .Fa iocb->aio_sigevent -structure can be used to request notification of the request's +structure can be used to request notification of the operation's completion as described in .Xr aio 4 . .Sh RESTRICTIONS -The asynchronous I/O Control Block structure pointed to by +The Asynchronous I/O Control Block structure pointed to by .Fa iocb must remain valid until the operation has completed. -For this reason, use of auto (stack) variables -for these objects is discouraged. .Pp The asynchronous I/O control buffer .Fa iocb @@ -91,9 +89,8 @@ should be zeroed before the .Fn aio_fsync call to avoid passing bogus context information to the kernel. .Pp -Modifications of the Asynchronous I/O Control Block structure or the -buffer contents after the request has been enqueued, but before the -request has completed, are not allowed. +Modification of the Asynchronous I/O Control Block structure is not allowed +while the request is queued. .Sh RETURN VALUES .Rv -std aio_fsync .Sh ERRORS Modified: head/lib/libc/sys/aio_mlock.2 ============================================================================== --- head/lib/libc/sys/aio_mlock.2 Fri Aug 19 17:03:14 2016 (r304475) +++ head/lib/libc/sys/aio_mlock.2 Fri Aug 19 17:37:32 2016 (r304476) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2016 +.Dd August 19, 2016 .Dt AIO_MLOCK 2 .Os .Sh NAME @@ -67,7 +67,7 @@ then the call returns without having enq .Pp The .Fa iocb->aio_sigevent -structure can be used to request notification of the request's +structure can be used to request notification of the operation's completion as described in .Xr aio 4 . .Sh RESTRICTIONS @@ -77,8 +77,6 @@ and the buffer that the .Fa iocb->aio_buf member of that structure references must remain valid until the operation has completed. -For this reason, use of auto (stack) variables -for these objects is discouraged. .Pp The asynchronous I/O control buffer .Fa iocb @@ -87,8 +85,8 @@ should be zeroed before the call to avoid passing bogus context information to the kernel. .Pp Modifications of the Asynchronous I/O Control Block structure or the -buffer contents after the request has been enqueued, but before the -request has completed, are not allowed. +memory mapping described by the virtual address range are not allowed +while the request is queued. .Sh RETURN VALUES .Rv -std aio_mlock .Sh ERRORS Modified: head/lib/libc/sys/aio_read.2 ============================================================================== --- head/lib/libc/sys/aio_read.2 Fri Aug 19 17:03:14 2016 (r304475) +++ head/lib/libc/sys/aio_read.2 Fri Aug 19 17:37:32 2016 (r304476) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2016 +.Dd August 19, 2016 .Dt AIO_READ 2 .Os .Sh NAME @@ -82,7 +82,7 @@ not be referenced after the request is e .Pp The .Fa iocb->aio_sigevent -structure can be used to request notification of the request's +structure can be used to request notification of the operation's completion as described in .Xr aio 4 . .Sh RESTRICTIONS @@ -92,8 +92,6 @@ and the buffer that the .Fa iocb->aio_buf member of that structure references must remain valid until the operation has completed. -For this reason, use of auto (stack) variables -for these objects is discouraged. .Pp The asynchronous I/O control buffer .Fa iocb @@ -102,8 +100,7 @@ should be zeroed before the call to avoid passing bogus context information to the kernel. .Pp Modifications of the Asynchronous I/O Control Block structure or the -buffer contents after the request has been enqueued, but before the -request has completed, are not allowed. +buffer contents are not allowed while the request is queued. .Pp If the file offset in .Fa iocb->aio_offset Modified: head/lib/libc/sys/aio_write.2 ============================================================================== --- head/lib/libc/sys/aio_write.2 Fri Aug 19 17:03:14 2016 (r304475) +++ head/lib/libc/sys/aio_write.2 Fri Aug 19 17:37:32 2016 (r304476) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 21, 2016 +.Dd August 19, 2016 .Dt AIO_WRITE 2 .Os .Sh NAME @@ -88,7 +88,7 @@ be referenced after the request is enque .Pp The .Fa iocb->aio_sigevent -structure can be used to request notification of the request's +structure can be used to request notification of the operation's completion as described in .Xr aio 4 . .Sh RESTRICTIONS @@ -98,8 +98,6 @@ and the buffer that the .Fa iocb->aio_buf member of that structure references must remain valid until the operation has completed. -For this reason, use of auto (stack) variables -for these objects is discouraged. .Pp The asynchronous I/O control buffer .Fa iocb @@ -108,8 +106,7 @@ should be zeroed before the system call to avoid passing bogus context information to the kernel. .Pp Modifications of the Asynchronous I/O Control Block structure or the -buffer contents after the request has been enqueued, but before the -request has completed, are not allowed. +buffer contents are not allowed while the request is queued. .Pp If the file offset in .Fa iocb->aio_offset From owner-svn-src-all@freebsd.org Fri Aug 19 17:48:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E77C4BBFABE; Fri, 19 Aug 2016 17:48:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B33101DC6; Fri, 19 Aug 2016 17:48:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JHmloX026194; Fri, 19 Aug 2016 17:48:47 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHml3I026193; Fri, 19 Aug 2016 17:48:47 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608191748.u7JHml3I026193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Aug 2016 17:48:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304477 - releng/11.0/usr.bin/truss X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 17:48:49 -0000 Author: bdrewery Date: Fri Aug 19 17:48:47 2016 New Revision: 304477 URL: https://svnweb.freebsd.org/changeset/base/304477 Log: MFS r304143: MFC r303934,r303937,r303942: r303934: Support rmdir(2). r303937: Use proper argument length for rmdir(2) for r303934. r303942: Fix sorting in r303934. Approved by: re (gjb) Modified: releng/11.0/usr.bin/truss/syscalls.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/usr.bin/truss/syscalls.c ============================================================================== --- releng/11.0/usr.bin/truss/syscalls.c Fri Aug 19 17:37:32 2016 (r304476) +++ releng/11.0/usr.bin/truss/syscalls.c Fri Aug 19 17:48:47 2016 (r304477) @@ -281,6 +281,8 @@ static struct syscall decoded_syscalls[] .args = { { Atfd, 0 }, { Name, 1 }, { Atfd, 2 }, { Name, 3 } } }, { .name = "rfork", .ret_type = 1, .nargs = 1, .args = { { Rforkflags, 0 } } }, + { .name = "rmdir", .ret_type = 1, .nargs = 1, + .args = { { Name, 0 } } }, { .name = "select", .ret_type = 1, .nargs = 5, .args = { { Int, 0 }, { Fd_set, 1 }, { Fd_set, 2 }, { Fd_set, 3 }, { Timeval, 4 } } }, From owner-svn-src-all@freebsd.org Fri Aug 19 17:49:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F655BBFB0F; Fri, 19 Aug 2016 17:49:37 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6BA61F34; Fri, 19 Aug 2016 17:49:36 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JHnatG026281; Fri, 19 Aug 2016 17:49:36 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHnZU3026272; Fri, 19 Aug 2016 17:49:35 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608191749.u7JHnZU3026272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 19 Aug 2016 17:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304478 - in head: sys/compat/cloudabi sys/compat/cloudabi64 sys/contrib/cloudabi usr.bin/truss 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 17:49:37 -0000 Author: ed Date: Fri Aug 19 17:49:35 2016 New Revision: 304478 URL: https://svnweb.freebsd.org/changeset/base/304478 Log: Import the new automatically generated system call table for CloudABI. Now that we've switched over to using the vDSO on CloudABI, it becomes a lot easier for us to phase out old features. System call numbering is no longer something that's part of the ABI. It's fully based on names. As long as the numbering used by the kernel and the vDSO is consistent (which it always is), it's all right. Let's put this to the test by removing a system call (thread_tcb_set()) that's already unused for quite some time now, but was only left intact to serve as a placeholder. Sync in the new system call table that uses alphabetic sorting of system calls. Obtained from: https://github.com/NuxiNL/cloudabi Added: head/sys/contrib/cloudabi/syscalls64.master Deleted: head/sys/contrib/cloudabi/syscalls.master Modified: head/sys/compat/cloudabi/cloudabi_thread.c head/sys/compat/cloudabi64/Makefile head/sys/compat/cloudabi64/cloudabi64_proto.h head/sys/compat/cloudabi64/cloudabi64_syscall.h head/sys/compat/cloudabi64/cloudabi64_syscalls.c head/sys/compat/cloudabi64/cloudabi64_sysent.c head/sys/compat/cloudabi64/cloudabi64_systrace_args.c head/sys/contrib/cloudabi/cloudabi64_types.h head/sys/contrib/cloudabi/cloudabi_types.h head/sys/contrib/cloudabi/cloudabi_types_common.h head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.c head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.c head/usr.bin/truss/syscalls.c Modified: head/sys/compat/cloudabi/cloudabi_thread.c ============================================================================== --- head/sys/compat/cloudabi/cloudabi_thread.c Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/compat/cloudabi/cloudabi_thread.c Fri Aug 19 17:49:35 2016 (r304478) @@ -60,14 +60,6 @@ cloudabi_sys_thread_exit(struct thread * } int -cloudabi_sys_thread_tcb_set(struct thread *td, - struct cloudabi_sys_thread_tcb_set_args *uap) -{ - - return (cpu_set_user_tls(td, uap->tcb)); -} - -int cloudabi_sys_thread_yield(struct thread *td, struct cloudabi_sys_thread_yield_args *uap) { Modified: head/sys/compat/cloudabi64/Makefile ============================================================================== --- head/sys/compat/cloudabi64/Makefile Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/compat/cloudabi64/Makefile Fri Aug 19 17:49:35 2016 (r304478) @@ -8,7 +8,7 @@ sysent: cloudabi64_sysent.c cloudabi64_s cloudabi64_sysent.c cloudabi64_syscall.h cloudabi64_proto.h \ cloudabi64_syscalls.c cloudabi64_systrace_args.c: \ - ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls.master \ + ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls64.master \ syscalls.conf - sh ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls.master \ + sh ../../kern/makesyscalls.sh ../../contrib/cloudabi/syscalls64.master \ syscalls.conf Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_proto.h Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/compat/cloudabi64/cloudabi64_proto.h Fri Aug 19 17:49:35 2016 (r304478) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed + * created from FreeBSD */ #ifndef _CLOUDABI64_SYSPROTO_H_ @@ -236,6 +236,14 @@ struct cloudabi64_sys_poll_args { char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; char nsubscriptions_l_[PADL_(size_t)]; size_t nsubscriptions; char nsubscriptions_r_[PADR_(size_t)]; }; +struct cloudabi64_sys_poll_fd_args { + char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; + char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)]; + char nin_l_[PADL_(size_t)]; size_t nin; char nin_r_[PADR_(size_t)]; + char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; + char nout_l_[PADL_(size_t)]; size_t nout; char nout_r_[PADR_(size_t)]; + char timeout_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi64_subscription_t *)]; +}; struct cloudabi_sys_proc_exec_args { char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; char data_l_[PADL_(const void *)]; const void * data; char data_r_[PADR_(const void *)]; @@ -302,20 +310,9 @@ struct cloudabi_sys_thread_exit_args { char lock_l_[PADL_(cloudabi_lock_t *)]; cloudabi_lock_t * lock; char lock_r_[PADR_(cloudabi_lock_t *)]; char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)]; }; -struct cloudabi_sys_thread_tcb_set_args { - char tcb_l_[PADL_(void *)]; void * tcb; char tcb_r_[PADR_(void *)]; -}; struct cloudabi_sys_thread_yield_args { register_t dummy; }; -struct cloudabi64_sys_poll_fd_args { - char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)]; - char in_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * in; char in_r_[PADR_(const cloudabi64_subscription_t *)]; - char nin_l_[PADL_(size_t)]; size_t nin; char nin_r_[PADR_(size_t)]; - char out_l_[PADL_(cloudabi64_event_t *)]; cloudabi64_event_t * out; char out_r_[PADR_(cloudabi64_event_t *)]; - char nout_l_[PADL_(size_t)]; size_t nout; char nout_r_[PADR_(size_t)]; - char timeout_l_[PADL_(const cloudabi64_subscription_t *)]; const cloudabi64_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi64_subscription_t *)]; -}; int cloudabi_sys_clock_res_get(struct thread *, struct cloudabi_sys_clock_res_get_args *); int cloudabi_sys_clock_time_get(struct thread *, struct cloudabi_sys_clock_time_get_args *); int cloudabi_sys_condvar_signal(struct thread *, struct cloudabi_sys_condvar_signal_args *); @@ -356,6 +353,7 @@ int cloudabi_sys_mem_sync(struct thread int cloudabi_sys_mem_unlock(struct thread *, struct cloudabi_sys_mem_unlock_args *); int cloudabi_sys_mem_unmap(struct thread *, struct cloudabi_sys_mem_unmap_args *); int cloudabi64_sys_poll(struct thread *, struct cloudabi64_sys_poll_args *); +int cloudabi64_sys_poll_fd(struct thread *, struct cloudabi64_sys_poll_fd_args *); int cloudabi_sys_proc_exec(struct thread *, struct cloudabi_sys_proc_exec_args *); int cloudabi_sys_proc_exit(struct thread *, struct cloudabi_sys_proc_exit_args *); int cloudabi_sys_proc_fork(struct thread *, struct cloudabi_sys_proc_fork_args *); @@ -371,9 +369,7 @@ int cloudabi_sys_sock_shutdown(struct th int cloudabi_sys_sock_stat_get(struct thread *, struct cloudabi_sys_sock_stat_get_args *); int cloudabi64_sys_thread_create(struct thread *, struct cloudabi64_sys_thread_create_args *); int cloudabi_sys_thread_exit(struct thread *, struct cloudabi_sys_thread_exit_args *); -int cloudabi_sys_thread_tcb_set(struct thread *, struct cloudabi_sys_thread_tcb_set_args *); int cloudabi_sys_thread_yield(struct thread *, struct cloudabi_sys_thread_yield_args *); -int cloudabi64_sys_poll_fd(struct thread *, struct cloudabi64_sys_poll_fd_args *); #ifdef COMPAT_43 @@ -398,6 +394,12 @@ int cloudabi64_sys_poll_fd(struct thread #endif /* COMPAT_FREEBSD7 */ + +#ifdef COMPAT_FREEBSD10 + + +#endif /* COMPAT_FREEBSD10 */ + #define CLOUDABI64_SYS_AUE_cloudabi_sys_clock_res_get AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_clock_time_get AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_condvar_signal AUE_NULL @@ -438,6 +440,7 @@ int cloudabi64_sys_poll_fd(struct thread #define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_unlock AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_unmap AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_poll AUE_NULL +#define CLOUDABI64_SYS_AUE_cloudabi64_sys_poll_fd AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_proc_exec AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_proc_exit AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_proc_fork AUE_NULL @@ -453,9 +456,7 @@ int cloudabi64_sys_poll_fd(struct thread #define CLOUDABI64_SYS_AUE_cloudabi_sys_sock_stat_get AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi64_sys_thread_create AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_thread_exit AUE_NULL -#define CLOUDABI64_SYS_AUE_cloudabi_sys_thread_tcb_set AUE_NULL #define CLOUDABI64_SYS_AUE_cloudabi_sys_thread_yield AUE_NULL -#define CLOUDABI64_SYS_AUE_cloudabi64_sys_poll_fd AUE_NULL #undef PAD_ #undef PADL_ Modified: head/sys/compat/cloudabi64/cloudabi64_syscall.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscall.h Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/compat/cloudabi64/cloudabi64_syscall.h Fri Aug 19 17:49:35 2016 (r304478) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed + * created from FreeBSD */ #define CLOUDABI64_SYS_cloudabi_sys_clock_res_get 0 @@ -46,22 +46,21 @@ #define CLOUDABI64_SYS_cloudabi_sys_mem_unlock 37 #define CLOUDABI64_SYS_cloudabi_sys_mem_unmap 38 #define CLOUDABI64_SYS_cloudabi64_sys_poll 39 -#define CLOUDABI64_SYS_cloudabi_sys_proc_exec 40 -#define CLOUDABI64_SYS_cloudabi_sys_proc_exit 41 -#define CLOUDABI64_SYS_cloudabi_sys_proc_fork 42 -#define CLOUDABI64_SYS_cloudabi_sys_proc_raise 43 -#define CLOUDABI64_SYS_cloudabi_sys_random_get 44 -#define CLOUDABI64_SYS_cloudabi_sys_sock_accept 45 -#define CLOUDABI64_SYS_cloudabi_sys_sock_bind 46 -#define CLOUDABI64_SYS_cloudabi_sys_sock_connect 47 -#define CLOUDABI64_SYS_cloudabi_sys_sock_listen 48 -#define CLOUDABI64_SYS_cloudabi64_sys_sock_recv 49 -#define CLOUDABI64_SYS_cloudabi64_sys_sock_send 50 -#define CLOUDABI64_SYS_cloudabi_sys_sock_shutdown 51 -#define CLOUDABI64_SYS_cloudabi_sys_sock_stat_get 52 -#define CLOUDABI64_SYS_cloudabi64_sys_thread_create 53 -#define CLOUDABI64_SYS_cloudabi_sys_thread_exit 54 -#define CLOUDABI64_SYS_cloudabi_sys_thread_tcb_set 55 +#define CLOUDABI64_SYS_cloudabi64_sys_poll_fd 40 +#define CLOUDABI64_SYS_cloudabi_sys_proc_exec 41 +#define CLOUDABI64_SYS_cloudabi_sys_proc_exit 42 +#define CLOUDABI64_SYS_cloudabi_sys_proc_fork 43 +#define CLOUDABI64_SYS_cloudabi_sys_proc_raise 44 +#define CLOUDABI64_SYS_cloudabi_sys_random_get 45 +#define CLOUDABI64_SYS_cloudabi_sys_sock_accept 46 +#define CLOUDABI64_SYS_cloudabi_sys_sock_bind 47 +#define CLOUDABI64_SYS_cloudabi_sys_sock_connect 48 +#define CLOUDABI64_SYS_cloudabi_sys_sock_listen 49 +#define CLOUDABI64_SYS_cloudabi64_sys_sock_recv 50 +#define CLOUDABI64_SYS_cloudabi64_sys_sock_send 51 +#define CLOUDABI64_SYS_cloudabi_sys_sock_shutdown 52 +#define CLOUDABI64_SYS_cloudabi_sys_sock_stat_get 53 +#define CLOUDABI64_SYS_cloudabi64_sys_thread_create 54 +#define CLOUDABI64_SYS_cloudabi_sys_thread_exit 55 #define CLOUDABI64_SYS_cloudabi_sys_thread_yield 56 -#define CLOUDABI64_SYS_cloudabi64_sys_poll_fd 57 -#define CLOUDABI64_SYS_MAXSYSCALL 58 +#define CLOUDABI64_SYS_MAXSYSCALL 57 Modified: head/sys/compat/cloudabi64/cloudabi64_syscalls.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscalls.c Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/compat/cloudabi64/cloudabi64_syscalls.c Fri Aug 19 17:49:35 2016 (r304478) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed + * created from FreeBSD */ const char *cloudabi64_syscallnames[] = { @@ -47,22 +47,21 @@ const char *cloudabi64_syscallnames[] = "cloudabi_sys_mem_unlock", /* 37 = cloudabi_sys_mem_unlock */ "cloudabi_sys_mem_unmap", /* 38 = cloudabi_sys_mem_unmap */ "cloudabi64_sys_poll", /* 39 = cloudabi64_sys_poll */ - "cloudabi_sys_proc_exec", /* 40 = cloudabi_sys_proc_exec */ - "cloudabi_sys_proc_exit", /* 41 = cloudabi_sys_proc_exit */ - "cloudabi_sys_proc_fork", /* 42 = cloudabi_sys_proc_fork */ - "cloudabi_sys_proc_raise", /* 43 = cloudabi_sys_proc_raise */ - "cloudabi_sys_random_get", /* 44 = cloudabi_sys_random_get */ - "cloudabi_sys_sock_accept", /* 45 = cloudabi_sys_sock_accept */ - "cloudabi_sys_sock_bind", /* 46 = cloudabi_sys_sock_bind */ - "cloudabi_sys_sock_connect", /* 47 = cloudabi_sys_sock_connect */ - "cloudabi_sys_sock_listen", /* 48 = cloudabi_sys_sock_listen */ - "cloudabi64_sys_sock_recv", /* 49 = cloudabi64_sys_sock_recv */ - "cloudabi64_sys_sock_send", /* 50 = cloudabi64_sys_sock_send */ - "cloudabi_sys_sock_shutdown", /* 51 = cloudabi_sys_sock_shutdown */ - "cloudabi_sys_sock_stat_get", /* 52 = cloudabi_sys_sock_stat_get */ - "cloudabi64_sys_thread_create", /* 53 = cloudabi64_sys_thread_create */ - "cloudabi_sys_thread_exit", /* 54 = cloudabi_sys_thread_exit */ - "cloudabi_sys_thread_tcb_set", /* 55 = cloudabi_sys_thread_tcb_set */ + "cloudabi64_sys_poll_fd", /* 40 = cloudabi64_sys_poll_fd */ + "cloudabi_sys_proc_exec", /* 41 = cloudabi_sys_proc_exec */ + "cloudabi_sys_proc_exit", /* 42 = cloudabi_sys_proc_exit */ + "cloudabi_sys_proc_fork", /* 43 = cloudabi_sys_proc_fork */ + "cloudabi_sys_proc_raise", /* 44 = cloudabi_sys_proc_raise */ + "cloudabi_sys_random_get", /* 45 = cloudabi_sys_random_get */ + "cloudabi_sys_sock_accept", /* 46 = cloudabi_sys_sock_accept */ + "cloudabi_sys_sock_bind", /* 47 = cloudabi_sys_sock_bind */ + "cloudabi_sys_sock_connect", /* 48 = cloudabi_sys_sock_connect */ + "cloudabi_sys_sock_listen", /* 49 = cloudabi_sys_sock_listen */ + "cloudabi64_sys_sock_recv", /* 50 = cloudabi64_sys_sock_recv */ + "cloudabi64_sys_sock_send", /* 51 = cloudabi64_sys_sock_send */ + "cloudabi_sys_sock_shutdown", /* 52 = cloudabi_sys_sock_shutdown */ + "cloudabi_sys_sock_stat_get", /* 53 = cloudabi_sys_sock_stat_get */ + "cloudabi64_sys_thread_create", /* 54 = cloudabi64_sys_thread_create */ + "cloudabi_sys_thread_exit", /* 55 = cloudabi_sys_thread_exit */ "cloudabi_sys_thread_yield", /* 56 = cloudabi_sys_thread_yield */ - "cloudabi64_sys_poll_fd", /* 57 = cloudabi64_sys_poll_fd */ }; Modified: head/sys/compat/cloudabi64/cloudabi64_sysent.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sysent.c Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/compat/cloudabi64/cloudabi64_sysent.c Fri Aug 19 17:49:35 2016 (r304478) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/contrib/cloudabi/syscalls.master 297468 2016-03-31 18:50:06Z ed + * created from FreeBSD */ #include @@ -55,22 +55,21 @@ struct sysent cloudabi64_sysent[] = { { AS(cloudabi_sys_mem_unlock_args), (sy_call_t *)cloudabi_sys_mem_unlock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = cloudabi_sys_mem_unlock */ { AS(cloudabi_sys_mem_unmap_args), (sy_call_t *)cloudabi_sys_mem_unmap, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = cloudabi_sys_mem_unmap */ { AS(cloudabi64_sys_poll_args), (sy_call_t *)cloudabi64_sys_poll, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = cloudabi64_sys_poll */ - { AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi_sys_proc_exec */ - { AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_exit */ - { 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_fork */ - { AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_proc_raise */ - { AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi_sys_random_get */ - { AS(cloudabi_sys_sock_accept_args), (sy_call_t *)cloudabi_sys_sock_accept, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_sock_accept */ - { AS(cloudabi_sys_sock_bind_args), (sy_call_t *)cloudabi_sys_sock_bind, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_bind */ - { AS(cloudabi_sys_sock_connect_args), (sy_call_t *)cloudabi_sys_sock_connect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_connect */ - { AS(cloudabi_sys_sock_listen_args), (sy_call_t *)cloudabi_sys_sock_listen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_sock_listen */ - { AS(cloudabi64_sys_sock_recv_args), (sy_call_t *)cloudabi64_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi64_sys_sock_recv */ - { AS(cloudabi64_sys_sock_send_args), (sy_call_t *)cloudabi64_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi64_sys_sock_send */ - { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi_sys_sock_shutdown */ - { AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = cloudabi_sys_sock_stat_get */ - { AS(cloudabi64_sys_thread_create_args), (sy_call_t *)cloudabi64_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = cloudabi64_sys_thread_create */ - { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi_sys_thread_exit */ - { AS(cloudabi_sys_thread_tcb_set_args), (sy_call_t *)cloudabi_sys_thread_tcb_set, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 55 = cloudabi_sys_thread_tcb_set */ + { AS(cloudabi64_sys_poll_fd_args), (sy_call_t *)cloudabi64_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi64_sys_poll_fd */ + { AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_exec */ + { AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_exit */ + { 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_proc_fork */ + { AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi_sys_proc_raise */ + { AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_random_get */ + { AS(cloudabi_sys_sock_accept_args), (sy_call_t *)cloudabi_sys_sock_accept, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_accept */ + { AS(cloudabi_sys_sock_bind_args), (sy_call_t *)cloudabi_sys_sock_bind, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_bind */ + { AS(cloudabi_sys_sock_connect_args), (sy_call_t *)cloudabi_sys_sock_connect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_sock_connect */ + { AS(cloudabi_sys_sock_listen_args), (sy_call_t *)cloudabi_sys_sock_listen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi_sys_sock_listen */ + { AS(cloudabi64_sys_sock_recv_args), (sy_call_t *)cloudabi64_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi64_sys_sock_recv */ + { AS(cloudabi64_sys_sock_send_args), (sy_call_t *)cloudabi64_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi64_sys_sock_send */ + { AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = cloudabi_sys_sock_shutdown */ + { AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = cloudabi_sys_sock_stat_get */ + { AS(cloudabi64_sys_thread_create_args), (sy_call_t *)cloudabi64_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi64_sys_thread_create */ + { AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 55 = cloudabi_sys_thread_exit */ { 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 56 = cloudabi_sys_thread_yield */ - { AS(cloudabi64_sys_poll_fd_args), (sy_call_t *)cloudabi64_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 57 = cloudabi64_sys_poll_fd */ }; Modified: head/sys/compat/cloudabi64/cloudabi64_systrace_args.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/compat/cloudabi64/cloudabi64_systrace_args.c Fri Aug 19 17:49:35 2016 (r304478) @@ -373,8 +373,20 @@ systrace_args(int sysnum, void *params, *n_args = 3; break; } - /* cloudabi_sys_proc_exec */ + /* cloudabi64_sys_poll_fd */ case 40: { + struct cloudabi64_sys_poll_fd_args *p = params; + iarg[0] = p->fd; /* cloudabi_fd_t */ + uarg[1] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */ + uarg[2] = p->nin; /* size_t */ + uarg[3] = (intptr_t) p->out; /* cloudabi64_event_t * */ + uarg[4] = p->nout; /* size_t */ + uarg[5] = (intptr_t) p->timeout; /* const cloudabi64_subscription_t * */ + *n_args = 6; + break; + } + /* cloudabi_sys_proc_exec */ + case 41: { struct cloudabi_sys_proc_exec_args *p = params; iarg[0] = p->fd; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->data; /* const void * */ @@ -385,26 +397,26 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi_sys_proc_exit */ - case 41: { + case 42: { struct cloudabi_sys_proc_exit_args *p = params; iarg[0] = p->rval; /* cloudabi_exitcode_t */ *n_args = 1; break; } /* cloudabi_sys_proc_fork */ - case 42: { + case 43: { *n_args = 0; break; } /* cloudabi_sys_proc_raise */ - case 43: { + case 44: { struct cloudabi_sys_proc_raise_args *p = params; iarg[0] = p->sig; /* cloudabi_signal_t */ *n_args = 1; break; } /* cloudabi_sys_random_get */ - case 44: { + case 45: { struct cloudabi_sys_random_get_args *p = params; uarg[0] = (intptr_t) p->buf; /* void * */ uarg[1] = p->nbyte; /* size_t */ @@ -412,7 +424,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi_sys_sock_accept */ - case 45: { + case 46: { struct cloudabi_sys_sock_accept_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */ @@ -420,7 +432,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi_sys_sock_bind */ - case 46: { + case 47: { struct cloudabi_sys_sock_bind_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->fd; /* cloudabi_fd_t */ @@ -430,7 +442,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi_sys_sock_connect */ - case 47: { + case 48: { struct cloudabi_sys_sock_connect_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->fd; /* cloudabi_fd_t */ @@ -440,7 +452,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi_sys_sock_listen */ - case 48: { + case 49: { struct cloudabi_sys_sock_listen_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->backlog; /* cloudabi_backlog_t */ @@ -448,7 +460,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi64_sys_sock_recv */ - case 49: { + case 50: { struct cloudabi64_sys_sock_recv_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi64_recv_in_t * */ @@ -457,7 +469,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi64_sys_sock_send */ - case 50: { + case 51: { struct cloudabi64_sys_sock_send_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->in; /* const cloudabi64_send_in_t * */ @@ -466,7 +478,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi_sys_sock_shutdown */ - case 51: { + case 52: { struct cloudabi_sys_sock_shutdown_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ iarg[1] = p->how; /* cloudabi_sdflags_t */ @@ -474,7 +486,7 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi_sys_sock_stat_get */ - case 52: { + case 53: { struct cloudabi_sys_sock_stat_get_args *p = params; iarg[0] = p->sock; /* cloudabi_fd_t */ uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */ @@ -483,44 +495,25 @@ systrace_args(int sysnum, void *params, break; } /* cloudabi64_sys_thread_create */ - case 53: { + case 54: { struct cloudabi64_sys_thread_create_args *p = params; uarg[0] = (intptr_t) p->attr; /* cloudabi64_threadattr_t * */ *n_args = 1; break; } /* cloudabi_sys_thread_exit */ - case 54: { + case 55: { struct cloudabi_sys_thread_exit_args *p = params; uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */ iarg[1] = p->scope; /* cloudabi_scope_t */ *n_args = 2; break; } - /* cloudabi_sys_thread_tcb_set */ - case 55: { - struct cloudabi_sys_thread_tcb_set_args *p = params; - uarg[0] = (intptr_t) p->tcb; /* void * */ - *n_args = 1; - break; - } /* cloudabi_sys_thread_yield */ case 56: { *n_args = 0; break; } - /* cloudabi64_sys_poll_fd */ - case 57: { - struct cloudabi64_sys_poll_fd_args *p = params; - iarg[0] = p->fd; /* cloudabi_fd_t */ - uarg[1] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */ - uarg[2] = p->nin; /* size_t */ - uarg[3] = (intptr_t) p->out; /* cloudabi64_event_t * */ - uarg[4] = p->nout; /* size_t */ - uarg[5] = (intptr_t) p->timeout; /* const cloudabi64_subscription_t * */ - *n_args = 6; - break; - } default: *n_args = 0; break; @@ -1177,13 +1170,38 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* cloudabi_sys_proc_exec */ + /* cloudabi64_sys_poll_fd */ case 40: switch(ndx) { case 0: p = "cloudabi_fd_t"; break; case 1: + p = "const cloudabi64_subscription_t *"; + break; + case 2: + p = "size_t"; + break; + case 3: + p = "cloudabi64_event_t *"; + break; + case 4: + p = "size_t"; + break; + case 5: + p = "const cloudabi64_subscription_t *"; + break; + default: + break; + }; + break; + /* cloudabi_sys_proc_exec */ + case 41: + switch(ndx) { + case 0: + p = "cloudabi_fd_t"; + break; + case 1: p = "const void *"; break; case 2: @@ -1200,7 +1218,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_proc_exit */ - case 41: + case 42: switch(ndx) { case 0: p = "cloudabi_exitcode_t"; @@ -1210,10 +1228,10 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_proc_fork */ - case 42: + case 43: break; /* cloudabi_sys_proc_raise */ - case 43: + case 44: switch(ndx) { case 0: p = "cloudabi_signal_t"; @@ -1223,7 +1241,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_random_get */ - case 44: + case 45: switch(ndx) { case 0: p = "void *"; @@ -1236,7 +1254,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_sock_accept */ - case 45: + case 46: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1249,7 +1267,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_sock_bind */ - case 46: + case 47: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1268,7 +1286,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_sock_connect */ - case 47: + case 48: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1287,7 +1305,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_sock_listen */ - case 48: + case 49: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1300,7 +1318,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi64_sys_sock_recv */ - case 49: + case 50: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1316,7 +1334,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi64_sys_sock_send */ - case 50: + case 51: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1332,7 +1350,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_sock_shutdown */ - case 51: + case 52: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1345,7 +1363,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_sock_stat_get */ - case 52: + case 53: switch(ndx) { case 0: p = "cloudabi_fd_t"; @@ -1361,7 +1379,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi64_sys_thread_create */ - case 53: + case 54: switch(ndx) { case 0: p = "cloudabi64_threadattr_t *"; @@ -1371,7 +1389,7 @@ systrace_entry_setargdesc(int sysnum, in }; break; /* cloudabi_sys_thread_exit */ - case 54: + case 55: switch(ndx) { case 0: p = "cloudabi_lock_t *"; @@ -1383,44 +1401,9 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* cloudabi_sys_thread_tcb_set */ - case 55: - switch(ndx) { - case 0: - p = "void *"; - break; - default: - break; - }; - break; /* cloudabi_sys_thread_yield */ case 56: break; - /* cloudabi64_sys_poll_fd */ - case 57: - switch(ndx) { - case 0: - p = "cloudabi_fd_t"; - break; - case 1: - p = "const cloudabi64_subscription_t *"; - break; - case 2: - p = "size_t"; - break; - case 3: - p = "cloudabi64_event_t *"; - break; - case 4: - p = "size_t"; - break; - case 5: - p = "const cloudabi64_subscription_t *"; - break; - default: - break; - }; - break; default: break; }; @@ -1632,90 +1615,85 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "size_t"; break; - /* cloudabi_sys_proc_exec */ + /* cloudabi64_sys_poll_fd */ case 40: if (ndx == 0 || ndx == 1) + p = "size_t"; + break; + /* cloudabi_sys_proc_exec */ + case 41: + if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_proc_exit */ - case 41: + case 42: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_proc_fork */ - case 42: - /* cloudabi_sys_proc_raise */ case 43: + /* cloudabi_sys_proc_raise */ + case 44: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_random_get */ - case 44: + case 45: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_sock_accept */ - case 45: + case 46: if (ndx == 0 || ndx == 1) p = "cloudabi_fd_t"; break; /* cloudabi_sys_sock_bind */ - case 46: + case 47: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_sock_connect */ - case 47: + case 48: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_sock_listen */ - case 48: + case 49: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi64_sys_sock_recv */ - case 49: + case 50: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi64_sys_sock_send */ - case 50: + case 51: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_sock_shutdown */ - case 51: + case 52: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_sock_stat_get */ - case 52: + case 53: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi64_sys_thread_create */ - case 53: + case 54: if (ndx == 0 || ndx == 1) p = "cloudabi_tid_t"; break; /* cloudabi_sys_thread_exit */ - case 54: - if (ndx == 0 || ndx == 1) - p = "void"; - break; - /* cloudabi_sys_thread_tcb_set */ case 55: if (ndx == 0 || ndx == 1) p = "void"; break; /* cloudabi_sys_thread_yield */ case 56: - /* cloudabi64_sys_poll_fd */ - case 57: - if (ndx == 0 || ndx == 1) - p = "size_t"; - break; default: break; }; Modified: head/sys/contrib/cloudabi/cloudabi64_types.h ============================================================================== --- head/sys/contrib/cloudabi/cloudabi64_types.h Fri Aug 19 17:48:47 2016 (r304477) +++ head/sys/contrib/cloudabi/cloudabi64_types.h Fri Aug 19 17:49:35 2016 (r304478) @@ -31,11 +31,11 @@ #include "cloudabi_types_common.h" typedef struct { - _Alignas(4) cloudabi_auxtype_t a_type; - union { - _Alignas(8) uint64_t a_val; - _Alignas(8) uint64_t a_ptr; - }; + _Alignas(4) cloudabi_auxtype_t a_type; + union { + _Alignas(8) uint64_t a_val; + _Alignas(8) uint64_t a_ptr; + }; } cloudabi64_auxv_t; _Static_assert(offsetof(cloudabi64_auxv_t, a_type) == 0, "Incorrect layout"); _Static_assert(offsetof(cloudabi64_auxv_t, a_val) == 8, "Incorrect layout"); @@ -44,58 +44,68 @@ _Static_assert(sizeof(cloudabi64_auxv_t) _Static_assert(_Alignof(cloudabi64_auxv_t) == 8, "Incorrect layout"); typedef struct { - _Alignas(8) uint64_t iov_base; - _Alignas(8) uint64_t iov_len; + _Alignas(8) uint64_t iov_base; + _Alignas(8) uint64_t iov_len; } cloudabi64_ciovec_t; -_Static_assert(offsetof(cloudabi64_ciovec_t, iov_base) == 0, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_ciovec_t, iov_base) == 0, + "Incorrect layout"); _Static_assert(offsetof(cloudabi64_ciovec_t, iov_len) == 8, "Incorrect layout"); _Static_assert(sizeof(cloudabi64_ciovec_t) == 16, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_ciovec_t) == 8, "Incorrect layout"); typedef struct { - _Alignas(8) cloudabi_userdata_t userdata; - _Alignas(2) cloudabi_errno_t error; - _Alignas(1) cloudabi_eventtype_t type; - union { - struct { - _Alignas(8) cloudabi_userdata_t identifier; - } clock; - struct { - _Alignas(8) uint64_t condvar; - } condvar; - struct { - _Alignas(8) cloudabi_filesize_t nbytes; - _Alignas(4) cloudabi_fd_t fd; - _Alignas(2) cloudabi_eventrwflags_t flags; - } fd_readwrite; - struct { - _Alignas(8) uint64_t lock; - } lock; - struct { - _Alignas(4) cloudabi_fd_t fd; - _Alignas(1) cloudabi_signal_t signal; - _Alignas(4) cloudabi_exitcode_t exitcode; - } proc_terminate; - }; + _Alignas(8) cloudabi_userdata_t userdata; + _Alignas(2) cloudabi_errno_t error; + _Alignas(1) cloudabi_eventtype_t type; + union { + struct { + _Alignas(8) cloudabi_userdata_t identifier; + } clock; + struct { + _Alignas(8) uint64_t condvar; + } condvar; + struct { + _Alignas(8) cloudabi_filesize_t nbytes; + _Alignas(4) cloudabi_fd_t fd; + _Alignas(2) cloudabi_eventrwflags_t flags; + } fd_readwrite; + struct { + _Alignas(8) uint64_t lock; + } lock; + struct { + _Alignas(4) cloudabi_fd_t fd; + _Alignas(1) cloudabi_signal_t signal; + _Alignas(4) cloudabi_exitcode_t exitcode; + } proc_terminate; + }; } cloudabi64_event_t; _Static_assert(offsetof(cloudabi64_event_t, userdata) == 0, "Incorrect layout"); _Static_assert(offsetof(cloudabi64_event_t, error) == 8, "Incorrect layout"); _Static_assert(offsetof(cloudabi64_event_t, type) == 10, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, clock.identifier) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, condvar.condvar) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.nbytes) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.fd) == 24, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.flags) == 28, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, lock.lock) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.fd) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.signal) == 20, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.exitcode) == 24, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, clock.identifier) == 16, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, condvar.condvar) == 16, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.nbytes) == 16, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.fd) == 24, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, fd_readwrite.flags) == 28, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, lock.lock) == 16, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.fd) == 16, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.signal) == 20, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_event_t, proc_terminate.exitcode) == 24, + "Incorrect layout"); _Static_assert(sizeof(cloudabi64_event_t) == 32, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_event_t) == 8, "Incorrect layout"); typedef struct { - _Alignas(8) uint64_t iov_base; - _Alignas(8) uint64_t iov_len; + _Alignas(8) uint64_t iov_base; + _Alignas(8) uint64_t iov_len; } cloudabi64_iovec_t; _Static_assert(offsetof(cloudabi64_iovec_t, iov_base) == 0, "Incorrect layout"); _Static_assert(offsetof(cloudabi64_iovec_t, iov_len) == 8, "Incorrect layout"); @@ -105,96 +115,120 @@ _Static_assert(_Alignof(cloudabi64_iovec typedef void cloudabi64_processentry_t(uint64_t auxv); typedef struct { - _Alignas(8) uint64_t ri_data; - _Alignas(8) uint64_t ri_datalen; - _Alignas(8) uint64_t ri_fds; - _Alignas(8) uint64_t ri_fdslen; - _Alignas(2) cloudabi_msgflags_t ri_flags; + _Alignas(8) uint64_t ri_data; + _Alignas(8) uint64_t ri_datalen; + _Alignas(8) uint64_t ri_fds; + _Alignas(8) uint64_t ri_fdslen; + _Alignas(2) cloudabi_msgflags_t ri_flags; } cloudabi64_recv_in_t; -_Static_assert(offsetof(cloudabi64_recv_in_t, ri_data) == 0, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_in_t, ri_datalen) == 8, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fds) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fdslen) == 24, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_recv_in_t, ri_flags) == 32, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_data) == 0, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_datalen) == 8, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fds) == 16, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_fdslen) == 24, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_recv_in_t, ri_flags) == 32, + "Incorrect layout"); _Static_assert(sizeof(cloudabi64_recv_in_t) == 40, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_recv_in_t) == 8, "Incorrect layout"); typedef struct { - _Alignas(8) uint64_t si_data; - _Alignas(8) uint64_t si_datalen; - _Alignas(8) uint64_t si_fds; - _Alignas(8) uint64_t si_fdslen; - _Alignas(2) cloudabi_msgflags_t si_flags; + _Alignas(8) uint64_t si_data; + _Alignas(8) uint64_t si_datalen; + _Alignas(8) uint64_t si_fds; + _Alignas(8) uint64_t si_fdslen; + _Alignas(2) cloudabi_msgflags_t si_flags; } cloudabi64_send_in_t; -_Static_assert(offsetof(cloudabi64_send_in_t, si_data) == 0, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_send_in_t, si_datalen) == 8, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_send_in_t, si_fds) == 16, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_send_in_t, si_fdslen) == 24, "Incorrect layout"); -_Static_assert(offsetof(cloudabi64_send_in_t, si_flags) == 32, "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_data) == 0, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_datalen) == 8, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_fds) == 16, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_fdslen) == 24, + "Incorrect layout"); +_Static_assert(offsetof(cloudabi64_send_in_t, si_flags) == 32, + "Incorrect layout"); _Static_assert(sizeof(cloudabi64_send_in_t) == 40, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_send_in_t) == 8, "Incorrect layout"); -typedef struct { - _Alignas(8) uint64_t so_datalen; -} cloudabi64_send_out_t; -_Static_assert(offsetof(cloudabi64_send_out_t, so_datalen) == 0, "Incorrect layout"); +typedef struct { _Alignas(8) uint64_t so_datalen; } cloudabi64_send_out_t; +_Static_assert(offsetof(cloudabi64_send_out_t, so_datalen) == 0, + "Incorrect layout"); _Static_assert(sizeof(cloudabi64_send_out_t) == 8, "Incorrect layout"); _Static_assert(_Alignof(cloudabi64_send_out_t) == 8, "Incorrect layout"); typedef struct { - _Alignas(8) cloudabi_userdata_t userdata; - _Alignas(2) cloudabi_subflags_t flags; - _Alignas(1) cloudabi_eventtype_t type; - union { - struct { - _Alignas(8) cloudabi_userdata_t identifier; - _Alignas(4) cloudabi_clockid_t clock_id; - _Alignas(8) cloudabi_timestamp_t timeout; - _Alignas(8) cloudabi_timestamp_t precision; - _Alignas(2) cloudabi_subclockflags_t flags; - } clock; - struct { - _Alignas(8) uint64_t condvar; - _Alignas(8) uint64_t lock; - _Alignas(1) cloudabi_scope_t condvar_scope; - _Alignas(1) cloudabi_scope_t lock_scope; - } condvar; - struct { - _Alignas(4) cloudabi_fd_t fd; - _Alignas(2) cloudabi_subrwflags_t flags; - } fd_readwrite; - struct { - _Alignas(8) uint64_t lock; - _Alignas(1) cloudabi_scope_t lock_scope; - } lock; - struct { - _Alignas(4) cloudabi_fd_t fd; - } proc_terminate; - }; + _Alignas(8) cloudabi_userdata_t userdata; + _Alignas(2) cloudabi_subflags_t flags; + _Alignas(1) cloudabi_eventtype_t type; + union { + struct { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Aug 19 17:49:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96A9DBBFB75; Fri, 19 Aug 2016 17:49:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4A77F1207; Fri, 19 Aug 2016 17:49:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JHnnbR026335; Fri, 19 Aug 2016 17:49:49 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHnnlF026334; Fri, 19 Aug 2016 17:49:49 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608191749.u7JHnnlF026334@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 17:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304479 - head/sys/dev/cxgbe/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 17:49:50 -0000 Author: jhb Date: Fri Aug 19 17:49:49 2016 New Revision: 304479 URL: https://svnweb.freebsd.org/changeset/base/304479 Log: Add structures for VF-specific adapter parameters. While here, mark which parameters are PF-specific and which are VF-specific. Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7508 Modified: head/sys/dev/cxgbe/common/common.h Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Fri Aug 19 17:49:35 2016 (r304478) +++ head/sys/dev/cxgbe/common/common.h Fri Aug 19 17:49:49 2016 (r304479) @@ -280,12 +280,52 @@ struct chip_params { u16 mps_tcam_size; }; +/* VF-only parameters. */ + +/* + * Global Receive Side Scaling (RSS) parameters in host-native format. + */ +struct rss_params { + unsigned int mode; /* RSS mode */ + union { + struct { + u_int synmapen:1; /* SYN Map Enable */ + u_int syn4tupenipv6:1; /* enable hashing 4-tuple IPv6 SYNs */ + u_int syn2tupenipv6:1; /* enable hashing 2-tuple IPv6 SYNs */ + u_int syn4tupenipv4:1; /* enable hashing 4-tuple IPv4 SYNs */ + u_int syn2tupenipv4:1; /* enable hashing 2-tuple IPv4 SYNs */ + u_int ofdmapen:1; /* Offload Map Enable */ + u_int tnlmapen:1; /* Tunnel Map Enable */ + u_int tnlalllookup:1; /* Tunnel All Lookup */ + u_int hashtoeplitz:1; /* use Toeplitz hash */ + } basicvirtual; + } u; +}; + +/* + * Maximum resources provisioned for a PCI VF. + */ +struct vf_resources { + unsigned int nvi; /* N virtual interfaces */ + unsigned int neq; /* N egress Qs */ + unsigned int nethctrl; /* N egress ETH or CTRL Qs */ + unsigned int niqflint; /* N ingress Qs/w free list(s) & intr */ + unsigned int niq; /* N ingress Qs */ + unsigned int tc; /* PCI-E traffic class */ + unsigned int pmask; /* port access rights mask */ + unsigned int nexactf; /* N exact MPS filters */ + unsigned int r_caps; /* read capabilities */ + unsigned int wx_caps; /* write/execute capabilities */ +}; + struct adapter_params { struct sge_params sge; - struct tp_params tp; + struct tp_params tp; /* PF-only */ struct vpd_params vpd; struct pci_params pci; - struct devlog_params devlog; + struct devlog_params devlog; /* PF-only */ + struct rss_params rss; /* VF-only */ + struct vf_resources vfres; /* VF-only */ unsigned int sf_size; /* serial flash size in bytes */ unsigned int sf_nsec; /* # of flash sectors */ From owner-svn-src-all@freebsd.org Fri Aug 19 17:51:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B54EEBBFD34; Fri, 19 Aug 2016 17:51:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6B801170A; Fri, 19 Aug 2016 17:51:54 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JHprVA029286; Fri, 19 Aug 2016 17:51:53 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHpql3029285; Fri, 19 Aug 2016 17:51:52 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608191751.u7JHpql3029285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 19 Aug 2016 17:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304481 - head/sys/contrib/cloudabi 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 17:51:54 -0000 Author: ed Date: Fri Aug 19 17:51:52 2016 New Revision: 304481 URL: https://svnweb.freebsd.org/changeset/base/304481 Log: Add missing SVN keywords keyword. Modified: Directory Properties: head/sys/contrib/cloudabi/syscalls64.master (props changed) From owner-svn-src-all@freebsd.org Fri Aug 19 17:52:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57D7FBBFD9C; Fri, 19 Aug 2016 17:52:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B3C61940; Fri, 19 Aug 2016 17:52:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JHqnbn030010; Fri, 19 Aug 2016 17:52:49 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHqnKs030009; Fri, 19 Aug 2016 17:52:49 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608191752.u7JHqnKs030009@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 17:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304482 - head/sys/dev/cxgbe/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 17:52:50 -0000 Author: jhb Date: Fri Aug 19 17:52:48 2016 New Revision: 304482 URL: https://svnweb.freebsd.org/changeset/base/304482 Log: Adjust t4_port_init() to work with VF devices. Specifically, the FW_PORT_CMD may or may not work for a VF (the PF driver can choose whether or not to permit access to this command), so don't attempt to fetch port information on a VF if permission is denied by the PF. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7511 Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Fri Aug 19 17:51:52 2016 (r304481) +++ head/sys/dev/cxgbe/common/t4_hw.c Fri Aug 19 17:52:48 2016 (r304482) @@ -7938,15 +7938,26 @@ int t4_port_init(struct adapter *adap, i } while ((adap->params.portvec & (1 << j)) == 0); } - c.op_to_portid = htonl(V_FW_CMD_OP(FW_PORT_CMD) | - F_FW_CMD_REQUEST | F_FW_CMD_READ | - V_FW_PORT_CMD_PORTID(j)); - c.action_to_len16 = htonl( - V_FW_PORT_CMD_ACTION(FW_PORT_ACTION_GET_PORT_INFO) | - FW_LEN16(c)); - ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); - if (ret) - return ret; + if (!(adap->flags & IS_VF) || + adap->params.vfres.r_caps & FW_CMD_CAP_PORT) { + c.op_to_portid = htonl(V_FW_CMD_OP(FW_PORT_CMD) | + F_FW_CMD_REQUEST | F_FW_CMD_READ | + V_FW_PORT_CMD_PORTID(j)); + c.action_to_len16 = htonl( + V_FW_PORT_CMD_ACTION(FW_PORT_ACTION_GET_PORT_INFO) | + FW_LEN16(c)); + ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); + if (ret) + return ret; + + ret = be32_to_cpu(c.u.info.lstatus_to_modtype); + p->mdio_addr = (ret & F_FW_PORT_CMD_MDIOCAP) ? + G_FW_PORT_CMD_MDIOADDR(ret) : -1; + p->port_type = G_FW_PORT_CMD_PTYPE(ret); + p->mod_type = G_FW_PORT_CMD_MODTYPE(ret); + + init_link_config(&p->link_cfg, be16_to_cpu(c.u.info.pcap)); + } ret = t4_alloc_vi(adap, mbox, j, pf, vf, 1, addr, &rss_size); if (ret < 0) @@ -7959,14 +7970,6 @@ int t4_port_init(struct adapter *adap, i p->vi[0].rss_size = rss_size; t4_os_set_hw_addr(adap, p->port_id, addr); - ret = be32_to_cpu(c.u.info.lstatus_to_modtype); - p->mdio_addr = (ret & F_FW_PORT_CMD_MDIOCAP) ? - G_FW_PORT_CMD_MDIOADDR(ret) : -1; - p->port_type = G_FW_PORT_CMD_PTYPE(ret); - p->mod_type = G_FW_PORT_CMD_MODTYPE(ret); - - init_link_config(&p->link_cfg, be16_to_cpu(c.u.info.pcap)); - param = V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) | V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_RSSINFO) | V_FW_PARAMS_PARAM_YZ(p->vi[0].viid); From owner-svn-src-all@freebsd.org Fri Aug 19 17:53:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 760BFBBFDFC; Fri, 19 Aug 2016 17:53:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F53E1B0D; Fri, 19 Aug 2016 17:53:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JHrb0h030083; Fri, 19 Aug 2016 17:53:37 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHrbGY030082; Fri, 19 Aug 2016 17:53:37 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608191753.u7JHrbGY030082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 19 Aug 2016 17:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304483 - head/sys/contrib/cloudabi 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 17:53:38 -0000 Author: ed Date: Fri Aug 19 17:53:37 2016 New Revision: 304483 URL: https://svnweb.freebsd.org/changeset/base/304483 Log: Use the proper value for svn:keywords. Pointy hat to: me Modified: Directory Properties: head/sys/contrib/cloudabi/syscalls64.master (props changed) From owner-svn-src-all@freebsd.org Fri Aug 19 17:54:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F8E7BBFE4F; Fri, 19 Aug 2016 17:54:08 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05EC11C9C; Fri, 19 Aug 2016 17:54:07 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JHs7KS030156; Fri, 19 Aug 2016 17:54:07 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHs6DW030152; Fri, 19 Aug 2016 17:54:06 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201608191754.u7JHs6DW030152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 19 Aug 2016 17:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304484 - head/sys/compat/cloudabi64 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 17:54:08 -0000 Author: ed Date: Fri Aug 19 17:54:06 2016 New Revision: 304484 URL: https://svnweb.freebsd.org/changeset/base/304484 Log: Regenerate system call table after r304483. Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h head/sys/compat/cloudabi64/cloudabi64_syscall.h head/sys/compat/cloudabi64/cloudabi64_syscalls.c head/sys/compat/cloudabi64/cloudabi64_sysent.c Modified: head/sys/compat/cloudabi64/cloudabi64_proto.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_proto.h Fri Aug 19 17:53:37 2016 (r304483) +++ head/sys/compat/cloudabi64/cloudabi64_proto.h Fri Aug 19 17:54:06 2016 (r304484) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed */ #ifndef _CLOUDABI64_SYSPROTO_H_ Modified: head/sys/compat/cloudabi64/cloudabi64_syscall.h ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscall.h Fri Aug 19 17:53:37 2016 (r304483) +++ head/sys/compat/cloudabi64/cloudabi64_syscall.h Fri Aug 19 17:54:06 2016 (r304484) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed */ #define CLOUDABI64_SYS_cloudabi_sys_clock_res_get 0 Modified: head/sys/compat/cloudabi64/cloudabi64_syscalls.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_syscalls.c Fri Aug 19 17:53:37 2016 (r304483) +++ head/sys/compat/cloudabi64/cloudabi64_syscalls.c Fri Aug 19 17:54:06 2016 (r304484) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed */ const char *cloudabi64_syscallnames[] = { Modified: head/sys/compat/cloudabi64/cloudabi64_sysent.c ============================================================================== --- head/sys/compat/cloudabi64/cloudabi64_sysent.c Fri Aug 19 17:53:37 2016 (r304483) +++ head/sys/compat/cloudabi64/cloudabi64_sysent.c Fri Aug 19 17:54:06 2016 (r304484) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD + * created from FreeBSD: head/sys/contrib/cloudabi/syscalls64.master 304483 2016-08-19 17:53:37Z ed */ #include From owner-svn-src-all@freebsd.org Fri Aug 19 17:54:52 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 562F8BBFEAB; Fri, 19 Aug 2016 17:54:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E0091E02; Fri, 19 Aug 2016 17:54:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JHspvV030229; Fri, 19 Aug 2016 17:54:51 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHspnD030228; Fri, 19 Aug 2016 17:54:51 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608191754.u7JHspnD030228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 17:54:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304485 - head/sys/dev/cxgbe 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 17:54:52 -0000 Author: jhb Date: Fri Aug 19 17:54:51 2016 New Revision: 304485 URL: https://svnweb.freebsd.org/changeset/base/304485 Log: Reorder sysctls so that nodes shared with the VF driver are added first. This permits a single early return for VF devices in the routines that add sysctl nodes. Reviewed by: np Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D7512 Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Aug 19 17:54:06 2016 (r304484) +++ head/sys/dev/cxgbe/t4_main.c Fri Aug 19 17:54:51 2016 (r304485) @@ -4592,6 +4592,32 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nports", CTLFLAG_RD, NULL, sc->params.nports, "# of ports"); + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "doorbells", + CTLTYPE_STRING | CTLFLAG_RD, doorbells, sc->doorbells, + sysctl_bitfield, "A", "available doorbells"); + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_clock", CTLFLAG_RD, NULL, + sc->params.vpd.cclk, "core clock frequency (in KHz)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_timers", + CTLTYPE_STRING | CTLFLAG_RD, sc->params.sge.timer_val, + sizeof(sc->params.sge.timer_val), sysctl_int_array, "A", + "interrupt holdoff timer values (us)"); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pkt_counts", + CTLTYPE_STRING | CTLFLAG_RD, sc->params.sge.counter_val, + sizeof(sc->params.sge.counter_val), sysctl_int_array, "A", + "interrupt holdoff packet counter values"); + + t4_sge_sysctls(sc, ctx, children); + + sc->lro_timeout = 100; + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lro_timeout", CTLFLAG_RW, + &sc->lro_timeout, 0, "lro inactive-flush timeout (in us)"); + + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "debug_flags", CTLFLAG_RW, + &sc->debug_flags, 0, "flags to enable runtime debugging"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "hw_revision", CTLFLAG_RD, NULL, chip_rev(sc), "chip hardware revision"); @@ -4612,10 +4638,6 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "cfcsum", CTLFLAG_RD, NULL, sc->cfcsum, "config file checksum"); - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "doorbells", - CTLTYPE_STRING | CTLFLAG_RD, doorbells, sc->doorbells, - sysctl_bitfield, "A", "available doorbells"); - #define SYSCTL_CAP(name, n, text) \ SYSCTL_ADD_PROC(ctx, children, OID_AUTO, #name, \ CTLTYPE_STRING | CTLFLAG_RD, caps_decoder[n], sc->name, \ @@ -4632,19 +4654,6 @@ t4_sysctls(struct adapter *sc) SYSCTL_CAP(fcoecaps, 8, "FCoE"); #undef SYSCTL_CAP - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "core_clock", CTLFLAG_RD, NULL, - sc->params.vpd.cclk, "core clock frequency (in KHz)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_timers", - CTLTYPE_STRING | CTLFLAG_RD, sc->params.sge.timer_val, - sizeof(sc->params.sge.timer_val), sysctl_int_array, "A", - "interrupt holdoff timer values (us)"); - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_pkt_counts", - CTLTYPE_STRING | CTLFLAG_RD, sc->params.sge.counter_val, - sizeof(sc->params.sge.counter_val), sysctl_int_array, "A", - "interrupt holdoff packet counter values"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nfilters", CTLFLAG_RD, NULL, sc->tids.nftids, "number of filters"); @@ -4652,15 +4661,6 @@ t4_sysctls(struct adapter *sc) CTLFLAG_RD, sc, 0, sysctl_temperature, "I", "chip temperature (in Celsius)"); - t4_sge_sysctls(sc, ctx, children); - - sc->lro_timeout = 100; - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "lro_timeout", CTLFLAG_RW, - &sc->lro_timeout, 0, "lro inactive-flush timeout (in us)"); - - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "debug_flags", CTLFLAG_RW, - &sc->debug_flags, 0, "flags to enable runtime debugging"); - #ifdef SBUF_DRAIN /* * dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload. From owner-svn-src-all@freebsd.org Fri Aug 19 17:57:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5FE1BBFF5A; Fri, 19 Aug 2016 17:57:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89298126A; Fri, 19 Aug 2016 17:57:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JHvELY030463; Fri, 19 Aug 2016 17:57:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JHvEB2030460; Fri, 19 Aug 2016 17:57:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608191757.u7JHvEB2030460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 19 Aug 2016 17:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304487 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 17:57:15 -0000 Author: markj Date: Fri Aug 19 17:57:14 2016 New Revision: 304487 URL: https://svnweb.freebsd.org/changeset/base/304487 Log: Don't set P2_PTRACE_FSTP in a process that invokes ptrace(PT_TRACE_ME). Such processes are stopped synchronously by a direct call to ptracestop(SIGTRAP) upon exec. P2_PTRACE_FSTP causes the exec()ing thread to suspend itself while waiting for a SIGSTOP that never arrives. Reviewed by: kib MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D7576 Modified: head/sys/kern/kern_fork.c head/sys/kern/sys_process.c head/sys/sys/proc.h Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Fri Aug 19 17:55:34 2016 (r304486) +++ head/sys/kern/kern_fork.c Fri Aug 19 17:57:14 2016 (r304487) @@ -1074,7 +1074,7 @@ fork_return(struct thread *td, struct tr * parent's children, do it now. */ dbg = p->p_pptr->p_pptr; - proc_set_traced(p); + proc_set_traced(p, true); CTR2(KTR_PTRACE, "fork_return: attaching to new child pid %d: oppid %d", p->p_pid, p->p_oppid); Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Fri Aug 19 17:55:34 2016 (r304486) +++ head/sys/kern/sys_process.c Fri Aug 19 17:57:14 2016 (r304487) @@ -693,12 +693,13 @@ sys_ptrace(struct thread *td, struct ptr #endif void -proc_set_traced(struct proc *p) +proc_set_traced(struct proc *p, bool stop) { PROC_LOCK_ASSERT(p, MA_OWNED); p->p_flag |= P_TRACED; - p->p_flag2 |= P2_PTRACE_FSTP; + if (stop) + p->p_flag2 |= P2_PTRACE_FSTP; p->p_ptevents = PTRACE_DEFAULT; p->p_oppid = p->p_pptr->p_pid; } @@ -910,7 +911,7 @@ kern_ptrace(struct thread *td, int req, switch (req) { case PT_TRACE_ME: /* set my trace flag and "owner" so it can read/write me */ - proc_set_traced(p); + proc_set_traced(p, false); if (p->p_flag & P_PPWAIT) p->p_flag |= P_PPTRACE; CTR1(KTR_PTRACE, "PT_TRACE_ME: pid %d", p->p_pid); @@ -927,7 +928,7 @@ kern_ptrace(struct thread *td, int req, * The old parent is remembered so we can put things back * on a "detach". */ - proc_set_traced(p); + proc_set_traced(p, true); if (p->p_pptr != td->td_proc) { proc_reparent(p, td->td_proc); } Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Fri Aug 19 17:55:34 2016 (r304486) +++ head/sys/sys/proc.h Fri Aug 19 17:57:14 2016 (r304487) @@ -1010,7 +1010,7 @@ void proc_linkup(struct proc *p, struct struct proc *proc_realparent(struct proc *child); void proc_reap(struct thread *td, struct proc *p, int *status, int options); void proc_reparent(struct proc *child, struct proc *newparent); -void proc_set_traced(struct proc *p); +void proc_set_traced(struct proc *p, bool stop); struct pstats *pstats_alloc(void); void pstats_fork(struct pstats *src, struct pstats *dst); void pstats_free(struct pstats *ps); From owner-svn-src-all@freebsd.org Fri Aug 19 18:02:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5977BBC013C; Fri, 19 Aug 2016 18:02:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 283BF17E9; Fri, 19 Aug 2016 18:02:37 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JI2aF3033951; Fri, 19 Aug 2016 18:02:36 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JI2ana033950; Fri, 19 Aug 2016 18:02:36 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608191802.u7JI2ana033950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Aug 2016 18:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304488 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 18:02:37 -0000 Author: manu Date: Fri Aug 19 18:02:36 2016 New Revision: 304488 URL: https://svnweb.freebsd.org/changeset/base/304488 Log: Keep boot parameters in ARM trampoline code Currently boot parameters (r0 - r3) are forgotten in ARM trampoline code. This patch save them at startup and restore them before jumping into kernel _start() routine. This is usefull when booting with Linux ABI and/or custom bootloader. Submitted by: Grégory Soutadé Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D7395 Modified: head/sys/arm/arm/elf_trampoline.c Modified: head/sys/arm/arm/elf_trampoline.c ============================================================================== --- head/sys/arm/arm/elf_trampoline.c Fri Aug 19 17:57:14 2016 (r304487) +++ head/sys/arm/arm/elf_trampoline.c Fri Aug 19 18:02:36 2016 (r304488) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include extern char kernel_start[]; extern char kernel_end[]; @@ -47,7 +48,7 @@ extern void *_end; void _start(void); void __start(void); -void __startC(void); +void __startC(unsigned r0, unsigned r1, unsigned r2, unsigned r3); extern unsigned int cpu_ident(void); extern void armv6_idcache_wbinv_all(void); @@ -124,6 +125,10 @@ static int arm_dcache_l2_nsets; static int arm_dcache_l2_assoc; static int arm_dcache_l2_linesize; +/* + * Boot parameters + */ +static struct arm_boot_params s_boot_params; extern int arm9_dcache_sets_inc; extern int arm9_dcache_sets_max; @@ -172,12 +177,17 @@ bzero(void *addr, int count) static void arm9_setup(void); void -_startC(void) +_startC(unsigned r0, unsigned r1, unsigned r2, unsigned r3) { int tmp1; unsigned int sp = ((unsigned int)&_end & ~3) + 4; unsigned int pc, kernphysaddr; + s_boot_params.abp_r0 = r0; + s_boot_params.abp_r1 = r1; + s_boot_params.abp_r2 = r2; + s_boot_params.abp_r3 = r3; + /* * Figure out the physical address the kernel was loaded at. This * assumes the entry point (this code right here) is in the first page, @@ -211,8 +221,15 @@ _startC(void) /* Temporary set the sp and jump to the new location. */ __asm __volatile( "mov sp, %1\n" + "mov r0, %2\n" + "mov r1, %3\n" + "mov r2, %4\n" + "mov r3, %5\n" "mov pc, %0\n" - : : "r" (target_addr), "r" (tmp_sp)); + : : "r" (target_addr), "r" (tmp_sp), + "r" (s_boot_params.abp_r0), "r" (s_boot_params.abp_r1), + "r" (s_boot_params.abp_r2), "r" (s_boot_params.abp_r3), + : "r0", "r1", "r2", "r3"); } #endif @@ -487,6 +504,7 @@ load_kernel(unsigned int kstart, unsigne vm_offset_t lastaddr = 0; Elf_Addr ssym = 0; Elf_Dyn *dp; + struct arm_boot_params local_boot_params; eh = (Elf32_Ehdr *)kstart; ssym = 0; @@ -555,6 +573,12 @@ load_kernel(unsigned int kstart, unsigne if (!d) return ((void *)lastaddr); + /* + * Now the stack is fixed, copy boot params + * before it's overrided + */ + memcpy(&local_boot_params, &s_boot_params, sizeof(local_boot_params)); + j = eh->e_phnum; for (i = 0; i < j; i++) { volatile char c; @@ -604,7 +628,10 @@ load_kernel(unsigned int kstart, unsigne "mcr p15, 0, %0, c1, c0, 0\n" /* CP15_SCTLR(%0)*/ : "=r" (ssym)); /* Jump to the entry point. */ - ((void(*)(void))(entry_point - KERNVIRTADDR + curaddr))(); + ((void(*)(unsigned, unsigned, unsigned, unsigned)) + (entry_point - KERNVIRTADDR + curaddr)) + (local_boot_params.abp_r0, local_boot_params.abp_r1, + local_boot_params.abp_r2, local_boot_params.abp_r3); __asm __volatile(".globl func_end\n" "func_end:"); From owner-svn-src-all@freebsd.org Fri Aug 19 18:09:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8ED1CBC0223; Fri, 19 Aug 2016 18:09:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 53E601B41; Fri, 19 Aug 2016 18:09:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JI90Ev034205; Fri, 19 Aug 2016 18:09:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JI8xJo034199; Fri, 19 Aug 2016 18:08:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608191808.u7JI8xJo034199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Aug 2016 18:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304489 - releng/11.0/share/mk X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 18:09:01 -0000 Author: bdrewery Date: Fri Aug 19 18:08:59 2016 New Revision: 304489 URL: https://svnweb.freebsd.org/changeset/base/304489 Log: MFS r304144: MFC r303964: PROGS: Support INTERNALPROG.prog=yes to not install it. Approved by: re (gjb) Modified: releng/11.0/share/mk/bsd.README releng/11.0/share/mk/bsd.progs.mk Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/share/mk/bsd.README ============================================================================== --- releng/11.0/share/mk/bsd.README Fri Aug 19 18:02:36 2016 (r304488) +++ releng/11.0/share/mk/bsd.README Fri Aug 19 18:08:59 2016 (r304489) @@ -331,6 +331,7 @@ PROGS_CXX PROG and PROGS_CXX in one Make - DEBUG_FLAGS - DPADD - DPSRCS + - INTERNALPROG (no installation) - LDADD - LDFLAGS - LIBADD Modified: releng/11.0/share/mk/bsd.progs.mk ============================================================================== --- releng/11.0/share/mk/bsd.progs.mk Fri Aug 19 18:02:36 2016 (r304488) +++ releng/11.0/share/mk/bsd.progs.mk Fri Aug 19 18:08:59 2016 (r304489) @@ -24,8 +24,8 @@ PROGS += ${PROGS_CXX} # just one of many PROG_OVERRIDE_VARS += BINDIR BINGRP BINOWN BINMODE DPSRCS MAN NO_WERROR \ PROGNAME SRCS STRIP WARNS -PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD LDADD LIBADD LINKS \ - LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} +PROG_VARS += CFLAGS CXXFLAGS DEBUG_FLAGS DPADD INTERNALPROG LDADD LIBADD \ + LINKS LDFLAGS MLINKS ${PROG_OVERRIDE_VARS} .for v in ${PROG_VARS:O:u} .if empty(${PROG_OVERRIDE_VARS:M$v}) .if defined(${v}.${PROG}) From owner-svn-src-all@freebsd.org Fri Aug 19 18:14:35 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2470CBC043F; Fri, 19 Aug 2016 18:14:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB8A612F1; Fri, 19 Aug 2016 18:14:34 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JIEYSf037691; Fri, 19 Aug 2016 18:14:34 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JIEY3E037690; Fri, 19 Aug 2016 18:14:34 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608191814.u7JIEY3E037690@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Aug 2016 18:14:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304490 - releng/11.0/usr.bin/xinstall X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 18:14:35 -0000 Author: bdrewery Date: Fri Aug 19 18:14:33 2016 New Revision: 304490 URL: https://svnweb.freebsd.org/changeset/base/304490 Log: MFS r304469: MFC r303929,r303930,r303931,r303932,r303933: r303929: Fix -S with -b not atomically updating the destination file. r303930: Support -v for -l. r303931: Fix -S with -l not being atomic. r303932: Fix -b failure not restoring flags on the destination file. r303933: Squelch a false-positive Clang static analyzer warning. Approved by: re (gjb) Modified: releng/11.0/usr.bin/xinstall/xinstall.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/usr.bin/xinstall/xinstall.c ============================================================================== --- releng/11.0/usr.bin/xinstall/xinstall.c Fri Aug 19 18:08:59 2016 (r304489) +++ releng/11.0/usr.bin/xinstall/xinstall.c Fri Aug 19 18:14:33 2016 (r304490) @@ -149,6 +149,7 @@ main(int argc, char *argv[]) char *p; const char *to_name; + fset = 0; iflags = 0; group = owner = NULL; while ((ch = getopt(argc, argv, "B:bCcD:df:g:h:l:M:m:N:o:pSsT:Uv")) != @@ -533,7 +534,9 @@ do_link(const char *from_name, const cha if (target_sb->st_flags & NOCHANGEBITS) (void)chflags(to_name, target_sb->st_flags & ~NOCHANGEBITS); - unlink(to_name); + if (verbose) + printf("install: link %s -> %s\n", + from_name, to_name); ret = rename(tmpl, to_name); /* * If rename has posix semantics, then the temporary @@ -543,8 +546,12 @@ do_link(const char *from_name, const cha (void)unlink(tmpl); } return (ret); - } else + } else { + if (verbose) + printf("install: link %s -> %s\n", + from_name, to_name); return (link(from_name, to_name)); + } } /* @@ -573,14 +580,18 @@ do_symlink(const char *from_name, const if (target_sb->st_flags & NOCHANGEBITS) (void)chflags(to_name, target_sb->st_flags & ~NOCHANGEBITS); - unlink(to_name); - + if (verbose) + printf("install: symlink %s -> %s\n", + from_name, to_name); if (rename(tmpl, to_name) == -1) { /* Remove temporary link before exiting. */ (void)unlink(tmpl); err(EX_OSERR, "%s: rename", to_name); } } else { + if (verbose) + printf("install: symlink %s -> %s\n", + from_name, to_name); if (symlink(from_name, to_name) == -1) err(EX_OSERR, "symlink %s -> %s", from_name, to_name); } @@ -886,11 +897,21 @@ install(const char *from_name, const cha } if (verbose) (void)printf("install: %s -> %s\n", to_name, backup); - if (rename(to_name, backup) < 0) { + if (unlink(backup) < 0 && errno != ENOENT) { + serrno = errno; + if (to_sb.st_flags & NOCHANGEBITS) + (void)chflags(to_name, to_sb.st_flags); + unlink(tempfile); + errno = serrno; + err(EX_OSERR, "unlink: %s", backup); + } + if (link(to_name, backup) < 0) { serrno = errno; unlink(tempfile); + if (to_sb.st_flags & NOCHANGEBITS) + (void)chflags(to_name, to_sb.st_flags); errno = serrno; - err(EX_OSERR, "rename: %s to %s", to_name, + err(EX_OSERR, "link: %s to %s", to_name, backup); } } @@ -1111,16 +1132,26 @@ create_newfile(const char *path, int tar if (dobackup) { if ((size_t)snprintf(backup, MAXPATHLEN, "%s%s", - path, suffix) != strlen(path) + strlen(suffix)) + path, suffix) != strlen(path) + strlen(suffix)) { + saved_errno = errno; + if (sbp->st_flags & NOCHANGEBITS) + (void)chflags(path, sbp->st_flags); + errno = saved_errno; errx(EX_OSERR, "%s: backup filename too long", path); + } (void)snprintf(backup, MAXPATHLEN, "%s%s", path, suffix); if (verbose) (void)printf("install: %s -> %s\n", path, backup); - if (rename(path, backup) < 0) + if (rename(path, backup) < 0) { + saved_errno = errno; + if (sbp->st_flags & NOCHANGEBITS) + (void)chflags(path, sbp->st_flags); + errno = saved_errno; err(EX_OSERR, "rename: %s to %s", path, backup); + } } else if (unlink(path) < 0) saved_errno = errno; From owner-svn-src-all@freebsd.org Fri Aug 19 18:40:48 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C2FCBC08BA; Fri, 19 Aug 2016 18:40:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1EEC8143B; Fri, 19 Aug 2016 18:40:48 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JIelj2046419; Fri, 19 Aug 2016 18:40:47 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JIelkV046418; Fri, 19 Aug 2016 18:40:47 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608191840.u7JIelkV046418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Aug 2016 18:40:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304491 - releng/11.0/sys/conf X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 18:40:48 -0000 Author: bdrewery Date: Fri Aug 19 18:40:47 2016 New Revision: 304491 URL: https://svnweb.freebsd.org/changeset/base/304491 Log: MFS r304470: MFC r304005: PORTS_MODULES: Don't leak in CC/CXX/CPP. Approved by: re (gjb) Modified: releng/11.0/sys/conf/kern.post.mk Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/sys/conf/kern.post.mk ============================================================================== --- releng/11.0/sys/conf/kern.post.mk Fri Aug 19 18:14:33 2016 (r304490) +++ releng/11.0/sys/conf/kern.post.mk Fri Aug 19 18:40:47 2016 (r304491) @@ -65,6 +65,10 @@ OSRELDATE!= awk '/^\#define[[:space:]]*_ # Keep the related ports builds in the obj directory so that they are only rebuilt once per kernel build WRKDIRPREFIX?= ${MAKEOBJDIRPREFIX}${SRC_BASE}/sys/${KERNCONF} PORTSMODULESENV=\ + env \ + -u CC \ + -u CXX \ + -u CPP \ PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \ SRC_BASE=${SRC_BASE} \ OSVERSION=${OSRELDATE} \ From owner-svn-src-all@freebsd.org Fri Aug 19 18:45:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E964BC0A2A; Fri, 19 Aug 2016 18:45:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF9531887; Fri, 19 Aug 2016 18:45:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JIjgRn049224; Fri, 19 Aug 2016 18:45:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JIjgn5049223; Fri, 19 Aug 2016 18:45:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608191845.u7JIjgn5049223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 18:45:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304492 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 18:45:44 -0000 Author: jhb Date: Fri Aug 19 18:45:42 2016 New Revision: 304492 URL: https://svnweb.freebsd.org/changeset/base/304492 Log: Move cxgb and cxgbe down to the non-mii PCI NIC section. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Aug 19 18:40:47 2016 (r304491) +++ head/sys/conf/NOTES Fri Aug 19 18:45:42 2016 (r304492) @@ -2116,9 +2116,6 @@ device bce # Broadcom BCM5706/BCM5708 device bfe # Broadcom BCM440x 10/100 Ethernet device bge # Broadcom BCM570xx Gigabit Ethernet device cas # Sun Cassini/Cassini+ and NS DP83065 Saturn -device cxgb # Chelsio T3 10 Gigabit Ethernet -device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware -device cxgbe # Chelsio T4 and T5 1GbE/10GbE/40GbE device dc # DEC/Intel 21143 and various workalikes device et # Agere ET1310 10/100/Gigabit Ethernet device fxp # Intel EtherExpress PRO/100B (82557, 82558) @@ -2149,6 +2146,9 @@ device wb # Winbond W89C840F device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # PCI Ethernet NICs. +device cxgb # Chelsio T3 10 Gigabit Ethernet +device cxgb_t3fw # Chelsio T3 10 Gigabit Ethernet firmware +device cxgbe # Chelsio T4 and T5 1GbE/10GbE/40GbE device de # DEC/Intel DC21x4x (``Tulip'') device em # Intel Pro/1000 Gigabit Ethernet device igb # Intel Pro/1000 PCIE Gigabit Ethernet From owner-svn-src-all@freebsd.org Fri Aug 19 19:02:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8894CBC0C65; Fri, 19 Aug 2016 19:02:20 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 599C91FAD; Fri, 19 Aug 2016 19:02:20 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JJ2JSl056877; Fri, 19 Aug 2016 19:02:19 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JJ2IfX056871; Fri, 19 Aug 2016 19:02:18 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201608191902.u7JJ2IfX056871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Fri, 19 Aug 2016 19:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304493 - releng/11.0/sys/dev/e1000 X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 19:02:20 -0000 Author: sbruno Date: Fri Aug 19 19:02:18 2016 New Revision: 304493 URL: https://svnweb.freebsd.org/changeset/base/304493 Log: MF stable11 r304337 e1000: Add support for Kaby Lake IDs Fixup some errors when transitioning to/from low power states. Approved by: re (kib) Modified: releng/11.0/sys/dev/e1000/e1000_api.c releng/11.0/sys/dev/e1000/e1000_hw.h releng/11.0/sys/dev/e1000/e1000_ich8lan.c releng/11.0/sys/dev/e1000/e1000_ich8lan.h releng/11.0/sys/dev/e1000/e1000_phy.c releng/11.0/sys/dev/e1000/if_em.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/sys/dev/e1000/e1000_api.c ============================================================================== --- releng/11.0/sys/dev/e1000/e1000_api.c Fri Aug 19 18:45:42 2016 (r304492) +++ releng/11.0/sys/dev/e1000/e1000_api.c Fri Aug 19 19:02:18 2016 (r304493) @@ -304,6 +304,10 @@ s32 e1000_set_mac_type(struct e1000_hw * case E1000_DEV_ID_PCH_SPT_I219_LM2: case E1000_DEV_ID_PCH_SPT_I219_V2: case E1000_DEV_ID_PCH_LBG_I219_LM3: + case E1000_DEV_ID_PCH_SPT_I219_LM4: + case E1000_DEV_ID_PCH_SPT_I219_V4: + case E1000_DEV_ID_PCH_SPT_I219_LM5: + case E1000_DEV_ID_PCH_SPT_I219_V5: mac->type = e1000_pch_spt; break; case E1000_DEV_ID_82575EB_COPPER: Modified: releng/11.0/sys/dev/e1000/e1000_hw.h ============================================================================== --- releng/11.0/sys/dev/e1000/e1000_hw.h Fri Aug 19 18:45:42 2016 (r304492) +++ releng/11.0/sys/dev/e1000/e1000_hw.h Fri Aug 19 19:02:18 2016 (r304493) @@ -142,6 +142,10 @@ struct e1000_hw; #define E1000_DEV_ID_PCH_SPT_I219_LM2 0x15B7 /* Sunrise Point-H PCH */ #define E1000_DEV_ID_PCH_SPT_I219_V2 0x15B8 /* Sunrise Point-H PCH */ #define E1000_DEV_ID_PCH_LBG_I219_LM3 0x15B9 /* LEWISBURG PCH */ +#define E1000_DEV_ID_PCH_SPT_I219_LM4 0x15D7 +#define E1000_DEV_ID_PCH_SPT_I219_V4 0x15D8 +#define E1000_DEV_ID_PCH_SPT_I219_LM5 0x15E3 +#define E1000_DEV_ID_PCH_SPT_I219_V5 0x15D6 #define E1000_DEV_ID_82576 0x10C9 #define E1000_DEV_ID_82576_FIBER 0x10E6 #define E1000_DEV_ID_82576_SERDES 0x10E7 @@ -957,9 +961,13 @@ struct e1000_dev_spec_ich8lan { E1000_MUTEX nvm_mutex; E1000_MUTEX swflag_mutex; bool nvm_k1_enabled; + bool disable_k1_off; bool eee_disable; u16 eee_lp_ability; enum e1000_ulp_state ulp_state; + bool ulp_capability_disabled; + bool during_suspend_flow; + bool during_dpg_exit; }; struct e1000_dev_spec_82575 { Modified: releng/11.0/sys/dev/e1000/e1000_ich8lan.c ============================================================================== --- releng/11.0/sys/dev/e1000/e1000_ich8lan.c Fri Aug 19 18:45:42 2016 (r304492) +++ releng/11.0/sys/dev/e1000/e1000_ich8lan.c Fri Aug 19 19:02:18 2016 (r304493) @@ -288,7 +288,7 @@ static void e1000_toggle_lanphypc_pch_lp mac_reg &= ~E1000_CTRL_LANPHYPC_VALUE; E1000_WRITE_REG(hw, E1000_CTRL, mac_reg); E1000_WRITE_FLUSH(hw); - usec_delay(10); + msec_delay(1); mac_reg &= ~E1000_CTRL_LANPHYPC_OVERRIDE; E1000_WRITE_REG(hw, E1000_CTRL, mac_reg); E1000_WRITE_FLUSH(hw); @@ -1625,7 +1625,17 @@ static s32 e1000_check_for_copper_link_i hw->phy.ops.write_reg_locked(hw, I217_PLL_CLOCK_GATE_REG, phy_reg); - } + + if (speed == SPEED_1000) { + hw->phy.ops.read_reg_locked(hw, HV_PM_CTRL, + &phy_reg); + + phy_reg |= HV_PM_CTRL_K1_CLK_REQ; + + hw->phy.ops.write_reg_locked(hw, HV_PM_CTRL, + phy_reg); + } + } hw->phy.ops.release(hw); if (ret_val) @@ -1718,7 +1728,8 @@ static s32 e1000_check_for_copper_link_i u32 pcieanacfg = E1000_READ_REG(hw, E1000_PCIEANACFG); u32 fextnvm6 = E1000_READ_REG(hw, E1000_FEXTNVM6); - if (pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE) + if ((pcieanacfg & E1000_FEXTNVM6_K1_OFF_ENABLE) && + (hw->dev_spec.ich8lan.disable_k1_off == FALSE)) fextnvm6 |= E1000_FEXTNVM6_K1_OFF_ENABLE; else fextnvm6 &= ~E1000_FEXTNVM6_K1_OFF_ENABLE; Modified: releng/11.0/sys/dev/e1000/e1000_ich8lan.h ============================================================================== --- releng/11.0/sys/dev/e1000/e1000_ich8lan.h Fri Aug 19 18:45:42 2016 (r304492) +++ releng/11.0/sys/dev/e1000/e1000_ich8lan.h Fri Aug 19 19:02:18 2016 (r304493) @@ -239,7 +239,7 @@ /* PHY Power Management Control */ #define HV_PM_CTRL PHY_REG(770, 17) -#define HV_PM_CTRL_PLL_STOP_IN_K1_GIGA 0x100 +#define HV_PM_CTRL_K1_CLK_REQ 0x200 #define HV_PM_CTRL_K1_ENABLE 0x4000 #define I217_PLL_CLOCK_GATE_REG PHY_REG(772, 28) Modified: releng/11.0/sys/dev/e1000/e1000_phy.c ============================================================================== --- releng/11.0/sys/dev/e1000/e1000_phy.c Fri Aug 19 18:45:42 2016 (r304492) +++ releng/11.0/sys/dev/e1000/e1000_phy.c Fri Aug 19 19:02:18 2016 (r304493) @@ -4146,12 +4146,13 @@ s32 e1000_read_phy_reg_mphy(struct e1000 *data = E1000_READ_REG(hw, E1000_MPHY_DATA); /* Disable access to mPHY if it was originally disabled */ - if (locked) { + if (locked) ready = e1000_is_mphy_ready(hw); - if (!ready) - return -E1000_ERR_PHY; - } - E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS); + if (!ready) + return -E1000_ERR_PHY; + E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, + E1000_MPHY_DIS_ACCESS); + return E1000_SUCCESS; } @@ -4210,12 +4211,13 @@ s32 e1000_write_phy_reg_mphy(struct e100 E1000_WRITE_REG(hw, E1000_MPHY_DATA, data); /* Disable access to mPHY if it was originally disabled */ - if (locked) { + if (locked) ready = e1000_is_mphy_ready(hw); - if (!ready) - return -E1000_ERR_PHY; - } - E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, E1000_MPHY_DIS_ACCESS); + if (!ready) + return -E1000_ERR_PHY; + E1000_WRITE_REG(hw, E1000_MPHY_ADDR_CTRL, + E1000_MPHY_DIS_ACCESS); + return E1000_SUCCESS; } Modified: releng/11.0/sys/dev/e1000/if_em.c ============================================================================== --- releng/11.0/sys/dev/e1000/if_em.c Fri Aug 19 18:45:42 2016 (r304492) +++ releng/11.0/sys/dev/e1000/if_em.c Fri Aug 19 19:02:18 2016 (r304493) @@ -193,6 +193,12 @@ static em_vendor_info_t em_vendor_info_a { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V2, PCI_ANY_ID, PCI_ANY_ID, 0}, { 0x8086, E1000_DEV_ID_PCH_LBG_I219_LM3, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_LM4, + PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V4, PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_LM5, + PCI_ANY_ID, PCI_ANY_ID, 0}, + { 0x8086, E1000_DEV_ID_PCH_SPT_I219_V5, PCI_ANY_ID, PCI_ANY_ID, 0}, /* required last entry */ { 0, 0, 0, 0, 0} }; From owner-svn-src-all@freebsd.org Fri Aug 19 19:16:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2ECBCBC0F7C; Fri, 19 Aug 2016 19:16:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 014E818B1; Fri, 19 Aug 2016 19:16:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JJGBEL060768; Fri, 19 Aug 2016 19:16:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JJGB3E060766; Fri, 19 Aug 2016 19:16:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608191916.u7JJGB3E060766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Aug 2016 19:16:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304494 - releng/11.0 X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 19:16:12 -0000 Author: bdrewery Date: Fri Aug 19 19:16:10 2016 New Revision: 304494 URL: https://svnweb.freebsd.org/changeset/base/304494 Log: MFS r304472: MFC r304006: Avoid showing the bootstrap make command for check-old, etc. Approved by: re (gjb) Modified: releng/11.0/Makefile releng/11.0/Makefile.inc1 Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/Makefile ============================================================================== --- releng/11.0/Makefile Fri Aug 19 19:02:18 2016 (r304493) +++ releng/11.0/Makefile Fri Aug 19 19:16:10 2016 (r304494) @@ -209,7 +209,8 @@ SUB_MAKE= `test -x ${MYMAKE} && echo ${M SUB_MAKE= ${MAKE} -m ${.CURDIR}/share/mk .endif -_MAKE= PATH=${PATH} ${SUB_MAKE} -f Makefile.inc1 TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} +_MAKE= PATH=${PATH} MAKE_CMD=${MAKE} ${SUB_MAKE} -f Makefile.inc1 \ + TARGET=${_TARGET} TARGET_ARCH=${_TARGET_ARCH} # Only allow meta mode for the whitelisted targets. See META_TGT_WHITELIST # above. Modified: releng/11.0/Makefile.inc1 ============================================================================== --- releng/11.0/Makefile.inc1 Fri Aug 19 19:02:18 2016 (r304493) +++ releng/11.0/Makefile.inc1 Fri Aug 19 19:16:10 2016 (r304494) @@ -2372,11 +2372,11 @@ check-old-dirs: .PHONY done delete-old: delete-old-files delete-old-dirs .PHONY - @echo "To remove old libraries run '${MAKE} delete-old-libs'." + @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'." check-old: check-old-files check-old-libs check-old-dirs .PHONY - @echo "To remove old files and directories run '${MAKE} delete-old'." - @echo "To remove old libraries run '${MAKE} delete-old-libs'." + @echo "To remove old files and directories run '${MAKE_CMD} delete-old'." + @echo "To remove old libraries run '${MAKE_CMD} delete-old-libs'." .endif From owner-svn-src-all@freebsd.org Fri Aug 19 19:19:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F553BC0FF9; Fri, 19 Aug 2016 19:19:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F38E1AA6; Fri, 19 Aug 2016 19:19:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JJJH8H060910; Fri, 19 Aug 2016 19:19:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JJJHs6060909; Fri, 19 Aug 2016 19:19:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608191919.u7JJJHs6060909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Aug 2016 19:19:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304495 - releng/11.0/sys/dev/filemon X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 19:19:18 -0000 Author: bdrewery Date: Fri Aug 19 19:19:17 2016 New Revision: 304495 URL: https://svnweb.freebsd.org/changeset/base/304495 Log: MFS r304474: MFC r304008: Avoid taking PROC_LOCK in syscalls if not being traced. Approved by: re (XXX) Modified: releng/11.0/sys/dev/filemon/filemon.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/sys/dev/filemon/filemon.c ============================================================================== --- releng/11.0/sys/dev/filemon/filemon.c Fri Aug 19 19:16:10 2016 (r304494) +++ releng/11.0/sys/dev/filemon/filemon.c Fri Aug 19 19:19:17 2016 (r304495) @@ -137,6 +137,8 @@ filemon_proc_get(struct proc *p) { struct filemon *filemon; + if (p->p_filemon == NULL) + return (NULL); PROC_LOCK(p); filemon = filemon_acquire(p->p_filemon); PROC_UNLOCK(p); From owner-svn-src-all@freebsd.org Fri Aug 19 19:21:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C370CBBF0E6; Fri, 19 Aug 2016 19:21:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A25F01CF7; Fri, 19 Aug 2016 19:21:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 983C0134E; Fri, 19 Aug 2016 19:21:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 5344A2108A; Fri, 19 Aug 2016 19:21:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id XUFOEirdjEwE; Fri, 19 Aug 2016 19:21:00 +0000 (UTC) Subject: Re: svn commit: r304495 - releng/11.0/sys/dev/filemon DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 7A12221085 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org References: <201608191919.u7JJJHs6060909@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: Date: Fri, 19 Aug 2016 12:20:59 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608191919.u7JJJHs6060909@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="RQRpIeaVuXMDG2Pc2714O8GkTTUEr29Wl" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 19:21:03 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --RQRpIeaVuXMDG2Pc2714O8GkTTUEr29Wl Content-Type: multipart/mixed; boundary="CM64hcCWfGbg3PC0klX7bdi5MPORCAWLH" From: Bryan Drewery To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Message-ID: Subject: Re: svn commit: r304495 - releng/11.0/sys/dev/filemon References: <201608191919.u7JJJHs6060909@repo.freebsd.org> In-Reply-To: <201608191919.u7JJJHs6060909@repo.freebsd.org> --CM64hcCWfGbg3PC0klX7bdi5MPORCAWLH Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/19/16 12:19 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Fri Aug 19 19:19:17 2016 > New Revision: 304495 > URL: https://svnweb.freebsd.org/changeset/base/304495 >=20 > Log: > MFS r304474: > =20 > MFC r304008: > =20 > Avoid taking PROC_LOCK in syscalls if not being traced. > =20 > Approved by: re (XXX) Woops, Approved by gjb. --=20 Regards, Bryan Drewery --CM64hcCWfGbg3PC0klX7bdi5MPORCAWLH-- --RQRpIeaVuXMDG2Pc2714O8GkTTUEr29Wl Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXt1wbAAoJEDXXcbtuRpfPII8H/j6s98RF4ved0665jM0V9ezh KUXs4Q+z5BIfX9l/Sr4+zlS+ovamyqDH6Vd42sFdUWylwGv1WcIoJ1HH5iQBn6QI GBc2Fhc4NHarwRZkY9GfnszcOv/Ew/ylytmol2TNCA/XkwZ4MedQN0c5iMp8nXaH /JcYwg8FmIvuLO3kHhJYAiqE95v4yI7vdB8Z0LCmo1/bcF3fGhHAu1UDSQPP/dqv CWZt3vGxGikc64eYYXdmUKOwSBlOQXEZvJmHi8RWS+98KiA/bpuTaxPpGpfxqq9E XQ6rO4X2V9RRdFN76dNwS1C6glNCuQox6nZjfL7H75Emheu7wBLPYXxg5660baY= =kkUr -----END PGP SIGNATURE----- --RQRpIeaVuXMDG2Pc2714O8GkTTUEr29Wl-- From owner-svn-src-all@freebsd.org Fri Aug 19 19:26:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01139BBF395; Fri, 19 Aug 2016 19:26:21 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C243A125F; Fri, 19 Aug 2016 19:26:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JJQKvi064509; Fri, 19 Aug 2016 19:26:20 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JJQGCh064467; Fri, 19 Aug 2016 19:26:16 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608191926.u7JJQGCh064467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 19 Aug 2016 19:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304496 - stable/11/share/timedef X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 19:26:21 -0000 Author: bapt Date: Fri Aug 19 19:26:16 2016 New Revision: 304496 URL: https://svnweb.freebsd.org/changeset/base/304496 Log: MFC r303354,303373,303404,304045,304192 Set date and time formats back to what they were before CLDR While CLDR brings us a good and up to date source data to generate locales for all databses we are using for locales, it is not the case of LC_TIME. Where it does not defines the informations we need. Put back all the date and time formats from the old locales. Make it statically for now (in order to be able to merge it now into 11.0-RELEASE). The generation tools will be updated soon. That gives us time to properly work on LC_TIME during the 12 timeframe. While here fix abbreviated month for af_ZA (which are already fixed in CLDR data upstream) In locales where AP/PM was not defined before CLDR data, remove again the AP/PM informations For locales where AP/PM was defined before CLDR data, keep the CLDR information which was properly translated. r303354,303373 by kevlo r303404,304192 by jkim Modified: stable/11/share/timedef/af_ZA.UTF-8.src stable/11/share/timedef/am_ET.UTF-8.src stable/11/share/timedef/ar_JO.UTF-8.src stable/11/share/timedef/ar_MA.UTF-8.src stable/11/share/timedef/ar_SA.UTF-8.src stable/11/share/timedef/be_BY.CP1131.src stable/11/share/timedef/be_BY.CP1251.src stable/11/share/timedef/be_BY.ISO8859-5.src stable/11/share/timedef/be_BY.UTF-8.src stable/11/share/timedef/bg_BG.CP1251.src stable/11/share/timedef/bg_BG.UTF-8.src stable/11/share/timedef/ca_IT.ISO8859-15.src stable/11/share/timedef/ca_IT.UTF-8.src stable/11/share/timedef/cs_CZ.ISO8859-2.src stable/11/share/timedef/cs_CZ.UTF-8.src stable/11/share/timedef/da_DK.ISO8859-15.src stable/11/share/timedef/da_DK.UTF-8.src stable/11/share/timedef/de_AT.ISO8859-15.src stable/11/share/timedef/de_AT.UTF-8.src stable/11/share/timedef/de_DE.ISO8859-15.src stable/11/share/timedef/de_DE.UTF-8.src stable/11/share/timedef/el_GR.ISO8859-7.src stable/11/share/timedef/el_GR.UTF-8.src stable/11/share/timedef/en_CA.UTF-8.src stable/11/share/timedef/en_GB.UTF-8.src stable/11/share/timedef/en_IE.UTF-8.src stable/11/share/timedef/en_PH.UTF-8.src stable/11/share/timedef/en_SG.UTF-8.src stable/11/share/timedef/en_US.UTF-8.src stable/11/share/timedef/en_ZA.UTF-8.src stable/11/share/timedef/es_AR.ISO8859-1.src stable/11/share/timedef/es_CR.UTF-8.src stable/11/share/timedef/es_ES.ISO8859-15.src stable/11/share/timedef/es_ES.UTF-8.src stable/11/share/timedef/es_MX.ISO8859-1.src stable/11/share/timedef/es_MX.UTF-8.src stable/11/share/timedef/et_EE.ISO8859-15.src stable/11/share/timedef/eu_ES.UTF-8.src stable/11/share/timedef/fi_FI.ISO8859-15.src stable/11/share/timedef/fi_FI.UTF-8.src stable/11/share/timedef/fr_BE.ISO8859-15.src stable/11/share/timedef/fr_BE.UTF-8.src stable/11/share/timedef/fr_CA.ISO8859-15.src stable/11/share/timedef/fr_CA.UTF-8.src stable/11/share/timedef/fr_CH.ISO8859-15.src stable/11/share/timedef/fr_CH.UTF-8.src stable/11/share/timedef/fr_FR.ISO8859-15.src stable/11/share/timedef/fr_FR.UTF-8.src stable/11/share/timedef/he_IL.UTF-8.src stable/11/share/timedef/hi_IN.ISCII-DEV.src stable/11/share/timedef/hi_IN.UTF-8.src stable/11/share/timedef/hr_HR.ISO8859-2.src stable/11/share/timedef/hr_HR.UTF-8.src stable/11/share/timedef/hu_HU.ISO8859-2.src stable/11/share/timedef/hu_HU.UTF-8.src stable/11/share/timedef/hy_AM.ARMSCII-8.src stable/11/share/timedef/hy_AM.UTF-8.src stable/11/share/timedef/is_IS.ISO8859-15.src stable/11/share/timedef/is_IS.UTF-8.src stable/11/share/timedef/it_CH.ISO8859-15.src stable/11/share/timedef/it_CH.UTF-8.src stable/11/share/timedef/it_IT.ISO8859-15.src stable/11/share/timedef/it_IT.UTF-8.src stable/11/share/timedef/ja_JP.SJIS.src stable/11/share/timedef/ja_JP.UTF-8.src stable/11/share/timedef/ja_JP.eucJP.src stable/11/share/timedef/kk_KZ.UTF-8.src stable/11/share/timedef/ko_KR.UTF-8.src stable/11/share/timedef/ko_KR.eucKR.src (contents, props changed) stable/11/share/timedef/lt_LT.ISO8859-13.src stable/11/share/timedef/lt_LT.UTF-8.src stable/11/share/timedef/lv_LV.ISO8859-13.src stable/11/share/timedef/lv_LV.UTF-8.src stable/11/share/timedef/mn_MN.UTF-8.src stable/11/share/timedef/nb_NO.ISO8859-15.src stable/11/share/timedef/nb_NO.UTF-8.src stable/11/share/timedef/nl_BE.UTF-8.src stable/11/share/timedef/nl_NL.UTF-8.src stable/11/share/timedef/nn_NO.ISO8859-15.src stable/11/share/timedef/nn_NO.UTF-8.src stable/11/share/timedef/pl_PL.ISO8859-2.src stable/11/share/timedef/pl_PL.UTF-8.src stable/11/share/timedef/pt_BR.ISO8859-1.src stable/11/share/timedef/pt_BR.UTF-8.src stable/11/share/timedef/pt_PT.ISO8859-15.src stable/11/share/timedef/pt_PT.UTF-8.src stable/11/share/timedef/ro_RO.ISO8859-2.src stable/11/share/timedef/ro_RO.UTF-8.src stable/11/share/timedef/ru_RU.CP1251.src stable/11/share/timedef/ru_RU.CP866.src stable/11/share/timedef/ru_RU.ISO8859-5.src stable/11/share/timedef/ru_RU.KOI8-R.src stable/11/share/timedef/ru_RU.UTF-8.src stable/11/share/timedef/se_FI.UTF-8.src stable/11/share/timedef/se_NO.UTF-8.src stable/11/share/timedef/sk_SK.ISO8859-2.src stable/11/share/timedef/sk_SK.UTF-8.src stable/11/share/timedef/sl_SI.ISO8859-2.src stable/11/share/timedef/sl_SI.UTF-8.src stable/11/share/timedef/sr_RS.ISO8859-2.src stable/11/share/timedef/sr_RS.ISO8859-5.src stable/11/share/timedef/sr_RS.UTF-8.src stable/11/share/timedef/sr_RS.UTF-8@latin.src stable/11/share/timedef/sv_FI.ISO8859-15.src stable/11/share/timedef/sv_SE.ISO8859-15.src stable/11/share/timedef/sv_SE.UTF-8.src stable/11/share/timedef/tr_TR.ISO8859-9.src stable/11/share/timedef/tr_TR.UTF-8.src stable/11/share/timedef/uk_UA.CP1251.src stable/11/share/timedef/uk_UA.ISO8859-5.src stable/11/share/timedef/uk_UA.KOI8-U.src stable/11/share/timedef/uk_UA.UTF-8.src stable/11/share/timedef/zh_CN.GB2312.src (contents, props changed) stable/11/share/timedef/zh_CN.GBK.src (contents, props changed) stable/11/share/timedef/zh_CN.UTF-8.src stable/11/share/timedef/zh_CN.eucCN.src (contents, props changed) stable/11/share/timedef/zh_HK.UTF-8.src (contents, props changed) stable/11/share/timedef/zh_TW.Big5.src (contents, props changed) stable/11/share/timedef/zh_TW.UTF-8.src (contents, props changed) Directory Properties: stable/11/ (props changed) Modified: stable/11/share/timedef/af_ZA.UTF-8.src ============================================================================== --- stable/11/share/timedef/af_ZA.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/af_ZA.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -7,15 +7,15 @@ Jan. Feb. Mrt. -Apr +Apr. Mei -Jun -Jul -Aug -Sep -Okt -Nov -Des +Jun. +Jul. +Aug. +Sep. +Okt. +Nov. +Des. # # Long month names (as in a date) Januarie @@ -50,20 +50,20 @@ Vrydag Saterdag # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%Y-%m-%d +%m/%d/%Y # # c_fmt -%d %B %Y %I:%M:%S %p +%a %b %e %X %Y # # AM/PM vm. nm. # # date_fmt -%d %B %Y %I:%M:%S %p %Z +%a %b %e %X %Z %Y # # Long month names (without case ending) Januarie Modified: stable/11/share/timedef/am_ET.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/11/share/timedef/ar_JO.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/11/share/timedef/ar_MA.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/11/share/timedef/ar_SA.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/11/share/timedef/be_BY.CP1131.src ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/11/share/timedef/be_BY.CP1251.src ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/11/share/timedef/be_BY.ISO8859-5.src ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/11/share/timedef/be_BY.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/11/share/timedef/bg_BG.CP1251.src ============================================================================== --- stable/11/share/timedef/bg_BG.CP1251.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/bg_BG.CP1251.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ %H:%M:%S # # x_fmt -%d.%m.%y г. +%d.%m.%y # # c_fmt -%A %e %B %Y ã. %H:%M:%S +%a %e %b %X %Y # # AM/PM ïð.îá. ñë.îá. # # date_fmt -%A %e %B %Y ã. %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) ÿíóàðè Modified: stable/11/share/timedef/bg_BG.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/11/share/timedef/ca_IT.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/ca_IT.ISO8859-15.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/ca_IT.ISO8859-15.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ dissabte %H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%A %e %B de %Y, %H:%M:%S +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%A %e %B de %Y, %H:%M:%S %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) de gener Modified: stable/11/share/timedef/ca_IT.UTF-8.src ============================================================================== --- stable/11/share/timedef/ca_IT.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/ca_IT.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ dissabte %H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%A %e %B de %Y, %H:%M:%S +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%A %e %B de %Y, %H:%M:%S %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) de gener Modified: stable/11/share/timedef/cs_CZ.ISO8859-2.src ============================================================================== --- stable/11/share/timedef/cs_CZ.ISO8859-2.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/cs_CZ.ISO8859-2.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ sobota %H:%M:%S # # x_fmt -%d.%m.%y +%Y/%m/%d # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM dopoledne odpoledne # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e. %B %Y %X %Z # # Long month names (without case ending) leden Modified: stable/11/share/timedef/cs_CZ.UTF-8.src ============================================================================== --- stable/11/share/timedef/cs_CZ.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/cs_CZ.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ sobota %H:%M:%S # # x_fmt -%d.%m.%y +%Y/%m/%d # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM dopoledne odpoledne # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e. %B %Y %X %Z # # Long month names (without case ending) leden Modified: stable/11/share/timedef/da_DK.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/da_DK.ISO8859-15.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/da_DK.ISO8859-15.src Fri Aug 19 19:26:16 2016 (r304496) @@ -50,20 +50,20 @@ fredag lørdag # # X_fmt -%H.%M.%S +%H:%M:%S # # x_fmt -%d/%m/%Y +%d.%m.%Y # # c_fmt -%A %e %B %Y kl. %H.%M.%S +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%A %e %B %Y kl. %H.%M.%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) januar Modified: stable/11/share/timedef/da_DK.UTF-8.src ============================================================================== --- stable/11/share/timedef/da_DK.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/da_DK.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -50,20 +50,20 @@ fredag lørdag # # X_fmt -%H.%M.%S +%H:%M:%S # # x_fmt -%d/%m/%Y +%d.%m.%Y # # c_fmt -%A %e %B %Y kl. %H.%M.%S +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%A %e %B %Y kl. %H.%M.%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) januar Modified: stable/11/share/timedef/de_AT.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/de_AT.ISO8859-15.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/de_AT.ISO8859-15.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ Samstag %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y um %H:%M:%S +%a %e %b %X %Y # # AM/PM vorm. nachm. # # date_fmt -%A %e %B %Y um %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) Jänner Modified: stable/11/share/timedef/de_AT.UTF-8.src ============================================================================== --- stable/11/share/timedef/de_AT.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/de_AT.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ Samstag %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y um %H:%M:%S +%a %e %b %X %Y # # AM/PM vorm. nachm. # # date_fmt -%A %e %B %Y um %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) Jänner Modified: stable/11/share/timedef/de_DE.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/de_DE.ISO8859-15.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/de_DE.ISO8859-15.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ Samstag %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y um %H:%M:%S +%a %e %b %X %Y # # AM/PM vorm. nachm. # # date_fmt -%A %e %B %Y um %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) Januar Modified: stable/11/share/timedef/de_DE.UTF-8.src ============================================================================== --- stable/11/share/timedef/de_DE.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/de_DE.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ Samstag %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y um %H:%M:%S +%a %e %b %X %Y # # AM/PM vorm. nachm. # # date_fmt -%A %e %B %Y um %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) Januar Modified: stable/11/share/timedef/el_GR.ISO8859-7.src ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/11/share/timedef/el_GR.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: stable/11/share/timedef/en_CA.UTF-8.src ============================================================================== --- stable/11/share/timedef/en_CA.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/en_CA.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%Y-%m-%d +%d/%m/%Y # # c_fmt -%A, %B %e, %Y at %I:%M:%S %p +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%A, %B %e, %Y at %I:%M:%S %p %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: stable/11/share/timedef/en_GB.UTF-8.src ============================================================================== --- stable/11/share/timedef/en_GB.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/en_GB.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -56,14 +56,14 @@ Saturday %d/%m/%Y # # c_fmt -%A %e %B %Y at %H:%M:%S +%a %e %b %X %Y # # AM/PM a.m. p.m. # # date_fmt -%A %e %B %Y at %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: stable/11/share/timedef/en_IE.UTF-8.src ============================================================================== --- stable/11/share/timedef/en_IE.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/en_IE.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt %d/%m/%Y # # c_fmt -%A %e %B %Y at %I:%M:%S %p +%a %e %b %X %Y # # AM/PM a.m. p.m. # # date_fmt -%A %e %B %Y at %I:%M:%S %p %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: stable/11/share/timedef/en_PH.UTF-8.src ============================================================================== --- stable/11/share/timedef/en_PH.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/en_PH.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt %d/%m/%Y # # c_fmt -%A %e %B %Y at %I:%M:%S %p +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%A %e %B %Y at %I:%M:%S %p %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: stable/11/share/timedef/en_SG.UTF-8.src ============================================================================== --- stable/11/share/timedef/en_SG.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/en_SG.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%A %e %B %Y at %I:%M:%S %p +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%A %e %B %Y at %I:%M:%S %p %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: stable/11/share/timedef/en_US.UTF-8.src ============================================================================== --- stable/11/share/timedef/en_US.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/en_US.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%m/%d/%y +%m/%d/%Y # # c_fmt -%A, %B %e, %Y at %I:%M:%S %p +%a %b %e %X %Y # # AM/PM AM PM # # date_fmt -%A, %B %e, %Y at %I:%M:%S %p %Z +%a %b %e %X %Z %Y # # Long month names (without case ending) January Modified: stable/11/share/timedef/en_ZA.UTF-8.src ============================================================================== --- stable/11/share/timedef/en_ZA.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/en_ZA.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%Y/%m/%d +%d/%m/%Y # # c_fmt -%d %B %Y at %I:%M:%S %p +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%d %B %Y at %I:%M:%S %p %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: stable/11/share/timedef/es_AR.ISO8859-1.src ============================================================================== --- stable/11/share/timedef/es_AR.ISO8859-1.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/es_AR.ISO8859-1.src Fri Aug 19 19:26:16 2016 (r304496) @@ -50,20 +50,20 @@ viernes sábado # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %I:%M:%S %p +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%e de %B de %Y, %I:%M:%S %p %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: stable/11/share/timedef/es_CR.UTF-8.src ============================================================================== --- stable/11/share/timedef/es_CR.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/es_CR.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -50,20 +50,20 @@ viernes sábado # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %I:%M:%S %p +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%e de %B de %Y, %I:%M:%S %p %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: stable/11/share/timedef/es_ES.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/es_ES.ISO8859-15.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/es_ES.ISO8859-15.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ sábado %H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %H:%M:%S +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%e de %B de %Y, %H:%M:%S %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: stable/11/share/timedef/es_ES.UTF-8.src ============================================================================== --- stable/11/share/timedef/es_ES.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/es_ES.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ sábado %H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %H:%M:%S +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%e de %B de %Y, %H:%M:%S %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: stable/11/share/timedef/es_MX.ISO8859-1.src ============================================================================== --- stable/11/share/timedef/es_MX.ISO8859-1.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/es_MX.ISO8859-1.src Fri Aug 19 19:26:16 2016 (r304496) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names -ene -feb -mar -abr -may -jun -jul -ago -sep -oct -nov -dic +ene. +feb. +mar. +abr. +may. +jun. +jul. +ago. +sep. +oct. +nov. +dic. # # Long month names (as in a date) enero @@ -50,20 +50,20 @@ viernes sábado # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %I:%M:%S %p +%a %e %b %X %Y # # AM/PM a.m. p.m. # # date_fmt -%e de %B de %Y, %I:%M:%S %p %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: stable/11/share/timedef/es_MX.UTF-8.src ============================================================================== --- stable/11/share/timedef/es_MX.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/es_MX.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -50,20 +50,20 @@ viernes sábado # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %I:%M:%S %p +%a %e %b %X %Y # # AM/PM a.m. p.m. # # date_fmt -%e de %B de %Y, %I:%M:%S %p %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: stable/11/share/timedef/et_EE.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/et_EE.ISO8859-15.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/et_EE.ISO8859-15.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ laupäev %H:%M.%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M.%S +%a %d %b %Y %X # # AM/PM AM PM # # date_fmt -%A %e %B %Y %H:%M.%S %Z +%a %d %b %Y %X %Z # # Long month names (without case ending) jaanuar Modified: stable/11/share/timedef/eu_ES.UTF-8.src ============================================================================== --- stable/11/share/timedef/eu_ES.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/eu_ES.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -56,14 +56,14 @@ larunbata %Y/%m/%d # # c_fmt -%Y(e)ko %B %e %H:%M:%S (%Z) +%Y - %b - %e %a %X # # AM/PM AM PM # # date_fmt -%Y(e)ko %B %e %H:%M:%S (%Z) +%Y(e)ko %B-ren %ea, %X %Z # # Long month names (without case ending) urtarrilak Modified: stable/11/share/timedef/fi_FI.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/fi_FI.ISO8859-15.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/fi_FI.ISO8859-15.src Fri Aug 19 19:26:16 2016 (r304496) @@ -50,20 +50,20 @@ perjantaina lauantaina # # X_fmt -%H.%M.%S +%H:%M:%S # # x_fmt %d.%m.%Y # # c_fmt -%A %e %B %Y klo %H.%M.%S +%a %e %b %X %Y # # AM/PM ap. ip. # # date_fmt -%A %e %B %Y klo %H.%M.%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) tammikuuta Modified: stable/11/share/timedef/fi_FI.UTF-8.src ============================================================================== --- stable/11/share/timedef/fi_FI.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/fi_FI.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -50,20 +50,20 @@ perjantaina lauantaina # # X_fmt -%H.%M.%S +%H:%M:%S # # x_fmt %d.%m.%Y # # c_fmt -%A %e %B %Y klo %H.%M.%S +%a %e %b %X %Y # # AM/PM ap. ip. # # date_fmt -%A %e %B %Y klo %H.%M.%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) tammikuuta Modified: stable/11/share/timedef/fr_BE.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/fr_BE.ISO8859-15.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/fr_BE.ISO8859-15.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%d/%m/%y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: stable/11/share/timedef/fr_BE.UTF-8.src ============================================================================== --- stable/11/share/timedef/fr_BE.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/fr_BE.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%d/%m/%y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: stable/11/share/timedef/fr_CA.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/fr_CA.ISO8859-15.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/fr_CA.ISO8859-15.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%y-%m-%d +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre md # # ampm_fmt -%I:%M:%S %p + # EOF Modified: stable/11/share/timedef/fr_CA.UTF-8.src ============================================================================== --- stable/11/share/timedef/fr_CA.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/fr_CA.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%y-%m-%d +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre md # # ampm_fmt -%I:%M:%S %p + # EOF Modified: stable/11/share/timedef/fr_CH.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/fr_CH.ISO8859-15.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/fr_CH.ISO8859-15.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: stable/11/share/timedef/fr_CH.UTF-8.src ============================================================================== --- stable/11/share/timedef/fr_CH.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/fr_CH.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: stable/11/share/timedef/fr_FR.ISO8859-15.src ============================================================================== --- stable/11/share/timedef/fr_FR.ISO8859-15.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/fr_FR.ISO8859-15.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%d/%m/%Y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: stable/11/share/timedef/fr_FR.UTF-8.src ============================================================================== --- stable/11/share/timedef/fr_FR.UTF-8.src Fri Aug 19 19:19:17 2016 (r304495) +++ stable/11/share/timedef/fr_FR.UTF-8.src Fri Aug 19 19:26:16 2016 (r304496) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Aug 19 19:30:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 309B2BBF56B; Fri, 19 Aug 2016 19:30:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0347A1594; Fri, 19 Aug 2016 19:30:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JJU0T6064905; Fri, 19 Aug 2016 19:30:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JJU0JX064904; Fri, 19 Aug 2016 19:30:00 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608191930.u7JJU0JX064904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 19 Aug 2016 19:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304497 - releng/11.0 X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 19:30:01 -0000 Author: bdrewery Date: Fri Aug 19 19:30:00 2016 New Revision: 304497 URL: https://svnweb.freebsd.org/changeset/base/304497 Log: MFS r304475: MFC r304217: Trim unneeded bootstrap after r301470 made 9.1 the minimum supported release. Approved by: re (gjb) Modified: releng/11.0/Makefile.inc1 Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/Makefile.inc1 ============================================================================== --- releng/11.0/Makefile.inc1 Fri Aug 19 19:26:16 2016 (r304496) +++ releng/11.0/Makefile.inc1 Fri Aug 19 19:30:00 2016 (r304497) @@ -1579,10 +1579,6 @@ _groff= gnu/usr.bin/groff \ _vtfontcvt= usr.bin/vtfontcvt .endif -.if ${BOOTSTRAPPING} < 900002 -_sed= usr.bin/sed -.endif - .if ${BOOTSTRAPPING} < 1000033 _libopenbsd= lib/libopenbsd _m4= usr.bin/m4 @@ -1621,10 +1617,6 @@ _crunchide= usr.sbin/crunch/crunchide _crunchgen= usr.sbin/crunch/crunchgen .endif -.if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 -_awk= usr.bin/awk -.endif - # r296926 -P keymap search path, MFC to stable/10 in r298297 .if ${BOOTSTRAPPING} < 1003501 || \ (${BOOTSTRAPPING} >= 1100000 && ${BOOTSTRAPPING} < 1100103) @@ -1692,7 +1684,6 @@ bootstrap-tools: .PHONY ${_gperf} \ ${_groff} \ ${_dtc} \ - ${_awk} \ ${_cat} \ ${_dd} \ ${_kbdcontrol} \ @@ -1700,7 +1691,6 @@ bootstrap-tools: .PHONY ${_libopenbsd} \ ${_makewhatis} \ usr.bin/rpcgen \ - ${_sed} \ ${_yacc} \ ${_m4} \ ${_lex} \ From owner-svn-src-all@freebsd.org Fri Aug 19 19:31:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2FD5BBF70D; Fri, 19 Aug 2016 19:31:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FD7918CF; Fri, 19 Aug 2016 19:31:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JJVt0O067198; Fri, 19 Aug 2016 19:31:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JJVth8067193; Fri, 19 Aug 2016 19:31:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608191931.u7JJVth8067193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 19:31:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304498 - in head: . share/man/man4 sys/conf sys/dev/scd sys/modules sys/modules/scd 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 19:31:56 -0000 Author: jhb Date: Fri Aug 19 19:31:55 2016 New Revision: 304498 URL: https://svnweb.freebsd.org/changeset/base/304498 Log: Remove the scd(4) driver for Sony CDU31/33 CD-ROM drives. This is a driver for a pre-ATAPI ISA CD-ROM adapter. The driver only uses PIO. Deleted: head/share/man/man4/scd.4 head/sys/dev/scd/ head/sys/modules/scd/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Aug 19 19:30:00 2016 (r304497) +++ head/ObsoleteFiles.inc Fri Aug 19 19:31:55 2016 (r304498) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160819: Remove scd(4) +OLD_FILES+=usr/share/man/man4/scd.4.gz # 20160815: Remove mcd(4) OLD_FILES+=usr/share/man/man4/mcd.4.gz # 20160703: POSIXify locales with variants Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Aug 19 19:30:00 2016 (r304497) +++ head/share/man/man4/Makefile Fri Aug 19 19:31:55 2016 (r304498) @@ -441,7 +441,6 @@ MAN= aac.4 \ sbp.4 \ sbp_targ.4 \ scc.4 \ - scd.4 \ sched_4bsd.4 \ sched_ule.4 \ screen.4 \ Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Aug 19 19:30:00 2016 (r304497) +++ head/sys/conf/NOTES Fri Aug 19 19:31:55 2016 (r304498) @@ -2411,15 +2411,10 @@ options SND_OLDSTEREO # # Miscellaneous hardware: # -# scd: Sony CD-ROM using proprietary (non-ATAPI) interface # bktr: Brooktree bt848/848a/849a/878/879 video capture and TV Tuner board # joy: joystick (including IO DATA PCJOY PC Card joystick) # cmx: OmniKey CardMan 4040 pccard smartcard reader -# for the Sony CDU31/33A CDROM -device scd -hint.scd.0.at="isa" -hint.scd.0.port="0x230" device joy # PnP aware, hints for non-PnP only hint.joy.0.at="isa" hint.joy.0.port="0x201" Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 19 19:30:00 2016 (r304497) +++ head/sys/conf/files Fri Aug 19 19:31:55 2016 (r304498) @@ -2506,8 +2506,6 @@ dev/scc/scc_core.c optional scc dev/scc/scc_dev_quicc.c optional scc quicc dev/scc/scc_dev_sab82532.c optional scc dev/scc/scc_dev_z8530.c optional scc -dev/scd/scd.c optional scd isa -dev/scd/scd_isa.c optional scd isa dev/sdhci/sdhci.c optional sdhci dev/sdhci/sdhci_if.m optional sdhci dev/sdhci/sdhci_pci.c optional sdhci pci Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Aug 19 19:30:00 2016 (r304497) +++ head/sys/modules/Makefile Fri Aug 19 19:31:55 2016 (r304498) @@ -322,7 +322,6 @@ SUBDIR= \ ${_safe} \ ${_sbni} \ scc \ - scd \ ${_scsi_low} \ sdhci \ sdhci_pci \ From owner-svn-src-all@freebsd.org Fri Aug 19 20:17:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE346BBE5ED; Fri, 19 Aug 2016 20:17:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A24A1263; Fri, 19 Aug 2016 20:17:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JKHwEH083427; Fri, 19 Aug 2016 20:17:58 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JKHw4g083420; Fri, 19 Aug 2016 20:17:58 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192017.u7JKHw4g083420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 20:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304499 - in stable: 10/lib/libc/sys 10/sys/kern 10/sys/sys 10/tests/sys/kern 11/lib/libc/sys 11/sys/kern 11/sys/sys 11/tests/sys/kern X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 20:17:59 -0000 Author: jhb Date: Fri Aug 19 20:17:57 2016 New Revision: 304499 URL: https://svnweb.freebsd.org/changeset/base/304499 Log: MFC 303001: Add PTRACE_VFORK to trace vfork events. First, PL_FLAG_FORKED events now also set a PL_FLAG_VFORKED flag when the new child was created via vfork() rather than fork(). Second, a new PL_FLAG_VFORK_DONE event can now be enabled via the PTRACE_VFORK event mask. This new stop is reported after the vfork parent resumes due to the child calling exit or exec. Debuggers can use this stop to reinsert breakpoints in the vfork parent process before it resumes. Modified: stable/10/lib/libc/sys/ptrace.2 stable/10/sys/kern/kern_fork.c stable/10/sys/kern/subr_syscall.c stable/10/sys/kern/sys_process.c stable/10/sys/sys/proc.h stable/10/sys/sys/ptrace.h stable/10/tests/sys/kern/ptrace_test.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libc/sys/ptrace.2 stable/11/sys/kern/kern_fork.c stable/11/sys/kern/subr_syscall.c stable/11/sys/kern/sys_process.c stable/11/sys/sys/proc.h stable/11/sys/sys/ptrace.h stable/11/tests/sys/kern/ptrace_test.c Directory Properties: stable/11/ (props changed) Modified: stable/10/lib/libc/sys/ptrace.2 ============================================================================== --- stable/10/lib/libc/sys/ptrace.2 Fri Aug 19 19:31:55 2016 (r304498) +++ stable/10/lib/libc/sys/ptrace.2 Fri Aug 19 20:17:57 2016 (r304499) @@ -151,6 +151,11 @@ The process ID of the new child process .Va pl_child_pid member of .Vt "struct ptrace_lwpinfo" . +If the new child process was created via +.Xr vfork 2 , +the traced process's stop will also include the +.Dv PL_FLAG_VFORKED +flag. Note that new child processes will be attached with the default tracing event mask; they do not inherit the event mask of the traced process. @@ -173,6 +178,33 @@ Note that new processes do not report an initial thread, and exiting processes do not report an event for the termination of the last thread. +.It Dv PTRACE_VFORK +Report a stop event when a parent process resumes after a +.Xr vfork 2 . +.Pp +When a thread in the traced process creates a new child process via +.Xr vfork 2 , +the stop that reports +.Dv PL_FLAG_FORKED +and +.Dv PL_FLAG_SCX +occurs just after the child process is created, +but before the thread waits for the child process to stop sharing process +memory. +If a debugger is not tracing the new child process, +it must ensure that no breakpoints are enabled in the shared process +memory before detaching from the new child process. +This means that no breakpoints are enabled in the parent process either. +.Pp +The +.Dv PTRACE_VFORK +flag enables a new stop that indicates when the new child process stops +sharing the process memory of the parent process. +A debugger can reinsert breakpoints in the parent process and resume it +in response to this event. +This event is indicated by setting the +.Dv PL_FLAG_VFORK_DONE +flag. .El .Pp The default tracing event mask when attaching to a process via @@ -501,6 +533,16 @@ is enabled. Note that this event is not reported when the last LWP in a process exits. The termination of the last thread is reported via a normal process exit event. +.It PL_FLAG_VFORKED +Indicates that the thread is returning from a call to +.Xr vfork 2 +that created a new child process. +This flag is set in addition to +.Dv PL_FLAG_FORKED . +.It PL_FLAG_VFORK_DONE +Indicates that the thread has resumed after a child process created via +.Xr vfork 2 +has stopped sharing its address space with the traced process. .El .It pl_sigmask The current signal mask of the LWP Modified: stable/10/sys/kern/kern_fork.c ============================================================================== --- stable/10/sys/kern/kern_fork.c Fri Aug 19 19:31:55 2016 (r304498) +++ stable/10/sys/kern/kern_fork.c Fri Aug 19 20:17:57 2016 (r304499) @@ -728,6 +728,7 @@ do_fork(struct thread *td, int flags, st if (flags & RFPPWAIT) { td->td_pflags |= TDP_RFPPWAIT; td->td_rfppwait_p = p2; + td->td_dbgflags |= TDB_VFORK; } PROC_UNLOCK(p2); if ((flags & RFSTOPPED) == 0) { Modified: stable/10/sys/kern/subr_syscall.c ============================================================================== --- stable/10/sys/kern/subr_syscall.c Fri Aug 19 19:31:55 2016 (r304498) +++ stable/10/sys/kern/subr_syscall.c Fri Aug 19 20:17:57 2016 (r304499) @@ -249,5 +249,13 @@ again: cv_timedwait(&p2->p_pwait, &p2->p_mtx, hz); } PROC_UNLOCK(p2); + + if (td->td_dbgflags & TDB_VFORK) { + PROC_LOCK(p); + if (p->p_ptevents & PTRACE_VFORK) + ptracestop(td, SIGTRAP); + td->td_dbgflags &= ~TDB_VFORK; + PROC_UNLOCK(p); + } } } Modified: stable/10/sys/kern/sys_process.c ============================================================================== --- stable/10/sys/kern/sys_process.c Fri Aug 19 19:31:55 2016 (r304498) +++ stable/10/sys/kern/sys_process.c Fri Aug 19 20:17:57 2016 (r304499) @@ -957,7 +957,7 @@ kern_ptrace(struct thread *td, int req, } tmp = *(int *)addr; if ((tmp & ~(PTRACE_EXEC | PTRACE_SCE | PTRACE_SCX | - PTRACE_FORK | PTRACE_LWP)) != 0) { + PTRACE_FORK | PTRACE_LWP | PTRACE_VFORK)) != 0) { error = EINVAL; break; } @@ -1296,7 +1296,11 @@ kern_ptrace(struct thread *td, int req, if (td2->td_dbgflags & TDB_FORK) { pl->pl_flags |= PL_FLAG_FORKED; pl->pl_child_pid = td2->td_dbg_forked; - } + if (td2->td_dbgflags & TDB_VFORK) + pl->pl_flags |= PL_FLAG_VFORKED; + } else if ((td2->td_dbgflags & (TDB_SCX | TDB_VFORK)) == + TDB_VFORK) + pl->pl_flags |= PL_FLAG_VFORK_DONE; if (td2->td_dbgflags & TDB_CHILD) pl->pl_flags |= PL_FLAG_CHILD; if (td2->td_dbgflags & TDB_BORN) Modified: stable/10/sys/sys/proc.h ============================================================================== --- stable/10/sys/sys/proc.h Fri Aug 19 19:31:55 2016 (r304498) +++ stable/10/sys/sys/proc.h Fri Aug 19 20:17:57 2016 (r304499) @@ -398,6 +398,7 @@ do { \ #define TDB_CHILD 0x00000100 /* New child indicator for ptrace() */ #define TDB_BORN 0x00000200 /* New LWP indicator for ptrace() */ #define TDB_EXIT 0x00000400 /* Exiting LWP indicator for ptrace() */ +#define TDB_VFORK 0x00000800 /* vfork indicator for ptrace() */ #define TDB_FSTP 0x00001000 /* The thread is PT_ATTACH leader */ /* Modified: stable/10/sys/sys/ptrace.h ============================================================================== --- stable/10/sys/sys/ptrace.h Fri Aug 19 19:31:55 2016 (r304498) +++ stable/10/sys/sys/ptrace.h Fri Aug 19 20:17:57 2016 (r304499) @@ -89,6 +89,7 @@ #define PTRACE_SYSCALL (PTRACE_SCE | PTRACE_SCX) #define PTRACE_FORK 0x0008 #define PTRACE_LWP 0x0010 +#define PTRACE_VFORK 0x0020 #define PTRACE_DEFAULT (PTRACE_EXEC) @@ -124,6 +125,8 @@ struct ptrace_lwpinfo { #define PL_FLAG_CHILD 0x80 /* I am from child */ #define PL_FLAG_BORN 0x100 /* new LWP */ #define PL_FLAG_EXITED 0x200 /* exiting LWP */ +#define PL_FLAG_VFORKED 0x400 /* new child via vfork */ +#define PL_FLAG_VFORK_DONE 0x800 /* vfork parent has resumed */ sigset_t pl_sigmask; /* LWP signal mask */ sigset_t pl_siglist; /* LWP pending signal */ struct __siginfo pl_siginfo; /* siginfo for signal */ Modified: stable/10/tests/sys/kern/ptrace_test.c ============================================================================== --- stable/10/tests/sys/kern/ptrace_test.c Fri Aug 19 19:31:55 2016 (r304498) +++ stable/10/tests/sys/kern/ptrace_test.c Fri Aug 19 20:17:57 2016 (r304499) @@ -1463,6 +1463,130 @@ ATF_TC_BODY(ptrace__event_mask, tc) ATF_REQUIRE(errno == ECHILD); } +/* + * Verify that the expected ptrace events are reported for PTRACE_VFORK. + */ +ATF_TC_WITHOUT_HEAD(ptrace__ptrace_vfork); +ATF_TC_BODY(ptrace__ptrace_vfork, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + int events, status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + follow_fork_parent(true); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + events |= PTRACE_VFORK; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + + /* Continue the child ignoring the SIGSTOP. */ + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) != -1); + + /* The next event should report the end of the vfork. */ + wpid = wait(&status); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE((pl.pl_flags & PL_FLAG_VFORK_DONE) != 0); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) != -1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + +ATF_TC_WITHOUT_HEAD(ptrace__ptrace_vfork_follow); +ATF_TC_BODY(ptrace__ptrace_vfork_follow, tc) +{ + struct ptrace_lwpinfo pl[2]; + pid_t children[2], fpid, wpid; + int events, status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + follow_fork_parent(true); + } + + /* Parent process. */ + children[0] = fpid; + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(children[0], &status, 0); + ATF_REQUIRE(wpid == children[0]); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, children[0], (caddr_t)&events, + sizeof(events)) == 0); + events |= PTRACE_FORK | PTRACE_VFORK; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, children[0], (caddr_t)&events, + sizeof(events)) == 0); + + /* Continue the child ignoring the SIGSTOP. */ + ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1); + + /* Wait for both halves of the fork event to get reported. */ + children[1] = handle_fork_events(children[0], pl); + ATF_REQUIRE(children[1] > 0); + + ATF_REQUIRE((pl[0].pl_flags & PL_FLAG_VFORKED) != 0); + + ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1); + ATF_REQUIRE(ptrace(PT_CONTINUE, children[1], (caddr_t)1, 0) != -1); + + /* + * The child can't exit until the grandchild reports status, so the + * grandchild should report its exit first to the debugger. + */ + wpid = waitpid(children[1], &status, 0); + ATF_REQUIRE(wpid == children[1]); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 2); + + /* + * The child should report it's vfork() completion before it + * exits. + */ + wpid = wait(&status); + ATF_REQUIRE(wpid == children[0]); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl[0], sizeof(pl[0])) != + -1); + ATF_REQUIRE((pl[0].pl_flags & PL_FLAG_VFORK_DONE) != 0); + + ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == children[0]); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + ATF_TP_ADD_TCS(tp) { @@ -1487,6 +1611,8 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ptrace__ptrace_exec_disable); ATF_TP_ADD_TC(tp, ptrace__ptrace_exec_enable); ATF_TP_ADD_TC(tp, ptrace__event_mask); + ATF_TP_ADD_TC(tp, ptrace__ptrace_vfork); + ATF_TP_ADD_TC(tp, ptrace__ptrace_vfork_follow); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Fri Aug 19 20:18:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9EEB7BBE5F3; Fri, 19 Aug 2016 20:18:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A2341266; Fri, 19 Aug 2016 20:18:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JKHxNW083439; Fri, 19 Aug 2016 20:17:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JKHxqe083432; Fri, 19 Aug 2016 20:17:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192017.u7JKHxqe083432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 20:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304499 - in stable: 10/lib/libc/sys 10/sys/kern 10/sys/sys 10/tests/sys/kern 11/lib/libc/sys 11/sys/kern 11/sys/sys 11/tests/sys/kern X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 20:18:00 -0000 Author: jhb Date: Fri Aug 19 20:17:57 2016 New Revision: 304499 URL: https://svnweb.freebsd.org/changeset/base/304499 Log: MFC 303001: Add PTRACE_VFORK to trace vfork events. First, PL_FLAG_FORKED events now also set a PL_FLAG_VFORKED flag when the new child was created via vfork() rather than fork(). Second, a new PL_FLAG_VFORK_DONE event can now be enabled via the PTRACE_VFORK event mask. This new stop is reported after the vfork parent resumes due to the child calling exit or exec. Debuggers can use this stop to reinsert breakpoints in the vfork parent process before it resumes. Modified: stable/11/lib/libc/sys/ptrace.2 stable/11/sys/kern/kern_fork.c stable/11/sys/kern/subr_syscall.c stable/11/sys/kern/sys_process.c stable/11/sys/sys/proc.h stable/11/sys/sys/ptrace.h stable/11/tests/sys/kern/ptrace_test.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libc/sys/ptrace.2 stable/10/sys/kern/kern_fork.c stable/10/sys/kern/subr_syscall.c stable/10/sys/kern/sys_process.c stable/10/sys/sys/proc.h stable/10/sys/sys/ptrace.h stable/10/tests/sys/kern/ptrace_test.c Directory Properties: stable/10/ (props changed) Modified: stable/11/lib/libc/sys/ptrace.2 ============================================================================== --- stable/11/lib/libc/sys/ptrace.2 Fri Aug 19 19:31:55 2016 (r304498) +++ stable/11/lib/libc/sys/ptrace.2 Fri Aug 19 20:17:57 2016 (r304499) @@ -151,6 +151,11 @@ The process ID of the new child process .Va pl_child_pid member of .Vt "struct ptrace_lwpinfo" . +If the new child process was created via +.Xr vfork 2 , +the traced process's stop will also include the +.Dv PL_FLAG_VFORKED +flag. Note that new child processes will be attached with the default tracing event mask; they do not inherit the event mask of the traced process. @@ -173,6 +178,33 @@ Note that new processes do not report an initial thread, and exiting processes do not report an event for the termination of the last thread. +.It Dv PTRACE_VFORK +Report a stop event when a parent process resumes after a +.Xr vfork 2 . +.Pp +When a thread in the traced process creates a new child process via +.Xr vfork 2 , +the stop that reports +.Dv PL_FLAG_FORKED +and +.Dv PL_FLAG_SCX +occurs just after the child process is created, +but before the thread waits for the child process to stop sharing process +memory. +If a debugger is not tracing the new child process, +it must ensure that no breakpoints are enabled in the shared process +memory before detaching from the new child process. +This means that no breakpoints are enabled in the parent process either. +.Pp +The +.Dv PTRACE_VFORK +flag enables a new stop that indicates when the new child process stops +sharing the process memory of the parent process. +A debugger can reinsert breakpoints in the parent process and resume it +in response to this event. +This event is indicated by setting the +.Dv PL_FLAG_VFORK_DONE +flag. .El .Pp The default tracing event mask when attaching to a process via @@ -501,6 +533,16 @@ is enabled. Note that this event is not reported when the last LWP in a process exits. The termination of the last thread is reported via a normal process exit event. +.It PL_FLAG_VFORKED +Indicates that the thread is returning from a call to +.Xr vfork 2 +that created a new child process. +This flag is set in addition to +.Dv PL_FLAG_FORKED . +.It PL_FLAG_VFORK_DONE +Indicates that the thread has resumed after a child process created via +.Xr vfork 2 +has stopped sharing its address space with the traced process. .El .It pl_sigmask The current signal mask of the LWP Modified: stable/11/sys/kern/kern_fork.c ============================================================================== --- stable/11/sys/kern/kern_fork.c Fri Aug 19 19:31:55 2016 (r304498) +++ stable/11/sys/kern/kern_fork.c Fri Aug 19 20:17:57 2016 (r304499) @@ -736,6 +736,7 @@ do_fork(struct thread *td, struct fork_r if (fr->fr_flags & RFPPWAIT) { td->td_pflags |= TDP_RFPPWAIT; td->td_rfppwait_p = p2; + td->td_dbgflags |= TDB_VFORK; } PROC_UNLOCK(p2); Modified: stable/11/sys/kern/subr_syscall.c ============================================================================== --- stable/11/sys/kern/subr_syscall.c Fri Aug 19 19:31:55 2016 (r304498) +++ stable/11/sys/kern/subr_syscall.c Fri Aug 19 20:17:57 2016 (r304499) @@ -242,5 +242,13 @@ again: cv_timedwait(&p2->p_pwait, &p2->p_mtx, hz); } PROC_UNLOCK(p2); + + if (td->td_dbgflags & TDB_VFORK) { + PROC_LOCK(p); + if (p->p_ptevents & PTRACE_VFORK) + ptracestop(td, SIGTRAP); + td->td_dbgflags &= ~TDB_VFORK; + PROC_UNLOCK(p); + } } } Modified: stable/11/sys/kern/sys_process.c ============================================================================== --- stable/11/sys/kern/sys_process.c Fri Aug 19 19:31:55 2016 (r304498) +++ stable/11/sys/kern/sys_process.c Fri Aug 19 20:17:57 2016 (r304499) @@ -1000,7 +1000,7 @@ kern_ptrace(struct thread *td, int req, } tmp = *(int *)addr; if ((tmp & ~(PTRACE_EXEC | PTRACE_SCE | PTRACE_SCX | - PTRACE_FORK | PTRACE_LWP)) != 0) { + PTRACE_FORK | PTRACE_LWP | PTRACE_VFORK)) != 0) { error = EINVAL; break; } @@ -1321,7 +1321,11 @@ kern_ptrace(struct thread *td, int req, if (td2->td_dbgflags & TDB_FORK) { pl->pl_flags |= PL_FLAG_FORKED; pl->pl_child_pid = td2->td_dbg_forked; - } + if (td2->td_dbgflags & TDB_VFORK) + pl->pl_flags |= PL_FLAG_VFORKED; + } else if ((td2->td_dbgflags & (TDB_SCX | TDB_VFORK)) == + TDB_VFORK) + pl->pl_flags |= PL_FLAG_VFORK_DONE; if (td2->td_dbgflags & TDB_CHILD) pl->pl_flags |= PL_FLAG_CHILD; if (td2->td_dbgflags & TDB_BORN) Modified: stable/11/sys/sys/proc.h ============================================================================== --- stable/11/sys/sys/proc.h Fri Aug 19 19:31:55 2016 (r304498) +++ stable/11/sys/sys/proc.h Fri Aug 19 20:17:57 2016 (r304499) @@ -422,6 +422,7 @@ do { \ #define TDB_CHILD 0x00000100 /* New child indicator for ptrace() */ #define TDB_BORN 0x00000200 /* New LWP indicator for ptrace() */ #define TDB_EXIT 0x00000400 /* Exiting LWP indicator for ptrace() */ +#define TDB_VFORK 0x00000800 /* vfork indicator for ptrace() */ #define TDB_FSTP 0x00001000 /* The thread is PT_ATTACH leader */ /* Modified: stable/11/sys/sys/ptrace.h ============================================================================== --- stable/11/sys/sys/ptrace.h Fri Aug 19 19:31:55 2016 (r304498) +++ stable/11/sys/sys/ptrace.h Fri Aug 19 20:17:57 2016 (r304499) @@ -89,6 +89,7 @@ #define PTRACE_SYSCALL (PTRACE_SCE | PTRACE_SCX) #define PTRACE_FORK 0x0008 #define PTRACE_LWP 0x0010 +#define PTRACE_VFORK 0x0020 #define PTRACE_DEFAULT (PTRACE_EXEC) @@ -124,6 +125,8 @@ struct ptrace_lwpinfo { #define PL_FLAG_CHILD 0x80 /* I am from child */ #define PL_FLAG_BORN 0x100 /* new LWP */ #define PL_FLAG_EXITED 0x200 /* exiting LWP */ +#define PL_FLAG_VFORKED 0x400 /* new child via vfork */ +#define PL_FLAG_VFORK_DONE 0x800 /* vfork parent has resumed */ sigset_t pl_sigmask; /* LWP signal mask */ sigset_t pl_siglist; /* LWP pending signal */ struct __siginfo pl_siginfo; /* siginfo for signal */ Modified: stable/11/tests/sys/kern/ptrace_test.c ============================================================================== --- stable/11/tests/sys/kern/ptrace_test.c Fri Aug 19 19:31:55 2016 (r304498) +++ stable/11/tests/sys/kern/ptrace_test.c Fri Aug 19 20:17:57 2016 (r304499) @@ -1549,6 +1549,130 @@ ATF_TC_BODY(ptrace__event_mask, tc) ATF_REQUIRE(errno == ECHILD); } +/* + * Verify that the expected ptrace events are reported for PTRACE_VFORK. + */ +ATF_TC_WITHOUT_HEAD(ptrace__ptrace_vfork); +ATF_TC_BODY(ptrace__ptrace_vfork, tc) +{ + struct ptrace_lwpinfo pl; + pid_t fpid, wpid; + int events, status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + follow_fork_parent(true); + } + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(fpid, &status, 0); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + events |= PTRACE_VFORK; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, fpid, (caddr_t)&events, + sizeof(events)) == 0); + + /* Continue the child ignoring the SIGSTOP. */ + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) != -1); + + /* The next event should report the end of the vfork. */ + wpid = wait(&status); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl, sizeof(pl)) != -1); + ATF_REQUIRE((pl.pl_flags & PL_FLAG_VFORK_DONE) != 0); + + ATF_REQUIRE(ptrace(PT_CONTINUE, fpid, (caddr_t)1, 0) != -1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == fpid); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + +ATF_TC_WITHOUT_HEAD(ptrace__ptrace_vfork_follow); +ATF_TC_BODY(ptrace__ptrace_vfork_follow, tc) +{ + struct ptrace_lwpinfo pl[2]; + pid_t children[2], fpid, wpid; + int events, status; + + ATF_REQUIRE((fpid = fork()) != -1); + if (fpid == 0) { + trace_me(); + follow_fork_parent(true); + } + + /* Parent process. */ + children[0] = fpid; + + /* The first wait() should report the stop from SIGSTOP. */ + wpid = waitpid(children[0], &status, 0); + ATF_REQUIRE(wpid == children[0]); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGSTOP); + + ATF_REQUIRE(ptrace(PT_GET_EVENT_MASK, children[0], (caddr_t)&events, + sizeof(events)) == 0); + events |= PTRACE_FORK | PTRACE_VFORK; + ATF_REQUIRE(ptrace(PT_SET_EVENT_MASK, children[0], (caddr_t)&events, + sizeof(events)) == 0); + + /* Continue the child ignoring the SIGSTOP. */ + ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1); + + /* Wait for both halves of the fork event to get reported. */ + children[1] = handle_fork_events(children[0], pl); + ATF_REQUIRE(children[1] > 0); + + ATF_REQUIRE((pl[0].pl_flags & PL_FLAG_VFORKED) != 0); + + ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1); + ATF_REQUIRE(ptrace(PT_CONTINUE, children[1], (caddr_t)1, 0) != -1); + + /* + * The child can't exit until the grandchild reports status, so the + * grandchild should report its exit first to the debugger. + */ + wpid = waitpid(children[1], &status, 0); + ATF_REQUIRE(wpid == children[1]); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 2); + + /* + * The child should report it's vfork() completion before it + * exits. + */ + wpid = wait(&status); + ATF_REQUIRE(wpid == children[0]); + ATF_REQUIRE(WIFSTOPPED(status)); + ATF_REQUIRE(WSTOPSIG(status) == SIGTRAP); + ATF_REQUIRE(ptrace(PT_LWPINFO, wpid, (caddr_t)&pl[0], sizeof(pl[0])) != + -1); + ATF_REQUIRE((pl[0].pl_flags & PL_FLAG_VFORK_DONE) != 0); + + ATF_REQUIRE(ptrace(PT_CONTINUE, children[0], (caddr_t)1, 0) != -1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == children[0]); + ATF_REQUIRE(WIFEXITED(status)); + ATF_REQUIRE(WEXITSTATUS(status) == 1); + + wpid = wait(&status); + ATF_REQUIRE(wpid == -1); + ATF_REQUIRE(errno == ECHILD); +} + ATF_TP_ADD_TCS(tp) { @@ -1574,6 +1698,8 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, ptrace__ptrace_exec_disable); ATF_TP_ADD_TC(tp, ptrace__ptrace_exec_enable); ATF_TP_ADD_TC(tp, ptrace__event_mask); + ATF_TP_ADD_TC(tp, ptrace__ptrace_vfork); + ATF_TP_ADD_TC(tp, ptrace__ptrace_vfork_follow); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Fri Aug 19 20:37:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66459BBEECB; Fri, 19 Aug 2016 20:37:37 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09C3A11B0; Fri, 19 Aug 2016 20:37:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JKbaGO090847; Fri, 19 Aug 2016 20:37:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JKbWVC090809; Fri, 19 Aug 2016 20:37:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608192037.u7JKbWVC090809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 19 Aug 2016 20:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304500 - releng/11.0/share/timedef X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 20:37:37 -0000 Author: bapt Date: Fri Aug 19 20:37:32 2016 New Revision: 304500 URL: https://svnweb.freebsd.org/changeset/base/304500 Log: MFC r303354,303373,303404,304045,304192 Set date and time formats back to what they were before CLDR While CLDR brings us a good and up to date source data to generate locales for all databses we are using for locales, it is not the case of LC_TIME. Where it does not defines the informations we need. Put back all the date and time formats from the old locales. Make it statically for now (in order to be able to merge it now into 11.0-RELEASE). The generation tools will be updated soon. That gives us time to properly work on LC_TIME during the 12 timeframe. While here fix abbreviated month for af_ZA (which are already fixed in CLDR data upstream) In locales where AP/PM was not defined before CLDR data, remove again the AP/PM informations For locales where AP/PM was defined before CLDR data, keep the CLDR information which was properly translated. r303354,303373 by kevlo r303404,304192 by jkim Approved by: re (gjb) Modified: releng/11.0/share/timedef/af_ZA.UTF-8.src releng/11.0/share/timedef/am_ET.UTF-8.src releng/11.0/share/timedef/ar_JO.UTF-8.src releng/11.0/share/timedef/ar_MA.UTF-8.src releng/11.0/share/timedef/ar_SA.UTF-8.src releng/11.0/share/timedef/be_BY.CP1131.src releng/11.0/share/timedef/be_BY.CP1251.src releng/11.0/share/timedef/be_BY.ISO8859-5.src releng/11.0/share/timedef/be_BY.UTF-8.src releng/11.0/share/timedef/bg_BG.CP1251.src releng/11.0/share/timedef/bg_BG.UTF-8.src releng/11.0/share/timedef/ca_IT.ISO8859-15.src releng/11.0/share/timedef/ca_IT.UTF-8.src releng/11.0/share/timedef/cs_CZ.ISO8859-2.src releng/11.0/share/timedef/cs_CZ.UTF-8.src releng/11.0/share/timedef/da_DK.ISO8859-15.src releng/11.0/share/timedef/da_DK.UTF-8.src releng/11.0/share/timedef/de_AT.ISO8859-15.src releng/11.0/share/timedef/de_AT.UTF-8.src releng/11.0/share/timedef/de_DE.ISO8859-15.src releng/11.0/share/timedef/de_DE.UTF-8.src releng/11.0/share/timedef/el_GR.ISO8859-7.src releng/11.0/share/timedef/el_GR.UTF-8.src releng/11.0/share/timedef/en_CA.UTF-8.src releng/11.0/share/timedef/en_GB.UTF-8.src releng/11.0/share/timedef/en_IE.UTF-8.src releng/11.0/share/timedef/en_PH.UTF-8.src releng/11.0/share/timedef/en_SG.UTF-8.src releng/11.0/share/timedef/en_US.UTF-8.src releng/11.0/share/timedef/en_ZA.UTF-8.src releng/11.0/share/timedef/es_AR.ISO8859-1.src releng/11.0/share/timedef/es_CR.UTF-8.src releng/11.0/share/timedef/es_ES.ISO8859-15.src releng/11.0/share/timedef/es_ES.UTF-8.src releng/11.0/share/timedef/es_MX.ISO8859-1.src releng/11.0/share/timedef/es_MX.UTF-8.src releng/11.0/share/timedef/et_EE.ISO8859-15.src releng/11.0/share/timedef/eu_ES.UTF-8.src releng/11.0/share/timedef/fi_FI.ISO8859-15.src releng/11.0/share/timedef/fi_FI.UTF-8.src releng/11.0/share/timedef/fr_BE.ISO8859-15.src releng/11.0/share/timedef/fr_BE.UTF-8.src releng/11.0/share/timedef/fr_CA.ISO8859-15.src releng/11.0/share/timedef/fr_CA.UTF-8.src releng/11.0/share/timedef/fr_CH.ISO8859-15.src releng/11.0/share/timedef/fr_CH.UTF-8.src releng/11.0/share/timedef/fr_FR.ISO8859-15.src releng/11.0/share/timedef/fr_FR.UTF-8.src releng/11.0/share/timedef/he_IL.UTF-8.src releng/11.0/share/timedef/hi_IN.ISCII-DEV.src releng/11.0/share/timedef/hi_IN.UTF-8.src releng/11.0/share/timedef/hr_HR.ISO8859-2.src releng/11.0/share/timedef/hr_HR.UTF-8.src releng/11.0/share/timedef/hu_HU.ISO8859-2.src releng/11.0/share/timedef/hu_HU.UTF-8.src releng/11.0/share/timedef/hy_AM.ARMSCII-8.src releng/11.0/share/timedef/hy_AM.UTF-8.src releng/11.0/share/timedef/is_IS.ISO8859-15.src releng/11.0/share/timedef/is_IS.UTF-8.src releng/11.0/share/timedef/it_CH.ISO8859-15.src releng/11.0/share/timedef/it_CH.UTF-8.src releng/11.0/share/timedef/it_IT.ISO8859-15.src releng/11.0/share/timedef/it_IT.UTF-8.src releng/11.0/share/timedef/ja_JP.SJIS.src releng/11.0/share/timedef/ja_JP.UTF-8.src releng/11.0/share/timedef/ja_JP.eucJP.src releng/11.0/share/timedef/kk_KZ.UTF-8.src releng/11.0/share/timedef/ko_KR.UTF-8.src releng/11.0/share/timedef/ko_KR.eucKR.src (contents, props changed) releng/11.0/share/timedef/lt_LT.ISO8859-13.src releng/11.0/share/timedef/lt_LT.UTF-8.src releng/11.0/share/timedef/lv_LV.ISO8859-13.src releng/11.0/share/timedef/lv_LV.UTF-8.src releng/11.0/share/timedef/mn_MN.UTF-8.src releng/11.0/share/timedef/nb_NO.ISO8859-15.src releng/11.0/share/timedef/nb_NO.UTF-8.src releng/11.0/share/timedef/nl_BE.UTF-8.src releng/11.0/share/timedef/nl_NL.UTF-8.src releng/11.0/share/timedef/nn_NO.ISO8859-15.src releng/11.0/share/timedef/nn_NO.UTF-8.src releng/11.0/share/timedef/pl_PL.ISO8859-2.src releng/11.0/share/timedef/pl_PL.UTF-8.src releng/11.0/share/timedef/pt_BR.ISO8859-1.src releng/11.0/share/timedef/pt_BR.UTF-8.src releng/11.0/share/timedef/pt_PT.ISO8859-15.src releng/11.0/share/timedef/pt_PT.UTF-8.src releng/11.0/share/timedef/ro_RO.ISO8859-2.src releng/11.0/share/timedef/ro_RO.UTF-8.src releng/11.0/share/timedef/ru_RU.CP1251.src releng/11.0/share/timedef/ru_RU.CP866.src releng/11.0/share/timedef/ru_RU.ISO8859-5.src releng/11.0/share/timedef/ru_RU.KOI8-R.src releng/11.0/share/timedef/ru_RU.UTF-8.src releng/11.0/share/timedef/se_FI.UTF-8.src releng/11.0/share/timedef/se_NO.UTF-8.src releng/11.0/share/timedef/sk_SK.ISO8859-2.src releng/11.0/share/timedef/sk_SK.UTF-8.src releng/11.0/share/timedef/sl_SI.ISO8859-2.src releng/11.0/share/timedef/sl_SI.UTF-8.src releng/11.0/share/timedef/sr_RS.ISO8859-2.src releng/11.0/share/timedef/sr_RS.ISO8859-5.src releng/11.0/share/timedef/sr_RS.UTF-8.src releng/11.0/share/timedef/sr_RS.UTF-8@latin.src releng/11.0/share/timedef/sv_FI.ISO8859-15.src releng/11.0/share/timedef/sv_SE.ISO8859-15.src releng/11.0/share/timedef/sv_SE.UTF-8.src releng/11.0/share/timedef/tr_TR.ISO8859-9.src releng/11.0/share/timedef/tr_TR.UTF-8.src releng/11.0/share/timedef/uk_UA.CP1251.src releng/11.0/share/timedef/uk_UA.ISO8859-5.src releng/11.0/share/timedef/uk_UA.KOI8-U.src releng/11.0/share/timedef/uk_UA.UTF-8.src releng/11.0/share/timedef/zh_CN.GB2312.src (contents, props changed) releng/11.0/share/timedef/zh_CN.GBK.src (contents, props changed) releng/11.0/share/timedef/zh_CN.UTF-8.src releng/11.0/share/timedef/zh_CN.eucCN.src (contents, props changed) releng/11.0/share/timedef/zh_HK.UTF-8.src (contents, props changed) releng/11.0/share/timedef/zh_TW.Big5.src (contents, props changed) releng/11.0/share/timedef/zh_TW.UTF-8.src (contents, props changed) Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/share/timedef/af_ZA.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/af_ZA.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/af_ZA.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -7,15 +7,15 @@ Jan. Feb. Mrt. -Apr +Apr. Mei -Jun -Jul -Aug -Sep -Okt -Nov -Des +Jun. +Jul. +Aug. +Sep. +Okt. +Nov. +Des. # # Long month names (as in a date) Januarie @@ -50,20 +50,20 @@ Vrydag Saterdag # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%Y-%m-%d +%m/%d/%Y # # c_fmt -%d %B %Y %I:%M:%S %p +%a %b %e %X %Y # # AM/PM vm. nm. # # date_fmt -%d %B %Y %I:%M:%S %p %Z +%a %b %e %X %Z %Y # # Long month names (without case ending) Januarie Modified: releng/11.0/share/timedef/am_ET.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: releng/11.0/share/timedef/ar_JO.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: releng/11.0/share/timedef/ar_MA.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: releng/11.0/share/timedef/ar_SA.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: releng/11.0/share/timedef/be_BY.CP1131.src ============================================================================== Binary file (source and/or target). No diff available. Modified: releng/11.0/share/timedef/be_BY.CP1251.src ============================================================================== Binary file (source and/or target). No diff available. Modified: releng/11.0/share/timedef/be_BY.ISO8859-5.src ============================================================================== Binary file (source and/or target). No diff available. Modified: releng/11.0/share/timedef/be_BY.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: releng/11.0/share/timedef/bg_BG.CP1251.src ============================================================================== --- releng/11.0/share/timedef/bg_BG.CP1251.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/bg_BG.CP1251.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ %H:%M:%S # # x_fmt -%d.%m.%y г. +%d.%m.%y # # c_fmt -%A %e %B %Y ã. %H:%M:%S +%a %e %b %X %Y # # AM/PM ïð.îá. ñë.îá. # # date_fmt -%A %e %B %Y ã. %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) ÿíóàðè Modified: releng/11.0/share/timedef/bg_BG.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: releng/11.0/share/timedef/ca_IT.ISO8859-15.src ============================================================================== --- releng/11.0/share/timedef/ca_IT.ISO8859-15.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/ca_IT.ISO8859-15.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ dissabte %H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%A %e %B de %Y, %H:%M:%S +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%A %e %B de %Y, %H:%M:%S %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) de gener Modified: releng/11.0/share/timedef/ca_IT.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/ca_IT.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/ca_IT.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ dissabte %H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%A %e %B de %Y, %H:%M:%S +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%A %e %B de %Y, %H:%M:%S %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) de gener Modified: releng/11.0/share/timedef/cs_CZ.ISO8859-2.src ============================================================================== --- releng/11.0/share/timedef/cs_CZ.ISO8859-2.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/cs_CZ.ISO8859-2.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ sobota %H:%M:%S # # x_fmt -%d.%m.%y +%Y/%m/%d # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM dopoledne odpoledne # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e. %B %Y %X %Z # # Long month names (without case ending) leden Modified: releng/11.0/share/timedef/cs_CZ.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/cs_CZ.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/cs_CZ.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ sobota %H:%M:%S # # x_fmt -%d.%m.%y +%Y/%m/%d # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM dopoledne odpoledne # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e. %B %Y %X %Z # # Long month names (without case ending) leden Modified: releng/11.0/share/timedef/da_DK.ISO8859-15.src ============================================================================== --- releng/11.0/share/timedef/da_DK.ISO8859-15.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/da_DK.ISO8859-15.src Fri Aug 19 20:37:32 2016 (r304500) @@ -50,20 +50,20 @@ fredag lørdag # # X_fmt -%H.%M.%S +%H:%M:%S # # x_fmt -%d/%m/%Y +%d.%m.%Y # # c_fmt -%A %e %B %Y kl. %H.%M.%S +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%A %e %B %Y kl. %H.%M.%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) januar Modified: releng/11.0/share/timedef/da_DK.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/da_DK.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/da_DK.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -50,20 +50,20 @@ fredag lørdag # # X_fmt -%H.%M.%S +%H:%M:%S # # x_fmt -%d/%m/%Y +%d.%m.%Y # # c_fmt -%A %e %B %Y kl. %H.%M.%S +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%A %e %B %Y kl. %H.%M.%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) januar Modified: releng/11.0/share/timedef/de_AT.ISO8859-15.src ============================================================================== --- releng/11.0/share/timedef/de_AT.ISO8859-15.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/de_AT.ISO8859-15.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ Samstag %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y um %H:%M:%S +%a %e %b %X %Y # # AM/PM vorm. nachm. # # date_fmt -%A %e %B %Y um %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) Jänner Modified: releng/11.0/share/timedef/de_AT.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/de_AT.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/de_AT.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ Samstag %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y um %H:%M:%S +%a %e %b %X %Y # # AM/PM vorm. nachm. # # date_fmt -%A %e %B %Y um %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) Jänner Modified: releng/11.0/share/timedef/de_DE.ISO8859-15.src ============================================================================== --- releng/11.0/share/timedef/de_DE.ISO8859-15.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/de_DE.ISO8859-15.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ Samstag %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y um %H:%M:%S +%a %e %b %X %Y # # AM/PM vorm. nachm. # # date_fmt -%A %e %B %Y um %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) Januar Modified: releng/11.0/share/timedef/de_DE.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/de_DE.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/de_DE.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ Samstag %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y um %H:%M:%S +%a %e %b %X %Y # # AM/PM vorm. nachm. # # date_fmt -%A %e %B %Y um %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) Januar Modified: releng/11.0/share/timedef/el_GR.ISO8859-7.src ============================================================================== Binary file (source and/or target). No diff available. Modified: releng/11.0/share/timedef/el_GR.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: releng/11.0/share/timedef/en_CA.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/en_CA.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/en_CA.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%Y-%m-%d +%d/%m/%Y # # c_fmt -%A, %B %e, %Y at %I:%M:%S %p +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%A, %B %e, %Y at %I:%M:%S %p %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: releng/11.0/share/timedef/en_GB.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/en_GB.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/en_GB.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -56,14 +56,14 @@ Saturday %d/%m/%Y # # c_fmt -%A %e %B %Y at %H:%M:%S +%a %e %b %X %Y # # AM/PM a.m. p.m. # # date_fmt -%A %e %B %Y at %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: releng/11.0/share/timedef/en_IE.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/en_IE.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/en_IE.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt %d/%m/%Y # # c_fmt -%A %e %B %Y at %I:%M:%S %p +%a %e %b %X %Y # # AM/PM a.m. p.m. # # date_fmt -%A %e %B %Y at %I:%M:%S %p %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: releng/11.0/share/timedef/en_PH.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/en_PH.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/en_PH.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt %d/%m/%Y # # c_fmt -%A %e %B %Y at %I:%M:%S %p +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%A %e %B %Y at %I:%M:%S %p %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: releng/11.0/share/timedef/en_SG.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/en_SG.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/en_SG.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%A %e %B %Y at %I:%M:%S %p +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%A %e %B %Y at %I:%M:%S %p %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: releng/11.0/share/timedef/en_US.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/en_US.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/en_US.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%m/%d/%y +%m/%d/%Y # # c_fmt -%A, %B %e, %Y at %I:%M:%S %p +%a %b %e %X %Y # # AM/PM AM PM # # date_fmt -%A, %B %e, %Y at %I:%M:%S %p %Z +%a %b %e %X %Z %Y # # Long month names (without case ending) January Modified: releng/11.0/share/timedef/en_ZA.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/en_ZA.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/en_ZA.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -50,20 +50,20 @@ Friday Saturday # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%Y/%m/%d +%d/%m/%Y # # c_fmt -%d %B %Y at %I:%M:%S %p +%a %e %b %X %Y # # AM/PM AM PM # # date_fmt -%d %B %Y at %I:%M:%S %p %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) January Modified: releng/11.0/share/timedef/es_AR.ISO8859-1.src ============================================================================== --- releng/11.0/share/timedef/es_AR.ISO8859-1.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/es_AR.ISO8859-1.src Fri Aug 19 20:37:32 2016 (r304500) @@ -50,20 +50,20 @@ viernes sábado # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %I:%M:%S %p +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%e de %B de %Y, %I:%M:%S %p %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: releng/11.0/share/timedef/es_CR.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/es_CR.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/es_CR.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -50,20 +50,20 @@ viernes sábado # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %I:%M:%S %p +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%e de %B de %Y, %I:%M:%S %p %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: releng/11.0/share/timedef/es_ES.ISO8859-15.src ============================================================================== --- releng/11.0/share/timedef/es_ES.ISO8859-15.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/es_ES.ISO8859-15.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ sábado %H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %H:%M:%S +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%e de %B de %Y, %H:%M:%S %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: releng/11.0/share/timedef/es_ES.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/es_ES.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/es_ES.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ sábado %H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %H:%M:%S +%a %e %b %X %Y # # AM/PM a. m. p. m. # # date_fmt -%e de %B de %Y, %H:%M:%S %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: releng/11.0/share/timedef/es_MX.ISO8859-1.src ============================================================================== --- releng/11.0/share/timedef/es_MX.ISO8859-1.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/es_MX.ISO8859-1.src Fri Aug 19 20:37:32 2016 (r304500) @@ -4,18 +4,18 @@ # ----------------------------------------------------------------------------- # # Short month names -ene -feb -mar -abr -may -jun -jul -ago -sep -oct -nov -dic +ene. +feb. +mar. +abr. +may. +jun. +jul. +ago. +sep. +oct. +nov. +dic. # # Long month names (as in a date) enero @@ -50,20 +50,20 @@ viernes sábado # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %I:%M:%S %p +%a %e %b %X %Y # # AM/PM a.m. p.m. # # date_fmt -%e de %B de %Y, %I:%M:%S %p %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: releng/11.0/share/timedef/es_MX.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/es_MX.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/es_MX.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -50,20 +50,20 @@ viernes sábado # # X_fmt -%I:%M:%S %p +%H:%M:%S # # x_fmt -%d/%m/%y +%d/%m/%Y # # c_fmt -%e de %B de %Y, %I:%M:%S %p +%a %e %b %X %Y # # AM/PM a.m. p.m. # # date_fmt -%e de %B de %Y, %I:%M:%S %p %Z +%A, %e de %B de %Y, %X %Z # # Long month names (without case ending) enero Modified: releng/11.0/share/timedef/et_EE.ISO8859-15.src ============================================================================== --- releng/11.0/share/timedef/et_EE.ISO8859-15.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/et_EE.ISO8859-15.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ laupäev %H:%M.%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M.%S +%a %d %b %Y %X # # AM/PM AM PM # # date_fmt -%A %e %B %Y %H:%M.%S %Z +%a %d %b %Y %X %Z # # Long month names (without case ending) jaanuar Modified: releng/11.0/share/timedef/eu_ES.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/eu_ES.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/eu_ES.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -56,14 +56,14 @@ larunbata %Y/%m/%d # # c_fmt -%Y(e)ko %B %e %H:%M:%S (%Z) +%Y - %b - %e %a %X # # AM/PM AM PM # # date_fmt -%Y(e)ko %B %e %H:%M:%S (%Z) +%Y(e)ko %B-ren %ea, %X %Z # # Long month names (without case ending) urtarrilak Modified: releng/11.0/share/timedef/fi_FI.ISO8859-15.src ============================================================================== --- releng/11.0/share/timedef/fi_FI.ISO8859-15.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/fi_FI.ISO8859-15.src Fri Aug 19 20:37:32 2016 (r304500) @@ -50,20 +50,20 @@ perjantaina lauantaina # # X_fmt -%H.%M.%S +%H:%M:%S # # x_fmt %d.%m.%Y # # c_fmt -%A %e %B %Y klo %H.%M.%S +%a %e %b %X %Y # # AM/PM ap. ip. # # date_fmt -%A %e %B %Y klo %H.%M.%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) tammikuuta Modified: releng/11.0/share/timedef/fi_FI.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/fi_FI.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/fi_FI.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -50,20 +50,20 @@ perjantaina lauantaina # # X_fmt -%H.%M.%S +%H:%M:%S # # x_fmt %d.%m.%Y # # c_fmt -%A %e %B %Y klo %H.%M.%S +%a %e %b %X %Y # # AM/PM ap. ip. # # date_fmt -%A %e %B %Y klo %H.%M.%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) tammikuuta Modified: releng/11.0/share/timedef/fr_BE.ISO8859-15.src ============================================================================== --- releng/11.0/share/timedef/fr_BE.ISO8859-15.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/fr_BE.ISO8859-15.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%d/%m/%y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: releng/11.0/share/timedef/fr_BE.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/fr_BE.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/fr_BE.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%d/%m/%y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: releng/11.0/share/timedef/fr_CA.ISO8859-15.src ============================================================================== --- releng/11.0/share/timedef/fr_CA.ISO8859-15.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/fr_CA.ISO8859-15.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%y-%m-%d +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre md # # ampm_fmt -%I:%M:%S %p + # EOF Modified: releng/11.0/share/timedef/fr_CA.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/fr_CA.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/fr_CA.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%y-%m-%d +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre md # # ampm_fmt -%I:%M:%S %p + # EOF Modified: releng/11.0/share/timedef/fr_CH.ISO8859-15.src ============================================================================== --- releng/11.0/share/timedef/fr_CH.ISO8859-15.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/fr_CH.ISO8859-15.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: releng/11.0/share/timedef/fr_CH.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/fr_CH.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/fr_CH.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%d.%m.%y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: releng/11.0/share/timedef/fr_FR.ISO8859-15.src ============================================================================== --- releng/11.0/share/timedef/fr_FR.ISO8859-15.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/fr_FR.ISO8859-15.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt -%d/%m/%Y +%d.%m.%Y # # c_fmt -%A %e %B %Y %H:%M:%S +%a %e %b %X %Y # # AM/PM -AM -PM + + # # date_fmt -%A %e %B %Y %H:%M:%S %Z +%a %e %b %Y %X %Z # # Long month names (without case ending) janvier @@ -83,5 +83,5 @@ décembre dm # # ampm_fmt -%I:%M:%S %p + # EOF Modified: releng/11.0/share/timedef/fr_FR.UTF-8.src ============================================================================== --- releng/11.0/share/timedef/fr_FR.UTF-8.src Fri Aug 19 20:17:57 2016 (r304499) +++ releng/11.0/share/timedef/fr_FR.UTF-8.src Fri Aug 19 20:37:32 2016 (r304500) @@ -53,17 +53,17 @@ samedi %H:%M:%S # # x_fmt *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Aug 19 20:53:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37804BC0217; Fri, 19 Aug 2016 20:53:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E36721B36; Fri, 19 Aug 2016 20:53:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JKru6j098191; Fri, 19 Aug 2016 20:53:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JKru2K098190; Fri, 19 Aug 2016 20:53:56 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192053.u7JKru2K098190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 20:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304501 - head/tools/kerneldoc/subsys 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 20:53:57 -0000 Author: jhb Date: Fri Aug 19 20:53:55 2016 New Revision: 304501 URL: https://svnweb.freebsd.org/changeset/base/304501 Log: Remove doxygen files for mcd(4) and scd(4) drivers. Submitted by: ak Deleted: head/tools/kerneldoc/subsys/Doxyfile-dev_mcd head/tools/kerneldoc/subsys/Doxyfile-dev_scd From owner-svn-src-all@freebsd.org Fri Aug 19 21:14:29 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F7E2BC0556; Fri, 19 Aug 2016 21:14:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FAED1564; Fri, 19 Aug 2016 21:14:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JLESZW005669; Fri, 19 Aug 2016 21:14:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JLER34005659; Fri, 19 Aug 2016 21:14:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192114.u7JLER34005659@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 21:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304502 - in head: . share/man/man4 sys/amd64/conf sys/conf sys/dev/si sys/i386/conf sys/modules sys/modules/si targets/pseudo/userland tools/kerneldoc/subsys usr.sbin usr.sbin/sicontrol 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 21:14:29 -0000 Author: jhb Date: Fri Aug 19 21:14:27 2016 New Revision: 304502 URL: https://svnweb.freebsd.org/changeset/base/304502 Log: Remove the si(4) driver and sicontrol(8) for Specialix serial cards. The si(4) driver supported multiport serial adapters for ISA, EISA, and PCI buses. This driver does not use bus_space, instead it depends on direct use of the pointer returned by rman_get_virtual(). It is also still locked by Giant and calls for patch testing to convert it to use bus_space were unanswered. Relnotes: yes Deleted: head/share/man/man4/si.4 head/sys/dev/si/ head/sys/modules/si/ head/tools/kerneldoc/subsys/Doxyfile-dev_si head/usr.sbin/sicontrol/ Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/amd64/conf/NOTES head/sys/conf/files head/sys/i386/conf/NOTES head/sys/modules/Makefile head/targets/pseudo/userland/Makefile.depend head/usr.sbin/Makefile.amd64 head/usr.sbin/Makefile.i386 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Aug 19 20:53:55 2016 (r304501) +++ head/ObsoleteFiles.inc Fri Aug 19 21:14:27 2016 (r304502) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20160819: Remove si(4) and sicontrol(8) +OLD_FILES+=usr/share/man/man4/si.4.gz +OLD_FILES+=usr/sbin/sicontrol +OLD_FILES+=usr/share/man/man8/sicontrol.8.gz # 20160819: Remove scd(4) OLD_FILES+=usr/share/man/man4/scd.4.gz # 20160815: Remove mcd(4) Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Aug 19 20:53:55 2016 (r304501) +++ head/share/man/man4/Makefile Fri Aug 19 21:14:27 2016 (r304502) @@ -453,7 +453,6 @@ MAN= aac.4 \ sf.4 \ ${_sfxge.4} \ sge.4 \ - si.4 \ siba.4 \ siftr.4 \ siis.4 \ Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Fri Aug 19 20:53:55 2016 (r304501) +++ head/sys/amd64/conf/NOTES Fri Aug 19 21:14:27 2016 (r304502) @@ -542,7 +542,6 @@ hint.pbio.0.port="0x360" device smbios device vpd device asmc -device si device tpm device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 19 20:53:55 2016 (r304501) +++ head/sys/conf/files Fri Aug 19 21:14:27 2016 (r304502) @@ -2511,12 +2511,6 @@ dev/sdhci/sdhci_if.m optional sdhci dev/sdhci/sdhci_pci.c optional sdhci pci dev/sf/if_sf.c optional sf pci dev/sge/if_sge.c optional sge pci -dev/si/si.c optional si -dev/si/si2_z280.c optional si -dev/si/si3_t225.c optional si -dev/si/si_eisa.c optional si eisa -dev/si/si_isa.c optional si isa -dev/si/si_pci.c optional si pci dev/siba/siba_bwn.c optional siba_bwn pci dev/siba/siba_core.c optional siba_bwn pci dev/siis/siis.c optional siis pci Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Aug 19 20:53:55 2016 (r304501) +++ head/sys/i386/conf/NOTES Fri Aug 19 21:14:27 2016 (r304502) @@ -880,7 +880,6 @@ device spic hint.spic.0.at="isa" hint.spic.0.port="0x10a0" device asmc -device si device tpm device padlock_rng # VIA Padlock RNG device rdrand_rng # Intel Bull Mountain RNG Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Aug 19 20:53:55 2016 (r304501) +++ head/sys/modules/Makefile Fri Aug 19 21:14:27 2016 (r304502) @@ -330,7 +330,6 @@ SUBDIR= \ ${_sf} \ ${_sfxge} \ sge \ - ${_si} \ siba_bwn \ siftr \ siis \ @@ -584,7 +583,6 @@ _rdma= rdma .endif _safe= safe _scsi_low= scsi_low -_si= si _speaker= speaker _splash= splash _sppp= sppp Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Fri Aug 19 20:53:55 2016 (r304501) +++ head/targets/pseudo/userland/Makefile.depend Fri Aug 19 21:14:27 2016 (r304502) @@ -834,7 +834,6 @@ DIRDEPS.amd64= \ usr.sbin/lptcontrol \ usr.sbin/mptable \ usr.sbin/ndiscvt \ - usr.sbin/sicontrol \ usr.sbin/spkrtest \ usr.sbin/sade \ usr.sbin/zzz @@ -863,7 +862,6 @@ DIRDEPS.i386= \ usr.sbin/ndiscvt \ usr.sbin/pnpinfo \ usr.sbin/sade \ - usr.sbin/sicontrol \ usr.sbin/spkrtest \ usr.sbin/zzz \ usr.sbin/acpi \ Modified: head/usr.sbin/Makefile.amd64 ============================================================================== --- head/usr.sbin/Makefile.amd64 Fri Aug 19 20:53:55 2016 (r304501) +++ head/usr.sbin/Makefile.amd64 Fri Aug 19 21:14:27 2016 (r304502) @@ -29,6 +29,5 @@ SUBDIR+= mptable .if ${MK_NDIS} != "no" SUBDIR+= ndiscvt .endif -SUBDIR+= sicontrol SUBDIR+= spkrtest SUBDIR+= zzz Modified: head/usr.sbin/Makefile.i386 ============================================================================== --- head/usr.sbin/Makefile.i386 Fri Aug 19 20:53:55 2016 (r304501) +++ head/usr.sbin/Makefile.i386 Fri Aug 19 21:14:27 2016 (r304502) @@ -17,7 +17,6 @@ SUBDIR+= mptable SUBDIR+= ndiscvt .endif SUBDIR+= pnpinfo -SUBDIR+= sicontrol SUBDIR+= spkrtest SUBDIR+= zzz From owner-svn-src-all@freebsd.org Fri Aug 19 21:51:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55194BC0CBF; Fri, 19 Aug 2016 21:51:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1515719B9; Fri, 19 Aug 2016 21:51:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JLphxN017160; Fri, 19 Aug 2016 21:51:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JLpgk0017152; Fri, 19 Aug 2016 21:51:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192151.u7JLpgk0017152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 21:51:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304503 - in head: etc release/doc/en_US.ISO8859-1/hardware sys/conf sys/dev/wds sys/modules sys/modules/wds sys/pc98/conf sys/sparc64/conf tools/kerneldoc/subsys 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 21:51:44 -0000 Author: jhb Date: Fri Aug 19 21:51:42 2016 New Revision: 304503 URL: https://svnweb.freebsd.org/changeset/base/304503 Log: Remove the wds(4) driver for the WD700 ISA SCSI HBA. While this driver does do DMA, it bounce buffers all transactions through a single 64k buffer. It also does not have a manpage. Relnotes: yes Deleted: head/sys/dev/wds/ head/sys/modules/wds/ head/tools/kerneldoc/subsys/Doxyfile-dev_wds Modified: head/etc/devd.conf head/release/doc/en_US.ISO8859-1/hardware/article.xml head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile head/sys/pc98/conf/NOTES head/sys/sparc64/conf/NOTES Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Fri Aug 19 21:14:27 2016 (r304502) +++ head/etc/devd.conf Fri Aug 19 21:51:42 2016 (r304503) @@ -20,7 +20,7 @@ options { #XXX Yes, these are gross -- imp set scsi-controller-regex "(aac|adv|adw|aha|ahb|ahc|ahd|aic|amd|amr|asr|bt|ciss|ct|dpt|\ - esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wds)\ + esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm)\ [0-9]+"; set wifi-driver-regex "(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|ral|rsu|rum|run|uath|\ Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 21:14:27 2016 (r304502) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 21:51:42 2016 (r304503) @@ -751,9 +751,6 @@ &hwlist.vpo; - [&arch.i386;] The wds(4) driver supports the WD7000 SCSI - controller. - With all supported SCSI controllers, full support is provided for SCSI-I, SCSI-II, and SCSI-III peripherals, including hard disks, optical disks, tape drives (including Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Aug 19 21:14:27 2016 (r304502) +++ head/sys/conf/NOTES Fri Aug 19 21:51:42 2016 (r304503) @@ -1560,7 +1560,6 @@ options TERMINAL_KERN_ATTR=(FG_LIGHTRED # 53C876, 53C885, 53C895, 53C895A, 53C896, 53C897, 53C1510D, # 53C1010-33, 53C1010-66. # trm: Tekram DC395U/UW/F DC315U adapters. -# wds: WD7000 # # Note that the order is important in order for Buslogic ISA/EISA cards to be @@ -1602,11 +1601,6 @@ device mpt device ncr device sym device trm -device wds -hint.wds.0.at="isa" -hint.wds.0.port="0x350" -hint.wds.0.irq="11" -hint.wds.0.drq="6" # The aic7xxx driver will attempt to use memory mapped I/O for all PCI # controllers that have it configured only if this option is set. Unfortunately, Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 19 21:14:27 2016 (r304502) +++ head/sys/conf/files Fri Aug 19 21:51:42 2016 (r304503) @@ -2930,7 +2930,6 @@ dev/vxge/vxgehal/vxgehal-channel.c optio dev/vxge/vxgehal/vxgehal-fifo.c optional vxge dev/watchdog/watchdog.c standard dev/wb/if_wb.c optional wb pci -dev/wds/wd7000.c optional wds isa dev/wi/if_wi.c optional wi dev/wi/if_wi_pccard.c optional wi pccard dev/wi/if_wi_pci.c optional wi pci Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Aug 19 21:14:27 2016 (r304502) +++ head/sys/modules/Makefile Fri Aug 19 21:51:42 2016 (r304503) @@ -390,7 +390,6 @@ SUBDIR= \ ${_vxge} \ wb \ ${_wbwd} \ - ${_wds} \ ${_wi} \ ${_wl} \ wlan \ @@ -718,7 +717,6 @@ _sbni= sbni _streams= streams _stg= stg _svr4= svr4 -_wds= wds .if ${MACHINE} == "i386" .if ${MK_EISA} != "no" _ahb= ahb Modified: head/sys/pc98/conf/NOTES ============================================================================== --- head/sys/pc98/conf/NOTES Fri Aug 19 21:14:27 2016 (r304502) +++ head/sys/pc98/conf/NOTES Fri Aug 19 21:51:42 2016 (r304503) @@ -595,7 +595,6 @@ nodevice ahb nodevice ahd nodevice mpt nodevice trm -nodevice wds nodevice dpt nodevice ciss nodevice iir Modified: head/sys/sparc64/conf/NOTES ============================================================================== --- head/sys/sparc64/conf/NOTES Fri Aug 19 21:14:27 2016 (r304502) +++ head/sys/sparc64/conf/NOTES Fri Aug 19 21:51:42 2016 (r304503) @@ -121,7 +121,6 @@ nodevice snd_vibes nodevice snd_uaudio nodevice aha nodevice bt -nodevice wds nodevice ep nodevice ex From owner-svn-src-all@freebsd.org Fri Aug 19 22:05:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D534BBF08C; Fri, 19 Aug 2016 22:05:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5038B1302; Fri, 19 Aug 2016 22:05:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JM5MxN024403; Fri, 19 Aug 2016 22:05:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JM5MiR024402; Fri, 19 Aug 2016 22:05:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192205.u7JM5MiR024402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 22:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304504 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 22:05:23 -0000 Author: jhb Date: Fri Aug 19 22:05:22 2016 New Revision: 304504 URL: https://svnweb.freebsd.org/changeset/base/304504 Log: Remove stale drivers (amd(4) and asr(4)) from the SCSI controller regex. Modified: head/etc/devd.conf Modified: head/etc/devd.conf ============================================================================== --- head/etc/devd.conf Fri Aug 19 21:51:42 2016 (r304503) +++ head/etc/devd.conf Fri Aug 19 22:05:22 2016 (r304504) @@ -19,7 +19,7 @@ options { # Setup some shorthand for regex that we use later in the file. #XXX Yes, these are gross -- imp set scsi-controller-regex - "(aac|adv|adw|aha|ahb|ahc|ahd|aic|amd|amr|asr|bt|ciss|ct|dpt|\ + "(aac|adv|adw|aha|ahb|ahc|ahd|aic|amr|bt|ciss|ct|dpt|\ esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm)\ [0-9]+"; set wifi-driver-regex From owner-svn-src-all@freebsd.org Fri Aug 19 22:13:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78954BBF2B2; Fri, 19 Aug 2016 22:13:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45AF518B3; Fri, 19 Aug 2016 22:13:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JMD1nZ028153; Fri, 19 Aug 2016 22:13:01 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JMD12W028152; Fri, 19 Aug 2016 22:13:01 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192213.u7JMD12W028152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 22:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304505 - head/release/doc/en_US.ISO8859-1/hardware 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 22:13:02 -0000 Author: jhb Date: Fri Aug 19 22:13:01 2016 New Revision: 304505 URL: https://svnweb.freebsd.org/changeset/base/304505 Log: Remove mentions of the mcd(4), scd(4), and si(4) drivers. Relnotes: yes Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 22:05:22 2016 (r304504) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 22:13:01 2016 (r304505) @@ -772,23 +772,9 @@ - [&arch.i386;] Sony proprietary interface (all models) - (&man.scd.4;) - - - ATAPI IDE interface (&man.acd.4;) - - [&arch.i386;] The following device is unmaintained: - - - - Mitsumi proprietary CD-ROM interface (all models) - (&man.mcd.4;) - - @@ -1235,13 +1221,6 @@ &hwlist.rc; - [&arch.i386;, &arch.amd64;] Specialix SI/XIO/SX multiport - serial cards, with both the older SIHOST2.x and the - enhanced (transputer based, aka JET) host cards - (ISA, EISA and PCI) are supported. Note that the newer SX+ - PCI cards are not currently supported. (&man.si.4; - driver) - [&arch.pc98;] Internel serial interfaces (&man.sio.4; driver) From owner-svn-src-all@freebsd.org Fri Aug 19 22:27:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7444BBF8C2; Fri, 19 Aug 2016 22:27:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A286D14D2; Fri, 19 Aug 2016 22:27:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JMRFfo032694; Fri, 19 Aug 2016 22:27:15 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JMREIo032684; Fri, 19 Aug 2016 22:27:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192227.u7JMREIo032684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 22:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304506 - in head: . release/doc/en_US.ISO8859-1/hardware share/man/man4/man4.i386 sys/conf sys/dev/wl sys/i386/conf sys/modules sys/modules/wl targets/pseudo/userland tools/build/mk to... 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 22:27:16 -0000 Author: jhb Date: Fri Aug 19 22:27:14 2016 New Revision: 304506 URL: https://svnweb.freebsd.org/changeset/base/304506 Log: Remove the wl(4) driver and wlconfig(8) utility. The wl(4) driver supports pre-802.11 PCCard wireless adapters that are slower than 802.11b. They do not work with any of the 802.11 framework and the driver hasn't been reported to actually work in a long time. Relnotes: yes Deleted: head/share/man/man4/man4.i386/wl.4 head/sys/dev/wl/ head/sys/modules/wl/ head/tools/kerneldoc/subsys/Doxyfile-dev_wl head/usr.sbin/wlconfig/ Modified: head/ObsoleteFiles.inc head/release/doc/en_US.ISO8859-1/hardware/article.xml head/share/man/man4/man4.i386/Makefile head/sys/conf/files head/sys/conf/options head/sys/i386/conf/NOTES head/sys/modules/Makefile head/targets/pseudo/userland/Makefile.depend head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/Makefile.i386 Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Aug 19 22:13:01 2016 (r304505) +++ head/ObsoleteFiles.inc Fri Aug 19 22:27:14 2016 (r304506) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20160819: Remove wl(4) and wlconfig(8) +OLD_FILES+=usr/share/man/man4/i386/wl.4.gz +OLD_FILES+=usr/sbin/wlconfig +OLD_FILES+=usr/share/man/man8/i386/wlconfig.8.gz # 20160819: Remove si(4) and sicontrol(8) OLD_FILES+=usr/share/man/man4/si.4.gz OLD_FILES+=usr/sbin/sicontrol Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 22:13:01 2016 (r304505) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 22:27:14 2016 (r304506) @@ -1023,9 +1023,6 @@ Intersil PRISM-2.5, Intersil Prism-3, and Symbol Spectrum24 chipsets (&man.wi.4; driver) - [&arch.i386;] NCR / AT&T / Lucent Technologies WaveLan - T1-speed ISA/radio LAN cards (&man.wl.4; driver) - [&arch.i386;, &arch.amd64;] Intel PRO/Wireless 3945ABG MiniPCI network adapters (&man.wpi.4; driver) Modified: head/share/man/man4/man4.i386/Makefile ============================================================================== --- head/share/man/man4/man4.i386/Makefile Fri Aug 19 22:13:01 2016 (r304505) +++ head/share/man/man4/man4.i386/Makefile Fri Aug 19 22:27:14 2016 (r304506) @@ -31,8 +31,7 @@ MAN= aic.4 \ streams.4 \ svr4.4 \ vpd.4 \ - vx.4 \ - wl.4 + vx.4 MLINKS= CPU_ELAN.4 CPU_SOEKRIS.4 MLINKS+=pae.4 PAE.4 Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Aug 19 22:13:01 2016 (r304505) +++ head/sys/conf/files Fri Aug 19 22:27:14 2016 (r304506) @@ -2933,7 +2933,6 @@ dev/wb/if_wb.c optional wb pci dev/wi/if_wi.c optional wi dev/wi/if_wi_pccard.c optional wi pccard dev/wi/if_wi_pci.c optional wi pci -dev/wl/if_wl.c optional wl isa dev/wpi/if_wpi.c optional wpi pci wpifw.c optional wpifw \ compile-with "${AWK} -f $S/tools/fw_stub.awk wpi.fw:wpifw:153229 -mwpi -c${.TARGET}" \ Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Fri Aug 19 22:13:01 2016 (r304505) +++ head/sys/conf/options Fri Aug 19 22:27:14 2016 (r304506) @@ -218,8 +218,6 @@ SW_WATCHDOG opt_watchdog.h TURNSTILE_PROFILING UMTX_PROFILING VERBOSE_SYSINIT -WLCACHE opt_wavelan.h -WLDEBUG opt_wavelan.h # POSIX kernel options P1003_1B_MQUEUE opt_posix.h Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Aug 19 22:13:01 2016 (r304505) +++ head/sys/i386/conf/NOTES Fri Aug 19 22:27:14 2016 (r304506) @@ -648,11 +648,6 @@ hint.sbni.0.port="0x210" hint.sbni.0.irq="0xefdead" hint.sbni.0.flags="0" device vmx # VMware VMXNET3 Ethernet -device wl -hint.wl.0.at="isa" -hint.wl.0.port="0x300" -options WLCACHE # enables the signal-strength cache -options WLDEBUG # enables verbose debugging output device wpi # Intel 3945ABG wireless NICs. # IEEE 802.11 adapter firmware modules Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Fri Aug 19 22:13:01 2016 (r304505) +++ head/sys/modules/Makefile Fri Aug 19 22:27:14 2016 (r304506) @@ -391,7 +391,6 @@ SUBDIR= \ wb \ ${_wbwd} \ ${_wi} \ - ${_wl} \ wlan \ wlan_acl \ wlan_amrr \ @@ -728,7 +727,6 @@ _ctau= ctau .endif _dpt= dpt _ex= ex -_wl= wl .elif ${MACHINE} == "pc98" _canbepm= canbepm _canbus= canbus Modified: head/targets/pseudo/userland/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/Makefile.depend Fri Aug 19 22:13:01 2016 (r304505) +++ head/targets/pseudo/userland/Makefile.depend Fri Aug 19 22:27:14 2016 (r304506) @@ -865,8 +865,7 @@ DIRDEPS.i386= \ usr.sbin/spkrtest \ usr.sbin/zzz \ usr.sbin/acpi \ - usr.sbin/boot0cfg \ - usr.sbin/wlconfig + usr.sbin/boot0cfg DIRDEPS.arm64= \ usr.sbin/acpi \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Aug 19 22:13:01 2016 (r304505) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Aug 19 22:27:14 2016 (r304506) @@ -8744,9 +8744,6 @@ OLD_FILES+=usr/sbin/hostapd OLD_FILES+=usr/sbin/hostapd_cli OLD_FILES+=usr/sbin/ndis_events OLD_FILES+=usr/sbin/wlandebug -.if ${TARGET_ARCH} == "i386" -OLD_FILES+=usr/sbin/wlconfig -.endif OLD_FILES+=usr/sbin/wpa_cli OLD_FILES+=usr/sbin/wpa_passphrase OLD_FILES+=usr/sbin/wpa_supplicant @@ -8761,9 +8758,6 @@ OLD_FILES+=usr/share/man/man5/wpa_suppli OLD_FILES+=usr/share/man/man8/ancontrol.8.gz OLD_FILES+=usr/share/man/man8/hostapd.8.gz OLD_FILES+=usr/share/man/man8/hostapd_cli.8.gz -.if ${TARGET_ARCH} == "i386" -OLD_FILES+=usr/share/man/man8/i386/wlconfig.8.gz -.endif OLD_FILES+=usr/share/man/man8/ndis_events.8.gz OLD_FILES+=usr/share/man/man8/wlandebug.8.gz OLD_FILES+=usr/share/man/man8/wpa_cli.8.gz Modified: head/usr.sbin/Makefile.i386 ============================================================================== --- head/usr.sbin/Makefile.i386 Fri Aug 19 22:13:01 2016 (r304505) +++ head/usr.sbin/Makefile.i386 Fri Aug 19 22:27:14 2016 (r304506) @@ -29,9 +29,6 @@ SUBDIR+= boot0cfg .if ${MK_HYPERV} != "no" SUBDIR+= hyperv .endif -.if ${MK_WIRELESS} != "no" -SUBDIR+= wlconfig -.endif .elif ${MACHINE} == "pc98" SUBDIR+= boot98cfg .endif From owner-svn-src-all@freebsd.org Fri Aug 19 23:31:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C83DEBC06DD; Fri, 19 Aug 2016 23:31:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98B3C139F; Fri, 19 Aug 2016 23:31:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JNVu6X057690; Fri, 19 Aug 2016 23:31:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JNVu8E057689; Fri, 19 Aug 2016 23:31:56 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192331.u7JNVu8E057689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 23:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304507 - in stable: 10/sys/boot/efi/loader 11/sys/boot/efi/loader X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 23:31:57 -0000 Author: jhb Date: Fri Aug 19 23:31:56 2016 New Revision: 304507 URL: https://svnweb.freebsd.org/changeset/base/304507 Log: MFC 304018: Add defines needed to export SMBIOS serial numbers Some defines needed for exporting serial numbers from the SMBIOS were missed during integration of SMBIOS support in the EFI boot loader (r281138). This is needed for getting the hostid set from the system hardware UUID. PR: 206031 Modified: stable/10/sys/boot/efi/loader/Makefile Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/boot/efi/loader/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/boot/efi/loader/Makefile ============================================================================== --- stable/10/sys/boot/efi/loader/Makefile Fri Aug 19 22:27:14 2016 (r304506) +++ stable/10/sys/boot/efi/loader/Makefile Fri Aug 19 23:31:56 2016 (r304507) @@ -50,6 +50,18 @@ CFLAGS+= -DEFI_ZFS_BOOT .endif CFLAGS+= -DNO_PCI -DEFI +.if !defined(BOOT_HIDE_SERIAL_NUMBERS) +# Export serial numbers, UUID, and asset tag from loader. +CFLAGS+= -DSMBIOS_SERIAL_NUMBERS +.if defined(BOOT_LITTLE_ENDIAN_UUID) +# Use little-endian UUID format as defined in SMBIOS 2.6. +CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID +.elif defined(BOOT_NETWORK_ENDIAN_UUID) +# Use network-endian UUID format for backward compatibility. +CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID +.endif +.endif + .if ${MK_FORTH} != "no" BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH From owner-svn-src-all@freebsd.org Fri Aug 19 23:31:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00096BC06E1; Fri, 19 Aug 2016 23:31:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C684813A1; Fri, 19 Aug 2016 23:31:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JNVvOj057696; Fri, 19 Aug 2016 23:31:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JNVvON057695; Fri, 19 Aug 2016 23:31:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192331.u7JNVvON057695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 23:31:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304507 - in stable: 10/sys/boot/efi/loader 11/sys/boot/efi/loader X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 23:31:58 -0000 Author: jhb Date: Fri Aug 19 23:31:56 2016 New Revision: 304507 URL: https://svnweb.freebsd.org/changeset/base/304507 Log: MFC 304018: Add defines needed to export SMBIOS serial numbers Some defines needed for exporting serial numbers from the SMBIOS were missed during integration of SMBIOS support in the EFI boot loader (r281138). This is needed for getting the hostid set from the system hardware UUID. PR: 206031 Modified: stable/11/sys/boot/efi/loader/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/boot/efi/loader/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/boot/efi/loader/Makefile ============================================================================== --- stable/11/sys/boot/efi/loader/Makefile Fri Aug 19 22:27:14 2016 (r304506) +++ stable/11/sys/boot/efi/loader/Makefile Fri Aug 19 23:31:56 2016 (r304507) @@ -63,6 +63,18 @@ CFLAGS+= -DNO_PCI -DEFI LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a .endif +.if !defined(BOOT_HIDE_SERIAL_NUMBERS) +# Export serial numbers, UUID, and asset tag from loader. +CFLAGS+= -DSMBIOS_SERIAL_NUMBERS +.if defined(BOOT_LITTLE_ENDIAN_UUID) +# Use little-endian UUID format as defined in SMBIOS 2.6. +CFLAGS+= -DSMBIOS_LITTLE_ENDIAN_UUID +.elif defined(BOOT_NETWORK_ENDIAN_UUID) +# Use network-endian UUID format for backward compatibility. +CFLAGS+= -DSMBIOS_NETWORK_ENDIAN_UUID +.endif +.endif + .if ${MK_FORTH} != "no" BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH From owner-svn-src-all@freebsd.org Fri Aug 19 23:39:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BC01BC07C2; Fri, 19 Aug 2016 23:39:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FFD017F0; Fri, 19 Aug 2016 23:39:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JNd80c058628; Fri, 19 Aug 2016 23:39:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JNd8Yg058624; Fri, 19 Aug 2016 23:39:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608192339.u7JNd8Yg058624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 19 Aug 2016 23:39:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304508 - in head: . share/man/man4 sys/conf sys/i386/conf sys/i386/isa 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 23:39:09 -0000 Author: jhb Date: Fri Aug 19 23:39:08 2016 New Revision: 304508 URL: https://svnweb.freebsd.org/changeset/base/304508 Log: Remove the spic(4) driver for the Sony Vaoi Jogdial. This hardware is not present on any modern systems. The driver is quite hackish (raw inb/outb instead of bus_space, and raw inb/outb to random I/O ports to enable ACPI since it predated proper ACPI support). Relnotes: yes Deleted: head/share/man/man4/spic.4 head/sys/i386/isa/spic.c head/sys/i386/isa/spicreg.h Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/sys/conf/files.i386 head/sys/i386/conf/NOTES Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Aug 19 23:31:56 2016 (r304507) +++ head/ObsoleteFiles.inc Fri Aug 19 23:39:08 2016 (r304508) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160819: Remove spic(4) +OLD_FILES+=usr/share/man/man4/spic.4.gz # 20160819: Remove wl(4) and wlconfig(8) OLD_FILES+=usr/share/man/man4/i386/wl.4.gz OLD_FILES+=usr/sbin/wlconfig Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Fri Aug 19 23:31:56 2016 (r304507) +++ head/share/man/man4/Makefile Fri Aug 19 23:39:08 2016 (r304508) @@ -496,7 +496,6 @@ MAN= aac.4 \ snd_via82c686.4 \ snd_vibes.4 \ snp.4 \ - spic.4 \ ${_spkr.4} \ splash.4 \ sppp.4 \ Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Fri Aug 19 23:31:56 2016 (r304507) +++ head/sys/conf/files.i386 Fri Aug 19 23:39:08 2016 (r304508) @@ -516,7 +516,6 @@ i386/isa/elink.c optional ep | ie i386/isa/npx.c optional npx i386/isa/pmtimer.c optional pmtimer i386/isa/prof_machdep.c optional profiling-routine -i386/isa/spic.c optional spic i386/linux/imgact_linux.c optional compat_linux i386/linux/linux_dummy.c optional compat_linux i386/linux/linux_machdep.c optional compat_linux Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Aug 19 23:31:56 2016 (r304507) +++ head/sys/i386/conf/NOTES Fri Aug 19 23:39:08 2016 (r304508) @@ -834,7 +834,6 @@ device hyperv # HyperV drivers # vpd: Vital Product Data kernel interface # pmtimer: Adjust system timer at wakeup time # pbio: Parallel (8255 PPI) basic I/O (mode 0) port (e.g. Advantech PCL-724) -# spic: Sony Programmable I/O controller (VAIO notebooks) # asmc: Apple System Management Controller # si: Specialix International SI/XIO or SX intelligent serial card driver # tpm: Trusted Platform Module @@ -871,9 +870,6 @@ device pmtimer device pbio hint.pbio.0.at="isa" hint.pbio.0.port="0x360" -device spic -hint.spic.0.at="isa" -hint.spic.0.port="0x10a0" device asmc device tpm device padlock_rng # VIA Padlock RNG From owner-svn-src-all@freebsd.org Fri Aug 19 23:44:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE2BCBC091C; Fri, 19 Aug 2016 23:44:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 755711C12; Fri, 19 Aug 2016 23:44:08 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7JNi7CX062274; Fri, 19 Aug 2016 23:44:07 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7JNi7db062273; Fri, 19 Aug 2016 23:44:07 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201608192344.u7JNi7db062273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 19 Aug 2016 23:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304509 - head/sys/arm/allwinner 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.22 Precedence: list List-Id: "SVN commit messages 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, 19 Aug 2016 23:44:08 -0000 Author: manu Date: Fri Aug 19 23:44:07 2016 New Revision: 304509 URL: https://svnweb.freebsd.org/changeset/base/304509 Log: if_emac: Before generating a random MAC address, try using the SID rootkey to generate one. This is was U-Boot does to generate a random MAC so we end up with the same MAC address as if U-Boot did generate it. MFC after: 1 week Modified: head/sys/arm/allwinner/if_emac.c Modified: head/sys/arm/allwinner/if_emac.c ============================================================================== --- head/sys/arm/allwinner/if_emac.c Fri Aug 19 23:39:08 2016 (r304508) +++ head/sys/arm/allwinner/if_emac.c Fri Aug 19 23:44:07 2016 (r304509) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include @@ -167,12 +168,17 @@ static void emac_get_hwaddr(struct emac_softc *sc, uint8_t *hwaddr) { uint32_t val0, val1, rnd; + u_char rootkey[16]; /* * Try to get MAC address from running hardware. * If there is something non-zero there just use it. * * Otherwise set the address to a convenient locally assigned address, + * using the SID rootkey. + * This is was uboot does so we end up with the same mac as if uboot + * did set it. + * If we can't get the root key, generate a random one, * 'bsd' + random 24 low-order bits. 'b' is 0x62, which has the locally * assigned bit set, and the broadcast/multicast bit clear. */ @@ -186,13 +192,23 @@ emac_get_hwaddr(struct emac_softc *sc, u hwaddr[4] = (val0 >> 8) & 0xff; hwaddr[5] = (val0 >> 0) & 0xff; } else { - rnd = arc4random() & 0x00ffffff; - hwaddr[0] = 'b'; - hwaddr[1] = 's'; - hwaddr[2] = 'd'; - hwaddr[3] = (rnd >> 16) & 0xff; - hwaddr[4] = (rnd >> 8) & 0xff; - hwaddr[5] = (rnd >> 0) & 0xff; + if (aw_sid_get_rootkey(rootkey) == 0) { + hwaddr[0] = 0x2; + hwaddr[1] = rootkey[3]; + hwaddr[2] = rootkey[12]; + hwaddr[3] = rootkey[13]; + hwaddr[4] = rootkey[14]; + hwaddr[5] = rootkey[15]; + } + else { + rnd = arc4random() & 0x00ffffff; + hwaddr[0] = 'b'; + hwaddr[1] = 's'; + hwaddr[2] = 'd'; + hwaddr[3] = (rnd >> 16) & 0xff; + hwaddr[4] = (rnd >> 8) & 0xff; + hwaddr[5] = (rnd >> 0) & 0xff; + } } if (bootverbose) printf("MAC address: %s\n", ether_sprintf(hwaddr)); From owner-svn-src-all@freebsd.org Sat Aug 20 00:08:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BDA8BBE001; Sat, 20 Aug 2016 00:08:12 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DD60E17A1; Sat, 20 Aug 2016 00:08:11 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7K08Bai069628; Sat, 20 Aug 2016 00:08:11 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K08Bok069627; Sat, 20 Aug 2016 00:08:11 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201608200008.u7K08Bok069627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Sat, 20 Aug 2016 00:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304510 - head/sys/dev/ixl 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 00:08:12 -0000 Author: erj Date: Sat Aug 20 00:08:10 2016 New Revision: 304510 URL: https://svnweb.freebsd.org/changeset/base/304510 Log: ixlv(4): Fix ixlv(4) not loading when loaded as a kernel module and netmap is enabled. Define (unused) netmap variables; ixlv(4) doesn't support netmap yet. Reported by: sergey.kozlov@intel.com Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/if_ixlv.c Modified: head/sys/dev/ixl/if_ixlv.c ============================================================================== --- head/sys/dev/ixl/if_ixlv.c Fri Aug 19 23:44:07 2016 (r304509) +++ head/sys/dev/ixl/if_ixlv.c Sat Aug 20 00:08:10 2016 (r304510) @@ -217,6 +217,10 @@ TUNABLE_INT("hw.ixlv.tx_itr", &ixlv_tx_i SYSCTL_INT(_hw_ixlv, OID_AUTO, tx_itr, CTLFLAG_RDTUN, &ixlv_tx_itr, 0, "TX Interrupt Rate"); +/* Fix when building as a standalone module when netmap is enabled */ +#if defined(DEV_NETMAP) && !defined(NETMAP_IXL_MAIN) +int ixl_rx_miss, ixl_rx_miss_bufs, ixl_crcstrip; +#endif /********************************************************************* * Device identification routine From owner-svn-src-all@freebsd.org Sat Aug 20 00:22:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB1E4BBE3A9; Sat, 20 Aug 2016 00:22:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D5991F05; Sat, 20 Aug 2016 00:22:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7K0MdCB077128; Sat, 20 Aug 2016 00:22:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K0Mdwk077127; Sat, 20 Aug 2016 00:22:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608200022.u7K0Mdwk077127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 20 Aug 2016 00:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304511 - in stable: 10/sys/dev/pci 8/sys/dev/pci 9/sys/dev/pci X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 00:22:40 -0000 Author: jhb Date: Sat Aug 20 00:22:39 2016 New Revision: 304511 URL: https://svnweb.freebsd.org/changeset/base/304511 Log: MFC 298950: Fix an off by one error when remapping MSI-X vectors. pci_remap_msix() can be used to alter the mapping of allocated MSI-X vectors to the MSI-X table. The code had an off by one error when adding the IRQ resources after performing a remap. This was fatal for any vectors in the table that used the "last" valid IRQ as those vectors were assigned a garbage IRQ value. Modified: stable/10/sys/dev/pci/pci.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/dev/pci/pci.c stable/9/sys/dev/pci/pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/pci/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Sat Aug 20 00:08:10 2016 (r304510) +++ stable/10/sys/dev/pci/pci.c Sat Aug 20 00:22:39 2016 (r304511) @@ -1744,7 +1744,7 @@ pci_remap_msix_method(device_t dev, devi for (i = 0; i < count; i++) { if (vectors[i] == 0) continue; - irq = msix->msix_vectors[vectors[i]].mv_irq; + irq = msix->msix_vectors[vectors[i] - 1].mv_irq; resource_list_add(&dinfo->resources, SYS_RES_IRQ, i + 1, irq, irq, 1); } @@ -1758,7 +1758,7 @@ pci_remap_msix_method(device_t dev, devi printf("---"); else printf("%d", - msix->msix_vectors[vectors[i]].mv_irq); + msix->msix_vectors[vectors[i] - 1].mv_irq); } printf("\n"); } From owner-svn-src-all@freebsd.org Sat Aug 20 00:22:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF835BBE3AE; Sat, 20 Aug 2016 00:22:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF3331F06; Sat, 20 Aug 2016 00:22:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7K0Mdvk077134; Sat, 20 Aug 2016 00:22:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K0Md9I077133; Sat, 20 Aug 2016 00:22:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608200022.u7K0Md9I077133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 20 Aug 2016 00:22: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: r304511 - in stable: 10/sys/dev/pci 8/sys/dev/pci 9/sys/dev/pci 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 00:22:41 -0000 Author: jhb Date: Sat Aug 20 00:22:39 2016 New Revision: 304511 URL: https://svnweb.freebsd.org/changeset/base/304511 Log: MFC 298950: Fix an off by one error when remapping MSI-X vectors. pci_remap_msix() can be used to alter the mapping of allocated MSI-X vectors to the MSI-X table. The code had an off by one error when adding the IRQ resources after performing a remap. This was fatal for any vectors in the table that used the "last" valid IRQ as those vectors were assigned a garbage IRQ value. Modified: stable/8/sys/dev/pci/pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/pci/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/pci/pci.c stable/9/sys/dev/pci/pci.c Directory Properties: stable/10/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Sat Aug 20 00:08:10 2016 (r304510) +++ stable/8/sys/dev/pci/pci.c Sat Aug 20 00:22:39 2016 (r304511) @@ -1617,7 +1617,7 @@ pci_remap_msix_method(device_t dev, devi for (i = 0; i < count; i++) { if (vectors[i] == 0) continue; - irq = msix->msix_vectors[vectors[i]].mv_irq; + irq = msix->msix_vectors[vectors[i] - 1].mv_irq; resource_list_add(&dinfo->resources, SYS_RES_IRQ, i + 1, irq, irq, 1); } @@ -1631,7 +1631,7 @@ pci_remap_msix_method(device_t dev, devi printf("---"); else printf("%d", - msix->msix_vectors[vectors[i]].mv_irq); + msix->msix_vectors[vectors[i] - 1].mv_irq); } printf("\n"); } From owner-svn-src-all@freebsd.org Sat Aug 20 00:22:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 228A3BBE3B2; Sat, 20 Aug 2016 00:22:41 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E906D1F07; Sat, 20 Aug 2016 00:22:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7K0Me4M077141; Sat, 20 Aug 2016 00:22:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K0MesG077140; Sat, 20 Aug 2016 00:22:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608200022.u7K0MesG077140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 20 Aug 2016 00:22:40 +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: r304511 - in stable: 10/sys/dev/pci 8/sys/dev/pci 9/sys/dev/pci 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 00:22:41 -0000 Author: jhb Date: Sat Aug 20 00:22:39 2016 New Revision: 304511 URL: https://svnweb.freebsd.org/changeset/base/304511 Log: MFC 298950: Fix an off by one error when remapping MSI-X vectors. pci_remap_msix() can be used to alter the mapping of allocated MSI-X vectors to the MSI-X table. The code had an off by one error when adding the IRQ resources after performing a remap. This was fatal for any vectors in the table that used the "last" valid IRQ as those vectors were assigned a garbage IRQ value. Modified: stable/9/sys/dev/pci/pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/pci/pci.c stable/8/sys/dev/pci/pci.c Directory Properties: stable/10/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/pci/ (props changed) Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Sat Aug 20 00:08:10 2016 (r304510) +++ stable/9/sys/dev/pci/pci.c Sat Aug 20 00:22:39 2016 (r304511) @@ -1660,7 +1660,7 @@ pci_remap_msix_method(device_t dev, devi for (i = 0; i < count; i++) { if (vectors[i] == 0) continue; - irq = msix->msix_vectors[vectors[i]].mv_irq; + irq = msix->msix_vectors[vectors[i] - 1].mv_irq; resource_list_add(&dinfo->resources, SYS_RES_IRQ, i + 1, irq, irq, 1); } @@ -1674,7 +1674,7 @@ pci_remap_msix_method(device_t dev, devi printf("---"); else printf("%d", - msix->msix_vectors[vectors[i]].mv_irq); + msix->msix_vectors[vectors[i] - 1].mv_irq); } printf("\n"); } From owner-svn-src-all@freebsd.org Sat Aug 20 00:23:23 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7853FBBE4D4 for ; Sat, 20 Aug 2016 00:23:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A0E0155F; Sat, 20 Aug 2016 00:23:23 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 17E6FB946; Fri, 19 Aug 2016 20:23:22 -0400 (EDT) From: John Baldwin To: Harry Schmalzbauer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r298950 - head/sys/dev/pci Date: Fri, 19 Aug 2016 17:23:17 -0700 Message-ID: <1963910.6LAR4h8U6F@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <57B6A54F.5020505@omnilan.de> References: <201605030035.u430ZBkH006797@repo.freebsd.org> <57B6A54F.5020505@omnilan.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 19 Aug 2016 20:23:22 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 00:23:23 -0000 On Friday, August 19, 2016 08:21:03 AM Harry Schmalzbauer wrote: > Bez=FCglich John Baldwin's Nachricht vom 03.05.2016 02:35 (localtime= ): > > Author: jhb > > Date: Tue May 3 00:35:11 2016 > > New Revision: 298950 > > URL: https://svnweb.freebsd.org/changeset/base/298950 > > > > Log: > > Fix an off by one error when remapping MSI-X vectors. > > =20 > > pci_remap_msix() can be used to alter the mapping of allocated > > MSI-X vectors to the MSI-X table. The code had an off by one err= or > > when adding the IRQ resources after performing a remap. This was= > > fatal for any vectors in the table that used the "last" valid IRQ= as > > those vectors were assigned a garbage IRQ value. > > =20 > > MFC after:=093 days >=20 > Was this superseded by any other merge? > As far as I saw, it's missing in stable/10? Sorry, the reminder somehow got marked as done when it wasn't done yet.= I've merged this back to 8.x and later. Thanks for the reminder! --=20 John Baldwin From owner-svn-src-all@freebsd.org Sat Aug 20 00:34:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10F75BBE6FE; Sat, 20 Aug 2016 00:34:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C897019DC; Sat, 20 Aug 2016 00:34:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7K0YKNC080814; Sat, 20 Aug 2016 00:34:20 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K0YJw4080812; Sat, 20 Aug 2016 00:34:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608200034.u7K0YJw4080812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 20 Aug 2016 00:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304512 - in stable/11: lib/libc/sys sys/kern X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 00:34:21 -0000 Author: bdrewery Date: Sat Aug 20 00:34:19 2016 New Revision: 304512 URL: https://svnweb.freebsd.org/changeset/base/304512 Log: MFC r304288: Garbage collect _umtx_lock(2)/_umtx_unlock(2) references removed in r263318. Modified: stable/11/lib/libc/sys/Symbol.map stable/11/sys/kern/capabilities.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/sys/Symbol.map ============================================================================== --- stable/11/lib/libc/sys/Symbol.map Sat Aug 20 00:22:39 2016 (r304511) +++ stable/11/lib/libc/sys/Symbol.map Sat Aug 20 00:34:19 2016 (r304512) @@ -34,9 +34,7 @@ FBSD_1.0 { __setugid; __syscall; __sysctl; - _umtx_lock; _umtx_op; - _umtx_unlock; abort2; accept; access; @@ -455,12 +453,8 @@ FBSDprivate_1.0 { __sys___syscall; ___sysctl; __sys___sysctl; - __umtx_lock; - __sys__umtx_lock; __umtx_op; __sys__umtx_op; - __umtx_unlock; - __sys__umtx_unlock; _abort2; __sys_abort2; _accept; Modified: stable/11/sys/kern/capabilities.conf ============================================================================== --- stable/11/sys/kern/capabilities.conf Sat Aug 20 00:22:39 2016 (r304511) +++ stable/11/sys/kern/capabilities.conf Sat Aug 20 00:34:19 2016 (r304512) @@ -64,9 +64,7 @@ __sysctl ## ## XXRW: Need to check this very carefully. ## -_umtx_lock _umtx_op -_umtx_unlock ## ## Allow process termination using abort2(2). From owner-svn-src-all@freebsd.org Sat Aug 20 00:38:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 290F9BBE7B8 for ; Sat, 20 Aug 2016 00:38:03 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E7ED11BD2 for ; Sat, 20 Aug 2016 00:38:02 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x233.google.com with SMTP id n128so38922281ith.1 for ; Fri, 19 Aug 2016 17:38:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=NeV5NDPF2NWw9BEr3MvWAbE0xhQTmLnzfsgdif7vQtk=; b=UmKuTHdGTuBO+ZCwqUx6h/8FM3V5v38MZI316e3MbsBA3J3ygUYsK/SCg0PsbG421p FkBOcEh26E4YktlhusQrfftLMaLllmLoxyVoPdf6YnA/ECXyBDjI6hEux5N24cua7oF9 Vm1dRvR7NJboEhwt2xC0+XmOWSFiBkxc4KXiU99jXasVW+eN6iJhJeA68PBzqy5nlnLI pDzGL/ghK2+YK8nhnPs51RuUOx58a+Ej/zjJXtU7d6TYhf2IWAAwhrlISK84lauYHDUm w3idHLTKlpKWW+r4hvhYvG867yjfJWdJ16Imc0gik8fflSHwmgHhxa6KVILtApplgHma dh5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=NeV5NDPF2NWw9BEr3MvWAbE0xhQTmLnzfsgdif7vQtk=; b=V14ABtwW0w4PdVeFq45ZXh6P+vbUdIFPdUGTtJjpoNrUko0gJtoLTMhwKsKASHAQdr 5TCm6osLNPaZQwJkTI6OLeaTNFHMaVUIXvbWaiTcQ9KD8ZuWc9Mw47AIbOPqcper2KzY NTdYAv/KS37ehw8GILlxJ7cSwQvKf4Cyt1W1NNBzFhcuwSnMu1SSPkmd/MMyIdpQU+9F i0KSIx4LJsYctNvl9OsGXFOpFz79PO/LS0Ao+AtSpliGGSViv/3PitXL3KTBfOg8r+1v /3jO1jn3tU6F9Bm7IPEFSHQjPN/eqlBw9YLq9VPlN1HQM0ZAzTnbEtpMjZvTmRAdhb2R +4vQ== X-Gm-Message-State: AEkoousNSOyrEJu1cCtn0tDvoctn+zi8/tTSwL92QAWk0nfsRIF5cBd5F6rfQMEHhz4wtY3yS97x5ucqRRMT5A== X-Received: by 10.36.210.68 with SMTP id z65mr9602383itf.32.1471653482187; Fri, 19 Aug 2016 17:38:02 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Fri, 19 Aug 2016 17:38:01 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: <201608192227.u7JMREIo032684@repo.freebsd.org> References: <201608192227.u7JMREIo032684@repo.freebsd.org> From: Warner Losh Date: Fri, 19 Aug 2016 18:38:01 -0600 X-Google-Sender-Auth: jJKEURcMAKkFIhONyLjeCz-VVlE Message-ID: Subject: Re: svn commit: r304506 - in head: . release/doc/en_US.ISO8859-1/hardware share/man/man4/man4.i386 sys/conf sys/dev/wl sys/i386/conf sys/modules sys/modules/wl targets/pseudo/userland tools/build/mk to... To: John Baldwin Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 00:38:03 -0000 On Fri, Aug 19, 2016 at 4:27 PM, John Baldwin wrote: > Author: jhb > Date: Fri Aug 19 22:27:14 2016 > New Revision: 304506 > URL: https://svnweb.freebsd.org/changeset/base/304506 > > Log: > Remove the wl(4) driver and wlconfig(8) utility. > > The wl(4) driver supports pre-802.11 PCCard wireless adapters that > are slower than 802.11b. They do not work with any of the 802.11 > framework and the driver hasn't been reported to actually work in a > long time. s/PC Card/ISA/g There never were any PC Card wl cards. These cards were ISA only and ran at up to 1Mbps. Warner > Relnotes: yes > > Deleted: > head/share/man/man4/man4.i386/wl.4 > head/sys/dev/wl/ > head/sys/modules/wl/ > head/tools/kerneldoc/subsys/Doxyfile-dev_wl > head/usr.sbin/wlconfig/ > Modified: > head/ObsoleteFiles.inc > head/release/doc/en_US.ISO8859-1/hardware/article.xml > head/share/man/man4/man4.i386/Makefile > head/sys/conf/files > head/sys/conf/options > head/sys/i386/conf/NOTES > head/sys/modules/Makefile > head/targets/pseudo/userland/Makefile.depend > head/tools/build/mk/OptionalObsoleteFiles.inc > head/usr.sbin/Makefile.i386 > > Modified: head/ObsoleteFiles.inc > ============================================================================== > --- head/ObsoleteFiles.inc Fri Aug 19 22:13:01 2016 (r304505) > +++ head/ObsoleteFiles.inc Fri Aug 19 22:27:14 2016 (r304506) > @@ -38,6 +38,10 @@ > # xargs -n1 | sort | uniq -d; > # done > > +# 20160819: Remove wl(4) and wlconfig(8) > +OLD_FILES+=usr/share/man/man4/i386/wl.4.gz > +OLD_FILES+=usr/sbin/wlconfig > +OLD_FILES+=usr/share/man/man8/i386/wlconfig.8.gz > # 20160819: Remove si(4) and sicontrol(8) > OLD_FILES+=usr/share/man/man4/si.4.gz > OLD_FILES+=usr/sbin/sicontrol > > Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml > ============================================================================== > --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 22:13:01 2016 (r304505) > +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri Aug 19 22:27:14 2016 (r304506) > @@ -1023,9 +1023,6 @@ > Intersil PRISM-2.5, Intersil Prism-3, and Symbol Spectrum24 > chipsets (&man.wi.4; driver) > > - [&arch.i386;] NCR / AT&T / Lucent Technologies WaveLan > - T1-speed ISA/radio LAN cards (&man.wl.4; driver) > - > [&arch.i386;, &arch.amd64;] Intel PRO/Wireless 3945ABG > MiniPCI network adapters (&man.wpi.4; driver) > > > Modified: head/share/man/man4/man4.i386/Makefile > ============================================================================== > --- head/share/man/man4/man4.i386/Makefile Fri Aug 19 22:13:01 2016 (r304505) > +++ head/share/man/man4/man4.i386/Makefile Fri Aug 19 22:27:14 2016 (r304506) > @@ -31,8 +31,7 @@ MAN= aic.4 \ > streams.4 \ > svr4.4 \ > vpd.4 \ > - vx.4 \ > - wl.4 > + vx.4 > > MLINKS= CPU_ELAN.4 CPU_SOEKRIS.4 > MLINKS+=pae.4 PAE.4 > > Modified: head/sys/conf/files > ============================================================================== > --- head/sys/conf/files Fri Aug 19 22:13:01 2016 (r304505) > +++ head/sys/conf/files Fri Aug 19 22:27:14 2016 (r304506) > @@ -2933,7 +2933,6 @@ dev/wb/if_wb.c optional wb pci > dev/wi/if_wi.c optional wi > dev/wi/if_wi_pccard.c optional wi pccard > dev/wi/if_wi_pci.c optional wi pci > -dev/wl/if_wl.c optional wl isa > dev/wpi/if_wpi.c optional wpi pci > wpifw.c optional wpifw \ > compile-with "${AWK} -f $S/tools/fw_stub.awk wpi.fw:wpifw:153229 -mwpi -c${.TARGET}" \ > > Modified: head/sys/conf/options > ============================================================================== > --- head/sys/conf/options Fri Aug 19 22:13:01 2016 (r304505) > +++ head/sys/conf/options Fri Aug 19 22:27:14 2016 (r304506) > @@ -218,8 +218,6 @@ SW_WATCHDOG opt_watchdog.h > TURNSTILE_PROFILING > UMTX_PROFILING > VERBOSE_SYSINIT > -WLCACHE opt_wavelan.h > -WLDEBUG opt_wavelan.h > > # POSIX kernel options > P1003_1B_MQUEUE opt_posix.h > > Modified: head/sys/i386/conf/NOTES > ============================================================================== > --- head/sys/i386/conf/NOTES Fri Aug 19 22:13:01 2016 (r304505) > +++ head/sys/i386/conf/NOTES Fri Aug 19 22:27:14 2016 (r304506) > @@ -648,11 +648,6 @@ hint.sbni.0.port="0x210" > hint.sbni.0.irq="0xefdead" > hint.sbni.0.flags="0" > device vmx # VMware VMXNET3 Ethernet > -device wl > -hint.wl.0.at="isa" > -hint.wl.0.port="0x300" > -options WLCACHE # enables the signal-strength cache > -options WLDEBUG # enables verbose debugging output > device wpi # Intel 3945ABG wireless NICs. > > # IEEE 802.11 adapter firmware modules > > Modified: head/sys/modules/Makefile > ============================================================================== > --- head/sys/modules/Makefile Fri Aug 19 22:13:01 2016 (r304505) > +++ head/sys/modules/Makefile Fri Aug 19 22:27:14 2016 (r304506) > @@ -391,7 +391,6 @@ SUBDIR= \ > wb \ > ${_wbwd} \ > ${_wi} \ > - ${_wl} \ > wlan \ > wlan_acl \ > wlan_amrr \ > @@ -728,7 +727,6 @@ _ctau= ctau > .endif > _dpt= dpt > _ex= ex > -_wl= wl > .elif ${MACHINE} == "pc98" > _canbepm= canbepm > _canbus= canbus > > Modified: head/targets/pseudo/userland/Makefile.depend > ============================================================================== > --- head/targets/pseudo/userland/Makefile.depend Fri Aug 19 22:13:01 2016 (r304505) > +++ head/targets/pseudo/userland/Makefile.depend Fri Aug 19 22:27:14 2016 (r304506) > @@ -865,8 +865,7 @@ DIRDEPS.i386= \ > usr.sbin/spkrtest \ > usr.sbin/zzz \ > usr.sbin/acpi \ > - usr.sbin/boot0cfg \ > - usr.sbin/wlconfig > + usr.sbin/boot0cfg > > DIRDEPS.arm64= \ > usr.sbin/acpi \ > > Modified: head/tools/build/mk/OptionalObsoleteFiles.inc > ============================================================================== > --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri Aug 19 22:13:01 2016 (r304505) > +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri Aug 19 22:27:14 2016 (r304506) > @@ -8744,9 +8744,6 @@ OLD_FILES+=usr/sbin/hostapd > OLD_FILES+=usr/sbin/hostapd_cli > OLD_FILES+=usr/sbin/ndis_events > OLD_FILES+=usr/sbin/wlandebug > -.if ${TARGET_ARCH} == "i386" > -OLD_FILES+=usr/sbin/wlconfig > -.endif > OLD_FILES+=usr/sbin/wpa_cli > OLD_FILES+=usr/sbin/wpa_passphrase > OLD_FILES+=usr/sbin/wpa_supplicant > @@ -8761,9 +8758,6 @@ OLD_FILES+=usr/share/man/man5/wpa_suppli > OLD_FILES+=usr/share/man/man8/ancontrol.8.gz > OLD_FILES+=usr/share/man/man8/hostapd.8.gz > OLD_FILES+=usr/share/man/man8/hostapd_cli.8.gz > -.if ${TARGET_ARCH} == "i386" > -OLD_FILES+=usr/share/man/man8/i386/wlconfig.8.gz > -.endif > OLD_FILES+=usr/share/man/man8/ndis_events.8.gz > OLD_FILES+=usr/share/man/man8/wlandebug.8.gz > OLD_FILES+=usr/share/man/man8/wpa_cli.8.gz > > Modified: head/usr.sbin/Makefile.i386 > ============================================================================== > --- head/usr.sbin/Makefile.i386 Fri Aug 19 22:13:01 2016 (r304505) > +++ head/usr.sbin/Makefile.i386 Fri Aug 19 22:27:14 2016 (r304506) > @@ -29,9 +29,6 @@ SUBDIR+= boot0cfg > .if ${MK_HYPERV} != "no" > SUBDIR+= hyperv > .endif > -.if ${MK_WIRELESS} != "no" > -SUBDIR+= wlconfig > -.endif > .elif ${MACHINE} == "pc98" > SUBDIR+= boot98cfg > .endif > From owner-svn-src-all@freebsd.org Sat Aug 20 00:49:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B320BBEA04; Sat, 20 Aug 2016 00:49:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7915A1199; Sat, 20 Aug 2016 00:49:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7K0nUaT084691; Sat, 20 Aug 2016 00:49:30 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K0nUYd084685; Sat, 20 Aug 2016 00:49:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201608200049.u7K0nUYd084685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 20 Aug 2016 00:49:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304513 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/ie sys/i386/conf sys/modules sys/modules/ie sys/pc98/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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 00:49:31 -0000 Author: jhb Date: Sat Aug 20 00:49:29 2016 New Revision: 304513 URL: https://svnweb.freebsd.org/changeset/base/304513 Log: Remove the ie(4) driver for Intel 82586 ISA Ethernet adapters. This driver only supports 10Mb Ethernet using PIO (the hardware supports DMA, but the driver only does PIO). There are not any PCCard adapters supported by this driver, only ISA cards. In addition, it does not use bus_space but instead uses bcopy with volatile pointers triggering a host of warnings. (if_ie.c is one of 3 files always built with -Wno-error) Relnotes: yes Deleted: head/share/man/man4/man4.i386/ie.4 head/sys/dev/ie/ head/sys/modules/ie/ Modified: head/ObsoleteFiles.inc head/share/man/man4/man4.i386/Makefile head/sys/conf/files head/sys/i386/conf/NOTES head/sys/modules/Makefile head/sys/pc98/conf/NOTES Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Aug 20 00:34:19 2016 (r304512) +++ head/ObsoleteFiles.inc Sat Aug 20 00:49:29 2016 (r304513) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160819: Remove ie(4) +OLD_FILES+=usr/share/man/man4/i386/ie.4.gz # 20160819: Remove spic(4) OLD_FILES+=usr/share/man/man4/spic.4.gz # 20160819: Remove wl(4) and wlconfig(8) Modified: head/share/man/man4/man4.i386/Makefile ============================================================================== --- head/share/man/man4/man4.i386/Makefile Sat Aug 20 00:34:19 2016 (r304512) +++ head/share/man/man4/man4.i386/Makefile Sat Aug 20 00:49:29 2016 (r304513) @@ -16,7 +16,6 @@ MAN= aic.4 \ fe.4 \ glxiic.4 \ glxsb.4 \ - ie.4 \ longrun.4 \ mse.4 \ npx.4 \ Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Aug 20 00:34:19 2016 (r304512) +++ head/sys/conf/files Sat Aug 20 00:49:29 2016 (r304513) @@ -1579,8 +1579,6 @@ dev/ida/ida.c optional ida dev/ida/ida_disk.c optional ida dev/ida/ida_eisa.c optional ida eisa dev/ida/ida_pci.c optional ida pci -dev/ie/if_ie.c optional ie isa nowerror -dev/ie/if_ie_isa.c optional ie isa dev/iicbus/ad7418.c optional ad7418 dev/iicbus/ds1307.c optional ds1307 dev/iicbus/ds133x.c optional ds133x Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Sat Aug 20 00:34:19 2016 (r304512) +++ head/sys/i386/conf/NOTES Sat Aug 20 00:49:29 2016 (r304513) @@ -624,12 +624,6 @@ hint.ed.0.at="isa" hint.ed.0.port="0x280" hint.ed.0.irq="5" hint.ed.0.maddr="0xd8000" -device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc. -# Hints only required for Starlan -hint.ie.2.at="isa" -hint.ie.2.port="0x300" -hint.ie.2.irq="5" -hint.ie.2.maddr="0xd0000" device ipw # Intel 2100 wireless NICs. device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. device iwn # Intel 4965/1000/5000/6000 wireless NICs. Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sat Aug 20 00:34:19 2016 (r304512) +++ head/sys/modules/Makefile Sat Aug 20 00:49:29 2016 (r304513) @@ -141,7 +141,6 @@ SUBDIR= \ ${_ibcs2} \ ${_ichwd} \ ${_ida} \ - ${_ie} \ if_bridge \ if_disc \ if_edsc \ @@ -705,7 +704,6 @@ _elink= elink _glxiic= glxiic _glxsb= glxsb #_ibcs2= ibcs2 -_ie= ie _mse= mse _ncr= ncr _ncv= ncv Modified: head/sys/pc98/conf/NOTES ============================================================================== --- head/sys/pc98/conf/NOTES Sat Aug 20 00:34:19 2016 (r304512) +++ head/sys/pc98/conf/NOTES Sat Aug 20 00:49:29 2016 (r304513) @@ -390,11 +390,6 @@ hint.ed.0.at="isa" hint.ed.0.port="0x280" hint.ed.0.irq="5" hint.ed.0.maddr="0xd8000" -device ie # Hints only required for Starlan -hint.ie.2.at="isa" -hint.ie.2.port="0x300" -hint.ie.2.irq="5" -hint.ie.2.maddr="0xd0000" #device le # Hint for the PC98-only C-NET(98)S C-bus front-end of le(4). hint.le.0.at="isa" From owner-svn-src-all@freebsd.org Sat Aug 20 00:56:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F372BBEBD6; Sat, 20 Aug 2016 00:56:00 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C29A415A1; Sat, 20 Aug 2016 00:55:59 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7K0twjY088184; Sat, 20 Aug 2016 00:55:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K0twMd088183; Sat, 20 Aug 2016 00:55:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201608200055.u7K0twMd088183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 20 Aug 2016 00:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304514 - head/sys/powerpc/booke 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 00:56:00 -0000 Author: jhibbits Date: Sat Aug 20 00:55:58 2016 New Revision: 304514 URL: https://svnweb.freebsd.org/changeset/base/304514 Log: Skip HID1 initialization on e6500 cores, it doesn't exist. With this, and some drivers removed, a T2080 dev board boots to mountroot. Submitted by: Ivan Krivonos Modified: head/sys/powerpc/booke/locore.S Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Sat Aug 20 00:49:29 2016 (r304513) +++ head/sys/powerpc/booke/locore.S Sat Aug 20 00:55:58 2016 (r304514) @@ -140,6 +140,8 @@ __start: beq 1f cmpli 0, 0, %r3, FSL_E5500 beq 1f + cmpli 0, 0, %r3, FSL_E6500 + beq 1f lis %r3, HID1_E500_DEFAULT_SET@h ori %r3, %r3, HID1_E500_DEFAULT_SET@l From owner-svn-src-all@freebsd.org Sat Aug 20 02:07:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45E03BC0251; Sat, 20 Aug 2016 02:07:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 15F2816E7; Sat, 20 Aug 2016 02:07:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7K270W4014278; Sat, 20 Aug 2016 02:07:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K26xuB014264; Sat, 20 Aug 2016 02:06:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608200206.u7K26xuB014264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 20 Aug 2016 02:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304515 - in stable/11: contrib/openresolv sbin/resolvconf X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 02:07:01 -0000 Author: pfg Date: Sat Aug 20 02:06:59 2016 New Revision: 304515 URL: https://svnweb.freebsd.org/changeset/base/304515 Log: MFC r303062, r303567, r303593: MFV r298167, r300962, r303048: openresolv(8): update to version 3.8.1. Among the new features it attempts to support alternative init systems. Modified: stable/11/contrib/openresolv/Makefile stable/11/contrib/openresolv/configure stable/11/contrib/openresolv/dnsmasq.in stable/11/contrib/openresolv/libc.in stable/11/contrib/openresolv/named.in stable/11/contrib/openresolv/resolvconf.8.in stable/11/contrib/openresolv/resolvconf.conf.5.in stable/11/contrib/openresolv/resolvconf.in stable/11/contrib/openresolv/unbound.in stable/11/sbin/resolvconf/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/openresolv/Makefile ============================================================================== --- stable/11/contrib/openresolv/Makefile Sat Aug 20 00:55:58 2016 (r304514) +++ stable/11/contrib/openresolv/Makefile Sat Aug 20 02:06:59 2016 (r304515) @@ -1,5 +1,4 @@ PKG= openresolv -VERSION= 3.7.3 # Nasty hack so that make clean works without configure being run _CONFIG_MK!= test -e config.mk && echo config.mk || echo config-null.mk @@ -10,14 +9,12 @@ SBINDIR?= /sbin SYSCONFDIR?= /etc LIBEXECDIR?= /libexec/resolvconf VARDIR?= /var/run/resolvconf -RCDIR?= /etc/rc.d -RESTARTCMD?= if ${RCDIR}/\1 status >/dev/null 2>\&1; then \ - ${RCDIR}/\1 restart; \ - fi INSTALL?= install SED?= sed +VERSION!= ${SED} -n 's/OPENRESOLV_VERSION="\(.*\)".*/\1/p' resolvconf.in + BINMODE?= 0755 DOCMODE?= 0644 MANMODE?= 0444 @@ -33,7 +30,9 @@ SED_SYSCONFDIR= -e 's:@SYSCONFDIR@:${SY SED_LIBEXECDIR= -e 's:@LIBEXECDIR@:${LIBEXECDIR}:g' SED_VARDIR= -e 's:@VARDIR@:${VARDIR}:g' SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g' -SED_RESTARTCMD= -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g' +SED_RESTARTCMD= -e 's:@RESTARTCMD@:${RESTARTCMD}:g' +SED_RCDIR= -e 's:@RCDIR@:${RCDIR}:g' +SED_STATUSARG= -e 's:@STATUSARG@:${STATUSARG}:g' DISTPREFIX?= ${PKG}-${VERSION} DISTFILEGZ?= ${DISTPREFIX}.tar.gz @@ -44,9 +43,10 @@ FOSSILID?= current all: ${TARGET} -.in: +.in: Makefile ${CONFIG_MK} ${SED} ${SED_SBINDIR} ${SED_SYSCONFDIR} ${SED_LIBEXECDIR} \ - ${SED_VARDIR} ${SED_RCDIR} ${SED_RESTARTCMD} \ + ${SED_VARDIR} \ + ${SED_RCDIR} ${SED_RESTARTCMD} ${SED_RCDIR} ${SED_STATUSARG} \ $< > $@ clean: Modified: stable/11/contrib/openresolv/configure ============================================================================== --- stable/11/contrib/openresolv/configure Sat Aug 20 00:55:58 2016 (r304514) +++ stable/11/contrib/openresolv/configure Sat Aug 20 02:06:59 2016 (r304515) @@ -8,6 +8,7 @@ HOST= TARGET= RESTARTCMD= RCDIR= +STATUSARG= for x do opt=${x%%=*} @@ -33,6 +34,8 @@ for x do --target) TARGET=$var;; --libdir) LIBDIR=$var;; --restartcmd) RESTARTCMD=$var;; + --rcdir) RCDIR=$var;; + --statusarg) STATUSARG=$var;; --includedir) eval INCLUDEDIR="$INCLUDEDIR${INCLUDEDIR:+ }$var";; --datadir|--infodir) ;; # ignore autotools --disable-maintainer-mode|--disable-dependency-tracking) ;; @@ -117,7 +120,17 @@ echo "Configuring openresolv for ... $OS rm -rf $CONFIG_MK echo "# $OS" >$CONFIG_MK -for x in SYSCONFDIR SBINDIR LIBEXECDIR VARDIR MANDIR; do +# On FreeBSD, /etc/init.d/foo status returns 0 if foo is not enabled +# regardless of if it's not running. +# So we force onestatus to work around this silly bug. +if [ -z "$STATUSARG" ]; then + case "$OS" in + freebsd*) STATUSARG="onestatus";; + esac +fi + +for x in SYSCONFDIR SBINDIR LIBEXECDIR VARDIR MANDIR RESTARTCMD RCDIR STATUSARG +do eval v=\$$x # Make files look nice for import l=$((10 - ${#x})) @@ -126,96 +139,6 @@ for x in SYSCONFDIR SBINDIR LIBEXECDIR V echo "$x=$t $v" >>$CONFIG_MK done -if [ -z "$RESTARTCMD" ]; then - printf "Checking for systemd ... " - if [ -x /bin/systemctl ]; then - RESTARTCMD="/bin/systemctl try-restart \1" - echo "yes" - elif [ -x /usr/bin/systemctl ]; then - RESTARTCMD="/usr/bin/systemctl try-restart \1" - echo "yes" - else - echo "no" - fi -fi - -# Arch upgraded to systemd, so this check has to be just after systemd -# but higher than the others -if [ -z "$RESTARTCMD" ]; then - printf "Checking for Arch ... " - if [ -e /etc/arch-release -a -d /etc/rc.d ]; then - RCDIR=/etc/rc.d - RESTARTCMD="[ -e /var/run/daemons/\1 ] \&\& /etc/rc.d/\1 restart" - echo "yes" - else - echo "no" - fi -fi - -if [ -z "$RESTARTCMD" ]; then - printf "Checking for OpenRC ... " - if [ -x /sbin/rc-service ]; then - RESTARTCMD="if /sbin/rc-service -e \1; then /sbin/rc-service \1 -- -Ds restart; fi" - echo "yes" - else - echo "no" - fi -fi -if [ -z "$RESTARTCMD" ]; then - printf "Checking for invoke-rc.d ... " - if [ -x /usr/sbin/invoke-rc.d ]; then - RCDIR=/etc/init.d - RESTARTCMD="if /usr/sbin/invoke-rc.d --quiet \1 status >/dev/null 2>\&1; then /usr/sbin/invoke-rc.d \1 restart; fi" - echo "yes" - else - echo "no" - fi -fi -if [ -z "$RESTARTCMD" ]; then - printf "Checking for service ... " - if [ -x /sbin/service ]; then - RCDIR=/etc/init.d - RESTARTCMD="if /sbin/service \1; then /sbin/service \1 restart; fi" - echo "yes" - else - echo "no" - fi -fi -if [ -z "$RESTARTCMD" ]; then - printf "Checking for runit... " - if [ -x /bin/sv ]; then - RESTARTCMD="/bin/sv try-restart \1" - echo "yes" - elif [ -x /usr/bin/sv ]; then - RESTARTCMD="/usr/bin/sv try-restart \1" - echo "yes" - else - echo "no" - fi -fi -if [ -z "$RESTARTCMD" ]; then - for x in /etc/init.d/rc.d /etc/rc.d /etc/init.d; do - printf "Checking for $x ... " - if [ -d $x ]; then - RCDIR=$x - RESTARTCMD="if $x/\1 status >/dev/null 2>\&1; then $x/\1 restart; fi" - echo "yes" - break - else - echo "no" - fi - done -fi - -if [ -z "$RESTARTCMD" ]; then - echo "$0: WARNING: No means of interacting with system services detected!" - exit 1 -fi - -echo "RCDIR= $RCDIR" >>$CONFIG_MK -# Work around bug in the dash shell as "echo 'foo \1'" does bad things -printf "%s\n" "RESTARTCMD= $RESTARTCMD" >>$CONFIG_MK - echo echo " SYSCONFDIR = $SYSCONFDIR" echo " SBINDIR = $SBINDIR" @@ -223,3 +146,7 @@ echo " LIBEXECDIR = $LIBEXECDIR" echo " VARDIR = $RUNDIR" echo " MANDIR = $MANDIR" echo +echo " RESTARTCMD = $RESTARTCMD" +echo " RCDIR = $RCDIR" +echo " STATUSARG = $STATUSARG" +echo Modified: stable/11/contrib/openresolv/dnsmasq.in ============================================================================== --- stable/11/contrib/openresolv/dnsmasq.in Sat Aug 20 00:55:58 2016 (r304514) +++ stable/11/contrib/openresolv/dnsmasq.in Sat Aug 20 02:06:59 2016 (r304515) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2012 Roy Marples +# Copyright (c) 2007-2016 Roy Marples # All rights reserved # dnsmasq subscriber for resolvconf @@ -37,7 +37,6 @@ NL=" [ -s "$dnsmasq_pid" ] || dnsmasq_pid=/var/run/dnsmasq/dnsmasq.pid [ -s "$dnsmasq_pid" ] || unset dnsmasq_pid : ${dnsmasq_service:=dnsmasq} -: ${dnsmasq_restart:=@RESTARTCMD ${dnsmasq_service}@} newconf="# Generated by resolvconf$NL" newresolv="$newconf" @@ -180,7 +179,15 @@ if [ -n "$dnsmasq_resolv" ]; then fi if $changed; then - eval $dnsmasq_restart + # dnsmasq does not re-read the configuration file on SIGHUP + if [ -n "$dnsmasq_restart" ]; then + eval $dnsmasq_restart + elif [ -n "$RESTARTCMD" ]; then + set -- ${dnsmasq_service} + eval $RESTARTCMD + else + @SBINDIR@/resolvconf -r ${dnsmasq_service} + fi fi if $dbus; then if [ -s "$dnsmasq_pid" ]; then Modified: stable/11/contrib/openresolv/libc.in ============================================================================== --- stable/11/contrib/openresolv/libc.in Sat Aug 20 00:55:58 2016 (r304514) +++ stable/11/contrib/openresolv/libc.in Sat Aug 20 02:06:59 2016 (r304515) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2014 Roy Marples +# Copyright (c) 2007-2016 Roy Marples # All rights reserved # libc subscriber for resolvconf @@ -97,7 +97,6 @@ elif [ -d "$SYSCONFDIR"/resolvconf ]; th fi : ${resolv_conf:=/etc/resolv.conf} : ${libc_service:=nscd} -: ${libc_restart:=@RESTARTCMD ${libc_service}@} : ${list_resolv:=@SBINDIR@/resolvconf -l} if [ "${resolv_conf_head-x}" = x -a -f "$SYSCONFDIR"/resolv.conf.head ]; then resolv_conf_head="$(cat "${SYSCONFDIR}"/resolv.conf.head)" @@ -229,7 +228,14 @@ fi # Create our resolv.conf now (umask 022; echo "$newconf" >"$resolv_conf") -eval $libc_restart +if [ -n "$libc_restart" ]; then + eval $libc_restart +elif [ -n "$RESTARTCMD" ]; then + set -- ${libc_service} + eval $RESTARTCMD +else + @SBINDIR@/resolvconf -r ${libc_service} +fi retval=0 # Notify users of the resolver Modified: stable/11/contrib/openresolv/named.in ============================================================================== --- stable/11/contrib/openresolv/named.in Sat Aug 20 00:55:58 2016 (r304514) +++ stable/11/contrib/openresolv/named.in Sat Aug 20 02:06:59 2016 (r304515) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2007-2012 Roy Marples +# Copyright (c) 2007-2016 Roy Marples # All rights reserved # named subscriber for resolvconf @@ -35,18 +35,22 @@ NL=" # Platform specific kludges if [ -z "$named_service" -a -z "$named_restart" -a \ - -d "@RCDIR@" -a ! -x "@RCDIR@"/named ] + -d "$RCDIR" -a ! -x "$RCDIR"/named ] then - if [ -x "@RCDIR@"/bind9 ]; then + if [ -x "$RCDIR"/bind9 ]; then # Debian and derivatives named_service=bind9 - elif [ -x "@RCDIR@"/rc.bind ]; then + elif [ -x "$RCDIR"/rc.bind ]; then # Slackware named_service=rc.bind fi fi : ${named_service:=named} -: ${named_restart:=@RESTARTCMD ${named_service}@} + +: ${named_pid:=/var/run/$named_service.pid} +[ -s "$named_pid" ] || named_pid=/var/run/$named_service/$named_service.pid +[ -s "$named_pid" ] || unset named_pid + newoptions="# Generated by resolvconf$NL" newzones="$newoptions" @@ -101,6 +105,14 @@ if [ -n "$named_zones" ]; then fi fi +# named does not seem to work with SIGHUP which is a same if $changed; then - eval $named_restart + if [ -n "$named_restart" ]; then + eval $named_restart + elif [ -n "$RESTARTCMD" ]; then + set -- ${named_service} + eval $RESTARTCMD + else + @SBINDIR@/resolvconf -r ${named_service} + fi fi Modified: stable/11/contrib/openresolv/resolvconf.8.in ============================================================================== --- stable/11/contrib/openresolv/resolvconf.8.in Sat Aug 20 00:55:58 2016 (r304514) +++ stable/11/contrib/openresolv/resolvconf.8.in Sat Aug 20 02:06:59 2016 (r304515) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2007-2015 Roy Marples +.\" Copyright (c) 2007-2016 Roy Marples .\" All rights reserved .\" .\" Redistribution and use in source and binary forms, with or without @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 27, 2015 +.Dd May 7, 2016 .Dt RESOLVCONF 8 .Os .Sh NAME @@ -64,7 +64,7 @@ solves this by letting the daemon send t file to .Nm via -.Xr stdin 3 +.Xr stdin 4 with the argument .Fl a Ar interface Ns Op Ar .protocol instead of the filesystem. @@ -101,7 +101,7 @@ as private. This means that the name servers listed in that .Pa resolv.conf are only used for queries against the domain/search listed in the same file. -This only works when a local resolver other than libc is installed. +This only works when a local resolver other than libc is installed. See .Xr resolvconf.conf 5 for how to configure @@ -125,24 +125,28 @@ file(s) for all the on the .Ar interface . .Pp -Here are some more options that -.Nm -has:- +Here are some options for the above commands:- .Bl -tag -width indent -.It Fl I -Initialise the state directory -.Pa @VARDIR@ . -This only needs to be called if the initial system boot sequence does not -automatically clean it out; for example the state directory is moved -somewhere other than -.Pa /var/run . -If used, it should only be called once as early in the system boot sequence -as possible and before -.Nm -is used to add interfaces. .It Fl f -Ignore non existant interfaces. +Ignore non existent interfaces. Only really useful for deleting interfaces. +.It Fl m Ar metric +Set the metric of the interface when adding it, default of 0. +Lower metrics take precedence. +This affects the default order of interfaces when listed. +.It Fl p +Marks the interface +.Pa resolv.conf +as private. +.It Fl x +Mark the interface +.Pa resolv.conf +as exclusive when adding, otherwise only use the latest exclusive interface. +.El +.Pp +.Nm +has some more commands for general usage:- +.Bl -tag -width indent .It Fl i Ar pattern List the interfaces and protocols, optionally matching .Ar pattern , @@ -157,14 +161,6 @@ If .Ar pattern is specified then we list the files for the interfaces and protocols that match it. -.It Fl m Ar metric -Set the metric of the interface when adding it, default of 0. -Lower metrics take precedence. -This affects the default order of interfaces when listed. -.It Fl p -Marks the interface -.Pa resolv.conf -as private. .It Fl u Force .Nm @@ -172,15 +168,31 @@ to update all its subscribers. .Nm does not update the subscribers when adding a resolv.conf that matches what it already has for that interface. -.It Fl x -Mark the interface -.Pa resolv.conf -as exclusive when adding, otherwise only use the latest exclusive interface. .El .Pp .Nm -also has some options designed to be used by its subscribers:- +also has some commands designed to be used by it's subscribers and +system startup:- .Bl -tag -width indent +.It Fl I +Initialise the state directory +.Pa @VARDIR@ . +This only needs to be called if the initial system boot sequence does not +automatically clean it out; for example the state directory is moved +somewhere other than +.Pa /var/run . +If used, it should only be called once as early in the system boot sequence +as possible and before +.Nm +is used to add interfaces. +.It Fl R +Echo the command used to restart a service. +.It Fl r Ar service +If the +.Ar service +is running then restart it. +If the service does not exist or is not running then zero is returned, +otherwise the result of restarting the service. .It Fl v Echo variables DOMAINS, SEARCH and NAMESERVERS so that the subscriber can configure the resolver easily. @@ -278,16 +290,16 @@ Directory of subscribers which are run a State directory for .Nm . .El +.Sh SEE ALSO +.Xr resolver 3 , +.Xr stdin 4 , +.Xr resolv.conf 5 , +.Xr resolvconf.conf 5 .Sh HISTORY This implementation of .Nm is called openresolv and is fully command line compatible with Debian's resolvconf, as written by Thomas Hood. -.Sh SEE ALSO -.Xr resolv.conf 5 , -.Xr resolvconf.conf 5 , -.Xr resolver 3 , -.Xr stdin 3 .Sh AUTHORS .An Roy Marples Aq Mt roy@marples.name .Sh BUGS Modified: stable/11/contrib/openresolv/resolvconf.conf.5.in ============================================================================== --- stable/11/contrib/openresolv/resolvconf.conf.5.in Sat Aug 20 00:55:58 2016 (r304514) +++ stable/11/contrib/openresolv/resolvconf.conf.5.in Sat Aug 20 02:06:59 2016 (r304515) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd February 21, 2016 +.Dd April 28, 2016 .Dt RESOLVCONF.CONF 5 .Os .Sh NAME @@ -103,7 +103,8 @@ This is equivalent to the .Nm resolvconf -p option. .It Sy replace -Is a space separated list of replacement keywords. The syntax is this: +Is a space separated list of replacement keywords. +The syntax is this: .Va $keyword Ns / Ns Va $match Ns / Ns Va $replacement .Pp Example, given this resolv.conf: @@ -284,33 +285,32 @@ variables, documented below. .Pp .Bl -tag -width indent .It Sy dnsmasq_service -Location of the dnsmasq service. +Name of the dnsmasq service. .It Sy dnsmasq_restart Command to restart the dnsmasq service. .It Sy dnsmasq_pid Location of the dnsmasq pidfile. .It Sy libc_service -Location of the libc service. +Name of the libc service. .It Sy libc_restart Command to restart the libc service. .It Sy named_service -Location of the named service. +Name of the named service. .It Sy named_restart Command to restart the named service. .It Sy pdnsd_restart Command to restart the pdnsd service. .It Sy unbound_service -Location of the unbound service. +Name of the unbound service. .It Sy unbound_restart Command to restart the unbound service. .It Sy unbound_pid Location of the unbound pidfile. .El .Sh SEE ALSO +.Xr sh 1 , .Xr resolv.conf 5 , .Xr resolvconf 8 -and -.Xr sh 1 . .Sh AUTHORS .An Roy Marples Aq Mt roy@marples.name .Sh BUGS Modified: stable/11/contrib/openresolv/resolvconf.in ============================================================================== --- stable/11/contrib/openresolv/resolvconf.in Sat Aug 20 00:55:58 2016 (r304514) +++ stable/11/contrib/openresolv/resolvconf.in Sat Aug 20 02:06:59 2016 (r304515) @@ -25,9 +25,12 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. RESOLVCONF="$0" +OPENRESOLV_VERSION="3.8.1" SYSCONFDIR=@SYSCONFDIR@ LIBEXECDIR=@LIBEXECDIR@ VARDIR=@VARDIR@ +RCDIR=@RCDIR@ +RESTARTCMD=@RESTARTCMD@ # Disregard dhcpcd setting unset interface_order state_dir @@ -71,55 +74,45 @@ error_exit() usage() { cat <<-EOF - Usage: ${RESOLVCONF##*/} [options] + Usage: ${RESOLVCONF##*/} [options] command [argument] Inform the system about any DNS updates. - Options: + Commands: -a \$INTERFACE Add DNS information to the specified interface (DNS supplied via stdin in resolv.conf format) - -m metric Give the added DNS information a metric - -p Mark the interface as private - -x Mark the interface as exclusive -d \$INTERFACE Delete DNS information from the specified interface - -f Ignore non existant interfaces - -I Init the state dir - -u Run updates from our current DNS information - -l [\$PATTERN] Show DNS information, optionally from interfaces - that match the specified pattern + -h Show this help cruft -i [\$PATTERN] Show interfaces that have supplied DNS information optionally from interfaces that match the specified pattern + -l [\$PATTERN] Show DNS information, optionally from interfaces + that match the specified pattern + + -u Run updates from our current DNS information + + Options: + -f Ignore non existent interfaces + -m metric Give the added DNS information a metric + -p Mark the interface as private + -x Mark the interface as exclusive + + Subscriber and System Init Commands: + -I Init the state dir + -r \$SERVICE Restart the system service + (restarting a non-existent or non-running service + should have no output and return 0) + -R Show the system service restart command -v [\$PATTERN] echo NEWDOMAIN, NEWSEARCH and NEWNS variables to the console - -h Show this help cruft + -V [\$PATTERN] Same as -v, but only uses configuration in + $SYSCONFDIR/resolvconf.conf EOF [ -z "$1" ] && exit 0 echo error_exit "$*" } -echo_resolv() -{ - local line= OIFS="$IFS" - - [ -n "$1" -a -f "$IFACEDIR/$1" ] || return 1 - echo "# resolv.conf from $1" - # Our variable maker works of the fact each resolv.conf per interface - # is separated by blank lines. - # So we remove them when echoing them. - while read -r line; do - IFS="$OIFS" - if [ -n "$line" ]; then - # We need to set IFS here to preserve any whitespace - IFS='' - printf "%s\n" "$line" - fi - done < "$IFACEDIR/$1" - echo - IFS="$OIFS" -} - # Strip any trailing dot from each name as a FQDN does not belong # in resolv.conf(5) # If you think otherwise, capture a DNS trace and you'll see libc @@ -159,7 +152,10 @@ parse_resolv() private=false for p in $private_interfaces; do case "$iface" in - "$p"|"$p":*) private=true; break;; + "$p"|"$p":*) + private=true + break + ;; esac done fi @@ -261,6 +257,108 @@ config_mkdirs() return $e } +# With the advent of alternative init systems, it's possible to have +# more than one installed. So we need to try and guess what one we're +# using unless overriden by configure. +# Note that restarting a service is a last resort - the subscribers +# should make a reasonable attempt to reconfigre the service via some +# method, normally SIGHUP. +detect_init() +{ + [ -n "$RESTARTCMD" ] && return 0 + + # Detect the running init system. + # As systemd and OpenRC can be installed on top of legacy init + # systems we try to detect them first. + local status="@STATUSARG@" + : ${status:=status} + if [ -x /bin/systemctl -a -S /run/systemd/private ]; then + RESTARTCMD="if /bin/systemctl --quiet is-active \$1.service; then + /bin/systemctl restart \$1.service; +fi" + elif [ -x /usr/bin/systemctl -a -S /run/systemd/private ]; then + RESTARTCMD="if /usr/bin/systemctl --quiet is-active \$1.service; then + /usr/bin/systemctl restart \$1.service; +fi" + elif [ -x /sbin/rc-service -a \ + -s /libexec/rc/init.d/softlevel -o -s /run/openrc/softlevel ] + then + RESTARTCMD="/sbin/rc-service -i \$1 -- -Ds restart" + elif [ -x /usr/sbin/invoke-rc.d ]; then + RCDIR=/etc/init.d + RESTARTCMD="if /usr/sbin/invoke-rc.d --quiet \$1 status 1>/dev/null 2>&1; then + /usr/sbin/invoke-rc.d \$1 restart; +fi" + elif [ -x /sbin/service ]; then + # Old RedHat + RCDIR=/etc/init.d + RESTARTCMD="if /sbin/service \$1; then + /sbin/service \$1 restart; +fi" + elif [ -x /usr/sbin/service ]; then + # Could be FreeBSD + RESTARTCMD="if /usr/sbin/service \$1 $status 1>/dev/null 2>&1; then + /usr/sbin/service \$1 restart; +fi" + elif [ -x /bin/sv ]; then + RESTARTCMD="/bin/sv try-restart \$1" + elif [ -x /usr/bin/sv ]; then + RESTARTCMD="/usr/bin/sv try-restart \$1" + elif [ -e /etc/arch-release -a -d /etc/rc.d ]; then + RCDIR=/etc/rc.d + RESTARTCMD="if [ -e /var/run/daemons/\$1 ]; then + /etc/rc.d/\$1 restart; +fi" + elif [ -e /etc/slackware-version -a -d /etc/rc.d ]; then + RESTARTCMD="if /etc/rc.d/rc.\$1 status 1>/dev/null 2>&1; then + /etc/rc.d/rc.\$1 restart; +fi" + elif [ -e /etc/rc.d/rc.subr -a -d /etc/rc.d ]; then + # OpenBSD + RESTARTCMD="if /etc/rc.d/\$1 check 1>/dev/null 2>&1; then + /etc/rc.d/\$1 restart; +fi" + else + for x in /etc/init.d/rc.d /etc/rc.d /etc/init.d; do + [ -d $x ] || continue + RESTARTCMD="if $x/\$1 $status 1>/dev/null 2>&1; then + $x/\$1 restart; +fi" + break + done + fi + + if [ -z "$RESTARTCMD" ]; then + if [ "$NOINIT_WARNED" != true ]; then + warn "could not detect a useable init system" + _NOINIT_WARNED=true + fi + return 1 + fi + _NOINIT_WARNED= + return 0 +} + +echo_resolv() +{ + local line= OIFS="$IFS" + + [ -n "$1" -a -f "$IFACEDIR/$1" ] || return 1 + echo "# resolv.conf from $1" + # Our variable maker works of the fact each resolv.conf per interface + # is separated by blank lines. + # So we remove them when echoing them. + while read -r line; do + IFS="$OIFS" + if [ -n "$line" ]; then + # We need to set IFS here to preserve any whitespace + IFS='' + printf "%s\n" "$line" + fi + done < "$IFACEDIR/$1" + IFS="$OIFS" +} + list_resolv() { [ -d "$IFACEDIR" ] || return 0 @@ -320,6 +418,7 @@ list_resolv() cd "$IFACEDIR" retval=1 + excl=true for i in $(uniqify $list); do # Only list interfaces which we really have if ! [ -f "$i" ]; then @@ -334,6 +433,7 @@ list_resolv() printf %s "$i " else echo_resolv "$i" + echo fi [ $? = 0 -a "$retval" = 1 ] && retval=0 done @@ -499,7 +599,7 @@ make_vars() force=false VFLAG= -while getopts a:Dd:fhIilm:puvVx OPT; do +while getopts a:Dd:fhIilm:pRruvVx OPT; do case "$OPT" in f) force=true;; h) usage;; @@ -541,6 +641,18 @@ if [ "$cmd" = l -o "$cmd" = i ]; then exit $? fi +# Restart a service or echo the command to restart a service +if [ "$cmd" = r -o "$cmd" = R ]; then + detect_init || exit 1 + if [ "$cmd" = r ]; then + set -- $args + eval $RESTARTCMD + else + echo "$RESTARTCMD" + fi + exit $? +fi + # Not normally needed, but subscribers should be able to run independently if [ "$cmd" = v -o -n "$VFLAG" ]; then make_vars "$iface" @@ -765,13 +877,17 @@ case "${resolvconf:-YES}" in *) exit 0;; esac +# Try and detect a suitable init system for our scripts +detect_init +export RESTARTCMD RCDIR _NOINIT_WARNED + eval "$(make_vars)" export RESOLVCONF DOMAINS SEARCH NAMESERVERS LOCALNAMESERVERS : ${list_resolv:=list_resolv -l} retval=0 # Run scripts in the same directory resolvconf is run from -# in case any scripts accidently dump files in the wrong place. +# in case any scripts accidentally dump files in the wrong place. cd "$_PWD" for script in "$LIBEXECDIR"/*; do if [ -f "$script" ]; then Modified: stable/11/contrib/openresolv/unbound.in ============================================================================== --- stable/11/contrib/openresolv/unbound.in Sat Aug 20 00:55:58 2016 (r304514) +++ stable/11/contrib/openresolv/unbound.in Sat Aug 20 02:06:59 2016 (r304515) @@ -1,5 +1,5 @@ #!/bin/sh -# Copyright (c) 2009-2014 Roy Marples +# Copyright (c) 2009-2016 Roy Marples # All rights reserved # unbound subscriber for resolvconf @@ -37,7 +37,6 @@ NL=" : ${unbound_pid:=/var/run/unbound.pid} : ${unbound_service:=unbound} -: ${unbound_restart:=@RESTARTCMD ${unbound_service}@} newconf="# Generated by resolvconf$NL" for d in $DOMAINS; do @@ -71,6 +70,18 @@ else @SBINDIR@/resolvconf -D "$unbound_conf" fi +restart_unbound() +{ + if [ -n "$unbound_restart" ]; then + eval $unbound_restart + elif [ -n "$RESTARTCMD" ]; then + set -- ${unbound_service} + eval $RESTARTCMD + else + @SBINDIR@/resolvconf -r ${unbound_service} + fi +} + if [ ! -f "$unbound_conf" ] || \ [ "$(cat "$unbound_conf")" != "$(printf %s "$newconf")" ] then @@ -78,9 +89,9 @@ then # If we can't sent a HUP then force a restart if [ -s "$unbound_pid" ]; then if ! kill -HUP $(cat "$unbound_pid") 2>/dev/null; then - eval $unbound_restart + restart_unbound fi else - eval $unbound_restart + restart_unbound fi fi Modified: stable/11/sbin/resolvconf/Makefile ============================================================================== --- stable/11/sbin/resolvconf/Makefile Sat Aug 20 00:55:58 2016 (r304514) +++ stable/11/sbin/resolvconf/Makefile Sat Aug 20 02:06:59 2016 (r304515) @@ -19,9 +19,12 @@ VARDIR= /var/run/resolvconf # We don't assume to restart the services in /sbin. So, though # our service(8) is in /usr/sbin, we can use it, here. -CMD1= \1 onestatus >/dev/null 2>\&1 -CMD2= \1 restart -RESTARTCMD= /usr/sbin/service ${CMD1} \&\& /usr/sbin/service ${CMD2} +CMD1_WITH_ARG= \1 onestatus >/dev/null 2>\&1 +CMD2_WITH_ARG= \1 restart +RESTARTCMD_WITH_ARG= /usr/sbin/service ${CMD1_WITH_ARG} \&\& /usr/sbin/service ${CMD2_WITH_ARG} +CMD1= \\$$1 onestatus >/dev/null 2>\&1 +CMD2= \\$$1 restart +RESTARTCMD= "/usr/sbin/service ${CMD1} \&\& /usr/sbin/service ${CMD2}" .for f in ${SCRIPTS} ${FILES} ${MAN} ${f}: ${f}.in @@ -29,7 +32,8 @@ ${f}: ${f}.in -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g' \ -e 's:@LIBEXECDIR@:${FILESDIR}:g' \ -e 's:@VARDIR@:${VARDIR}:g' \ - -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD}:g' \ + -e 's:@RESTARTCMD \(.*\)@:${RESTARTCMD_WITH_ARG}:g' \ + -e 's:@RESTARTCMD@:${RESTARTCMD}:g' \ -e 's:@RCDIR@:${RCDIR}:g' \ -e 's: vpn : ng[0-9]*&:g' \ ${DIST}/$@.in > $@ From owner-svn-src-all@freebsd.org Sat Aug 20 02:14:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2BFABC047D; Sat, 20 Aug 2016 02:14:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 718AF1BB6; Sat, 20 Aug 2016 02:14:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7K2EE6d017852; Sat, 20 Aug 2016 02:14:14 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K2EENq017851; Sat, 20 Aug 2016 02:14:14 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608200214.u7K2EENq017851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 20 Aug 2016 02:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304516 - stable/11/contrib/binutils/bfd X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 02:14:15 -0000 Author: pfg Date: Sat Aug 20 02:14:14 2016 New Revision: 304516 URL: https://svnweb.freebsd.org/changeset/base/304516 Log: MFC r303147 binutils: fix "Bad value" error in bfd for MIPS when using -Bsymbolic. From OpenBSD's log: Inspired by https://sourceware.org/ml/binutils/2010-08/msg00333.html, but expressed differently so there are no GPLv3 issues. Obtained from: OpenBSD (CVS rev. 1.7) Modified: stable/11/contrib/binutils/bfd/elfxx-mips.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/binutils/bfd/elfxx-mips.c ============================================================================== --- stable/11/contrib/binutils/bfd/elfxx-mips.c Sat Aug 20 02:06:59 2016 (r304515) +++ stable/11/contrib/binutils/bfd/elfxx-mips.c Sat Aug 20 02:14:14 2016 (r304516) @@ -4801,7 +4801,7 @@ mips_elf_create_dynamic_relocation (bfd /* We must now calculate the dynamic symbol table index to use in the relocation. */ if (h != NULL - && (!h->root.def_regular + && (sec == NULL || !h->root.def_regular || (info->shared && !info->symbolic && !h->root.forced_local))) { indx = h->root.dynindx; From owner-svn-src-all@freebsd.org Sat Aug 20 02:18:45 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B02EBBC052C; Sat, 20 Aug 2016 02:18:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7416F1D54; Sat, 20 Aug 2016 02:18:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7K2IiC1018028; Sat, 20 Aug 2016 02:18:44 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K2Ii20018027; Sat, 20 Aug 2016 02:18:44 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608200218.u7K2Ii20018027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 20 Aug 2016 02:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304517 - stable/10/contrib/binutils/bfd X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 02:18:45 -0000 Author: pfg Date: Sat Aug 20 02:18:44 2016 New Revision: 304517 URL: https://svnweb.freebsd.org/changeset/base/304517 Log: MFC r303147 binutils: fix "Bad value" error in bfd for MIPS when using -Bsymbolic. From OpenBSD's log: Inspired by https://sourceware.org/ml/binutils/2010-08/msg00333.html, but expressed differently so there are no GPLv3 issues. Obtained from: OpenBSD (CVS rev. 1.7) Modified: stable/10/contrib/binutils/bfd/elfxx-mips.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/binutils/bfd/elfxx-mips.c ============================================================================== --- stable/10/contrib/binutils/bfd/elfxx-mips.c Sat Aug 20 02:14:14 2016 (r304516) +++ stable/10/contrib/binutils/bfd/elfxx-mips.c Sat Aug 20 02:18:44 2016 (r304517) @@ -4801,7 +4801,7 @@ mips_elf_create_dynamic_relocation (bfd /* We must now calculate the dynamic symbol table index to use in the relocation. */ if (h != NULL - && (!h->root.def_regular + && (sec == NULL || !h->root.def_regular || (info->shared && !info->symbolic && !h->root.forced_local))) { indx = h->root.dynindx; From owner-svn-src-all@freebsd.org Sat Aug 20 02:21:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E1E7BC0716; Sat, 20 Aug 2016 02:21:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D76F115F; Sat, 20 Aug 2016 02:21:47 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7K2LjHG021412; Sat, 20 Aug 2016 02:21:45 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K2Lj6q021411; Sat, 20 Aug 2016 02:21:45 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201608200221.u7K2Lj6q021411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 20 Aug 2016 02:21:45 +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: r304518 - stable/9/contrib/binutils/bfd 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 02:21:47 -0000 Author: pfg Date: Sat Aug 20 02:21:45 2016 New Revision: 304518 URL: https://svnweb.freebsd.org/changeset/base/304518 Log: MFC r303147 binutils: fix "Bad value" error in bfd for MIPS when using -Bsymbolic. From OpenBSD's log: Inspired by https://sourceware.org/ml/binutils/2010-08/msg00333.html, but expressed differently so there are no GPLv3 issues. Obtained from: OpenBSD (CVS rev. 1.7) Modified: stable/9/contrib/binutils/bfd/elfxx-mips.c Directory Properties: stable/9/contrib/binutils/ (props changed) Modified: stable/9/contrib/binutils/bfd/elfxx-mips.c ============================================================================== --- stable/9/contrib/binutils/bfd/elfxx-mips.c Sat Aug 20 02:18:44 2016 (r304517) +++ stable/9/contrib/binutils/bfd/elfxx-mips.c Sat Aug 20 02:21:45 2016 (r304518) @@ -4797,7 +4797,7 @@ mips_elf_create_dynamic_relocation (bfd /* We must now calculate the dynamic symbol table index to use in the relocation. */ if (h != NULL - && (!h->root.def_regular + && (sec == NULL || !h->root.def_regular || (info->shared && !info->symbolic && !h->root.forced_local))) { indx = h->root.dynindx; From owner-svn-src-all@freebsd.org Sat Aug 20 07:44:42 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E039FBBFD4B; Sat, 20 Aug 2016 07:44:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AF3071312; Sat, 20 Aug 2016 07:44:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7K7ifc8041114; Sat, 20 Aug 2016 07:44:41 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K7ifSW041113; Sat, 20 Aug 2016 07:44:41 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608200744.u7K7ifSW041113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 20 Aug 2016 07:44:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304519 - stable/11/usr.bin/netstat X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 07:44:43 -0000 Author: tuexen Date: Sat Aug 20 07:44:41 2016 New Revision: 304519 URL: https://svnweb.freebsd.org/changeset/base/304519 Log: MFC r304292: Use names for SCTP and UDPLite when reporting the input histogram. MFC r304295: Fix the output for scope statistics. Modified: stable/11/usr.bin/netstat/inet6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/netstat/inet6.c ============================================================================== --- stable/11/usr.bin/netstat/inet6.c Sat Aug 20 02:21:45 2016 (r304518) +++ stable/11/usr.bin/netstat/inet6.c Sat Aug 20 07:44:41 2016 (r304519) @@ -207,11 +207,11 @@ static const char *ip6nh[] = { "#129", "#130", "#131", - "#132", + "SCTP", "#133", "#134", "#135", - "#136", + "UDPLite", "#137", "#138", "#139", @@ -488,8 +488,8 @@ ip6_stats(u_long off, const char *name, "{N:/global%s}\n");\ break;\ default:\ - xo_emit("\t\t{qke:name/%x}{:count/%ju} " \ - "addresses scope=%x\n",\ + xo_emit("\t\t{qke:name/%#x}{:count/%ju} " \ + "{N:/addresses scope=%#x}\n",\ i, (uintmax_t)ip6stat.s, i); \ }\ } while (0); From owner-svn-src-all@freebsd.org Sat Aug 20 09:12:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1626BC07EC; Sat, 20 Aug 2016 09:12:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8812916CC; Sat, 20 Aug 2016 09:12:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7K9C1b4074012; Sat, 20 Aug 2016 09:12:01 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K9C1i5074011; Sat, 20 Aug 2016 09:12:01 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608200912.u7K9C1i5074011@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 20 Aug 2016 09:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304520 - head/cddl/contrib/opensolaris/lib/libzfs/common 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 09:12:02 -0000 Author: avg Date: Sat Aug 20 09:12:01 2016 New Revision: 304520 URL: https://svnweb.freebsd.org/changeset/base/304520 Log: fix bug introduced in r297521, set canmount=on doesn't mount filesystem There are two cases where changing canmount should result in an action: - canmount is set to off for a mounted filesystem - canmount is set to on for an unmounted filesystem Before r297521 we could unmount and re-mount a filesystem when that was not necessary, but after r297521 we only handled the first of the above cases. MFC after: 5 days Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sat Aug 20 07:44:41 2016 (r304519) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sat Aug 20 09:12:01 2016 (r304520) @@ -1630,12 +1630,17 @@ zfs_prop_set_list(zfs_handle_t *zhp, nvl assert(cl_idx < nvl_len); /* * We don't want to unmount & remount the dataset when changing - * its canmount property to 'on' or 'noauto'. We only use - * the changelist logic to unmount when setting canmount=off. + * its canmount property. We only use the changelist logic to + * unmount when setting canmount=off for a mounted filesystem + * or when setting canmount=on for an unmounted filesystem. + * For all other changes to canmount property the filesystem + * remains the same. */ if (prop != ZFS_PROP_CANMOUNT || (fnvpair_value_uint64(elem) == ZFS_CANMOUNT_OFF && - zfs_is_mounted(zhp, NULL))) { + zfs_is_mounted(zhp, NULL)) || + (fnvpair_value_uint64(elem) == ZFS_CANMOUNT_ON && + !zfs_is_mounted(zhp, NULL))) { cls[cl_idx] = changelist_gather(zhp, prop, 0, 0); if (cls[cl_idx] == NULL) goto error; From owner-svn-src-all@freebsd.org Sat Aug 20 09:13:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8363ABC0847; Sat, 20 Aug 2016 09:13:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C1AA18B6; Sat, 20 Aug 2016 09:13:15 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7K9DEDc074096; Sat, 20 Aug 2016 09:13:14 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7K9DEZH074095; Sat, 20 Aug 2016 09:13:14 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201608200913.u7K9DEZH074095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Sat, 20 Aug 2016 09:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304521 - head/sys/dev/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 09:13:15 -0000 Author: avg Date: Sat Aug 20 09:13:14 2016 New Revision: 304521 URL: https://svnweb.freebsd.org/changeset/base/304521 Log: JMicron JMB361 has only a single SATA port Discussed with: mav MFC after: 3 days Modified: head/sys/dev/ahci/ahci_pci.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Sat Aug 20 09:12:01 2016 (r304520) +++ head/sys/dev/ahci/ahci_pci.c Sat Aug 20 09:13:14 2016 (r304521) @@ -187,7 +187,7 @@ static const struct { {0xa10f8086, 0x00, "Intel Sunrise Point (RAID)", 0}, {0x23238086, 0x00, "Intel DH89xxCC", 0}, {0x2360197b, 0x00, "JMicron JMB360", 0}, - {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE}, + {0x2361197b, 0x00, "JMicron JMB361", AHCI_Q_NOFORCE | AHCI_Q_1CH}, {0x2362197b, 0x00, "JMicron JMB362", 0}, {0x2363197b, 0x00, "JMicron JMB363", AHCI_Q_NOFORCE}, {0x2365197b, 0x00, "JMicron JMB365", AHCI_Q_NOFORCE}, From owner-svn-src-all@freebsd.org Sat Aug 20 10:08:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32B90BBE71B; Sat, 20 Aug 2016 10:08:12 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 00B931D64; Sat, 20 Aug 2016 10:08:12 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-pf0-x231.google.com with SMTP id y134so17039971pfg.0; Sat, 20 Aug 2016 03:08:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RTBoPYKDXjEhQMmHNzONhCLcBtzhsYUbtTJHWPKHfMc=; b=fUN3rASsbJpJwhe4dx0DyB7acKukOq2SXzSNWOjSNVOUBAFdFk/7HofwZR37Yhx3/x hKm7buu9Vpc31i3VjB1v8Q5Bc9oQI4EZihJhPCQB7krbKSaMee/CObbGIlN9HDkEh+Ec Q+LVpp6kaCgjSa55kXwg4AoWu8bUOS0qSajwFzy+Jlwcv6oXRys1WP//LAguc9A5oEOc kEaqDCu8d8TLMhKi7M1uTZ587ohTfowUVwZlJ2zF/EAL4yXolMjokMisiwHX4kmpxunh zimXGvpXEPNDTOCEWVJTMUhaayYKus15424kn6v86wqEdakAbYTwHkzZxNWX93lEfSGo KArg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:reply-to:subject:references:to:from :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=RTBoPYKDXjEhQMmHNzONhCLcBtzhsYUbtTJHWPKHfMc=; b=XJcWa66vmQ64uG06Oe1KqZAWuGEdnFBuVPdyjHLv/6VG/hdbrbL7LNZ9ifrCAQb/Yd NgPkaIlNvY7CnAGfxKdpsj9e1Q4immcEsahwSmT/SfGsq7DjyuLlEbJe6HceFlr88T0H w3n6mcUfvwG6xdeXtZ7v9Mix/7Xl5g5YTEj4oPtSlI8wn75nvjSCi7McIvn2NuQvn0iV fJy9yoboxS3ATULVMOviEJ8WUaQaKvOL1/jP71GbspZEz/uiV6jcs/g5BHgSnOiQTYvs 5veZJgjPe69TcHQGiJ0i2C7+nIRCsN1ZOD7xSEiGQWdbXREFAEisylIsUNZajLKT3BjH jawg== X-Gm-Message-State: AEkoouvPH5ZsF0SLh8RvEw3UF0tBOH4fnjsUYOK+Xq6LYjn5FvO0J9kTt47uF+RyMqG65Q== X-Received: by 10.98.80.220 with SMTP id g89mr22649121pfj.12.1471687691487; Sat, 20 Aug 2016 03:08:11 -0700 (PDT) Received: from ?IPv6:2001:44b8:31ae:7b01:f985:3c4b:2a0c:8bea? (2001-44b8-31ae-7b01-f985-3c4b-2a0c-8bea.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:f985:3c4b:2a0c:8bea]) by smtp.gmail.com with ESMTPSA id w76sm12698589pfd.69.2016.08.20.03.08.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Aug 2016 03:08:10 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: svn commit: r304435 - head/sys/netinet References: <201608182259.u7IMx0bx001967@repo.freebsd.org> To: Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Kubilay Kocak Message-ID: <96b7428a-0a57-6d6d-4b2e-24010596ceaf@FreeBSD.org> Date: Sat, 20 Aug 2016 20:08:01 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:50.0) Gecko/20100101 Thunderbird/50.0a2 MIME-Version: 1.0 In-Reply-To: <201608182259.u7IMx0bx001967@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 10:08:12 -0000 On 19/08/2016 8:59 AM, Ryan Stone wrote: > Author: rstone > Date: Thu Aug 18 22:59:00 2016 > New Revision: 304435 > URL: https://svnweb.freebsd.org/changeset/base/304435 > > Log: > Don't iterate over the ifnet addr list in ip_output() > > For almost every packet that is transmitted through ip_output(), > a call to in_broadcast() was made to decide if the destination > IP was a broadcast address. in_broadcast() iterates over the > ifnet's address to find a source IP matching the subnet of the > destination IP, and then checks if the IP is a broadcast in that > subnet. > > This is completely redundant as we have already performed the > route lookup, so the source IP is already known. Just use that > address to directly check whether the destination IP is a > broadcast address or not. Hi Ryan, Could you elaborate on any of the potential performance implications of this? > MFC after: 2 months > Sponsored By: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D7266 > > Modified: > head/sys/netinet/in.c > head/sys/netinet/in.h > head/sys/netinet/ip_output.c > > Modified: head/sys/netinet/in.c From owner-svn-src-all@freebsd.org Sat Aug 20 11:42:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B8F8BBAEAA; Sat, 20 Aug 2016 11:42:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D7C91697; Sat, 20 Aug 2016 11:42:09 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KBg8iT027464; Sat, 20 Aug 2016 11:42:08 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KBg8Q0027463; Sat, 20 Aug 2016 11:42:08 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608201142.u7KBg8Q0027463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 20 Aug 2016 11:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304522 - releng/11.0/usr.bin/netstat X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 11:42:09 -0000 Author: tuexen Date: Sat Aug 20 11:42:08 2016 New Revision: 304522 URL: https://svnweb.freebsd.org/changeset/base/304522 Log: MFC r304519: * Use names for SCTP and UDPLite when reporting the input histogram. * Fix the output for scope statistics. Approved by: re (kib) Modified: releng/11.0/usr.bin/netstat/inet6.c Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/usr.bin/netstat/inet6.c ============================================================================== --- releng/11.0/usr.bin/netstat/inet6.c Sat Aug 20 09:13:14 2016 (r304521) +++ releng/11.0/usr.bin/netstat/inet6.c Sat Aug 20 11:42:08 2016 (r304522) @@ -207,11 +207,11 @@ static const char *ip6nh[] = { "#129", "#130", "#131", - "#132", + "SCTP", "#133", "#134", "#135", - "#136", + "UDPLite", "#137", "#138", "#139", @@ -488,8 +488,8 @@ ip6_stats(u_long off, const char *name, "{N:/global%s}\n");\ break;\ default:\ - xo_emit("\t\t{qke:name/%x}{:count/%ju} " \ - "addresses scope=%x\n",\ + xo_emit("\t\t{qke:name/%#x}{:count/%ju} " \ + "{N:/addresses scope=%#x}\n",\ i, (uintmax_t)ip6stat.s, i); \ }\ } while (0); From owner-svn-src-all@freebsd.org Sat Aug 20 11:43:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21D6ABBAEFA; Sat, 20 Aug 2016 11:43:03 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D84C3186A; Sat, 20 Aug 2016 11:43:02 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id E348620283; Sat, 20 Aug 2016 07:33:14 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 07:33:14 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=/8q/Kh34eNzdb/7HFT1hBSvn3HM=; b=Yksf5P LoBLgZYqB30PPamLHbExsD0J+fXYs+Rj96q+/QZef0BtqmbN/LIn1s0H+iBXek+x WnaEcu9pGU5IGRtd/Oh9k73L4c6W+2KUDTIG2/2lxY2uc1JttMCZYbiH85o2txhW 8vWYkS3hKfyYF06AI9DTSDeyBMxBCW/spMQiI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=/8q/Kh34eNzdb/7 HFT1hBSvn3HM=; b=g2FA/CfQmtMrfZyfrVjbgsvOmC1NXqn2qcd1dB8Li3XlZLS gIykxsnc1QlvJwcMBqAHYdwgQZdKAF5D0QH0CNzWFKmpNeTdlE5Kvr5ihYXFYK52 6lgBtIobmpstnKqplEBpfnl+9rMfrCzhEq1CtGWKvU6P40JygbxuIuyp0i1Y= X-Sasl-enc: Q4DfqWyUouwhaEvr13jaBRIrmFYT3qPyzIsVuIW0p9Hd 1471692794 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 2F0D0CCE69; Sat, 20 Aug 2016 07:33:14 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608182259.u7IMx5oW002018@repo.freebsd.org> From: Bruce Simpson Message-ID: <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> Date: Sat, 20 Aug 2016 12:33:05 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608182259.u7IMx5oW002018@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 11:43:03 -0000 This potentially breaks reception of IPv4 broadcasts where FreeBSD is the endpoint at the end of a P2P interface, or other forms of links, where there is no guarantee that the link layer will set M_BCAST (or indeed M_MCAST). On 18/08/16 23:59, Ryan Stone wrote: > Author: rstone > Date: Thu Aug 18 22:59:05 2016 > New Revision: 304436 > URL: https://svnweb.freebsd.org/changeset/base/304436 > > Log: > Don't check for broadcast IPs on non-bcast pkts > > in_broadcast() can be quite expensive, so skip calling it if the > incoming mbuf wasn't sent to a broadcast L2 address in the first > place. > > Reviewed by: gnn > MFC after: 2 months > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D7309 > > Modified: > head/UPDATING > head/sys/netinet/udp_usrreq.c > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Thu Aug 18 22:59:00 2016 (r304435) > +++ head/UPDATING Thu Aug 18 22:59:05 2016 (r304436) > @@ -32,6 +32,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > 20160818: > + The UDP receive code has been updated to only treat incoming UDP > + packets that were addressed to an L2 broadcast address as L3 > + broadcast packets. It is not expected that this will affect any > + standards-conforming UDP application. The new behaviour can be > + disabled by setting the sysctl net.inet.udp.require_l2_bcast to > + 0. > + > +20160818: > Remove the openbsd_poll system call. > __FreeBSD_version has been bumped because of this. > > > Modified: head/sys/netinet/udp_usrreq.c > ============================================================================== > --- head/sys/netinet/udp_usrreq.c Thu Aug 18 22:59:00 2016 (r304435) > +++ head/sys/netinet/udp_usrreq.c Thu Aug 18 22:59:05 2016 (r304436) > @@ -126,6 +126,11 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, blac > &VNET_NAME(udp_blackhole), 0, > "Do not send port unreachables for refused connects"); > > +static VNET_DEFINE(int, udp_require_l2_bcast) = 1; > +SYSCTL_INT(_net_inet_udp, OID_AUTO, require_l2_bcast, CTLFLAG_VNET | CTLFLAG_RW, > + &VNET_NAME(udp_require_l2_bcast), 0, > + "Only treat packets sent to an L2 broadcast address as broadcast packets"); > + > u_long udp_sendspace = 9216; /* really max datagram size */ > SYSCTL_ULONG(_net_inet_udp, UDPCTL_MAXDGRAM, maxdgram, CTLFLAG_RW, > &udp_sendspace, 0, "Maximum outgoing UDP datagram size"); > @@ -523,7 +528,8 @@ udp_input(struct mbuf **mp, int *offp, i > > pcbinfo = udp_get_inpcbinfo(proto); > if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || > - in_broadcast(ip->ip_dst, ifp)) { > + ((!VNET_NAME(udp_require_l2_bcast) || m->m_flags & M_BCAST) && > + in_broadcast(ip->ip_dst, ifp))) { > struct inpcb *last; > struct inpcbhead *pcblist; > struct ip_moptions *imo; > From owner-svn-src-all@freebsd.org Sat Aug 20 11:48:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5469BBF097; Sat, 20 Aug 2016 11:48:10 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAF3A1B9B; Sat, 20 Aug 2016 11:48:10 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 6AD9820248; Sat, 20 Aug 2016 07:48:09 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 07:48:09 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=dM81jlqjZi/vINEioo43lhyBipk=; b=HpJtbc UA31uyG7hw791hNn4Qfqqdvc34iT+IcOnFVEw66cQua19e1jMXnXqq7OOJGYTtpK yWO65rWVRZZV33QH5fCfuYtjCmDa0dEs7qi/np8VJk2iIyaye9nGeDbTB5J8d/Yr pNs88m4LLkdJABGpaE9DVv1ugB8byOc3Vlim4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=dM81jlqjZi/vINE ioo43lhyBipk=; b=c+9M1V83oSknCS+VcvWbu5TbAm36chtZJqT9glTZ1H1PG+q baYJtf+6eLiTeMwOThpat7vW7T+kWk/ba6+FPdevTbBQoJ1zPYx6dI4VxgfKHzlM C58fbv0YQlxqj73S/6QqjixHtkZFWvBRNUsoizUC/94Dze3fy/wb0OZKsIeg= X-Sasl-enc: T0q1dIbBgEf8uXfYEacP89j23rOX/uhakPSfqnZbeu5A 1471693689 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id A74E8CC021; Sat, 20 Aug 2016 07:48:08 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> From: Bruce Simpson Message-ID: <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> Date: Sat, 20 Aug 2016 12:48:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 11:48:10 -0000 On 20/08/16 12:33, Bruce Simpson wrote: > This potentially breaks reception of IPv4 broadcasts where FreeBSD is > the endpoint at the end of a P2P interface, or other forms of links, > where there is no guarantee that the link layer will set M_BCAST (or > indeed M_MCAST). I appreciate it probably looks like a quick win, but if it's only been tested with Ethernet (it looks like it has only been written with Ethernet in mind), it does strongly look as if it breaks broadcast for UDP/IPv4 in other situations. So, maybe it should be backed out ASAP. (I haven't tested this code.) It is perfectly legal for broadcast packets to be addressed to the end of a P2P or non-Ethernet link, which may not set M_BCAST or M_MCAST. The classic example is ATM (Non-Broadcast, Multiple Access (NBMA)) but the situation may be readily observed with loopback or tunnels. The same issue doesn't exist in your output path change, which looks sane. The same issue doesn't exist with IPv6 where broadcast is dead. From owner-svn-src-all@freebsd.org Sat Aug 20 11:54:12 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D6B3BBF26D; Sat, 20 Aug 2016 11:54:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 02AB51F3C; Sat, 20 Aug 2016 11:54:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KBsBAI033266; Sat, 20 Aug 2016 11:54:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KBsBvZ033265; Sat, 20 Aug 2016 11:54:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608201154.u7KBsBvZ033265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Aug 2016 11:54:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304523 - stable/11/lib/libc X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 11:54:12 -0000 Author: kib Date: Sat Aug 20 11:54:11 2016 New Revision: 304523 URL: https://svnweb.freebsd.org/changeset/base/304523 Log: MFC r303794: Create namespace for the symbols added during 12-CURRENT cycle. Modified: stable/11/lib/libc/Versions.def Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/Versions.def ============================================================================== --- stable/11/lib/libc/Versions.def Sat Aug 20 11:42:08 2016 (r304522) +++ stable/11/lib/libc/Versions.def Sat Aug 20 11:54:11 2016 (r304523) @@ -27,6 +27,10 @@ FBSD_1.3 { FBSD_1.4 { } FBSD_1.3; +# This version was first added to 12.0-current. +FBSD_1.5 { +} FBSD_1.4; + # This is our private namespace. Any global interfaces that are # strictly for use only by other FreeBSD applications and libraries @@ -35,4 +39,4 @@ FBSD_1.4 { # # Please do NOT increment the version of this namespace. FBSDprivate_1.0 { -} FBSD_1.4; +} FBSD_1.5; From owner-svn-src-all@freebsd.org Sat Aug 20 11:58:25 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F514BBF2E9; Sat, 20 Aug 2016 11:58:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30B8F1208; Sat, 20 Aug 2016 11:58:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KBwOKW033478; Sat, 20 Aug 2016 11:58:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KBwNsV033468; Sat, 20 Aug 2016 11:58:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608201158.u7KBwNsV033468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Aug 2016 11:58:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304524 - in stable/11/lib: libc/include libc/stdlib libc/tests/stdlib libthr/thread X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 11:58:25 -0000 Author: kib Date: Sat Aug 20 11:58:23 2016 New Revision: 304524 URL: https://svnweb.freebsd.org/changeset/base/304524 Log: MFC r303795: Add __cxa_thread_atexit(3) API implementation. Added: stable/11/lib/libc/stdlib/cxa_thread_atexit.c - copied unchanged from r303795, head/lib/libc/stdlib/cxa_thread_atexit.c stable/11/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc - copied unchanged from r303795, head/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc stable/11/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc - copied unchanged from r303795, head/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc Modified: stable/11/lib/libc/include/libc_private.h stable/11/lib/libc/stdlib/Makefile.inc stable/11/lib/libc/stdlib/Symbol.map stable/11/lib/libc/stdlib/exit.c stable/11/lib/libc/tests/stdlib/Makefile stable/11/lib/libc/tests/stdlib/Makefile.depend stable/11/lib/libthr/thread/thr_exit.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/include/libc_private.h ============================================================================== --- stable/11/lib/libc/include/libc_private.h Sat Aug 20 11:54:11 2016 (r304523) +++ stable/11/lib/libc/include/libc_private.h Sat Aug 20 11:58:23 2016 (r304524) @@ -267,6 +267,12 @@ extern const char *__progname; void _malloc_thread_cleanup(void); /* + * This function is used by the threading libraries to notify libc that a + * thread is exiting, so its thread-local dtors should be called. + */ +void __cxa_thread_call_dtors(void); + +/* * These functions are used by the threading libraries in order to protect * malloc across fork(). */ Modified: stable/11/lib/libc/stdlib/Makefile.inc ============================================================================== --- stable/11/lib/libc/stdlib/Makefile.inc Sat Aug 20 11:54:11 2016 (r304523) +++ stable/11/lib/libc/stdlib/Makefile.inc Sat Aug 20 11:58:23 2016 (r304524) @@ -5,7 +5,7 @@ .PATH: ${LIBC_SRCTOP}/${LIBC_ARCH}/stdlib ${LIBC_SRCTOP}/stdlib MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ - bsearch.c div.c exit.c getenv.c getopt.c getopt_long.c \ + bsearch.c cxa_thread_atexit.c div.c exit.c getenv.c getopt.c getopt_long.c \ getsubopt.c hcreate.c hcreate_r.c hdestroy_r.c heapsort.c heapsort_b.c \ hsearch_r.c imaxabs.c imaxdiv.c \ insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \ Modified: stable/11/lib/libc/stdlib/Symbol.map ============================================================================== --- stable/11/lib/libc/stdlib/Symbol.map Sat Aug 20 11:54:11 2016 (r304523) +++ stable/11/lib/libc/stdlib/Symbol.map Sat Aug 20 11:58:23 2016 (r304524) @@ -116,8 +116,13 @@ FBSD_1.4 { reallocarray; }; +FBSD_1.5 { + __cxa_thread_atexit; +}; + FBSDprivate_1.0 { __system; _system; __libc_system; + __cxa_thread_call_dtors; }; Copied: stable/11/lib/libc/stdlib/cxa_thread_atexit.c (from r303795, head/lib/libc/stdlib/cxa_thread_atexit.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libc/stdlib/cxa_thread_atexit.c Sat Aug 20 11:58:23 2016 (r304524, copy of r303795, head/lib/libc/stdlib/cxa_thread_atexit.c) @@ -0,0 +1,140 @@ +/*- + * Copyright (c) 2016 Mahdi Mokhtari + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" + +/* + * C++11 introduces the thread_local scope (like __thread with some + * additions). As a key-feature it should support non-trivial + * destructors, registered with __cxa_thread_atexit() to be executed + * at the thread termination. + * + * The implemention keeps a _Thread_local list of destructors per each + * thread, and calls __cxa_thread_call_dtors() on each thread's exit + * to do cleanup. For a thread calling exit(3), in particular, for + * the initial thread returning from main(), we call + * __cxa_thread_call_dtors() inside exit(). + * + * It could be possible that a dynamically loaded library, use + * thread_local variable but is dlclose()'d before thread exit. The + * destructor of this variable will then try to access the address, + * for calling it but it's unloaded, so it'll crash. We're using + * __elf_phdr_match_addr() to detect and prevent such cases and so + * prevent the crash. + */ + +#define CXA_DTORS_ITERATIONS 4 + +struct cxa_thread_dtor { + void *obj; + void (*func)(void *); + void *dso; + LIST_ENTRY(cxa_thread_dtor) entry; +}; +static _Thread_local LIST_HEAD(dtor_list, cxa_thread_dtor) dtors = + LIST_HEAD_INITIALIZER(dtors); + +int +__cxa_thread_atexit(void (*dtor_func)(void *), void *obj, void *dso_symbol) +{ + struct cxa_thread_dtor *new_dtor; + + new_dtor = malloc(sizeof(*new_dtor)); + if (new_dtor == NULL) { + errno = ENOMEM; /* forcibly override malloc(3) error */ + return (-1); + } + + new_dtor->obj = obj; + new_dtor->func = dtor_func; + new_dtor->dso = dso_symbol; + LIST_INSERT_HEAD(&dtors, new_dtor, entry); + return (0); +} + +static void +walk_cb_call(struct cxa_thread_dtor *dtor) +{ + struct dl_phdr_info phdr_info; + + if (_rtld_addr_phdr(dtor->dso, &phdr_info) && + __elf_phdr_match_addr(&phdr_info, dtor->func)) + dtor->func(dtor->obj); + else + fprintf(stderr, "__cxa_thread_call_dtors: dtr %p from " + "unloaded dso, skipping\n", (void *)(dtor->func)); +} + +static void +walk_cb_nocall(struct cxa_thread_dtor *dtor __unused) +{ +} + +static void +cxa_thread_walk(void (*cb)(struct cxa_thread_dtor *)) +{ + struct cxa_thread_dtor *dtor, *tdtor; + + LIST_FOREACH_SAFE(dtor, &dtors, entry, tdtor) { + LIST_REMOVE(dtor, entry); + cb(dtor); + free(dtor); + } +} + +/* + * This is the callback function we use to call destructors, once for + * each thread. It is called in exit(3) in libc/stdlib/exit.c and + * before exit_thread() in libthr/thread/thr_exit.c. + */ +void +__cxa_thread_call_dtors(void) +{ + int i; + + for (i = 0; i < CXA_DTORS_ITERATIONS && !LIST_EMPTY(&dtors); i++) + cxa_thread_walk(walk_cb_call); + + if (!LIST_EMPTY(&dtors)) { + fprintf(stderr, "Thread %p is exiting with more " + "thread-specific dtors created after %d iterations " + "of destructor calls\n", + _pthread_self(), i); + cxa_thread_walk(walk_cb_nocall); + } +} Modified: stable/11/lib/libc/stdlib/exit.c ============================================================================== --- stable/11/lib/libc/stdlib/exit.c Sat Aug 20 11:54:11 2016 (r304523) +++ stable/11/lib/libc/stdlib/exit.c Sat Aug 20 11:58:23 2016 (r304524) @@ -63,6 +63,12 @@ exit(int status) _thread_autoinit_dummy_decl = 1; + /* + * We're dealing with cleaning up thread_local destructors in the case of + * the process termination through main() exit. + * Other cases are handled elsewhere. + */ + __cxa_thread_call_dtors(); __cxa_finalize(NULL); if (__cleanup) (*__cleanup)(); Modified: stable/11/lib/libc/tests/stdlib/Makefile ============================================================================== --- stable/11/lib/libc/tests/stdlib/Makefile Sat Aug 20 11:54:11 2016 (r304523) +++ stable/11/lib/libc/tests/stdlib/Makefile Sat Aug 20 11:58:23 2016 (r304524) @@ -1,9 +1,15 @@ # $FreeBSD$ +.include + ATF_TESTS_C+= heapsort_test ATF_TESTS_C+= mergesort_test ATF_TESTS_C+= qsort_test ATF_TESTS_C+= tsearch_test +.if ${COMPILER_FEATURES:Mc++11} +ATF_TESTS_CXX+= cxa_thread_atexit_test +ATF_TESTS_CXX+= cxa_thread_atexit_nothr_test +.endif # TODO: t_getenv_thread, t_mi_vector_hash NETBSD_ATF_TESTS_C+= abs_test @@ -33,6 +39,10 @@ PROGS+= h_getopt h_getopt_long CFLAGS+= -I${.CURDIR} +CXXFLAGS.cxa_thread_atexit_test+= -std=c++11 +CXXFLAGS.cxa_thread_atexit_nothr_test+= -std=c++11 +LIBADD.cxa_thread_atexit_test+= pthread + .for t in h_getopt h_getopt_long CFLAGS.$t+= -I${LIBNETBSD_SRCDIR} -I${SRCTOP}/contrib/netbsd-tests LDFLAGS.$t+= -L${LIBNETBSD_OBJDIR} Modified: stable/11/lib/libc/tests/stdlib/Makefile.depend ============================================================================== --- stable/11/lib/libc/tests/stdlib/Makefile.depend Sat Aug 20 11:54:11 2016 (r304523) +++ stable/11/lib/libc/tests/stdlib/Makefile.depend Sat Aug 20 11:58:23 2016 (r304524) @@ -8,7 +8,10 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/atf/libatf-c \ + lib/atf/libatf-c++ \ lib/libc \ + lib/libc++ \ + lib/libthr \ lib/libcompiler_rt \ lib/libnetbsd \ lib/libutil \ Copied: stable/11/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc (from r303795, head/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc Sat Aug 20 11:58:23 2016 (r304524, copy of r303795, head/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc) @@ -0,0 +1,102 @@ +/*- + * Copyright (c) 2016 Mahdi Mokhtari + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +static FILE *output = NULL; + +struct Foo { + Foo() { ATF_REQUIRE(fprintf(output, "Created\n") > 0); } + ~Foo() { ATF_REQUIRE(fprintf(output, "Destroyed\n") > 0); } + void use() { ATF_REQUIRE(fprintf(output, "Used\n") > 0); } +}; + +static thread_local Foo f; + +/* + * This test must not be linked to libpthread. + */ +ATF_TEST_CASE_WITHOUT_HEAD(cxx__nothr); +ATF_TEST_CASE_BODY(cxx__nothr) +{ + void *libthr_handle; + + /* Avoid coredump during f construction. */ + output = stderr; + + libthr_handle = dlopen("libthr.so.3", RTLD_LAZY | RTLD_GLOBAL | + RTLD_NOLOAD); + ATF_REQUIRE(libthr_handle == NULL); +} + +static void +check_local_main(void) +{ + static const char out_log[] = "Created\nUsed\nDestroyed\n"; + + fflush(output); + ATF_REQUIRE(atf::utils::compare_file("test_main.txt", out_log)); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cxx__thread_local_main); +ATF_TEST_CASE_BODY(cxx__thread_local_main) +{ + + ATF_REQUIRE((output = fopen("test_main.txt", "w")) != NULL); + f.use(); + atexit(check_local_main); +} + +extern "C" int __cxa_thread_atexit(void (*)(void *), void *, void *); + +static void +again(void *arg) +{ + + __cxa_thread_atexit(again, arg, &output); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cxx__thread_inf_dtors); +ATF_TEST_CASE_BODY(cxx__thread_inf_dtors) +{ + + again(NULL); +} + +ATF_INIT_TEST_CASES(tcs) +{ + + ATF_ADD_TEST_CASE(tcs, cxx__nothr); + ATF_ADD_TEST_CASE(tcs, cxx__thread_local_main); + ATF_ADD_TEST_CASE(tcs, cxx__thread_inf_dtors); +} Copied: stable/11/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc (from r303795, head/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc Sat Aug 20 11:58:23 2016 (r304524, copy of r303795, head/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc) @@ -0,0 +1,180 @@ +/*- + * Copyright (c) 2016 Mahdi Mokhtari + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +static FILE *output = NULL; + +struct Foo { + Foo() { ATF_REQUIRE(fprintf(output, "Created\n") > 0); } + ~Foo() { ATF_REQUIRE(fprintf(output, "Destroyed\n") > 0); } + void use() { ATF_REQUIRE(fprintf(output, "Used\n") > 0); } +}; + +struct Bar { + Bar() {} + ~Bar() { + thread_local static Foo foo; + ATF_REQUIRE(fprintf(output, "DIED\n") > 0); + } + void use() {} +}; + +extern "C" int __cxa_thread_atexit(void (*)(void *), void *, void *); + +static void +again(void *arg) +{ + + __cxa_thread_atexit(again, arg, &output); +} + +struct Baz { + Baz() {} + ~Baz() { + again(NULL); + } + void use() {} +}; + +static thread_local Foo f; +static thread_local Foo g; +static thread_local Bar h; +static thread_local Baz e; + +/* + * This test must be linked to libpthread. + */ +ATF_TEST_CASE_WITHOUT_HEAD(cxx__thr); +ATF_TEST_CASE_BODY(cxx__thr) +{ + void *libthr_handle; + + /* Avoid coredump during f construction. */ + output = stderr; + + libthr_handle = dlopen("libthr.so.3", RTLD_LAZY | RTLD_GLOBAL | + RTLD_NOLOAD); + ATF_REQUIRE(libthr_handle != NULL); + dlclose(libthr_handle); +} + +/* + * In this test f.use() will test cxa_thread_atexit() in non-threaded mode. + * After f.use() main will be threaded and we'll have one additional thread + * with its own TLS data. + */ +ATF_TEST_CASE_WITHOUT_HEAD(cxx__thread_local_before); +ATF_TEST_CASE_BODY(cxx__thread_local_before) +{ + static const char out_log[] = "Created\nCreated\nUsed\nCreated\n" + "Created\nUsed\nCreated\nDIED\nDestroyed\nDestroyed\nDestroyed\n"; + + ATF_REQUIRE((output = fopen("test_before.txt", "w")) != NULL); + + f.use(); + std::thread t([]() { f.use(); }); + t.join(); + + fflush(output); + + ATF_REQUIRE(atf::utils::compare_file("test_before.txt", out_log)); +} + +/* + * In this test, f.use() will test __cxa_thread_atexit() + * in threaded mode (but still in main-threaed). + */ +ATF_TEST_CASE_WITHOUT_HEAD(cxx__thread_local_after); +ATF_TEST_CASE_BODY(cxx__thread_local_after) +{ + static const char out_log[] = "Created\nCreated\nUsed\nCreated\n" + "DIED\nDestroyed\nDestroyed\nDestroyed\nCreated\nCreated\nUsed\n"; + + ATF_REQUIRE((output = fopen("test_after.txt", "w")) != NULL); + + std::thread t([]() { g.use(); }); + t.join(); + sleep(1); + g.use(); + + fflush(output); + + ATF_REQUIRE(atf::utils::compare_file("test_after.txt", out_log)); +} + +/* + * In this test, we register a new dtor while dtors are being run + * in __cxa_thread_atexit(). + */ +ATF_TEST_CASE_WITHOUT_HEAD(cxx__thread_local_add_while_calling_dtors); +ATF_TEST_CASE_BODY(cxx__thread_local_add_while_calling_dtors) +{ + static const char out_log[] = "Created\nCreated\nCreated\nDIED\n" + "Destroyed\nDestroyed\nDestroyed\n"; + + ATF_REQUIRE((output = fopen("test_add_meanwhile.txt", "w")) != NULL); + + std::thread t([]() { h.use(); }); + t.join(); + sleep(1); + + fflush(output); + + ATF_REQUIRE(atf::utils::compare_file("test_add_meanwhile.txt", out_log)); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cxx__thread_inf_dtors); +ATF_TEST_CASE_BODY(cxx__thread_inf_dtors) +{ + + /* + * Only added to make isolated run of this test not + * coredumping. Construction of Foo objects require filled + * output. + */ + output = stderr; + + std::thread t([]() { e.use(); }); + t.join(); +} + +ATF_INIT_TEST_CASES(tcs) +{ + + ATF_ADD_TEST_CASE(tcs, cxx__thr); + ATF_ADD_TEST_CASE(tcs, cxx__thread_local_before); + ATF_ADD_TEST_CASE(tcs, cxx__thread_local_after); + ATF_ADD_TEST_CASE(tcs, cxx__thread_local_add_while_calling_dtors); + ATF_ADD_TEST_CASE(tcs, cxx__thread_inf_dtors); +} Modified: stable/11/lib/libthr/thread/thr_exit.c ============================================================================== --- stable/11/lib/libthr/thread/thr_exit.c Sat Aug 20 11:54:11 2016 (r304523) +++ stable/11/lib/libthr/thread/thr_exit.c Sat Aug 20 11:58:23 2016 (r304524) @@ -153,8 +153,12 @@ thread_unwind_stop(int version, _Unwind_ __pthread_cleanup_pop_imp(1); } - if (done) + if (done) { + /* Tell libc that it should call non-trivial TLS dtors. */ + __cxa_thread_call_dtors(); + exit_thread(); /* Never return! */ + } return (_URC_NO_REASON); } @@ -258,6 +262,8 @@ cleanup: while (curthread->cleanup != NULL) { __pthread_cleanup_pop_imp(1); } + __cxa_thread_call_dtors(); + exit_thread(); } @@ -265,6 +271,7 @@ cleanup: while (curthread->cleanup != NULL) { __pthread_cleanup_pop_imp(1); } + __cxa_thread_call_dtors(); exit_thread(); #endif /* _PTHREAD_FORCED_UNWIND */ From owner-svn-src-all@freebsd.org Sat Aug 20 11:59:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC775BBF37D; Sat, 20 Aug 2016 11:59:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB8A51391; Sat, 20 Aug 2016 11:59:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KBxJN7033554; Sat, 20 Aug 2016 11:59:19 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KBxJPw033552; Sat, 20 Aug 2016 11:59:19 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201608201159.u7KBxJPw033552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 20 Aug 2016 11:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304525 - in releng/11.0: lib/libc/sys sys/kern X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 11:59:21 -0000 Author: bdrewery Date: Sat Aug 20 11:59:19 2016 New Revision: 304525 URL: https://svnweb.freebsd.org/changeset/base/304525 Log: MFS r304512: MFC r304288: Garbage collect _umtx_lock(2)/_umtx_unlock(2) references removed in r263318. Approved by: re (gjb) Modified: releng/11.0/lib/libc/sys/Symbol.map releng/11.0/sys/kern/capabilities.conf Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/lib/libc/sys/Symbol.map ============================================================================== --- releng/11.0/lib/libc/sys/Symbol.map Sat Aug 20 11:58:23 2016 (r304524) +++ releng/11.0/lib/libc/sys/Symbol.map Sat Aug 20 11:59:19 2016 (r304525) @@ -34,9 +34,7 @@ FBSD_1.0 { __setugid; __syscall; __sysctl; - _umtx_lock; _umtx_op; - _umtx_unlock; abort2; accept; access; @@ -455,12 +453,8 @@ FBSDprivate_1.0 { __sys___syscall; ___sysctl; __sys___sysctl; - __umtx_lock; - __sys__umtx_lock; __umtx_op; __sys__umtx_op; - __umtx_unlock; - __sys__umtx_unlock; _abort2; __sys_abort2; _accept; Modified: releng/11.0/sys/kern/capabilities.conf ============================================================================== --- releng/11.0/sys/kern/capabilities.conf Sat Aug 20 11:58:23 2016 (r304524) +++ releng/11.0/sys/kern/capabilities.conf Sat Aug 20 11:59:19 2016 (r304525) @@ -64,9 +64,7 @@ __sysctl ## ## XXRW: Need to check this very carefully. ## -_umtx_lock _umtx_op -_umtx_unlock ## ## Allow process termination using abort2(2). From owner-svn-src-all@freebsd.org Sat Aug 20 12:23:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2EAFBC0521; Sat, 20 Aug 2016 12:23:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F5C415A5; Sat, 20 Aug 2016 12:23:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KCNRw2044553; Sat, 20 Aug 2016 12:23:27 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KCNRhD044552; Sat, 20 Aug 2016 12:23:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608201223.u7KCNRhD044552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Aug 2016 12:23:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304526 - stable/10/lib/libc X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 12:23:28 -0000 Author: kib Date: Sat Aug 20 12:23:27 2016 New Revision: 304526 URL: https://svnweb.freebsd.org/changeset/base/304526 Log: MFC r303794: Create namespace for the symbols added during 12-CURRENT cycle. Modified: stable/10/lib/libc/Versions.def Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/Versions.def ============================================================================== --- stable/10/lib/libc/Versions.def Sat Aug 20 11:59:19 2016 (r304525) +++ stable/10/lib/libc/Versions.def Sat Aug 20 12:23:27 2016 (r304526) @@ -27,6 +27,10 @@ FBSD_1.3 { FBSD_1.4 { } FBSD_1.3; +# This version was first added to 12.0-current. +FBSD_1.5 { +} FBSD_1.4; + # This is our private namespace. Any global interfaces that are # strictly for use only by other FreeBSD applications and libraries @@ -35,4 +39,4 @@ FBSD_1.4 { # # Please do NOT increment the version of this namespace. FBSDprivate_1.0 { -} FBSD_1.4; +} FBSD_1.5; From owner-svn-src-all@freebsd.org Sat Aug 20 12:26:46 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88848BC05F7; Sat, 20 Aug 2016 12:26:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 533341761; Sat, 20 Aug 2016 12:26:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KCQjPl044724; Sat, 20 Aug 2016 12:26:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KCQiV6044715; Sat, 20 Aug 2016 12:26:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201608201226.u7KCQiV6044715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 20 Aug 2016 12:26:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r304527 - in stable/10/lib: libc/include libc/stdlib libc/tests/stdlib libthr/thread X-SVN-Group: stable-10 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 12:26:46 -0000 Author: kib Date: Sat Aug 20 12:26:44 2016 New Revision: 304527 URL: https://svnweb.freebsd.org/changeset/base/304527 Log: MFC r303795: Add __cxa_thread_atexit(3) API implementation. Added: stable/10/lib/libc/stdlib/cxa_thread_atexit.c - copied unchanged from r303795, head/lib/libc/stdlib/cxa_thread_atexit.c stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc - copied unchanged from r303795, head/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc - copied unchanged from r303795, head/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc Modified: stable/10/lib/libc/include/libc_private.h stable/10/lib/libc/stdlib/Makefile.inc stable/10/lib/libc/stdlib/Symbol.map stable/10/lib/libc/stdlib/exit.c stable/10/lib/libc/tests/stdlib/Makefile stable/10/lib/libthr/thread/thr_exit.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/include/libc_private.h ============================================================================== --- stable/10/lib/libc/include/libc_private.h Sat Aug 20 12:23:27 2016 (r304526) +++ stable/10/lib/libc/include/libc_private.h Sat Aug 20 12:26:44 2016 (r304527) @@ -264,6 +264,12 @@ extern const char *__progname; void _malloc_thread_cleanup(void); /* + * This function is used by the threading libraries to notify libc that a + * thread is exiting, so its thread-local dtors should be called. + */ +void __cxa_thread_call_dtors(void); + +/* * These functions are used by the threading libraries in order to protect * malloc across fork(). */ Modified: stable/10/lib/libc/stdlib/Makefile.inc ============================================================================== --- stable/10/lib/libc/stdlib/Makefile.inc Sat Aug 20 12:23:27 2016 (r304526) +++ stable/10/lib/libc/stdlib/Makefile.inc Sat Aug 20 12:26:44 2016 (r304527) @@ -5,7 +5,7 @@ .PATH: ${.CURDIR}/${LIBC_ARCH}/stdlib ${.CURDIR}/stdlib MISRCS+=_Exit.c a64l.c abort.c abs.c atexit.c atof.c atoi.c atol.c atoll.c \ - bsearch.c div.c exit.c getenv.c getopt.c getopt_long.c \ + bsearch.c cxa_thread_atexit.c div.c exit.c getenv.c getopt.c getopt_long.c \ getsubopt.c hcreate.c heapsort.c imaxabs.c imaxdiv.c \ insque.c l64a.c labs.c ldiv.c llabs.c lldiv.c lsearch.c \ merge.c ptsname.c qsort.c qsort_r.c quick_exit.c radixsort.c rand.c \ Modified: stable/10/lib/libc/stdlib/Symbol.map ============================================================================== --- stable/10/lib/libc/stdlib/Symbol.map Sat Aug 20 12:23:27 2016 (r304526) +++ stable/10/lib/libc/stdlib/Symbol.map Sat Aug 20 12:26:44 2016 (r304527) @@ -104,8 +104,13 @@ FBSD_1.3 { strtouq_l; }; +FBSD_1.5 { + __cxa_thread_atexit; +}; + FBSDprivate_1.0 { __system; _system; __libc_system; + __cxa_thread_call_dtors; }; Copied: stable/10/lib/libc/stdlib/cxa_thread_atexit.c (from r303795, head/lib/libc/stdlib/cxa_thread_atexit.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/stdlib/cxa_thread_atexit.c Sat Aug 20 12:26:44 2016 (r304527, copy of r303795, head/lib/libc/stdlib/cxa_thread_atexit.c) @@ -0,0 +1,140 @@ +/*- + * Copyright (c) 2016 Mahdi Mokhtari + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include "namespace.h" +#include +#include +#include +#include +#include +#include +#include "un-namespace.h" +#include "libc_private.h" + +/* + * C++11 introduces the thread_local scope (like __thread with some + * additions). As a key-feature it should support non-trivial + * destructors, registered with __cxa_thread_atexit() to be executed + * at the thread termination. + * + * The implemention keeps a _Thread_local list of destructors per each + * thread, and calls __cxa_thread_call_dtors() on each thread's exit + * to do cleanup. For a thread calling exit(3), in particular, for + * the initial thread returning from main(), we call + * __cxa_thread_call_dtors() inside exit(). + * + * It could be possible that a dynamically loaded library, use + * thread_local variable but is dlclose()'d before thread exit. The + * destructor of this variable will then try to access the address, + * for calling it but it's unloaded, so it'll crash. We're using + * __elf_phdr_match_addr() to detect and prevent such cases and so + * prevent the crash. + */ + +#define CXA_DTORS_ITERATIONS 4 + +struct cxa_thread_dtor { + void *obj; + void (*func)(void *); + void *dso; + LIST_ENTRY(cxa_thread_dtor) entry; +}; +static _Thread_local LIST_HEAD(dtor_list, cxa_thread_dtor) dtors = + LIST_HEAD_INITIALIZER(dtors); + +int +__cxa_thread_atexit(void (*dtor_func)(void *), void *obj, void *dso_symbol) +{ + struct cxa_thread_dtor *new_dtor; + + new_dtor = malloc(sizeof(*new_dtor)); + if (new_dtor == NULL) { + errno = ENOMEM; /* forcibly override malloc(3) error */ + return (-1); + } + + new_dtor->obj = obj; + new_dtor->func = dtor_func; + new_dtor->dso = dso_symbol; + LIST_INSERT_HEAD(&dtors, new_dtor, entry); + return (0); +} + +static void +walk_cb_call(struct cxa_thread_dtor *dtor) +{ + struct dl_phdr_info phdr_info; + + if (_rtld_addr_phdr(dtor->dso, &phdr_info) && + __elf_phdr_match_addr(&phdr_info, dtor->func)) + dtor->func(dtor->obj); + else + fprintf(stderr, "__cxa_thread_call_dtors: dtr %p from " + "unloaded dso, skipping\n", (void *)(dtor->func)); +} + +static void +walk_cb_nocall(struct cxa_thread_dtor *dtor __unused) +{ +} + +static void +cxa_thread_walk(void (*cb)(struct cxa_thread_dtor *)) +{ + struct cxa_thread_dtor *dtor, *tdtor; + + LIST_FOREACH_SAFE(dtor, &dtors, entry, tdtor) { + LIST_REMOVE(dtor, entry); + cb(dtor); + free(dtor); + } +} + +/* + * This is the callback function we use to call destructors, once for + * each thread. It is called in exit(3) in libc/stdlib/exit.c and + * before exit_thread() in libthr/thread/thr_exit.c. + */ +void +__cxa_thread_call_dtors(void) +{ + int i; + + for (i = 0; i < CXA_DTORS_ITERATIONS && !LIST_EMPTY(&dtors); i++) + cxa_thread_walk(walk_cb_call); + + if (!LIST_EMPTY(&dtors)) { + fprintf(stderr, "Thread %p is exiting with more " + "thread-specific dtors created after %d iterations " + "of destructor calls\n", + _pthread_self(), i); + cxa_thread_walk(walk_cb_nocall); + } +} Modified: stable/10/lib/libc/stdlib/exit.c ============================================================================== --- stable/10/lib/libc/stdlib/exit.c Sat Aug 20 12:23:27 2016 (r304526) +++ stable/10/lib/libc/stdlib/exit.c Sat Aug 20 12:26:44 2016 (r304527) @@ -64,6 +64,12 @@ exit(status) _thread_autoinit_dummy_decl = 1; + /* + * We're dealing with cleaning up thread_local destructors in the case of + * the process termination through main() exit. + * Other cases are handled elsewhere. + */ + __cxa_thread_call_dtors(); __cxa_finalize(NULL); if (__cleanup) (*__cleanup)(); Modified: stable/10/lib/libc/tests/stdlib/Makefile ============================================================================== --- stable/10/lib/libc/tests/stdlib/Makefile Sat Aug 20 12:23:27 2016 (r304526) +++ stable/10/lib/libc/tests/stdlib/Makefile Sat Aug 20 12:26:44 2016 (r304527) @@ -1,8 +1,14 @@ # $FreeBSD$ +.include + ATF_TESTS_C+= heapsort_test ATF_TESTS_C+= mergesort_test ATF_TESTS_C+= qsort_test +.if ${COMPILER_FEATURES:Mc++11} +ATF_TESTS_CXX+= cxa_thread_atexit_test +ATF_TESTS_CXX+= cxa_thread_atexit_nothr_test +.endif TESTSDIR= ${TESTSBASE}/lib/libc/stdlib @@ -34,6 +40,10 @@ PROGS+= h_getopt h_getopt_long CFLAGS+= -I${.CURDIR} +CXXFLAGS.cxa_thread_atexit_test+= -std=c++11 +CXXFLAGS.cxa_thread_atexit_nothr_test+= -std=c++11 +LIBADD.cxa_thread_atexit_test+= pthread + .for t in h_getopt h_getopt_long CFLAGS.$t+= -I${LIBNETBSD_SRCDIR} -I${SRCTOP}/contrib/netbsd-tests LDFLAGS.$t+= -L${LIBNETBSD_OBJDIR} Copied: stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc (from r303795, head/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc Sat Aug 20 12:26:44 2016 (r304527, copy of r303795, head/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc) @@ -0,0 +1,102 @@ +/*- + * Copyright (c) 2016 Mahdi Mokhtari + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +static FILE *output = NULL; + +struct Foo { + Foo() { ATF_REQUIRE(fprintf(output, "Created\n") > 0); } + ~Foo() { ATF_REQUIRE(fprintf(output, "Destroyed\n") > 0); } + void use() { ATF_REQUIRE(fprintf(output, "Used\n") > 0); } +}; + +static thread_local Foo f; + +/* + * This test must not be linked to libpthread. + */ +ATF_TEST_CASE_WITHOUT_HEAD(cxx__nothr); +ATF_TEST_CASE_BODY(cxx__nothr) +{ + void *libthr_handle; + + /* Avoid coredump during f construction. */ + output = stderr; + + libthr_handle = dlopen("libthr.so.3", RTLD_LAZY | RTLD_GLOBAL | + RTLD_NOLOAD); + ATF_REQUIRE(libthr_handle == NULL); +} + +static void +check_local_main(void) +{ + static const char out_log[] = "Created\nUsed\nDestroyed\n"; + + fflush(output); + ATF_REQUIRE(atf::utils::compare_file("test_main.txt", out_log)); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cxx__thread_local_main); +ATF_TEST_CASE_BODY(cxx__thread_local_main) +{ + + ATF_REQUIRE((output = fopen("test_main.txt", "w")) != NULL); + f.use(); + atexit(check_local_main); +} + +extern "C" int __cxa_thread_atexit(void (*)(void *), void *, void *); + +static void +again(void *arg) +{ + + __cxa_thread_atexit(again, arg, &output); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cxx__thread_inf_dtors); +ATF_TEST_CASE_BODY(cxx__thread_inf_dtors) +{ + + again(NULL); +} + +ATF_INIT_TEST_CASES(tcs) +{ + + ATF_ADD_TEST_CASE(tcs, cxx__nothr); + ATF_ADD_TEST_CASE(tcs, cxx__thread_local_main); + ATF_ADD_TEST_CASE(tcs, cxx__thread_inf_dtors); +} Copied: stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc (from r303795, head/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc Sat Aug 20 12:26:44 2016 (r304527, copy of r303795, head/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc) @@ -0,0 +1,180 @@ +/*- + * Copyright (c) 2016 Mahdi Mokhtari + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +static FILE *output = NULL; + +struct Foo { + Foo() { ATF_REQUIRE(fprintf(output, "Created\n") > 0); } + ~Foo() { ATF_REQUIRE(fprintf(output, "Destroyed\n") > 0); } + void use() { ATF_REQUIRE(fprintf(output, "Used\n") > 0); } +}; + +struct Bar { + Bar() {} + ~Bar() { + thread_local static Foo foo; + ATF_REQUIRE(fprintf(output, "DIED\n") > 0); + } + void use() {} +}; + +extern "C" int __cxa_thread_atexit(void (*)(void *), void *, void *); + +static void +again(void *arg) +{ + + __cxa_thread_atexit(again, arg, &output); +} + +struct Baz { + Baz() {} + ~Baz() { + again(NULL); + } + void use() {} +}; + +static thread_local Foo f; +static thread_local Foo g; +static thread_local Bar h; +static thread_local Baz e; + +/* + * This test must be linked to libpthread. + */ +ATF_TEST_CASE_WITHOUT_HEAD(cxx__thr); +ATF_TEST_CASE_BODY(cxx__thr) +{ + void *libthr_handle; + + /* Avoid coredump during f construction. */ + output = stderr; + + libthr_handle = dlopen("libthr.so.3", RTLD_LAZY | RTLD_GLOBAL | + RTLD_NOLOAD); + ATF_REQUIRE(libthr_handle != NULL); + dlclose(libthr_handle); +} + +/* + * In this test f.use() will test cxa_thread_atexit() in non-threaded mode. + * After f.use() main will be threaded and we'll have one additional thread + * with its own TLS data. + */ +ATF_TEST_CASE_WITHOUT_HEAD(cxx__thread_local_before); +ATF_TEST_CASE_BODY(cxx__thread_local_before) +{ + static const char out_log[] = "Created\nCreated\nUsed\nCreated\n" + "Created\nUsed\nCreated\nDIED\nDestroyed\nDestroyed\nDestroyed\n"; + + ATF_REQUIRE((output = fopen("test_before.txt", "w")) != NULL); + + f.use(); + std::thread t([]() { f.use(); }); + t.join(); + + fflush(output); + + ATF_REQUIRE(atf::utils::compare_file("test_before.txt", out_log)); +} + +/* + * In this test, f.use() will test __cxa_thread_atexit() + * in threaded mode (but still in main-threaed). + */ +ATF_TEST_CASE_WITHOUT_HEAD(cxx__thread_local_after); +ATF_TEST_CASE_BODY(cxx__thread_local_after) +{ + static const char out_log[] = "Created\nCreated\nUsed\nCreated\n" + "DIED\nDestroyed\nDestroyed\nDestroyed\nCreated\nCreated\nUsed\n"; + + ATF_REQUIRE((output = fopen("test_after.txt", "w")) != NULL); + + std::thread t([]() { g.use(); }); + t.join(); + sleep(1); + g.use(); + + fflush(output); + + ATF_REQUIRE(atf::utils::compare_file("test_after.txt", out_log)); +} + +/* + * In this test, we register a new dtor while dtors are being run + * in __cxa_thread_atexit(). + */ +ATF_TEST_CASE_WITHOUT_HEAD(cxx__thread_local_add_while_calling_dtors); +ATF_TEST_CASE_BODY(cxx__thread_local_add_while_calling_dtors) +{ + static const char out_log[] = "Created\nCreated\nCreated\nDIED\n" + "Destroyed\nDestroyed\nDestroyed\n"; + + ATF_REQUIRE((output = fopen("test_add_meanwhile.txt", "w")) != NULL); + + std::thread t([]() { h.use(); }); + t.join(); + sleep(1); + + fflush(output); + + ATF_REQUIRE(atf::utils::compare_file("test_add_meanwhile.txt", out_log)); +} + +ATF_TEST_CASE_WITHOUT_HEAD(cxx__thread_inf_dtors); +ATF_TEST_CASE_BODY(cxx__thread_inf_dtors) +{ + + /* + * Only added to make isolated run of this test not + * coredumping. Construction of Foo objects require filled + * output. + */ + output = stderr; + + std::thread t([]() { e.use(); }); + t.join(); +} + +ATF_INIT_TEST_CASES(tcs) +{ + + ATF_ADD_TEST_CASE(tcs, cxx__thr); + ATF_ADD_TEST_CASE(tcs, cxx__thread_local_before); + ATF_ADD_TEST_CASE(tcs, cxx__thread_local_after); + ATF_ADD_TEST_CASE(tcs, cxx__thread_local_add_while_calling_dtors); + ATF_ADD_TEST_CASE(tcs, cxx__thread_inf_dtors); +} Modified: stable/10/lib/libthr/thread/thr_exit.c ============================================================================== --- stable/10/lib/libthr/thread/thr_exit.c Sat Aug 20 12:23:27 2016 (r304526) +++ stable/10/lib/libthr/thread/thr_exit.c Sat Aug 20 12:26:44 2016 (r304527) @@ -151,8 +151,12 @@ thread_unwind_stop(int version, _Unwind_ __pthread_cleanup_pop_imp(1); } - if (done) + if (done) { + /* Tell libc that it should call non-trivial TLS dtors. */ + __cxa_thread_call_dtors(); + exit_thread(); /* Never return! */ + } return (_URC_NO_REASON); } @@ -246,6 +250,8 @@ cleanup: while (curthread->cleanup != NULL) { __pthread_cleanup_pop_imp(1); } + __cxa_thread_call_dtors(); + exit_thread(); } @@ -253,6 +259,7 @@ cleanup: while (curthread->cleanup != NULL) { __pthread_cleanup_pop_imp(1); } + __cxa_thread_call_dtors(); exit_thread(); #endif /* _PTHREAD_FORCED_UNWIND */ From owner-svn-src-all@freebsd.org Sat Aug 20 12:49:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62C0FBC0BBF; Sat, 20 Aug 2016 12:49:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1919B149B; Sat, 20 Aug 2016 12:49:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KCn6Yd052529; Sat, 20 Aug 2016 12:49:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KCn6T0052526; Sat, 20 Aug 2016 12:49:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608201249.u7KCn6T0052526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Aug 2016 12:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304528 - in stable/11: contrib/llvm/lib/Target/X86 contrib/llvm/tools/clang/lib/Basic lib/clang X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 12:49:07 -0000 Author: dim Date: Sat Aug 20 12:49:05 2016 New Revision: 304528 URL: https://svnweb.freebsd.org/changeset/base/304528 Log: MFC r304319: Pull in r262772 from upstream clang trunk (by Simon Pilgrim): [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't support XSAVE. Differential Revision: http://reviews.llvm.org/D17682 Pull in r262782 from upstream llvm trunk (by Simon Pilgrim): [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't support XSAVE. Differential Revision: http://reviews.llvm.org/D17683 This ensures clang does not emit AVX instructions for CPUTYPE=btver1. Reported by: Michel Depeige PR: 211864 Modified: stable/11/contrib/llvm/lib/Target/X86/X86.td stable/11/contrib/llvm/tools/clang/lib/Basic/Targets.cpp stable/11/lib/clang/freebsd_cc_version.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/llvm/lib/Target/X86/X86.td ============================================================================== --- stable/11/contrib/llvm/lib/Target/X86/X86.td Sat Aug 20 12:26:44 2016 (r304527) +++ stable/11/contrib/llvm/lib/Target/X86/X86.td Sat Aug 20 12:49:05 2016 (r304528) @@ -576,7 +576,6 @@ def : Proc<"btver1", [ FeaturePRFCHW, FeatureLZCNT, FeaturePOPCNT, - FeatureXSAVE, FeatureSlowSHLD, FeatureLAHFSAHF ]>; Modified: stable/11/contrib/llvm/tools/clang/lib/Basic/Targets.cpp ============================================================================== --- stable/11/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Sat Aug 20 12:26:44 2016 (r304527) +++ stable/11/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Sat Aug 20 12:49:05 2016 (r304528) @@ -2731,7 +2731,6 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "prfchw", true); setFeatureEnabledImpl(Features, "cx16", true); setFeatureEnabledImpl(Features, "fxsr", true); - setFeatureEnabledImpl(Features, "xsave", true); break; case CK_BDVER4: setFeatureEnabledImpl(Features, "avx2", true); Modified: stable/11/lib/clang/freebsd_cc_version.h ============================================================================== --- stable/11/lib/clang/freebsd_cc_version.h Sat Aug 20 12:26:44 2016 (r304527) +++ stable/11/lib/clang/freebsd_cc_version.h Sat Aug 20 12:49:05 2016 (r304528) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1100500 +#define FREEBSD_CC_VERSION 1100501 From owner-svn-src-all@freebsd.org Sat Aug 20 13:30:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45DC8BC04A2; Sat, 20 Aug 2016 13:30:00 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EEE1B1813; Sat, 20 Aug 2016 13:29:59 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KDTxJx067448; Sat, 20 Aug 2016 13:29:59 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KDTw38067445; Sat, 20 Aug 2016 13:29:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608201329.u7KDTw38067445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Aug 2016 13:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r304529 - in releng/11.0: contrib/llvm/lib/Target/X86 contrib/llvm/tools/clang/lib/Basic lib/clang X-SVN-Group: releng 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 13:30:00 -0000 Author: dim Date: Sat Aug 20 13:29:58 2016 New Revision: 304529 URL: https://svnweb.freebsd.org/changeset/base/304529 Log: MFC r304319: Pull in r262772 from upstream clang trunk (by Simon Pilgrim): [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't support XSAVE. Differential Revision: http://reviews.llvm.org/D17682 Pull in r262782 from upstream llvm trunk (by Simon Pilgrim): [X86] AMD Bobcat CPU (btver1) doesn't support XSAVE btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't support XSAVE. Differential Revision: http://reviews.llvm.org/D17683 This ensures clang does not emit AVX instructions for CPUTYPE=btver1. Approved by: re (kib) Reported by: Michel Depeige PR: 211864 Modified: releng/11.0/contrib/llvm/lib/Target/X86/X86.td releng/11.0/contrib/llvm/tools/clang/lib/Basic/Targets.cpp releng/11.0/lib/clang/freebsd_cc_version.h Directory Properties: releng/11.0/ (props changed) Modified: releng/11.0/contrib/llvm/lib/Target/X86/X86.td ============================================================================== --- releng/11.0/contrib/llvm/lib/Target/X86/X86.td Sat Aug 20 12:49:05 2016 (r304528) +++ releng/11.0/contrib/llvm/lib/Target/X86/X86.td Sat Aug 20 13:29:58 2016 (r304529) @@ -576,7 +576,6 @@ def : Proc<"btver1", [ FeaturePRFCHW, FeatureLZCNT, FeaturePOPCNT, - FeatureXSAVE, FeatureSlowSHLD, FeatureLAHFSAHF ]>; Modified: releng/11.0/contrib/llvm/tools/clang/lib/Basic/Targets.cpp ============================================================================== --- releng/11.0/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Sat Aug 20 12:49:05 2016 (r304528) +++ releng/11.0/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Sat Aug 20 13:29:58 2016 (r304529) @@ -2731,7 +2731,6 @@ bool X86TargetInfo::initFeatureMap( setFeatureEnabledImpl(Features, "prfchw", true); setFeatureEnabledImpl(Features, "cx16", true); setFeatureEnabledImpl(Features, "fxsr", true); - setFeatureEnabledImpl(Features, "xsave", true); break; case CK_BDVER4: setFeatureEnabledImpl(Features, "avx2", true); Modified: releng/11.0/lib/clang/freebsd_cc_version.h ============================================================================== --- releng/11.0/lib/clang/freebsd_cc_version.h Sat Aug 20 12:49:05 2016 (r304528) +++ releng/11.0/lib/clang/freebsd_cc_version.h Sat Aug 20 13:29:58 2016 (r304529) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1100005 +#define FREEBSD_CC_VERSION 1100006 From owner-svn-src-all@freebsd.org Sat Aug 20 14:04:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21932BC0D16; Sat, 20 Aug 2016 14:04:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D09CD188C; Sat, 20 Aug 2016 14:04:52 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KE4qCS082083; Sat, 20 Aug 2016 14:04:52 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KE4pML082079; Sat, 20 Aug 2016 14:04:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201608201404.u7KE4pML082079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 20 Aug 2016 14:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304530 - in head: contrib/llvm/lib/Target/ARM/MCTargetDesc lib/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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 14:04:53 -0000 Author: dim Date: Sat Aug 20 14:04:51 2016 New Revision: 304530 URL: https://svnweb.freebsd.org/changeset/base/304530 Log: Pull in r265122 from upstream llvm trunk (by James Molloy): Fix for pr24346: arm asm label calculation error in sub Some ARM instructions encode 32-bit immediates as a 8-bit integer (0-255) and a 4-bit rotation (0-30, even) in its least significant 12 bits. The original fixup, FK_Data_4, patches the instruction by the value bit-to-bit, regardless of the encoding. For example, assuming the label L1 and L2 are 0x0 and 0x104 respectively, the following instruction: add r0, r0, #(L2 - L1) ; expects 0x104, i.e., 260 would be assembled to the following, which adds 1 to r0, instead of 260: e2800104 add r0, r0, #4, 2 ; equivalently 1 The new fixup kind fixup_arm_mod_imm takes care of the encoding: e2800f41 add r0, r0, #260 Patch by Ting-Yuan Huang! This fixes label calculation for ARM assembly, and is needed to enable ARM assembly sources for OpenSSL. Requested by: jkim MFC after: 3 days Modified: head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMFixupKinds.h head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp head/lib/clang/freebsd_cc_version.h Modified: head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp Sat Aug 20 13:29:58 2016 (r304529) +++ head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp Sat Aug 20 14:04:51 2016 (r304530) @@ -90,6 +90,7 @@ const MCFixupKindInfo &ARMAsmBackend::ge {"fixup_arm_movw_lo16", 0, 20, 0}, {"fixup_t2_movt_hi16", 0, 20, 0}, {"fixup_t2_movw_lo16", 0, 20, 0}, + {"fixup_arm_mod_imm", 0, 12, 0}, }; const static MCFixupKindInfo InfosBE[ARM::NumTargetFixupKinds] = { // This table *must* be in the order that the fixup_* kinds are defined in @@ -133,6 +134,7 @@ const MCFixupKindInfo &ARMAsmBackend::ge {"fixup_arm_movw_lo16", 12, 20, 0}, {"fixup_t2_movt_hi16", 12, 20, 0}, {"fixup_t2_movw_lo16", 12, 20, 0}, + {"fixup_arm_mod_imm", 20, 12, 0}, }; if (Kind < FirstTargetFixupKind) @@ -624,6 +626,13 @@ unsigned ARMAsmBackend::adjustFixupValue return Value; } + case ARM::fixup_arm_mod_imm: + Value = ARM_AM::getSOImmVal(Value); + if (Ctx && Value >> 12) { + Ctx->reportError(Fixup.getLoc(), "out of range immediate fixup value"); + return 0; + } + return Value; } } @@ -690,6 +699,7 @@ static unsigned getFixupKindNumBytes(uns case FK_Data_2: case ARM::fixup_arm_thumb_br: case ARM::fixup_arm_thumb_cb: + case ARM::fixup_arm_mod_imm: return 2; case ARM::fixup_arm_pcrel_10_unscaled: @@ -766,6 +776,7 @@ static unsigned getFixupKindContainerSiz case ARM::fixup_arm_movw_lo16: case ARM::fixup_t2_movt_hi16: case ARM::fixup_t2_movw_lo16: + case ARM::fixup_arm_mod_imm: // Instruction size is 4 bytes. return 4; } Modified: head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMFixupKinds.h ============================================================================== --- head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMFixupKinds.h Sat Aug 20 13:29:58 2016 (r304529) +++ head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMFixupKinds.h Sat Aug 20 14:04:51 2016 (r304530) @@ -100,6 +100,9 @@ enum Fixups { fixup_t2_movt_hi16, // :upper16: fixup_t2_movw_lo16, // :lower16: + // fixup_arm_mod_imm - Fixup for mod_imm + fixup_arm_mod_imm, + // Marker LastTargetFixupKind, NumTargetFixupKinds = LastTargetFixupKind - FirstTargetFixupKind Modified: head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp ============================================================================== --- head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp Sat Aug 20 13:29:58 2016 (r304529) +++ head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp Sat Aug 20 14:04:51 2016 (r304530) @@ -312,12 +312,8 @@ public: // Support for fixups (MCFixup) if (MO.isExpr()) { const MCExpr *Expr = MO.getExpr(); - // In instruction code this value always encoded as lowest 12 bits, - // so we don't have to perform any specific adjustments. - // Due to requirements of relocatable records we have to use FK_Data_4. - // See ARMELFObjectWriter::ExplicitRelSym and - // ARMELFObjectWriter::GetRelocTypeInner for more details. - MCFixupKind Kind = MCFixupKind(FK_Data_4); + // Fixups resolve to plain values that need to be encoded. + MCFixupKind Kind = MCFixupKind(ARM::fixup_arm_mod_imm); Fixups.push_back(MCFixup::create(0, Expr, Kind, MI.getLoc())); return 0; } Modified: head/lib/clang/freebsd_cc_version.h ============================================================================== --- head/lib/clang/freebsd_cc_version.h Sat Aug 20 13:29:58 2016 (r304529) +++ head/lib/clang/freebsd_cc_version.h Sat Aug 20 14:04:51 2016 (r304530) @@ -1,3 +1,3 @@ /* $FreeBSD$ */ -#define FREEBSD_CC_VERSION 1200001 +#define FREEBSD_CC_VERSION 1200002 From owner-svn-src-all@freebsd.org Sat Aug 20 14:52:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7FC2BC0D45; Sat, 20 Aug 2016 14:52:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 963E415B3; Sat, 20 Aug 2016 14:52:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CD550B9B7; Sat, 20 Aug 2016 10:52:22 -0400 (EDT) From: John Baldwin To: Warner Losh Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r304506 - in head: . release/doc/en_US.ISO8859-1/hardware share/man/man4/man4.i386 sys/conf sys/dev/wl sys/i386/conf sys/modules sys/modules/wl targets/pseudo/userland tools/build/mk to... Date: Sat, 20 Aug 2016 07:33:59 -0700 Message-ID: <9056382.PA4dZNFpPe@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201608192227.u7JMREIo032684@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 20 Aug 2016 10:52:22 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 14:52:24 -0000 On Friday, August 19, 2016 06:38:01 PM Warner Losh wrote: > On Fri, Aug 19, 2016 at 4:27 PM, John Baldwin wrote: > > Author: jhb > > Date: Fri Aug 19 22:27:14 2016 > > New Revision: 304506 > > URL: https://svnweb.freebsd.org/changeset/base/304506 > > > > Log: > > Remove the wl(4) driver and wlconfig(8) utility. > > > > The wl(4) driver supports pre-802.11 PCCard wireless adapters that > > are slower than 802.11b. They do not work with any of the 802.11 > > framework and the driver hasn't been reported to actually work in a > > long time. > > s/PC Card/ISA/g > > There never were any PC Card wl cards. These cards were ISA only > and ran at up to 1Mbps. Wow, even worse than I thought. -- John Baldwin From owner-svn-src-all@freebsd.org Sat Aug 20 14:52:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B615BBC0D44; Sat, 20 Aug 2016 14:52:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 924C415B2; Sat, 20 Aug 2016 14:52:24 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6F86CB9B3; Sat, 20 Aug 2016 10:52:21 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304513 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/ie sys/i386/conf sys/modules sys/modules/ie sys/pc98/conf Date: Sat, 20 Aug 2016 07:51:55 -0700 Message-ID: <1699917.hhfoKyASTk@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201608200049.u7K0nUYd084685@repo.freebsd.org> References: <201608200049.u7K0nUYd084685@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 20 Aug 2016 10:52:21 -0400 (EDT) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 14:52:24 -0000 On Saturday, August 20, 2016 12:49:30 AM John Baldwin wrote: > Author: jhb > Date: Sat Aug 20 00:49:29 2016 > New Revision: 304513 > URL: https://svnweb.freebsd.org/changeset/base/304513 > > Log: > Remove the ie(4) driver for Intel 82586 ISA Ethernet adapters. > > This driver only supports 10Mb Ethernet using PIO (the hardware supports > DMA, but the driver only does PIO). There are not any PCCard adapters > supported by this driver, only ISA cards. In addition, it does not use > bus_space but instead uses bcopy with volatile pointers triggering a > host of warnings. (if_ie.c is one of 3 files always built with > -Wno-error) > > Relnotes: yes This concludes the list of older drivers I had from earlier after working on the timeout(9) -> callout(9) changes (almost finished with that, just a few things left to test changes for, one of them being fail points before we can remove timeout()/untimeout() entirely). I do not have plans for removing any other drivers, though am open to suggestions. Some possibilities include: - tty drivers that haven't been updated to new tty and have been disconnected from the build since 8.0 including digi(4) and cy(4). I know Bruce has patches for sio(4) that I just haven't merged, so I'm inclined to leave sio(4), but the other disconnected drivers are candidates I think. - Older storage adapters: - aha (ISA) - ahb (EISA) - adv (ISA / EISA / PCI) - adw (PCI)? - bt (ISA / EISA / PCI) - aic (ISA / PCCard) - ct (ISA / CBUS) - dpt (ISA / EISA / PCI) - ncv (PCCard / PCI) - nsp (PCCard) - stg (ISA / PCCard / PCI) (Note: some of these are PC-98 related and might remove too much of the PC-98 ecosystem if removed?) - mse(4) (ISA-only non-PS-2, non-serial mouse) - joy(4) (ISA-only, was on various Sound Cards, etc., but I haven't seen a "game port" on a modern box in a long while) -- John Baldwin From owner-svn-src-all@freebsd.org Sat Aug 20 14:52:40 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9958BC0DA0; Sat, 20 Aug 2016 14:52:40 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A20D918B7; Sat, 20 Aug 2016 14:52:40 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-io0-x236.google.com with SMTP id q83so73969936iod.1; Sat, 20 Aug 2016 07:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cHtUpT9qnNvZfxYRWw6IqHPt1+9EbeZ3eOWKs7pukZs=; b=aqhJaldXlqPzueZOsG7AioREiCOAZ5k6sMiSZfAojmteFKacrp6kGwhW4EPf7rBIN5 /Wi19jEkvROsoAYVxcSpQGaTj3swMtbnHitteoL93Rq4Z3PNk+zsHAdLNA0EWJFCyy4N 76t5UND/gaPYodievPqH7gKYBnAEpE0dZWJMIWMeytbEjtKCXPRZSJCSibQ2jnn7tJhw dC0x2B2NQsJ9XfqBuZsEwoutSb39GTJ2dZIZqRXBF2N6tAd6USfrkzAS5kL+tMTNo2hG y50zvc17U945MPMyxWPuxehtcmestbWMB3sIeDkh4P7rTPTSdpoqP7gZOlTirVuIvgR6 k/BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cHtUpT9qnNvZfxYRWw6IqHPt1+9EbeZ3eOWKs7pukZs=; b=HrzH7zfXqYb/q4HTv9y3+nzqNjXppWbROvc0PmdFUt5FqxR2+b2Su9pj/lr+bqudX4 EbhJrQmx/XhW8bRaylQ+jKf0HYfEkM6uN8bihIOFS+7MbhfStuiW4epRnoi0RjdhTwyL /ILKoep4nxcPPhP3ZDc1y2qTNrPCtOjY3pGiGCF7FCQ3AwuHJJHWPQqEzMIc/ian/egM 5isqEJ9b0v0ecBqima2JqzgwiKnsSL9ERyMld3vk/pxtcAnOC3dr/aX5Y6VK9TWpYlgi 4IFmDZhsEmSLCXS+z38wvYbGjjJEM/o53+QG4lhiOHCb8AfXhapiD0+sf/GbztHfhMND md3g== X-Gm-Message-State: AEkoousFo5DJ1/4T9xUePnNL0uzO6BL+cBO/batve8JtNk2oIktNQPpf8y7WlrKqFg/YVsiCFt7q7Jnkwg1tTA== X-Received: by 10.107.159.147 with SMTP id i141mr14877367ioe.29.1471704760079; Sat, 20 Aug 2016 07:52:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Sat, 20 Aug 2016 07:52:39 -0700 (PDT) In-Reply-To: <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> From: Ryan Stone Date: Sat, 20 Aug 2016 10:52:39 -0400 Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Bruce Simpson Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 14:52:41 -0000 On Sat, Aug 20, 2016 at 7:48 AM, Bruce Simpson wrote: > It is perfectly legal for broadcast packets to be addressed to the end of > a P2P or non-Ethernet link, which may not set M_BCAST or M_MCAST. The > classic example is ATM (Non-Broadcast, Multiple Access (NBMA)) but the > situation may be readily observed with loopback or tunnels. > Can you give an example of a tunneling protocol support by FreeBSD that may be affected? I looked and didn't see any. OpenVPN, as best that I can tell, injects frames into a tap interface, which appears as a Ethernet interface, for example. From owner-svn-src-all@freebsd.org Sat Aug 20 14:54:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6FD4BC0EB1; Sat, 20 Aug 2016 14:54:54 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FDFC1AA6; Sat, 20 Aug 2016 14:54:54 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-io0-x22b.google.com with SMTP id b62so73648816iod.3; Sat, 20 Aug 2016 07:54:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Tfi3owlqCfj8981TI6k8TparvoQIFPJNpp1nuc9Uur0=; b=ZwRPb34zv8WzCnIyQbXNLC+SjRjo7gV35ReNflHKOBMbXHw5Be56C8w5B91g1PeuEU LMxRz2bKTGA0t05lNPqI6nhSb0rgRbrMidOiDBXHzz7PdQsnQ812tk4X8KZrmVqaNW4w d/JGWWM0W5e/bCjRuQo3GAew6Nn9k5cpKCDKqO6UQouK9Wo3tsViripHYjhuxkzYrseJ EhoRbcFP1yyp5ofMRHk0jmm80FoSXtCquHldZv6ZwQsEho9wIbf+zb4PV/DZsDkepEKT HT03jWPVgojRRDE6mRwJ0Kp9fpWYIjww+O/Z0fCN8IVLHuWY8aIVrAK0WFNacG+3IAt5 adCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Tfi3owlqCfj8981TI6k8TparvoQIFPJNpp1nuc9Uur0=; b=eQtpIeH0ZOchqFeGClslJ+m29VrrV5r3HpmB8abDAHLVsjURdxOb0KtJ4qCaAvHaOi gIvRxGfkE47SxYky9lUpLkftxZz3iob9uj4jwzjBMJ5xYblyMGTEiF5ZeNLA/NqyNo0H uNIWdzH3vTL4jSe25+Tnn1GnwH4qNb+JVlFHxTNivIRSEIE+w8sFfx5bq+eWsXUdIRJZ yzlJRayW/5EsulAbKTsiDdsdDCaT5QPY7cormuTrZT+WQ4KZiWAT8/t2OS1fOJ55zwVt E7liaweA7ELJqpPham8uc03sbi3zA1Ty0nRyl0prUYcmeh6nayn35LILFlAcJyUdOEFg EVEQ== X-Gm-Message-State: AEkoouvBmPOaHLghL743/i7hFXdRFfhUTv0AmCF+bLddw/V9z4fR/smac3yGp8GsWjHoUFBDSxd9U1ei0JlLig== X-Received: by 10.107.129.97 with SMTP id c94mr15695178iod.102.1471704894032; Sat, 20 Aug 2016 07:54:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Sat, 20 Aug 2016 07:54:53 -0700 (PDT) In-Reply-To: <96b7428a-0a57-6d6d-4b2e-24010596ceaf@FreeBSD.org> References: <201608182259.u7IMx0bx001967@repo.freebsd.org> <96b7428a-0a57-6d6d-4b2e-24010596ceaf@FreeBSD.org> From: Ryan Stone Date: Sat, 20 Aug 2016 10:54:53 -0400 Message-ID: Subject: Re: svn commit: r304435 - head/sys/netinet To: koobs@freebsd.org Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 14:54:55 -0000 On Sat, Aug 20, 2016 at 6:08 AM, Kubilay Kocak wrote: > Hi Ryan, > > Could you elaborate on any of the potential performance implications of > this? > As if r304437, skipping the call to in_broadcast() means that we avoid an additional (potentially heavily contended) rlock acquire and release on the ifnet address list. From owner-svn-src-all@freebsd.org Sat Aug 20 15:01:51 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 272F3BC005D; Sat, 20 Aug 2016 15:01:51 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E9E221DD0; Sat, 20 Aug 2016 15:01:50 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 6914A201A8; Sat, 20 Aug 2016 11:01:49 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 11:01:49 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=Pj5M0mpxOizfmg7RoJRrR2rGghw=; b=Q6CEd3 6mSvdjhgwE1UXy++g9PnzNiMpaEGO7HkOjcv8kyA8eu26/dHf6Y7t9VhlhBeIm9K PoSGU+rQF8D1Gw/uIyzeToeMbB6z/6HKNzk7r8rSrju2SfrxblxzqrmB87WamAXU azsT2k1yy/NJcQ4+Q+KsiRnIec7aXhIlBCJIc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=Pj5M0mpxOizfmg7 RoJRrR2rGghw=; b=EPF66NF5cq0EPSgLVcBl76ujSPVAyg9jLi62fitbW8pdCBF 0HtSZ7QLocjXWrEDev4G+mmuGBD6PRk3OAW7kXUX3OUcgp12jVLG1WFUZ2os/42J nLA1XKFqm8N2oD+TOLxWkZmL85p9+hkB1r0lH3Rv2/nmwl566+C99ogpDEx4= X-Sasl-enc: aUdf3kewzlhPGIt7OEyQ64m95xBUAmC3hV4wOBoLrkOr 1471705308 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 4F568CCE6C; Sat, 20 Aug 2016 11:01:48 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bruce Simpson Message-ID: Date: Sat, 20 Aug 2016 16:01:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 15:01:51 -0000 On 20/08/16 15:52, Ryan Stone wrote: > It is perfectly legal for broadcast packets to be addressed to the > end of a P2P or non-Ethernet link, which may not set M_BCAST or > M_MCAST. The classic example is ATM (Non-Broadcast, Multiple Access > (NBMA)) but the situation may be readily observed with loopback or > tunnels. > > Can you give an example of a tunneling protocol support by FreeBSD that > may be affected? I looked and didn't see any. OpenVPN, as best that I > can tell, injects frames into a tap interface, which appears as a > Ethernet interface, for example. Potentially any and all PPP, tun(4); any link layer with plain IP on top of it other than Ethernet, which may not set M_BCAST for an IPv4 broadcast packet (or does not distinguish between broadcast and unicast/multicast packets). if_ethersubr.c does set M_BCAST correctly for Ethernet broadcast packets in the receive path. That is guaranteed, and the majority of Ethernet network drivers will pass packets up the stack through it more or less directly. tap(4) is an exception because, as you rightly point out, it is pretty faithfully Ethernet, although I may have had to add code around Ethernet address conditions like this to it in the very distant past. tun(4) on the other hand is a plain, PPP-like, IP tunnel. But this mbuf flag is not guaranteed to be set in all situations; e.g. where the link layer does not have the concept of broadcast being distinct from other kinds of network traffic. PPP and ATM are the most obvious examples. From owner-svn-src-all@freebsd.org Sat Aug 20 15:24:15 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 441DCBC053E; Sat, 20 Aug 2016 15:24:15 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [192.108.105.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "StartCom Class 2 IV Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29BA51BE6; Sat, 20 Aug 2016 15:24:14 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (bones.soaustin.net [192.108.105.22]) by mail.soaustin.net (Postfix) with ESMTPSA id 98FC1C6; Sat, 20 Aug 2016 10:24:07 -0500 (CDT) Date: Sat, 20 Aug 2016 10:24:06 -0500 From: Mark Linimon To: John Baldwin Cc: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r304513 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/ie sys/i386/conf sys/modules sys/modules/ie sys/pc98/conf Message-ID: <20160820152406.GA8132@lonesome.com> References: <201608200049.u7K0nUYd084685@repo.freebsd.org> <1699917.hhfoKyASTk@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1699917.hhfoKyASTk@ralph.baldwin.cx> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 15:24:15 -0000 On Sat, Aug 20, 2016 at 07:51:55AM -0700, John Baldwin wrote: > - aha (ISA) > - bt (ISA / EISA / PCI) If anyone complains, tell them I'll ship them cards. If they consider that a threat ... so be it :-) (I *am* in the middle of a big decluttering, you know. I can find them ...) mcl From owner-svn-src-all@freebsd.org Sat Aug 20 15:27:26 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5578BC05E0; Sat, 20 Aug 2016 15:27:26 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com [IPv6:2607:f8b0:4001:c0b::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C82D1D85; Sat, 20 Aug 2016 15:27:26 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-it0-x22d.google.com with SMTP id f6so48938004ith.0; Sat, 20 Aug 2016 08:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=eioi5Epu3j8krd89wzUcKFDS3pNH7+kcQliPrOJpvl8=; b=YxYVjF2IEPBXiy58KVxZPXQfzU8K14PrAmLlZW8LekOt+XyHAQevdSYOzP1jv1DfDD esKy1+zfK4swBiV9iLhksZ/r4pNsPAAT8OZ1RvcwiMx1Y1UOOH4jL1iLVsoxi3fyLQMI 6IXfOmQlqSaCg3ak/A2Pjncd4bhg+c/N9IxItHmr946VEXgACw2F4VQosP7eqimzkA8O vEuO7GLiUpTx3AoW42ChrK74zshqqU0UFTvVy5HOgFEOpRt2hefo67y44LTymj3NUOmc GnjBKaaDLfR/qCTDPlhvEmDR5FauIyj8dLk/t6PWTByBv/lAmEVv51ldwyi3Qww0GjrE 4IIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=eioi5Epu3j8krd89wzUcKFDS3pNH7+kcQliPrOJpvl8=; b=G90gFA109hyX31Y1mqA9j2vux9cnyH4dqrz8xKwn4chD4/cDlRzuo+zeJjMG9vDieT BXgOlJz1u12bLxzctVl2jkkWwr+hGNe0bDyALFTH6IYHFj5DFZY619h3cGXXxRs1HNNO DjH2/D/UkWcVoqNRF4dYXKWx9I0kqNYQWk/r1/eXISGmQ/3ouBn7cmjG6pI3lvs9V+9A 5QyclgKovNKc9DW2YNyI30Eglm9aii1ns1gbsdd8CCJ7CrEJiJ8RL30cZ+JaEKfLEVhR l2iNK9NyDEn1lkw+dttW4FXAjRsWXu8giYMNfPSaOoCtCrjOc2fsIPAvQFP0ahlP73/U yzDA== X-Gm-Message-State: AEkoouvRH/VW0sPWGLpGBYPIEVd3LT+1cyntIJXrwQ+UjvtUUoh2b65o2w9SivrLF1wF/FXPqzcsR0Wra+zghQ== X-Received: by 10.36.79.148 with SMTP id c142mr12610355itb.20.1471706845911; Sat, 20 Aug 2016 08:27:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Sat, 20 Aug 2016 08:27:25 -0700 (PDT) In-Reply-To: References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> From: Ryan Stone Date: Sat, 20 Aug 2016 11:27:25 -0400 Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Bruce Simpson Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 15:27:26 -0000 On Sat, Aug 20, 2016 at 11:01 AM, Bruce Simpson wrote: > tun(4) on the other hand is a plain, PPP-like, IP tunnel. > Can you send a broadcast packet through an L3 tunnel? I thought that a L2 tunnel was required. But this mbuf flag is not guaranteed to be set in all situations; e.g. > where the link layer does not have the concept of broadcast being distinct > from other kinds of network traffic. PPP and ATM are the most obvious > examples. > We don't support ATM, but PPP is a good example. I hadn't thought of that. Hm, ip_input() already has to check for a broadcast IP. What it set M_BCAST on the mbuf at that time? From owner-svn-src-all@freebsd.org Sat Aug 20 15:42:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 675A7BC0AEF; Sat, 20 Aug 2016 15:42:55 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 293F218C7; Sat, 20 Aug 2016 15:42:54 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id D9A86202F5; Sat, 20 Aug 2016 11:42:53 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 11:42:53 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=LYUiRwQW/Yn0ths87CpgZiZgB3k=; b=LLZSIc /4dEN4bPR8LZNV0pVk97oPatlvOCi3fR3ng3wkcfoC3wx9pcCPSrpm56MmS9G4xx 6cED7pjGf5Bklbh6LnHNA5yWckKCdnmF7x7AU2Sczw+xOPK05jzcv8nJ8ctlTbLQ BTTKIgKVauYxvtk7psDSrPXudLtk41oez/bK0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=LYUiRwQW/Yn0ths 87CpgZiZgB3k=; b=UK2Esf1gn6ZpSIYDvMQ8a6+kAsRA901DcVhJimC6xoozUd7 E0+qUHSQAjkRai5wk2ZPz+x2TnwvQqkmX1DxM679iAbER7UEzzyE3f6DTP9yr5YO an48Ddp7fnG6K3gKE/1HiVFuK3lhhav1waDEp8R6PhpHndgvV4WAMazwlK/o= X-Sasl-enc: xwIL2zYPqE4RXuqZLNZV+0mKcz0R/myLAhUpidRGoScs 1471707773 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 04CA2F296F; Sat, 20 Aug 2016 11:42:52 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bruce Simpson Message-ID: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> Date: Sat, 20 Aug 2016 16:42:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 15:42:55 -0000 On 20/08/16 16:27, Ryan Stone wrote: > Can you send a broadcast packet through an L3 tunnel? I thought that a > L2 tunnel was required. Yes. This is perfectly legal and necessary for forwarding of IPv4 broadcasts to work. (it is Internet Protocol after all, not Infernal-ethernet-extension Protocol. ;-)) The change is in UDP input so it will not affect routers. But if a FreeBSD system were at the end of a link layer, and was the final recipient of the IPv4 broadcast packet, then if that link layer is not Ethernet, all bets are off. That situation could occur very easily where FreeBSD is hanging off the end of a PPPoE link: e.g. consumer DSL, microwave, etc. The underlying link layer for the tunnel might be Ethernet, but it will be demuxed as a PPP tunnel. PPP is treated as a bit pipe and does not normally distinguish between unicast, broadcast, multicast. Broadcast destined for the host on its PPP address would be transported inside the tunnel, encapsulated as a normal unicast Ethernet packet. > But this mbuf flag is not guaranteed to be set in all situations; > e.g. where the link layer does not have the concept of broadcast > being distinct from other kinds of network traffic. PPP and ATM are > the most obvious examples. > > > We don't support ATM, but PPP is a good example. I hadn't thought of > that. Hm, ip_input() already has to check for a broadcast IP. What it > set M_BCAST on the mbuf at that time? ATM is one of those things everyone kind of has to support by default in some way because of the ITU ADSL specs. It is literally written into G.992.x. Linux can do it, FreeBSD can't. PPP over ATM is something BT inflicted on the UK all by themselves, though, and we wish it would just go away. Whilst your suggestion may work, it may be dangerous, as you are then stepping on the meaning of the flags. Some of them are intended to be used for one layer to signal another. M_BCAST is pretty rigidly defined in mbuf.h as "The link layer received this as a broadcast / I intended for link layer to send this as a broadcast". M_PROTOFLAGS is normally used to clear flags with different meaning in different protocol layers. M_MCAST also has similar status. On my PhD, I wrote code which uses a private Ethernet link between FreeBSD routers for load distribution; it distributes unicast traffic using IPv6 multicast. It uses multicast both as convenience, and as a way to 'channelise' traffic if the Ethernet link supports it, using multicast groups. (Modern shared memory switches can slice L2 multicast traffic like this quite efficiently. So one slice of unicast traffic could be switched across locations purely at L2. However, the distribution of actual IPv6 multicast was out of scope.) The routers have to very carefully clear M_MCAST on egress, to ensure normal L2 next-hop resolution for IPv6 destinations. From owner-svn-src-all@freebsd.org Sat Aug 20 16:17:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 102C8BC047A for ; Sat, 20 Aug 2016 16:17:57 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22f.google.com (mail-it0-x22f.google.com [IPv6:2607:f8b0:4001:c0b::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CE4CE1A67 for ; Sat, 20 Aug 2016 16:17:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22f.google.com with SMTP id e63so8519225ith.1 for ; Sat, 20 Aug 2016 09:17:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Dy/42n6ZEpFBcrEoNKxZ/1ZwMFvS8KP2a8stVxxfxuo=; b=N/0vQOBUm1LVBnpMvNCC0pmiYbj3x2FSARFh1NzWk84vLO9IWe0QrwS+asfTdlMBAy hi/4f7opiqY93NKxNOANEyFmXmy8YMOzfyo7MKEvJ+Q3hn+2MfkwTHUCmv/u15txdabt HP8dn5fGgFzApZ93cfRVYiqxBt7p21zoGsRBfoFw6BtJN+Yp6EfMP04uMj7AViDFvo1F yeMFJDOoVMfa2QGci/jCqPyR2oRS4ny8A2vnzqnS1bpbyLeSzJhhRfA8jvwuLdeva8oj ulmim+Bt1nwBBWNzuhUSJoMELCSDwa5pCXb9/lVg+NgQ6f85r3QMSBGTqwKMJWroBzZw 8cxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Dy/42n6ZEpFBcrEoNKxZ/1ZwMFvS8KP2a8stVxxfxuo=; b=PUygyhEUTnkO8WjyRK0Zr6bcMjF5ACfx6tenPDvSTUClqLrF5q3eO5sAAv1H9RqtFd W10dWAGpE5xKfPk8wFYVTZLh7dsvsmrBNpGtKOgkRcEq+A3B68r3ksBA/8n/7D/cvZoF 9IcUIqCh5/h4WxfiFkSJifUO16W5QLZO1YjHyFWBGI8R2FdEA7Wul6ZgzNmJYU+GC3CL JxH2xFBRBYv5qHOpRSnaJUr1KPAC+hw2J2cg1yDs9LNXdhp/Q7j654hdzTSyHcUEUIgU x/xEu60tKjC1POy+IxmzakRp7RgLnMm3r6LTa6oHLjj1N92AhmbZMgHEyPzi9ooaeuf9 cWMQ== X-Gm-Message-State: AEkoouvpldN7sfY+R30mDRraE1bV3n53Up3UexGmep1n+3EGnPaSJ4PM74hAIpKQN53Btj8OsiRdgOVZqxzcZg== X-Received: by 10.36.17.20 with SMTP id 20mr13014752itf.94.1471709876122; Sat, 20 Aug 2016 09:17:56 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Sat, 20 Aug 2016 09:17:55 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <9056382.PA4dZNFpPe@ralph.baldwin.cx> References: <201608192227.u7JMREIo032684@repo.freebsd.org> <9056382.PA4dZNFpPe@ralph.baldwin.cx> From: Warner Losh Date: Sat, 20 Aug 2016 10:17:55 -0600 X-Google-Sender-Auth: c7HXzinL-m4Hh4pe7mo_IR9W__k Message-ID: Subject: Re: svn commit: r304506 - in head: . release/doc/en_US.ISO8859-1/hardware share/man/man4/man4.i386 sys/conf sys/dev/wl sys/i386/conf sys/modules sys/modules/wl targets/pseudo/userland tools/build/mk to... To: John Baldwin Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 16:17:57 -0000 On Sat, Aug 20, 2016 at 8:33 AM, John Baldwin wrote: > On Friday, August 19, 2016 06:38:01 PM Warner Losh wrote: >> On Fri, Aug 19, 2016 at 4:27 PM, John Baldwin wrote: >> > Author: jhb >> > Date: Fri Aug 19 22:27:14 2016 >> > New Revision: 304506 >> > URL: https://svnweb.freebsd.org/changeset/base/304506 >> > >> > Log: >> > Remove the wl(4) driver and wlconfig(8) utility. >> > >> > The wl(4) driver supports pre-802.11 PCCard wireless adapters that >> > are slower than 802.11b. They do not work with any of the 802.11 >> > framework and the driver hasn't been reported to actually work in a >> > long time. >> >> s/PC Card/ISA/g >> >> There never were any PC Card wl cards. These cards were ISA only >> and ran at up to 1Mbps. > > Wow, even worse than I thought. In the days of 144kbps ISDN lines being the best you could get many places, 1Mbps was awesome. I had one for a 7 mile link to a friend's house in town who had better connectivity. Cards supported by the awi driver were 2Mbps and were the first 802.11 cards. wi blew that away with 10Mbps and a variety of suppliers... wl lost its relevance in 2000 or so. wi was committed in 1999 for hardware that had been around a couple of years in various forms. There was a fast adaptation of it. I moved from my wl-based system to wi-based in 2000 or so once I was able to get a ISA to PC Card adapter and the right connectors to go from the funky tiny connectors on the WaveLan cards to the N connectors that the rest of the gear was setup with. Heck, wi hasn't been all that relevant since ath went into the tree with the boatload of features it supported and way better features... And that's been since 2003 or 2004 or so. Warner From owner-svn-src-all@freebsd.org Sat Aug 20 16:23:21 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C056BC063E; Sat, 20 Aug 2016 16:23:21 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 198B81F1F; Sat, 20 Aug 2016 16:23:21 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KGNKkW034014; Sat, 20 Aug 2016 16:23:20 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KGNJn7034005; Sat, 20 Aug 2016 16:23:19 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201608201623.u7KGNJn7034005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 20 Aug 2016 16:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304532 - in head/sys/boot: common efi/loader/arch/amd64 fdt 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 16:23:21 -0000 Author: tsoome Date: Sat Aug 20 16:23:19 2016 New Revision: 304532 URL: https://svnweb.freebsd.org/changeset/base/304532 Log: loader is filling fixed length command_errbuf with sprintf() and is trusting strings provided by user/config files. This update is replacing sprintf with snprintf for cases the command_errbuf is built from dynamic content. PR: 211958 Reported by: ecturt@gmail.com Reviewed by: imp, allanjude Approved by: imp (mentor), allanjude (mentor) Differential Revision: https://reviews.freebsd.org/D7563 Modified: head/sys/boot/common/boot.c head/sys/boot/common/bootstrap.h head/sys/boot/common/commands.c head/sys/boot/common/interp.c head/sys/boot/common/ls.c head/sys/boot/common/module.c head/sys/boot/efi/loader/arch/amd64/framebuffer.c head/sys/boot/fdt/fdt_loader_cmd.c Modified: head/sys/boot/common/boot.c ============================================================================== --- head/sys/boot/common/boot.c Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/common/boot.c Sat Aug 20 16:23:19 2016 (r304532) @@ -61,7 +61,8 @@ command_boot(int argc, char *argv[]) /* XXX maybe we should discard everything and start again? */ if (file_findfile(NULL, NULL) != NULL) { - sprintf(command_errbuf, "can't boot '%s', kernel module already loaded", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't boot '%s', kernel module already loaded", argv[1]); return(CMD_ERROR); } @@ -129,7 +130,8 @@ command_autoboot(int argc, char *argv[]) case 2: howlong = strtol(argv[1], &cp, 0); if (*cp != 0) { - sprintf(command_errbuf, "bad delay '%s'", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "bad delay '%s'", argv[1]); return(CMD_ERROR); } /* FALLTHROUGH */ Modified: head/sys/boot/common/bootstrap.h ============================================================================== --- head/sys/boot/common/bootstrap.h Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/common/bootstrap.h Sat Aug 20 16:23:19 2016 (r304532) @@ -35,8 +35,9 @@ /* Commands and return values; nonzero return sets command_errmsg != NULL */ typedef int (bootblk_cmd_t)(int argc, char *argv[]); +#define COMMAND_ERRBUFSZ (256) extern char *command_errmsg; -extern char command_errbuf[]; /* XXX blah, length */ +extern char command_errbuf[COMMAND_ERRBUFSZ]; #define CMD_OK 0 #define CMD_WARN 1 #define CMD_ERROR 2 Modified: head/sys/boot/common/commands.c ============================================================================== --- head/sys/boot/common/commands.c Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/common/commands.c Sat Aug 20 16:23:19 2016 (r304532) @@ -33,7 +33,8 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" char *command_errmsg; -char command_errbuf[256]; /* XXX should have procedural interface for setting, size limit? */ +/* XXX should have procedural interface for setting, size limit? */ +char command_errbuf[COMMAND_ERRBUFSZ]; static int page_file(char *filename); @@ -196,7 +197,8 @@ command_help(int argc, char *argv[]) pager_close(); close(hfd); if (!matched) { - sprintf(command_errbuf, "no help available for '%s'", topic); + snprintf(command_errbuf, sizeof(command_errbuf), + "no help available for '%s'", topic); free(topic); if (subtopic) free(subtopic); @@ -276,7 +278,8 @@ command_show(int argc, char *argv[]) if ((cp = getenv(argv[1])) != NULL) { printf("%s\n", cp); } else { - sprintf(command_errbuf, "variable '%s' not found", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "variable '%s' not found", argv[1]); return(CMD_ERROR); } } @@ -386,7 +389,8 @@ command_read(int argc, char *argv[]) case 't': timeout = strtol(optarg, &cp, 0); if (cp == optarg) { - sprintf(command_errbuf, "bad timeout '%s'", optarg); + snprintf(command_errbuf, sizeof(command_errbuf), + "bad timeout '%s'", optarg); return(CMD_ERROR); } break; @@ -454,8 +458,10 @@ page_file(char *filename) result = pager_file(filename); - if (result == -1) - sprintf(command_errbuf, "error showing %s", filename); + if (result == -1) { + snprintf(command_errbuf, sizeof(command_errbuf), + "error showing %s", filename); + } return result; } Modified: head/sys/boot/common/interp.c ============================================================================== --- head/sys/boot/common/interp.c Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/common/interp.c Sat Aug 20 16:23:19 2016 (r304532) @@ -214,7 +214,8 @@ include(const char *filename) #endif if (((fd = open(filename, O_RDONLY)) == -1)) { - sprintf(command_errbuf,"can't open '%s': %s", filename, strerror(errno)); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't open '%s': %s", filename, strerror(errno)); return(CMD_ERROR); } @@ -256,8 +257,9 @@ include(const char *filename) script = script->next; free(se); } - sprintf(command_errbuf, "file '%s' line %d: memory allocation " - "failure - aborting", filename, line); + snprintf(command_errbuf, sizeof(command_errbuf), + "file '%s' line %d: memory allocation failure - aborting", + filename, line); return (CMD_ERROR); } strcpy(sp->text, cp); @@ -291,7 +293,9 @@ include(const char *filename) #ifdef BOOT_FORTH res = bf_run(sp->text); if (res != VM_OUTOFTEXT) { - sprintf(command_errbuf, "Error while including %s, in the line:\n%s", filename, sp->text); + snprintf(command_errbuf, sizeof(command_errbuf), + "Error while including %s, in the line:\n%s", + filename, sp->text); res = CMD_ERROR; break; } else Modified: head/sys/boot/common/ls.c ============================================================================== --- head/sys/boot/common/ls.c Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/common/ls.c Sat Aug 20 16:23:19 2016 (r304532) @@ -150,7 +150,8 @@ ls_getdir(char **pathp) /* Make sure the path is respectable to begin with */ if (archsw.arch_getdev(NULL, path, &cp)) { - sprintf(command_errbuf, "bad path '%s'", path); + snprintf(command_errbuf, sizeof(command_errbuf), + "bad path '%s'", path); goto out; } @@ -160,15 +161,18 @@ ls_getdir(char **pathp) fd = open(path, O_RDONLY); if (fd < 0) { - sprintf(command_errbuf, "open '%s' failed: %s", path, strerror(errno)); + snprintf(command_errbuf, sizeof(command_errbuf), + "open '%s' failed: %s", path, strerror(errno)); goto out; } if (fstat(fd, &sb) < 0) { - sprintf(command_errbuf, "stat failed: %s", strerror(errno)); + snprintf(command_errbuf, sizeof(command_errbuf), + "stat failed: %s", strerror(errno)); goto out; } if (!S_ISDIR(sb.st_mode)) { - sprintf(command_errbuf, "%s: %s", path, strerror(ENOTDIR)); + snprintf(command_errbuf, sizeof(command_errbuf), + "%s: %s", path, strerror(ENOTDIR)); goto out; } Modified: head/sys/boot/common/module.c ============================================================================== --- head/sys/boot/common/module.c Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/common/module.c Sat Aug 20 16:23:19 2016 (r304532) @@ -143,7 +143,8 @@ command_load(int argc, char *argv[]) fp = file_findfile(argv[1], typestr); if (fp) { - sprintf(command_errbuf, "warning: file '%s' already loaded", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: file '%s' already loaded", argv[1]); return (CMD_WARN); } @@ -162,7 +163,8 @@ command_load(int argc, char *argv[]) if (dokld || file_havepath(argv[1])) { error = mod_loadkld(argv[1], argc - 2, argv + 2); if (error == EEXIST) { - sprintf(command_errbuf, "warning: KLD '%s' already loaded", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: KLD '%s' already loaded", argv[1]); return (CMD_WARN); } @@ -173,7 +175,8 @@ command_load(int argc, char *argv[]) */ error = mod_load(argv[1], NULL, argc - 2, argv + 2); if (error == EEXIST) { - sprintf(command_errbuf, "warning: module '%s' already loaded", argv[1]); + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: module '%s' already loaded", argv[1]); return (CMD_WARN); } @@ -202,7 +205,8 @@ command_load_geli(int argc, char *argv[] case 'n': num = strtol(optarg, &cp, 0); if (cp == optarg) { - sprintf(command_errbuf, "bad key index '%s'", optarg); + snprintf(command_errbuf, sizeof(command_errbuf), + "bad key index '%s'", optarg); return(CMD_ERROR); } break; @@ -334,8 +338,8 @@ file_load(char *filename, vm_offset_t de if (error == EFTYPE) continue; /* Unknown to this handler? */ if (error) { - sprintf(command_errbuf, "can't load file '%s': %s", - filename, strerror(error)); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't load file '%s': %s", filename, strerror(error)); break; } } @@ -371,8 +375,8 @@ file_load_dependencies(struct preloaded_ */ mp = file_findmodule(NULL, dmodname, verinfo); if (mp == NULL) { - sprintf(command_errbuf, "module '%s' exists but with wrong version", - dmodname); + snprintf(command_errbuf, sizeof(command_errbuf), + "module '%s' exists but with wrong version", dmodname); error = ENOENT; break; } @@ -411,12 +415,14 @@ file_loadraw(const char *fname, char *ty /* locate the file on the load path */ name = file_search(fname, NULL); if (name == NULL) { - sprintf(command_errbuf, "can't find '%s'", fname); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't find '%s'", fname); return(NULL); } if ((fd = open(name, O_RDONLY)) < 0) { - sprintf(command_errbuf, "can't open '%s': %s", name, strerror(errno)); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't open '%s': %s", name, strerror(errno)); free(name); return(NULL); } @@ -433,7 +439,8 @@ file_loadraw(const char *fname, char *ty if (got == 0) /* end of file */ break; if (got < 0) { /* error */ - sprintf(command_errbuf, "error reading '%s': %s", name, strerror(errno)); + snprintf(command_errbuf, sizeof(command_errbuf), + "error reading '%s': %s", name, strerror(errno)); free(name); close(fd); return(NULL); @@ -487,13 +494,15 @@ mod_load(char *modname, struct mod_depen free(mp->m_args); mp->m_args = unargv(argc, argv); #endif - sprintf(command_errbuf, "warning: module '%s' already loaded", mp->m_name); + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: module '%s' already loaded", mp->m_name); return (0); } /* locate file with the module on the search path */ filename = mod_searchmodule(modname, verinfo); if (filename == NULL) { - sprintf(command_errbuf, "can't find '%s'", modname); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't find '%s'", modname); return (ENOENT); } err = mod_loadkld(filename, argc, argv); @@ -516,7 +525,8 @@ mod_loadkld(const char *kldname, int arg */ filename = file_search(kldname, kld_ext_list); if (filename == NULL) { - sprintf(command_errbuf, "can't find '%s'", kldname); + snprintf(command_errbuf, sizeof(command_errbuf), + "can't find '%s'", kldname); return (ENOENT); } /* @@ -524,7 +534,8 @@ mod_loadkld(const char *kldname, int arg */ fp = file_findfile(filename, NULL); if (fp) { - sprintf(command_errbuf, "warning: KLD '%s' already loaded", filename); + snprintf(command_errbuf, sizeof(command_errbuf), + "warning: KLD '%s' already loaded", filename); free(filename); return (0); } @@ -548,8 +559,10 @@ mod_loadkld(const char *kldname, int arg break; } } while(0); - if (err == EFTYPE) - sprintf(command_errbuf, "don't know how to load module '%s'", filename); + if (err == EFTYPE) { + snprintf(command_errbuf, sizeof(command_errbuf), + "don't know how to load module '%s'", filename); + } if (err && fp) file_discard(fp); free(filename); Modified: head/sys/boot/efi/loader/arch/amd64/framebuffer.c ============================================================================== --- head/sys/boot/efi/loader/arch/amd64/framebuffer.c Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/efi/loader/arch/amd64/framebuffer.c Sat Aug 20 16:23:19 2016 (r304532) @@ -474,8 +474,9 @@ command_gop(int argc, char *argv[]) status = BS->LocateProtocol(&gop_guid, NULL, (VOID **)&gop); if (EFI_ERROR(status)) { - sprintf(command_errbuf, "%s: Graphics Output Protocol not " - "present (error=%lu)", argv[0], EFI_ERROR_CODE(status)); + snprintf(command_errbuf, sizeof(command_errbuf), + "%s: Graphics Output Protocol not present (error=%lu)", + argv[0], EFI_ERROR_CODE(status)); return (CMD_ERROR); } @@ -494,9 +495,9 @@ command_gop(int argc, char *argv[]) } status = gop->SetMode(gop, mode); if (EFI_ERROR(status)) { - sprintf(command_errbuf, "%s: Unable to set mode to " - "%u (error=%lu)", argv[0], mode, - EFI_ERROR_CODE(status)); + snprintf(command_errbuf, sizeof(command_errbuf), + "%s: Unable to set mode to %u (error=%lu)", + argv[0], mode, EFI_ERROR_CODE(status)); return (CMD_ERROR); } } else if (!strcmp(argv[1], "get")) { @@ -526,8 +527,8 @@ command_gop(int argc, char *argv[]) return (CMD_OK); usage: - sprintf(command_errbuf, "usage: %s [list | get | set ]", - argv[0]); + snprintf(command_errbuf, sizeof(command_errbuf), + "usage: %s [list | get | set ]", argv[0]); return (CMD_ERROR); } @@ -542,8 +543,9 @@ command_uga(int argc, char *argv[]) status = BS->LocateProtocol(&uga_guid, NULL, (VOID **)&uga); if (EFI_ERROR(status)) { - sprintf(command_errbuf, "%s: UGA Protocol not present " - "(error=%lu)", argv[0], EFI_ERROR_CODE(status)); + snprintf(command_errbuf, sizeof(command_errbuf), + "%s: UGA Protocol not present (error=%lu)", + argv[0], EFI_ERROR_CODE(status)); return (CMD_ERROR); } @@ -551,8 +553,8 @@ command_uga(int argc, char *argv[]) goto usage; if (efifb_from_uga(&efifb, uga) != CMD_OK) { - sprintf(command_errbuf, "%s: Unable to get UGA information", - argv[0]); + snprintf(command_errbuf, sizeof(command_errbuf), + "%s: Unable to get UGA information", argv[0]); return (CMD_ERROR); } @@ -561,6 +563,6 @@ command_uga(int argc, char *argv[]) return (CMD_OK); usage: - sprintf(command_errbuf, "usage: %s", argv[0]); + snprintf(command_errbuf, sizeof(command_errbuf), "usage: %s", argv[0]); return (CMD_ERROR); } Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Sat Aug 20 15:20:01 2016 (r304531) +++ head/sys/boot/fdt/fdt_loader_cmd.c Sat Aug 20 16:23:19 2016 (r304532) @@ -194,14 +194,14 @@ fdt_load_dtb(vm_offset_t va) COPYOUT(va, &header, sizeof(header)); err = fdt_check_header(&header); if (err < 0) { - if (err == -FDT_ERR_BADVERSION) - sprintf(command_errbuf, + if (err == -FDT_ERR_BADVERSION) { + snprintf(command_errbuf, sizeof(command_errbuf), "incompatible blob version: %d, should be: %d", fdt_version(fdtp), FDT_LAST_SUPPORTED_VERSION); - - else - sprintf(command_errbuf, "error validating blob: %s", - fdt_strerror(err)); + } else { + snprintf(command_errbuf, sizeof(command_errbuf), + "error validating blob: %s", fdt_strerror(err)); + } return (1); } @@ -236,8 +236,8 @@ fdt_load_dtb_addr(struct fdt_header *hea fdtp_size = fdt_totalsize(header); err = fdt_check_header(header); if (err < 0) { - sprintf(command_errbuf, "error validating blob: %s", - fdt_strerror(err)); + snprintf(command_errbuf, sizeof(command_errbuf), + "error validating blob: %s", fdt_strerror(err)); return (err); } free(fdtp); @@ -263,7 +263,8 @@ fdt_load_dtb_file(const char * filename) /* Attempt to load and validate a new dtb from a file. */ if ((bfp = file_loadraw(filename, "dtb", 1)) == NULL) { - sprintf(command_errbuf, "failed to load file '%s'", filename); + snprintf(command_errbuf, sizeof(command_errbuf), + "failed to load file '%s'", filename); return (1); } if ((err = fdt_load_dtb(bfp->f_addr)) != 0) { @@ -609,7 +610,8 @@ fdt_fixup_memory(struct fdt_mem_region * /* Create proper '/memory' node. */ memory = fdt_add_subnode(fdtp, root, "memory"); if (memory <= 0) { - sprintf(command_errbuf, "Could not fixup '/memory' " + snprintf(command_errbuf, sizeof(command_errbuf), + "Could not fixup '/memory' " "node, error code : %d!\n", memory); return; } @@ -626,7 +628,8 @@ fdt_fixup_memory(struct fdt_mem_region * size_cellsp = (uint32_t *)fdt_getprop(fdtp, root, "#size-cells", NULL); if (addr_cellsp == NULL || size_cellsp == NULL) { - sprintf(command_errbuf, "Could not fixup '/memory' node : " + snprintf(command_errbuf, sizeof(command_errbuf), + "Could not fixup '/memory' node : " "%s %s property not found in root node!\n", (!addr_cellsp) ? "#address-cells" : "", (!size_cellsp) ? "#size-cells" : ""); @@ -906,7 +909,8 @@ fdt_cmd_addr(int argc, char *argv[]) hdr = (struct fdt_header *)strtoul(addr, &cp, 16); if (cp == addr) { - sprintf(command_errbuf, "Invalid address: %s", addr); + snprintf(command_errbuf, sizeof(command_errbuf), + "Invalid address: %s", addr); return (CMD_ERROR); } @@ -945,7 +949,8 @@ fdt_cmd_cd(int argc, char *argv[]) o = fdt_path_offset(fdtp, path); if (o < 0) { - sprintf(command_errbuf, "could not find node: '%s'", path); + snprintf(command_errbuf, sizeof(command_errbuf), + "could not find node: '%s'", path); return (CMD_ERROR); } @@ -953,8 +958,8 @@ fdt_cmd_cd(int argc, char *argv[]) return (CMD_OK); fail: - sprintf(command_errbuf, "path too long: %d, max allowed: %d", - len, FDT_CWD_LEN - 1); + snprintf(command_errbuf, sizeof(command_errbuf), + "path too long: %d, max allowed: %d", len, FDT_CWD_LEN - 1); return (CMD_ERROR); } @@ -1037,7 +1042,8 @@ fdt_cmd_ls(int argc, char *argv[]) o = fdt_path_offset(fdtp, path); if (o < 0) { - sprintf(command_errbuf, "could not find node: '%s'", path); + snprintf(command_errbuf, sizeof(command_errbuf), + "could not find node: '%s'", path); return (CMD_ERROR); } @@ -1483,7 +1489,8 @@ fdt_extract_nameloc(char **pathp, char * return (1); } if (o < 0) { - sprintf(command_errbuf, "could not find node: '%s'", path); + snprintf(command_errbuf, sizeof(command_errbuf), + "could not find node: '%s'", path); return (1); } *namep = name; @@ -1530,7 +1537,8 @@ fdt_cmd_prop(int argc, char *argv[]) o = fdt_path_offset(fdtp, path); if (o < 0) { - sprintf(command_errbuf, "could not find node: '%s'", path); + snprintf(command_errbuf, sizeof(command_errbuf), + "could not find node: '%s'", path); rv = CMD_ERROR; goto out; } @@ -1623,8 +1631,9 @@ fdt_cmd_rm(int argc, char *argv[]) return (CMD_ERROR); if ((rv = fdt_delprop(fdtp, o, propname)) != 0) { - sprintf(command_errbuf, "could not delete" - "%s\n", (rv == -FDT_ERR_NOTFOUND) ? + snprintf(command_errbuf, sizeof(command_errbuf), + "could not delete %s\n", + (rv == -FDT_ERR_NOTFOUND) ? "(property/node does not exist)" : ""); return (CMD_ERROR); From owner-svn-src-all@freebsd.org Sat Aug 20 16:27:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86A04BC077B for ; Sat, 20 Aug 2016 16:27:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E73F1398 for ; Sat, 20 Aug 2016 16:27:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x229.google.com with SMTP id f6so49700767ith.0 for ; Sat, 20 Aug 2016 09:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=95seXCNaNNZQstCyvOjKrdvLSzvuovFq9BTsM7xvg7o=; b=QfcqJW0o5Vx4Zepcf+UWWTW2A0VGEeu7hHRjBdJrjhw1T2/6wAD7ShBnrGV8RjQY9B 38urdzRipUiSDP/EqVQxdbcKZ0LuTV3mVNEfsQoufzwkOTuH6+wIPcPkbvEKqOt3ccSH LHIEvjTgQ5WTFNJx4gHlRNamppyxYetzhMPIIR1asUyc+rcYfK0LvQtFxpwASH+ku50r xTUv/9WmclUXLle7udBEDgk0dloLnWb2OraLLb0XlaawiEMQLX3sn1PejbnaeIY8/dlX /ZDbdXT1y/sPwa36cCURgLKnXGuTBs0qAwRUDOrs01sBE9I7gKt9EcFz2H8iqf2Q9qX4 MXuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=95seXCNaNNZQstCyvOjKrdvLSzvuovFq9BTsM7xvg7o=; b=G7r/Lvla9QOnIyXbU7pklbUbCK98tX1QKdAAPnHaPp96IUwIKcBAwOWcqEUgh53Oiq nAHQVOB2i8UAlJAo0YlswLeZgSLzmhYw6/MnOAIS8FG881j/U8Zw6JUqrqDkfMK9EU5j 1NjLKNGOZwsXscdTrKCRv1lbYAOC05Bg7YkjLVgbK0S7kGO5CpWX4Do2417lS+wbnwLs gHEnRDImSJvHJopk0+v3crxCqQCoSuJXlEKEZXYAXWmkPd316LN3vEMbmH4c/Uu55lVx XdiZkhOcKq7K3B3I3sMOZFCzhksmpyT7sy+Y5Ht43s3Hm5Q4Xrxgc3dI8HJi+/ZONc84 GJuQ== X-Gm-Message-State: AEkooutGY/w3iMmOs0vGsQzxyutllN6O84XD8fghjQcG/lmRZusfO7QK84ShIjOiWH+urXmQDUN7Y7yB1fWVSQ== X-Received: by 10.36.236.193 with SMTP id g184mr2263784ith.32.1471710425724; Sat, 20 Aug 2016 09:27:05 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Sat, 20 Aug 2016 09:27:05 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: <1699917.hhfoKyASTk@ralph.baldwin.cx> References: <201608200049.u7K0nUYd084685@repo.freebsd.org> <1699917.hhfoKyASTk@ralph.baldwin.cx> From: Warner Losh Date: Sat, 20 Aug 2016 10:27:05 -0600 X-Google-Sender-Auth: sZ77SfQ7zrVEf9mYFqjGbs5GJEg Message-ID: Subject: Re: svn commit: r304513 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/ie sys/i386/conf sys/modules sys/modules/ie sys/pc98/conf To: John Baldwin Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 16:27:06 -0000 On Sat, Aug 20, 2016 at 8:51 AM, John Baldwin wrote: > On Saturday, August 20, 2016 12:49:30 AM John Baldwin wrote: >> Author: jhb >> Date: Sat Aug 20 00:49:29 2016 >> New Revision: 304513 >> URL: https://svnweb.freebsd.org/changeset/base/304513 >> >> Log: >> Remove the ie(4) driver for Intel 82586 ISA Ethernet adapters. >> >> This driver only supports 10Mb Ethernet using PIO (the hardware supports >> DMA, but the driver only does PIO). There are not any PCCard adapters >> supported by this driver, only ISA cards. In addition, it does not use >> bus_space but instead uses bcopy with volatile pointers triggering a >> host of warnings. (if_ie.c is one of 3 files always built with >> -Wno-error) >> >> Relnotes: yes > > This concludes the list of older drivers I had from earlier after working > on the timeout(9) -> callout(9) changes (almost finished with that, just > a few things left to test changes for, one of them being fail points before > we can remove timeout()/untimeout() entirely). > > I do not have plans for removing any other drivers, though am open to > suggestions. Some possibilities include: > > - tty drivers that haven't been updated to new tty and have been disconnected > from the build since 8.0 including digi(4) and cy(4). I know Bruce has > patches for sio(4) that I just haven't merged, so I'm inclined to leave > sio(4), but the other disconnected drivers are candidates I think. These should be removed. > - Older storage adapters: > - aha (ISA) > - ahb (EISA) > - adv (ISA / EISA / PCI) > - adw (PCI)? > - bt (ISA / EISA / PCI) > - aic (ISA / PCCard) Most of these can go. There were PC Card versions of adv, but I never got around to getting the adv attachment working. Mostly because the cards were expensive and the one that fell into my hands lacked the dongle. aic was a workhorse, but I think is no longer. > - ct (ISA / CBUS) ct likely should stay. It's used in a lot of PC-98 gear that I think is still deployed. > - dpt (ISA / EISA / PCI) Not sure on this one. > - ncv (PCCard / PCI) > - nsp (PCCard) > - stg (ISA / PCCard / PCI) > (Note: some of these are PC-98 related and might remove too much of the > PC-98 ecosystem if removed?) That's hard to say. They were widely used on PC-9821 laptops back in the day, but I'm not sure how much. I'd be inclined to keep them in pending discussions with the pc98 folks. > - mse(4) (ISA-only non-PS-2, non-serial mouse) This is the PC-98 mouse. > - joy(4) (ISA-only, was on various Sound Cards, etc., but I haven't seen > a "game port" on a modern box in a long while) If it still works, what's the rush? Then again, I doubt it's been attached to in many years. EISA can likely be safely removed in 12. It was deprecated in 11 when I made it opt-in. MCA likely can go too. I used to have a boatload of aha and bt cards, but gave up on them years ago. It would be a shame to see them go, but it would help to cleanup CAM a bit since many of the dark corner cases in CAM exist for one ancient SIM or another. While I'd like my aic card to keep working, I've long since tossed the SCSI gear I used to connect with it. The PC Card network drivers, on the other hand, do all still work and I've tested them recently. I'll send pics of my wall of drawers that I keep them all in. My only request is that if there's any PC Card related removals to please put me on the reviews. Warner From owner-svn-src-all@freebsd.org Sat Aug 20 16:27:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08A1EBC07AE; Sat, 20 Aug 2016 16:27:24 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF3251575; Sat, 20 Aug 2016 16:27:23 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id A0BFC201CC; Sat, 20 Aug 2016 12:27:22 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 12:27:22 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=xeOSLIFBYuICVQfKvILC/IX2ZFc=; b=GsZEPA zrZLqLn+kyIQ765wk8GyNAVwIJ9YoXTK3PC8z/7ko2lyAqa8J+ivS9oghN5Ze6E3 dBhGAKsU6ixfI5s7CoIvd8SjKBVvldoigIfVfL1qPsd/ERIaPkRxQ2ahxNkBNbfv EKF7USPU7siiA9lSVX0Ry6lm2t6Avx+q+7zdA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=xeOSLIFBYuICVQf KvILC/IX2ZFc=; b=IWDvx4/recMznSVftLj0jn4lS1SacKEMeOksDRyY8Yg7DRK vaA9UG9REBOiSGFosf/RXoNOznvcP4W+/QwDzwik5CHzprEOOrNclTLxLFD7+0tn gMksPF27d6jEpEwjKSJub76tJq7GLr5xEeOuxsLIG7Cz7llSeZeEWUE02UKU= X-Sasl-enc: 8tOkE+GdM5NfsFvgM7oX/e7b7B5yi9jGaRo4kcdOwaWV 1471710442 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id BDA1DF2986; Sat, 20 Aug 2016 12:27:21 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bruce Simpson Message-ID: <091555f6-05a8-3f91-0486-beb6531abd34@fastmail.net> Date: Sat, 20 Aug 2016 17:27:13 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 16:27:24 -0000 On 20/08/16 16:42, Bruce Simpson wrote: > On 20/08/16 16:27, Ryan Stone wrote: >> Can you send a broadcast packet through an L3 tunnel? I thought that a >> L2 tunnel was required. > > Yes. This is perfectly legal and necessary for forwarding of IPv4 > broadcasts to work. (it is Internet Protocol after all, not > Infernal-ethernet-extension Protocol. ;-)) For completeness: This does not hold true for L2 in L2, the most obvious example being Metro Ethernet VMAN style service. There, Ethernet is the transport (link layer), as well as the payload. That's a concrete example of the kind of L2 'tunnel' you may be referring to. Sometimes, specific Ethernet [broad|multi]cast destinations -- notably L2 control protocols, e.g. RSTP within the customer VLAN, may need to be tunnelled (Provider-Backbone-Bridges (PBB) style). Alternatively, the L2 destination MAC may be rewritten for that specific address, to avoid the destination being interpreted by routers in the Metro Ethernet core. It can be considered a crude form of Ethernet NAT, but it's common practice. But, for IP, forwarding IPv4 directed broadcast packets over a non-broadcast link is completely legal (and required for normal operation). From owner-svn-src-all@freebsd.org Sat Aug 20 16:28:19 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1DB3BC0842; Sat, 20 Aug 2016 16:28:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CEF416F9; Sat, 20 Aug 2016 16:28:19 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KGSI9R034234; Sat, 20 Aug 2016 16:28:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KGSICv034227; Sat, 20 Aug 2016 16:28:18 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608201628.u7KGSICv034227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 20 Aug 2016 16:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304533 - vendor/dma/dist X-SVN-Group: vendor 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 16:28:19 -0000 Author: bapt Date: Sat Aug 20 16:28:17 2016 New Revision: 304533 URL: https://svnweb.freebsd.org/changeset/base/304533 Log: Import Dragonfly Mail agent snapshot from 2016-08-16 Modified: vendor/dma/dist/VERSION vendor/dma/dist/dma-mbox-create.c vendor/dma/dist/dma.c vendor/dma/dist/dma.h vendor/dma/dist/dns.c vendor/dma/dist/local.c vendor/dma/dist/net.c Modified: vendor/dma/dist/VERSION ============================================================================== --- vendor/dma/dist/VERSION Sat Aug 20 16:23:19 2016 (r304532) +++ vendor/dma/dist/VERSION Sat Aug 20 16:28:17 2016 (r304533) @@ -1 +1 @@ -v0.10 +v0.11 Modified: vendor/dma/dist/dma-mbox-create.c ============================================================================== --- vendor/dma/dist/dma-mbox-create.c Sat Aug 20 16:23:19 2016 (r304532) +++ vendor/dma/dist/dma-mbox-create.c Sat Aug 20 16:28:17 2016 (r304533) @@ -142,7 +142,7 @@ main(int argc, char **argv) logfail(EX_CANTCREAT, "cannot build mbox path for `%s/%s'", _PATH_MAILDIR, user); } - f = open(fn, O_RDONLY|O_CREAT, 0600); + f = open(fn, O_RDONLY|O_CREAT|O_NOFOLLOW, 0600); if (f < 0) logfail(EX_NOINPUT, "cannt open mbox `%s'", fn); Modified: vendor/dma/dist/dma.c ============================================================================== --- vendor/dma/dist/dma.c Sat Aug 20 16:23:19 2016 (r304532) +++ vendor/dma/dist/dma.c Sat Aug 20 16:28:17 2016 (r304533) @@ -321,7 +321,7 @@ deliver(struct qitem *it) snprintf(errmsg, sizeof(errmsg), "unknown bounce reason"); retry: - syslog(LOG_INFO, "trying delivery"); + syslog(LOG_INFO, "<%s> trying delivery", it->addr); if (it->remote) error = deliver_remote(it); @@ -331,7 +331,7 @@ retry: switch (error) { case 0: delqueue(it); - syslog(LOG_INFO, "delivery successful"); + syslog(LOG_INFO, "<%s> delivery successful", it->addr); exit(EX_OK); case 1: Modified: vendor/dma/dist/dma.h ============================================================================== --- vendor/dma/dist/dma.h Sat Aug 20 16:23:19 2016 (r304532) +++ vendor/dma/dist/dma.h Sat Aug 20 16:28:17 2016 (r304533) @@ -49,7 +49,7 @@ #define VERSION "DragonFly Mail Agent " DMA_VERSION #define BUF_SIZE 2048 -#define ERRMSG_SIZE 200 +#define ERRMSG_SIZE 1024 #define USERNAME_SIZE 50 #define MIN_RETRY 300 /* 5 minutes */ #define MAX_RETRY (3*60*60) /* retry at least every 3 hours */ Modified: vendor/dma/dist/dns.c ============================================================================== --- vendor/dma/dist/dns.c Sat Aug 20 16:23:19 2016 (r304532) +++ vendor/dma/dist/dns.c Sat Aug 20 16:28:17 2016 (r304533) @@ -34,6 +34,7 @@ */ #include +#include #include #include #include Modified: vendor/dma/dist/local.c ============================================================================== --- vendor/dma/dist/local.c Sat Aug 20 16:23:19 2016 (r304532) +++ vendor/dma/dist/local.c Sat Aug 20 16:28:17 2016 (r304533) @@ -196,7 +196,7 @@ retry: goto out; } - error = snprintf(line, sizeof(line), "%sFrom %s\t%s", newline, sender, ctime(&now)); + error = snprintf(line, sizeof(line), "%sFrom %s %s", newline, sender, ctime(&now)); if (error < 0 || (size_t)error >= sizeof(line)) { syslog(LOG_NOTICE, "local delivery deferred: can not write header: %m"); goto out; Modified: vendor/dma/dist/net.c ============================================================================== --- vendor/dma/dist/net.c Sat Aug 20 16:23:19 2016 (r304532) +++ vendor/dma/dist/net.c Sat Aug 20 16:28:17 2016 (r304533) @@ -372,11 +372,13 @@ deliver_to_host(struct qitem *it, struct host->host, host->addr, c, neterr); \ snprintf(errmsg, sizeof(errmsg), "%s [%s] did not like our %s:\n%s", \ host->host, host->addr, c, neterr); \ - return (-1); \ + error = -1; \ + goto out; \ } else if (res != exp) { \ syslog(LOG_NOTICE, "remote delivery deferred: %s [%s] failed after %s: %s", \ host->host, host->addr, c, neterr); \ - return (1); \ + error = 1; \ + goto out; \ } /* Check first reply from remote host */ @@ -426,7 +428,8 @@ deliver_to_host(struct qitem *it, struct syslog(LOG_ERR, "remote delivery failed:" " SMTP login failed: %m"); snprintf(errmsg, sizeof(errmsg), "SMTP login to %s failed", host->host); - return (-1); + error = -1; + goto out; } /* SMTP login is not available, so try without */ else if (error > 0) { From owner-svn-src-all@freebsd.org Sat Aug 20 16:29:09 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2C65BC08D6; Sat, 20 Aug 2016 16:29:09 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A33A01890; Sat, 20 Aug 2016 16:29:09 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KGT8WL034317; Sat, 20 Aug 2016 16:29:08 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KGT8Te034312; Sat, 20 Aug 2016 16:29:08 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608201629.u7KGT8Te034312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 20 Aug 2016 16:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r304534 - vendor/dma/20160806 X-SVN-Group: vendor 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 16:29:09 -0000 Author: bapt Date: Sat Aug 20 16:29:08 2016 New Revision: 304534 URL: https://svnweb.freebsd.org/changeset/base/304534 Log: tag import of Dragonfly Mail Agent 20160806 Added: vendor/dma/20160806/ - copied from r304532, vendor/dma/dist/ Replaced: vendor/dma/20160806/VERSION - copied unchanged from r304533, vendor/dma/dist/VERSION vendor/dma/20160806/dma-mbox-create.c - copied unchanged from r304533, vendor/dma/dist/dma-mbox-create.c vendor/dma/20160806/dma.c - copied unchanged from r304533, vendor/dma/dist/dma.c vendor/dma/20160806/dma.h - copied unchanged from r304533, vendor/dma/dist/dma.h vendor/dma/20160806/dns.c - copied unchanged from r304533, vendor/dma/dist/dns.c vendor/dma/20160806/local.c - copied unchanged from r304533, vendor/dma/dist/local.c vendor/dma/20160806/net.c - copied unchanged from r304533, vendor/dma/dist/net.c Copied: vendor/dma/20160806/VERSION (from r304533, vendor/dma/dist/VERSION) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/20160806/VERSION Sat Aug 20 16:29:08 2016 (r304534, copy of r304533, vendor/dma/dist/VERSION) @@ -0,0 +1 @@ +v0.11 Copied: vendor/dma/20160806/dma-mbox-create.c (from r304533, vendor/dma/dist/dma-mbox-create.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/20160806/dma-mbox-create.c Sat Aug 20 16:29:08 2016 (r304534, copy of r304533, vendor/dma/dist/dma-mbox-create.c) @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2010-2014, Simon Schubert <2@0x2c.org>. + * Copyright (c) 2008 The DragonFly Project. All rights reserved. + * + * This code is derived from software contributed to The DragonFly Project + * by Simon Schubert <2@0x2c.org>. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of The DragonFly Project nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific, prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS 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. + */ + +/* + * This binary is setuid root. Use extreme caution when touching + * user-supplied information. Keep the root window as small as possible. + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dma.h" + + +static void +logfail(int exitcode, const char *fmt, ...) +{ + int oerrno = errno; + va_list ap; + char outs[1024]; + + outs[0] = 0; + if (fmt != NULL) { + va_start(ap, fmt); + vsnprintf(outs, sizeof(outs), fmt, ap); + va_end(ap); + } + + errno = oerrno; + if (*outs != 0) + syslog(LOG_ERR, errno ? "%s: %m" : "%s", outs); + else + syslog(LOG_ERR, errno ? "%m" : "unknown error"); + + exit(exitcode); +} + +/* + * Create a mbox in /var/mail for a given user, or make sure + * the permissions are correct for dma. + */ + +int +main(int argc, char **argv) +{ + const char *user; + struct passwd *pw; + struct group *gr; + uid_t user_uid; + gid_t mail_gid; + int error; + char fn[PATH_MAX+1]; + int f; + + openlog("dma-mbox-create", 0, LOG_MAIL); + + errno = 0; + gr = getgrnam(DMA_GROUP); + if (!gr) + logfail(EX_CONFIG, "cannot find dma group `%s'", DMA_GROUP); + + mail_gid = gr->gr_gid; + + if (setgid(mail_gid) != 0) + logfail(EX_NOPERM, "cannot set gid to %d (%s)", mail_gid, DMA_GROUP); + if (getegid() != mail_gid) + logfail(EX_NOPERM, "cannot set gid to %d (%s), still at %d", mail_gid, DMA_GROUP, getegid()); + + /* + * We take exactly one argument: the username. + */ + if (argc != 2) { + errno = 0; + logfail(EX_USAGE, "no arguments"); + } + user = argv[1]; + + syslog(LOG_NOTICE, "creating mbox for `%s'", user); + + /* the username may not contain a pathname separator */ + if (strchr(user, '/')) { + errno = 0; + logfail(EX_DATAERR, "path separator in username `%s'", user); + exit(1); + } + + /* verify the user exists */ + errno = 0; + pw = getpwnam(user); + if (!pw) + logfail(EX_NOUSER, "cannot find user `%s'", user); + + user_uid = pw->pw_uid; + + error = snprintf(fn, sizeof(fn), "%s/%s", _PATH_MAILDIR, user); + if (error < 0 || (size_t)error >= sizeof(fn)) { + if (error >= 0) { + errno = 0; + logfail(EX_USAGE, "mbox path too long"); + } + logfail(EX_CANTCREAT, "cannot build mbox path for `%s/%s'", _PATH_MAILDIR, user); + } + + f = open(fn, O_RDONLY|O_CREAT|O_NOFOLLOW, 0600); + if (f < 0) + logfail(EX_NOINPUT, "cannt open mbox `%s'", fn); + + if (fchown(f, user_uid, mail_gid)) + logfail(EX_OSERR, "cannot change owner of mbox `%s'", fn); + + if (fchmod(f, 0620)) + logfail(EX_OSERR, "cannot change permissions of mbox `%s'", fn); + + /* file should be present with the right owner and permissions */ + + syslog(LOG_NOTICE, "successfully created mbox for `%s'", user); + + return (0); +} Copied: vendor/dma/20160806/dma.c (from r304533, vendor/dma/dist/dma.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/20160806/dma.c Sat Aug 20 16:29:08 2016 (r304534, copy of r304533, vendor/dma/dist/dma.c) @@ -0,0 +1,632 @@ +/* + * Copyright (c) 2008-2014, Simon Schubert <2@0x2c.org>. + * Copyright (c) 2008 The DragonFly Project. All rights reserved. + * + * This code is derived from software contributed to The DragonFly Project + * by Simon Schubert <2@0x2c.org>. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of The DragonFly Project nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific, prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include "dfcompat.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dma.h" + + +static void deliver(struct qitem *); + +struct aliases aliases = LIST_HEAD_INITIALIZER(aliases); +struct strlist tmpfs = SLIST_HEAD_INITIALIZER(tmpfs); +struct authusers authusers = LIST_HEAD_INITIALIZER(authusers); +char username[USERNAME_SIZE]; +uid_t useruid; +const char *logident_base; +char errmsg[ERRMSG_SIZE]; + +static int daemonize = 1; +static int doqueue = 0; + +struct config config = { + .smarthost = NULL, + .port = 25, + .aliases = "/etc/aliases", + .spooldir = "/var/spool/dma", + .authpath = NULL, + .certfile = NULL, + .features = 0, + .mailname = NULL, + .masquerade_host = NULL, + .masquerade_user = NULL, +}; + + +static void +sighup_handler(int signo) +{ + (void)signo; /* so that gcc doesn't complain */ +} + +static char * +set_from(struct queue *queue, const char *osender) +{ + const char *addr; + char *sender; + + if (osender) { + addr = osender; + } else if (getenv("EMAIL") != NULL) { + addr = getenv("EMAIL"); + } else { + if (config.masquerade_user) + addr = config.masquerade_user; + else + addr = username; + } + + if (!strchr(addr, '@')) { + const char *from_host = hostname(); + + if (config.masquerade_host) + from_host = config.masquerade_host; + + if (asprintf(&sender, "%s@%s", addr, from_host) <= 0) + return (NULL); + } else { + sender = strdup(addr); + if (sender == NULL) + return (NULL); + } + + if (strchr(sender, '\n') != NULL) { + errno = EINVAL; + return (NULL); + } + + queue->sender = sender; + return (sender); +} + +static int +read_aliases(void) +{ + yyin = fopen(config.aliases, "r"); + if (yyin == NULL) { + /* + * Non-existing aliases file is not a fatal error + */ + if (errno == ENOENT) + return (0); + /* Other problems are. */ + return (-1); + } + if (yyparse()) + return (-1); /* fatal error, probably malloc() */ + fclose(yyin); + return (0); +} + +static int +do_alias(struct queue *queue, const char *addr) +{ + struct alias *al; + struct stritem *sit; + int aliased = 0; + + LIST_FOREACH(al, &aliases, next) { + if (strcmp(al->alias, addr) != 0) + continue; + SLIST_FOREACH(sit, &al->dests, next) { + if (add_recp(queue, sit->str, EXPAND_ADDR) != 0) + return (-1); + } + aliased = 1; + } + + return (aliased); +} + +int +add_recp(struct queue *queue, const char *str, int expand) +{ + struct qitem *it, *tit; + struct passwd *pw; + char *host; + int aliased = 0; + + it = calloc(1, sizeof(*it)); + if (it == NULL) + return (-1); + it->addr = strdup(str); + if (it->addr == NULL) + return (-1); + + it->sender = queue->sender; + host = strrchr(it->addr, '@'); + if (host != NULL && + (strcmp(host + 1, hostname()) == 0 || + strcmp(host + 1, "localhost") == 0)) { + *host = 0; + } + LIST_FOREACH(tit, &queue->queue, next) { + /* weed out duplicate dests */ + if (strcmp(tit->addr, it->addr) == 0) { + free(it->addr); + free(it); + return (0); + } + } + LIST_INSERT_HEAD(&queue->queue, it, next); + + /** + * Do local delivery if there is no @. + * Do not do local delivery when NULLCLIENT is set. + */ + if (strrchr(it->addr, '@') == NULL && (config.features & NULLCLIENT) == 0) { + it->remote = 0; + if (expand) { + aliased = do_alias(queue, it->addr); + if (!aliased && expand == EXPAND_WILDCARD) + aliased = do_alias(queue, "*"); + if (aliased < 0) + return (-1); + if (aliased) { + LIST_REMOVE(it, next); + } else { + /* Local destination, check */ + pw = getpwnam(it->addr); + if (pw == NULL) + goto out; + /* XXX read .forward */ + endpwent(); + } + } + } else { + it->remote = 1; + } + + return (0); + +out: + free(it->addr); + free(it); + return (-1); +} + +static struct qitem * +go_background(struct queue *queue) +{ + struct sigaction sa; + struct qitem *it; + pid_t pid; + + if (daemonize && daemon(0, 0) != 0) { + syslog(LOG_ERR, "can not daemonize: %m"); + exit(EX_OSERR); + } + daemonize = 0; + + bzero(&sa, sizeof(sa)); + sa.sa_handler = SIG_IGN; + sigaction(SIGCHLD, &sa, NULL); + + LIST_FOREACH(it, &queue->queue, next) { + /* No need to fork for the last dest */ + if (LIST_NEXT(it, next) == NULL) + goto retit; + + pid = fork(); + switch (pid) { + case -1: + syslog(LOG_ERR, "can not fork: %m"); + exit(EX_OSERR); + break; + + case 0: + /* + * Child: + * + * return and deliver mail + */ +retit: + /* + * If necessary, acquire the queue and * mail files. + * If this fails, we probably were raced by another + * process. It is okay to be raced if we're supposed + * to flush the queue. + */ + setlogident("%s", it->queueid); + switch (acquirespool(it)) { + case 0: + break; + case 1: + if (doqueue) + exit(EX_OK); + syslog(LOG_WARNING, "could not lock queue file"); + exit(EX_SOFTWARE); + default: + exit(EX_SOFTWARE); + } + dropspool(queue, it); + return (it); + + default: + /* + * Parent: + * + * fork next child + */ + break; + } + } + + syslog(LOG_CRIT, "reached dead code"); + exit(EX_SOFTWARE); +} + +static void +deliver(struct qitem *it) +{ + int error; + unsigned int backoff = MIN_RETRY, slept; + struct timeval now; + struct stat st; + + snprintf(errmsg, sizeof(errmsg), "unknown bounce reason"); + +retry: + syslog(LOG_INFO, "<%s> trying delivery", it->addr); + + if (it->remote) + error = deliver_remote(it); + else + error = deliver_local(it); + + switch (error) { + case 0: + delqueue(it); + syslog(LOG_INFO, "<%s> delivery successful", it->addr); + exit(EX_OK); + + case 1: + if (stat(it->queuefn, &st) != 0) { + syslog(LOG_ERR, "lost queue file `%s'", it->queuefn); + exit(EX_SOFTWARE); + } + if (gettimeofday(&now, NULL) == 0 && + (now.tv_sec - st.st_mtim.tv_sec > MAX_TIMEOUT)) { + snprintf(errmsg, sizeof(errmsg), + "Could not deliver for the last %d seconds. Giving up.", + MAX_TIMEOUT); + goto bounce; + } + for (slept = 0; slept < backoff;) { + slept += SLEEP_TIMEOUT - sleep(SLEEP_TIMEOUT); + if (flushqueue_since(slept)) { + backoff = MIN_RETRY; + goto retry; + } + } + if (slept >= backoff) { + /* pick the next backoff between [1.5, 2.5) times backoff */ + backoff = backoff + backoff / 2 + random() % backoff; + if (backoff > MAX_RETRY) + backoff = MAX_RETRY; + } + goto retry; + + case -1: + default: + break; + } + +bounce: + bounce(it, errmsg); + /* NOTREACHED */ +} + +void +run_queue(struct queue *queue) +{ + struct qitem *it; + + if (LIST_EMPTY(&queue->queue)) + return; + + it = go_background(queue); + deliver(it); + /* NOTREACHED */ +} + +static void +show_queue(struct queue *queue) +{ + struct qitem *it; + int locked = 0; /* XXX */ + + if (LIST_EMPTY(&queue->queue)) { + printf("Mail queue is empty\n"); + return; + } + + LIST_FOREACH(it, &queue->queue, next) { + printf("ID\t: %s%s\n" + "From\t: %s\n" + "To\t: %s\n", + it->queueid, + locked ? "*" : "", + it->sender, it->addr); + + if (LIST_NEXT(it, next) != NULL) + printf("--\n"); + } +} + +/* + * TODO: + * + * - alias processing + * - use group permissions + * - proper sysexit codes + */ + +int +main(int argc, char **argv) +{ + struct sigaction act; + char *sender = NULL; + struct queue queue; + int i, ch; + int nodot = 0, showq = 0, queue_only = 0; + int recp_from_header = 0; + + set_username(); + + /* + * We never run as root. If called by root, drop permissions + * to the mail user. + */ + if (geteuid() == 0 || getuid() == 0) { + struct passwd *pw; + + errno = 0; + pw = getpwnam(DMA_ROOT_USER); + if (pw == NULL) { + if (errno == 0) + errx(EX_CONFIG, "user '%s' not found", DMA_ROOT_USER); + else + err(EX_OSERR, "cannot drop root privileges"); + } + + if (setuid(pw->pw_uid) != 0) + err(EX_OSERR, "cannot drop root privileges"); + + if (geteuid() == 0 || getuid() == 0) + errx(EX_OSERR, "cannot drop root privileges"); + } + + atexit(deltmp); + init_random(); + + bzero(&queue, sizeof(queue)); + LIST_INIT(&queue.queue); + + if (strcmp(argv[0], "mailq") == 0) { + argv++; argc--; + showq = 1; + if (argc != 0) + errx(EX_USAGE, "invalid arguments"); + goto skipopts; + } else if (strcmp(argv[0], "newaliases") == 0) { + logident_base = "dma"; + setlogident(NULL); + + if (read_aliases() != 0) + errx(EX_SOFTWARE, "could not parse aliases file `%s'", config.aliases); + exit(EX_OK); + } + + opterr = 0; + while ((ch = getopt(argc, argv, ":A:b:B:C:d:Df:F:h:iL:N:no:O:q:r:R:tUV:vX:")) != -1) { + switch (ch) { + case 'A': + /* -AX is being ignored, except for -A{c,m} */ + if (optarg[0] == 'c' || optarg[0] == 'm') { + break; + } + /* else FALLTRHOUGH */ + case 'b': + /* -bX is being ignored, except for -bp */ + if (optarg[0] == 'p') { + showq = 1; + break; + } else if (optarg[0] == 'q') { + queue_only = 1; + break; + } + /* else FALLTRHOUGH */ + case 'D': + daemonize = 0; + break; + case 'L': + logident_base = optarg; + break; + case 'f': + case 'r': + sender = optarg; + break; + + case 't': + recp_from_header = 1; + break; + + case 'o': + /* -oX is being ignored, except for -oi */ + if (optarg[0] != 'i') + break; + /* else FALLTRHOUGH */ + case 'O': + break; + case 'i': + nodot = 1; + break; + + case 'q': + /* Don't let getopt slup up other arguments */ + if (optarg && *optarg == '-') + optind--; + doqueue = 1; + break; + + /* Ignored options */ + case 'B': + case 'C': + case 'd': + case 'F': + case 'h': + case 'N': + case 'n': + case 'R': + case 'U': + case 'V': + case 'v': + case 'X': + break; + + case ':': + if (optopt == 'q') { + doqueue = 1; + break; + } + /* FALLTHROUGH */ + + default: + fprintf(stderr, "invalid argument: `-%c'\n", optopt); + exit(EX_USAGE); + } + } + argc -= optind; + argv += optind; + opterr = 1; + + if (argc != 0 && (showq || doqueue)) + errx(EX_USAGE, "sending mail and queue operations are mutually exclusive"); + + if (showq + doqueue > 1) + errx(EX_USAGE, "conflicting queue operations"); + +skipopts: + if (logident_base == NULL) + logident_base = "dma"; + setlogident(NULL); + + act.sa_handler = sighup_handler; + act.sa_flags = 0; + sigemptyset(&act.sa_mask); + if (sigaction(SIGHUP, &act, NULL) != 0) + syslog(LOG_WARNING, "can not set signal handler: %m"); + + parse_conf(CONF_PATH "/dma.conf"); + + if (config.authpath != NULL) + parse_authfile(config.authpath); + + if (showq) { + if (load_queue(&queue) < 0) + errlog(EX_NOINPUT, "can not load queue"); + show_queue(&queue); + return (0); + } + + if (doqueue) { + flushqueue_signal(); + if (load_queue(&queue) < 0) + errlog(EX_NOINPUT, "can not load queue"); + run_queue(&queue); + return (0); + } + + if (read_aliases() != 0) + errlog(EX_SOFTWARE, "could not parse aliases file `%s'", config.aliases); + + if ((sender = set_from(&queue, sender)) == NULL) + errlog(EX_SOFTWARE, NULL); + + if (newspoolf(&queue) != 0) + errlog(EX_CANTCREAT, "can not create temp file in `%s'", config.spooldir); + + setlogident("%s", queue.id); + + for (i = 0; i < argc; i++) { + if (add_recp(&queue, argv[i], EXPAND_WILDCARD) != 0) + errlogx(EX_DATAERR, "invalid recipient `%s'", argv[i]); + } + + if (LIST_EMPTY(&queue.queue) && !recp_from_header) + errlogx(EX_NOINPUT, "no recipients"); + + if (readmail(&queue, nodot, recp_from_header) != 0) + errlog(EX_NOINPUT, "can not read mail"); + + if (LIST_EMPTY(&queue.queue)) + errlogx(EX_NOINPUT, "no recipients"); + + if (linkspool(&queue) != 0) + errlog(EX_CANTCREAT, "can not create spools"); + + /* From here on the mail is safe. */ + + if (config.features & DEFER || queue_only) + return (0); + + run_queue(&queue); + + /* NOTREACHED */ + return (0); +} Copied: vendor/dma/20160806/dma.h (from r304533, vendor/dma/dist/dma.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/dma/20160806/dma.h Sat Aug 20 16:29:08 2016 (r304534, copy of r304533, vendor/dma/dist/dma.h) @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2008-2014, Simon Schubert <2@0x2c.org>. + * Copyright (c) 2008 The DragonFly Project. All rights reserved. + * + * This code is derived from software contributed to The DragonFly Project + * by Simon Schubert <2@0x2c.org> and + * Matthias Schmidt . + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name of The DragonFly Project nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific, prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef DMA_H +#define DMA_H + +#include +#include +#include +#include +#include +#include +#include +#include + +#define VERSION "DragonFly Mail Agent " DMA_VERSION + +#define BUF_SIZE 2048 +#define ERRMSG_SIZE 1024 +#define USERNAME_SIZE 50 +#define MIN_RETRY 300 /* 5 minutes */ +#define MAX_RETRY (3*60*60) /* retry at least every 3 hours */ +#define MAX_TIMEOUT (5*24*60*60) /* give up after 5 days */ +#define SLEEP_TIMEOUT 30 /* check for queue flush every 30 seconds */ +#ifndef PATH_MAX +#define PATH_MAX 1024 /* Max path len */ +#endif +#define SMTP_PORT 25 /* Default SMTP port */ +#define CON_TIMEOUT (5*60) /* Connection timeout per RFC5321 */ + +#define STARTTLS 0x002 /* StartTLS support */ +#define SECURETRANS 0x004 /* SSL/TLS in general */ +#define NOSSL 0x008 /* Do not use SSL */ +#define DEFER 0x010 /* Defer mails */ +#define INSECURE 0x020 /* Allow plain login w/o encryption */ +#define FULLBOUNCE 0x040 /* Bounce the full message */ +#define TLS_OPP 0x080 /* Opportunistic STARTTLS */ +#define NULLCLIENT 0x100 /* Nullclient support */ + +#ifndef CONF_PATH +#error Please define CONF_PATH +#endif + +#ifndef LIBEXEC_PATH +#error Please define LIBEXEC_PATH +#endif + +#define SPOOL_FLUSHFILE "flush" + +#ifndef DMA_ROOT_USER +#define DMA_ROOT_USER "mail" +#endif +#ifndef DMA_GROUP +#define DMA_GROUP "mail" +#endif + +#ifndef MBOX_STRICT +#define MBOX_STRICT 0 +#endif + + +struct stritem { + SLIST_ENTRY(stritem) next; + char *str; +}; +SLIST_HEAD(strlist, stritem); + +struct alias { + LIST_ENTRY(alias) next; + char *alias; + struct strlist dests; +}; +LIST_HEAD(aliases, alias); + +struct qitem { + LIST_ENTRY(qitem) next; + const char *sender; + char *addr; + char *queuefn; + char *mailfn; + char *queueid; + FILE *queuef; + FILE *mailf; + int remote; +}; +LIST_HEAD(queueh, qitem); + +struct queue { + struct queueh queue; + char *id; + FILE *mailf; + char *tmpf; + const char *sender; +}; + +struct config { + const char *smarthost; + int port; + const char *aliases; + const char *spooldir; + const char *authpath; + const char *certfile; + int features; + const char *mailname; + const char *masquerade_host; + const char *masquerade_user; + + /* XXX does not belong into config */ + SSL *ssl; +}; + + +struct authuser { + SLIST_ENTRY(authuser) next; + char *login; + char *password; + char *host; +}; +SLIST_HEAD(authusers, authuser); + + +struct mx_hostentry { + char host[MAXDNAME]; + char addr[INET6_ADDRSTRLEN]; + int pref; + struct addrinfo ai; + struct sockaddr_storage sa; +}; + + +/* global variables */ +extern struct aliases aliases; +extern struct config config; +extern struct strlist tmpfs; +extern struct authusers authusers; +extern char username[USERNAME_SIZE]; +extern uid_t useruid; +extern const char *logident_base; + +extern char neterr[ERRMSG_SIZE]; +extern char errmsg[ERRMSG_SIZE]; + +/* aliases_parse.y */ +int yyparse(void); +int yywrap(void); +int yylex(void); +extern FILE *yyin; + +/* conf.c */ +void trim_line(char *); +void parse_conf(const char *); +void parse_authfile(const char *); + +/* crypto.c */ +void hmac_md5(unsigned char *, int, unsigned char *, int, unsigned char *); +int smtp_auth_md5(int, char *, char *); +int smtp_init_crypto(int, int); + +/* dns.c */ +int dns_get_mx_list(const char *, int, struct mx_hostentry **, int); + +/* net.c */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Aug 20 16:30:02 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD325BC0947; Sat, 20 Aug 2016 16:30:02 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E97C19FC; Sat, 20 Aug 2016 16:30:02 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 8904420292; Sat, 20 Aug 2016 12:30:01 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 12:30:01 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=sIB/sfc8rtF+GuAFxaEs1far7Pg=; b=gjcK7K bQaykjSsfhfN18CZrVWJxXhBlAn53LOJvuIivfOlp56GR3kA5/OywAsmPBDYnnKb PkfRNJGFE2Y0YZz1tmvzeWWqkhhygTGoRhOzsOk1YsEUILJ9odQOITowKq/hsj2H 1i1QH+saceIJFQImDqMgyUdu/GmDJIshaUaOM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=sIB/sfc8rtF+GuA FxaEs1far7Pg=; b=f1EAqDC5DDpmNiUxB88vroRBwfXrKe392fmu/7Iej4fNOki 2rWjQkb3bey/0HhsaWTaHmhdLuVGo/+fNlBndKLYvsl7pbFwRmijHUB4ohHk2Lav Shl5jysMiC9U70V0O5pFzbuppmhCaYjQ+7iJd+y37D8PF0PAM1KsaJOwhEng= X-Sasl-enc: V/YZyvhsPuokhS8czSFf2FkHLq/jjmVtn51VgE7+t2Hu 1471710601 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id B30B6F296F; Sat, 20 Aug 2016 12:30:00 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <091555f6-05a8-3f91-0486-beb6531abd34@fastmail.net> Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Bruce Simpson Message-ID: Date: Sat, 20 Aug 2016 17:29:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <091555f6-05a8-3f91-0486-beb6531abd34@fastmail.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 16:30:02 -0000 On 20/08/16 17:27, Bruce Simpson wrote: > Alternatively, the L2 destination MAC may be rewritten for that specific > address, to avoid the destination being interpreted by routers in the > Metro Ethernet core. s/routers/switches/ -- in some views of the world, they are the same :) PBB is also known as 'MAC-in-MAC' for this reason. There's also L2TP pseudowires, but we're not really there yet. From owner-svn-src-all@freebsd.org Sat Aug 20 16:36:07 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07D73BC0B87; Sat, 20 Aug 2016 16:36:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD4971EA5; Sat, 20 Aug 2016 16:36:06 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KGa5Mr037867; Sat, 20 Aug 2016 16:36:05 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KGa59Z037859; Sat, 20 Aug 2016 16:36:05 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201608201636.u7KGa59Z037859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 20 Aug 2016 16:36:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304535 - in head: contrib/dma libexec/dma 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 16:36:07 -0000 Author: bapt Date: Sat Aug 20 16:36:05 2016 New Revision: 304535 URL: https://svnweb.freebsd.org/changeset/base/304535 Log: Import Dragonfly Mail Agent snapshort from 20160806 aka v0.11+ Most important change being: dma - Fix security hole (#46) Affecting DragonFly 4.6 and earlier, Matt Dillon fixed this in base after finding out from BSDNow Episode 152. Comments following were from his commit which explains better than I. Just taking his change and putting it here as well. * dma makes an age-old mistake of not properly checking whether a file owned by a user is a symlink or not, a bug which the original mail.local also had. * Add O_NOFOLLOW to disallow symlinks. Thanks-to: BSDNow Episode 152, made me dive dma to check when they talked about the mail.local bug. MFC After: 2 days Modified: head/contrib/dma/VERSION head/contrib/dma/dma-mbox-create.c head/contrib/dma/dma.c head/contrib/dma/dma.h head/contrib/dma/dns.c head/contrib/dma/local.c head/contrib/dma/net.c head/libexec/dma/Makefile.inc Directory Properties: head/contrib/dma/ (props changed) Modified: head/contrib/dma/VERSION ============================================================================== --- head/contrib/dma/VERSION Sat Aug 20 16:29:08 2016 (r304534) +++ head/contrib/dma/VERSION Sat Aug 20 16:36:05 2016 (r304535) @@ -1 +1 @@ -v0.10 +v0.11 Modified: head/contrib/dma/dma-mbox-create.c ============================================================================== --- head/contrib/dma/dma-mbox-create.c Sat Aug 20 16:29:08 2016 (r304534) +++ head/contrib/dma/dma-mbox-create.c Sat Aug 20 16:36:05 2016 (r304535) @@ -142,7 +142,7 @@ main(int argc, char **argv) logfail(EX_CANTCREAT, "cannot build mbox path for `%s/%s'", _PATH_MAILDIR, user); } - f = open(fn, O_RDONLY|O_CREAT, 0600); + f = open(fn, O_RDONLY|O_CREAT|O_NOFOLLOW, 0600); if (f < 0) logfail(EX_NOINPUT, "cannt open mbox `%s'", fn); Modified: head/contrib/dma/dma.c ============================================================================== --- head/contrib/dma/dma.c Sat Aug 20 16:29:08 2016 (r304534) +++ head/contrib/dma/dma.c Sat Aug 20 16:36:05 2016 (r304535) @@ -321,7 +321,7 @@ deliver(struct qitem *it) snprintf(errmsg, sizeof(errmsg), "unknown bounce reason"); retry: - syslog(LOG_INFO, "trying delivery"); + syslog(LOG_INFO, "<%s> trying delivery", it->addr); if (it->remote) error = deliver_remote(it); @@ -331,7 +331,7 @@ retry: switch (error) { case 0: delqueue(it); - syslog(LOG_INFO, "delivery successful"); + syslog(LOG_INFO, "<%s> delivery successful", it->addr); exit(EX_OK); case 1: Modified: head/contrib/dma/dma.h ============================================================================== --- head/contrib/dma/dma.h Sat Aug 20 16:29:08 2016 (r304534) +++ head/contrib/dma/dma.h Sat Aug 20 16:36:05 2016 (r304535) @@ -49,7 +49,7 @@ #define VERSION "DragonFly Mail Agent " DMA_VERSION #define BUF_SIZE 2048 -#define ERRMSG_SIZE 200 +#define ERRMSG_SIZE 1024 #define USERNAME_SIZE 50 #define MIN_RETRY 300 /* 5 minutes */ #define MAX_RETRY (3*60*60) /* retry at least every 3 hours */ Modified: head/contrib/dma/dns.c ============================================================================== --- head/contrib/dma/dns.c Sat Aug 20 16:29:08 2016 (r304534) +++ head/contrib/dma/dns.c Sat Aug 20 16:36:05 2016 (r304535) @@ -34,6 +34,7 @@ */ #include +#include #include #include #include Modified: head/contrib/dma/local.c ============================================================================== --- head/contrib/dma/local.c Sat Aug 20 16:29:08 2016 (r304534) +++ head/contrib/dma/local.c Sat Aug 20 16:36:05 2016 (r304535) @@ -196,7 +196,7 @@ retry: goto out; } - error = snprintf(line, sizeof(line), "%sFrom %s\t%s", newline, sender, ctime(&now)); + error = snprintf(line, sizeof(line), "%sFrom %s %s", newline, sender, ctime(&now)); if (error < 0 || (size_t)error >= sizeof(line)) { syslog(LOG_NOTICE, "local delivery deferred: can not write header: %m"); goto out; Modified: head/contrib/dma/net.c ============================================================================== --- head/contrib/dma/net.c Sat Aug 20 16:29:08 2016 (r304534) +++ head/contrib/dma/net.c Sat Aug 20 16:36:05 2016 (r304535) @@ -372,11 +372,13 @@ deliver_to_host(struct qitem *it, struct host->host, host->addr, c, neterr); \ snprintf(errmsg, sizeof(errmsg), "%s [%s] did not like our %s:\n%s", \ host->host, host->addr, c, neterr); \ - return (-1); \ + error = -1; \ + goto out; \ } else if (res != exp) { \ syslog(LOG_NOTICE, "remote delivery deferred: %s [%s] failed after %s: %s", \ host->host, host->addr, c, neterr); \ - return (1); \ + error = 1; \ + goto out; \ } /* Check first reply from remote host */ @@ -426,7 +428,8 @@ deliver_to_host(struct qitem *it, struct syslog(LOG_ERR, "remote delivery failed:" " SMTP login failed: %m"); snprintf(errmsg, sizeof(errmsg), "SMTP login to %s failed", host->host); - return (-1); + error = -1; + goto out; } /* SMTP login is not available, so try without */ else if (error > 0) { Modified: head/libexec/dma/Makefile.inc ============================================================================== --- head/libexec/dma/Makefile.inc Sat Aug 20 16:29:08 2016 (r304534) +++ head/libexec/dma/Makefile.inc Sat Aug 20 16:36:05 2016 (r304535) @@ -7,7 +7,7 @@ DMA_SOURCES= ${.CURDIR}/../../../contrib CFLAGS+= -I${DMA_SOURCES} \ -DHAVE_REALLOCF -DHAVE_STRLCPY -DHAVE_GETPROGNAME \ -DCONF_PATH='"/etc/dma"' \ - -DLIBEXEC_PATH='"/usr/libexec"' -DDMA_VERSION='"v0.10"' \ + -DLIBEXEC_PATH='"/usr/libexec"' -DDMA_VERSION='"v0.11+"' \ -DDMA_ROOT_USER='"mailnull"' \ -DDMA_GROUP='"mail"' BINGRP= mail From owner-svn-src-all@freebsd.org Sat Aug 20 16:36:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D560BC0C12; Sat, 20 Aug 2016 16:36:59 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6363F125C; Sat, 20 Aug 2016 16:36:59 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-it0-x232.google.com with SMTP id x131so54577905ite.0; Sat, 20 Aug 2016 09:36:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6DGdjVJFCS/p3RRXAlo3iTeQlDzxVyFU9q4i8aqPXbg=; b=qmHRrSu39Dv6tcNhmQEvaQbZPeoJejO1LC9jJiLgH/3Zbs5XvVgutEQqTMEW3p78aO Io4Acw/L4UM7k7sYRw4p21j5sOilPOkGtcZw9KuAR0HOhFfX5L0R5h3nOpm1geF4Pg12 JbpR15u4tHYNqteNghQSMzGIl8oCxRtdGlz6G76eAkkcJ5oJYNj9K19DVlZByZDNQ4Ba zqRSS3XBS95/wggiztvJ8vin4w6/sJ7Uz6YsEVE/Gl4ZpkHIdHZ6sbPl8FyLiLJ2KuKE kDe+/7az6pPcU3WimB6d59wEQmhOZBUXnnSF1l+diD7TIjg8Xf71do7W5QMFjuuz4B9J PQFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6DGdjVJFCS/p3RRXAlo3iTeQlDzxVyFU9q4i8aqPXbg=; b=ZXUWTU4CTaFApzawzd79fkQJLDmj9uuFLCfbIiYQ3Rft1tOrOAFzBJ7ZekyYV/uebY Ii3loJSPJiC7mjbGemGtQn7B71kap77WjuDWduO+z0nV2CeskZRWl7af6Xs9sH96WRIv O/h2hj2NyZ/awHpU1SK2afJs004x5TzFKev/Rs7voCKDaNM0LmoHJE+FgSgBaSS9JG+u JsWOWiSDOkVOt8+OE05yZdP6L22qNbs7RfRyVIH+mDOOGjvJ+l6mvxr25UUX0erR4olU VlMb10l4x+0yXQNdPwD91GLfyaBNKYkjbxFBHv8VTS3DPZhlhfd4M0LF1u3izNISl01j 38kg== X-Gm-Message-State: AEkoouvvnhA3D+fO+YXGpu63yoktS+8b0EpyNUekJeTLerYQdGSiVfWfN2khM+NYF7F395i+Pzr1wosFs50rXQ== X-Received: by 10.36.149.5 with SMTP id m5mr12870457itd.20.1471711018603; Sat, 20 Aug 2016 09:36:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Sat, 20 Aug 2016 09:36:58 -0700 (PDT) In-Reply-To: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> From: Ryan Stone Date: Sat, 20 Aug 2016 12:36:58 -0400 Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Bruce Simpson Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 16:36:59 -0000 + adrian@, who prompted me to look at UDP in the first place I'm really not sure what my next step should be. I'm willing to revert r304436, but I really don't want to revert r304437 because we've seen crashes in the real world due to the missing locking. Unfortunately, reverting r304436 would mean that every UDP packet would incur the overhead of an additional rlock/runlock call, which is what I've been trying to avoid. I don't see a particularly good path forward. - The if_addr_lock would appear to be an excellent candidate to be converted into an rmlock, but unfortunately we made the mistake of exposing the lock through the ifnet KPI. Fixing that would require rototilling every single Ethernet/WiFi/etc driver in the tree. - Providing a mechanism for ip_input() to signal to udp_input() that the packet was addressed to an L3 broadcast address would require rototilling the pr_input interface, and I'd have to carefully ensure that if anything might interpose itself between the two layers (IPSec?) that the flag would have to be passed through correctly. - mbuf flags are far too precious to allocate a new one for such a narrow use-case On Sat, Aug 20, 2016 at 11:42 AM, Bruce Simpson wrote: > On 20/08/16 16:27, Ryan Stone wrote: > >> Can you send a broadcast packet through an L3 tunnel? I thought that a >> L2 tunnel was required. >> > > Yes. This is perfectly legal and necessary for forwarding of IPv4 > broadcasts to work. (it is Internet Protocol after all, not > Infernal-ethernet-extension Protocol. ;-)) > > The change is in UDP input so it will not affect routers. But if a FreeBSD > system were at the end of a link layer, and was the final recipient of the > IPv4 broadcast packet, then if that link layer is not Ethernet, all bets > are off. > > That situation could occur very easily where FreeBSD is hanging off the > end of a PPPoE link: e.g. consumer DSL, microwave, etc. > > The underlying link layer for the tunnel might be Ethernet, but it will be > demuxed as a PPP tunnel. PPP is treated as a bit pipe and does not normally > distinguish between unicast, broadcast, multicast. > > Broadcast destined for the host on its PPP address would be transported > inside the tunnel, encapsulated as a normal unicast Ethernet packet. > > But this mbuf flag is not guaranteed to be set in all situations; >> e.g. where the link layer does not have the concept of broadcast >> being distinct from other kinds of network traffic. PPP and ATM are >> the most obvious examples. >> >> >> We don't support ATM, but PPP is a good example. I hadn't thought of >> that. Hm, ip_input() already has to check for a broadcast IP. What it >> set M_BCAST on the mbuf at that time? >> > > ATM is one of those things everyone kind of has to support by default in > some way because of the ITU ADSL specs. It is literally written into > G.992.x. > > Linux can do it, FreeBSD can't. PPP over ATM is something BT inflicted on > the UK all by themselves, though, and we wish it would just go away. > > Whilst your suggestion may work, it may be dangerous, as you are then > stepping on the meaning of the flags. Some of them are intended to be used > for one layer to signal another. > > M_BCAST is pretty rigidly defined in mbuf.h as "The link layer received > this as a broadcast / I intended for link layer to send this as a > broadcast". M_PROTOFLAGS is normally used to clear flags with different > meaning in different protocol layers. > > M_MCAST also has similar status. On my PhD, I wrote code which uses a > private Ethernet link between FreeBSD routers for load distribution; it > distributes unicast traffic using IPv6 multicast. > > It uses multicast both as convenience, and as a way to 'channelise' > traffic if the Ethernet link supports it, using multicast groups. (Modern > shared memory switches can slice L2 multicast traffic like this quite > efficiently. So one slice of unicast traffic could be switched across > locations purely at L2. However, the distribution of actual IPv6 multicast > was out of scope.) > > The routers have to very carefully clear M_MCAST on egress, to ensure > normal L2 next-hop resolution for IPv6 destinations. > > From owner-svn-src-all@freebsd.org Sat Aug 20 16:49:24 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB599BC0EEE; Sat, 20 Aug 2016 16:49:24 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD1C7197A; Sat, 20 Aug 2016 16:49:24 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 5EE752025C; Sat, 20 Aug 2016 12:49:23 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 12:49:23 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=HD4EHIlt6M4xzmvuJDV950U3/Mw=; b=EJ0msq 4yGWrPS5BJ/0Gxd0QT/ifUtfOCY7xxDAKIrDz8h4E3argkAQLbh+H921tqVhTPpX d1RBSjBLaNdX+/aHLZLJE38H8QadqEJ/edNUG4gFjvI5M0oeZ80v7SJGbTlcB+RY mdzRIlzsaOyU3Ao1TXzC9ualTYaDjgeitp4cI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=HD4EHIlt6M4xzmv uJDV950U3/Mw=; b=QCub3SnybNF/WP7abOJGJ4Rbjz2qnrDx/Tl6lt/K7s1cDo+ fFgp4zXRujBTIKZoY6fqQG9CbO3mgM6w3AOVLMLc0CIcrZ+AhBhpQJvxDiAQHjnK KuQ6/hAfQ5NXOPsAsa+PlFaDnoaJ6aRu+uI9NJAy8elf9q2SsOkGySvjg2x8= X-Sasl-enc: 4VKkddHAUxSSovpPlkHKDtLaq7PR3qKCTOlsY1n9GefT 1471711763 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 6AD24F285F; Sat, 20 Aug 2016 12:49:22 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <990e003f-6180-b016-3b5f-6bdf579d073f@fastmail.net> Date: Sat, 20 Aug 2016 17:49:14 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 16:49:25 -0000 On 20/08/16 17:36, Ryan Stone wrote: > + adrian@, who prompted me to look at UDP in the first place > > I'm really not sure what my next step should be. I'm willing to revert > r304436, but I really don't want to revert r304437 because we've seen > crashes in the real world due to the missing locking. Unfortunately, > reverting r304436 would mean that every UDP packet would incur the > overhead of an additional rlock/runlock call, which is what I've been > trying to avoid. I don't see a particularly good path forward. Your changes have the same motivations as my historical change to move group-level IP multicast lookups (and locking) out of the output path. Source-specific multicast (SSM) requires support for reception filters on individual sockets, so I moved those multicast-specific input checks into the socket layer. > - The if_addr_lock would appear to be an excellent candidate to be > converted into an rmlock, but unfortunately we made the mistake of > exposing the lock through the ifnet KPI. Fixing that would require > rototilling every single Ethernet/WiFi/etc driver in the tree. Oops... > - Providing a mechanism for ip_input() to signal to udp_input() that the > packet was addressed to an L3 broadcast address would require > rototilling the pr_input interface, and I'd have to carefully ensure > that if anything might interpose itself between the two layers (IPSec?) > that the flag would have to be passed through correctly. > > - mbuf flags are far too precious to allocate a new one for such a > narrow use-case Agree. Then it may be that slipping the definition of M_BCAST to mean 'And IP identified that this is network-layer broadcast' is the most expedient solution. A quick look around suggests you may be able to get away with it. You'd essentially be widening the definition of the existing M_BCAST flag. Given the ultimate consumer of the mbuf in the case you are addressing in the code (bad pun) is udp_input(), that may be fine. (We had to do something similar for ILNPv6, because of how IPv6 input works, so it allocates an unused bit from the IPv6 flow label.) But it has to be qualified very carefully. If L2 is re-entered from IP (e.g. a netgraph IP-level hook), it may have unexpected side-effects. I have not given this the KScope treatment, just a quick fxr.watson.org. From owner-svn-src-all@freebsd.org Sat Aug 20 16:57:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B14DDBC0071; Sat, 20 Aug 2016 16:57:36 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D3E51DC9; Sat, 20 Aug 2016 16:57:36 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 5EDB220413; Sat, 20 Aug 2016 12:57:35 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 12:57:35 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=R46HCLwo9z5g0uEpAZRtscNLB18=; b=W5qdJB mjU6W1YBNBTyabt+INad7/g/oP4F1yhiQvQz0MuEjd2iXBdOm7l5Gr7cD8HThuby tv9kyW4YYGlC0FDPtXgt7LXFSCVNxPrvF6lv7zJKQeBj10tTZvCOTy4GV6Tv+7Z3 jYvIzeGNCbd53UCULSiRA9ZWknATq5jyWIVz4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=R46HCLwo9z5g0uE pAZRtscNLB18=; b=ja21MswIV2b5L8lWV340DRWm7PqEgn9BswQGQW8vbS81S+l HCpL1UySkjMt+zix2wuPXAtLcPN/zKz0IwJ2jXsTukrRpDbeoDEntVvocyMvq/V4 yzZak+lMj+ECVTmgKuoFBb7rukNFGSfbsY1siHNIPrJcwX7Xx2LigC5HQCx8= X-Sasl-enc: TI4htLTa4peMX11iDWGh9oqCjxxD8hXV/nysyvOmuR3V 1471712255 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 7A1FFF296E; Sat, 20 Aug 2016 12:57:34 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <990e003f-6180-b016-3b5f-6bdf579d073f@fastmail.net> Cc: Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <7779ae65-5366-0f42-4369-7f0647abca3c@fastmail.net> Date: Sat, 20 Aug 2016 17:57:26 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <990e003f-6180-b016-3b5f-6bdf579d073f@fastmail.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 16:57:36 -0000 On 20/08/16 17:49, Bruce Simpson wrote: >> - Providing a mechanism for ip_input() to signal to udp_input() that the >> packet was addressed to an L3 broadcast address would require >> rototilling the pr_input interface, and I'd have to carefully ensure >> that if anything might interpose itself between the two layers (IPSec?) >> that the flag would have to be passed through correctly. > (We had to do something similar for ILNPv6, because of how IPv6 input > works, so it allocates an unused bit from the IPv6 flow label.) In case anyone's interested, IPSEC is one big reason we had to do this. Performance was another; without marking ILNPv6 traffic, demultiplexing an ILNPv6 packet -- even 'just enough' to forward it -- would have required processing all IPv6 extension headers, and additional state lookups. Using a bit from the flow label means ILNPv6 routers don't need to do any of that, and it got translated into an M_ILNP mbuf flag internally. I shudder to think what gymnastics the FreeBSD stack may have to endure to accommodate modern Ethernet switching capabilities, though. From owner-svn-src-all@freebsd.org Sat Aug 20 17:18:20 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37A0CBC0606; Sat, 20 Aug 2016 17:18:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 1B6BF1848; Sat, 20 Aug 2016 17:18:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 1334714F6; Sat, 20 Aug 2016 17:18:20 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id C65772311D; Sat, 20 Aug 2016 17:18:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id Se97EHV2nC9I; Sat, 20 Aug 2016 17:18:16 +0000 (UTC) Subject: Re: svn commit: r304244 - head/sys/kern DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com C054C23117 To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201608162155.u7GLtYp4091232@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <529d7219-4dc9-eb06-2a5d-682c725855f6@FreeBSD.org> Date: Sat, 20 Aug 2016 10:18:14 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <201608162155.u7GLtYp4091232@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wHtvbNoT5HReuwovSiwOqFQdfUfw5jNmc" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 17:18:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --wHtvbNoT5HReuwovSiwOqFQdfUfw5jNmc Content-Type: multipart/mixed; boundary="je8VnCsmxL1ejnTS2WSvjbIdtebWlkmSf" From: Bryan Drewery To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <529d7219-4dc9-eb06-2a5d-682c725855f6@FreeBSD.org> Subject: Re: svn commit: r304244 - head/sys/kern References: <201608162155.u7GLtYp4091232@repo.freebsd.org> In-Reply-To: <201608162155.u7GLtYp4091232@repo.freebsd.org> --je8VnCsmxL1ejnTS2WSvjbIdtebWlkmSf Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 8/16/2016 2:55 PM, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Aug 16 21:55:34 2016 > New Revision: 304244 > URL: https://svnweb.freebsd.org/changeset/base/304244 >=20 > Log: > We should not be allowing a timeout to reset when a drain is in progr= ess on > it (either async or sync drain). > =20 > At this moment the only user of drain is TCP, but TCP wouldn't resche= dule a > callout after it has drained it, since it drains only when a tcpcb is= closed. > This for now the problem isn't observed. > =20 > Submitted by: rrs Should this be MFC'd into 11.0? >=20 > Modified: > head/sys/kern/kern_timeout.c >=20 > Modified: head/sys/kern/kern_timeout.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/kern/kern_timeout.c Tue Aug 16 21:32:05 2016 (r304243) > +++ head/sys/kern/kern_timeout.c Tue Aug 16 21:55:34 2016 (r304244) > @@ -1061,7 +1061,7 @@ callout_reset_sbt_on(struct callout *c,=20 > */ > if (c->c_lock !=3D NULL && !cc_exec_cancel(cc, direct)) > cancelled =3D cc_exec_cancel(cc, direct) =3D true; > - if (cc_exec_waiting(cc, direct)) { > + if (cc_exec_waiting(cc, direct) || cc_exec_drain(cc, dir)) { > /* > * Someone has called callout_drain to kill this > * callout. Don't reschedule. >=20 --=20 Regards, Bryan Drewery --je8VnCsmxL1ejnTS2WSvjbIdtebWlkmSf-- --wHtvbNoT5HReuwovSiwOqFQdfUfw5jNmc 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 iQEcBAEBAgAGBQJXuJDWAAoJEDXXcbtuRpfP2MYH/2GQ3qnxniBeflXbty2Eml/g Paz2/gYCydCRtTKbflW9ZT1szB913ju0T6IswdBjXjsUm4bls6sME5/37D0bqBj1 3ril9Vz7uC1T5HEQ65giK0l/r6ROsL7IOJ9befUjOQo5OTe6XqPf878xk3pxmjhM XtrmBy6wW4nvRgZJRxY2nFbP7efH/14ugexeksf4NA3n6aoY+kG5SHHpVLSzUDdi 3v2YOulmnPVGkTSt5Kd9J0VMdtTkBnvRfXhR1PwCByfAPHf0MYsfAmhF9B0H32GJ AuKV3Bny5KEahQjW3G7VBBfd0+cD25kKfxzrZgyJZS/o+Fz/+5m1AbLX73MfKRg= =u2W6 -----END PGP SIGNATURE----- --wHtvbNoT5HReuwovSiwOqFQdfUfw5jNmc-- From owner-svn-src-all@freebsd.org Sat Aug 20 17:30:56 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46120BC0857; Sat, 20 Aug 2016 17:30:56 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 043821F0B; Sat, 20 Aug 2016 17:30:56 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbA6c-0004bP-UR; Sat, 20 Aug 2016 20:30:50 +0300 Date: Sat, 20 Aug 2016 20:30:50 +0300 From: Slawa Olhovchenkov To: Ryan Stone Cc: Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160820173050.GQ22212@zxy.spb.ru> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 17:30:56 -0000 On Sat, Aug 20, 2016 at 12:36:58PM -0400, Ryan Stone wrote: > + adrian@, who prompted me to look at UDP in the first place > > > I'm really not sure what my next step should be. I'm willing to revert > r304436, but I really don't want to revert r304437 because we've seen > crashes in the real world due to the missing locking. Unfortunately, > reverting r304436 would mean that every UDP packet would incur the overhead > of an additional rlock/runlock call, which is what I've been trying to > avoid. I don't see a particularly good path forward. As I understund specific handling of broadcast required only for routers (by RFC1812). For host enought have [hidden] alias with broadcsts bits. Anyway, don't should relay on the L2 information, you can recive L3 unicast addressed packets (with alien dst IP address) in L2 broadcas packet. Sorry if I am miss something in you discurs. From owner-svn-src-all@freebsd.org Sat Aug 20 17:48:01 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3B86BC0B9F; Sat, 20 Aug 2016 17:48:01 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93D70181B; Sat, 20 Aug 2016 17:48:01 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 05CD52043E; Sat, 20 Aug 2016 13:47:59 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 13:48:00 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=q/qH+owN5tPPAXQXPTDVjlduApQ=; b=PeOQBO s869a9UqOL5UP9mSNXEjiRXW+gLf9FMJWLqK6JdlIywponEcrP7pwIwM7ks9d4BH YAIkhKVKuGCDtgMbPuncSQYFHVYCT5yejubeBjLLO/myp+DFFKJmGN4Nj/v9gRoC OuoLM5vE+dI3C2c4aUnEgjg8fCc6DinliTwLU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=q/qH+owN5tPPAXQ XPTDVjlduApQ=; b=WVNW8GbNQ34Pk98sLQcl3HiNVidlADvzpSTFF36QQkY4Pi8 dIjt+u+YOO2smcUhc3jhSHuO5krMeZTuxT1Z8EPJEvlXhl842lcc3CotaCpF1wRC wQd1uOH6gOm2rmQJ1EMGUsr1zIdN5SdQOt6PvHE0tkhK53RhWs4BJH6jb+HY= X-Sasl-enc: 5TSZvYUUe2LhxwKSUFRksqrw09YN9FT+36ddcN7msXnw 1471715279 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id F24EDF296E; Sat, 20 Aug 2016 13:47:58 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov , Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> Cc: "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <598d1827-f834-5172-1431-9ecf25eb3b5c@fastmail.net> Date: Sat, 20 Aug 2016 18:47:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160820173050.GQ22212@zxy.spb.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 17:48:01 -0000 On 20/08/16 18:30, Slawa Olhovchenkov wrote: > Anyway, don't should relay on the L2 information, you can recive L3 > unicast addressed packets (with alien dst IP address) in L2 broadcas > packet. That is exactly what the egress routers in chapter 6 of my PhD do, but in a very controlled way -- by setting and clearing M_MCAST ! http://hdl.handle.net/10023/8681 In Ch6, ILNPv6 packets are effective being routed, using a multicast next-hop address (as distinct from the destination I-LV, which in turn is distinct from an IPv6 destination -- it just uses the same format.) It's counter-intuitive (and should not happen outside of that constrained scenario), but it has real world applications. From owner-svn-src-all@freebsd.org Sat Aug 20 18:02:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5014BC0E73; Sat, 20 Aug 2016 18:02:17 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 894B01F54; Sat, 20 Aug 2016 18:02:17 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-it0-x22c.google.com with SMTP id x131so55674631ite.0; Sat, 20 Aug 2016 11:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=v9OLQOo+Y0l3GbiUA62s4FVnJ1Hub/t1TivCgvOVANE=; b=MIjprukg6ab0dOlgKdz1MGws8kEtfnS8iN89W4LIOLepZJh1wjwU8AgtZn/vIqnq0P xUabxeDePw2sROqrxgPHCsh20ZdajQ422gHjSTIVtUcIxNWyOUAZItEcgIyVuw63l8Ok Ae7MBKkBWNAVr6TV0Qh0YxtjriDV1ISXA2LXFaVSNOXWsh9hn88CdQ//S/eKqoUzxMyB 01Y8R9Yw+KLXDuqyKyVKV8t8imzINaiSsHSOSgfqmuV3dEJntTRV2XIJEAUi2sOcOFX7 rn3ndlDvQMLfxp/2IaPO+uA/Yzphp+CVUkEyYUptYmVuLk3Vy/TIpeXiPrYNeDHqDcOe Jgrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=v9OLQOo+Y0l3GbiUA62s4FVnJ1Hub/t1TivCgvOVANE=; b=KmOQKxfo0TSILoywjwb2WCgtpQCvXLVbRCDMPeWFPUF77tRHURG3ZN97GfCQoegjuq qXuw8a+m3E79D6jtDk/yE+hJiP4NC638re0m9OaDP4JOqhfMFhtCxKmAz3FBBZbdstCu 6Pf9z3OROBoYkBOGfCd9e81t8iCb5Z9cnFQiHm7OPSKHZnRC0LZjv9UR1F+FJXl6hAac oINK0z97/D4NHK5VeI4Ws3qTL9fuenq1dXn9UPObMlXJSi0QJtpao8qhwmbMCzKbeOm7 fuOdqHOIwgyzzH+pgtaHSpgXJonvQuUqXwVC6k4cUZnJkF9ra4xsRyCCBFvn6YwwZ4Od /gtw== X-Gm-Message-State: AEkoousJ0lPSVKx13m7FujqwvueVTgZJhsXxhklQftnKW12iOdmrvGhYNn5gcgphpBW5HuHJYLMR0+Wc1oT08Q== X-Received: by 10.36.217.9 with SMTP id p9mr13165883itg.46.1471716136825; Sat, 20 Aug 2016 11:02:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Sat, 20 Aug 2016 11:02:16 -0700 (PDT) In-Reply-To: <20160820173050.GQ22212@zxy.spb.ru> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> From: Ryan Stone Date: Sat, 20 Aug 2016 14:02:16 -0400 Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov Cc: Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 18:02:17 -0000 On Sat, Aug 20, 2016 at 1:30 PM, Slawa Olhovchenkov wrote: > For host enought have [hidden] alias with broadcsts bits. > Anyway, don't should relay on the L2 information, you can recive L3 > unicast addressed packets (with alien dst IP address) in L2 broadcas > packet. > This is still handled correctly. The new code only checks for L3 broadcast addresses on L2 broadcast packets, but we still check the L3 address before treating it as a broadcast. The problem is that I assumed that all paths into the IP stack would set M_BCAST, but as Bruce has pointed out there are cases like PPP which do not. From owner-svn-src-all@freebsd.org Sat Aug 20 18:09:03 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 972AEBC0FDE; Sat, 20 Aug 2016 18:09:03 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x229.google.com (mail-it0-x229.google.com [IPv6:2607:f8b0:4001:c0b::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B5CB1515; Sat, 20 Aug 2016 18:09:03 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x229.google.com with SMTP id f6so50941699ith.0; Sat, 20 Aug 2016 11:09:03 -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:from:date:message-id :subject:to:cc; bh=4z1cCjGuWk0OgmimvNkvzCSHCDErys4eX9qRzUhqty0=; b=ZG4ZMZMLZZSo9h/XZB6+9Kg0mN/WoZIMXLXebQdX9nnIAixRgiYDQGFr8CZV236g+c iaJd0TQGXU/EUvxSbIgIGzuyPJVTgoKgazPcXGpWTArlz2p2S/RQz/iDdX1pWQCKzdxg woOSJpMuSj4dxFt+XCfN5vErt3dc2zmn2xx+Z7AB1fn7U1Oc24a6gmNHlAFPAxMSgUS5 Z+iQoCyKK/517Wu2DK7eD51/OnbwaV0NTDqmi/5jM0CTQaS3laQlozJbUQbsmj2qDqGa wmZPf2jNbCohC6coNS7ML3AF6BAyL8avHVV4lMwmoF4C2r1zlIusVieZZzoO80PQ3xwg 53eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4z1cCjGuWk0OgmimvNkvzCSHCDErys4eX9qRzUhqty0=; b=JPFg52sI2s++fSx0SdF6Kc2Ll2M9eUgvHdtHah/nZAubpcVzJ5F4K6+cCObbz6yY4v 8UqlQYovfBAPzKxmpDGFsYwS3fY7MyhbdnyhTSyG9l6oQSmII59rwEycD7gDkG4TA0ft rnCymDa0zoQIeWdtUmf96yupbo+rRRsp3xpMVG0l9hPb+ZUtVLo1yAcjluqj2g7LacKO Mc+IOZF6/9NQR7l1QaP3Fs5bQEMGbWtlDKwWPFjmMz2GADyKDXL0xBS/9wOvnmRFIUsb 0KJZOYfkeTx8B2AnlrTm9Ue8kfgWr47O3ZEyiUJFsp68RNJBFdSyIYlSyGbGAVHVt3sm Zn6A== X-Gm-Message-State: AEkoousWlkIwyrp3UCWnuBjtyTh/GpTG52JtoPGy1U+cSUMQx8JsZE9zqwZuhPIxtTxKQdfAMEBQiLWrQIe7xA== X-Received: by 10.36.124.141 with SMTP id a135mr12217351itd.25.1471716542851; Sat, 20 Aug 2016 11:09:02 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.141.129 with HTTP; Sat, 20 Aug 2016 11:09:00 -0700 (PDT) In-Reply-To: References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> From: Adrian Chadd Date: Sat, 20 Aug 2016 11:09:00 -0700 X-Google-Sender-Auth: YziLzUTXKROMF11KP8fB-oTNByE Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone Cc: Slawa Olhovchenkov , Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 18:09:03 -0000 On 20 August 2016 at 11:02, Ryan Stone wrote: > On Sat, Aug 20, 2016 at 1:30 PM, Slawa Olhovchenkov wrote: >> >> For host enought have [hidden] alias with broadcsts bits. >> Anyway, don't should relay on the L2 information, you can recive L3 >> unicast addressed packets (with alien dst IP address) in L2 broadcas >> packet. > > > This is still handled correctly. The new code only checks for L3 broadcast > addresses on L2 broadcast packets, but we still check the L3 address before > treating it as a broadcast. The problem is that I assumed that all paths > into the IP stack would set M_BCAST, but as Bruce has pointed out there are > cases like PPP which do not. Hi, So why not fix those paths? -adrian From owner-svn-src-all@freebsd.org Sat Aug 20 18:14:06 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB556BC04CB; Sat, 20 Aug 2016 18:14:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B327B1A82; Sat, 20 Aug 2016 18:14:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x230.google.com with SMTP id f6so51001670ith.0; Sat, 20 Aug 2016 11:14:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=dGqO+tn/D525kzTtDs0kB0laYiXrK1QMfBViTE4djno=; b=TItnNkk4q7oOYjQsPpXIaauXuTKHF6Wz1jI4+JkEAtak5s7OL+miAs00wsq3heYCly UzdcpZAEM8RUpIB98fVKwOJox5Vf92Ezg5oqf7/O+xX0rh9iCOqIAMEMfUwF6+GJrEw+ QTHYp5uW8Q2Dmtwz/+Qu7TGwwHttCzU9TYe8taUNlkxhhXpKMP3GYgKeYPwUWwx7To08 KGQPchXmWGdPsuj/Tetd/dH28PKH/t9aUp0td56d2/9Jbnt37/dXgsMXYzG1wY/o87vb mOi5XO8ppDC5kS9aiS7N+IkcDf9c30v/a223f3RKTJ7zUqKWAdbbIZx0NyspULM6ECAy QxIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=dGqO+tn/D525kzTtDs0kB0laYiXrK1QMfBViTE4djno=; b=kW0pSQVLPJ1GXfVl1epTewZ0q6QFeN0RyM25RXSd6x29BXVKAqBXapQRKGyaE0ayey TFeErvRgRLqtVUwrdv70J/YnIANz481A26MGOBXweCn/Qv2Xe1Sf8BqVUVEPDbtaiWnB znKmvpPVclKXYqUBIIv4+ecCPqxwSLI9mVOczgxBhL2OF3BEKazIIVPP0u84p51maznd KgJ/HUBSg+PbrGgLUinCr5rl9PZJTg5jOLHEo44Y/m12jx+DjdH+k4rV1+opbSwv7J2k 9VuWQ8lQj+imftGzvomPQmkSboBE+2HUn9KgyZVmLQrAdpK7mWfb4ioKsk4suppqkfOj QSyw== X-Gm-Message-State: AEkoouvtVAyZmWkr1q3YM3LLH9kBdN8Mb9Jun1bTQsagy8sF/DUduP6SPNWnr7H0icZwRwb+0F0CocSw+kJFfg== X-Received: by 10.36.242.68 with SMTP id j65mr12149576ith.25.1471716846196; Sat, 20 Aug 2016 11:14:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.141.129 with HTTP; Sat, 20 Aug 2016 11:14:05 -0700 (PDT) In-Reply-To: References: <201608192227.u7JMREIo032684@repo.freebsd.org> <9056382.PA4dZNFpPe@ralph.baldwin.cx> From: Adrian Chadd Date: Sat, 20 Aug 2016 11:14:05 -0700 Message-ID: Subject: Re: svn commit: r304506 - in head: . release/doc/en_US.ISO8859-1/hardware share/man/man4/man4.i386 sys/conf sys/dev/wl sys/i386/conf sys/modules sys/modules/wl targets/pseudo/userland tools/build/mk to... To: Warner Losh Cc: John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 18:14:07 -0000 [snip] I ... may do some kind of anniversary related work to fix up wi support again. Because - and this is pretty god damned hilarious - the same stack features (no raw frames, 802.3 encapsulation, scan/join/etc done via commands only, etc) that I need to 'fix' for wi are also required for almost all the 11ac hardware. ... -a From owner-svn-src-all@freebsd.org Sat Aug 20 18:14:41 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBAF3BC055B; Sat, 20 Aug 2016 18:14:41 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F7301D21; Sat, 20 Aug 2016 18:14:41 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id AB6C5202AD; Sat, 20 Aug 2016 14:14:40 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 14:14:40 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=e2mvHCawrJuBq0N8ULSLjAcU72w=; b=iA3rvP jF/2Qm19n16LgGF7nu/g8zYi5dxYSqhObPPe61cjQatqchQfLum9bT+4HOzR+w/X +bX8w1VrJBpox+WRBBbcoVjMM2A3y4IrdhBeqfdXWHYiKjvjaVc7QvZdT3Nu14ir i20Ic3SwIaLnVY9J1p6RIIREzrZ38uNaeTofE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=e2mvHCawrJuBq0N 8ULSLjAcU72w=; b=uZVUPrmmfIHd0dfmJ1ir9YA4vdvn65oQrWPFdJgpQ7UNPKF 5yTkyeWxnJF+ckjUMDwWW+PMDaUwt9kXXX2q3jKIe6Dkb6QAmlwM8TjK7+Zc7Hsa 4pabbdy44DKajReGMqAT39zuzRatjEb+P7Xabo/xpGGKihHChCqX/HVkutyo= X-Sasl-enc: nwhWTdUlbtl42Nj5JUtjqr2wj6SMLe3vzp0YS5xgeBTf 1471716880 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 9D442F2983; Sat, 20 Aug 2016 14:14:39 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Adrian Chadd , Ryan Stone References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> Cc: Slawa Olhovchenkov , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" From: Bruce Simpson Message-ID: Date: Sat, 20 Aug 2016 19:14:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 18:14:42 -0000 On 20/08/16 19:09, Adrian Chadd wrote: > On 20 August 2016 at 11:02, Ryan Stone wrote: >> On Sat, Aug 20, 2016 at 1:30 PM, Slawa Olhovchenkov wrote: >>> For host enought have [hidden] alias with broadcsts bits. >>> Anyway, don't should relay on the L2 information, you can recive L3 >>> unicast addressed packets (with alien dst IP address) in L2 broadcas >>> packet. >> >> This is still handled correctly. The new code only checks for L3 broadcast >> addresses on L2 broadcast packets, but we still check the L3 address before >> treating it as a broadcast. The problem is that I assumed that all paths >> into the IP stack would set M_BCAST, but as Bruce has pointed out there are >> cases like PPP which do not. > > So why not fix those paths? Because it would involve doing something similar to what if_ethersubr.c does right now: a direct comparison with FF:FF:FF:FF:FF:FF. Doing so outside of Ethernet would be invasive and one of those 'bad' layer crossings. This is tricky to get right. NetBSD introduced the M_PROMISC flag to cover situations which can occur when Ethernet can be re-entered by layers 'above' its original invocation. (I merged it here.) Ryan proposes slipping the definition of M_BCAST to include the network layer, inside ip_input() itself. That would not strictly violate layering, but bends the original meaning of the flag somewhat. That may work, provided it doesn't tread on the toes of anything above it. However the situation is somewhat similar to that of M_PROMISC. From owner-svn-src-all@freebsd.org Sat Aug 20 18:25:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66866BC0788; Sat, 20 Aug 2016 18:25:14 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 29E40139E; Sat, 20 Aug 2016 18:25:14 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-it0-x235.google.com with SMTP id f6so51128314ith.0; Sat, 20 Aug 2016 11:25:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YAf9EztyzzeE1TzgR/ts5noeSFkit9TlfBYOWy4enb8=; b=lctsOHI95WRc4CHwHWptZ0FtnyNYckxqFZL9qRhBEuiSzd/kFj8DgPS13R86gMZfvH ccbTAjNOadTmyvByw7CRnD2pCrVD5mat/+Dneccq7O+5d19z6Pa1wqLXlq7WuGe7wqu9 821k8g8VwHrya13lhcC2JOgLb264tSinLXvU5bc+2moNeNj12zG/pjrMVDaDQmT9d8KN mTCHqRIFpfg+j3NbpLP4s1G7b4A8k7Bp037Bvz7Vrk45/x42vVqrWr8rvxqnVhDWebbt wqJw4L+fz1MPVgI10DHgqyUjKjXmB/G4VFyIv4fVajEo9lPVhETFWVOPB4Q4AdYKnWdu 3ZYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=YAf9EztyzzeE1TzgR/ts5noeSFkit9TlfBYOWy4enb8=; b=C/wIuC+yPhW/iB6RTf/4Oboq3rX7tD2vXVPv+ckRZbm4qQ9ZKhx6x1OJZfwrS2m/j+ pLav/hwQ8rivYFIajQsCNNR0YFOG/dYgAwEg0O8G7M4dCqdWA2ZPRRbHELxmfftBNMLS tlHKZX/blWbJH5dEWjq8OnO7c788lEdRpl2dGOZglnmcYd8Zeb6DCVm3FI9gOiirgPv7 e0Ugs9tHtnkNiR58giX7L1HgRmeiJj6blSBxSU1pkgQLYB3FlxbBKWePrAkUcKJwM4Si On/hxXBuMTiA8CvT0hfPsdwqTxDNQoQWV+U1VjnolHLdoNR0OA4mGDRYzw9D9769R6PV 42FQ== X-Gm-Message-State: AEkoout/di+jMMuDUlDLI5+8zf6G3QMw14rh6C+/tpqm0ugC4vMsgzj6bkyPgH/tPjJEXYmE56T5aXXmn5k4EQ== X-Received: by 10.36.149.5 with SMTP id m5mr13230521itd.20.1471717513546; Sat, 20 Aug 2016 11:25:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Sat, 20 Aug 2016 11:25:12 -0700 (PDT) In-Reply-To: References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> From: Ryan Stone Date: Sat, 20 Aug 2016 14:25:13 -0400 Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Adrian Chadd Cc: Slawa Olhovchenkov , Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 18:25:14 -0000 On Sat, Aug 20, 2016 at 2:09 PM, Adrian Chadd wrote: > Hi, > > So why not fix those paths? > > > > -adrian > Is there even a fix that can be done there? I wouldn't expect a point-to-point protocol like PPP to have any need to explicitly signal that a packet is a broadcast. Is the information even available at that layer? From owner-svn-src-all@freebsd.org Sat Aug 20 18:27:22 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A633BC080B for ; Sat, 20 Aug 2016 18:27:22 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x236.google.com (mail-it0-x236.google.com [IPv6:2607:f8b0:4001:c0b::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F3A2715A8 for ; Sat, 20 Aug 2016 18:27:21 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x236.google.com with SMTP id e63so8707097ith.1 for ; Sat, 20 Aug 2016 11:27:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=sv2hwK0p6fLzKjcHHY7xRz+goI3LCYD0nDnsBH+wNLQ=; b=PBjvgMlq5lPeZvR1JL/pQTMOpExFmV5+nBXjk3lY2+NXaW7sbz6mniWsQ2PGV3bVul 8sQ7IAKDS9uA+qaJml4Rh/x2lDjEHRvX/PwYvMddepbX20oE2JOhuOHuOMaQdwQ5ZeRo FgQGXqF2uQAl0uiIcLrRYSZP7+7K+piDenuh4rRvOcyawRpOOLFn1/mFBixz8IAjicRU Xur+pnLL1XX36uWwFav6O1nzEFYFFVzINZ03PlXbEGXoh3oFh2FtmlPJKRE7w7f32d68 L7sVE3QcK29LF+gul7qAVf3heN7LrVujgnQGjoNeMqmYgMKadCKglPXCBIURkYzEWvrS CoPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=sv2hwK0p6fLzKjcHHY7xRz+goI3LCYD0nDnsBH+wNLQ=; b=cxVR0rau5SFkaCizg2dP61+QXqCRGA4gymM7sUW3zhWBesDUbKo8wfNNe8QIlKST+s DajfJlhDKgUYj6KFwifSVCN1TF4C7Mip846vkbtEn2YB4tuY9xy+dVxevL/4heCY2c29 YS+xD1NnOBShml2DpZnzs5+FJ8m2vLZrr+S38iM7Vfz3hM4Lr9WvWkMECgESR444cLJa FXTr8YHutLs8z2HTKEoOVmCDfmKVJFKjiGXJyO6tFKhoHt2hr2fYvxr93KTQgf/GLhzJ uP/JelU6il5aiy8OjvYOGwul4LtClVfrGP7usWGSfI8mxbGpV6iNozO24U/9J8xjJZj7 LARg== X-Gm-Message-State: AEkooutZcFT8adUM6ARJaODyMD2LnqsmHgMYkoBnvL3molOo8sswx86JKBvgJayJ9IBXnQo4eKJv0GVAwEU4dQ== X-Received: by 10.36.116.193 with SMTP id o184mr12597269itc.14.1471717641486; Sat, 20 Aug 2016 11:27:21 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.36.65.7 with HTTP; Sat, 20 Aug 2016 11:27:20 -0700 (PDT) X-Originating-IP: [69.53.245.200] In-Reply-To: References: <201608192227.u7JMREIo032684@repo.freebsd.org> <9056382.PA4dZNFpPe@ralph.baldwin.cx> From: Warner Losh Date: Sat, 20 Aug 2016 12:27:20 -0600 X-Google-Sender-Auth: KZsKYsDvBRjtIRpVKCoafD70wNA Message-ID: Subject: Re: svn commit: r304506 - in head: . release/doc/en_US.ISO8859-1/hardware share/man/man4/man4.i386 sys/conf sys/dev/wl sys/i386/conf sys/modules sys/modules/wl targets/pseudo/userland tools/build/mk to... To: Adrian Chadd Cc: John Baldwin , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 18:27:22 -0000 On Sat, Aug 20, 2016 at 12:14 PM, Adrian Chadd wrote: > [snip] > > I ... may do some kind of anniversary related work to fix up wi support again. > > Because - and this is pretty god damned hilarious - the same stack > features (no raw frames, 802.3 encapsulation, scan/join/etc done via > commands only, etc) that I need to 'fix' for wi are also required for > almost all the 11ac hardware. I'm not saying don't fix it. There's a bunch of older laptops that still have these cards in them (much to my amazement). Just that it shouldn't be a priority. If it works, keep it in the tree. If it is broken, though, the time has come to ditch it... Warner From owner-svn-src-all@freebsd.org Sat Aug 20 18:45:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90584BC0C14; Sat, 20 Aug 2016 18:45:11 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E7E61F91; Sat, 20 Aug 2016 18:45:11 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbBGU-0006Js-6W; Sat, 20 Aug 2016 21:45:06 +0300 Date: Sat, 20 Aug 2016 21:45:06 +0300 From: Slawa Olhovchenkov To: Ryan Stone Cc: Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160820184506.GV8192@zxy.spb.ru> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 18:45:11 -0000 On Sat, Aug 20, 2016 at 02:02:16PM -0400, Ryan Stone wrote: > On Sat, Aug 20, 2016 at 1:30 PM, Slawa Olhovchenkov wrote: > > > For host enought have [hidden] alias with broadcsts bits. > > Anyway, don't should relay on the L2 information, you can recive L3 > > unicast addressed packets (with alien dst IP address) in L2 broadcas > > packet. > > > > This is still handled correctly. The new code only checks for L3 broadcast > addresses on L2 broadcast packets, but we still check the L3 address before > treating it as a broadcast. The problem is that I assumed that all paths > into the IP stack would set M_BCAST, but as Bruce has pointed out there are > cases like PPP which do not. You also can recive this on ethernet too, IMHO, in case of /32. Receiving L3 broadcst in L2 unicast is legitime (IMHO) and we must be relaxed on this. From owner-svn-src-all@freebsd.org Sat Aug 20 18:51:50 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B58ABC0E2B; Sat, 20 Aug 2016 18:51:50 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFFDF16BF; Sat, 20 Aug 2016 18:51:49 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KIpn1T086910; Sat, 20 Aug 2016 18:51:49 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KIpnSf086909; Sat, 20 Aug 2016 18:51:49 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201608201851.u7KIpnSf086909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sat, 20 Aug 2016 18:51:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304537 - 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 18:51:50 -0000 Author: rwatson Date: Sat Aug 20 18:51:48 2016 New Revision: 304537 URL: https://svnweb.freebsd.org/changeset/base/304537 Log: Audit additional vnode information in the implementation of the ftruncate(2) system call. This was not required by the Common Criteria, which needed only open-time audit. MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sat Aug 20 18:45:25 2016 (r304536) +++ head/sys/kern/vfs_vnops.c Sat Aug 20 18:51:48 2016 (r304537) @@ -1302,6 +1302,7 @@ vn_truncate(struct file *fp, off_t lengt if (error) goto out1; vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); + AUDIT_ARG_VNODE1(vp); if (vp->v_type == VDIR) { error = EISDIR; goto out; From owner-svn-src-all@freebsd.org Sat Aug 20 18:57:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 621A1BC0EFF; Sat, 20 Aug 2016 18:57:37 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25B1B1C40; Sat, 20 Aug 2016 18:57:37 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-io0-x230.google.com with SMTP id 38so76997594iol.0; Sat, 20 Aug 2016 11:57:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=GzYXeQos5FAGlL7ru4K5UO/s8F6AQg6K/om87Nb9uKU=; b=q7WmFaa6CXZTl5INjzABW+AlfowKzcq9rWbUtPffcGeWgEZaiNyzAFPrebQ57IzT00 dw/QvZCSj0860EKt2fbbAJzVFGfetev2a4nLPWnfiq6kNKM5oIlfMTkjgkRl8g6LOC18 IS2PTUw2W/HW2r69z1N3VamnwBVDQUf5T9oSZXtlAeLltUDAokttbddrIiuHiw6D37v7 XebnvhYD5xe2eCvwawCNc3lxRuiiHOCKb8BEat3bvLpLUEGLocln65LX+yjVRa6YPl4n 4cgezvg8wguqK9+mQF0GiKWkxDOlj0OWIyH7Z9vTr9i117lPq/BW4OfcJWPeKoitSx2M xBnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=GzYXeQos5FAGlL7ru4K5UO/s8F6AQg6K/om87Nb9uKU=; b=j827XgqeNnzZIQdWyL/VQMI+FGAUdNcfrIy0ahmiBRwIYRqLtsKQzxSknAuhXJmM8q /t4oVu74BirFU/xFnSVF1k+3iazicrn3UHWTYbCW+gDyTSU5AaexXVce9Q1CcsXz8Cmu EhEpoDU43/rI01Xbnx9Wm/E92DYH7O2bHv1bMr+N1XyZOZpVWFcFyktR7Tw32klU/9dq t+xqrUvZOr+lQkWRB47VK0p1XfIwtKZLMNn0RhjLRB0GZ264wiHT2Ji62sukhZXS9Vsh GH2P1ovEdeFKcbVCA0qlKhZeFQDOnMQQl11l32QZcHdHYsKVPsN5s8YUtlPesUzS9Rz7 7CMQ== X-Gm-Message-State: AEkooutXMg6FTowNDHPbsVrUdOYlwONLncND+rXhwE8VW0BogQ0+ei1jn2d1xFGvfwvqOflz8cTAVDiB7hu3gg== X-Received: by 10.107.159.147 with SMTP id i141mr15640182ioe.29.1471719456573; Sat, 20 Aug 2016 11:57:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.200.71 with HTTP; Sat, 20 Aug 2016 11:57:36 -0700 (PDT) In-Reply-To: <20160820184506.GV8192@zxy.spb.ru> References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> From: Ryan Stone Date: Sat, 20 Aug 2016 14:57:36 -0400 Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov Cc: Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 18:57:37 -0000 On Sat, Aug 20, 2016 at 2:45 PM, Slawa Olhovchenkov wrote: > You also can recive this on ethernet too, IMHO, in case of /32. > Receiving L3 broadcst in L2 unicast is legitime (IMHO) and we must be > relaxed on this. > There is no broadcast address on a /32 network. Independent of my change, we would not treat a packet received on a /32 network as a broadcast here because in_broadcast() will return 0 for it. From owner-svn-src-all@freebsd.org Sat Aug 20 18:59:58 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4001CBC0013; Sat, 20 Aug 2016 18:59:58 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F23881E0B; Sat, 20 Aug 2016 18:59:57 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbBUp-0006eV-Uj; Sat, 20 Aug 2016 21:59:55 +0300 Date: Sat, 20 Aug 2016 21:59:55 +0300 From: Slawa Olhovchenkov To: Ryan Stone Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Bruce Simpson , "svn-src-head@freebsd.org" , Ryan Stone Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160820185955.GR22212@zxy.spb.ru> References: <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 18:59:58 -0000 On Sat, Aug 20, 2016 at 02:57:36PM -0400, Ryan Stone wrote: > On Sat, Aug 20, 2016 at 2:45 PM, Slawa Olhovchenkov wrote: > > > You also can recive this on ethernet too, IMHO, in case of /32. > > Receiving L3 broadcst in L2 unicast is legitime (IMHO) and we must be > > relaxed on this. > > > > There is no broadcast address on a /32 network. Independent of my change, > we would not treat a packet received on a /32 network as a broadcast here > because in_broadcast() will return 0 for it. /32 only from router side (+proxy arp). host configured for /24 From owner-svn-src-all@freebsd.org Sat Aug 20 19:49:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A26ACBC0E4E; Sat, 20 Aug 2016 19:49:31 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5AF2619F4; Sat, 20 Aug 2016 19:49:31 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id bCGlbzcvzXHJlbCGmbB2B9; Sat, 20 Aug 2016 13:49:29 -0600 X-Authority-Analysis: v=2.2 cv=Ffh1/926 c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=7z1cN_iqozsA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=mqxo5rJUD7QTCOWbiGwA:9 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 47968137E8; Sat, 20 Aug 2016 12:49:27 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u7KJnRHf003966; Sat, 20 Aug 2016 12:49:27 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201608201949.u7KJnRHf003966@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: John Baldwin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r304513 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/ie sys/i386/conf sys/modules sys/modules/ie sys/pc98/conf In-Reply-To: Message from John Baldwin of "Sat, 20 Aug 2016 07:51:55 -0700." <1699917.hhfoKyASTk@ralph.baldwin.cx> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 20 Aug 2016 12:49:27 -0700 X-CMAE-Envelope: MS4wfMyzrH08pCe6dKy9TLaVEbNSBAJJKT5pbv3ptl2k5im7m+De20N6PG6oUbGZUMdhyhOyHtAtK3nKOPYnhLq5u1BhvzFlBY2GW9v+aX17Ei/V4CbEGGNh gwhW3FNL2V1F5Ue69BS4elAMj/4bgiyyr19ZJnFdUndLXd5MhGcbOLjsscR77O10T29Jl2ystbTsWpjCTdDOIXl+dl2DOdFfrLtRuLWiPkstZvSSzEBfIw/H eJBXMKdPhBGyuAjWowJiN9J6FBKLpwJd9qqGmlI6Lzmmtu7OhZzsnt7oKnKzb+rs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 19:49:31 -0000 In message <1699917.hhfoKyASTk@ralph.baldwin.cx>, John Baldwin writes: > On Saturday, August 20, 2016 12:49:30 AM John Baldwin wrote: > > Author: jhb > > Date: Sat Aug 20 00:49:29 2016 > > New Revision: 304513 > > URL: https://svnweb.freebsd.org/changeset/base/304513 > > > > Log: > > Remove the ie(4) driver for Intel 82586 ISA Ethernet adapters. > > > > This driver only supports 10Mb Ethernet using PIO (the hardware supports > > DMA, but the driver only does PIO). There are not any PCCard adapters > > supported by this driver, only ISA cards. In addition, it does not use > > bus_space but instead uses bcopy with volatile pointers triggering a > > host of warnings. (if_ie.c is one of 3 files always built with > > -Wno-error) > > > > Relnotes: yes > > This concludes the list of older drivers I had from earlier after working > on the timeout(9) -> callout(9) changes (almost finished with that, just > a few things left to test changes for, one of them being fail points before > we can remove timeout()/untimeout() entirely). > > I do not have plans for removing any other drivers, though am open to > suggestions. Some possibilities include: > > - tty drivers that haven't been updated to new tty and have been disconnected > from the build since 8.0 including digi(4) and cy(4). I know Bruce has > patches for sio(4) that I just haven't merged, so I'm inclined to leave > sio(4), but the other disconnected drivers are candidates I think. > - Older storage adapters: > - aha (ISA) I have a bunch of AHA-1542s in a storage locker (along with the contents of my house when I sold it). I recall that SCSI was better behaved on my first FreeBSD machine (FreeBSD 2.0.5) than was IDE. (Except for IDE support, Linux sucked badly in all other areas at the time, thus my introduction to FreeBSD, thanks to jkh@. But that's going down memory lane...) I digress... > - ahb (EISA) > - adv (ISA / EISA / PCI) > - adw (PCI)? > - bt (ISA / EISA / PCI) I have one of these. IIRC, a 948 PCI card. Though I don't use it any more. The Adaptec 2940s -- ahc -- of which I have many -- were my mainstay. > - aic (ISA / PCCard) > - ct (ISA / CBUS) > - dpt (ISA / EISA / PCI) > - ncv (PCCard / PCI) > - nsp (PCCard) > - stg (ISA / PCCard / PCI) > (Note: some of these are PC-98 related and might remove too much of the > PC-98 ecosystem if removed?) > - mse(4) (ISA-only non-PS-2, non-serial mouse) > - joy(4) (ISA-only, was on various Sound Cards, etc., but I haven't seen > a "game port" on a modern box in a long while) > Hmmm. I could open another bikeshed here. I'd better not. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat Aug 20 19:51:53 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0259FBC0FE0; Sat, 20 Aug 2016 19:51:53 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AAA301CBF; Sat, 20 Aug 2016 19:51:52 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id bCIzbzeDPXHJlbCJ0bB2VK; Sat, 20 Aug 2016 13:51:46 -0600 X-Authority-Analysis: v=2.2 cv=Ffh1/926 c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=7z1cN_iqozsA:10 a=-FGs326eAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=Uq3-0apMmEqrnhaVEVUA:9 a=7Nw9HX5Nqxt2AnyyOhBr:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 2975D13860; Sat, 20 Aug 2016 12:51:45 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u7KJpiAZ004000; Sat, 20 Aug 2016 12:51:44 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201608201951.u7KJpiAZ004000@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Mark Linimon cc: John Baldwin , src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r304513 - in head: . share/man/man4/man4.i386 sys/conf sys/dev/ie sys/i386/conf sys/modules sys/modules/ie sys/pc98/conf In-Reply-To: Message from Mark Linimon of "Sat, 20 Aug 2016 10:24:06 -0500." <20160820152406.GA8132@lonesome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 20 Aug 2016 12:51:44 -0700 X-CMAE-Envelope: MS4wfOABDrGxCxOAT27jgoYAh2cctIViKz/o/7nbiGDv3t1Q0h/pGAaB0i2jso5fZ9un6/k/RPBHS7O27WEbM4DrFDyanGMnS0jo0xaGEZQkbPvD7Y5e7yHC yNUT8JQ4yIwUXCKG+4q9M+v8MjsncVrxN69n7NpVkMQ2gCo+foktAUEsIuP1mH7H6jy+zoByZM+PHyoXBfKGly1/XWO/dj0gW1b+zF8UowmaWvc/LqUk6Whu WYF1T/RaWstZ/g5l0w9P+L0Ht1lLW+Zn+TWTEKaFNWfsw4QQmdORdU+OXrQpNZkm4RmQiOiwRGZNeCsU8YsNZw== X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 19:51:53 -0000 In message <20160820152406.GA8132@lonesome.com>, Mark Linimon writes: > On Sat, Aug 20, 2016 at 07:51:55AM -0700, John Baldwin wrote: > > - aha (ISA) > > - bt (ISA / EISA / PCI) > > If anyone complains, tell them I'll ship them cards. > > If they consider that a threat ... so be it :-) > > (I *am* in the middle of a big decluttering, you know. I can find > them ...) Add my BT-948 to the list. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat Aug 20 20:05:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11D7CBC02C9; Sat, 20 Aug 2016 20:05:47 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D41A315B2; Sat, 20 Aug 2016 20:05:46 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id BC830202B5; Sat, 20 Aug 2016 16:05:45 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 16:05:45 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=0aA0EwChDLlZjobxX68vrGtvK6c=; b=ipXi6g W9EH8gUVIQhw5/UwOnME5dLFhE38cZAjSks2lqZLRJ8Qf3CccD5cfCpHtJIUSxg3 Fg8BOYbInaT/ob04WM7V3A2D/rjKjDAWgYg2tQ/2E+z/r5Larvow+O1BH0V9p171 w1kEHttXN6/iPWf/A/46ZqRh5Kizj4wOj3Qxo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=0aA0EwChDLlZjob xX68vrGtvK6c=; b=W1FbtqDOq9W6un0/6x0JIz0EwMXqSxmIizApWAGXQqIXE8+ OsDABX9aUXzh0Su+QFYJIib9NoQAOxv0THxD6c6BmsoXrLzIP+9jh0h/lBbAnUaj gNES2E7cFRM/73piUT6YgqEjK3H+lTix0+D0oS2pJwNwWE+tUMJCUJvvpzHw= X-Sasl-enc: MF2XJ7uoXbQbK+CQB3Fav63UhRk+v+eFwzUr74cXXwTe 1471723545 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 88C8EF296F; Sat, 20 Aug 2016 16:05:44 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone , Slawa Olhovchenkov References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> Cc: "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: Date: Sat, 20 Aug 2016 21:05:36 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 20:05:47 -0000 On 20/08/16 19:57, Ryan Stone wrote: > > > On Sat, Aug 20, 2016 at 2:45 PM, Slawa Olhovchenkov > wrote: > > You also can recive this on ethernet too, IMHO, in case of /32. > Receiving L3 broadcst in L2 unicast is legitime (IMHO) and we must be > relaxed on this. > > > There is no broadcast address on a /32 network. Independent of my > change, we would not treat a packet received on a /32 network as a > broadcast here because in_broadcast() will return 0 for it. Hmm. That is not entirely true for /32. Even though the link layer might be Ethernet in that case, in the traditional BSD ifnet sense, while the broadcast address slot may have the same value (and actual location) as the peer end of a P2P (as in generically IFF_PPP, not just pppd(8)) interface), because it's on an Ethernet (IFF_BROADCAST) interface, the host part of the /32's value in in the broadcast address is still valid, and will probably get mapped that way if M_BCAST is set on outgoing traffic. (You are, after all, going to go through ARP on Ethernet, even for a /32, so that mapping will be triggered.) Unless I am missing something crucial here? As far as I can tell, arpresolve() unconditionally resolves L2 next-hop to the value of ifp->if_broadcastaddr. And that is always set to 'etherbroadcastaddr' by default for Ethernet ifnets: FF:FF:FF:FF:FF:FF. Would that not get past the M_BCAST check which replaced the call to in_broadcast()? From owner-svn-src-all@freebsd.org Sat Aug 20 20:15:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EF88BC04FF; Sat, 20 Aug 2016 20:15:38 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFC191A0B; Sat, 20 Aug 2016 20:15:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KKFbFq020468; Sat, 20 Aug 2016 20:15:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KKFbm9020467; Sat, 20 Aug 2016 20:15:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201608202015.u7KKFbm9020467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 20 Aug 2016 20:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304543 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 20:15:38 -0000 Author: tuexen Date: Sat Aug 20 20:15:36 2016 New Revision: 304543 URL: https://svnweb.freebsd.org/changeset/base/304543 Log: Unbreak sctp_connectx(). MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Aug 20 19:48:03 2016 (r304542) +++ head/sys/netinet/sctputil.c Sat Aug 20 20:15:36 2016 (r304543) @@ -6356,7 +6356,7 @@ sctp_connectx_helper_find(struct sctp_in struct sctp_tcb *stcb = NULL; unsigned int incr, at, i; - at = incr = 0; + at = 0; sa = addr; *error = *num_v6 = *num_v4 = 0; /* account and validate addresses */ @@ -6364,6 +6364,7 @@ sctp_connectx_helper_find(struct sctp_in switch (sa->sa_family) { #ifdef INET case AF_INET: + incr = (unsigned int)sizeof(struct sockaddr_in); if (sa->sa_len != incr) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); *error = EINVAL; @@ -6371,7 +6372,6 @@ sctp_connectx_helper_find(struct sctp_in return (NULL); } (*num_v4) += 1; - incr = (unsigned int)sizeof(struct sockaddr_in); break; #endif #ifdef INET6 @@ -6387,6 +6387,7 @@ sctp_connectx_helper_find(struct sctp_in *bad_addr = 1; return (NULL); } + incr = (unsigned int)sizeof(struct sockaddr_in6); if (sa->sa_len != incr) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EINVAL); *error = EINVAL; @@ -6394,7 +6395,6 @@ sctp_connectx_helper_find(struct sctp_in return (NULL); } (*num_v6) += 1; - incr = (unsigned int)sizeof(struct sockaddr_in6); break; } #endif From owner-svn-src-all@freebsd.org Sat Aug 20 20:28:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33EC3BC07C2; Sat, 20 Aug 2016 20:28:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E00701FE4; Sat, 20 Aug 2016 20:28:09 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KKS9JR024167; Sat, 20 Aug 2016 20:28:09 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KKS84V024163; Sat, 20 Aug 2016 20:28:08 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201608202028.u7KKS84V024163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sat, 20 Aug 2016 20:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304544 - in head/sys: kern security/audit 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 20:28:10 -0000 Author: rwatson Date: Sat Aug 20 20:28:08 2016 New Revision: 304544 URL: https://svnweb.freebsd.org/changeset/base/304544 Log: Audit the accepted (or rejected) username argument to setlogin(2). (NB: This was likely a mismerge from XNU in audit support, where the text argument to setlogin(2) is captured -- but as a text token, whereas this change uses the dedicated login-name field in struct audit_record.) MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/sys/kern/kern_prot.c head/sys/security/audit/audit.h head/sys/security/audit/audit_bsm.c Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Sat Aug 20 20:15:36 2016 (r304543) +++ head/sys/kern/kern_prot.c Sat Aug 20 20:28:08 2016 (r304544) @@ -2105,6 +2105,7 @@ sys_setlogin(struct thread *td, struct s error = EINVAL; return (error); } + AUDIT_ARG_LOGIN(logintmp); PROC_LOCK(p); SESS_LOCK(p->p_session); strcpy(p->p_session->s_login, logintmp); Modified: head/sys/security/audit/audit.h ============================================================================== --- head/sys/security/audit/audit.h Sat Aug 20 20:15:36 2016 (r304543) +++ head/sys/security/audit/audit.h Sat Aug 20 20:28:08 2016 (r304544) @@ -212,6 +212,11 @@ void audit_thread_free(struct thread *t audit_arg_groupset((gidset), (gidset_size)); \ } while (0) +#define AUDIT_ARG_LOGIN(login) do { \ + if (AUDITING_TD(curthread)) \ + audit_arg_login((login)); \ +} while (0) + #define AUDIT_ARG_MODE(mode) do { \ if (AUDITING_TD(curthread)) \ audit_arg_mode((mode)); \ @@ -354,6 +359,7 @@ void audit_thread_free(struct thread *t #define AUDIT_ARG_FFLAGS(fflags) #define AUDIT_ARG_GID(gid) #define AUDIT_ARG_GROUPSET(gidset, gidset_size) +#define AUDIT_ARG_LOGIN(login) #define AUDIT_ARG_MODE(mode) #define AUDIT_ARG_OWNER(uid, gid) #define AUDIT_ARG_PID(pid) Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Sat Aug 20 20:15:36 2016 (r304543) +++ head/sys/security/audit/audit_bsm.c Sat Aug 20 20:28:08 2016 (r304544) @@ -1394,8 +1394,8 @@ kaudit_to_bsm(struct kaudit_record *kar, break; case AUE_SETLOGIN: - if (ARG_IS_VALID(kar, ARG_TEXT)) { - tok = au_to_text(ar->ar_arg_text); + if (ARG_IS_VALID(kar, ARG_LOGIN)) { + tok = au_to_text(ar->ar_arg_login); kau_write(rec, tok); } break; From owner-svn-src-all@freebsd.org Sat Aug 20 20:34:17 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99E9CBC0C81; Sat, 20 Aug 2016 20:34:17 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67D101799; Sat, 20 Aug 2016 20:34:17 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 1242E20255; Sat, 20 Aug 2016 16:34:16 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 16:34:16 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=M7X4CaGypMylhBzxghJSCv+oHWo=; b=EOJJYG xbUmLKZuneEjiCIUSktkelx+QjFvtC3QpFzWFURxxSR3QHj0MGae5hXRp5qAdBaT g+qFLEIYW/gCCMHAZlH4CNQExwM0Xo/HNqdrHYYbtZb0zhfjNe2R0Oh81MEUgViI LDInhTsFEJyA+QeakHthmJQngygUYBT5sPeV4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=M7X4CaGypMylhBz xghJSCv+oHWo=; b=KUGqd+8g0hrUhwZaAsE+oRgPSwxBX38vlw1CGY11W+zRP4A lkPQmfQlk1xa7ptXALhzdQgQP1GdRhNXur12Kf5ZBj3INUuvwWGEDuYYNIUIlNz9 9Wc212G84910cblVxXs2030gew6QAKMdN/Pf10Za04DaIeHXFOeCxLIwVEQg= X-Sasl-enc: 1gldOMlIDvVgByxfQ2KhLaQPibzj7HX+xqcoHNgmK9Io 1471725255 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 07B94F2983; Sat, 20 Aug 2016 16:34:14 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Ryan Stone , Slawa Olhovchenkov References: <201608182259.u7IMx5oW002018@repo.freebsd.org> <4fbc2e1d-3a62-5963-83d5-f9c931503e51@fastmail.net> <3806700d-ed27-7915-4818-c2d64f7b806d@fastmail.net> <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> Cc: "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> Date: Sat, 20 Aug 2016 21:34:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 20:34:17 -0000 On 20/08/16 21:05, Bruce Simpson wrote: > Unless I am missing something crucial here? As far as I can tell, > arpresolve() unconditionally resolves L2 next-hop to the value of > ifp->if_broadcastaddr. And that is always set to 'etherbroadcastaddr' by > default for Ethernet ifnets: FF:FF:FF:FF:FF:FF. > > Would that not get past the M_BCAST check which replaced the call to > in_broadcast()? Based on my reading of the UDP-and-plumbing layer, it looks like we will only see FF:FF:FF:FF:FF:FF being used by the undirected IPv4 broadcast address, 255.255.255.255. But, in fact, this is probably a far more valid address to use for discovery services than the x.x.x.255-style IPv4 directed broadcast address, as, for Ethernet at least, it is guaranteed not to propagate beyond 1 union-of (on-link broadcast domain (layer 2, hop 1) & other ways that IPv4 subnet is bridged). So, Ryan -- your original reading of how in_broadcast() behaves is correct, modulo the all-ones bypassing it. (I believe dhclient and isc-dhcpd bypass it at BPF injection, though.) From owner-svn-src-all@freebsd.org Sat Aug 20 20:41:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 022E5BC0DA1; Sat, 20 Aug 2016 20:41:16 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B429F1A24; Sat, 20 Aug 2016 20:41:15 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbD4k-0008qT-VJ; Sat, 20 Aug 2016 23:41:06 +0300 Date: Sat, 20 Aug 2016 23:41:06 +0300 From: Slawa Olhovchenkov To: Bruce Simpson Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160820204106.GW8192@zxy.spb.ru> References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 20:41:16 -0000 On Sat, Aug 20, 2016 at 09:34:06PM +0100, Bruce Simpson wrote: > On 20/08/16 21:05, Bruce Simpson wrote: > > Unless I am missing something crucial here? As far as I can tell, > > arpresolve() unconditionally resolves L2 next-hop to the value of > > ifp->if_broadcastaddr. And that is always set to 'etherbroadcastaddr' by > > default for Ethernet ifnets: FF:FF:FF:FF:FF:FF. > > > > Would that not get past the M_BCAST check which replaced the call to > > in_broadcast()? > > Based on my reading of the UDP-and-plumbing layer, it looks like we will > only see FF:FF:FF:FF:FF:FF being used by the undirected IPv4 broadcast > address, 255.255.255.255. > > But, in fact, this is probably a far more valid address to use for > discovery services than the x.x.x.255-style IPv4 directed broadcast > address, as, for Ethernet at least, it is guaranteed not to propagate > beyond 1 union-of (on-link broadcast domain (layer 2, hop 1) & other > ways that IPv4 subnet is bridged). > > So, Ryan -- your original reading of how in_broadcast() behaves is > correct, modulo the all-ones bypassing it. > > (I believe dhclient and isc-dhcpd bypass it at BPF injection, though.) What purpose to analyse L2 header? Yes, curently FreeBSD don't support multiaccess media other then ethernet (i.e. ATM, FrameRelay), but in case of mGRE L2 header will be absent. From owner-svn-src-all@freebsd.org Sat Aug 20 20:46:55 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BDC9BC0F73; Sat, 20 Aug 2016 20:46:55 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E14D61ECF; Sat, 20 Aug 2016 20:46:54 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KKksWk031559; Sat, 20 Aug 2016 20:46:54 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KKksdN031558; Sat, 20 Aug 2016 20:46:54 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201608202046.u7KKksdN031558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Sat, 20 Aug 2016 20:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304545 - head/sys/netinet6 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 20:46:55 -0000 Author: karels Date: Sat Aug 20 20:46:53 2016 New Revision: 304545 URL: https://svnweb.freebsd.org/changeset/base/304545 Log: Disable L2 caching for UDP over IPv6 The ip6_output routine is missing L2 cache invalication as done in ip_output. Even with that code, some problems with UDP over IPv6 have been reported. Diabling L2 cache for that problem works around the problem for now. PR: 211872 211926 Reviewed by: gnn Approved by: gnn (mentor) MFC after: immediate Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Sat Aug 20 20:28:08 2016 (r304544) +++ head/sys/netinet6/udp6_usrreq.c Sat Aug 20 20:46:53 2016 (r304545) @@ -898,7 +898,7 @@ udp6_output(struct inpcb *inp, struct mb UDP_PROBE(send, NULL, inp, ip6, inp, udp6); UDPSTAT_INC(udps_opackets); - error = ip6_output(m, optp, &inp->inp_route6, flags, + error = ip6_output(m, optp, NULL, flags, inp->in6p_moptions, NULL, inp); break; case AF_INET: From owner-svn-src-all@freebsd.org Sat Aug 20 20:56:37 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA975BC0240; Sat, 20 Aug 2016 20:56:37 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A7491609; Sat, 20 Aug 2016 20:56:37 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KKuaXV035387; Sat, 20 Aug 2016 20:56:36 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KKuaOg035386; Sat, 20 Aug 2016 20:56:36 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201608202056.u7KKuaOg035386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Sat, 20 Aug 2016 20:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r304546 - stable/11/sys/netinet6 X-SVN-Group: stable-11 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.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 20:56:37 -0000 Author: karels Date: Sat Aug 20 20:56:36 2016 New Revision: 304546 URL: https://svnweb.freebsd.org/changeset/base/304546 Log: MFC r304545: Disable L2 caching for UDP over IPv6 The ip6_output routine is missing L2 cache invalication as done in ip_output. Even with that code, some problems with UDP over IPv6 have been reported. Diabling L2 cache for that problem works around the problem for now. PR: 211872 211926 Reviewed by: gnn Approved by: gnn (mentor) Tested by: peter@, Mike Andrews MFC after: immediate Modified: stable/11/sys/netinet6/udp6_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/11/sys/netinet6/udp6_usrreq.c Sat Aug 20 20:46:53 2016 (r304545) +++ stable/11/sys/netinet6/udp6_usrreq.c Sat Aug 20 20:56:36 2016 (r304546) @@ -898,7 +898,7 @@ udp6_output(struct inpcb *inp, struct mb UDP_PROBE(send, NULL, inp, ip6, inp, udp6); UDPSTAT_INC(udps_opackets); - error = ip6_output(m, optp, &inp->inp_route6, flags, + error = ip6_output(m, optp, NULL, flags, inp->in6p_moptions, NULL, inp); break; case AF_INET: From owner-svn-src-all@freebsd.org Sat Aug 20 21:17:38 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C311BC07F3; Sat, 20 Aug 2016 21:17:38 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1C12411E6; Sat, 20 Aug 2016 21:17:37 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id A5EC220439; Sat, 20 Aug 2016 17:17:36 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 17:17:36 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=O6Z7xG76TTuAkgoUdfUY2eoEuoI=; b=C6mbdP PH9svkcWDsV50MurSQeeMJ1yVaTXJwolUv1RxzW34VHSIl/ibyqMT5vorl9SaP34 SxzP7XJzo/k7VmvVeCAQqdUQ1676aO8zoeYvwHs2qI9AhSK9lU31a1QETc1r1Rzp 2kR/4dlkEYGltRv+T242LAwveRs9FAJph+YRw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=O6Z7xG76TTuAkgo UdfUY2eoEuoI=; b=ER/hqcGoq8Fv0lcRpzQiA0H00tsgJd4D5K7mb774KsN1/gl NpIt699cxcnS6/pqXoajYa/FEuP2e1OxDlmARKYXBt5aFZqUyDzM103HrBVnJLaa 2z2qrenIXKg9j8bW5OS5TjhIiedszhtFrsmpU5HBh1wpsQ0rkjV7ZBpkOtfU= X-Sasl-enc: QA6B73tyS1i9DvM8kfr4NMEayXNK3yiKbN8mXfF9N7Z1 1471727856 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 9EF7BCCDC5; Sat, 20 Aug 2016 17:17:35 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> Date: Sat, 20 Aug 2016 22:17:27 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160820204106.GW8192@zxy.spb.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 21:17:38 -0000 On 20/08/16 21:41, Slawa Olhovchenkov wrote: > On Sat, Aug 20, 2016 at 09:34:06PM +0100, Bruce Simpson wrote: >> So, Ryan -- your original reading of how in_broadcast() behaves is >> correct, modulo the all-ones bypassing it. > What purpose to analyse L2 header? I was just checking for possible edge cases for a substitution of the in_broadcast() check with some other way of logically summarising the real broadcast disposition of the interface in bits, given your mGRE example below. Like M_BCAST, but 'This packet is flagged as broadcast, but only by a proxy method, not L2'. > Yes, curently FreeBSD don't support multiaccess media other then > ethernet (i.e. ATM, FrameRelay), but in case of mGRE L2 header will be > absent. Exactly! People forget that certain legitimate multipoint protocols already exist as overlays already. It is easy when all we grow up with is Ethernet. :-) Until we peek under the hood, we may not know. Slawa, you have hit the nail on the head. The situation can naturally arise anywhere we bridge L2/L3 in certain directions, be that in VPN aggregation or PPPoE aggregation. In many ways I regret never being able to have executed work on a design for ng_pppoa in 2005/6. But, given the pain people in the UK are having with BT and VDSL modem provision right now... it comes as no surprise that the next generation of DSL access, for us, can be as bad. For some, multipoint is less important now we have SR-IOV VFs and other means of allocating discrete unicast Ethernet MACs and using them as links, but... Roundabout the time I merged M_PROMISC from NetBSD to FreeBSD in 2006/7, I considered that we should add an abstraction to ifnet to permit multiple unicast (or special) MACs to be bound to existing ifnets, and -- where the card permits it, expedite that MAC in some way. That capability was present on the (legacy) Adaptec Starfire quad 100TX from that era. Today, it exists in e.g. Chelsio T4/5 TCAM filter, or multiple perfect hashes on the previous generations of cards. (Currently the FreeBSD stack does nothing about such.) I suspect it is less important now we have RSS for raw TCP throughput, but, for those of us -- e.g. in internet service provider (ISP) type environments, we have to keep a careful eye on how well FreeBSD plays nice with other Ethernet equipment, with a view to these types of potential optimizations in future. However, we still have to keep the FreeBSD-on-Ethernet ship sailing smoothly. The intent of the original input path change is clearly for performance, but perhaps slipping the M_BCAST tag in the stack is the right way forward. I would also suggest: we add ability to qualify where in the stack M_BCAST was raised (in case of any possible re-entry), by allocating one more MBUF flag to Layer 2. Then, the same M_PROMISC flag trick can be applied... and Ryan's broadcast performance boost could perhaps even carry across L2 bridging tiers, e.g. stacked if_bridge or netgraph, providing we know what direction in the stack it's traveling in (and its absolute ifnet origin). From owner-svn-src-all@freebsd.org Sat Aug 20 21:44:14 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28867BC0FEB; Sat, 20 Aug 2016 21:44:14 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB8F11F93; Sat, 20 Aug 2016 21:44:13 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 71159202A9; Sat, 20 Aug 2016 17:44:12 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 17:44:12 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=4tDGJUWkgw6O2b3yyyB14QlnOBw=; b=YNfFak ccUFbmvGTvs9djkypX2pDjGfEHm4zDisLmeS5UBSLLPbc3imw//1pcTV7cehBmt3 K1CL01CucWxF1b3MNwGgQ/Ha1V4wxpRHXO3owUWrrMENaNeTb62bLlEz2CzvnzTI rG9fIZwaaLdwhiP7htkZGUL4sH5opzm3SyoXs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=4tDGJUWkgw6O2b3 yyyB14QlnOBw=; b=rFaiYVl1WWa3CzHThzRZX1Ha+D1uWN+ap45Z4Km+x3pbW32 KtHzxriqanIr3BY6L0ON7+Vgl3gCv6EepcbTcK+0ArcKgASYKuYcxA8cJfrYjRWE u7+Ux63oNlhW78s7wGF7bW/hoSY+95wjSLPBBnDx6kJTNoYaKvJd6AdZERdg= X-Sasl-enc: rRPDW19BbktxvWNZkTIKvCOjeCjZeF4jxYUK/Gypz7Qw 1471729452 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 4A850CCE68; Sat, 20 Aug 2016 17:44:11 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: Date: Sat, 20 Aug 2016 22:44:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 21:44:14 -0000 On 20/08/16 22:17, Bruce Simpson wrote: > However, we still have to keep the FreeBSD-on-Ethernet ship sailing > smoothly. The intent of the original input path change is clearly for > performance, but perhaps slipping the M_BCAST tag in the stack is the > right way forward. > > I would also suggest: we add ability to qualify where in the stack > M_BCAST was raised (in case of any possible re-entry), by allocating one > more MBUF flag to Layer 2. > > Then, the same M_PROMISC flag trick can be applied... and Ryan's > broadcast performance boost could perhaps even carry across L2 bridging > tiers, e.g. stacked if_bridge or netgraph, providing we know what > direction in the stack it's traveling in (and its absolute ifnet origin) The main motivation for this: retain the original meaning of M_BCAST. (in addition to Ryan's intended new meaning that IP indicate to itself "This is IPv4 broadcast" and to others - it could be used to expedite delivery with some form of map). But, say, let's add a second flag which allows for controlled stacking of L2 in situations like this. Let's call it M_BCPROXY. It can be tracked for the original meaning, i.e. without the new meaning Ryan proposes for M_BCAST. When M_BCAST is set and M_BCPROXY is clear, we know the packet is broadcast, but we don't know for sure that this isn't because IP inspected it, and set the M_BCAST flag due to the destination IPv4 address being identified as such (and valid for its link, if you are enforcing the Strong IP End-Station model, RFC 1122 style, as is the BSD default). However, if we set M_BCPROXY at the same time, then, in situations where we might potentially re-enter the stack holding the same broadcast packet, we know that IP marked the packet as broadcast, and - on entry - can change our routing/switching/allocation/replication strategies accordingly. (This is not information which, on its own, holding the origin ifnet pointer provides; the flag is needed to sense direction in the stack.) So, as the mbuf chain is handed-off between other L2 entities (this can easily happen with stacked VLAN tags, in Q-in-Q and provider environments, which pfSense can service very well) - and, if the node itself determines that it is also a recipient of the broadcast, for correct hand-off if the broadcast does need to be forwarded by some other FreeBSD subsystem. It could also be checked by firewalls: e.g. for a corroborated check, from the mask of these two flags, where in the stack (or link forest) a purported broadcast packet actually originated from. (Pretty much essential for maintaining audit trail if a Smurf-like amplification attack is caught in the act, or if an NTP relay (or other association) terminates in an NTP broadcast association. And, of course, to trace dodgy broadcast Sun-style XDR RPC back to its source.) From owner-svn-src-all@freebsd.org Sat Aug 20 22:05:16 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BA87BC0325; Sat, 20 Aug 2016 22:05:16 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3AD7618B5; Sat, 20 Aug 2016 22:05:16 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1bbEO6-000Ah9-VS; Sun, 21 Aug 2016 01:05:10 +0300 Date: Sun, 21 Aug 2016 01:05:10 +0300 From: Slawa Olhovchenkov To: Bruce Simpson Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd Subject: Re: svn commit: r304436 - in head: . sys/netinet Message-ID: <20160820220510.GX8192@zxy.spb.ru> References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 22:05:16 -0000 On Sat, Aug 20, 2016 at 10:17:27PM +0100, Bruce Simpson wrote: > On 20/08/16 21:41, Slawa Olhovchenkov wrote: > > On Sat, Aug 20, 2016 at 09:34:06PM +0100, Bruce Simpson wrote: > >> So, Ryan -- your original reading of how in_broadcast() behaves is > >> correct, modulo the all-ones bypassing it. > > What purpose to analyse L2 header? > > I was just checking for possible edge cases for a substitution of the > in_broadcast() check with some other way of logically summarising the > real broadcast disposition of the interface in bits, given your mGRE > example below. I am think this substitution is very bad idea (by design). Also, on transmit side this is must be irrelevant on received L2 header (and this in many cases this is will be L2 unicast packet). For other cases packet will be created on host and don't have any received information. On received side for host relaing on L2 information for accepting packet as host targeting sound like security hole. In router case receiving broadcast packet in any way need additional check for dst IP address (host part is all zero or all one? what about handling this broadcast type (RFC talk about conroling variation of this)? what about sysctl control of receiving routed broadcast packets? what about handling 255.255.255.255?) In any way, this is irrelevant to L2 broadcast MAC and present L2 broadcast flags. > Like M_BCAST, but 'This packet is flagged as broadcast, but only by a > proxy method, not L2'. > > > Yes, curently FreeBSD don't support multiaccess media other then > > ethernet (i.e. ATM, FrameRelay), but in case of mGRE L2 header will be > > absent. > > Exactly! People forget that certain legitimate multipoint protocols > already exist as overlays already. It is easy when all we grow up with > is Ethernet. :-) Until we peek under the hood, we may not know. > > Slawa, you have hit the nail on the head. > > The situation can naturally arise anywhere we bridge L2/L3 in certain > directions, be that in VPN aggregation or PPPoE aggregation. > > In many ways I regret never being able to have executed work on a design > for ng_pppoa in 2005/6. But, given the pain people in the UK are having > with BT and VDSL modem provision right now... it comes as no surprise > that the next generation of DSL access, for us, can be as bad. > > For some, multipoint is less important now we have SR-IOV VFs and other > means of allocating discrete unicast Ethernet MACs and using them as > links, but... Multipoint is mandatory for DMVPN. > Roundabout the time I merged M_PROMISC from NetBSD to FreeBSD in 2006/7, > I considered that we should add an abstraction to ifnet to permit > multiple unicast (or special) MACs to be bound to existing ifnets, and > -- where the card permits it, expedite that MAC in some way. > > That capability was present on the (legacy) Adaptec Starfire quad 100TX > from that era. Today, it exists in e.g. Chelsio T4/5 TCAM filter, or > multiple perfect hashes on the previous generations of cards. (Currently > the FreeBSD stack does nothing about such.) > > I suspect it is less important now we have RSS for raw TCP throughput, > but, for those of us -- e.g. in internet service provider (ISP) type > environments, we have to keep a careful eye on how well FreeBSD plays > nice with other Ethernet equipment, with a view to these types of > potential optimizations in future. May be only as options, per NIC based? I.e. check for L3 broadcasy only when NIC flaged? w/o check L2 dst MAC for broadcasting, because this is excessively and don't give any speed up (in any case need check for L3 broadcast). > However, we still have to keep the FreeBSD-on-Ethernet ship sailing > smoothly. The intent of the original input path change is clearly for > performance, but perhaps slipping the M_BCAST tag in the stack is the > right way forward. > > I would also suggest: we add ability to qualify where in the stack > M_BCAST was raised (in case of any possible re-entry), by allocating one > more MBUF flag to Layer 2. > > Then, the same M_PROMISC flag trick can be applied... and Ryan's > broadcast performance boost could perhaps even carry across L2 bridging > tiers, e.g. stacked if_bridge or netgraph, providing we know what > direction in the stack it's traveling in (and its absolute ifnet origin). > Because L3 broadcast check need be in any case (and can be perform by hash lookup in same time as host ip check) L2 broadcaste check needless. From owner-svn-src-all@freebsd.org Sat Aug 20 22:09:10 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D77CBC0454 for ; Sat, 20 Aug 2016 22:09:10 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03DB01BAD for ; Sat, 20 Aug 2016 22:09:10 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x231.google.com with SMTP id q128so75015470wma.1 for ; Sat, 20 Aug 2016 15:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Y4jyUd7sSwdOJvBmI60MtCXBKqoq9lP9E/vzeTV56Js=; b=ef9ve9cmjL/H5UAsZyUm8cJLka4pVYU4LI9shtD5biV3W2fFNaOjggLy6QjZ6TJMlH DkUTp+e3XZDpVz4/JwOhmN69Qtb2MWZasC4Kl4bbBk9NoCMoZYOgeYsBK9ynVTQtE57B WyXDuOT66v3j8dKZ3xq7wSP5iM+i50jw1ywTJkEGJP/WSQvP7m63Xg6NpbDvaQxNyokg J+a2rEmcMwmC3fpn2Yid4JHqyPW/E475uFnfuC6QagxxiHsvLEzPkwhv1CYmKKUB6kzB oX8UeY8V8EHJuQCId0c2ytutBmd8kqWdMX2AYB9XwgYoHEaZW1Rx1JQO5A1Tt53FP6vB iKYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Y4jyUd7sSwdOJvBmI60MtCXBKqoq9lP9E/vzeTV56Js=; b=iowREW/8U0ZdGDDJpYn4yCQvnXgTfQWzE91znfXExX8cAgm8nXxYHf2lReCPxbMEK+ ewDYHKqGAvWrBXTxTdspjCmbGfIWKC3/iOK0CS3Z6kpeMLV4SyWSaKn/IV/+4tUblSPF viY2EJuLUPirNqeV95fw/FT+Dcrp72hS/rqH5qyHs+l2bHlGajcZfS/hM7Z8ZbGqqlrc Ih/SG5QXBRYmzVcEaJeAhyJfalgxn5uuq1KPF9bEDQ0YVLWCZ2q3AYi/0fKPiH5kou3n ccJwCdXIr/p/IHqcPRbLOnM1b1kgiEW+Q6mGOZ/yzGW+1iPkM4jji+5yUbFztoexVgqm FwCg== X-Gm-Message-State: AEkoouuvOQlv8kARQLf86bgQ1dzeWtWQ+i3m1CZuKG32niO6MjTV/9rmZYJL3VTjrldwDaHU9HX64WU1twKuFCvu X-Received: by 10.28.51.21 with SMTP id z21mr8881556wmz.24.1471730948336; Sat, 20 Aug 2016 15:09:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.221.7 with HTTP; Sat, 20 Aug 2016 15:09:07 -0700 (PDT) In-Reply-To: <201608201226.u7KCQiV6044715@repo.freebsd.org> References: <201608201226.u7KCQiV6044715@repo.freebsd.org> From: Oliver Pinter Date: Sun, 21 Aug 2016 00:09:07 +0200 Message-ID: Subject: Re: svn commit: r304527 - in stable/10/lib: libc/include libc/stdlib libc/tests/stdlib libthr/thread To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 22:09:10 -0000 On 8/20/16, Konstantin Belousov wrote: > Author: kib > Date: Sat Aug 20 12:26:44 2016 > New Revision: 304527 > URL: https://svnweb.freebsd.org/changeset/base/304527 > > Log: > MFC r303795: > Add __cxa_thread_atexit(3) API implementation. > > Added: > stable/10/lib/libc/stdlib/cxa_thread_atexit.c > - copied unchanged from r303795, > head/lib/libc/stdlib/cxa_thread_atexit.c > stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc > - copied unchanged from r303795, > head/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc > stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc > - copied unchanged from r303795, > head/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc > Modified: > stable/10/lib/libc/include/libc_private.h > stable/10/lib/libc/stdlib/Makefile.inc > stable/10/lib/libc/stdlib/Symbol.map > stable/10/lib/libc/stdlib/exit.c > stable/10/lib/libc/tests/stdlib/Makefile > stable/10/lib/libthr/thread/thr_exit.c > Directory Properties: > stable/10/ (props changed) > make[6]: "/jenkins/workspace/HardenedBSD-stable-10-STABLE-master-amd64/lib/libc/tests/stdlib/Makefile" line 3: Could not find src.opts.mk make[6]: "/jenkins/workspace/HardenedBSD-stable-10-STABLE-master-amd64/lib/libc/tests/stdlib/Makefile" line 8: Malformed conditional (${COMPILER_FEATURES:Mc++11}) From owner-svn-src-all@freebsd.org Sat Aug 20 22:12:28 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 094D3BC0603; Sat, 20 Aug 2016 22:12:28 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CDF021F07; Sat, 20 Aug 2016 22:12:27 +0000 (UTC) (envelope-from zec@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7KMCRWo065107; Sat, 20 Aug 2016 22:12:27 GMT (envelope-from zec@FreeBSD.org) Received: (from zec@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7KMCRQU065106; Sat, 20 Aug 2016 22:12:27 GMT (envelope-from zec@FreeBSD.org) Message-Id: <201608202212.u7KMCRQU065106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zec set sender to zec@FreeBSD.org using -f From: Marko Zec Date: Sat, 20 Aug 2016 22:12:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304548 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 22:12:28 -0000 Author: zec Date: Sat Aug 20 22:12:26 2016 New Revision: 304548 URL: https://svnweb.freebsd.org/changeset/base/304548 Log: Permit disabling net.inet.udp.require_l2_bcast in VIMAGE kernels. The default value of the tunable introduced in r304436 couldn't be effectively overrided on VIMAGE kernels, because instead of being accessed via the appropriate VNET() accessor macro, it was accessed via the VNET_NAME() macro, which resolves to the (should-be) read-only master template of initial values of per-VNET data. Hence, while the value of udp_require_l2_bcast could be altered on per-VNET basis, the code in udp_input() would ignore it as it would always read the default value (one) from the VNET master template. Silence from: rstone Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Sat Aug 20 21:34:41 2016 (r304547) +++ head/sys/netinet/udp_usrreq.c Sat Aug 20 22:12:26 2016 (r304548) @@ -127,6 +127,7 @@ SYSCTL_INT(_net_inet_udp, OID_AUTO, blac "Do not send port unreachables for refused connects"); static VNET_DEFINE(int, udp_require_l2_bcast) = 1; +#define V_udp_require_l2_bcast VNET(udp_require_l2_bcast) SYSCTL_INT(_net_inet_udp, OID_AUTO, require_l2_bcast, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(udp_require_l2_bcast), 0, "Only treat packets sent to an L2 broadcast address as broadcast packets"); @@ -528,7 +529,7 @@ udp_input(struct mbuf **mp, int *offp, i pcbinfo = udp_get_inpcbinfo(proto); if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) || - ((!VNET_NAME(udp_require_l2_bcast) || m->m_flags & M_BCAST) && + ((!V_udp_require_l2_bcast || m->m_flags & M_BCAST) && in_broadcast(ip->ip_dst, ifp))) { struct inpcb *last; struct inpcbhead *pcblist; From owner-svn-src-all@freebsd.org Sat Aug 20 22:18:36 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08C20BC0731 for ; Sat, 20 Aug 2016 22:18:36 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85616122C for ; Sat, 20 Aug 2016 22:18:35 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22d.google.com with SMTP id q128so75150322wma.1 for ; Sat, 20 Aug 2016 15:18:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9TBy0R6uVNMnNZF02fnuAKijWRUvRUAUNP4Kfl5H5f8=; b=n9qaDwH76i7mu2HVqcHSHs0YEqSxrIPwTwgAooHpgvs38b06JzGIN5mdbGzE+vEbKj 9UWmmyzE5UevMNkQnEGzoqsx68sq7v2pxIIuBz5L2/1J2k2HDqWWIDAK4kcU/ncokYTL /9VzlYUvzIaQkRG5z2hIP/cdtFchtDJniUHwHOIwzUOE9DCRY6r9hmiPiTasySQKPmA9 Vq62W5jRLp2dQbjgKCHQ12aY3iAvCKPfqvLfgsJIf2RhaaPBb0vQazr2HTD3oz9j+Ene qFIl9fnRhiT2lo9dT2lJcLIz5Ph5cpWBdLnS2Rr9qqc2a3qJLP08izlorV9HjDycK8h5 lPNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=9TBy0R6uVNMnNZF02fnuAKijWRUvRUAUNP4Kfl5H5f8=; b=TIKV1GgzAvwkhiXSJrPxuemV7Yd/YFsg9wTeki4WYMNBLF4mxDmCZ2jR+/MTjSyAY5 SAQG2AlTt6M95N1FYZSHHi7OKvX4/bD5AkfnfoY0AcycUy8SpnDnP8X/mqKtqPbbpb9p 4LCPPOr9IYrGErRI5QL2ryyR3oVPF3mDWyG8TRyqogKD6NUa+xc5arhwOg/Ni+GL+Sxx ccHczVU2iwiNXs0TejNaRabKpbXiPVN1yvov5STQZqHoKVfxAVVC4UB/v0xrvqPuFnZE Q4mBaD/izqeg2TYppQlW8Tkul7eKG8XaSFnRT3J9sp/P7DusKkwbUGr/JS9cY5FIrZEI oF4Q== X-Gm-Message-State: AEkoouvO0KnpezNCkvstUTCHLdLj4NI/TfK1UEEpKyPkE4wSCemlJQ9q32EEijoxpghubq/arUumuF7D4Tjl6r2X X-Received: by 10.28.197.143 with SMTP id v137mr9432450wmf.26.1471731514067; Sat, 20 Aug 2016 15:18:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.221.7 with HTTP; Sat, 20 Aug 2016 15:18:33 -0700 (PDT) In-Reply-To: References: <201608201226.u7KCQiV6044715@repo.freebsd.org> From: Oliver Pinter Date: Sun, 21 Aug 2016 00:18:33 +0200 Message-ID: Subject: Re: svn commit: r304527 - in stable/10/lib: libc/include libc/stdlib libc/tests/stdlib libthr/thread To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: multipart/mixed; boundary=94eb2c0d465a1a14ec053a8832fe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 22:18:36 -0000 --94eb2c0d465a1a14ec053a8832fe Content-Type: text/plain; charset=UTF-8 On 8/21/16, Oliver Pinter wrote: > On 8/20/16, Konstantin Belousov wrote: >> Author: kib >> Date: Sat Aug 20 12:26:44 2016 >> New Revision: 304527 >> URL: https://svnweb.freebsd.org/changeset/base/304527 >> >> Log: >> MFC r303795: >> Add __cxa_thread_atexit(3) API implementation. >> >> Added: >> stable/10/lib/libc/stdlib/cxa_thread_atexit.c >> - copied unchanged from r303795, >> head/lib/libc/stdlib/cxa_thread_atexit.c >> stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc >> - copied unchanged from r303795, >> head/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc >> stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc >> - copied unchanged from r303795, >> head/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc >> Modified: >> stable/10/lib/libc/include/libc_private.h >> stable/10/lib/libc/stdlib/Makefile.inc >> stable/10/lib/libc/stdlib/Symbol.map >> stable/10/lib/libc/stdlib/exit.c >> stable/10/lib/libc/tests/stdlib/Makefile >> stable/10/lib/libthr/thread/thr_exit.c >> Directory Properties: >> stable/10/ (props changed) >> > > > make[6]: > "/jenkins/workspace/HardenedBSD-stable-10-STABLE-master-amd64/lib/libc/tests/stdlib/Makefile" > line 3: Could not find src.opts.mk > make[6]: > "/jenkins/workspace/HardenedBSD-stable-10-STABLE-master-amd64/lib/libc/tests/stdlib/Makefile" > line 8: Malformed conditional (${COMPILER_FEATURES:Mc++11}) > --94eb2c0d465a1a14ec053a8832fe Content-Type: application/octet-stream; name="0001-HBSD-fix-build-error-after-kib-s-8ef9c6fc5bcfe1b6062.patch" Content-Disposition: attachment; filename="0001-HBSD-fix-build-error-after-kib-s-8ef9c6fc5bcfe1b6062.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 RnJvbSBmZjMyYzM3YmU5ODEyZmE2N2E4MThkOTNlZTMwMGMwNDNhZDY4MmM5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBPbGl2ZXIgUGludGVyIDxvbGl2ZXIucGludGVyQGhhcmRlbmVk YnNkLm9yZz4KRGF0ZTogU3VuLCAyMSBBdWcgMjAxNiAwMDoxMDo1OCArMDIwMApTdWJqZWN0OiBb UEFUQ0hdIEhCU0Q6IGZpeCBidWlsZCBlcnJvciBhZnRlciBraWIncwogOGVmOWM2ZmM1YmNmZTFi NjA2MjI5YThkYTAyNGY3NmIyZDUwNDhjMSBjb21taXQKCi0tODwtLQptYWtlWzZdOgoiL2plbmtp bnMvd29ya3NwYWNlL0hhcmRlbmVkQlNELXN0YWJsZS0xMC1TVEFCTEUtbWFzdGVyLWFtZDY0L2xp Yi9saWJjL3Rlc3RzL3N0ZGxpYi9NYWtlZmlsZSIKbGluZSAzOiBDb3VsZCBub3QgZmluZCBzcmMu b3B0cy5tawptYWtlWzZdOgoiL2plbmtpbnMvd29ya3NwYWNlL0hhcmRlbmVkQlNELXN0YWJsZS0x MC1TVEFCTEUtbWFzdGVyLWFtZDY0L2xpYi9saWJjL3Rlc3RzL3N0ZGxpYi9NYWtlZmlsZSIKbGlu ZSA4OiBNYWxmb3JtZWQgY29uZGl0aW9uYWwgKCR7Q09NUElMRVJfRkVBVFVSRVM6TWMrKzExfSkK LS04PC0tCgpTaWduZWQtb2ZmLWJ5OiBPbGl2ZXIgUGludGVyIDxvbGl2ZXIucGludGVyQGhhcmRl bmVkYnNkLm9yZz4KLS0tCiBsaWIvbGliYy90ZXN0cy9zdGRsaWIvTWFrZWZpbGUgfCAyICstCiAx IGZpbGUgY2hhbmdlZCwgMSBpbnNlcnRpb24oKyksIDEgZGVsZXRpb24oLSkKCmRpZmYgLS1naXQg YS9saWIvbGliYy90ZXN0cy9zdGRsaWIvTWFrZWZpbGUgYi9saWIvbGliYy90ZXN0cy9zdGRsaWIv TWFrZWZpbGUKaW5kZXggZGY1MDU3Mi4uYmJiOWI1OSAxMDA2NDQKLS0tIGEvbGliL2xpYmMvdGVz dHMvc3RkbGliL01ha2VmaWxlCisrKyBiL2xpYi9saWJjL3Rlc3RzL3N0ZGxpYi9NYWtlZmlsZQpA QCAtMSw2ICsxLDYgQEAKICMgJEZyZWVCU0QkCiAKLS5pbmNsdWRlIDxzcmMub3B0cy5taz4KKy5p bmNsdWRlIDxic2QuY29tcGlsZXIubWs+CiAKIEFURl9URVNUU19DKz0JCWhlYXBzb3J0X3Rlc3QK IEFURl9URVNUU19DKz0JCW1lcmdlc29ydF90ZXN0Ci0tIAoyLjkuMgoK --94eb2c0d465a1a14ec053a8832fe-- From owner-svn-src-all@freebsd.org Sat Aug 20 22:44:44 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9412BC0BF7 for ; Sat, 20 Aug 2016 22:44:44 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DB101C87 for ; Sat, 20 Aug 2016 22:44:44 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22a.google.com with SMTP id q128so75509644wma.1 for ; Sat, 20 Aug 2016 15:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ITzaz6fu8+jKc4QuiLfVv2L8ynaI3bPz5NrMgCLeJks=; b=NlreIFeYTbvxAaO3wLYzP5CMayUTmFHPCWmKo2S1hX9NsS/03yh2GidVK1qqRexZKo InWkKTWI6rjabM8XN+fuAhy0HL+PRbJLas62UmoKkrMdNZrRgXPwPu7PRPSgoFYkEqS/ YpB+ytG22c/3E8lLLL8P7OmYHeKGxkUpUCSN4yKL3IJ63e/IT3ZoB3Smt1qYpgzQ78QV idl15120Q8ysaTbpdZFc52OwokbraWQh9OFKxhDVsO3hUvgiAOA5RoUGuRIvx7hws8z2 M+LyKH/io8UP0nn72IwI2It+MXg6ihXLNIs0Kv2t08vVCSUYrEBN8PmE8LyrTVt7fVCN lGvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ITzaz6fu8+jKc4QuiLfVv2L8ynaI3bPz5NrMgCLeJks=; b=NhSctGsHndM/d0q1Kk9XAJEzr1OYNM/Ifdux3ZPWwDDXH9W72VjV2LFeVH+DKY+LdW ZeAuxL5h1uSvUm1KCT1VjQwESsO8DkOlEtvdXZiODNqwow+9m2eOI2PGBbnzbAD1K/mR hQ795FdN3Fr82lbeA8uXx0T1IAzBKenwaPLfmCLd/fLgx3rsEQfCkCVuT2QN1xDU+KHp dSsEsCay235rCzc9xgVryyQ7Q68AGT27xd0TGHQPfTM0E+PCu3misfKL8KKNLprzJwN9 tFkRv/Yo5L55Vb2Djg+ShUV8QpYsv+G7Buv6nvzZU7jwLrS3eI7M/ia2c45nh2uwzR9d kNVQ== X-Gm-Message-State: AEkoouvxPHWTBSAYIkefjHsUc7Aln4q1V9x5iv6rElnnVIi2xin0+J16MU/2DgXNwLS6WJF3ENX58MUdqvZLAfzF X-Received: by 10.28.51.21 with SMTP id z21mr8946964wmz.24.1471733082859; Sat, 20 Aug 2016 15:44:42 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.221.7 with HTTP; Sat, 20 Aug 2016 15:44:41 -0700 (PDT) In-Reply-To: References: <201608201226.u7KCQiV6044715@repo.freebsd.org> From: Oliver Pinter Date: Sun, 21 Aug 2016 00:44:41 +0200 Message-ID: Subject: Re: svn commit: r304527 - in stable/10/lib: libc/include libc/stdlib libc/tests/stdlib libthr/thread To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 22:44:45 -0000 On 8/21/16, Oliver Pinter wrote: > On 8/21/16, Oliver Pinter wrote: >> On 8/20/16, Konstantin Belousov wrote: >>> Author: kib >>> Date: Sat Aug 20 12:26:44 2016 >>> New Revision: 304527 >>> URL: https://svnweb.freebsd.org/changeset/base/304527 >>> >>> Log: >>> MFC r303795: >>> Add __cxa_thread_atexit(3) API implementation. >>> >>> Added: >>> stable/10/lib/libc/stdlib/cxa_thread_atexit.c >>> - copied unchanged from r303795, >>> head/lib/libc/stdlib/cxa_thread_atexit.c >>> stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc >>> - copied unchanged from r303795, >>> head/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc >>> stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc >>> - copied unchanged from r303795, >>> head/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc >>> Modified: >>> stable/10/lib/libc/include/libc_private.h >>> stable/10/lib/libc/stdlib/Makefile.inc >>> stable/10/lib/libc/stdlib/Symbol.map >>> stable/10/lib/libc/stdlib/exit.c >>> stable/10/lib/libc/tests/stdlib/Makefile >>> stable/10/lib/libthr/thread/thr_exit.c >>> Directory Properties: >>> stable/10/ (props changed) >>> >> >> >> make[6]: >> "/jenkins/workspace/HardenedBSD-stable-10-STABLE-master-amd64/lib/libc/tests/stdlib/Makefile" >> line 3: Could not find src.opts.mk >> make[6]: >> "/jenkins/workspace/HardenedBSD-stable-10-STABLE-master-amd64/lib/libc/tests/stdlib/Makefile" >> line 8: Malformed conditional (${COMPILER_FEATURES:Mc++11}) >> > And the next build error from the same MFC: 18:36:12 cxa_thread_atexit_test.o: In function `(anonymous namespace)::atfu_tc_cxx__thread_inf_dtors::body() const': 18:36:12 /jenkins/workspace/HardenedBSD-10-STABLE-amd64/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc:(.text+0x335): undefined reference to `pthread_create' 18:36:12 cxa_thread_atexit_test.o: In function `(anonymous namespace)::atfu_tc_cxx__thread_local_add_while_calling_dtors::body() const': 18:36:12 /jenkins/workspace/HardenedBSD-10-STABLE-amd64/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc:(.text+0x4b0): undefined reference to `pthread_create' 18:36:12 cxa_thread_atexit_test.o: In function `(anonymous namespace)::atfu_tc_cxx__thread_local_after::body() const': 18:36:12 /jenkins/workspace/HardenedBSD-10-STABLE-amd64/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc:(.text+0xa50): undefined reference to `pthread_create' 18:36:12 cxa_thread_atexit_test.o: In function `(anonymous namespace)::atfu_tc_cxx__thread_local_before::body() const': 18:36:12 /jenkins/workspace/HardenedBSD-10-STABLE-amd64/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc:(.text+0x102a): undefined reference to `pthread_create' 18:36:12 c++: error: linker command failed with exit code 1 (use -v to see invocation) 18:36:12 --- cxa_thread_atexit_test --- 18:36:12 *** [cxa_thread_atexit_test] Error code 1 From owner-svn-src-all@freebsd.org Sat Aug 20 23:02:47 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2AD24BC0197 for ; Sat, 20 Aug 2016 23:02:47 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A9BA5166A for ; Sat, 20 Aug 2016 23:02:46 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22d.google.com with SMTP id i5so90261144wmg.0 for ; Sat, 20 Aug 2016 16:02:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pfDjC3YIEt58CFtFE+yHbNpXFaaB7yX3lnWHkND/A2M=; b=NDhW0VyqmsiZPJ0BB+snnirMQOuVkAJQrUPIfrP/279Puo3ysRNr1glCFhobEngYtu ln3kvq5zm7aQlUDSyjXCRv3XYD5F2sodRplYd927ids4xiCkSgDfbnzB6vuoSBpWKeFy YL7TKzUq+qlLNtcg1SSUyaFLC4JIK8j7UOJkWrQK5KsrnCwoe71+uBdpsyjEfcqk8CyW GDAk0sB7lT7+ZoGojZ6/KyssISnnSEymnNMj58BT9RaA1i9p7/aCi9pRDpVx+teZaYIN bSTHopTkrhd0htr7WztrSAnK3Ddqcb7AeTukyzxpltw7iG98MH2Ko4lc3px5TSK70zXB wbRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pfDjC3YIEt58CFtFE+yHbNpXFaaB7yX3lnWHkND/A2M=; b=fghP9vwSxi78aynGPtjjOmNehEboloppGxiCe14cyWMT+M23+Qo0GZQVikNSCMI9NL oYAAeX1Nw6mJ+y+SeP5ZTA5cSyRy7o1HuIc17IqD0PJf99tG1mO9w9WZKAw1mSC5VR3N UODJRCYvTFxUffqLfOjQJ//R7V9cxNuPgAnFyuictaGJOcIguzIEu27o/9paMTA/3j8t hQEk/on7G37gsaBcqV2PnGe3bsxyt22hl2VjzDCEb4Dtv3ECLG9zQtlEEKRs/jpH9rZx wO+TnNRAi8rG1hT5YK5Z99qyd7PL7/X9l0Hz3oi9BLwNxitK0I4wTsC91lQm3IZmOJLO sNAQ== X-Gm-Message-State: AEkoouvFk6Fh2r0jkaj/OshjIYuCNZrt0mMsJtxkRysQB0I1ik7UrxzzjEDbkyCWXXqkBXil9DibwW2ZvUh8hpI/ X-Received: by 10.28.9.194 with SMTP id 185mr8787546wmj.37.1471734165086; Sat, 20 Aug 2016 16:02:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.221.7 with HTTP; Sat, 20 Aug 2016 16:02:44 -0700 (PDT) In-Reply-To: References: <201608201226.u7KCQiV6044715@repo.freebsd.org> From: Oliver Pinter Date: Sun, 21 Aug 2016 01:02:44 +0200 Message-ID: Subject: Re: svn commit: r304527 - in stable/10/lib: libc/include libc/stdlib libc/tests/stdlib libthr/thread To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: multipart/mixed; boundary=001a114424021d50e7053a88d0c0 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 23:02:47 -0000 --001a114424021d50e7053a88d0c0 Content-Type: text/plain; charset=UTF-8 And one more. On 8/21/16, Oliver Pinter wrote: > On 8/21/16, Oliver Pinter wrote: >> On 8/21/16, Oliver Pinter wrote: >>> On 8/20/16, Konstantin Belousov wrote: >>>> Author: kib >>>> Date: Sat Aug 20 12:26:44 2016 >>>> New Revision: 304527 >>>> URL: https://svnweb.freebsd.org/changeset/base/304527 >>>> >>>> Log: >>>> MFC r303795: >>>> Add __cxa_thread_atexit(3) API implementation. >>>> >>>> Added: >>>> stable/10/lib/libc/stdlib/cxa_thread_atexit.c >>>> - copied unchanged from r303795, >>>> head/lib/libc/stdlib/cxa_thread_atexit.c >>>> stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc >>>> - copied unchanged from r303795, >>>> head/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc >>>> stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc >>>> - copied unchanged from r303795, >>>> head/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc >>>> Modified: >>>> stable/10/lib/libc/include/libc_private.h >>>> stable/10/lib/libc/stdlib/Makefile.inc >>>> stable/10/lib/libc/stdlib/Symbol.map >>>> stable/10/lib/libc/stdlib/exit.c >>>> stable/10/lib/libc/tests/stdlib/Makefile >>>> stable/10/lib/libthr/thread/thr_exit.c >>>> Directory Properties: >>>> stable/10/ (props changed) >>>> >>> >>> >>> make[6]: >>> "/jenkins/workspace/HardenedBSD-stable-10-STABLE-master-amd64/lib/libc/tests/stdlib/Makefile" >>> line 3: Could not find src.opts.mk >>> make[6]: >>> "/jenkins/workspace/HardenedBSD-stable-10-STABLE-master-amd64/lib/libc/tests/stdlib/Makefile" >>> line 8: Malformed conditional (${COMPILER_FEATURES:Mc++11}) >>> >> > > And the next build error from the same MFC: > 18:36:12 cxa_thread_atexit_test.o: In function `(anonymous > namespace)::atfu_tc_cxx__thread_inf_dtors::body() const': > 18:36:12 > /jenkins/workspace/HardenedBSD-10-STABLE-amd64/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc:(.text+0x335): > undefined reference to `pthread_create' > 18:36:12 cxa_thread_atexit_test.o: In function `(anonymous > namespace)::atfu_tc_cxx__thread_local_add_while_calling_dtors::body() > const': > 18:36:12 > /jenkins/workspace/HardenedBSD-10-STABLE-amd64/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc:(.text+0x4b0): > undefined reference to `pthread_create' > 18:36:12 cxa_thread_atexit_test.o: In function `(anonymous > namespace)::atfu_tc_cxx__thread_local_after::body() const': > 18:36:12 > /jenkins/workspace/HardenedBSD-10-STABLE-amd64/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc:(.text+0xa50): > undefined reference to `pthread_create' > 18:36:12 cxa_thread_atexit_test.o: In function `(anonymous > namespace)::atfu_tc_cxx__thread_local_before::body() const': > 18:36:12 > /jenkins/workspace/HardenedBSD-10-STABLE-amd64/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc:(.text+0x102a): > undefined reference to `pthread_create' > 18:36:12 c++: error: linker command failed with exit code 1 (use -v to > see invocation) > 18:36:12 --- cxa_thread_atexit_test --- > 18:36:12 *** [cxa_thread_atexit_test] Error code 1 > --001a114424021d50e7053a88d0c0 Content-Type: application/octet-stream; name="0002-HBSD-fix-build-error-after-kib-s-8ef9c6fc5bcfe1b6062.patch" Content-Disposition: attachment; filename="0002-HBSD-fix-build-error-after-kib-s-8ef9c6fc5bcfe1b6062.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 RnJvbSBkOTA5YzhjZTUzNGJiZTRlNDE4NTlkYjkxOTI5ZDE1ZTc3NGVlYmE1IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBPbGl2ZXIgUGludGVyIDxvbGl2ZXIucGludGVyQGhhcmRlbmVk YnNkLm9yZz4KRGF0ZTogU3VuLCAyMSBBdWcgMjAxNiAwMTowMDowNyArMDIwMApTdWJqZWN0OiBb UEFUQ0hdIEhCU0Q6IGZpeCBidWlsZCBlcnJvciBhZnRlciBraWIncwogOGVmOWM2ZmM1YmNmZTFi NjA2MjI5YThkYTAyNGY3NmIyZDUwNDhjMSBjb21taXQgLSBwYXJ0IDIuCgotLTg8LS0KMTg6MzY6 MTIgY3hhX3RocmVhZF9hdGV4aXRfdGVzdC5vOiBJbiBmdW5jdGlvbiBgKGFub255bW91cyBuYW1l c3BhY2UpOjphdGZ1X3RjX2N4eF9fdGhyZWFkX2luZl9kdG9yczo6Ym9keSgpIGNvbnN0JzoKMTg6 MzY6MTIgL2plbmtpbnMvd29ya3NwYWNlL0hhcmRlbmVkQlNELTEwLVNUQUJMRS1hbWQ2NC9saWIv bGliYy90ZXN0cy9zdGRsaWIvY3hhX3RocmVhZF9hdGV4aXRfdGVzdC5jYzooLnRleHQrMHgzMzUp OiB1bmRlZmluZWQgcmVmZXJlbmNlIHRvIGBwdGhyZWFkX2NyZWF0ZScKMTg6MzY6MTIgY3hhX3Ro cmVhZF9hdGV4aXRfdGVzdC5vOiBJbiBmdW5jdGlvbiBgKGFub255bW91cyBuYW1lc3BhY2UpOjph dGZ1X3RjX2N4eF9fdGhyZWFkX2xvY2FsX2FkZF93aGlsZV9jYWxsaW5nX2R0b3JzOjpib2R5KCkg Y29uc3QnOgoxODozNjoxMiAvamVua2lucy93b3Jrc3BhY2UvSGFyZGVuZWRCU0QtMTAtU1RBQkxF LWFtZDY0L2xpYi9saWJjL3Rlc3RzL3N0ZGxpYi9jeGFfdGhyZWFkX2F0ZXhpdF90ZXN0LmNjOigu dGV4dCsweDRiMCk6IHVuZGVmaW5lZCByZWZlcmVuY2UgdG8gYHB0aHJlYWRfY3JlYXRlJwoxODoz NjoxMiBjeGFfdGhyZWFkX2F0ZXhpdF90ZXN0Lm86IEluIGZ1bmN0aW9uIGAoYW5vbnltb3VzIG5h bWVzcGFjZSk6OmF0ZnVfdGNfY3h4X190aHJlYWRfbG9jYWxfYWZ0ZXI6OmJvZHkoKSBjb25zdCc6 CjE4OjM2OjEyIC9qZW5raW5zL3dvcmtzcGFjZS9IYXJkZW5lZEJTRC0xMC1TVEFCTEUtYW1kNjQv bGliL2xpYmMvdGVzdHMvc3RkbGliL2N4YV90aHJlYWRfYXRleGl0X3Rlc3QuY2M6KC50ZXh0KzB4 YTUwKTogdW5kZWZpbmVkIHJlZmVyZW5jZSB0byBgcHRocmVhZF9jcmVhdGUnCjE4OjM2OjEyIGN4 YV90aHJlYWRfYXRleGl0X3Rlc3QubzogSW4gZnVuY3Rpb24gYChhbm9ueW1vdXMgbmFtZXNwYWNl KTo6YXRmdV90Y19jeHhfX3RocmVhZF9sb2NhbF9iZWZvcmU6OmJvZHkoKSBjb25zdCc6CjE4OjM2 OjEyIC9qZW5raW5zL3dvcmtzcGFjZS9IYXJkZW5lZEJTRC0xMC1TVEFCTEUtYW1kNjQvbGliL2xp YmMvdGVzdHMvc3RkbGliL2N4YV90aHJlYWRfYXRleGl0X3Rlc3QuY2M6KC50ZXh0KzB4MTAyYSk6 IHVuZGVmaW5lZCByZWZlcmVuY2UgdG8gYHB0aHJlYWRfY3JlYXRlJwoxODozNjoxMiBjKys6IGVy cm9yOiBsaW5rZXIgY29tbWFuZCBmYWlsZWQgd2l0aCBleGl0IGNvZGUgMSAodXNlIC12IHRvIHNl ZSBpbnZvY2F0aW9uKQoxODozNjoxMiAtLS0gY3hhX3RocmVhZF9hdGV4aXRfdGVzdCAtLS0KMTg6 MzY6MTIgKioqIFtjeGFfdGhyZWFkX2F0ZXhpdF90ZXN0XSBFcnJvciBjb2RlIDEKLS04PC0tCgpT aWduZWQtb2ZmLWJ5OiBPbGl2ZXIgUGludGVyIDxvbGl2ZXIucGludGVyQGhhcmRlbmVkYnNkLm9y Zz4KLS0tCiBsaWIvbGliYy90ZXN0cy9zdGRsaWIvTWFrZWZpbGUgfCAzICsrLQogMSBmaWxlIGNo YW5nZWQsIDIgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbigtKQoKZGlmZiAtLWdpdCBhL2xpYi9s aWJjL3Rlc3RzL3N0ZGxpYi9NYWtlZmlsZSBiL2xpYi9saWJjL3Rlc3RzL3N0ZGxpYi9NYWtlZmls ZQppbmRleCBiYmI5YjU5Li4wNTgzMDlmIDEwMDY0NAotLS0gYS9saWIvbGliYy90ZXN0cy9zdGRs aWIvTWFrZWZpbGUKKysrIGIvbGliL2xpYmMvdGVzdHMvc3RkbGliL01ha2VmaWxlCkBAIC00Myw3 ICs0Myw4IEBAIENGTEFHUys9CS1JJHsuQ1VSRElSfQogCiBDWFhGTEFHUy5jeGFfdGhyZWFkX2F0 ZXhpdF90ZXN0Kz0JLXN0ZD1jKysxMQogQ1hYRkxBR1MuY3hhX3RocmVhZF9hdGV4aXRfbm90aHJf dGVzdCs9CS1zdGQ9YysrMTEKLUxJQkFERC5jeGFfdGhyZWFkX2F0ZXhpdF90ZXN0Kz0JCXB0aHJl YWQKK0RQQURELmN4YV90aHJlYWRfYXRleGl0X25vdGhyX3Rlc3QrPSAke0xJQlBUSFJFQUR9CitM REFERC5jeGFfdGhyZWFkX2F0ZXhpdF9ub3Rocl90ZXN0Kz0gLWxwdGhyZWFkCiAKIC5mb3IgdCBp biBoX2dldG9wdCBoX2dldG9wdF9sb25nCiBDRkxBR1MuJHQrPQktSSR7TElCTkVUQlNEX1NSQ0RJ Un0gLUkke1NSQ1RPUH0vY29udHJpYi9uZXRic2QtdGVzdHMKLS0gCjIuOS4yCgo= --001a114424021d50e7053a88d0c0-- From owner-svn-src-all@freebsd.org Sat Aug 20 23:25:57 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7231CBC059B; Sat, 20 Aug 2016 23:25:57 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 430C31DAA; Sat, 20 Aug 2016 23:25:57 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 2D95720597; Sat, 20 Aug 2016 19:25:56 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 19:25:56 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=GhyA1fRNWhlqlLzVIAEtg6zuTFk=; b=ERoLN6 Otka4TQ0s7fi7aUC00ZBD4FT8ACKsVdKQEYYiRLutr5PRb65w+SNYvdlor4ckDaX Ofo0nyjKGQsu9ndjq1s8mHDNJ71Xmuywtc+48i4QPGnBnGzuQ69k6MTiUBoT3q4Q NbJZIUAlNQHqgjhY8+aVa/JPUViWQwWUx/20o= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=GhyA1fRNWhlqlLz VIAEtg6zuTFk=; b=Y+F+S10mUNaA5Odut60dwlFJ9OCYhhtSbGiYphE/gCE0zSA iGzALGJlTOpHSYQXyL4h7FT4FbCJ8zqIQJVtp5vtbGQAH/uOJyTDeiAyHw4L2DG5 ZvkVl8gzGp1Wr7qTZxwjp7mMRLOxOM5KAtsxF3855Mx58rD39pBnBnA9fcP4= X-Sasl-enc: J12LT999O2YQnjP2/ci8YMhrCX0TtWQ5TNHG9/6kLkDr 1471735555 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id F2234CCE7E; Sat, 20 Aug 2016 19:25:54 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> Date: Sun, 21 Aug 2016 00:25:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160820220510.GX8192@zxy.spb.ru> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 23:25:57 -0000 On 20/08/16 23:05, Slawa Olhovchenkov wrote: > I am think this substitution is very bad idea (by design). > Also, on transmit side this is must be irrelevant on received L2 > header (and this in many cases this is will be L2 unicast packet). For > other cases packet will be created on host and don't have any received > information. > Whilst I agree with your concerns about multipoint, I support the motivation behind Ryan's original change: optimize the common case. On the other hand, I'm suggesting a slight extension to it -- one which would probably require adoption across some L2-exposed subsystems, or anywhere which might reinterpret an M_BCAST from re-entrant encapsulation (i.e. I receive a UDP broadcast packet, but my VPN daemon then decides it needs to be NATted and forwarded somewhere else). Whilst I believe the scope for problems like this are limited (and perhaps to Netgraph permutations), I do believe they exist, and should be defensively coded for. And: If, the logic for this can be factored out into one additional bit, in a conditional branch (or small set of those) in terms of delta to the existing FreeBSD data plane path -- i.e. my suggestion; Then: we should be able to preserve correctness for multipoint configurations, without sacrificing performance. Or, a possible tie-breaker: ...we ensure that M_BCAST is cleared at all times before possible re-entry, and use a separate M_BCASTL3 bit. Let the ethernet protocols decide themselves if re-entered about M_BCAST based on DMAC. > On received side for host relaing on L2 information for accepting > packet as host targeting sound like security hole. > > In router case receiving broadcast packet in any way need additional > check for dst IP address (host part is all zero or all one? what about > handling this broadcast type (RFC talk about conroling variation of > this)? what about sysctl control of receiving routed broadcast > packets? what about handling 255.255.255.255?) I believe most of this is already special-cased in ip_fastfwd.c (which gnn@ of course has merged, as it's full of sensible FIB-like operators which most router forwarding planes adopt on *their* IP input paths up to the forwarding decision), assuming the Ethernet input path colours packets with the right flags. Although, no direct distinction between IPv4 directed or undirected broadcast is made, until that code (or a full rtalloc()) is hit. In the past, I have tried to "hack around" the issue on the output (send) side, by introducing IP_ONESBCAST from BSD/OS. The fundamental problem there is that the IPv4 socket APIs were never designed to deal with 'with link' as well as 'with destination' particularly well -- i.e. to direct traffic to a particular host, with correct L2 resolution, but over a specific choice of link (or even, class of link). So, for correct behaviour when handling packets like this, the XORP FEA and libfeaclient frameworks would attempt to fully-bind control sockets requiring broadcast input where possible (OLSR being one candidate, but there are also other protocols requiring them). > In any way, this is irrelevant to L2 broadcast MAC and present L2 > broadcast flags. On the contrary, I believe in teasing as much explanation about the Layer 2 Soup 'out there' and how in FreeBSD it is treated, as this lends much background to the original problem posed by Ryan's change, to those who may not be from a primarily networking-oriented background. From owner-svn-src-all@freebsd.org Sat Aug 20 23:31:59 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B3DDBC06EF; Sat, 20 Aug 2016 23:31:59 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA96F13A9; Sat, 20 Aug 2016 23:31:58 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 8EBF0205B0; Sat, 20 Aug 2016 19:31:57 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 19:31:57 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=iMpxhCqsV5FAagN/y0xbnI4kdqY=; b=Q0vVJe lERh0CZIOgtnXQt+rW0FEJZvitckzy7EYvdNz5iesv0B4Ki/ODKJ+nkrr/KQrGxD Faem6TPdcT0bYVOegJM7nNeC0PS1bkbDELEhV5mNhHRLAnxH3KrSmAFq5Eh/mxMr JqAJ8FingLMEu/m9EWxm05qDK3cRRRHCs5jTo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=iMpxhCqsV5FAagN /y0xbnI4kdqY=; b=t1gTXdx6lI3GjyG9j2ned8PktUVNYNGrKIR2wrz9h6WHpS5 FRRTeYQwKrxwww8E/WC8WykXaMsSQbFYQsctn3/iOd6STWkhIjYsUjK/8R8SbGvx JPSSBu7u6PVmRngHnOkoDT6eVauK/CEqrk1/9xhsYoPGdNfSGjT/dJNNORwQ= X-Sasl-enc: ydkpiFx6+H6ogYnBec9ba1o4yuR5jKcKCj4wprcXZfSw 1471735917 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 8903BCCDC7; Sat, 20 Aug 2016 19:31:56 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <6edd84f0-6bbc-d080-3763-fddb3df609fb@fastmail.net> Date: Sun, 21 Aug 2016 00:31:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 23:31:59 -0000 On 21/08/16 00:25, Bruce Simpson wrote: [Use a predicted branch in favour of Ethernet to optimize common case comments snipped] > ...we ensure that M_BCAST is cleared at all times before possible > re-entry, and use a separate M_BCASTL3 bit. Let the ethernet protocols > decide themselves if re-entered about M_BCAST based on DMAC. Better still, rename it to M_IPBCAST, because that is exactly what that flag would be. Treat it like M_PROMISC, hands off, use THAT test instead of M_BCAST in the code (but predictive branch the original in_broadcast() call), make sure M_BCAST is cleared before possible Netgraph handoff, but leave M_IPBCAST set. That way, anyone can tell IP set the M_BCAST bit - not Ethernet - just by XORing them together. I'd code this, but I don't have a -CURRENT box. :-( From owner-svn-src-all@freebsd.org Sat Aug 20 23:42:34 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 731C8BC09AC; Sat, 20 Aug 2016 23:42:34 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B4FB188C; Sat, 20 Aug 2016 23:42:33 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id B41812060F; Sat, 20 Aug 2016 19:42:32 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 19:42:32 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=WAl1E+q9SPAnri9ThpISU7pyAq0=; b=DNfhFr I4cbJgAofhUGEG2zytJZgwi7/EMH/FgM4yraV+UbHr4IFxhws1rwdHbs6/+0Ope9 gN+9csSFkyEQPNVVfHyovBvwiKkmbRYo2saMagOqNYm+lDJNj4w69mwm9JjOOIh4 iggXU6IOvkHXfYc5Ft7t8WA0JRp3/B6pzXKJk= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=WAl1E+q9SPAnri9 ThpISU7pyAq0=; b=Hl0XYto+5ddXxL+ijx78+KiWnNHsrlK/8+uMPXEj2Pp06vU FdUr577/FWfQXwDRg5+1TEylnbOEIv+b8ckAlf6UpJc5Cjg4YicrXb7KxP7os9AP HMg+W/eOtO8PgbE+GJrHH+5p4J3TWFb5NozXtVV3cQrGfvviUp3Dd4irtIPQ= X-Sasl-enc: H4QZNNI+5FvuL2/TX9NrZ/f+aYP/9ePmyBcUZuOE0jx9 1471736552 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 9F9D5CCE6E; Sat, 20 Aug 2016 19:42:31 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Slawa Olhovchenkov References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> Cc: Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , Adrian Chadd From: Bruce Simpson Message-ID: <1ebf4e2c-5fa1-29bc-0dc9-7ee2d7e2dc59@fastmail.net> Date: Sun, 21 Aug 2016 00:42:23 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 23:42:34 -0000 On 21/08/16 00:25, Bruce Simpson wrote: > On 20/08/16 23:05, Slawa Olhovchenkov wrote: >> In router case receiving broadcast packet in any way need additional >> check for dst IP address (host part is all zero or all one? what about >> handling this broadcast type (RFC talk about conroling variation of >> this)? what about sysctl control of receiving routed broadcast >> packets? what about handling 255.255.255.255?) > > I believe most of this is already special-cased in ip_fastfwd.c (which > gnn@ of course has merged, as it's full of sensible FIB-like operators > which most router forwarding planes adopt on *their* IP input paths up > to the forwarding decision), assuming the Ethernet input path colours > packets with the right flags. Just for reference, many of these 'sensible FIB operators' in the former ip_fastfwd.c came from the experience of James Jun at Towardex Systems. I merged his patch on the job whilst staying in Berkeley, CA and working on XORP at ICSI. I was only too happy to do that on their ticket, as it covered a lot of little performance cases which the pure rtalloc() fallthrough made us wince about. From owner-svn-src-all@freebsd.org Sat Aug 20 23:48:00 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6798FBC0C9D; Sat, 20 Aug 2016 23:48:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B1711D62; Sat, 20 Aug 2016 23:48:00 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x232.google.com with SMTP id e63so59571752ith.1; Sat, 20 Aug 2016 16:48:00 -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:from:date:message-id :subject:to:cc; bh=vIqMmC71rb5PEl2dX6XbSmk98cirMrgn6avwsGPS1ns=; b=xRmKHq5fbHyl0Ab3iLY/s9tjEwfpJyAgPOh0L6DVuO9ZyyPytd4KIvFZT8Bv0t5jnI 9Zym1UW8Bq+5VLZI1+IrDyUh7eB7GsZoTvSXKRO6rHma8YR2ylmOH78q7YJp5JmNxYS6 F9LdlzBjnZ4qB9vbxQu7jOSfvalExUL9q8DyPnjaj3CDSsZNLJVl/vkBWzG1mdqxreCG l5CDyFfo2PKmpCq4ik70hMwSef1Rwfj+GXM1/Y7LrwOYvWjlclFYyxoQ0OSiMe/Oa/Iv p91QspmYvpSV083tvjXBmjbYCQIYhKuzusXBcZwxBU4E60u15pCz148q1fwajSLiYuJE k+ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=vIqMmC71rb5PEl2dX6XbSmk98cirMrgn6avwsGPS1ns=; b=PUW4YKQBjtNRN8gvDHWW9ogmRsLlhZevo/sbFt9rGtCWKCDXLHSEX7TXmO75WPZq6g bIJld3rkIeZQJHBtTMawT7iesV+RuNCDaTwhJ7ab/0mjEBcVAhQ8JlTyTRDrD3UVWRpD /Cum1BbzVfpWW7OV59qEs67toKWzkgaDb+I9vYxpnyDkBnXOg2Z/1yUV20CLeWqGMWWr 5z99H0Agcv6uPmZ/GvzYG/xDAPRUOEiAwJJx+/k+ryqpD9A2Bm+MPliEy7Bx72PK2fvX qKJKfUKY1ajwT/A+YLc13C4tN+9JjG3WgWvcyFdxhbXDbywiRPDKG+CIlZ/OJ+34rK2x vwLA== X-Gm-Message-State: AEkoouvjaD4jXZJ5Metr0VD88mfwQji28ggd1b+dQH/FgIDTxg6pnPKjAu9rtWy2tCVl9pOvbi30Waf9vA+0Qw== X-Received: by 10.36.150.70 with SMTP id z67mr12692987itd.80.1471736879570; Sat, 20 Aug 2016 16:47:59 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.141.129 with HTTP; Sat, 20 Aug 2016 16:47:58 -0700 (PDT) In-Reply-To: <1ebf4e2c-5fa1-29bc-0dc9-7ee2d7e2dc59@fastmail.net> References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> <1ebf4e2c-5fa1-29bc-0dc9-7ee2d7e2dc59@fastmail.net> From: Adrian Chadd Date: Sat, 20 Aug 2016 16:47:58 -0700 X-Google-Sender-Auth: B90BxaiDiEGvtDtLM8ivNQBo3Rg Message-ID: Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Bruce Simpson Cc: Slawa Olhovchenkov , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 23:48:00 -0000 [snip] Just for everyone else on the list, would you mind distilling the original versus now-from-ryan meaning of M_BCAST and M_MCAST ? And how they're supposed to be used? thanks, -adrian From owner-svn-src-all@freebsd.org Sat Aug 20 23:49:31 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BF9FBC0D3F; Sat, 20 Aug 2016 23:49:31 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A7C01EDF; Sat, 20 Aug 2016 23:49:30 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 819C5205B9; Sat, 20 Aug 2016 19:49:29 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute2.internal (MEProxy); Sat, 20 Aug 2016 19:49:29 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=rNEMRENFJErC9f2QgECBldjwE2A=; b=alUOsR oOYvkQFZ3WKIZ9Zn/sg6BHH5Mr5n4dZQMSnC58R4mvSuG3BtIkPTDOGD89Pw3t1U 6cL+YhrBMjYkB3LXrfxhtvGzrM5HtcZtW7KRPUnshnTxzY+NXC8MWZ+xOHOCwzVZ 2WkdZZj3FZwW8rfkiqEE8gziIt0p09ddO2pM4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=rNEMRENFJErC9f2 QgECBldjwE2A=; b=kz7GSKsPrU9DovyPZIDeMiAQuyLzwRA6zZKcu8Ej+Pvu0hl MN8shf078UIdPegrPsutryNUJfklfbElEN74nfJdnkXzJrK/pGr+rv7BDqxZLOQh wZsate0TKO3NPYiKEZIk36GQAGmFjMktvSwltioQ6OINTiUwjNui1BR5UDDk= X-Sasl-enc: cQfRtxCGqyMIdqJmZDqtGZdegluw48hhtJiIc1qSv+9I 1471736969 Received: from pion.local (cpc96954-walt26-2-0-cust843.13-2.cable.virginm.net [82.31.91.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 5DC68CCDB8; Sat, 20 Aug 2016 19:49:28 -0400 (EDT) Subject: Re: svn commit: r304436 - in head: . sys/netinet To: Adrian Chadd References: <6f4449f2-d145-8b49-c3f0-433e8ff4d2a2@fastmail.net> <20160820173050.GQ22212@zxy.spb.ru> <20160820184506.GV8192@zxy.spb.ru> <0f42c5fb-f930-c6e3-75d6-df97f67c201d@fastmail.net> <20160820204106.GW8192@zxy.spb.ru> <0acba141-4701-d9c2-0ddb-46d1f60ff55b@fastmail.net> <20160820220510.GX8192@zxy.spb.ru> <8ac23bd1-dcb3-7c64-f195-5039f9af0eaf@fastmail.net> <1ebf4e2c-5fa1-29bc-0dc9-7ee2d7e2dc59@fastmail.net> Cc: Slawa Olhovchenkov , Ryan Stone , "svn-src-head@freebsd.org" , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" From: Bruce Simpson Message-ID: <483c533b-cb83-5234-0e99-61bbdadc9fea@fastmail.net> Date: Sun, 21 Aug 2016 00:49:20 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 23:49:31 -0000 On 21/08/16 00:47, Adrian Chadd wrote: > [snip] > > Just for everyone else on the list, would you mind distilling the > original versus now-from-ryan meaning of M_BCAST and M_MCAST ? And how > they're supposed to be used? (With my best Liam Neeson 'Dad' voice from Fallout 3) They stay as-is, but IP is allowed to slip the tag. But it has to slip another tag in there, to say it slipped the tag. The rest is M_PROTOFLAG style hand-off hygeine, along the mbuf pipeline. From owner-svn-src-all@freebsd.org Sat Aug 20 23:50:18 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8496BC0DD1 for ; Sat, 20 Aug 2016 23:50:18 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x236.google.com (mail-wm0-x236.google.com [IPv6:2a00:1450:400c:c09::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4300E11D0 for ; Sat, 20 Aug 2016 23:50:18 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x236.google.com with SMTP id i5so90976284wmg.0 for ; Sat, 20 Aug 2016 16:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=qGieJGSaA7i0y07hGw0OYkfCppNpMghaN5+rUQTO+9Y=; b=1cQbEBmDPDIvhdPPykYLC8YD3ZtDnRXNMOpRGobau7BTMmMao8T4MdI9Dda967EXPR yYmjFTELCD8M0frUd7HM+jjGkoMPHpb+Hf6ssRsO1yjLANIrG3DLG9w+rPkw3kt0CQup pPw4uP4sJBYgjf5LbH+PX9OjOtQJVhMxqzRBisD669NDce1XCsUyPZWgifyqlu2pt+aK YzVDQuRGBDTmSqU0h2ht1D46wIFCG3H9jt3SRn0SHTuX3gQrIhZB5xI74EHVs1T5Sbym wvnUfiUbFoyjGMa+drDY6K48iusLnhcoUGy/xp+RPUGGTN6mgZ5MNV9OuAWXSmSX8Hiu FqVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=qGieJGSaA7i0y07hGw0OYkfCppNpMghaN5+rUQTO+9Y=; b=fd93XSeFE2ffwhH9vkDc6+641XLIvP8c9xtVBPY8vri+Rig0xl7YnD4TbcB9IgHxmA E2HA9ZcGnXTurG2c8Hn0JMlctmgoUmRw7ENLThQ1YCQ6h6TsxFPnQ2Dba9Rb1ehj8WFd glM6GpV/TcmaDo7mxuDG0ORePs9hZHUHo9CMMa62FzGsw41Olg63Y0OSkUxeFhONflDM ATpuqn5mqhdCpiFMkIuPUpX3hHQsUKhqOCDhOebfSjmIaaG69qGVQflJ458kVG4H4jrG T+MMeQzEaC3HRJres39+4xFx/HcYekVmNZH10M33yx9QDbAdNH92EakHZZ6hTRZ8NcpO PdJA== X-Gm-Message-State: AEkoouuwmK2J3NVbSenh23laefSjj9lneM/gzuCvMcZ0/pVO9DVxJ6gUyl3nIk00bYkrvI9QA+XQ1DNHLiEt9SCv X-Received: by 10.194.27.202 with SMTP id v10mr11084085wjg.140.1471737015827; Sat, 20 Aug 2016 16:50:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.221.7 with HTTP; Sat, 20 Aug 2016 16:50:15 -0700 (PDT) In-Reply-To: References: <201608201226.u7KCQiV6044715@repo.freebsd.org> From: Oliver Pinter Date: Sun, 21 Aug 2016 01:50:15 +0200 Message-ID: Subject: Re: svn commit: r304527 - in stable/10/lib: libc/include libc/stdlib libc/tests/stdlib libthr/thread To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Content-Type: multipart/mixed; boundary=047d7b670a7b08409f053a897aec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages 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, 20 Aug 2016 23:50:18 -0000 --047d7b670a7b08409f053a897aec Content-Type: text/plain; charset=UTF-8 And an updated version of the fix. On 8/21/16, Oliver Pinter wrote: > And one more. > > On 8/21/16, Oliver Pinter wrote: >> On 8/21/16, Oliver Pinter wrote: >>> On 8/21/16, Oliver Pinter wrote: >>>> On 8/20/16, Konstantin Belousov wrote: >>>>> Author: kib >>>>> Date: Sat Aug 20 12:26:44 2016 >>>>> New Revision: 304527 >>>>> URL: https://svnweb.freebsd.org/changeset/base/304527 >>>>> >>>>> Log: >>>>> MFC r303795: >>>>> Add __cxa_thread_atexit(3) API implementation. >>>>> >>>>> Added: >>>>> stable/10/lib/libc/stdlib/cxa_thread_atexit.c >>>>> - copied unchanged from r303795, >>>>> head/lib/libc/stdlib/cxa_thread_atexit.c >>>>> stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc >>>>> - copied unchanged from r303795, >>>>> head/lib/libc/tests/stdlib/cxa_thread_atexit_nothr_test.cc >>>>> stable/10/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc >>>>> - copied unchanged from r303795, >>>>> head/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc >>>>> Modified: >>>>> stable/10/lib/libc/include/libc_private.h >>>>> stable/10/lib/libc/stdlib/Makefile.inc >>>>> stable/10/lib/libc/stdlib/Symbol.map >>>>> stable/10/lib/libc/stdlib/exit.c >>>>> stable/10/lib/libc/tests/stdlib/Makefile >>>>> stable/10/lib/libthr/thread/thr_exit.c >>>>> Directory Properties: >>>>> stable/10/ (props changed) >>>>> >>>> >>>> >>>> make[6]: >>>> "/jenkins/workspace/HardenedBSD-stable-10-STABLE-master-amd64/lib/libc/tests/stdlib/Makefile" >>>> line 3: Could not find src.opts.mk >>>> make[6]: >>>> "/jenkins/workspace/HardenedBSD-stable-10-STABLE-master-amd64/lib/libc/tests/stdlib/Makefile" >>>> line 8: Malformed conditional (${COMPILER_FEATURES:Mc++11}) >>>> >>> >> >> And the next build error from the same MFC: >> 18:36:12 cxa_thread_atexit_test.o: In function `(anonymous >> namespace)::atfu_tc_cxx__thread_inf_dtors::body() const': >> 18:36:12 >> /jenkins/workspace/HardenedBSD-10-STABLE-amd64/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc:(.text+0x335): >> undefined reference to `pthread_create' >> 18:36:12 cxa_thread_atexit_test.o: In function `(anonymous >> namespace)::atfu_tc_cxx__thread_local_add_while_calling_dtors::body() >> const': >> 18:36:12 >> /jenkins/workspace/HardenedBSD-10-STABLE-amd64/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc:(.text+0x4b0): >> undefined reference to `pthread_create' >> 18:36:12 cxa_thread_atexit_test.o: In function `(anonymous >> namespace)::atfu_tc_cxx__thread_local_after::body() const': >> 18:36:12 >> /jenkins/workspace/HardenedBSD-10-STABLE-amd64/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc:(.text+0xa50): >> undefined reference to `pthread_create' >> 18:36:12 cxa_thread_atexit_test.o: In function `(anonymous >> namespace)::atfu_tc_cxx__thread_local_before::body() const': >> 18:36:12 >> /jenkins/workspace/HardenedBSD-10-STABLE-amd64/lib/libc/tests/stdlib/cxa_thread_atexit_test.cc:(.text+0x102a): >> undefined reference to `pthread_create' >> 18:36:12 c++: error: linker command failed with exit code 1 (use -v to >> see invocation) >> 18:36:12 --- cxa_thread_atexit_test --- >> 18:36:12 *** [cxa_thread_atexit_test] Error code 1 >> > --047d7b670a7b08409f053a897aec Content-Type: application/octet-stream; name="0002-HBSD-fix-build-error-after-kib-s-8ef9c6fc5bcfe1b6062.patch" Content-Disposition: attachment; filename="0002-HBSD-fix-build-error-after-kib-s-8ef9c6fc5bcfe1b6062.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 RnJvbSA5YzJkNTI1YmYxZmY2MjQwODIyYTE0OTlmZjgyMzNjZDc2YmIyZDEwIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBPbGl2ZXIgUGludGVyIDxvbGl2ZXIucGludGVyQGhhcmRlbmVk YnNkLm9yZz4KRGF0ZTogU3VuLCAyMSBBdWcgMjAxNiAwMTowMDowNyArMDIwMApTdWJqZWN0OiBb UEFUQ0hdIEhCU0Q6IGZpeCBidWlsZCBlcnJvciBhZnRlciBraWIncwogOGVmOWM2ZmM1YmNmZTFi NjA2MjI5YThkYTAyNGY3NmIyZDUwNDhjMSBjb21taXQgLSBwYXJ0IDIuCgotLTg8LS0KMTg6MzY6 MTIgY3hhX3RocmVhZF9hdGV4aXRfdGVzdC5vOiBJbiBmdW5jdGlvbiBgKGFub255bW91cyBuYW1l c3BhY2UpOjphdGZ1X3RjX2N4eF9fdGhyZWFkX2luZl9kdG9yczo6Ym9keSgpIGNvbnN0JzoKMTg6 MzY6MTIgL2plbmtpbnMvd29ya3NwYWNlL0hhcmRlbmVkQlNELTEwLVNUQUJMRS1hbWQ2NC9saWIv bGliYy90ZXN0cy9zdGRsaWIvY3hhX3RocmVhZF9hdGV4aXRfdGVzdC5jYzooLnRleHQrMHgzMzUp OiB1bmRlZmluZWQgcmVmZXJlbmNlIHRvIGBwdGhyZWFkX2NyZWF0ZScKMTg6MzY6MTIgY3hhX3Ro cmVhZF9hdGV4aXRfdGVzdC5vOiBJbiBmdW5jdGlvbiBgKGFub255bW91cyBuYW1lc3BhY2UpOjph dGZ1X3RjX2N4eF9fdGhyZWFkX2xvY2FsX2FkZF93aGlsZV9jYWxsaW5nX2R0b3JzOjpib2R5KCkg Y29uc3QnOgoxODozNjoxMiAvamVua2lucy93b3Jrc3BhY2UvSGFyZGVuZWRCU0QtMTAtU1RBQkxF LWFtZDY0L2xpYi9saWJjL3Rlc3RzL3N0ZGxpYi9jeGFfdGhyZWFkX2F0ZXhpdF90ZXN0LmNjOigu dGV4dCsweDRiMCk6IHVuZGVmaW5lZCByZWZlcmVuY2UgdG8gYHB0aHJlYWRfY3JlYXRlJwoxODoz NjoxMiBjeGFfdGhyZWFkX2F0ZXhpdF90ZXN0Lm86IEluIGZ1bmN0aW9uIGAoYW5vbnltb3VzIG5h bWVzcGFjZSk6OmF0ZnVfdGNfY3h4X190aHJlYWRfbG9jYWxfYWZ0ZXI6OmJvZHkoKSBjb25zdCc6 CjE4OjM2OjEyIC9qZW5raW5zL3dvcmtzcGFjZS9IYXJkZW5lZEJTRC0xMC1TVEFCTEUtYW1kNjQv bGliL2xpYmMvdGVzdHMvc3RkbGliL2N4YV90aHJlYWRfYXRleGl0X3Rlc3QuY2M6KC50ZXh0KzB4 YTUwKTogdW5kZWZpbmVkIHJlZmVyZW5jZSB0byBgcHRocmVhZF9jcmVhdGUnCjE4OjM2OjEyIGN4 YV90aHJlYWRfYXRleGl0X3Rlc3QubzogSW4gZnVuY3Rpb24gYChhbm9ueW1vdXMgbmFtZXNwYWNl KTo6YXRmdV90Y19jeHhfX3RocmVhZF9sb2NhbF9iZWZvcmU6OmJvZHkoKSBjb25zdCc6CjE4OjM2 OjEyIC9qZW5raW5zL3dvcmtzcGFjZS9IYXJkZW5lZEJTRC0xMC1TVEFCTEUtYW1kNjQvbGliL2xp YmMvdGVzdHMvc3RkbGliL2N4YV90aHJlYWRfYXRleGl0X3Rlc3QuY2M6KC50ZXh0KzB4MTAyYSk6 IHVuZGVmaW5lZCByZWZlcmVuY2UgdG8gYHB0aHJlYWRfY3JlYXRlJwoxODozNjoxMiBjKys6IGVy cm9yOiBsaW5rZXIgY29tbWFuZCBmYWlsZWQgd2l0aCBleGl0IGNvZGUgMSAodXNlIC12IHRvIHNl ZSBpbnZvY2F0aW9uKQoxODozNjoxMiAtLS0gY3hhX3RocmVhZF9hdGV4aXRfdGVzdCAtLS0KMTg6 MzY6MTIgKioqIFtjeGFfdGhyZWFkX2F0ZXhpdF90ZXN0XSBFcnJvciBjb2RlIDEKLS04PC0tCgpT aWduZWQtb2ZmLWJ5OiBPbGl2ZXIgUGludGVyIDxvbGl2ZXIucGludGVyQGhhcmRlbmVkYnNkLm9y Zz4KLS0tCiBsaWIvbGliYy90ZXN0cy9zdGRsaWIvTWFrZWZpbGUgfCAzICsrLQogMSBmaWxlIGNo YW5nZWQsIDIgaW5zZXJ0aW9ucygrKSwgMSBkZWxldGlvbigtKQoKZGlmZiAtLWdpdCBhL2xpYi9s aWJjL3Rlc3RzL3N0ZGxpYi9NYWtlZmlsZSBiL2xpYi9saWJjL3Rlc3RzL3N0ZGxpYi9NYWtlZmls ZQppbmRleCBiYmI5YjU5Li4yYzNjOTBkIDEwMDY0NAotLS0gYS9saWIvbGliYy90ZXN0cy9zdGRs aWIvTWFrZWZpbGUKKysrIGIvbGliL2xpYmMvdGVzdHMvc3RkbGliL01ha2VmaWxlCkBAIC00Myw3 ICs0Myw4IEBAIENGTEFHUys9CS1JJHsuQ1VSRElSfQogCiBDWFhGTEFHUy5jeGFfdGhyZWFkX2F0 ZXhpdF90ZXN0Kz0JLXN0ZD1jKysxMQogQ1hYRkxBR1MuY3hhX3RocmVhZF9hdGV4aXRfbm90aHJf dGVzdCs9CS1zdGQ9YysrMTEKLUxJQkFERC5jeGFfdGhyZWFkX2F0ZXhpdF90ZXN0Kz0JCXB0aHJl YWQKK0RQQURELmN4YV90aHJlYWRfYXRleGl0X3Rlc3QrPSAke0xJQlBUSFJFQUR9CitMREFERC5j eGFfdGhyZWFkX2F0ZXhpdF90ZXN0Kz0gLWxwdGhyZWFkCiAKIC5mb3IgdCBpbiBoX2dldG9wdCBo X2dldG9wdF9sb25nCiBDRkxBR1MuJHQrPQktSSR7TElCTkVUQlNEX1NSQ0RJUn0gLUkke1NSQ1RP UH0vY29udHJpYi9uZXRic2QtdGVzdHMKLS0gCjIuOS4yCgo= --047d7b670a7b08409f053a897aec--