svn commit: r294991 - in head/sys: arm64/cavium conf
Author: zbb Date: Thu Jan 28 15:34:13 2016 New Revision: 294991 URL: https://svnweb.freebsd.org/changeset/base/294991 Log: Divide ThunderX PCIe driver to general and FDT part - Separate FDT and general PCIe driver parts - Drop some irrelevant printfs that cannot be displayed in FDT attach - Move ranges parsing to FDT portion of PCIe code Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5067 Added: head/sys/arm64/cavium/thunder_pcie_fdt.c (contents, props changed) Modified: head/sys/arm64/cavium/thunder_pcie.c head/sys/arm64/cavium/thunder_pcie_common.c head/sys/arm64/cavium/thunder_pcie_common.h head/sys/conf/files.arm64 Modified: head/sys/arm64/cavium/thunder_pcie.c == --- head/sys/arm64/cavium/thunder_pcie.cThu Jan 28 15:30:58 2016 (r294990) +++ head/sys/arm64/cavium/thunder_pcie.cThu Jan 28 15:34:13 2016 (r294991) @@ -43,9 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include #include #include #include @@ -82,23 +79,6 @@ __FBSDID("$FreeBSD$"); #defineTHUNDER_ECAM6_CFG_BASE 0x94a0UL #defineTHUNDER_ECAM7_CFG_BASE 0x94b0UL -#defineOFW_CELL_TO_UINT64(cell)\ -(((uint64_t)(*(cell)) << 32) | (uint64_t)(*((cell) + 1))) - -#defineSPACE_CODE_SHIFT24 -#defineSPACE_CODE_MASK 0x3 -#defineSPACE_CODE_IO_SPACE 0x1 -#definePROPS_CELL_SIZE 1 -#definePCI_ADDR_CELL_SIZE 2 - -struct thunder_pcie_softc { - struct pcie_range ranges[RANGES_TUPLES_MAX]; - struct rman mem_rman; - struct resource *res; - int ecam; - device_tdev; -}; - /* * ThunderX supports up to 4 ethernet interfaces, so it's good * value to use as default for numbers of VFs, since each eth @@ -111,11 +91,8 @@ SYSCTL_INT(_hw, OID_AUTO, thunder_pcie_m /* Forward prototypes */ static struct resource *thunder_pcie_alloc_resource(device_t, device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); -static int thunder_pcie_attach(device_t); static int thunder_pcie_identify_pcib(device_t); static int thunder_pcie_maxslots(device_t); -static int parse_pci_mem_ranges(struct thunder_pcie_softc *); -static int thunder_pcie_probe(device_t); static uint32_t thunder_pcie_read_config(device_t, u_int, u_int, u_int, u_int, int); static int thunder_pcie_read_ivar(device_t, device_t, int, uintptr_t *); @@ -125,23 +102,7 @@ static void thunder_pcie_write_config(de u_int, u_int, uint32_t, int); static int thunder_pcie_write_ivar(device_t, device_t, int, uintptr_t); -static int -thunder_pcie_probe(device_t dev) -{ - - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (ofw_bus_is_compatible(dev, "cavium,thunder-pcie") || - ofw_bus_is_compatible(dev, "cavium,pci-host-thunder-ecam")) { - device_set_desc(dev, "Cavium Integrated PCI/PCI-E Controller"); - return (BUS_PROBE_DEFAULT); - } - - return (ENXIO); -} - -static int +int thunder_pcie_attach(device_t dev) { int rid; @@ -167,13 +128,6 @@ thunder_pcie_attach(device_t dev) sc->mem_rman.rm_type = RMAN_ARRAY; sc->mem_rman.rm_descr = "PCIe Memory"; - /* Retrieve 'ranges' property from FDT */ - if (bootverbose) - device_printf(dev, "parsing FDT for ECAM%d:\n", - sc->ecam); - if (parse_pci_mem_ranges(sc)) - return (ENXIO); - /* Initialize rman and allocate memory regions */ error = rman_init(>mem_rman); if (error) { @@ -199,115 +153,6 @@ thunder_pcie_attach(device_t dev) return (bus_generic_attach(dev)); } -static int -parse_pci_mem_ranges(struct thunder_pcie_softc *sc) -{ - phandle_t node; - pcell_t pci_addr_cells, parent_addr_cells, size_cells; - pcell_t attributes; - pcell_t *ranges_buf, *cell_ptr; - int cells_count, tuples_count; - int tuple; - int rv; - - node = ofw_bus_get_node(sc->dev); - - /* Find address cells if present */ - if (OF_getencprop(node, "#address-cells", _addr_cells, - sizeof(pci_addr_cells)) < sizeof(pci_addr_cells)) - pci_addr_cells = 2; - - /* Find size cells if present */ - if (OF_getencprop(node, "#size-cells", _cells, - sizeof(size_cells)) < sizeof(size_cells)) - size_cells = 1; - - /* Find parent address cells if present */ - if (OF_getencprop(OF_parent(node), "#address-cells", - _addr_cells, sizeof(parent_addr_cells)) < sizeof(parent_addr_cells)) - parent_addr_cells = 2; - - /* Check if FDT format matches driver requirements */ - if
svn commit: r294994 - in head/sys: conf dev/vnic
Author: zbb Date: Thu Jan 28 15:44:14 2016 New Revision: 294994 URL: https://svnweb.freebsd.org/changeset/base/294994 Log: Support new MDIO hierarchy in ThunderX DTB Some firmware revisions provide different DTB tree that include odd MDIO placement in the tree. This commit adds support for 2 new buses: - MRML bridge (PCIB subordinate) - MDIO nexus (MRML subordinate) This allows for the correct MDIO attachment with both - new and old firmware. Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5070 Added: head/sys/dev/vnic/mrml_bridge.c (contents, props changed) Modified: head/sys/conf/files.arm64 head/sys/dev/vnic/thunder_mdio_fdt.c head/sys/dev/vnic/thunder_mdio_var.h Modified: head/sys/conf/files.arm64 == --- head/sys/conf/files.arm64 Thu Jan 28 15:40:56 2016(r294993) +++ head/sys/conf/files.arm64 Thu Jan 28 15:44:14 2016(r294994) @@ -71,6 +71,7 @@ dev/psci/psci_arm64.S optionalpsci dev/uart/uart_cpu_fdt.coptionaluart fdt dev/uart/uart_dev_pl011.c optionaluart pl011 dev/usb/controller/dwc_otg_hisi.c optional dwcotg soc_hisi_hi6220 +dev/vnic/mrml_bridge.c optionalvnic fdt dev/vnic/nic_main.coptionalvnic pci dev/vnic/nicvf_main.c optionalvnic pci pci_iov dev/vnic/nicvf_queues.coptionalvnic pci pci_iov Added: head/sys/dev/vnic/mrml_bridge.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/vnic/mrml_bridge.c Thu Jan 28 15:44:14 2016 (r294994) @@ -0,0 +1,280 @@ +/* + * Copyright (C) 2016 Cavium Inc. + * All rights reserved. + * + * Developed by Semihalf. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + *notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + *notice, this list of conditions and the following disclaimer in the + *documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include "opt_platform.h" + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +static MALLOC_DEFINE(M_MRMLB, "MRML bridge", "Cavium MRML bridge"); + +static device_probe_t mrmlb_fdt_probe; +static device_attach_t mrmlb_fdt_attach; + +static struct resource * mrmlb_ofw_bus_alloc_res(device_t, device_t, int, int *, +rman_res_t, rman_res_t, rman_res_t, u_int); + +static const struct ofw_bus_devinfo * mrmlb_ofw_get_devinfo(device_t, device_t); + +static device_method_t mrmlbus_fdt_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, mrmlb_fdt_probe), + DEVMETHOD(device_attach,mrmlb_fdt_attach), + + /* Bus interface */ + DEVMETHOD(bus_alloc_resource, mrmlb_ofw_bus_alloc_res), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource,bus_generic_activate_resource), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, mrmlb_ofw_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model,ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(mrmlbus, mrmlbus_fdt_driver, mrmlbus_fdt_methods, +sizeof(struct simplebus_softc)); + +static devclass_t mrmlbus_fdt_devclass; + +EARLY_DRIVER_MODULE(mrmlbus, pcib, mrmlbus_fdt_driver, mrmlbus_fdt_devclass, 0, 0, +
svn commit: r294993 - head/sys/arm64/cavium
Author: zbb Date: Thu Jan 28 15:40:56 2016 New Revision: 294993 URL: https://svnweb.freebsd.org/changeset/base/294993 Log: Add FDT bus capabilities to ThunderX PCI driver New ThunderX firmware incorporates modified DTB that presents different device hierarchy. In the new device tree, MDIO devices are below two additional buses that oddly hang on PCI bridge. Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5069 Modified: head/sys/arm64/cavium/thunder_pcie.c head/sys/arm64/cavium/thunder_pcie_common.c head/sys/arm64/cavium/thunder_pcie_common.h head/sys/arm64/cavium/thunder_pcie_fdt.c Modified: head/sys/arm64/cavium/thunder_pcie.c == --- head/sys/arm64/cavium/thunder_pcie.cThu Jan 28 15:38:02 2016 (r294992) +++ head/sys/arm64/cavium/thunder_pcie.cThu Jan 28 15:40:56 2016 (r294993) @@ -28,6 +28,7 @@ */ /* PCIe root complex driver for Cavium Thunder SOC */ +#include "opt_platform.h" #include __FBSDID("$FreeBSD$"); @@ -89,15 +90,11 @@ SYSCTL_INT(_hw, OID_AUTO, thunder_pcie_m _pcie_max_vfs, 0, "Max VFs supported by ThunderX internal PCIe"); /* Forward prototypes */ -static struct resource *thunder_pcie_alloc_resource(device_t, -device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); static int thunder_pcie_identify_pcib(device_t); static int thunder_pcie_maxslots(device_t); static uint32_t thunder_pcie_read_config(device_t, u_int, u_int, u_int, u_int, int); static int thunder_pcie_read_ivar(device_t, device_t, int, uintptr_t *); -static int thunder_pcie_release_resource(device_t, device_t, int, int, -struct resource *); static void thunder_pcie_write_config(device_t, u_int, u_int, u_int, u_int, uint32_t, int); static int thunder_pcie_write_ivar(device_t, device_t, int, uintptr_t); @@ -262,7 +259,7 @@ thunder_pcie_write_ivar(device_t dev, de return (ENOENT); } -static int +int thunder_pcie_release_resource(device_t dev, device_t child, int type, int rid, struct resource *res) { @@ -274,7 +271,7 @@ thunder_pcie_release_resource(device_t d return (rman_release_resource(res)); } -static struct resource * +struct resource * thunder_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags) { Modified: head/sys/arm64/cavium/thunder_pcie_common.c == --- head/sys/arm64/cavium/thunder_pcie_common.c Thu Jan 28 15:38:02 2016 (r294992) +++ head/sys/arm64/cavium/thunder_pcie_common.c Thu Jan 28 15:40:56 2016 (r294993) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -44,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include "thunder_pcie_common.h" +MALLOC_DEFINE(M_THUNDER_PCIE, "Thunder PCIe driver", "Thunder PCIe driver memory"); + uint32_t range_addr_is_pci(struct pcie_range *ranges, uint64_t addr, uint64_t size) { Modified: head/sys/arm64/cavium/thunder_pcie_common.h == --- head/sys/arm64/cavium/thunder_pcie_common.h Thu Jan 28 15:38:02 2016 (r294992) +++ head/sys/arm64/cavium/thunder_pcie_common.h Thu Jan 28 15:40:56 2016 (r294993) @@ -34,6 +34,8 @@ DECLARE_CLASS(thunder_pcie_driver); +MALLOC_DECLARE(M_THUNDER_PCIE); + struct pcie_range { uint64_tpci_base; uint64_tphys_base; @@ -58,6 +60,11 @@ int thunder_common_map_msi(device_t, dev int thunder_common_release_msi(device_t, device_t, int, int *); int thunder_common_release_msix(device_t, device_t, int); +struct resource *thunder_pcie_alloc_resource(device_t, +device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +int thunder_pcie_release_resource(device_t, device_t, int, int, +struct resource *); + int thunder_pcie_attach(device_t); #endif /* _CAVIUM_THUNDER_PCIE_COMMON_H_ */ Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c == --- head/sys/arm64/cavium/thunder_pcie_fdt.cThu Jan 28 15:38:02 2016 (r294992) +++ head/sys/arm64/cavium/thunder_pcie_fdt.cThu Jan 28 15:40:56 2016 (r294993) @@ -60,10 +60,32 @@ __FBSDID("$FreeBSD$"); static int thunder_pcie_fdt_probe(device_t); static int thunder_pcie_fdt_attach(device_t); +static struct resource * thunder_pcie_ofw_bus_alloc_res(device_t, device_t, +int, int *, rman_res_t, rman_res_t, rman_res_t, u_int); +static int thunder_pcie_ofw_bus_rel_res(device_t, device_t, int, int, +struct resource *); + +static const struct ofw_bus_devinfo *thunder_pcie_ofw_get_devinfo(device_t, +device_t); + static device_method_t thunder_pcie_fdt_methods[] = { /* Device
svn commit: r294995 - head/sys/netinet
Author: tuexen Date: Thu Jan 28 16:05:46 2016 New Revision: 294995 URL: https://svnweb.freebsd.org/changeset/base/294995 Log: Always look in the TCP pool. This fixes issues with a restarting peer when the listening 1-to-1 style socket is closed. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_pcb.c Modified: head/sys/netinet/sctp_input.c == --- head/sys/netinet/sctp_input.c Thu Jan 28 15:44:14 2016 (r294994) +++ head/sys/netinet/sctp_input.c Thu Jan 28 16:05:46 2016 (r294995) @@ -5688,6 +5688,7 @@ sctp_common_input_processing(struct mbuf if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } +printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), ntohs(port)); net->port = port; } #endif @@ -5719,6 +5720,7 @@ sctp_common_input_processing(struct mbuf if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } +printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), ntohs(port)); net->port = port; } #endif @@ -5831,6 +5833,7 @@ sctp_common_input_processing(struct mbuf if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } +printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), ntohs(port)); net->port = port; } #endif Modified: head/sys/netinet/sctp_pcb.c == --- head/sys/netinet/sctp_pcb.c Thu Jan 28 15:44:14 2016(r294994) +++ head/sys/netinet/sctp_pcb.c Thu Jan 28 16:05:46 2016(r294995) @@ -2256,7 +2256,6 @@ sctp_findassociation_addr(struct mbuf *m struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb **inp_p, struct sctp_nets **netp, uint32_t vrf_id) { - int find_tcp_pool; struct sctp_tcb *stcb; struct sctp_inpcb *inp; @@ -2268,25 +2267,13 @@ sctp_findassociation_addr(struct mbuf *m return (stcb); } } - find_tcp_pool = 0; - /* -* Don't consider INIT chunks since that breaks 1-to-1 sockets: When -* a server closes the listener, incoming INIT chunks are not -* responsed by an INIT-ACK chunk. -*/ - if ((ch->chunk_type != SCTP_INITIATION_ACK) && - (ch->chunk_type != SCTP_COOKIE_ACK) && - (ch->chunk_type != SCTP_COOKIE_ECHO)) { - /* Other chunk types go to the tcp pool. */ - find_tcp_pool = 1; - } if (inp_p) { stcb = sctp_findassociation_addr_sa(src, dst, inp_p, netp, - find_tcp_pool, vrf_id); + 1, vrf_id); inp = *inp_p; } else { stcb = sctp_findassociation_addr_sa(src, dst, , netp, - find_tcp_pool, vrf_id); + 1, vrf_id); } SCTPDBG(SCTP_DEBUG_PCB1, "stcb:%p inp:%p\n", (void *)stcb, (void *)inp); if (stcb == NULL && inp) { ___ 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-unsubscr...@freebsd.org"
svn commit: r294996 - head/sys/dev/sfxge
Author: glebius Date: Thu Jan 28 16:51:56 2016 New Revision: 294996 URL: https://svnweb.freebsd.org/changeset/base/294996 Log: Use m_getjcl() instead of manually selecting zone. Reviewed by: arybchik Modified: head/sys/dev/sfxge/sfxge.h head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/sfxge.h == --- head/sys/dev/sfxge/sfxge.h Thu Jan 28 16:05:46 2016(r294995) +++ head/sys/dev/sfxge/sfxge.h Thu Jan 28 16:51:56 2016(r294996) @@ -273,7 +273,7 @@ struct sfxge_softc { size_t rx_prefix_size; size_t rx_buffer_size; size_t rx_buffer_align; - uma_zone_t rx_buffer_zone; + int rx_cluster_size; unsigned intevq_max; unsigned intevq_count; Modified: head/sys/dev/sfxge/sfxge_rx.c == --- head/sys/dev/sfxge/sfxge_rx.c Thu Jan 28 16:05:46 2016 (r294995) +++ head/sys/dev/sfxge/sfxge_rx.c Thu Jan 28 16:51:56 2016 (r294996) @@ -205,25 +205,6 @@ sfxge_rx_schedule_refill(struct sfxge_rx sfxge_rx_post_refill, rxq); } -static struct mbuf *sfxge_rx_alloc_mbuf(struct sfxge_softc *sc) -{ - struct mb_args args; - struct mbuf *m; - - /* Allocate mbuf structure */ - args.flags = M_PKTHDR; - args.type = MT_DATA; - m = (struct mbuf *)uma_zalloc_arg(zone_mbuf, , M_NOWAIT); - - /* Allocate (and attach) packet buffer */ - if (m != NULL && !uma_zalloc_arg(sc->rx_buffer_zone, m, M_NOWAIT)) { - uma_zfree(zone_mbuf, m); - m = NULL; - } - - return (m); -} - #defineSFXGE_REFILL_BATCH 64 static void @@ -273,7 +254,8 @@ sfxge_rx_qfill(struct sfxge_rxq *rxq, un KASSERT(rx_desc->mbuf == NULL, ("rx_desc->mbuf != NULL")); rx_desc->flags = EFX_DISCARD; - m = rx_desc->mbuf = sfxge_rx_alloc_mbuf(sc); + m = rx_desc->mbuf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, + sc->rx_cluster_size); if (m == NULL) break; @@ -1125,13 +1107,13 @@ sfxge_rx_start(struct sfxge_softc *sc) /* Select zone for packet buffers */ if (reserved <= MCLBYTES) - sc->rx_buffer_zone = zone_clust; + sc->rx_cluster_size = MCLBYTES; else if (reserved <= MJUMPAGESIZE) - sc->rx_buffer_zone = zone_jumbop; + sc->rx_cluster_size = MJUMPAGESIZE; else if (reserved <= MJUM9BYTES) - sc->rx_buffer_zone = zone_jumbo9; + sc->rx_cluster_size = MJUM9BYTES; else - sc->rx_buffer_zone = zone_jumbo16; + sc->rx_cluster_size = MJUM16BYTES; /* * Set up the scale table. Enable all hash types and hash insertion. ___ 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-unsubscr...@freebsd.org"
svn commit: r294998 - in head/sys: arm64/cavium dev/vnic
Author: zbb Date: Thu Jan 28 16:58:49 2016 New Revision: 294998 URL: https://svnweb.freebsd.org/changeset/base/294998 Log: Fix VNIC enumeration after r294993 and r294990 ofw_bus_get_node() must be tested against negative values since missing parent bus method will result in calling the default method which simply returns (-1): sys/dev/ofw/ofw_bus_if.m This was lost in the review process. Obtained from: Semihalf Sponsored by: Cavium Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c head/sys/dev/vnic/thunder_bgx_fdt.c Modified: head/sys/arm64/cavium/thunder_pcie_fdt.c == --- head/sys/arm64/cavium/thunder_pcie_fdt.cThu Jan 28 16:52:02 2016 (r294997) +++ head/sys/arm64/cavium/thunder_pcie_fdt.cThu Jan 28 16:58:49 2016 (r294998) @@ -276,7 +276,7 @@ thunder_pcie_ofw_bus_alloc_res(device_t int i; /* For PCIe devices that do not have FDT nodes, use PCIB method */ - if (ofw_bus_get_node(child) == 0) { + if ((int)ofw_bus_get_node(child) <= 0) { return (thunder_pcie_alloc_resource(bus, child, type, rid, start, end, count, flags)); } @@ -329,7 +329,7 @@ thunder_pcie_ofw_bus_rel_res(device_t bu { /* For PCIe devices that do not have FDT nodes, use PCIB method */ - if (ofw_bus_get_node(child) == 0) { + if ((int)ofw_bus_get_node(child) <= 0) { return (thunder_pcie_release_resource(bus, child, type, rid, res)); } Modified: head/sys/dev/vnic/thunder_bgx_fdt.c == --- head/sys/dev/vnic/thunder_bgx_fdt.c Thu Jan 28 16:52:02 2016 (r294997) +++ head/sys/dev/vnic/thunder_bgx_fdt.c Thu Jan 28 16:58:49 2016 (r294998) @@ -244,7 +244,7 @@ bgx_fdt_find_node(struct bgx *bgx) } node = ofw_bus_get_node(root_pcib); - if (node == 0) { + if ((int)node <= 0) { device_printf(bgx->dev, "No parent FDT node for BGX\n"); goto out; } ___ 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-unsubscr...@freebsd.org"
svn commit: r294990 - head/sys/dev/vnic
Author: zbb Date: Thu Jan 28 15:30:58 2016 New Revision: 294990 URL: https://svnweb.freebsd.org/changeset/base/294990 Log: Fix finding appropriate BGX node in DTB and move it to a separate function Search for BGX node in DTS in two ways: 1. Try to find it uder root node first 2. If not found under root, find the top level PCI bridge node and search all nodes below it until appropriate BGX node is found. Move search code to another function to make the code more clear. Remove unused variable by the way. Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5066 Modified: head/sys/dev/vnic/thunder_bgx.c head/sys/dev/vnic/thunder_bgx_fdt.c head/sys/dev/vnic/thunder_bgx_var.h Modified: head/sys/dev/vnic/thunder_bgx.c == --- head/sys/dev/vnic/thunder_bgx.c Thu Jan 28 14:11:59 2016 (r294989) +++ head/sys/dev/vnic/thunder_bgx.c Thu Jan 28 15:30:58 2016 (r294990) @@ -68,7 +68,7 @@ __FBSDID("$FreeBSD$"); #defineTHUNDER_BGX_DEVSTR "ThunderX BGX Ethernet I/O Interface" -static MALLOC_DEFINE(M_BGX, "thunder_bgx", "ThunderX BGX dynamic memory"); +MALLOC_DEFINE(M_BGX, "thunder_bgx", "ThunderX BGX dynamic memory"); #define BGX_NODE_ID_MASK 0x1 #define BGX_NODE_ID_SHIFT 24 Modified: head/sys/dev/vnic/thunder_bgx_fdt.c == --- head/sys/dev/vnic/thunder_bgx_fdt.c Thu Jan 28 14:11:59 2016 (r294989) +++ head/sys/dev/vnic/thunder_bgx_fdt.c Thu Jan 28 15:30:58 2016 (r294990) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "thunder_bgx.h" @@ -61,6 +62,11 @@ __FBSDID("$FreeBSD$"); #defineCONN_TYPE_MAXLEN16 #defineCONN_TYPE_OFFSET2 +#defineBGX_NODE_NAME "bgx" +#defineBGX_MAXID 9 + +#defineFDT_NAME_MAXLEN 31 + int bgx_fdt_init_phy(struct bgx *); static void @@ -119,28 +125,152 @@ bgx_fdt_phy_mode_match(struct bgx *bgx, return (FALSE); } +static phandle_t +bgx_fdt_traverse_nodes(phandle_t start, char *name, size_t len) +{ + phandle_t node, ret; + size_t buf_size; + char *node_name; + int err; + + buf_size = sizeof(*node_name) * FDT_NAME_MAXLEN; + if (len > buf_size) { + /* +* This is an erroneous situation since the string +* to compare cannot be longer than FDT_NAME_MAXLEN. +*/ + return (0); + } + + node_name = malloc(buf_size, M_BGX, M_WAITOK); + for (node = OF_child(start); node != 0; node = OF_peer(node)) { + /* Clean-up the buffer */ + memset(node_name, 0, buf_size); + /* Recurse to children */ + if (OF_child(node) != 0) { + ret = bgx_fdt_traverse_nodes(node, name, len); + if (ret != 0) { + free(node_name, M_BGX); + return (ret); + } + } + err = OF_getprop(node, "name", node_name, FDT_NAME_MAXLEN); + if ((err > 0) && (strncmp(node_name, name, len) == 0)) { + free(node_name, M_BGX); + return (node); + } + } + free(node_name, M_BGX); + + return (0); +} + +/* + * Similar functionality to pci_find_pcie_root_port() + * but this one works for ThunderX. + */ +static device_t +bgx_find_root_pcib(device_t dev) +{ + devclass_t pci_class; + device_t pcib, bus; + + pci_class = devclass_find("pci"); + KASSERT(device_get_devclass(device_get_parent(dev)) == pci_class, + ("%s: non-pci device %s", __func__, device_get_nameunit(dev))); + + /* Walk the bridge hierarchy until we find a non-PCI device */ + for (;;) { + bus = device_get_parent(dev); + KASSERT(bus != NULL, ("%s: null parent of %s", __func__, + device_get_nameunit(dev))); + + if (device_get_devclass(bus) != pci_class) + return (NULL); + + pcib = device_get_parent(bus); + KASSERT(pcib != NULL, ("%s: null bridge of %s", __func__, + device_get_nameunit(bus))); + + /* +* If the parent of this PCIB is not PCI +* then we found our root PCIB. +*/ + if (device_get_devclass(device_get_parent(pcib)) != pci_class) + return (pcib); + + dev = pcib; + } +} + +static __inline phandle_t +bgx_fdt_find_node(struct bgx *bgx) +{ + device_t root_pcib; + phandle_t node; + char *bgx_sel; + size_t
svn commit: r294992 - head/sys/arm64/cavium
Author: zbb Date: Thu Jan 28 15:38:02 2016 New Revision: 294992 URL: https://svnweb.freebsd.org/changeset/base/294992 Log: Correct alloc_ and release_resource methods in thunder_pcie driver - Avoid using BUS_ macros as bus_generic_ functions should be used instead. - Fix mistaken device_t pointers in thunder_pcie_alloc_resource. Should use dev->parent method and allocate resource for child device Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5068 Modified: head/sys/arm64/cavium/thunder_pcie.c Modified: head/sys/arm64/cavium/thunder_pcie.c == --- head/sys/arm64/cavium/thunder_pcie.cThu Jan 28 15:34:13 2016 (r294991) +++ head/sys/arm64/cavium/thunder_pcie.cThu Jan 28 15:38:02 2016 (r294992) @@ -268,7 +268,7 @@ thunder_pcie_release_resource(device_t d { if (type != SYS_RES_MEMORY) - return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child, + return (bus_generic_release_resource(dev, child, type, rid, res)); return (rman_release_resource(res)); @@ -291,7 +291,7 @@ thunder_pcie_alloc_resource(device_t dev rm = >mem_rman; break; default: - return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev, + return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); }; ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r294909 - head/crypto/openssh
> On Jan 28, 2016, at 02:05, Dag-Erling Smørgravwrote: > > Colin Percival writes: >> At a guess, because NGie thinks that this is something which is important >> enough to be worth mentioning in the FreeBSD release notes, and "Relnotes: >> yes" flags the commit to the release engineering team for that purpose? > > UseDNS was (unintentionally) turned off in head last week, I just turned > it back on. As Conrad said earlier, I incorrectly assumed that this needed to be MFCed: I didn't look at the commit history for openssh, and the message stated the what, not the why behind the change, so I assumed incorrectly that this was a new feature. I apologize for the confusion. -NGie ___ 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-unsubscr...@freebsd.org"
svn commit: r295006 - head/share/mk
Author: bdrewery Date: Thu Jan 28 18:57:47 2016 New Revision: 295006 URL: https://svnweb.freebsd.org/changeset/base/295006 Log: Fix -include .depend hack from r294370 for headers not in .PATH. This hack will be removed in a few weeks. It is here to fix incremental builds of SSH between r291941 and r294370. Reported by: jmallett MFC after:1 day Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk == --- head/share/mk/bsd.dep.mkThu Jan 28 18:45:09 2016(r295005) +++ head/share/mk/bsd.dep.mkThu Jan 28 18:57:47 2016(r295006) @@ -206,12 +206,13 @@ depend: beforedepend ${DEPENDFILE} after _CFLAGS_INCLUDES= ${CFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g} _CXXFLAGS_INCLUDES= ${CXXFLAGS:Q:S/\\ /,/g:C/-include,/-include%/g:C/,/ /g:M-include*:C/%/ /g} # XXX: Temporary hack to workaround .depend files not tracking -include -.if !empty(_CFLAGS_INCLUDES) -${OBJS} ${POBJS} ${SOBJS}: ${_CFLAGS_INCLUDES:M*.h} -.endif -.if !empty(_CXXFLAGS_INCLUDES) -${OBJS} ${POBJS} ${SOBJS}: ${_CXXFLAGS_INCLUDES:M*.h} +_hdrincludes=${_CFLAGS_INCLUDES:M*.h} ${_CXXFLAGS_INCLUDES:M*.h} +.for _hdr in ${_hdrincludes:O:u} +.if exists(${_hdr}) +${OBJS} ${POBJS} ${SOBJS}: ${_hdr} .endif +.endfor +.undef _hdrincludes # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r294840 - head/sys/netinet
Somehow I totally missed this email. On 01/26/16 at 02:53P, Gleb Smirnoff wrote: > Hiren, > > On Tue, Jan 26, 2016 at 04:33:38PM +, Hiren Panchasara wrote: > H> Author: hiren > H> Date: Tue Jan 26 16:33:38 2016 > H> New Revision: 294840 > H> URL: https://svnweb.freebsd.org/changeset/base/294840 > H> > H> Log: > H> Persist timers TCPTV_PERSMIN and TCPTV_PERSMAX are hardcoded with 5 > seconds and > H> 60 seconds, respectively. Turn them into sysctls that can be tuned live. > The > H> default values of 5 seconds and 60 seconds have been retained. > H> > H> Submitted by:Jason Wolfe (j at nitrology dot com) > H> Reviewed by: gnn, rrs, hiren, bz > H> MFC after: 1 week > H> Sponsored by:Limelight Networks > H> Differential Revision: https://reviews.freebsd.org/D5024 > > A theoretical question: could it be useful to make them socket options > like the TCP_KEEP* timeouts? Hum, unsure. I do not have a use-case for that currently. Cheers, Hiren pgpJMB2qhf2Tf.pgp Description: PGP signature
svn commit: r295022 - in head: share/man/man4 sys/dev/nvd
Author: jimharris Date: Thu Jan 28 23:15:14 2016 New Revision: 295022 URL: https://svnweb.freebsd.org/changeset/base/295022 Log: nvd: add hw.nvd.delete_max tunable The NVMe specification does not define a maximum or optimal delete size, so technically max delete size is min(full size of namespace, 2^32 - 1 LBAs). A single delete operation for a multi-TB NVMe namespace though may take much longer to complete than the nvme(4) I/O timeout period. So choose a sensible default here that is still suitably large to minimize the number of overall delete operations. This also fixes possible uint32_t overflow on initial TRIM operation for zpool create operations for NVMe namespaces with >4G LBAs. MFC after:3 days Sponsored by: Intel Modified: head/share/man/man4/nvd.4 head/sys/dev/nvd/nvd.c Modified: head/share/man/man4/nvd.4 == --- head/share/man/man4/nvd.4 Thu Jan 28 23:12:12 2016(r295021) +++ head/share/man/man4/nvd.4 Thu Jan 28 23:15:14 2016(r295022) @@ -1,5 +1,5 @@ .\" -.\" Copyright (c) 2012-2014 Intel Corporation +.\" Copyright (c) 2012-2016 Intel Corporation .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -33,7 +33,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2014 +.Dd January 28, 2016 .Dt NVD 4 .Os .Sh NAME @@ -74,6 +74,15 @@ Note that device nodes from the driver are not .Xr GEOM 4 disks and cannot be partitioned. +.Sh CONFIGURATION +The +.Nm +driver defines a system-wide maximum delete size for NVMe devices. The +default is 1GB. To select a different value, set the following tunable in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.nvd.delete_max= +.Ed .Sh SEE ALSO .Xr GEOM 4 , .Xr nvme 4 , Modified: head/sys/dev/nvd/nvd.c == --- head/sys/dev/nvd/nvd.c Thu Jan 28 23:12:12 2016(r295021) +++ head/sys/dev/nvd/nvd.c Thu Jan 28 23:15:14 2016(r295022) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012-2013 Intel Corporation + * Copyright (C) 2012-2016 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -88,6 +89,19 @@ struct nvd_controller { static TAILQ_HEAD(, nvd_controller)ctrlr_head; static TAILQ_HEAD(disk_list, nvd_disk) disk_head; +static SYSCTL_NODE(_hw, OID_AUTO, nvd, CTLFLAG_RD, 0, "nvd driver parameters"); +/* + * The NVMe specification does not define a maximum or optimal delete size, so + * technically max delete size is min(full size of the namespace, 2^32 - 1 + * LBAs). A single delete for a multi-TB NVMe namespace though may take much + * longer to complete than the nvme(4) I/O timeout period. So choose a sensible + * default here that is still suitably large to minimize the number of overall + * delete operations. + */ +static uint64_t nvd_delete_max = (1024 * 1024 * 1024); /* 1GB */ +SYSCTL_UQUAD(_hw_nvd, OID_AUTO, delete_max, CTLFLAG_RDTUN, _delete_max, 0, +"nvd maximum BIO_DELETE size in bytes"); + static int nvd_modevent(module_t mod, int type, void *arg) { int error = 0; @@ -295,6 +309,8 @@ nvd_new_disk(struct nvme_namespace *ns, disk->d_sectorsize = nvme_ns_get_sector_size(ns); disk->d_mediasize = (off_t)nvme_ns_get_size(ns); disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns); + if (disk->d_delmaxsize > nvd_delete_max) + disk->d_delmaxsize = nvd_delete_max; disk->d_stripesize = nvme_ns_get_optimal_sector_size(ns); if (TAILQ_EMPTY(_head)) ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r294995 - head/sys/netinet
On Thu, Jan 28, 2016 at 5:05 PM, Michael Tuexenwrote: > Author: tuexen > Date: Thu Jan 28 16:05:46 2016 > New Revision: 294995 > URL: https://svnweb.freebsd.org/changeset/base/294995 > > Log: > Always look in the TCP pool. > This fixes issues with a restarting peer when the listening > 1-to-1 style socket is closed. > > MFC after: 3 days > > Modified: > head/sys/netinet/sctp_input.c > head/sys/netinet/sctp_pcb.c > > Modified: head/sys/netinet/sctp_input.c > == > --- head/sys/netinet/sctp_input.c Thu Jan 28 15:44:14 2016 > (r294994) > +++ head/sys/netinet/sctp_input.c Thu Jan 28 16:05:46 2016 > (r294995) > @@ -5688,6 +5688,7 @@ sctp_common_input_processing(struct mbuf > if (net->port == 0) { > sctp_pathmtu_adjustment(stcb, > net->mtu - sizeof(struct udphdr)); > } > +printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), > ntohs(port)); Are these debug printf intended? > net->port = port; > } > #endif > @@ -5719,6 +5720,7 @@ sctp_common_input_processing(struct mbuf > if (net->port == 0) { > sctp_pathmtu_adjustment(stcb, net->mtu - > sizeof(struct udphdr)); > } > +printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), > ntohs(port)); > net->port = port; > } > #endif > @@ -5831,6 +5833,7 @@ sctp_common_input_processing(struct mbuf > if (net->port == 0) { > sctp_pathmtu_adjustment(stcb, > net->mtu - sizeof(struct udphdr)); > } > +printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), > ntohs(port)); > net->port = port; > } > #endif > > Modified: head/sys/netinet/sctp_pcb.c > == > --- head/sys/netinet/sctp_pcb.c Thu Jan 28 15:44:14 2016(r294994) > +++ head/sys/netinet/sctp_pcb.c Thu Jan 28 16:05:46 2016(r294995) > @@ -2256,7 +2256,6 @@ sctp_findassociation_addr(struct mbuf *m > struct sctphdr *sh, struct sctp_chunkhdr *ch, > struct sctp_inpcb **inp_p, struct sctp_nets **netp, uint32_t vrf_id) > { > - int find_tcp_pool; > struct sctp_tcb *stcb; > struct sctp_inpcb *inp; > > @@ -2268,25 +2267,13 @@ sctp_findassociation_addr(struct mbuf *m > return (stcb); > } > } > - find_tcp_pool = 0; > - /* > -* Don't consider INIT chunks since that breaks 1-to-1 sockets: When > -* a server closes the listener, incoming INIT chunks are not > -* responsed by an INIT-ACK chunk. > -*/ > - if ((ch->chunk_type != SCTP_INITIATION_ACK) && > - (ch->chunk_type != SCTP_COOKIE_ACK) && > - (ch->chunk_type != SCTP_COOKIE_ECHO)) { > - /* Other chunk types go to the tcp pool. */ > - find_tcp_pool = 1; > - } > if (inp_p) { > stcb = sctp_findassociation_addr_sa(src, dst, inp_p, netp, > - find_tcp_pool, vrf_id); > + 1, vrf_id); > inp = *inp_p; > } else { > stcb = sctp_findassociation_addr_sa(src, dst, , netp, > - find_tcp_pool, vrf_id); > + 1, vrf_id); > } > SCTPDBG(SCTP_DEBUG_PCB1, "stcb:%p inp:%p\n", (void *)stcb, (void > *)inp); > if (stcb == NULL && inp) { > ___ > 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-unsubscr...@freebsd.org" ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r294995 - head/sys/netinet
> On 28 Jan 2016, at 23:24, Oliver Pinterwrote: > > On Thu, Jan 28, 2016 at 5:05 PM, Michael Tuexen wrote: >> Author: tuexen >> Date: Thu Jan 28 16:05:46 2016 >> New Revision: 294995 >> URL: https://svnweb.freebsd.org/changeset/base/294995 >> >> Log: >> Always look in the TCP pool. >> This fixes issues with a restarting peer when the listening >> 1-to-1 style socket is closed. >> >> MFC after: 3 days >> >> Modified: >> head/sys/netinet/sctp_input.c >> head/sys/netinet/sctp_pcb.c >> >> Modified: head/sys/netinet/sctp_input.c >> == >> --- head/sys/netinet/sctp_input.c Thu Jan 28 15:44:14 2016 >> (r294994) >> +++ head/sys/netinet/sctp_input.c Thu Jan 28 16:05:46 2016 >> (r294995) >> @@ -5688,6 +5688,7 @@ sctp_common_input_processing(struct mbuf >>if (net->port == 0) { >>sctp_pathmtu_adjustment(stcb, >> net->mtu - sizeof(struct udphdr)); >>} >> +printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), >> ntohs(port)); > > Are these debug printf intended? No. Fixed in https://svnweb.freebsd.org/changeset/base/295021 Thanks for reporting! Best regards Michael > >>net->port = port; >>} >> #endif >> @@ -5719,6 +5720,7 @@ sctp_common_input_processing(struct mbuf >>if (net->port == 0) { >>sctp_pathmtu_adjustment(stcb, net->mtu - >> sizeof(struct udphdr)); >>} >> +printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), >> ntohs(port)); >>net->port = port; >>} >> #endif >> @@ -5831,6 +5833,7 @@ sctp_common_input_processing(struct mbuf >>if (net->port == 0) { >>sctp_pathmtu_adjustment(stcb, >> net->mtu - sizeof(struct udphdr)); >>} >> +printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), >> ntohs(port)); >>net->port = port; >>} >> #endif >> >> Modified: head/sys/netinet/sctp_pcb.c >> == >> --- head/sys/netinet/sctp_pcb.c Thu Jan 28 15:44:14 2016(r294994) >> +++ head/sys/netinet/sctp_pcb.c Thu Jan 28 16:05:46 2016(r294995) >> @@ -2256,7 +2256,6 @@ sctp_findassociation_addr(struct mbuf *m >> struct sctphdr *sh, struct sctp_chunkhdr *ch, >> struct sctp_inpcb **inp_p, struct sctp_nets **netp, uint32_t vrf_id) >> { >> - int find_tcp_pool; >>struct sctp_tcb *stcb; >>struct sctp_inpcb *inp; >> >> @@ -2268,25 +2267,13 @@ sctp_findassociation_addr(struct mbuf *m >>return (stcb); >>} >>} >> - find_tcp_pool = 0; >> - /* >> -* Don't consider INIT chunks since that breaks 1-to-1 sockets: When >> -* a server closes the listener, incoming INIT chunks are not >> -* responsed by an INIT-ACK chunk. >> -*/ >> - if ((ch->chunk_type != SCTP_INITIATION_ACK) && >> - (ch->chunk_type != SCTP_COOKIE_ACK) && >> - (ch->chunk_type != SCTP_COOKIE_ECHO)) { >> - /* Other chunk types go to the tcp pool. */ >> - find_tcp_pool = 1; >> - } >>if (inp_p) { >>stcb = sctp_findassociation_addr_sa(src, dst, inp_p, netp, >> - find_tcp_pool, vrf_id); >> + 1, vrf_id); >>inp = *inp_p; >>} else { >>stcb = sctp_findassociation_addr_sa(src, dst, , netp, >> - find_tcp_pool, vrf_id); >> + 1, vrf_id); >>} >>SCTPDBG(SCTP_DEBUG_PCB1, "stcb:%p inp:%p\n", (void *)stcb, (void >> *)inp); >>if (stcb == NULL && inp) { >> ___ >> 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-unsubscr...@freebsd.org" > ___ 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-unsubscr...@freebsd.org"
svn commit: r295021 - head/sys/netinet
Author: tuexen Date: Thu Jan 28 23:12:12 2016 New Revision: 295021 URL: https://svnweb.freebsd.org/changeset/base/295021 Log: Remove debug output which was committed by accident. Thanks to Oliver Pinter for reporting. MFC after: 3 days X-MFC with: r294995 Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c == --- head/sys/netinet/sctp_input.c Thu Jan 28 22:57:09 2016 (r295020) +++ head/sys/netinet/sctp_input.c Thu Jan 28 23:12:12 2016 (r295021) @@ -5688,7 +5688,6 @@ sctp_common_input_processing(struct mbuf if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } -printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), ntohs(port)); net->port = port; } #endif @@ -5720,7 +5719,6 @@ printf("Changing remote encaps port from if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } -printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), ntohs(port)); net->port = port; } #endif @@ -5833,7 +5831,6 @@ printf("Changing remote encaps port from if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); } -printf("Changing remote encaps port from %u to %u.\n", ntohs(net->port), ntohs(port)); net->port = port; } #endif ___ 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-unsubscr...@freebsd.org"
svn commit: r295017 - in head/sys: dev/filemon modules/filemon
Author: bdrewery Date: Thu Jan 28 21:45:25 2016 New Revision: 295017 URL: https://svnweb.freebsd.org/changeset/base/295017 Log: filemon: Use process_exec EVENTHANDLER to capture sys_execve. MFC after:2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon_wrapper.c head/sys/modules/filemon/Makefile Modified: head/sys/dev/filemon/filemon_wrapper.c == --- head/sys/dev/filemon/filemon_wrapper.c Thu Jan 28 21:42:10 2016 (r295016) +++ head/sys/dev/filemon/filemon_wrapper.c Thu Jan 28 21:45:25 2016 (r295017) @@ -29,8 +29,10 @@ #include __FBSDID("$FreeBSD$"); +#include #include #include +#include #include "opt_compat.h" @@ -44,7 +46,6 @@ __FBSDID("$FreeBSD$"); (2011-09-10) so this code is broken for 9-CURRENT September 10th-16th. */ #define sys_chdir chdir -#define sys_execve execve #define sys_link link #define sys_open open #define sys_rename rename @@ -56,6 +57,7 @@ __FBSDID("$FreeBSD$"); #endif #endif /* __FreeBSD_version */ +static eventhandler_tag filemon_exec_tag; static eventhandler_tag filemon_exit_tag; static eventhandler_tag filemon_fork_tag; @@ -137,62 +139,33 @@ filemon_wrapper_chdir(struct thread *td, return (ret); } -static int -filemon_wrapper_execve(struct thread *td, struct execve_args *uap) +static void +filemon_event_process_exec(void *arg __unused, struct proc *p, +struct image_params *imgp) { - char fname[MAXPATHLEN]; - int ret; - size_t done; - size_t len; struct filemon *filemon; + char *fullpath, *freepath; + size_t len; - copyinstr(uap->fname, fname, sizeof(fname), ); - - if ((ret = sys_execve(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "E %d %s\n", - curproc->p_pid, fname); - - filemon_output(filemon, filemon->msgbufr, len); - - /* Unlock the found filemon structure. */ - filemon_filemon_unlock(filemon); - } - } - - return (ret); -} + if ((filemon = filemon_pid_check(p)) != NULL) { + fullpath = ""; + freepath = NULL; -#if defined(COMPAT_IA32) || defined(COMPAT_FREEBSD32) || defined(COMPAT_ARCH32) -static int -filemon_wrapper_freebsd32_execve(struct thread *td, -struct freebsd32_execve_args *uap) -{ - char fname[MAXPATHLEN]; - int ret; - size_t done; - size_t len; - struct filemon *filemon; + vn_fullpath(FIRST_THREAD_IN_PROC(p), imgp->vp, , + ); - copyinstr(uap->fname, fname, sizeof(fname), ); + len = snprintf(filemon->msgbufr, + sizeof(filemon->msgbufr), "E %d %s\n", + p->p_pid, fullpath); - if ((ret = freebsd32_execve(td, uap)) == 0) { - if ((filemon = filemon_pid_check(curproc)) != NULL) { - len = snprintf(filemon->msgbufr, - sizeof(filemon->msgbufr), "E %d %s\n", - curproc->p_pid, fname); + filemon_output(filemon, filemon->msgbufr, len); - filemon_output(filemon, filemon->msgbufr, len); + /* Unlock the found filemon structure. */ + filemon_filemon_unlock(filemon); - /* Unlock the found filemon structure. */ - filemon_filemon_unlock(filemon); - } + free(freepath, M_TEMP); } - - return (ret); } -#endif static int filemon_wrapper_open(struct thread *td, struct open_args *uap) @@ -550,7 +523,6 @@ filemon_wrapper_install(void) #endif sv_table[SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir; - sv_table[SYS_execve].sy_call = (sy_call_t *) filemon_wrapper_execve; sv_table[SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; sv_table[SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat; sv_table[SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename; @@ -566,7 +538,6 @@ filemon_wrapper_install(void) sv_table = ia32_freebsd_sysvec.sv_table; sv_table[FREEBSD32_SYS_chdir].sy_call = (sy_call_t *) filemon_wrapper_chdir; - sv_table[FREEBSD32_SYS_freebsd32_execve].sy_call = (sy_call_t *) filemon_wrapper_freebsd32_execve; sv_table[FREEBSD32_SYS_open].sy_call = (sy_call_t *) filemon_wrapper_open; sv_table[FREEBSD32_SYS_openat].sy_call = (sy_call_t *) filemon_wrapper_openat; sv_table[FREEBSD32_SYS_rename].sy_call = (sy_call_t *) filemon_wrapper_rename; @@ -579,6
svn commit: r295009 - in head: crypto/openssl crypto/openssl/apps crypto/openssl/crypto crypto/openssl/crypto/aes crypto/openssl/crypto/aes/asm crypto/openssl/crypto/bio crypto/openssl/crypto/bn cr...
Author: jkim Date: Thu Jan 28 20:15:22 2016 New Revision: 295009 URL: https://svnweb.freebsd.org/changeset/base/295009 Log: Merge OpenSSL 1.0.2f. Relnotes: yes Added: head/crypto/openssl/doc/ssl/SSL_CTX_set_tlsext_status_cb.pod - copied unchanged from r295001, vendor-crypto/openssl/dist/doc/ssl/SSL_CTX_set_tlsext_status_cb.pod head/crypto/openssl/util/pod2mantest - copied unchanged from r295001, vendor-crypto/openssl/dist/util/pod2mantest head/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3 (contents, props changed) Modified: head/crypto/openssl/ACKNOWLEDGMENTS head/crypto/openssl/CHANGES head/crypto/openssl/Configure head/crypto/openssl/INSTALL head/crypto/openssl/LICENSE head/crypto/openssl/Makefile head/crypto/openssl/Makefile.org head/crypto/openssl/NEWS head/crypto/openssl/README head/crypto/openssl/apps/engine.c head/crypto/openssl/apps/ocsp.c head/crypto/openssl/apps/pkcs12.c head/crypto/openssl/apps/pkeyutl.c head/crypto/openssl/apps/s_client.c head/crypto/openssl/apps/s_server.c head/crypto/openssl/apps/speed.c head/crypto/openssl/apps/x509.c head/crypto/openssl/crypto/aes/aes.h head/crypto/openssl/crypto/aes/aes_cbc.c head/crypto/openssl/crypto/aes/aes_cfb.c head/crypto/openssl/crypto/aes/aes_core.c head/crypto/openssl/crypto/aes/aes_ctr.c head/crypto/openssl/crypto/aes/aes_ecb.c head/crypto/openssl/crypto/aes/aes_ige.c head/crypto/openssl/crypto/aes/aes_locl.h head/crypto/openssl/crypto/aes/aes_misc.c head/crypto/openssl/crypto/aes/aes_ofb.c head/crypto/openssl/crypto/aes/aes_x86core.c head/crypto/openssl/crypto/aes/asm/aesni-mb-x86_64.pl head/crypto/openssl/crypto/aes/asm/aesni-sha1-x86_64.pl head/crypto/openssl/crypto/aes/asm/aesni-sha256-x86_64.pl head/crypto/openssl/crypto/bio/bio.h head/crypto/openssl/crypto/bio/bss_bio.c head/crypto/openssl/crypto/bio/bss_conn.c head/crypto/openssl/crypto/bio/bss_dgram.c head/crypto/openssl/crypto/bn/asm/rsaz-x86_64.pl head/crypto/openssl/crypto/bn/asm/x86_64-mont.pl head/crypto/openssl/crypto/bn/asm/x86_64-mont5.pl head/crypto/openssl/crypto/bn/bn_exp.c head/crypto/openssl/crypto/bn/exptest.c head/crypto/openssl/crypto/camellia/camellia.c head/crypto/openssl/crypto/camellia/camellia.h head/crypto/openssl/crypto/camellia/cmll_cbc.c head/crypto/openssl/crypto/camellia/cmll_cfb.c head/crypto/openssl/crypto/camellia/cmll_ctr.c head/crypto/openssl/crypto/camellia/cmll_ecb.c head/crypto/openssl/crypto/camellia/cmll_locl.h head/crypto/openssl/crypto/camellia/cmll_misc.c head/crypto/openssl/crypto/camellia/cmll_ofb.c head/crypto/openssl/crypto/camellia/cmll_utl.c head/crypto/openssl/crypto/des/des_old.c head/crypto/openssl/crypto/des/des_old.h head/crypto/openssl/crypto/des/des_old2.c head/crypto/openssl/crypto/dh/dh.h head/crypto/openssl/crypto/dh/dh_check.c head/crypto/openssl/crypto/dh/dhtest.c head/crypto/openssl/crypto/dsa/dsa_ossl.c head/crypto/openssl/crypto/dso/dso.h head/crypto/openssl/crypto/dso/dso_dl.c head/crypto/openssl/crypto/dso/dso_dlfcn.c head/crypto/openssl/crypto/dso/dso_lib.c head/crypto/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl head/crypto/openssl/crypto/ec/ec2_smpl.c head/crypto/openssl/crypto/ec/ec_key.c head/crypto/openssl/crypto/ec/ecp_nistz256_table.c head/crypto/openssl/crypto/ec/ectest.c head/crypto/openssl/crypto/engine/eng_all.c head/crypto/openssl/crypto/evp/e_camellia.c head/crypto/openssl/crypto/evp/e_old.c head/crypto/openssl/crypto/evp/e_seed.c head/crypto/openssl/crypto/mem_clr.c head/crypto/openssl/crypto/modes/asm/aesni-gcm-x86_64.pl head/crypto/openssl/crypto/modes/asm/ghash-x86_64.pl head/crypto/openssl/crypto/o_dir.c head/crypto/openssl/crypto/o_dir.h head/crypto/openssl/crypto/o_dir_test.c head/crypto/openssl/crypto/o_str.c head/crypto/openssl/crypto/o_str.h head/crypto/openssl/crypto/o_time.c head/crypto/openssl/crypto/o_time.h head/crypto/openssl/crypto/opensslv.h head/crypto/openssl/crypto/rc4/rc4_utl.c head/crypto/openssl/crypto/rsa/rsa_chk.c head/crypto/openssl/crypto/rsa/rsa_sign.c head/crypto/openssl/crypto/seed/seed_cbc.c head/crypto/openssl/crypto/seed/seed_cfb.c head/crypto/openssl/crypto/seed/seed_ecb.c head/crypto/openssl/crypto/seed/seed_ofb.c head/crypto/openssl/crypto/sha/asm/sha1-mb-x86_64.pl head/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl head/crypto/openssl/crypto/sha/asm/sha256-mb-x86_64.pl head/crypto/openssl/crypto/sha/asm/sha512-x86_64.pl head/crypto/openssl/crypto/sha/sha1test.c head/crypto/openssl/crypto/store/store.h head/crypto/openssl/crypto/store/str_lib.c head/crypto/openssl/crypto/store/str_locl.h head/crypto/openssl/crypto/store/str_mem.c head/crypto/openssl/crypto/store/str_meth.c head/crypto/openssl/crypto/ts/ts_rsp_verify.c head/crypto/openssl/crypto/ui/ui.h head/crypto/openssl/crypto/ui/ui_compat.c head/crypto/openssl/crypto/ui/ui_compat.h
svn commit: r295012 - in head: sys/kern sys/sys tests/sys/kqueue
Author: vangyzen Date: Thu Jan 28 20:24:15 2016 New Revision: 295012 URL: https://svnweb.freebsd.org/changeset/base/295012 Log: kqueue EVFILT_PROC: avoid collision between NOTE_CHILD and NOTE_EXIT NOTE_CHILD and NOTE_EXIT return something in kevent.data: the parent pid (ppid) for NOTE_CHILD and the exit status for NOTE_EXIT. Do not let the two events be combined, since one would overwrite the other's data. PR: 180385 Submitted by: David A. BrightReviewed by: jhb MFC after:1 month Sponsored by: Dell Inc. Differential Revision:https://reviews.freebsd.org/D4900 Modified: head/sys/kern/kern_event.c head/sys/sys/event.h head/tests/sys/kqueue/common.h head/tests/sys/kqueue/main.c head/tests/sys/kqueue/proc.c Modified: head/sys/kern/kern_event.c == --- head/sys/kern/kern_event.c Thu Jan 28 20:21:15 2016(r295011) +++ head/sys/kern/kern_event.c Thu Jan 28 20:24:15 2016(r295012) @@ -373,11 +373,21 @@ filt_procattach(struct knote *kn) kn->kn_flags |= EV_CLEAR; /* automatically set */ /* -* internal flag indicating registration done by kernel +* Internal flag indicating registration done by kernel for the +* purposes of getting a NOTE_CHILD notification. */ - if (kn->kn_flags & EV_FLAG1) { + if (kn->kn_flags & EV_FLAG2) { + kn->kn_flags &= ~EV_FLAG2; kn->kn_data = kn->kn_sdata; /* ppid */ kn->kn_fflags = NOTE_CHILD; +kn->kn_sfflags &= ~NOTE_EXIT; + immediate = 1; /* Force immediate activation of child note. */ + } + /* +* Internal flag indicating registration done by kernel (for other than +* NOTE_CHILD). +*/ + if (kn->kn_flags & EV_FLAG1) { kn->kn_flags &= ~EV_FLAG1; } @@ -385,9 +395,10 @@ filt_procattach(struct knote *kn) knlist_add(>p_klist, kn, 1); /* -* Immediately activate any exit notes if the target process is a -* zombie. This is necessary to handle the case where the target -* process, e.g. a child, dies before the kevent is registered. +* Immediately activate any child notes or, in the case of a zombie +* target process, exit notes. The latter is necessary to handle the +* case where the target process, e.g. a child, dies before the kevent +* is registered. */ if (immediate && filt_proc(kn, NOTE_EXIT)) KNOTE_ACTIVATE(kn, 0); @@ -495,7 +506,7 @@ knote_fork(struct knlist *list, int pid) /* * The NOTE_TRACK case. In addition to the activation -* of the event, we need to register new event to +* of the event, we need to register new events to * track the child. Drop the locks in preparation for * the call to kqueue_register(). */ @@ -504,8 +515,27 @@ knote_fork(struct knlist *list, int pid) list->kl_unlock(list->kl_lockarg); /* -* Activate existing knote and register a knote with +* Activate existing knote and register tracking knotes with * new process. +* +* First register a knote to get just the child notice. This +* must be a separate note from a potential NOTE_EXIT +* notification since both NOTE_CHILD and NOTE_EXIT are defined +* to use the data field (in conflicting ways). +*/ + kev.ident = pid; + kev.filter = kn->kn_filter; + kev.flags = kn->kn_flags | EV_ADD | EV_ENABLE | EV_ONESHOT | EV_FLAG2; + kev.fflags = kn->kn_sfflags; + kev.data = kn->kn_id; /* parent */ + kev.udata = kn->kn_kevent.udata;/* preserve udata */ + error = kqueue_register(kq, , NULL, 0); + if (error) + kn->kn_fflags |= NOTE_TRACKERR; + + /* +* Then register another knote to track other potential events +* from the new process. */ kev.ident = pid; kev.filter = kn->kn_filter; @@ -1129,7 +1159,7 @@ findkn: if (fp->f_type == DTYPE_KQUEUE) { /* -* if we add some inteligence about what we are doing, +* If we add some intelligence about what we are doing, * we should be able to support events on ourselves. * We need to know when we are doing this to prevent * getting both the knlist lock and the kq lock since @@ -1161,7
svn commit: r295028 - head/lib/libbluetooth
Author: brooks Date: Fri Jan 29 00:59:48 2016 New Revision: 295028 URL: https://svnweb.freebsd.org/changeset/base/295028 Log: Declare bt_devenum() to match the definition. Obtained from:CheriBSD (1c1dad87ef9983a4ca0c7d6eb0792d489436bcd1) MFC after:1 week Sponsored by: DARPA, AFRL Modified: head/lib/libbluetooth/bluetooth.h Modified: head/lib/libbluetooth/bluetooth.h == --- head/lib/libbluetooth/bluetooth.h Fri Jan 29 00:44:32 2016 (r295027) +++ head/lib/libbluetooth/bluetooth.h Fri Jan 29 00:59:48 2016 (r295028) @@ -178,7 +178,7 @@ int bt_devfilter_evt_tst(struct bt_devf intbt_devinquiry(char const *devname, time_t length, int num_rsp, struct bt_devinquiry **ii); intbt_devinfo (struct bt_devinfo *di); -intbt_devenum (bt_devenum_cb_t *cb, void *arg); +intbt_devenum (bt_devenum_cb_t cb, void *arg); /* * bdaddr utility functions (from NetBSD) ___ 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-unsubscr...@freebsd.org"
svn commit: r295029 - head/share/man/man4
Author: bdrewery Date: Fri Jan 29 01:00:12 2016 New Revision: 295029 URL: https://svnweb.freebsd.org/changeset/base/295029 Log: Document the purpose and non-purpose of filemon(4). MFC after:2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/filemon.4 Modified: head/share/man/man4/filemon.4 == --- head/share/man/man4/filemon.4 Fri Jan 29 00:59:48 2016 (r295028) +++ head/share/man/man4/filemon.4 Fri Jan 29 01:00:12 2016 (r295029) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2013 +.Dd January 28, 2016 .Dt FILEMON 4 .Os .Sh NAME @@ -49,6 +49,18 @@ responds to two .Xr ioctl 2 calls. .Pp +.Nm +is not intended to be a security auditing tool. +Many syscalls are not tracked and binaries of foreign ABI will not be fully +audited. +It is intended for auditing of processes for the purpose of determining its +dependencies in an efficient and easily parsable format. +An example of this is +.Xr make 1 +which uses this module with +.Sy .MAKE.MODE=meta +to handle incremental builds more smartly. +.Pp System calls are denoted using the following single letters: .Pp .Bl -tag -width indent -compact @@ -173,3 +185,7 @@ A .Nm device appeared in .Fx 9.1 . +.Sh BUGS +Loading +.Nm +may reduce system performance for the noted syscalls. ___ 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-unsubscr...@freebsd.org"
svn commit: r295031 - head/lib/libc/db/hash
Author: brooks Date: Fri Jan 29 01:22:12 2016 New Revision: 295031 URL: https://svnweb.freebsd.org/changeset/base/295031 Log: Use intptr_t note ptrdiff_t when storing flags in the bottom bits of pointers. Obtained from:CheriBSD (e3a69027cc5a384431156d61c90d4304387a9b9d) Sponsored by: DARPA, AFRL Modified: head/lib/libc/db/hash/hash.h head/lib/libc/db/hash/hash_buf.c Modified: head/lib/libc/db/hash/hash.h == --- head/lib/libc/db/hash/hash.hFri Jan 29 01:09:04 2016 (r295030) +++ head/lib/libc/db/hash/hash.hFri Jan 29 01:22:12 2016 (r295031) @@ -138,11 +138,11 @@ typedef struct htab{ /* Memory reside #define ALL_SET((u_int32_t)0x) #define ALL_CLEAR 0 -#define PTROF(X) ((BUFHEAD *)((ptrdiff_t)(X)&~0x3)) -#define ISMOD(X) ((u_int32_t)(ptrdiff_t)(X)&0x1) -#define DOMOD(X) ((X) = (char *)((ptrdiff_t)(X)|0x1)) -#define ISDISK(X) ((u_int32_t)(ptrdiff_t)(X)&0x2) -#define DODISK(X) ((X) = (char *)((ptrdiff_t)(X)|0x2)) +#define PTROF(X) ((BUFHEAD *)((intptr_t)(X)&~0x3)) +#define ISMOD(X) ((u_int32_t)(intptr_t)(X)&0x1) +#define DOMOD(X) ((X) = (char *)((intptr_t)(X)|0x1)) +#define ISDISK(X) ((u_int32_t)(intptr_t)(X)&0x2) +#define DODISK(X) ((X) = (char *)((intptr_t)(X)|0x2)) #define BITS_PER_MAP 32 Modified: head/lib/libc/db/hash/hash_buf.c == --- head/lib/libc/db/hash/hash_buf.cFri Jan 29 01:09:04 2016 (r295030) +++ head/lib/libc/db/hash/hash_buf.cFri Jan 29 01:22:12 2016 (r295031) @@ -138,7 +138,7 @@ __get_buf(HTAB *hashp, u_int32_t addr, return (NULL); if (!prev_bp) segp[segment_ndx] = - (BUFHEAD *)((ptrdiff_t)bp | is_disk_mask); + (BUFHEAD *)((intptr_t)bp | is_disk_mask); } else { BUF_REMOVE(bp); MRU_INSERT(bp); ___ 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-unsubscr...@freebsd.org"
svn commit: r295027 - head/sys/dev/filemon
Author: bdrewery Date: Fri Jan 29 00:44:32 2016 New Revision: 295027 URL: https://svnweb.freebsd.org/changeset/base/295027 Log: filemon: Track the process pointer rather than a pid. The process is not held since the process_exit hook is called after the exithold. There is no need to hold the process since the hook will always see it exiting via the process_exit event. MFC after:2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c head/sys/dev/filemon/filemon_wrapper.c Modified: head/sys/dev/filemon/filemon.c == --- head/sys/dev/filemon/filemon.c Fri Jan 29 00:44:28 2016 (r295026) +++ head/sys/dev/filemon/filemon.c Fri Jan 29 00:44:32 2016 (r295027) @@ -89,7 +89,7 @@ struct filemon { TAILQ_ENTRY(filemon) link; /* Link into the in-use list. */ struct sx lock; /* Lock mutex for this filemon. */ struct file *fp;/* Output file pointer. */ - pid_t pid;/* The process ID being monitored. */ + struct proc *p; /* The process being monitored. */ charfname1[MAXPATHLEN]; /* Temporary filename buffer. */ charfname2[MAXPATHLEN]; /* Temporary filename buffer. */ charmsgbufr[1024]; /* Output message buffer. */ @@ -137,7 +137,7 @@ filemon_dtr(void *data) fp = filemon->fp; filemon->fp = NULL; - filemon->pid = -1; + filemon->p = NULL; /* Add to the free list. */ TAILQ_INSERT_TAIL(_free, filemon, link); @@ -188,7 +188,7 @@ filemon_ioctl(struct cdev *dev, u_long c error = pget(*((pid_t *)data), PGET_CANDEBUG | PGET_NOTWEXIT, ); if (error == 0) { - filemon->pid = p->p_pid; + filemon->p = p; PROC_UNLOCK(p); } break; @@ -221,7 +221,6 @@ filemon_open(struct cdev *dev, int oflag filemon = malloc(sizeof(struct filemon), M_FILEMON, M_WAITOK | M_ZERO); sx_init(>lock, "filemon"); - filemon->pid = -1; } devfs_set_cdevpriv(filemon, filemon_dtr); Modified: head/sys/dev/filemon/filemon_wrapper.c == --- head/sys/dev/filemon/filemon_wrapper.c Fri Jan 29 00:44:28 2016 (r295026) +++ head/sys/dev/filemon/filemon_wrapper.c Fri Jan 29 00:44:32 2016 (r295027) @@ -98,7 +98,7 @@ filemon_pid_check(struct proc *p) sx_slock(_lock); while (p != initproc) { TAILQ_FOREACH(filemon, _inuse, link) { - if (p->p_pid == filemon->pid) { + if (p == filemon->p) { sx_sunlock(_lock); filemon_filemon_lock(filemon); filemon_unlock_read(); @@ -452,14 +452,14 @@ filemon_event_process_exit(void *arg __u filemon_output(filemon, filemon->msgbufr, len); /* Check if the monitored process is about to exit. */ - if (filemon->pid == p->p_pid) { + if (filemon->p == p) { len = snprintf(filemon->msgbufr, sizeof(filemon->msgbufr), "# Stop %ju.%06ju\n# Bye bye\n", (uintmax_t)now.tv_sec, (uintmax_t)now.tv_usec); filemon_output(filemon, filemon->msgbufr, len); - filemon->pid = -1; + filemon->p = NULL; } /* Unlock the found filemon structure. */ ___ 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-unsubscr...@freebsd.org"
svn commit: r295026 - head/sys/dev/filemon
Author: bdrewery Date: Fri Jan 29 00:44:28 2016 New Revision: 295026 URL: https://svnweb.freebsd.org/changeset/base/295026 Log: filemon_open: Don't record a process to trace here. Only ioctl(FILEMON_SET_PID) should be setting the process-to-be-traced. MFC after:2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/filemon/filemon.c Modified: head/sys/dev/filemon/filemon.c == --- head/sys/dev/filemon/filemon.c Fri Jan 29 00:29:32 2016 (r295025) +++ head/sys/dev/filemon/filemon.c Fri Jan 29 00:44:28 2016 (r295026) @@ -221,10 +221,9 @@ filemon_open(struct cdev *dev, int oflag filemon = malloc(sizeof(struct filemon), M_FILEMON, M_WAITOK | M_ZERO); sx_init(>lock, "filemon"); + filemon->pid = -1; } - filemon->pid = curproc->p_pid; - devfs_set_cdevpriv(filemon, filemon_dtr); /* Get exclusive write access. */ ___ 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-unsubscr...@freebsd.org"
svn commit: r295030 - head/share/man/man4
Author: bdrewery Date: Fri Jan 29 01:09:04 2016 New Revision: 295030 URL: https://svnweb.freebsd.org/changeset/base/295030 Log: Note the double fork behavior with filemon. X-MFC-With: r295029 MFC after:2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/filemon.4 Modified: head/share/man/man4/filemon.4 == --- head/share/man/man4/filemon.4 Fri Jan 29 01:00:12 2016 (r295029) +++ head/share/man/man4/filemon.4 Fri Jan 29 01:09:04 2016 (r295030) @@ -189,3 +189,8 @@ device appeared in Loading .Nm may reduce system performance for the noted syscalls. +.Pp +Only children of the set process are logged. +Processes can escape being traced by double forking. +This is not seen as a problem as the intended use is build monitoring, which +does not make sense to have daemons for. ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r294909 - head/crypto/openssh
On 01/28/16 01:07, Dag-Erling Smørgrav wrote: > NGie Cooperwrites: >> Dag-Erling Smørgrav writes: >>> Log: >>> Switch UseDNS back on >> Please add "Relnotes: yes" to the MFC commit, if this is MFCed. > > Why? At a guess, because NGie thinks that this is something which is important enough to be worth mentioning in the FreeBSD release notes, and "Relnotes: yes" flags the commit to the release engineering team for that purpose? -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid ___ 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-unsubscr...@freebsd.org"
Re: svn commit: r294909 - head/crypto/openssh
NGie Cooperwrites: > Dag-Erling Smørgrav writes: > > Log: > > Switch UseDNS back on > Please add "Relnotes: yes" to the MFC commit, if this is MFCed. Why? DES -- Dag-Erling Smørgrav - d...@des.no ___ 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-unsubscr...@freebsd.org"
svn commit: r294983 - head/sys/ufs/ffs
Author: trasz Date: Thu Jan 28 12:21:23 2016 New Revision: 294983 URL: https://svnweb.freebsd.org/changeset/base/294983 Log: Remove ffs_mountroot() prototype; seems to be long gone. MFC after:1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/ufs/ffs/ffs_extern.h Modified: head/sys/ufs/ffs/ffs_extern.h == --- head/sys/ufs/ffs/ffs_extern.h Thu Jan 28 12:15:50 2016 (r294982) +++ head/sys/ufs/ffs/ffs_extern.h Thu Jan 28 12:21:23 2016 (r294983) @@ -77,7 +77,6 @@ void ffs_fserr(struct fs *, ino_t, char intffs_isblock(struct fs *, u_char *, ufs1_daddr_t); intffs_isfreeblock(struct fs *, u_char *, ufs1_daddr_t); void ffs_load_inode(struct buf *, struct inode *, struct fs *, ino_t); -intffs_mountroot(void); void ffs_oldfscompat_write(struct fs *, struct ufsmount *); intffs_own_mount(const struct mount *mp); intffs_reallocblks(struct vop_reallocblks_args *); ___ 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-unsubscr...@freebsd.org"
svn commit: r294979 - head/sys/arm64/arm64
Author: wma Date: Thu Jan 28 12:00:17 2016 New Revision: 294979 URL: https://svnweb.freebsd.org/changeset/base/294979 Log: Fix mutex releasing in ARM64 cpu_switch The code should be comparing pointers, not any data gathered from a blocked_lock. Spotted by:cognet Approved by: zbb, cognet (mentor) Differential revision: https://reviews.freebsd.org/D5100 Modified: head/sys/arm64/arm64/swtch.S Modified: head/sys/arm64/arm64/swtch.S == --- head/sys/arm64/arm64/swtch.SThu Jan 28 09:25:15 2016 (r294978) +++ head/sys/arm64/arm64/swtch.SThu Jan 28 12:00:17 2016 (r294979) @@ -166,9 +166,8 @@ ENTRY(cpu_switch) */ str x2, [x0, #TD_LOCK] #if defined(SCHED_ULE) && defined(SMP) - /* Read the value in blocked_lock */ - ldr x0, =_C_LABEL(blocked_lock) - ldr x2, [x0] + /* Spin if TD_LOCK points to a blocked_lock */ + ldr x2, =_C_LABEL(blocked_lock) 1: ldarx3, [x1, #TD_LOCK] cmp x3, x2 ___ 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-unsubscr...@freebsd.org"
svn commit: r294987 - in head/sys/arm: arm include
Author: zbb Date: Thu Jan 28 12:43:58 2016 New Revision: 294987 URL: https://svnweb.freebsd.org/changeset/base/294987 Log: SMP support for ARMv6/v7 HW watchpoints Use per-CPU structure to store HW watchpoints registers state for each CPU present in the system. Those registers will be restored upon wake up from the STOP state if requested by the debug_monitor code. The method is similar to the one introduced to AMD64. We store all possible 16 registers for HW watchpoints (maximum allowed by the architecture). HW breakpoints are not maintained since they are used for single stepping only. Pointed out by: kib Reviewed by:wma No strong objections from: kib Submitted by: Zbigniew BodekObtained from: Semihalf Sponsored by: Juniper Networks Inc. Differential Revision: https://reviews.freebsd.org/D4338 Modified: head/sys/arm/arm/debug_monitor.c head/sys/arm/arm/mp_machdep.c head/sys/arm/include/debug_monitor.h head/sys/arm/include/pcpu.h head/sys/arm/include/reg.h Modified: head/sys/arm/arm/debug_monitor.c == --- head/sys/arm/arm/debug_monitor.cThu Jan 28 12:25:27 2016 (r294986) +++ head/sys/arm/arm/debug_monitor.cThu Jan 28 12:43:58 2016 (r294987) @@ -35,14 +35,17 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include #include #include #include +#include #include #include @@ -80,7 +83,7 @@ static boolean_t dbg_ossr;/* OS Save an static uint32_t dbg_watchpoint_num; static uint32_t dbg_breakpoint_num; -static int dbg_ref_count_mme[MAXCPU]; /* Times monitor mode was enabled */ +static int dbg_ref_count_mme; /* Times monitor mode was enabled */ /* ID_DFR0 - Debug Feature Register 0 */ #defineID_DFR0_CP_DEBUG_M_SHIFT0 @@ -542,11 +545,9 @@ dbg_enable_monitor(void) { uint32_t dbg_dscr; - /* Already enabled? Just increment reference counter and return */ - if (dbg_monitor_is_enabled()) { - dbg_ref_count_mme[PCPU_GET(cpuid)]++; + /* Already enabled? Just return */ + if (dbg_monitor_is_enabled()) return (0); - } dbg_dscr = cp14_dbgdscrint_get(); @@ -565,10 +566,8 @@ dbg_enable_monitor(void) isb(); /* Verify that Monitor mode is set */ - if (dbg_monitor_is_enabled()) { - dbg_ref_count_mme[PCPU_GET(cpuid)]++; + if (dbg_monitor_is_enabled()) return (0); - } return (ENXIO); } @@ -581,9 +580,6 @@ dbg_disable_monitor(void) if (!dbg_monitor_is_enabled()) return (0); - if (--dbg_ref_count_mme[PCPU_GET(cpuid)] > 0) - return (0); - dbg_dscr = cp14_dbgdscrint_get(); switch (dbg_model) { case ID_DFR0_CP_DEBUG_M_V6: @@ -607,11 +603,13 @@ dbg_disable_monitor(void) static int dbg_setup_xpoint(struct dbg_wb_conf *conf) { + struct pcpu *pcpu; + struct dbreg *d; const char *typestr; uint32_t cr_size, cr_priv, cr_access; uint32_t reg_ctrl, reg_addr, ctrl, addr; boolean_t is_bkpt; - u_int cpuid; + u_int cpuid, cpu; u_int i; int err; @@ -705,20 +703,52 @@ dbg_setup_xpoint(struct dbg_wb_conf *con dbg_wb_write_reg(reg_addr, i, addr); dbg_wb_write_reg(reg_ctrl, i, ctrl); - return (dbg_enable_monitor()); + err = dbg_enable_monitor(); + if (err != 0) + return (err); + + /* Increment monitor enable counter */ + dbg_ref_count_mme++; + + /* +* Save watchpoint settings for all CPUs. +* We don't need to do the same with breakpoints since HW breakpoints +* are only used to perform single stepping. +*/ + if (!is_bkpt) { + CPU_FOREACH(cpu) { + pcpu = pcpu_find(cpu); + /* Fill out the settings for watchpoint */ + d = (struct dbreg *)pcpu->pc_dbreg; + d->dbg_wvr[i] = addr; + d->dbg_wcr[i] = ctrl; + /* Skip update command for the current CPU */ + if (cpu != cpuid) + pcpu->pc_dbreg_cmd = PC_DBREG_CMD_LOAD; + } + } + /* Ensure all data is written before waking other CPUs */ + atomic_thread_fence_rel(); + + return (0); } static int dbg_remove_xpoint(struct dbg_wb_conf *conf) { + struct pcpu *pcpu; + struct dbreg *d; uint32_t reg_ctrl, reg_addr, addr; - u_int cpuid; + boolean_t is_bkpt; + u_int cpuid, cpu; u_int i; int err; if (!dbg_capable) return (ENXIO); + is_bkpt = (conf->type == DBG_TYPE_BREAKPOINT); + cpuid = PCPU_GET(cpuid);
Re: svn commit: r294909 - head/crypto/openssh
Colin Percivalwrites: > At a guess, because NGie thinks that this is something which is important > enough to be worth mentioning in the FreeBSD release notes, and "Relnotes: > yes" flags the commit to the release engineering team for that purpose? UseDNS was (unintentionally) turned off in head last week, I just turned it back on. DES -- Dag-Erling Smørgrav - d...@des.no ___ 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-unsubscr...@freebsd.org"
svn commit: r295032 - head/etc/periodic/security
Author: marius Date: Fri Jan 29 01:54:32 2016 New Revision: 295032 URL: https://svnweb.freebsd.org/changeset/base/295032 Log: Use '^[>+][^+]' instead of '^[>+]' with grep(1) when filtering the diff(1) output between two files in "new_only"-mode. Otherwise, with the default of using unified format a remnant of the header in the output is the result. This is especially irritating when the two files differ but the second one is empty, amounting to the vestige of the header being the only readout. Reported by: Stefan Haemmerl MFC after:3 days Modified: head/etc/periodic/security/security.functions Modified: head/etc/periodic/security/security.functions == --- head/etc/periodic/security/security.functions Fri Jan 29 01:22:12 2016(r295031) +++ head/etc/periodic/security/security.functions Fri Jan 29 01:54:32 2016(r295032) @@ -51,7 +51,7 @@ check_diff() { rc=0 if [ "$1" = "new_only" ]; then shift -filter="grep '^[>+]'" +filter="grep '^[>+][^+]'" else filter="cat" fi ___ 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-unsubscr...@freebsd.org"
svn commit: r294989 - in head/sys: arm/freescale/vybrid arm/xilinx dev/usb/controller mips/atheros powerpc/ps3
Author: mmel Date: Thu Jan 28 14:11:59 2016 New Revision: 294989 URL: https://svnweb.freebsd.org/changeset/base/294989 Log: EHCI: Make core reset and port speed reading more generic. Use driver settable callbacks for handling of: - core post reset - reading actual port speed Typically, OTG enabled EHCI cores wants setting of USBMODE register, but this register is not defined in EHCI specification and different cores can have it on different offset. Also, for cores with TT extension, actual port speed must be determinable. But again, EHCI specification not covers this so this patch provides function for two most common variant of speed bits layout. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D5088 Modified: head/sys/arm/freescale/vybrid/vf_ehci.c head/sys/arm/xilinx/zy7_ehci.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ehci.h head/sys/dev/usb/controller/ehci_ixp4xx.c head/sys/dev/usb/controller/ehci_mv.c head/sys/dev/usb/controller/ehcireg.h head/sys/mips/atheros/ar71xx_ehci.c head/sys/powerpc/ps3/ehci_ps3.c Modified: head/sys/arm/freescale/vybrid/vf_ehci.c == --- head/sys/arm/freescale/vybrid/vf_ehci.c Thu Jan 28 13:32:00 2016 (r294988) +++ head/sys/arm/freescale/vybrid/vf_ehci.c Thu Jan 28 14:11:59 2016 (r294989) @@ -169,6 +169,18 @@ static devclass_t ehci_devclass; DRIVER_MODULE(ehci, simplebus, ehci_driver, ehci_devclass, 0, 0); MODULE_DEPEND(ehci, usb, 1, 1, 1); +static void +vybrid_ehci_post_reset(struct ehci_softc *ehci_softc) +{ + uint32_t usbmode; + + /* Force HOST mode */ + usbmode = EOREAD4(ehci_softc, EHCI_USBMODE_NOLPM); + usbmode &= ~EHCI_UM_CM; + usbmode |= EHCI_UM_CM_HOST; + EOWRITE4(ehci_softc, EHCI_USBMODE_NOLPM, usbmode); +} + /* * Public methods */ @@ -343,8 +355,10 @@ vybrid_ehci_attach(device_t dev) reg |= 0x3; bus_space_write_4(sc->sc_io_tag, sc->sc_io_hdl, 0xA8, reg); - /* Set flags */ - sc->sc_flags |= EHCI_SCFLG_SETMODE | EHCI_SCFLG_NORESTERM; + /* Set flags and callbacks*/ + sc->sc_flags |= EHCI_SCFLG_TT | EHCI_SCFLG_NORESTERM; + sc->sc_vendor_post_reset = vybrid_ehci_post_reset; + sc->sc_vendor_get_port_speed = ehci_get_port_speed_portsc; err = ehci_init(sc); if (!err) { Modified: head/sys/arm/xilinx/zy7_ehci.c == --- head/sys/arm/xilinx/zy7_ehci.c Thu Jan 28 13:32:00 2016 (r294988) +++ head/sys/arm/xilinx/zy7_ehci.c Thu Jan 28 14:11:59 2016 (r294989) @@ -138,6 +138,18 @@ __FBSDID("$FreeBSD$"); #define EHCI_REG_OFFSETZY7_USB_CAPLENGTH_HCIVERSION #define EHCI_REG_SIZE 0x100 +static void +zy7_ehci_post_reset(struct ehci_softc *ehci_softc) +{ + uint32_t usbmode; + + /* Force HOST mode */ + usbmode = EOREAD4(ehci_softc, EHCI_USBMODE_NOLPM); + usbmode &= ~EHCI_UM_CM; + usbmode |= EHCI_UM_CM_HOST; + EOWRITE4(ehci_softc, EHCI_USBMODE_NOLPM, usbmode); +} + static int zy7_phy_config(device_t dev, bus_space_tag_t io_tag, bus_space_handle_t bsh) { @@ -275,8 +287,9 @@ zy7_ehci_attach(device_t dev) } /* Customization. */ - sc->sc_flags |= EHCI_SCFLG_SETMODE | EHCI_SCFLG_TT | - EHCI_SCFLG_NORESTERM; + sc->sc_flags |= EHCI_SCFLG_TT | EHCI_SCFLG_NORESTERM; + sc->sc_vendor_post_reset = zy7_ehci_post_reset; + sc->sc_vendor_get_port_speed = ehci_get_port_speed_portsc; /* Modify FIFO burst threshold from 2 to 8. */ bus_space_write_4(sc->sc_io_tag, bsh, Modified: head/sys/dev/usb/controller/ehci.c == --- head/sys/dev/usb/controller/ehci.c Thu Jan 28 13:32:00 2016 (r294988) +++ head/sys/dev/usb/controller/ehci.c Thu Jan 28 14:11:59 2016 (r294989) @@ -189,24 +189,8 @@ ehci_reset(ehci_softc_t *sc) usb_pause_mtx(NULL, hz / 128); hcr = EOREAD4(sc, EHCI_USBCMD) & EHCI_CMD_HCRESET; if (!hcr) { - if (sc->sc_flags & (EHCI_SCFLG_SETMODE | EHCI_SCFLG_BIGEMMIO)) { - /* -* Force USBMODE as requested. Controllers -* may have multiple operating modes. -*/ - uint32_t usbmode = EOREAD4(sc, EHCI_USBMODE); - if (sc->sc_flags & EHCI_SCFLG_SETMODE) { - usbmode = (usbmode &~ EHCI_UM_CM) | EHCI_UM_CM_HOST; - device_printf(sc->sc_bus.bdev, - "set host controller mode\n"); - } -