svn commit: r307152 - head/sys/mips/conf
Author: emaste Date: Wed Oct 12 18:49:30 2016 New Revision: 307152 URL: https://svnweb.freebsd.org/changeset/base/307152 Log: Add COMPAT_FREEBSD10 to the MIPS ERL kernel config As of r302092, pipe is a wrapper around pipe2 and the pipe syscall is no longer used. It is included only with the COMPAT_FREEBSD10 kernel option. Add the compat option to support upgrades from systems with an earlier userland. MFC after:1 week Modified: head/sys/mips/conf/ERL Modified: head/sys/mips/conf/ERL == --- head/sys/mips/conf/ERL Wed Oct 12 17:10:59 2016(r307151) +++ head/sys/mips/conf/ERL Wed Oct 12 18:49:30 2016(r307152) @@ -74,6 +74,7 @@ options PSEUDOFS# Pseudo-filesystem f optionsGEOM_PART_GPT # GUID Partition Tables. optionsGEOM_LABEL # Provides labelization optionsCOMPAT_FREEBSD32# Compatible with o32 binaries +optionsCOMPAT_FREEBSD10# Compatible with FreeBSD10 optionsSCSI_DELAY=5000 # Delay (in ms) before probing SCSI optionsKTRACE # ktrace(1) support optionsSTACK # stack(9) support ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307154 - head/sys/dev/usb/net
Author: gonzo Date: Wed Oct 12 19:53:10 2016 New Revision: 307154 URL: https://svnweb.freebsd.org/changeset/base/307154 Log: [fdt] Add one more heuristic to determine MAC address of the SMSC device - If check for net,ethernet/usb,device compatible node fails, try to find .../usb/hub/ethernet, where ... is bus path that can depend on actual HW. net,ethernet/usb,device compatibity strings are FreeBSD custom invention that is used only in RPi DTBs and since there is no other way to tie USB device to FDT node we just do our best effort here to work with upstream device tree - Use -1 value to indicate invalid phandle_t, 0 is valid phandle value and shouldn't be used as error signal Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c == --- head/sys/dev/usb/net/if_smsc.c Wed Oct 12 19:06:50 2016 (r307153) +++ head/sys/dev/usb/net/if_smsc.c Wed Oct 12 19:53:10 2016 (r307154) @@ -1556,6 +1556,9 @@ smsc_ioctl(struct ifnet *ifp, u_long cmd } #ifdef FDT +/* + * This is FreeBSD-specific compatibility strings for RPi/RPi2 + */ static phandle_t smsc_fdt_find_eth_node(phandle_t start) { @@ -1567,11 +1570,68 @@ smsc_fdt_find_eth_node(phandle_t start) fdt_is_compatible(node, "usb,device")) return (node); child = smsc_fdt_find_eth_node(node); - if (child != 0) + if (child != -1) return (child); } - return (0); + return (-1); +} + +/* + * Check if node's path is <*>/usb/hub/ethernet + */ +static int +smsc_fdt_is_usb_eth(phandle_t node) +{ + char name[16]; + int len; + + memset(name, 0, sizeof(name)); + len = OF_getprop(node, "name", name, sizeof(name)); + if (len <= 0) + return (0); + + if (strcmp(name, "ethernet")) + return (0); + + node = OF_parent(node); + if (node == -1) + return (0); + len = OF_getprop(node, "name", name, sizeof(name)); + if (len <= 0) + return (0); + + if (strcmp(name, "hub")) + return (0); + + node = OF_parent(node); + if (node == -1) + return (0); + len = OF_getprop(node, "name", name, sizeof(name)); + if (len <= 0) + return (0); + + if (strcmp(name, "usb")) + return (0); + + return (1); +} + +static phandle_t +smsc_fdt_find_eth_node_by_path(phandle_t start) +{ + phandle_t child, node; + + /* Traverse through entire tree to find usb ethernet nodes. */ + for (node = OF_child(start); node != 0; node = OF_peer(node)) { + if (smsc_fdt_is_usb_eth(node)) + return (node); + child = smsc_fdt_find_eth_node_by_path(node); + if (child != -1) + return (child); + } + + return (-1); } /** @@ -1587,8 +1647,14 @@ smsc_fdt_find_mac(unsigned char *mac) root = OF_finddevice("/"); node = smsc_fdt_find_eth_node(root); - if (node != 0) { + /* +* If it's not FreeBSD FDT blob for RPi, try more +* generic .../usb/hub/ethernet +*/ + if (node == -1) + node = smsc_fdt_find_eth_node_by_path(root); + if (node != -1) { /* Check if there is property */ if ((len = OF_getproplen(node, "local-mac-address")) > 0) { if (len != ETHER_ADDR_LEN) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307157 - head/usr.sbin
Author: emaste Date: Wed Oct 12 20:25:03 2016 New Revision: 307157 URL: https://svnweb.freebsd.org/changeset/base/307157 Log: Temporarily disconnect efivar to fix arm and i386 builds Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile == --- head/usr.sbin/Makefile Wed Oct 12 20:24:33 2016(r307156) +++ head/usr.sbin/Makefile Wed Oct 12 20:25:03 2016(r307157) @@ -123,7 +123,7 @@ SUBDIR.${MK_BSNMP}+=bsnmpd SUBDIR.${MK_CTM}+= ctm SUBDIR.${MK_DIALOG}+= tzsetup SUBDIR.${MK_DIALOG}+= bsdconfig -SUBDIR.${MK_EFI}+= efivar +#SUBDIR.${MK_EFI}+=efivar SUBDIR.${MK_FLOPPY}+= fdcontrol SUBDIR.${MK_FLOPPY}+= fdformat SUBDIR.${MK_FLOPPY}+= fdread ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307158 - in head/sys: dev/iwm dev/otus dev/usb/wlan net80211
Author: avos Date: Wed Oct 12 20:50:13 2016 New Revision: 307158 URL: https://svnweb.freebsd.org/changeset/base/307158 Log: net80211: convert all ieee80211_input_mimo*() consumers to ieee80211_add_rx_params() + drop last (ieee80211_rx_stats) parameter Note: there is an additional check for ieee80211_get_rx_params() return value (which does not exist in the original diff). Reviewed by: adrian Differential Revision:https://reviews.freebsd.org/D8207 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/otus/if_otus.c head/sys/dev/usb/wlan/if_rsu.c head/sys/net80211/ieee80211_input.c head/sys/net80211/ieee80211_proto.h Modified: head/sys/dev/iwm/if_iwm.c == --- head/sys/dev/iwm/if_iwm.c Wed Oct 12 20:25:03 2016(r307157) +++ head/sys/dev/iwm/if_iwm.c Wed Oct 12 20:50:13 2016(r307158) @@ -2977,6 +2977,8 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, /* rssi is in 1/2db units */ rxs.c_rssi = rssi * 2; rxs.c_nf = sc->sc_noise; + if (ieee80211_add_rx_params(m, ) == 0) + goto fail; if (ieee80211_radiotap_active_vap(vap)) { struct iwm_rx_radiotap_header *tap = >sc_rxtap; @@ -3013,11 +3015,11 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, IWM_UNLOCK(sc); if (ni != NULL) { IWM_DPRINTF(sc, IWM_DEBUG_RECV, "input m %p\n", m); - ieee80211_input_mimo(ni, m, ); + ieee80211_input_mimo(ni, m); ieee80211_free_node(ni); } else { IWM_DPRINTF(sc, IWM_DEBUG_RECV, "inputall m %p\n", m); - ieee80211_input_mimo_all(ic, m, ); + ieee80211_input_mimo_all(ic, m); } IWM_LOCK(sc); Modified: head/sys/dev/otus/if_otus.c == --- head/sys/dev/otus/if_otus.c Wed Oct 12 20:25:03 2016(r307157) +++ head/sys/dev/otus/if_otus.c Wed Oct 12 20:50:13 2016(r307158) @@ -1713,7 +1713,10 @@ otus_sub_rxeof(struct otus_softc *sc, ui rxs.c_nf = sc->sc_nf[0];/* XXX chain 0 != combined rssi/nf */ rxs.c_rssi = tail->rssi; /* XXX TODO: add MIMO RSSI/NF as well */ - ieee80211_add_rx_params(m, ); + if (ieee80211_add_rx_params(m, ) == 0) { + counter_u64_add(ic->ic_ierrors, 1); + return; + } /* XXX make a method */ STAILQ_INSERT_TAIL(>mq_head, m, m_stailqpkt); @@ -1826,10 +1829,10 @@ tr_setup: if (ni != NULL) { if (ni->ni_flags & IEEE80211_NODE_HT) m->m_flags |= M_AMPDU; - (void)ieee80211_input_mimo(ni, m, NULL); + (void)ieee80211_input_mimo(ni, m); ieee80211_free_node(ni); } else - (void)ieee80211_input_mimo_all(ic, m, NULL); + (void)ieee80211_input_mimo_all(ic, m); } #ifdef IEEE80211_SUPPORT_SUPERG ieee80211_ff_age_all(ic, 100); Modified: head/sys/dev/usb/wlan/if_rsu.c == --- head/sys/dev/usb/wlan/if_rsu.c Wed Oct 12 20:25:03 2016 (r307157) +++ head/sys/dev/usb/wlan/if_rsu.c Wed Oct 12 20:50:13 2016 (r307158) @@ -1536,10 +1536,12 @@ rsu_event_survey(struct rsu_softc *sc, u /* This is a number from 0..100; so let's just divide it down a bit */ rxs.c_rssi = le32toh(bss->rssi) / 2; rxs.c_nf = -96; + if (ieee80211_add_rx_params(m, ) == 0) + return; /* XXX avoid a LOR */ RSU_UNLOCK(sc); - ieee80211_input_mimo_all(ic, m, ); + ieee80211_input_mimo_all(ic, m); RSU_LOCK(sc); } Modified: head/sys/net80211/ieee80211_input.c == --- head/sys/net80211/ieee80211_input.c Wed Oct 12 20:25:03 2016 (r307157) +++ head/sys/net80211/ieee80211_input.c Wed Oct 12 20:50:13 2016 (r307158) @@ -83,18 +83,14 @@ ieee80211_process_mimo(struct ieee80211_ } int -ieee80211_input_mimo(struct ieee80211_node *ni, struct mbuf *m, -struct ieee80211_rx_stats *rx) +ieee80211_input_mimo(struct ieee80211_node *ni, struct mbuf *m) { struct ieee80211_rx_stats rxs; - if (rx) { - memcpy(, rx, sizeof(*rx)); - } else { - /* try to read from mbuf */ - bzero(, sizeof(rxs)); - ieee80211_get_rx_params(m, ); - } + /* try to read stats from mbuf */ + bzero(, sizeof(rxs)); + if (ieee80211_get_rx_params(m, ) != 0) + return (-1); /* XXX should assert IEEE80211_R_NF and IEEE80211_R_RSSI are set
svn commit: r307159 - in head/etc: defaults rc.d
Author: dteske Date: Wed Oct 12 20:50:17 2016 New Revision: 307159 URL: https://svnweb.freebsd.org/changeset/base/307159 Log: Many shops still prefer rc.conf(5) based jail configuration(s). In-part because they can use sysrc in conjunction with ssh and xargs to perform en-masse changes in a large distribution with lots of jails spread over many hosts on a LAN/WAN. Provide a mechanism for disabling the warning eschewed by /etc/rc.d/jail in said situation. If jail_confwarn="NO" is in rc.conf(5) (default "YES") skip the warning that per-jail configurations are obsolete and that the user should migrate to jail.conf(5). Reviewed by: jelischer MFC after:3 days Sponsored by: FIS Global, Inc. Differential Revision:https://reviews.freebsd.org/D7465 Modified: head/etc/defaults/rc.conf head/etc/rc.d/jail Modified: head/etc/defaults/rc.conf == --- head/etc/defaults/rc.conf Wed Oct 12 20:50:13 2016(r307158) +++ head/etc/defaults/rc.conf Wed Oct 12 20:50:17 2016(r307159) @@ -695,6 +695,7 @@ iovctl_files="" # Config files for iovc ### Jail Configuration (see rc.conf(5) manual page) ## ## jail_enable="NO" # Set to NO to disable starting of any jails +jail_confwarn="YES"# Prevent warning about obsolete per-jail configuration jail_parallel_start="NO" # Start jails in the background jail_list="" # Space separated list of names of jails jail_reverse_stop="NO" # Stop jails in reverse order Modified: head/etc/rc.d/jail == --- head/etc/rc.d/jail Wed Oct 12 20:50:13 2016(r307158) +++ head/etc/rc.d/jail Wed Oct 12 20:50:17 2016(r307159) @@ -147,7 +147,8 @@ parse_options() # # To relieve confusion, show a warning message. # - _confwarn=1 + : ${jail_confwarn:=YES} + checkyesno jail_confwarn && _confwarn=1 if [ -r "$jail_conf" -o -r "$_jconf" ]; then if ! checkyesno jail_parallel_start; then warn "$_conf is created and used for jail $_j." ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307132 - head/sys/cam/scsi
Author: mav Date: Wed Oct 12 08:25:13 2016 New Revision: 307132 URL: https://svnweb.freebsd.org/changeset/base/307132 Log: Use copyout() instead of pointing sbuf to user-space buffer. MFC after:2 weeks Modified: head/sys/cam/scsi/scsi_enc_ses.c Modified: head/sys/cam/scsi/scsi_enc_ses.c == --- head/sys/cam/scsi/scsi_enc_ses.cWed Oct 12 07:08:32 2016 (r307131) +++ head/sys/cam/scsi/scsi_enc_ses.cWed Oct 12 08:25:13 2016 (r307132) @@ -2672,13 +2672,13 @@ ses_get_elm_devnames(enc_softc_t *enc, e if (len < 0) return (EINVAL); - sbuf_new(, elmdn->elm_devnames, len, 0); - cam_periph_unlock(enc->periph); + sbuf_new(, NULL, len, SBUF_FIXEDLEN); ses_paths_iter(enc, >enc_cache.elm_map[elmdn->elm_idx], ses_elmdevname_callback, ); sbuf_finish(); elmdn->elm_names_len = sbuf_len(); + copyout(sbuf_data(), elmdn->elm_devnames, elmdn->elm_names_len + 1); cam_periph_lock(enc->periph); return (elmdn->elm_names_len > 0 ? 0 : ENODEV); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307133 - in stable/10/sys/dev/hyperv: include netvsc storvsc utilities vmbus
Author: sephe Date: Wed Oct 12 08:58:03 2016 New Revision: 307133 URL: https://svnweb.freebsd.org/changeset/base/307133 Log: MFC 303421,303422,303470-303473 303421 hyperv/vmbus: Avoid unnecessary mb() Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7333 303422 hyperv/vmbus: Inclusion cleanup Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7334 303470 hyperv/vmbus: Reindent function declarations. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7344 303471 hyperv/vmbus: Forward declare static functions Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7346 303472 hyperv/vmbus: Move driver glue to the beginning of the files Just as most of other drivers do. And move sysinit function close to its SYSINIT. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7347 303473 hyperv/vmbus: Revoke unnecessary exposure of vmbus softc Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7348 Modified: stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/include/hyperv_busdma.h stable/10/sys/dev/hyperv/include/vmbus.h stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c stable/10/sys/dev/hyperv/utilities/hv_shutdown.c stable/10/sys/dev/hyperv/utilities/hv_timesync.c stable/10/sys/dev/hyperv/vmbus/hyperv.c stable/10/sys/dev/hyperv/vmbus/vmbus.c stable/10/sys/dev/hyperv/vmbus/vmbus_br.c stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c stable/10/sys/dev/hyperv/vmbus/vmbus_chanvar.h stable/10/sys/dev/hyperv/vmbus/vmbus_et.c stable/10/sys/dev/hyperv/vmbus/vmbus_var.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/hyperv.h == --- stable/10/sys/dev/hyperv/include/hyperv.h Wed Oct 12 08:25:13 2016 (r307132) +++ stable/10/sys/dev/hyperv/include/hyperv.h Wed Oct 12 08:58:03 2016 (r307133) @@ -28,43 +28,21 @@ * $FreeBSD$ */ -/** - * HyperV definitions for messages that are sent between instances of the - * Channel Management Library in separate partitions, or in some cases, - * back to itself. - */ - -#ifndef __HYPERV_H__ -#define __HYPERV_H__ +#ifndef _HYPERV_H_ +#define _HYPERV_H_ #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + #include -#include #include -#include -#include -#include - struct hyperv_guid { uint8_t hv_guid[16]; } __packed; #define HYPERV_GUID_STRLEN 40 -inthyperv_guid2str(const struct hyperv_guid *, char *, size_t); +inthyperv_guid2str(const struct hyperv_guid *, char *, size_t); /** * @brief Get physical address from virtual @@ -77,4 +55,4 @@ hv_get_phys_addr(void *virt) return (ret); } -#endif /* __HYPERV_H__ */ +#endif /* _HYPERV_H_ */ Modified: stable/10/sys/dev/hyperv/include/hyperv_busdma.h == --- stable/10/sys/dev/hyperv/include/hyperv_busdma.hWed Oct 12 08:25:13 2016(r307132) +++ stable/10/sys/dev/hyperv/include/hyperv_busdma.hWed Oct 12 08:58:03 2016(r307133) @@ -39,11 +39,11 @@ struct hyperv_dma { bus_dmamap_thv_dmap; }; -void hyperv_dma_map_paddr(void *arg, bus_dma_segment_t *segs, int nseg, - int error); -void *hyperv_dmamem_alloc(bus_dma_tag_t parent_dtag, bus_size_t alignment, - bus_addr_t boundary, bus_size_t size, struct hyperv_dma *dma, - int flags); -void hyperv_dmamem_free(struct hyperv_dma *dma, void *ptr); +void hyperv_dma_map_paddr(void *arg, bus_dma_segment_t *segs, + int nseg, int error); +void *hyperv_dmamem_alloc(bus_dma_tag_t parent_dtag, + bus_size_t alignment, bus_addr_t boundary, bus_size_t size, + struct hyperv_dma *dma, int flags); +void hyperv_dmamem_free(struct hyperv_dma *dma, void *ptr); #endif /* !_HYPERV_BUSDMA_H_ */ Modified: stable/10/sys/dev/hyperv/include/vmbus.h == --- stable/10/sys/dev/hyperv/include/vmbus.hWed Oct 12 08:25:13 2016 (r307132) +++ stable/10/sys/dev/hyperv/include/vmbus.hWed Oct 12 08:58:03 2016 (r307133) @@ -30,6 +30,8 @@ #define _VMBUS_H_ #include +#include +#include /* * VMBUS version is 32 bit, upper 16 bit for major_number and lower @@ -115,45 +117,47
Re: svn commit: r307070 - in head/sys: amd64/amd64 conf dev/efidev i386/include modules/efirt sys
On Tue, Oct 11, 2016 at 10:24:30PM +, Warner Losh wrote: > Added: head/sys/dev/efidev/efidev.c > == > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/dev/efidev/efidev.c Tue Oct 11 22:24:30 2016 > (r307070) > @@ -0,0 +1,199 @@ > +/*- > + * Copyright (c) 2016 Netflix, Inc. > + * 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 > + *in this position and unchanged. > + * 2. Redistributions in binary form must reproduce the above copyright > + *notice, this list of conditions and the following disclaimer in the > + *documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include As I asked in review, please use , not > +#include > + > +static d_ioctl_t efidev_ioctl; > + > +static struct cdevsw efi_cdevsw = { > + .d_name = "efi", > + .d_version = D_VERSION, > + .d_ioctl = efidev_ioctl, > +}; > + > +/* ARGSUSED */ > +static int > +efidev_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t addr, > +int flags __unused, struct thread *td __unused) > +{ > + int error; > + > + switch (cmd) { > + case EFIIOC_GET_TABLE: > + { > + struct efi_get_table_ioc *egtioc = > + (struct efi_get_table_ioc *)addr; > + > + error = efi_get_table(>uuid, >ptr); > + break; > + } > + case EFIIOC_GET_TIME: > + { > + struct efi_tm *tm = (struct efi_tm *)addr; > + > + error = efi_get_time(tm); > + break; > + } > + case EFIIOC_SET_TIME: > + { > + struct efi_tm *tm = (struct efi_tm *)addr; > + > + error = efi_set_time(tm); > + break; > + } > + case EFIIOC_VAR_GET: > + { > + struct efi_var_ioc *ev = (struct efi_var_ioc *)addr; > + void *data; > + efi_char *name; > + > + data = malloc(ev->datasize, M_TEMP, M_WAITOK); > + name = malloc(ev->namesize, M_TEMP, M_WAITOK); > + error = copyin(ev->name, name, ev->namesize); > + if (error) > + goto vg_out; > + if (name[ev->namesize / sizeof(efi_char) - 1] != 0) { > + error = EINVAL; > + goto vg_out; > + } > + > + error = efi_var_get(name, >vendor, >attrib, > + >datasize, data); > + > + if (error == 0) { > + error = copyout(data, ev->data, ev->datasize); > + } else if (error == EOVERFLOW) { > + /* > + * Pass back the size we really need, but > + * convert the error to 0 so the copyout > + * happens. datasize was updated in the > + * efi_var_get call. > + */ > + ev->data = NULL; > + error = 0; > + } > +vg_out: > + free(data, M_TEMP); > + free(name, M_TEMP); > + break; > + } > + case EFIIOC_VAR_NEXT: > + { > + struct efi_var_ioc *ev = (struct efi_var_ioc *)addr; > + efi_char *name; > + > + name = malloc(ev->namesize, M_TEMP, M_WAITOK); > + if (name == NULL) { The check is for impossible condition. > + error = ENOMEM; > + goto vn_out; > + } > + error = copyin(ev->name, name, ev->namesize); > + if (error) > + goto vn_out; > + /* Note: namesize is the buffer size, not the string lenght */ > + > + error = efi_var_nextname(>namesize, name,
svn commit: r307137 - in stable/10/sys/dev/hyperv: include netvsc storvsc vmbus
Author: sephe Date: Wed Oct 12 09:27:39 2016 New Revision: 307137 URL: https://svnweb.freebsd.org/changeset/base/307137 Log: MFC 303603-303605,303764 303603 hyperv/vmbus: Remove the artificial entry limit of SG and PRP list. Just make sure that the total channel packet size does not exceed 1/2 data size of the TX bufring. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7359 303604 hyperv/storvsc: Set maxio to 128KB. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7360 303605 hyperv/storvsc: Stringent PRP list assertions Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7361 303764 hyperv/vmbus: Only make sure the TX bufring will not be closed. KVP can write data, whose size is > 1/2 TX bufring size. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7414 Modified: stable/10/sys/dev/hyperv/include/vmbus.h stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c stable/10/sys/dev/hyperv/vmbus/vmbus_brvar.h stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/vmbus.h == --- stable/10/sys/dev/hyperv/include/vmbus.hWed Oct 12 09:17:41 2016 (r307136) +++ stable/10/sys/dev/hyperv/include/vmbus.hWed Oct 12 09:27:39 2016 (r307137) @@ -103,9 +103,6 @@ struct vmbus_chanpkt_rxbuf { struct vmbus_rxbuf_desc cp_rxbuf[]; } __packed; -#define VMBUS_CHAN_SGLIST_MAX 32 -#define VMBUS_CHAN_PRPLIST_MAX 32 - struct vmbus_channel; struct hyperv_guid; Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h == --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Oct 12 09:17:41 2016(r307136) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Oct 12 09:27:39 2016(r307137) @@ -1088,6 +1088,7 @@ struct vmbus_channel; typedef void (*pfn_on_send_rx_completion)(struct vmbus_channel *, void *); #define NETVSC_DEVICE_RING_BUFFER_SIZE (128 * PAGE_SIZE) +#define NETVSC_PACKET_MAXPAGE 32 #define NETVSC_VLAN_PRIO_MASK 0xe000 #define NETVSC_VLAN_PRIO_SHIFT 13 @@ -1137,7 +1138,7 @@ typedef struct netvsc_packet_ { uint32_ttot_data_buf_len; void*data; uint32_tgpa_cnt; - struct vmbus_gpa gpa[VMBUS_CHAN_SGLIST_MAX]; + struct vmbus_gpa gpa[NETVSC_PACKET_MAXPAGE]; } netvsc_packet; typedef struct { Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 12 09:17:41 2016(r307136) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 12 09:27:39 2016(r307137) @@ -154,7 +154,7 @@ __FBSDID("$FreeBSD$"); #define HN_TX_DATA_MAXSIZE IP_MAXPACKET #define HN_TX_DATA_SEGSIZE PAGE_SIZE #define HN_TX_DATA_SEGCNT_MAX \ -(VMBUS_CHAN_SGLIST_MAX - HV_RF_NUM_TX_RESERVED_PAGE_BUFS) +(NETVSC_PACKET_MAXPAGE - HV_RF_NUM_TX_RESERVED_PAGE_BUFS) #define HN_DIRECT_TX_SIZE_DEF 128 Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Oct 12 09:17:41 2016(r307136) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Oct 12 09:27:39 2016(r307137) @@ -88,10 +88,25 @@ __FBSDID("$FreeBSD$"); #define VSTOR_PKT_SIZE (sizeof(struct vstor_packet) - vmscsi_size_delta) -#define STORVSC_DATA_SEGCNT_MAXVMBUS_CHAN_PRPLIST_MAX +/* + * 33 segments are needed to allow 128KB maxio, in case the data + * in the first page is _not_ PAGE_SIZE aligned, e.g. + * + * |<--- 128KB --->| + * | | + * 0 2K 4K8K 16K 124K 128K 130K + * | | | | | | | | + * +--+--+-+-+...+-+--+--+ + * | | | | | | | | | DATA + * | | | | | | | | | + * +--+--+-+-+...--+--+--+ + * | | | | + * | 1|31 | 1| .. # of segments + */ +#define STORVSC_DATA_SEGCNT_MAX33 #define STORVSC_DATA_SEGSZ_MAX PAGE_SIZE #define STORVSC_DATA_SIZE_MAX \ - (STORVSC_DATA_SEGCNT_MAX * STORVSC_DATA_SEGSZ_MAX) + ((STORVSC_DATA_SEGCNT_MAX
svn commit: r307138 - in stable/11: contrib/libarchive/cat/test contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchi...
Author: mm Date: Wed Oct 12 10:28:22 2016 New Revision: 307138 URL: https://svnweb.freebsd.org/changeset/base/307138 Log: MFC r306670: Sync libarchive with vendor including security fixes. Important vendor bugfixes (relevant to FreeBSD): #747: Out of bounds read in mtree parser #761: heap-based buffer overflow in read_Header (7-zip) #794: Invalid file on bsdtar command line results in internal errors (1) PR: 213092 (1) Added: stable/11/contrib/libarchive/libarchive/test/test_read_format_mtree_crash747.c - copied unchanged from r306670, head/contrib/libarchive/libarchive/test/test_read_format_mtree_crash747.c stable/11/contrib/libarchive/libarchive/test/test_read_format_mtree_crash747.mtree.bz2.uu - copied unchanged from r306670, head/contrib/libarchive/libarchive/test/test_read_format_mtree_crash747.mtree.bz2.uu Modified: stable/11/contrib/libarchive/cat/test/main.c stable/11/contrib/libarchive/cat/test/test.h stable/11/contrib/libarchive/cpio/test/main.c stable/11/contrib/libarchive/cpio/test/test.h stable/11/contrib/libarchive/libarchive/archive_read_support_format_7zip.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_mtree.c stable/11/contrib/libarchive/libarchive/test/main.c stable/11/contrib/libarchive/libarchive/test/test_acl_freebsd_nfs4.c stable/11/contrib/libarchive/libarchive/test/test_read_set_format.c stable/11/contrib/libarchive/tar/subst.c stable/11/contrib/libarchive/tar/test/main.c stable/11/contrib/libarchive/tar/test/test.h stable/11/contrib/libarchive/tar/test/test_option_H_upper.c stable/11/contrib/libarchive/tar/test/test_option_L_upper.c stable/11/contrib/libarchive/tar/test/test_option_U_upper.c stable/11/contrib/libarchive/tar/test/test_option_n.c stable/11/contrib/libarchive/tar/write.c stable/11/lib/libarchive/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libarchive/cat/test/main.c == --- stable/11/contrib/libarchive/cat/test/main.cWed Oct 12 09:27:39 2016(r307137) +++ stable/11/contrib/libarchive/cat/test/main.cWed Oct 12 10:28:22 2016(r307138) @@ -1360,6 +1360,31 @@ assertion_file_birthtime_recent(const ch return assertion_file_time(file, line, pathname, 0, 0, 'b', 1); } +/* 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, ); + 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); +} + /* Verify mtime of 'pathname'. */ int assertion_file_mtime(const char *file, int line, @@ -1578,8 +1603,12 @@ assertion_make_dir(const char *file, int if (0 == _mkdir(dirname)) return (1); #else - if (0 == mkdir(dirname, mode)) - return (1); + if (0 == mkdir(dirname, mode)) { + if (0 == chmod(dirname, mode)) { + assertion_file_mode(file, line, dirname, mode); + return (1); + } + } #endif failure_start(file, line, "Could not create directory %s", dirname); failure_finish(NULL); @@ -1628,6 +1657,11 @@ assertion_make_file(const char *file, in failure_finish(NULL); return (0); } + if (0 != chmod(path, mode)) { + failure_start(file, line, "Could not chmod %s", path); + failure_finish(NULL); + return (0); + } if (contents != NULL) { ssize_t wsize; @@ -1644,6 +1678,7 @@ assertion_make_file(const char *file, in } } close(fd); + assertion_file_mode(file, line, path, mode); return (1); #endif } Modified: stable/11/contrib/libarchive/cat/test/test.h == --- stable/11/contrib/libarchive/cat/test/test.hWed Oct 12 09:27:39 2016(r307137) +++ stable/11/contrib/libarchive/cat/test/test.hWed Oct 12 10:28:22 2016(r307138) @@ -241,6 +241,7 @@ int assertion_file_birthtime_recent(cons int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **); int assertion_file_contents(const char *, int, const void *, int, const char *); int assertion_file_exists(const char *, int, const char *);
svn commit: r307135 - stable/11/sys/compat/ia32
Author: ed Date: Wed Oct 12 09:16:16 2016 New Revision: 307135 URL: https://svnweb.freebsd.org/changeset/base/307135 Log: MFC r304740: Add missing header dependency. This header depends on sigaltstack32 being declared. Modified: stable/11/sys/compat/ia32/ia32_signal.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/ia32/ia32_signal.h == --- stable/11/sys/compat/ia32/ia32_signal.h Wed Oct 12 09:13:16 2016 (r307134) +++ stable/11/sys/compat/ia32/ia32_signal.h Wed Oct 12 09:16:16 2016 (r307135) @@ -32,6 +32,8 @@ #ifndef_COMPAT_IA32_IA32_SIGNAL_H #define_COMPAT_IA32_IA32_SIGNAL_H +#include + #define_MC_IA32_HASSEGS0x1 #define_MC_IA32_HASBASES 0x2 #define_MC_IA32_HASFPXSTATE0x4 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307136 - in stable/11/sys/arm: arm include
Author: ed Date: Wed Oct 12 09:17:41 2016 New Revision: 307136 URL: https://svnweb.freebsd.org/changeset/base/307136 Log: MFC r306162: Make it possible to safely use TPIDRURW from userspace. On amd64, arm64 and i386, we have the possibility to switch between TLS areas in userspace. The nice thing about this is that it makes it easier to do light-weight threading, if we ever feel like doing that. On armv6, let's go into the same direction by making it possible to safely use the TPIDRURW register, which is intended for this purpose. Clean up the ARMv6 code to remove md_tp entirely. Simply add a dedicated field to the PCB to hold the value of TPIDRURW across context switches, like we do for any other register. As userspace currently uses the read-only TPIDRURO register, simply ensure that we keep both values in sync where possible. The system calls for modifying the read-only register will simply write the intended value into both registers, so that it lazily ends up in the PCB during the next context switch. Approved by:andrew Reviewed by:imp Differential Revision: https://reviews.freebsd.org/D7951 Modified: stable/11/sys/arm/arm/genassym.c stable/11/sys/arm/arm/swtch-v6.S stable/11/sys/arm/arm/sys_machdep.c stable/11/sys/arm/arm/vm_machdep.c stable/11/sys/arm/include/frame.h stable/11/sys/arm/include/pcpu.h stable/11/sys/arm/include/proc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/genassym.c == --- stable/11/sys/arm/arm/genassym.cWed Oct 12 09:16:16 2016 (r307135) +++ stable/11/sys/arm/arm/genassym.cWed Oct 12 09:17:41 2016 (r307136) @@ -81,6 +81,9 @@ ASSYM(PCB_R12, offsetof(struct pcb, pcb_ ASSYM(PCB_SP, offsetof(struct pcb, pcb_regs.sf_sp)); ASSYM(PCB_LR, offsetof(struct pcb, pcb_regs.sf_lr)); ASSYM(PCB_PC, offsetof(struct pcb, pcb_regs.sf_pc)); +#if __ARM_ARCH >= 6 +ASSYM(PCB_TPIDRURW, offsetof(struct pcb, pcb_regs.sf_tpidrurw)); +#endif ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb)); ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread)); @@ -100,8 +103,8 @@ ASSYM(TD_FLAGS, offsetof(struct thread, ASSYM(TD_PROC, offsetof(struct thread, td_proc)); ASSYM(TD_MD, offsetof(struct thread, td_md)); ASSYM(TD_LOCK, offsetof(struct thread, td_lock)); -ASSYM(MD_TP, offsetof(struct mdthread, md_tp)); #if __ARM_ARCH < 6 +ASSYM(MD_TP, offsetof(struct mdthread, md_tp)); ASSYM(MD_RAS_START, offsetof(struct mdthread, md_ras_start)); ASSYM(MD_RAS_END, offsetof(struct mdthread, md_ras_end)); #endif Modified: stable/11/sys/arm/arm/swtch-v6.S == --- stable/11/sys/arm/arm/swtch-v6.SWed Oct 12 09:16:16 2016 (r307135) +++ stable/11/sys/arm/arm/swtch-v6.SWed Oct 12 09:17:41 2016 (r307136) @@ -291,6 +291,8 @@ ENTRY(cpu_switch) ldr r3, [r0, #(TD_PCB)] add r3, #(PCB_R4) stmia r3, {r4-r12, sp, lr, pc} + mrc CP15_TPIDRURW(r4) + str r4, [r3, #(PCB_TPIDRURW - PCB_R4)] #ifdef INVARIANTS cmp r1, #0 /* new thread? */ @@ -437,9 +439,6 @@ sw1: cmp r3, r6 beq 1b #endif - /* Set the new tls */ - ldr r0, [r11, #(TD_MD + MD_TP)] - mcr CP15_TPIDRURO(r0) /* write tls thread reg 2 */ /* We have a new curthread now so make a note it */ str r11, [r8, #PC_CURTHREAD] @@ -452,7 +451,14 @@ sw1: * Restore all saved registers and return. Note that some saved * registers can be changed when either cpu_fork(), cpu_copy_thread(), * cpu_fork_kthread_handler(), or makectx() was called. -*/ +* +* The value of TPIDRURW is also written into TPIDRURO, as +* userspace still uses TPIDRURO, modifying it through +* sysarch(ARM_SET_TP, addr). +*/ + ldr r3, [r7, #PCB_TPIDRURW] + mcr CP15_TPIDRURW(r3) /* write tls thread reg 2 */ + mcr CP15_TPIDRURO(r3) /* write tls thread reg 3 */ add r3, r7, #PCB_R4 ldmia r3, {r4-r12, sp, pc} Modified: stable/11/sys/arm/arm/sys_machdep.c == --- stable/11/sys/arm/arm/sys_machdep.c Wed Oct 12 09:16:16 2016 (r307135) +++ stable/11/sys/arm/arm/sys_machdep.c Wed Oct 12 09:17:41 2016 (r307136) @@ -166,10 +166,10 @@ static int arm32_set_tp(struct thread *td, void *args) { - td->td_md.md_tp = (register_t)args; #if __ARM_ARCH >= 6 set_tls(args); #else + td->td_md.md_tp = (register_t)args; *(register_t *)ARM_TP_ADDRESS = (register_t)args; #endif return (0); @@ -180,7 +180,7 @@ arm32_get_tp(struct thread *td, void *ar { #if __ARM_ARCH >= 6 -
svn commit: r307139 - in stable/10: contrib/libarchive/cat/test contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchi...
Author: mm Date: Wed Oct 12 10:28:54 2016 New Revision: 307139 URL: https://svnweb.freebsd.org/changeset/base/307139 Log: MFC r306670: Sync libarchive with vendor including security fixes. Important vendor bugfixes (relevant to FreeBSD): #747: Out of bounds read in mtree parser #761: heap-based buffer overflow in read_Header (7-zip) #794: Invalid file on bsdtar command line results in internal errors (1) PR: 213092 (1) Added: stable/10/contrib/libarchive/libarchive/test/test_read_format_mtree_crash747.c - copied unchanged from r306670, head/contrib/libarchive/libarchive/test/test_read_format_mtree_crash747.c stable/10/contrib/libarchive/libarchive/test/test_read_format_mtree_crash747.mtree.bz2.uu - copied unchanged from r306670, head/contrib/libarchive/libarchive/test/test_read_format_mtree_crash747.mtree.bz2.uu Modified: stable/10/contrib/libarchive/cat/test/main.c stable/10/contrib/libarchive/cat/test/test.h stable/10/contrib/libarchive/cpio/test/main.c stable/10/contrib/libarchive/cpio/test/test.h stable/10/contrib/libarchive/libarchive/archive_read_support_format_7zip.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c stable/10/contrib/libarchive/libarchive/test/main.c stable/10/contrib/libarchive/libarchive/test/test_acl_freebsd_nfs4.c stable/10/contrib/libarchive/libarchive/test/test_read_set_format.c stable/10/contrib/libarchive/tar/subst.c stable/10/contrib/libarchive/tar/test/main.c stable/10/contrib/libarchive/tar/test/test.h stable/10/contrib/libarchive/tar/test/test_option_H_upper.c stable/10/contrib/libarchive/tar/test/test_option_L_upper.c stable/10/contrib/libarchive/tar/test/test_option_U_upper.c stable/10/contrib/libarchive/tar/test/test_option_n.c stable/10/contrib/libarchive/tar/write.c stable/10/lib/libarchive/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/cat/test/main.c == --- stable/10/contrib/libarchive/cat/test/main.cWed Oct 12 10:28:22 2016(r307138) +++ stable/10/contrib/libarchive/cat/test/main.cWed Oct 12 10:28:54 2016(r307139) @@ -1360,6 +1360,31 @@ assertion_file_birthtime_recent(const ch return assertion_file_time(file, line, pathname, 0, 0, 'b', 1); } +/* 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, ); + 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); +} + /* Verify mtime of 'pathname'. */ int assertion_file_mtime(const char *file, int line, @@ -1578,8 +1603,12 @@ assertion_make_dir(const char *file, int if (0 == _mkdir(dirname)) return (1); #else - if (0 == mkdir(dirname, mode)) - return (1); + if (0 == mkdir(dirname, mode)) { + if (0 == chmod(dirname, mode)) { + assertion_file_mode(file, line, dirname, mode); + return (1); + } + } #endif failure_start(file, line, "Could not create directory %s", dirname); failure_finish(NULL); @@ -1628,6 +1657,11 @@ assertion_make_file(const char *file, in failure_finish(NULL); return (0); } + if (0 != chmod(path, mode)) { + failure_start(file, line, "Could not chmod %s", path); + failure_finish(NULL); + return (0); + } if (contents != NULL) { ssize_t wsize; @@ -1644,6 +1678,7 @@ assertion_make_file(const char *file, in } } close(fd); + assertion_file_mode(file, line, path, mode); return (1); #endif } Modified: stable/10/contrib/libarchive/cat/test/test.h == --- stable/10/contrib/libarchive/cat/test/test.hWed Oct 12 10:28:22 2016(r307138) +++ stable/10/contrib/libarchive/cat/test/test.hWed Oct 12 10:28:54 2016(r307139) @@ -241,6 +241,7 @@ int assertion_file_birthtime_recent(cons int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **); int assertion_file_contents(const char *, int, const void *, int, const char *); int assertion_file_exists(const char *, int, const char *);
svn commit: r307140 - head/sys/sys
Author: avg Date: Wed Oct 12 11:12:31 2016 New Revision: 307140 URL: https://svnweb.freebsd.org/changeset/base/307140 Log: bump __FreeBSD_version for libzfs_core.h Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h == --- head/sys/sys/param.hWed Oct 12 10:28:54 2016(r307139) +++ head/sys/sys/param.hWed Oct 12 11:12:31 2016(r307140) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1200012 /* Master, propagated to newvers */ +#define __FreeBSD_version 1200013 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307134 - stable/10/sys/dev/hyperv/storvsc
Author: sephe Date: Wed Oct 12 09:13:16 2016 New Revision: 307134 URL: https://svnweb.freebsd.org/changeset/base/307134 Log: MFC 303474 hyperv/storvsc: Use busdma(9) and enable PIM_UNMAPPED by default. The UNMAPPED I/O greatly improves userland direct disk I/O performance by 35% ~ 135%. Submitted by: Hongjiang Zhang Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7195 Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Oct 12 08:58:03 2016(r307133) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Oct 12 09:13:16 2016(r307134) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -87,7 +88,10 @@ __FBSDID("$FreeBSD$"); #define VSTOR_PKT_SIZE (sizeof(struct vstor_packet) - vmscsi_size_delta) -#define HV_ALIGN(x, a) roundup2(x, a) +#define STORVSC_DATA_SEGCNT_MAXVMBUS_CHAN_PRPLIST_MAX +#define STORVSC_DATA_SEGSZ_MAX PAGE_SIZE +#define STORVSC_DATA_SIZE_MAX \ + (STORVSC_DATA_SEGCNT_MAX * STORVSC_DATA_SEGSZ_MAX) struct storvsc_softc; @@ -102,7 +106,7 @@ struct hv_sgl_page_pool{ boolean_tis_init; } g_hv_sgl_page_pool; -#define STORVSC_MAX_SG_PAGE_CNT STORVSC_MAX_IO_REQUESTS * VMBUS_CHAN_PRPLIST_MAX +#define STORVSC_MAX_SG_PAGE_CNT STORVSC_MAX_IO_REQUESTS * STORVSC_DATA_SEGCNT_MAX enum storvsc_request_type { WRITE_TYPE, @@ -110,26 +114,41 @@ enum storvsc_request_type { UNKNOWN_TYPE }; -struct hvs_gpa_range { +SYSCTL_NODE(_hw, OID_AUTO, storvsc, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, +"Hyper-V storage interface"); + +static u_int hv_storvsc_use_pim_unmapped = 1; +SYSCTL_INT(_hw_storvsc, OID_AUTO, use_pim_unmapped, CTLFLAG_RDTUN, +_storvsc_use_pim_unmapped, 0, +"Optimize storvsc by using unmapped I/O"); + +struct hv_storvsc_sysctl { + u_long data_bio_cnt; + u_long data_vaddr_cnt; + u_long data_sg_cnt; +}; + +struct storvsc_gpa_range { struct vmbus_gpa_range gpa_range; - uint64_tgpa_page[VMBUS_CHAN_PRPLIST_MAX]; + uint64_tgpa_page[STORVSC_DATA_SEGCNT_MAX]; } __packed; struct hv_storvsc_request { - LIST_ENTRY(hv_storvsc_request) link; - struct vstor_packet vstor_packet; - int prp_cnt; - struct hvs_gpa_range prp_list; - void *sense_data; - uint8_t sense_info_len; - uint8_t retries; - union ccb *ccb; - struct storvsc_softc *softc; - struct callout callout; - struct sema synch_sema; /*Synchronize the request/response if needed */ - struct sglist *bounce_sgl; - unsigned int bounce_sgl_count; - uint64_t not_aligned_seg_bits; + LIST_ENTRY(hv_storvsc_request) link; + struct vstor_packet vstor_packet; + int prp_cnt; + struct storvsc_gpa_rangeprp_list; + void*sense_data; + uint8_t sense_info_len; + uint8_t retries; + union ccb *ccb; + struct storvsc_softc*softc; + struct callout callout; + struct sema synch_sema; /*Synchronize the request/response if needed */ + struct sglist *bounce_sgl; + unsigned intbounce_sgl_count; + uint64_tnot_aligned_seg_bits; + bus_dmamap_tdata_dmap; }; struct storvsc_softc { @@ -148,6 +167,8 @@ struct storvsc_softc { struct hv_storvsc_request hs_init_req; struct hv_storvsc_request hs_reset_req; device_ths_dev; + bus_dma_tag_t storvsc_req_dtag; + struct hv_storvsc_sysctlsysctl_data; struct vmbus_channel*hs_cpu2chan[MAXCPU]; }; @@ -884,6 +905,77 @@ storvsc_create_cpu2chan(struct storvsc_s } } +static int +storvsc_init_requests(device_t dev) +{ + struct storvsc_softc *sc = device_get_softc(dev); + struct hv_storvsc_request *reqp; + int error, i; + + LIST_INIT(>hs_free_list); + + error = bus_dma_tag_create( + bus_get_dma_tag(dev), /* parent */ + 1, /* alignment */ + PAGE_SIZE, /* boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ +
Re: svn commit: r307082 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/conf sys/i386/conf sys/mips/conf sys/modules/cc sys/modules/khelp sys/netinet sys/netinet/tcp_stacks sys/pc98/conf s
On Wed, Oct 12, 2016 at 02:16:42AM +, Jonathan T. Looney wrote: > Author: jtl > Date: Wed Oct 12 02:16:42 2016 > New Revision: 307082 > URL: https://svnweb.freebsd.org/changeset/base/307082 > > Log: > In the TCP stack, the hhook(9) framework provides hooks for kernel modules > to add actions that run when a TCP frame is sent or received on a TCP > session in the ESTABLISHED state. In the base tree, this functionality is > only used for the h_ertt module, which is used by the cc_cdg, cc_chd, cc_hd, > and cc_vegas congestion control modules. > > Presently, we incur overhead to check for hooks each time a TCP frame is > sent or received on an ESTABLISHED TCP session. Do you perform estimate of performane impact of this overhead? ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307141 - head/sys/sys
Author: avg Date: Wed Oct 12 11:17:10 2016 New Revision: 307141 URL: https://svnweb.freebsd.org/changeset/base/307141 Log: remove a few stray spaces from sys/param.h Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h == --- head/sys/sys/param.hWed Oct 12 11:12:31 2016(r307140) +++ head/sys/sys/param.hWed Oct 12 11:17:10 2016(r307141) @@ -44,7 +44,7 @@ #define BSD4_3 1 #define BSD4_4 1 -/* +/* * __FreeBSD_version numbers are documented in the Porter's Handbook. * If you bump the version for any reason, you should update the documentation * there. @@ -241,7 +241,7 @@ * * BKVASIZE - Nominal buffer space per buffer, in bytes. BKVASIZE is the * minimum KVM memory reservation the kernel is willing to make. - * Filesystems can of course request smaller chunks. Actual + * Filesystems can of course request smaller chunks. Actual * backing memory uses a chunk size of a page (PAGE_SIZE). * The default value here can be overridden on a per-architecture * basis by defining it in . This should @@ -250,8 +250,8 @@ * * If you make BKVASIZE too small you risk seriously fragmenting * the buffer KVM map which may slow things down a bit. If you - * make it too big the kernel will not be able to optimally use - * the KVM memory reserved for the buffer cache and will wind + * make it too big the kernel will not be able to optimally use + * the KVM memory reserved for the buffer cache and will wind * up with too-few buffers. * * The default is 16384, roughly 2x the block size used by a @@ -344,7 +344,7 @@ __END_DECLS #define dbtoc(db) /* calculates devblks to pages */ \ ((db + (ctodb(1) - 1)) >> (PAGE_SHIFT - DEV_BSHIFT)) - + #define ctodb(db) /* calculates pages to devblks */ \ ((db) << (PAGE_SHIFT - DEV_BSHIFT)) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307143 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: avg Date: Wed Oct 12 11:48:47 2016 New Revision: 307143 URL: https://svnweb.freebsd.org/changeset/base/307143 Log: MFC r306665: zfs: fix a wrong assertion for extended attributes PR: 213112 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 Wed Oct 12 11:48:14 2016(r307142) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Oct 12 11:48:47 2016(r307143) @@ -1454,7 +1454,8 @@ zfs_lookup_lock(vnode_t *dvp, vnode_t *v ASSERT_VOP_LOCKED(dvp, __func__); #ifdef DIAGNOSTIC - ASSERT(!RRM_LOCK_HELD(>z_teardown_lock)); + if ((zdp->z_pflags & ZFS_XATTR) == 0) + VERIFY(!RRM_LOCK_HELD(>z_teardown_lock)); #endif if (name[0] == 0 || (name[0] == '.' && name[1] == 0)) { @@ -6017,13 +6018,15 @@ zfs_lock(ap) vp = ap->a_vp; flags = ap->a_flags; if ((flags & LK_INTERLOCK) == 0 && (flags & LK_NOWAIT) == 0 && - (vp->v_iflag & VI_DOOMED) == 0 && (zp = vp->v_data) != NULL) { + (vp->v_iflag & VI_DOOMED) == 0 && (zp = vp->v_data) != NULL && + (zp->z_pflags & ZFS_XATTR) == 0) { zfsvfs = zp->z_zfsvfs; VERIFY(!RRM_LOCK_HELD(>z_teardown_lock)); } err = vop_stdlock(ap); if ((flags & LK_INTERLOCK) != 0 && (flags & LK_NOWAIT) == 0 && - (vp->v_iflag & VI_DOOMED) == 0 && (zp = vp->v_data) != NULL) { + (vp->v_iflag & VI_DOOMED) == 0 && (zp = vp->v_data) != NULL && + (zp->z_pflags & ZFS_XATTR) == 0) { zfsvfs = zp->z_zfsvfs; VERIFY(!RRM_LOCK_HELD(>z_teardown_lock)); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307142 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: avg Date: Wed Oct 12 11:48:14 2016 New Revision: 307142 URL: https://svnweb.freebsd.org/changeset/base/307142 Log: MFC r306665: zfs: fix a wrong assertion for extended attributes PR: 213112 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 Wed Oct 12 11:17:10 2016(r307141) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Wed Oct 12 11:48:14 2016(r307142) @@ -1454,7 +1454,8 @@ zfs_lookup_lock(vnode_t *dvp, vnode_t *v ASSERT_VOP_LOCKED(dvp, __func__); #ifdef DIAGNOSTIC - ASSERT(!RRM_LOCK_HELD(>z_teardown_lock)); + if ((zdp->z_pflags & ZFS_XATTR) == 0) + VERIFY(!RRM_LOCK_HELD(>z_teardown_lock)); #endif if (name[0] == 0 || (name[0] == '.' && name[1] == 0)) { @@ -5973,13 +5974,15 @@ zfs_lock(ap) vp = ap->a_vp; flags = ap->a_flags; if ((flags & LK_INTERLOCK) == 0 && (flags & LK_NOWAIT) == 0 && - (vp->v_iflag & VI_DOOMED) == 0 && (zp = vp->v_data) != NULL) { + (vp->v_iflag & VI_DOOMED) == 0 && (zp = vp->v_data) != NULL && + (zp->z_pflags & ZFS_XATTR) == 0) { zfsvfs = zp->z_zfsvfs; VERIFY(!RRM_LOCK_HELD(>z_teardown_lock)); } err = vop_stdlock(ap); if ((flags & LK_INTERLOCK) != 0 && (flags & LK_NOWAIT) == 0 && - (vp->v_iflag & VI_DOOMED) == 0 && (zp = vp->v_data) != NULL) { + (vp->v_iflag & VI_DOOMED) == 0 && (zp = vp->v_data) != NULL && + (zp->z_pflags & ZFS_XATTR) == 0) { zfsvfs = zp->z_zfsvfs; VERIFY(!RRM_LOCK_HELD(>z_teardown_lock)); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r307082 - in head: . sys/amd64/conf sys/arm/conf sys/arm64/conf sys/conf sys/i386/conf sys/mips/conf sys/modules/cc sys/modules/khelp sys/netinet sys/netinet/tcp_stacks sys/pc98/conf s
On Wed, Oct 12, 2016 at 5:44 AM, Slawa Olhovchenkovwrote: > Do you perform estimate of performane impact of this overhead? > > Somewhat, but not precisely. It will depend on (at least) a few factors: a. The hardware * How fast is your CPU? Your L1/L2/L3 cache? * How many CPUs? * How smart is the hardware prefetching? * How fast is the memory bus? * etc. b. Whether VNET is enabled * If VNET is enabled, the hook lookup will require more instructions to find the correct list c. Which TCP stack you are using * The hook lookup is implemented as an external function in the non-default stacks, so that requires the overhead of a function call d. The probability that the number of hooks is in your CPU cache * This is a combination of the hardware and the exact workload on the device On a test system running a fairly heavy load of TCP traffic using the default TCP stack, without VNET, and without any TCP hooks installed, the input/output hhook functions accounted for approximately .075% of the "busy" CPU cycles during one of my measurements. That certainly is not a large number, but it is large enough to be measurable. And, I think the hardware I used for the measurement is tuned for high-performance, so this may be close to the "best case" measurement. I suspect that systems with a large number of short-lived sessions will see a larger improvement from the deletion of khelp_init_osd() from the session setup path. (I didn't measure this.) I also suspect that systems with VNET will see a larger improvement. I also suspect that systems with slower memory busses, smaller caches, etc. will see a larger improvement. But, this is very hard to measure precisely in a generic sense. The one concrete thing we *can* measure is that the functions add some number of instructions to the session setup, session teardown, input, and output code paths. If you need those instructions to achieve the desired functionality (in this case, probably a congestion-control algorithm), then you probably want those instructions. If not, then you may want to delete them. This was the impetus to add a kernel option to give you the ability to decide whether you want to include the functionality. I hope this answer helps explain some more about the change. Jonathan ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307149 - head/release/arm
Author: andrew Date: Wed Oct 12 15:29:22 2016 New Revision: 307149 URL: https://svnweb.freebsd.org/changeset/base/307149 Log: Use the armv6 GENERIC kernel in the release images on hardware this kernel config supports. Approved by: gjb Sponsored by: ABT Systems Ltd Differential Revision:https://reviews.freebsd.org/D8147 Modified: head/release/arm/BANANAPI.conf head/release/arm/CUBIEBOARD2.conf head/release/arm/RPI2.conf Modified: head/release/arm/BANANAPI.conf == --- head/release/arm/BANANAPI.conf Wed Oct 12 13:56:14 2016 (r307148) +++ head/release/arm/BANANAPI.conf Wed Oct 12 15:29:22 2016 (r307149) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-bananapi" -KERNEL="ALLWINNER" +KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x4200" IMAGE_SIZE="1G" PART_SCHEME="MBR" Modified: head/release/arm/CUBIEBOARD2.conf == --- head/release/arm/CUBIEBOARD2.conf Wed Oct 12 13:56:14 2016 (r307148) +++ head/release/arm/CUBIEBOARD2.conf Wed Oct 12 15:29:22 2016 (r307149) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-cubieboard2" -KERNEL="ALLWINNER" +KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x4200" IMAGE_SIZE="1G" PART_SCHEME="MBR" Modified: head/release/arm/RPI2.conf == --- head/release/arm/RPI2.conf Wed Oct 12 13:56:14 2016(r307148) +++ head/release/arm/RPI2.conf Wed Oct 12 15:29:22 2016(r307149) @@ -7,7 +7,7 @@ EMBEDDEDBUILD=1 EMBEDDED_TARGET="arm" EMBEDDED_TARGET_ARCH="armv6" EMBEDDEDPORTS="sysutils/u-boot-rpi2" -KERNEL="RPI2" +KERNEL="GENERIC" WORLD_FLAGS="${WORLD_FLAGS} UBLDR_LOADADDR=0x200" IMAGE_SIZE="1G" PART_SCHEME="MBR" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r306680 - in head/sys: amd64/amd64 amd64/include i386/include x86/include x86/x86
On 12/10/2016 16:45, Konstantin Belousov wrote: > On Wed, Oct 12, 2016 at 04:25:00PM +0300, Andriy Gapon wrote: >> On 04/10/2016 20:01, Konstantin Belousov wrote: >>> Author: kib >>> Date: Tue Oct 4 17:01:24 2016 >>> New Revision: 306680 >>> URL: https://svnweb.freebsd.org/changeset/base/306680 >>> >>> Log: >>> Re-apply r306516 (by cem): >>> >>> Reduce the cost of TLB invalidation on x86 by using per-CPU completion >>> flags >>> >>> Reduce contention during TLB invalidation operations by using a per-CPU >>> completion flag, rather than a single atomically-updated variable. >> >> Kostik, >> >> could this commit cause a problem reported in the below links? >> https://bz-attachments.freebsd.org/attachment.cgi?id=175614 >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213371 > > If I am reading the report right, the problem appears on the > 11.0-RELEASE system. The patch you reference was only applied to HEAD a > week ago and was not merged even to stable/11. Sorry for the noise, then. Somehow I thought that this went into the release branch, but obviously there was too little time for that. > The examination must start with backtracing the thread which owns the > smp_ipi_mtx (shown on the screenshot). It looks like DDB is not in GENERIC in 11.0? Not sure if the reporter would be able to configure a dump device and then save the dump given that the panic happens in the installer. If anyone could provide them with instructions that would be great. -- Andriy Gapon ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307147 - head/sys/conf
Author: br Date: Wed Oct 12 13:51:41 2016 New Revision: 307147 URL: https://svnweb.freebsd.org/changeset/base/307147 Log: Keep in-sync MK_SSP=no option both with kernel and userspace. Pointed out by: emaste Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/conf/kern.opts.mk Modified: head/sys/conf/kern.opts.mk == --- head/sys/conf/kern.opts.mk Wed Oct 12 13:19:21 2016(r307146) +++ head/sys/conf/kern.opts.mk Wed Oct 12 13:51:41 2016(r307147) @@ -65,7 +65,7 @@ BROKEN_OPTIONS+= CDDL ZFS .endif .if ${MACHINE_CPUARCH} == "mips" -BROKEN_OPTIONS+= CDDL ZFS +BROKEN_OPTIONS+= CDDL ZFS SSP .endif .if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} == "powerpc" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307145 - head/sys/dev/kbd
Author: emaste Date: Wed Oct 12 12:56:18 2016 New Revision: 307145 URL: https://svnweb.freebsd.org/changeset/base/307145 Log: Use M_WAITOK in PIO_KEYMAP ioctl The malloc return value is not checked. Submitted by: CTurtMFC after:1 week Modified: head/sys/dev/kbd/kbd.c Modified: head/sys/dev/kbd/kbd.c == --- head/sys/dev/kbd/kbd.c Wed Oct 12 12:17:41 2016(r307144) +++ head/sys/dev/kbd/kbd.c Wed Oct 12 12:56:18 2016(r307145) @@ -888,7 +888,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo case PIO_KEYMAP:/* set keyboard translation table */ case OPIO_KEYMAP: /* set keyboard translation table (compat) */ #ifndef KBD_DISABLE_KEYMAP_LOAD - mapp = malloc(sizeof *mapp, M_TEMP, M_NOWAIT); + mapp = malloc(sizeof *mapp, M_TEMP, M_WAITOK); if (cmd == OPIO_KEYMAP) { omapp = (okeymap_t *)arg; mapp->n_keys = omapp->n_keys; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r306364 - in head: lib/libc/tests share/mk
On Wed, Oct 05, 2016 at 08:44:39PM +, Ed Maste wrote: > On 27 September 2016 at 09:44, Ruslan Bukinwrote: > > Author: br > > Date: Tue Sep 27 09:44:30 2016 > > New Revision: 306364 > > URL: https://svnweb.freebsd.org/changeset/base/306364 > > > > Log: > > Mark SSP broken on MIPS. > > This needs an adjustment in sys/conf/kern.opts.mk as well it seems; > 'make showconfig' (as used by makeman to generate src.conf.5) now > reports SSP is both 'no' and 'yes' on mips: > > % make TARGET=mips TARGET_ARCH=mips showconfig | grep SSP > MK_SSP = no > MK_SSP = yes > I made a change, but for some reason it works from buildenv only: make TARGET=mips TARGET_ARCH=mips buildenv % make showconfig |grep SSP MK_SSP = no It looks like MACHINE_CPUARCH is not exported by showconfig. Ruslan ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307144 - in stable/11: share/man/man4 sys/amd64/cloudabi32 sys/amd64/cloudabi64 sys/amd64/conf sys/arm/cloudabi32 sys/arm64/cloudabi64 sys/compat/cloudabi sys/compat/cloudabi32 sys/com...
Author: ed Date: Wed Oct 12 12:17:41 2016 New Revision: 307144 URL: https://svnweb.freebsd.org/changeset/base/307144 Log: MFC r303818, r303833, r303941, r304478, r304481, r304483, r304484, r304554, r304555, r304556, r304557, r304558, r304559, r304561, r304563, r304564, r304565, r304615, r304742, r304743, r304744, r304745, r304748, r304886, r304991, r305928, r305938, r305987, r306185: Bring CloudABI support back in sync with HEAD. - Add support for running 32-bit executables on amd64, armv6 and i386. - As these new architectures require the use of the vDSO, merge back vDSO support for 64-bit executables running on amd64 and arm64 as well. This has the advantage that support for vDSO-less execution can be phased out when 11.0 becomes unsupported, as opposed to 11.x. This change has been tested by running the cloudlibc unit tests on all supported architectures, which seems to work fine. Added: stable/11/sys/amd64/cloudabi32/ - copied from r304744, head/sys/amd64/cloudabi32/ stable/11/sys/arm/cloudabi32/ - copied from r305928, head/sys/arm/cloudabi32/ stable/11/sys/compat/cloudabi/cloudabi_vdso.c - copied unchanged from r303941, head/sys/compat/cloudabi/cloudabi_vdso.c stable/11/sys/compat/cloudabi/cloudabi_vdso.lds - copied unchanged from r304557, head/sys/compat/cloudabi/cloudabi_vdso.lds stable/11/sys/compat/cloudabi32/ - copied from r304564, head/sys/compat/cloudabi32/ stable/11/sys/compat/cloudabi32/cloudabi32_proto.h - copied unchanged from r304565, head/sys/compat/cloudabi32/cloudabi32_proto.h stable/11/sys/compat/cloudabi32/cloudabi32_syscall.h - copied unchanged from r304565, head/sys/compat/cloudabi32/cloudabi32_syscall.h stable/11/sys/compat/cloudabi32/cloudabi32_syscalls.c - copied unchanged from r304565, head/sys/compat/cloudabi32/cloudabi32_syscalls.c stable/11/sys/compat/cloudabi32/cloudabi32_sysent.c - copied unchanged from r304565, head/sys/compat/cloudabi32/cloudabi32_sysent.c stable/11/sys/compat/cloudabi32/cloudabi32_systrace_args.c - copied unchanged from r304565, head/sys/compat/cloudabi32/cloudabi32_systrace_args.c stable/11/sys/contrib/cloudabi/cloudabi32_types.h - copied unchanged from r304561, head/sys/contrib/cloudabi/cloudabi32_types.h stable/11/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S - copied unchanged from r304554, head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S stable/11/sys/contrib/cloudabi/cloudabi_vdso_armv6.S - copied, changed from r305928, head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S stable/11/sys/contrib/cloudabi/cloudabi_vdso_i686.S - copied, changed from r304615, head/sys/contrib/cloudabi/cloudabi_vdso_i686.S stable/11/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S - copied unchanged from r304744, head/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S stable/11/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S - copied unchanged from r304554, head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S stable/11/sys/contrib/cloudabi/syscalls32.master - copied, changed from r304561, head/sys/contrib/cloudabi/syscalls32.master - copied unchanged from r304478, head/sys/contrib/cloudabi/syscalls64.master stable/11/sys/i386/cloudabi32/ - copied from r304615, head/sys/i386/cloudabi32/ stable/11/sys/modules/cloudabi32/ - copied from r304745, head/sys/modules/cloudabi32/ Directory Properties: stable/11/sys/contrib/cloudabi/syscalls64.master (props changed) Deleted: stable/11/sys/contrib/cloudabi/syscalls.master Modified: stable/11/share/man/man4/cloudabi.4 stable/11/sys/amd64/cloudabi64/cloudabi64_sysvec.c stable/11/sys/amd64/conf/NOTES stable/11/sys/arm64/cloudabi64/cloudabi64_sysvec.c stable/11/sys/compat/cloudabi/cloudabi_clock.c stable/11/sys/compat/cloudabi/cloudabi_thread.c stable/11/sys/compat/cloudabi/cloudabi_util.h stable/11/sys/compat/cloudabi64/Makefile stable/11/sys/compat/cloudabi64/cloudabi64_fd.c stable/11/sys/compat/cloudabi64/cloudabi64_module.c stable/11/sys/compat/cloudabi64/cloudabi64_poll.c stable/11/sys/compat/cloudabi64/cloudabi64_proto.h stable/11/sys/compat/cloudabi64/cloudabi64_sock.c stable/11/sys/compat/cloudabi64/cloudabi64_syscall.h stable/11/sys/compat/cloudabi64/cloudabi64_syscalls.c stable/11/sys/compat/cloudabi64/cloudabi64_sysent.c stable/11/sys/compat/cloudabi64/cloudabi64_systrace_args.c stable/11/sys/compat/cloudabi64/cloudabi64_util.h stable/11/sys/conf/files stable/11/sys/conf/files.amd64 stable/11/sys/conf/files.arm stable/11/sys/conf/files.arm64 stable/11/sys/conf/files.i386 stable/11/sys/conf/options stable/11/sys/contrib/cloudabi/cloudabi64_types.h stable/11/sys/contrib/cloudabi/cloudabi_types_common.h stable/11/sys/i386/cloudabi32/cloudabi32_sysvec.c stable/11/sys/i386/conf/NOTES stable/11/sys/modules/Makefile stable/11/sys/modules/cloudabi/Makefile
svn commit: r307146 - head/lib/libc
Author: br Date: Wed Oct 12 13:19:21 2016 New Revision: 307146 URL: https://svnweb.freebsd.org/changeset/base/307146 Log: Add different libc ldscript: the one without libssp -- we don't have it when MK_SSP==no. This fixes compilation on MIPS. Reviewed by: imp Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision:https://reviews.freebsd.org/D8212 Added: head/lib/libc/libc_nossp.ldscript (contents, props changed) Modified: head/lib/libc/Makefile Modified: head/lib/libc/Makefile == --- head/lib/libc/Makefile Wed Oct 12 12:56:18 2016(r307145) +++ head/lib/libc/Makefile Wed Oct 12 13:19:21 2016(r307146) @@ -29,7 +29,11 @@ LIBC_ARCH=${MACHINE_CPUARCH} # to CFLAGS below. -DSYSLIBC_SCCS affects just the system call stubs. LIB=c SHLIB_MAJOR= 7 +.if ${MK_SSP} != "no" SHLIB_LDSCRIPT=libc.ldscript +.else +SHLIB_LDSCRIPT=libc_nossp.ldscript +.endif SHLIB_LDSCRIPT_LINKS=libxnet.so WARNS?=2 CFLAGS+=-I${LIBC_SRCTOP}/include -I${LIBC_SRCTOP}/../../include Added: head/lib/libc/libc_nossp.ldscript == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/libc_nossp.ldscript Wed Oct 12 13:19:21 2016 (r307146) @@ -0,0 +1,2 @@ +/* $FreeBSD$ */ +GROUP ( @@SHLIB@@ @@LIBDIR@@/libc_nonshared.a ) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r306680 - in head/sys: amd64/amd64 amd64/include i386/include x86/include x86/x86
On 04/10/2016 20:01, Konstantin Belousov wrote: > Author: kib > Date: Tue Oct 4 17:01:24 2016 > New Revision: 306680 > URL: https://svnweb.freebsd.org/changeset/base/306680 > > Log: > Re-apply r306516 (by cem): > > Reduce the cost of TLB invalidation on x86 by using per-CPU completion flags > > Reduce contention during TLB invalidation operations by using a per-CPU > completion flag, rather than a single atomically-updated variable. Kostik, could this commit cause a problem reported in the below links? https://bz-attachments.freebsd.org/attachment.cgi?id=175614 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213371 > On a Westmere system (2 sockets x 4 cores x 1 threads), dtrace measurements > show that smp_tlb_shootdown is about 50% faster with this patch; > observations > with VTune show that the percentage of time spent in invlrng_single_page on > an > interrupt (actually doing invalidation, rather than synchronization) > increases > from 31% with the old mechanism to 71% with the new one. (Running a basic > file > server workload.) > > Submitted by: Anton Rang > Reviewed by:cem (earlier version) > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D8041 -- Andriy Gapon ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307148 - in head/lib/libc: gen stdlib
Author: emaste Date: Wed Oct 12 13:56:14 2016 New Revision: 307148 URL: https://svnweb.freebsd.org/changeset/base/307148 Log: Add comment on use of abort() in libc Suggested by: jonathan (in review D8133) Modified: head/lib/libc/gen/arc4random.c head/lib/libc/stdlib/random.c Modified: head/lib/libc/gen/arc4random.c == --- head/lib/libc/gen/arc4random.c Wed Oct 12 13:51:41 2016 (r307147) +++ head/lib/libc/gen/arc4random.c Wed Oct 12 13:56:14 2016 (r307148) @@ -144,8 +144,15 @@ arc4_stir(void) arc4_init(); rs_initialized = 1; } - if (arc4_sysctl(rdat, KEYSIZE) != KEYSIZE) - abort(); /* Random sysctl cannot fail. */ + if (arc4_sysctl(rdat, KEYSIZE) != KEYSIZE) { + /* +* The sysctl cannot fail. If it does fail on some FreeBSD +* derivative or after some future change, just abort so that +* the problem will be found and fixed. abort is not normally +* suitable for a library but makes sense here. +*/ + abort(); + } arc4_addrandom(rdat, KEYSIZE); Modified: head/lib/libc/stdlib/random.c == --- head/lib/libc/stdlib/random.c Wed Oct 12 13:51:41 2016 (r307147) +++ head/lib/libc/stdlib/random.c Wed Oct 12 13:56:14 2016 (r307148) @@ -279,8 +279,15 @@ srandomdev(void) mib[0] = CTL_KERN; mib[1] = KERN_ARND; - if (sysctl(mib, 2, state, , NULL, 0) == -1 || len != expected) + if (sysctl(mib, 2, state, , NULL, 0) == -1 || len != expected) { + /* +* The sysctl cannot fail. If it does fail on some FreeBSD +* derivative or after some future change, just abort so that +* the problem will be found and fixed. abort is not normally +* suitable for a library but makes sense here. +*/ abort(); + } if (rand_type != TYPE_0) { fptr = [rand_sep]; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r306680 - in head/sys: amd64/amd64 amd64/include i386/include x86/include x86/x86
On Wed, Oct 12, 2016 at 04:25:00PM +0300, Andriy Gapon wrote: > On 04/10/2016 20:01, Konstantin Belousov wrote: > > Author: kib > > Date: Tue Oct 4 17:01:24 2016 > > New Revision: 306680 > > URL: https://svnweb.freebsd.org/changeset/base/306680 > > > > Log: > > Re-apply r306516 (by cem): > > > > Reduce the cost of TLB invalidation on x86 by using per-CPU completion > > flags > > > > Reduce contention during TLB invalidation operations by using a per-CPU > > completion flag, rather than a single atomically-updated variable. > > Kostik, > > could this commit cause a problem reported in the below links? > https://bz-attachments.freebsd.org/attachment.cgi?id=175614 > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213371 If I am reading the report right, the problem appears on the 11.0-RELEASE system. The patch you reference was only applied to HEAD a week ago and was not merged even to stable/11. The examination must start with backtracing the thread which owns the smp_ipi_mtx (shown on the screenshot). ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307155 - stable/10/lib/libc/sys
Author: jilles Date: Wed Oct 12 20:19:33 2016 New Revision: 307155 URL: https://svnweb.freebsd.org/changeset/base/307155 Log: MFC r305628: intro(2),_exit(2): Update for reaper (procctl(PROC_REAP_ACQUIRE)). Modified: stable/10/lib/libc/sys/_exit.2 stable/10/lib/libc/sys/intro.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/_exit.2 == --- stable/10/lib/libc/sys/_exit.2 Wed Oct 12 19:53:10 2016 (r307154) +++ stable/10/lib/libc/sys/_exit.2 Wed Oct 12 20:19:33 2016 (r307155) @@ -28,7 +28,7 @@ .\" @(#)_exit.28.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd September 8, 2016 .Dt EXIT 2 .Os .Sh NAME @@ -64,9 +64,11 @@ is set as defined by .Xr wait 2 . .It The parent process-ID of all of the calling process's existing child -processes are set to 1; the initialization process +processes are set to the process-ID of the calling process's reaper; +the reaper (normally the initialization process) inherits each of these processes (see +.Xr procctl 2 , .Xr init 8 and the .Sx DEFINITIONS Modified: stable/10/lib/libc/sys/intro.2 == --- stable/10/lib/libc/sys/intro.2 Wed Oct 12 19:53:10 2016 (r307154) +++ stable/10/lib/libc/sys/intro.2 Wed Oct 12 20:19:33 2016 (r307155) @@ -28,7 +28,7 @@ .\" @(#)intro.28.5 (Berkeley) 2/27/95 .\" $FreeBSD$ .\" -.Dd May 4, 2013 +.Dd September 8, 2016 .Dt INTRO 2 .Os .Sh NAME @@ -486,7 +486,10 @@ A new process is created by a currently .Xr fork 2 ) . The parent process ID of a process is initially the process ID of its creator. If the creating process exits, -the parent process ID of each child is set to the ID of a system process, +the parent process ID of each child is set to the ID of the calling process's +reaper (see +.Xr procctl 2 ) , +normally .Xr init 8 . .It Process Group Each active process is a member of a process group that is identified by @@ -535,7 +538,7 @@ when none of its members has a parent pr as the group, but is in a different process group. Note that when a process exits, the parent process for its children -is changed to be +is normally changed to be .Xr init 8 , which is in a separate session. Not all members of an orphaned process group are necessarily orphaned ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307156 - head/usr.sbin/freebsd-update
Author: cperciva Date: Wed Oct 12 20:24:33 2016 New Revision: 307156 URL: https://svnweb.freebsd.org/changeset/base/307156 Log: MFportsnap r264740: Use case insensitive match when parsing host(1) output. Some DNS caches turn "FreeBSD.org" into "freebsd.org", which was causing the printed SRV records to not match our regex. PR: 170503 MFC after:2 weeks Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh == --- head/usr.sbin/freebsd-update/freebsd-update.sh Wed Oct 12 20:19:33 2016(r307155) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Wed Oct 12 20:24:33 2016(r307156) @@ -953,7 +953,7 @@ fetch_pick_server_init () { # "$name server selection ..."; we allow either format. MLIST="_http._tcp.${SERVERNAME}" host -t srv "${MLIST}" | - sed -nE "s/${MLIST} (has SRV record|server selection) //p" | + sed -nE "s/${MLIST} (has SRV record|server selection) //Ip" | cut -f 1,2,4 -d ' ' | sed -e 's/\.$//' | sort > serverlist_full ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r307072 - in head/usr.sbin: . efivar
On 12 October 2016 at 12:55, Zbigniew Bodekwrote: > Hello Warner, > > Did you try to build world for ARMv6 on HEAD? I'm not able to do so and the > issues seems to be related to this commit (missing efivar.h file). Indeed, my tinderbox build failed for arm.arm, arm.armeb, arm.armv6, arm64.aarch64, pc98.i386, i386.i386 with /scratch/tmp/emaste/freebsd/usr.sbin/efivar/efivar.c:31:10: fatal error: 'efivar.h' file not found #include ^ I temporarily unhooked it from the build in r307157. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307130 - head/sys/dev/smbus
Author: avg Date: Wed Oct 12 06:58:01 2016 New Revision: 307130 URL: https://svnweb.freebsd.org/changeset/base/307130 Log: smbus: allow child devices to be added via hints This will allow to add slave drivers in the same fashion as for iicbus. Also, allow other code to add a child device and set its 'addr' ivar. The ivar can only be set if it's unset, it can not be changed. That could be used, for example, by a platform driver that has a precise description of the hardware and, thus, knows what drivers can handle what slaves. The slave auto-probing code is unsafe and broken because it uses 7-bit slave addresses. It's going to be removed. Note: internally the driver uses address of zero as an unset address while smbus_get_addr() returns it as -1 for compatibility reasons. The address is expected to be unset only for children that do not work with slaves like, for example, smb(4). Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D8173 Modified: head/sys/dev/smbus/smbconf.h head/sys/dev/smbus/smbus.c Modified: head/sys/dev/smbus/smbconf.h == --- head/sys/dev/smbus/smbconf.hWed Oct 12 05:50:47 2016 (r307129) +++ head/sys/dev/smbus/smbconf.hWed Oct 12 06:58:01 2016 (r307130) @@ -34,6 +34,10 @@ #define n(flags) (~(flags) & (flags)) +/* Order constants for smbus children. */ +#define SMBUS_ORDER_HINTED 20 +#define SMBUS_ORDER_PNP40 + /* * How tsleep() is called in smb_request_bus(). */ Modified: head/sys/dev/smbus/smbus.c == --- head/sys/dev/smbus/smbus.c Wed Oct 12 05:50:47 2016(r307129) +++ head/sys/dev/smbus/smbus.c Wed Oct 12 06:58:01 2016(r307130) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -41,54 +42,16 @@ __FBSDID("$FreeBSD$"); #include "smbus_if.h" #include "bus_if.h" +struct smbus_ivar +{ + uint8_t addr; +}; /* * Autoconfiguration and support routines for System Management bus */ +static void smbus_probe_device(device_t dev, u_char addr); -/* - * Device methods - */ -static int smbus_probe(device_t); -static int smbus_attach(device_t); -static int smbus_detach(device_t); - -static int smbus_child_location_str(device_t parent, device_t child, - char *buf, size_t buflen); -static int smbus_print_child(device_t parent, device_t child); -static void smbus_probe_device(device_t dev, u_char* addr); -static int smbus_read_ivar(device_t parent, device_t child, int which, - uintptr_t *result); - -static device_method_t smbus_methods[] = { -/* device interface */ -DEVMETHOD(device_probe, smbus_probe), -DEVMETHOD(device_attach,smbus_attach), -DEVMETHOD(device_detach,smbus_detach), - - /* bus interface */ - DEVMETHOD(bus_add_child,bus_generic_add_child), - DEVMETHOD(bus_child_location_str, smbus_child_location_str), - DEVMETHOD(bus_driver_added, bus_generic_driver_added), - DEVMETHOD(bus_print_child, smbus_print_child), - DEVMETHOD(bus_read_ivar,smbus_read_ivar), - - DEVMETHOD_END -}; - -driver_t smbus_driver = { -"smbus", -smbus_methods, -sizeof(struct smbus_softc), -}; - -devclass_t smbus_devclass; - -/* - * At 'probe' time, we add all the devices which we know about to the - * bus. The generic attach routine will probe and attach them if they - * are alive. - */ static int smbus_probe(device_t dev) { @@ -107,9 +70,9 @@ smbus_attach(device_t dev) mtx_init(>lock, device_get_nameunit(dev), "smbus", MTX_DEF); bus_generic_probe(dev); for (addr = SMBUS_ADDR_MIN; addr < SMBUS_ADDR_MAX; ++addr) { - sc->addrs[addr] = addr; - smbus_probe_device(dev, >addrs[addr]); + smbus_probe_device(dev, addr); } + bus_enumerate_hinted_children(dev); bus_generic_attach(dev); return (0); @@ -124,6 +87,7 @@ smbus_detach(device_t dev) error = bus_generic_detach(dev); if (error) return (error); + device_delete_children(dev); mtx_destroy(>lock); return (0); @@ -135,34 +99,78 @@ smbus_generic_intr(device_t dev, u_char } static void -smbus_probe_device(device_t dev, u_char* addr) +smbus_probe_device(device_t dev, u_char addr) { device_t child; int error; u_char cmd; u_char buf[2]; + struct smbus_ivar *devi; cmd = 0x01; - error = smbus_trans(dev, *addr, cmd, + error = smbus_trans(dev, addr, cmd, SMB_TRANS_NOCNT | SMB_TRANS_NOREPORT, NULL, 0, buf, 1, NULL); if (error == 0) {
svn commit: r307131 - head/include
Author: avg Date: Wed Oct 12 07:08:32 2016 New Revision: 307131 URL: https://svnweb.freebsd.org/changeset/base/307131 Log: install header files required development with libzfs_core libzfs_core provides a rather limited but committed (stable) interface for working with ZFS. We install libzfs_core shared library but we do not install header files required for developing programs that use the library. This change is to install the required header files libzfs_core.h, libnvpair.h and sys/nvpair.h. The headers are installed into the same locations as on illumos. Reviewed by: mav, markj Differential Revision: https://reviews.freebsd.org/D8005 Modified: head/include/Makefile Modified: head/include/Makefile == --- head/include/Makefile Wed Oct 12 06:58:01 2016(r307130) +++ head/include/Makefile Wed Oct 12 07:08:32 2016(r307131) @@ -237,6 +237,17 @@ copies: .PHONY .META cd ${.CURDIR}/../sys/teken; \ ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 teken.h \ ${DESTDIR}${INCLUDEDIR}/teken +.if ${MK_CDDL} != "no" + cd ${.CURDIR}/../cddl/contrib/opensolaris/lib/libzfs_core/common; \ + ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 libzfs_core.h \ + ${DESTDIR}${INCLUDEDIR} + cd ${.CURDIR}/../cddl/contrib/opensolaris/lib/libnvpair; \ + ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 libnvpair.h \ + ${DESTDIR}${INCLUDEDIR} + cd ${.CURDIR}/../sys/cddl/contrib/opensolaris/uts/common/sys; \ + ${INSTALL} -C ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 nvpair.h \ + ${DESTDIR}${INCLUDEDIR}/sys +.endif symlinks: .PHONY .META @${ECHO} "Setting up symlinks to kernel source tree..." ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r307072 - in head/usr.sbin: . efivar
Hello Warner, Did you try to build world for ARMv6 on HEAD? I'm not able to do so and the issues seems to be related to this commit (missing efivar.h file). Kind regards zbb 2016-10-12 0:31 GMT+02:00 Warner Losh: > Author: imp > Date: Tue Oct 11 22:31:45 2016 > New Revision: 307072 > URL: https://svnweb.freebsd.org/changeset/base/307072 > > Log: > Add efivar(1) to manipulate EFI variables. It uses a similar command > line interface to the Linux program, as well as adding a number of > useful features to make using it in shell scripts easier (since we > don't have a filesystem to fall back on interacting with). > > Differential Revision: https://reviews.freebsd.org/D8128 > Reviewed by: kib@, wblock@, Ganael Laplanche > > Added: > head/usr.sbin/efivar/ > head/usr.sbin/efivar/Makefile (contents, props changed) > head/usr.sbin/efivar/efivar.8 (contents, props changed) > head/usr.sbin/efivar/efivar.c (contents, props changed) > Modified: > head/usr.sbin/Makefile > > Modified: head/usr.sbin/Makefile > > == > --- head/usr.sbin/Makefile Tue Oct 11 22:30:41 2016(r307071) > +++ head/usr.sbin/Makefile Tue Oct 11 22:31:45 2016(r307072) > @@ -123,6 +123,7 @@ SUBDIR.${MK_BSNMP}+=bsnmpd > SUBDIR.${MK_CTM}+= ctm > SUBDIR.${MK_DIALOG}+= tzsetup > SUBDIR.${MK_DIALOG}+= bsdconfig > +SUBDIR.${MK_EFI}+= efivar > SUBDIR.${MK_FLOPPY}+= fdcontrol > SUBDIR.${MK_FLOPPY}+= fdformat > SUBDIR.${MK_FLOPPY}+= fdread > > Added: head/usr.sbin/efivar/Makefile > > == > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/efivar/Makefile Tue Oct 11 22:31:45 2016 > (r307072) > @@ -0,0 +1,8 @@ > +# $FreeBSD$ > + > +PROG= efivar > +MAN= efivar.8 > + > +LIBADD= efivar > + > +.include > > Added: head/usr.sbin/efivar/efivar.8 > > == > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/usr.sbin/efivar/efivar.8 Tue Oct 11 22:31:45 2016 > (r307072) > @@ -0,0 +1,164 @@ > +.\" Copyright (c) 2003 Netflix, Inc > +.\" 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 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$ > +.\" > +.Dd September 29, 2016 > +.Dt EFIVAR 8 > +.Os > +.Sh NAME > +.Nm efivar > +.Nd UEFI environemnt variable interaction > +.Sh SYNOPSIS > +.Nm > +.Op Fl abdDHlLNpRtw > +.Op Fl n Ar name > +.Op Fl f Ar file > +.Op Fl -append > +.Op Fl -ascii > +.Op Fl -attributes > +.Op Fl -binary > +.Op Fl -delete > +.Op Fl -fromfile Ar file > +.Op Fl -hex > +.Op Fl -list-guids > +.Op Fl -list > +.Op Fl -name Ar name > +.Op Fl -no-name > +.Op Fl -print > +.Op Fl -print-decimal > +.Op Fl -raw-guid > +.Op Fl -write > +.Ar name Ns Op = Ns Ar value > +.Sh DESCRIPTION > +This program manages > +.Dq Unified Extensible Firmware Interface > +.Pq UEFI > +environment variables. > +UEFI variables have three part: A namespace, a name and a value. > +The namespace is a GUID that's self assigned by the group defining the > +variables. > +The name is a Unicode name for the variable. > +The value is binary data. > +All Unicode data is presented to the user as UTF-8. > +.Pp > +The following options are available: > +.Bl -tag -width 20m > +.It Fl n Ar name Fl -name Ar name > +Specify the name of the variable to operate on. > +The > +.Ar name > +argument is the GUID of variable, followed by a dash, followed by the > +UEFI variable name. > +The GUID may be
svn commit: r307153 - head/sys/netinet
Author: jtl Date: Wed Oct 12 19:06:50 2016 New Revision: 307153 URL: https://svnweb.freebsd.org/changeset/base/307153 Log: The TFO server-side code contains some changes that are not conditioned on the TCP_RFC7413 kernel option. This change removes those few instructions from the packet processing path. While not strictly necessary, for the sake of consistency, I applied the new IS_FASTOPEN macro to all places in the packet processing path that used the (t_flags & TF_FASTOPEN) check. Reviewed by: hiren Sponsored by: Netflix Differential Revision:https://reviews.freebsd.org/D8219 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_input.c == --- head/sys/netinet/tcp_input.cWed Oct 12 18:49:30 2016 (r307152) +++ head/sys/netinet/tcp_input.cWed Oct 12 19:06:50 2016 (r307153) @@ -1028,7 +1028,7 @@ relocked: #endif if (!((tp->t_state == TCPS_ESTABLISHED && (thflags & TH_SYN) == 0) || (tp->t_state == TCPS_LISTEN && (thflags & TH_SYN) && - !(tp->t_flags & TF_FASTOPEN { + !IS_FASTOPEN(tp->t_flags { if (ti_locked == TI_UNLOCKED) { if (INP_INFO_TRY_RLOCK(_tcbinfo) == 0) { in_pcbref(inp); @@ -1506,7 +1506,9 @@ tcp_do_segment(struct mbuf *m, struct tc struct in_conninfo *inc; struct mbuf *mfree; struct tcpopt to; +#ifdef TCP_RFC7413 int tfo_syn; +#endif #ifdef TCPDEBUG /* @@ -1964,7 +1966,7 @@ tcp_do_segment(struct mbuf *m, struct tc goto dropwithreset; } #ifdef TCP_RFC7413 - if (tp->t_flags & TF_FASTOPEN) { + if (IS_FASTOPEN(tp->t_flags)) { /* * When a TFO connection is in SYN_RECEIVED, the * only valid packets are the initial SYN, a @@ -2398,7 +2400,7 @@ tcp_do_segment(struct mbuf *m, struct tc (tp->t_flags & TF_NEEDSYN)) { #ifdef TCP_RFC7413 if (tp->t_state == TCPS_SYN_RECEIVED && - tp->t_flags & TF_FASTOPEN) { + IS_FASTOPEN(tp->t_flags)) { tp->snd_wnd = tiwin; cc_conn_init(tp); } @@ -2461,7 +2463,7 @@ tcp_do_segment(struct mbuf *m, struct tc * snd_cwnd reduction that occurs when a TFO SYN|ACK * is retransmitted. */ - if (!(tp->t_flags & TF_FASTOPEN)) + if (!IS_FASTOPEN(tp->t_flags)) #endif cc_conn_init(tp); tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); @@ -3028,8 +3030,12 @@ dodata: /* XXX */ * case PRU_RCVD). If a FIN has already been received on this * connection then we just ignore the text. */ +#ifdef TCP_RFC7413 tfo_syn = ((tp->t_state == TCPS_SYN_RECEIVED) && - (tp->t_flags & TF_FASTOPEN)); + IS_FASTOPEN(tp->t_flags)); +#else +#definetfo_syn (false) +#endif if ((tlen || (thflags & TH_FIN) || tfo_syn) && TCPS_HAVERCVDFIN(tp->t_state) == 0) { tcp_seq save_start = th->th_seq; @@ -3253,6 +3259,9 @@ drop: if (tp != NULL) INP_WUNLOCK(tp->t_inpcb); m_freem(m); +#ifndef TCP_RFC7413 +#undef tfo_syn +#endif } /* Modified: head/sys/netinet/tcp_output.c == --- head/sys/netinet/tcp_output.c Wed Oct 12 18:49:30 2016 (r307152) +++ head/sys/netinet/tcp_output.c Wed Oct 12 19:06:50 2016 (r307153) @@ -230,7 +230,7 @@ tcp_output(struct tcpcb *tp) * For TFO connections in SYN_RECEIVED, only allow the initial * SYN|ACK and those sent by the retransmit timer. */ - if ((tp->t_flags & TF_FASTOPEN) && + if (IS_FASTOPEN(tp->t_flags) && (tp->t_state == TCPS_SYN_RECEIVED) && SEQ_GT(tp->snd_max, tp->snd_una) &&/* initial SYN|ACK sent */ (tp->snd_nxt != tp->snd_una)) /* not a retransmit */ @@ -426,7 +426,7 @@ after_sack_rexmit: * When sending additional segments following a TFO SYN|ACK, * do not include the SYN bit. */ - if ((tp->t_flags & TF_FASTOPEN) && + if (IS_FASTOPEN(tp->t_flags) && (tp->t_state == TCPS_SYN_RECEIVED)) flags &= ~TH_SYN; #endif @@ -449,7
Re: svn commit: r307072 - in head/usr.sbin: . efivar
In message, Ed Maste writes: > On 12 October 2016 at 12:55, Zbigniew Bodek wrote: > > Hello Warner, > > > > Did you try to build world for ARMv6 on HEAD? I'm not able to do so and the > > issues seems to be related to this commit (missing efivar.h file). > > Indeed, my tinderbox build failed for arm.arm, arm.armeb, arm.armv6, > arm64.aarch64, pc98.i386, i386.i386 with > > /scratch/tmp/emaste/freebsd/usr.sbin/efivar/efivar.c:31:10: fatal > error: 'efivar.h' file not found > #include > ^ > > I temporarily unhooked it from the build in r307157. > > I had the same on amd64. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r307072 - in head/usr.sbin: . efivar
I'll look into it. It worked just fine for me for all the builds I did on many different machines. Ugg. Warner On Wed, Oct 12, 2016 at 5:41 PM, Cy Schubertwrote: > In message om> > , Ed Maste writes: >> On 12 October 2016 at 12:55, Zbigniew Bodek wrote: >> > Hello Warner, >> > >> > Did you try to build world for ARMv6 on HEAD? I'm not able to do so and the >> > issues seems to be related to this commit (missing efivar.h file). >> >> Indeed, my tinderbox build failed for arm.arm, arm.armeb, arm.armv6, >> arm64.aarch64, pc98.i386, i386.i386 with >> >> /scratch/tmp/emaste/freebsd/usr.sbin/efivar/efivar.c:31:10: fatal >> error: 'efivar.h' file not found >> #include >> ^ >> >> I temporarily unhooked it from the build in r307157. >> >> > > I had the same on amd64. > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307151 - in head/sys: arm/arm arm64/arm64 mips/mips
Author: gonzo Date: Wed Oct 12 17:10:59 2016 New Revision: 307151 URL: https://svnweb.freebsd.org/changeset/base/307151 Log: INTRNG: Propagate IRQ activation error to API consumer Keep resource state consistent with INTRNG state - if intr_activate_irq fails - deactivate resource and propagate error to calling function Reviewed by: mmel Modified: head/sys/arm/arm/nexus.c head/sys/arm64/arm64/nexus.c head/sys/mips/mips/nexus.c Modified: head/sys/arm/arm/nexus.c == --- head/sys/arm/arm/nexus.cWed Oct 12 15:49:20 2016(r307150) +++ head/sys/arm/arm/nexus.cWed Oct 12 17:10:59 2016(r307151) @@ -383,7 +383,11 @@ nexus_activate_resource(device_t bus, de return (0); } else if (type == SYS_RES_IRQ) { #ifdef INTRNG - intr_activate_irq(child, r); + err = intr_activate_irq(child, r); + if (err != 0) { + rman_deactivate_resource(r); + return (err); + } #endif } return (0); Modified: head/sys/arm64/arm64/nexus.c == --- head/sys/arm64/arm64/nexus.cWed Oct 12 15:49:20 2016 (r307150) +++ head/sys/arm64/arm64/nexus.cWed Oct 12 17:10:59 2016 (r307151) @@ -347,7 +347,11 @@ nexus_activate_resource(device_t bus, de rman_set_virtual(r, (void *)vaddr); rman_set_bushandle(r, vaddr); } else if (type == SYS_RES_IRQ) { - intr_activate_irq(child, r); + err = intr_activate_irq(child, r); + if (err != 0) { + rman_deactivate_resource(r); + return (err); + } } return (0); } Modified: head/sys/mips/mips/nexus.c == --- head/sys/mips/mips/nexus.c Wed Oct 12 15:49:20 2016(r307150) +++ head/sys/mips/mips/nexus.c Wed Oct 12 17:10:59 2016(r307151) @@ -433,7 +433,11 @@ nexus_activate_resource(device_t bus, de } else if (type == SYS_RES_IRQ) { #ifdef INTRNG #ifdef FDT - intr_activate_irq(child, r); + err = intr_activate_irq(child, r); + if (err != 0) { + rman_deactivate_resource(r); + return (err); + } #else /* * INTRNG without FDT needs to have the interrupt properly ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r306680 - in head/sys: amd64/amd64 amd64/include i386/include x86/include x86/x86
On Wed, Oct 12, 2016 at 06:30:09PM +0300, Andriy Gapon wrote: > On 12/10/2016 16:45, Konstantin Belousov wrote: > > On Wed, Oct 12, 2016 at 04:25:00PM +0300, Andriy Gapon wrote: > >> On 04/10/2016 20:01, Konstantin Belousov wrote: > >>> Author: kib > >>> Date: Tue Oct 4 17:01:24 2016 > >>> New Revision: 306680 > >>> URL: https://svnweb.freebsd.org/changeset/base/306680 > >>> > >>> Log: > >>> Re-apply r306516 (by cem): > >>> > >>> Reduce the cost of TLB invalidation on x86 by using per-CPU completion > >>> flags > >>> > >>> Reduce contention during TLB invalidation operations by using a per-CPU > >>> completion flag, rather than a single atomically-updated variable. > >> > >> Kostik, > >> > >> could this commit cause a problem reported in the below links? > >> https://bz-attachments.freebsd.org/attachment.cgi?id=175614 > >> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=213371 > > > > If I am reading the report right, the problem appears on the > > 11.0-RELEASE system. The patch you reference was only applied to HEAD a > > week ago and was not merged even to stable/11. > > Sorry for the noise, then. Somehow I thought that this went into the release > branch, but obviously there was too little time for that. > > > The examination must start with backtracing the thread which owns the > > smp_ipi_mtx (shown on the screenshot). > > It looks like DDB is not in GENERIC in 11.0? Yes, DDB is absent in GENERIC 11.0 > Not sure if the reporter would be able to configure a dump device and then > save > the dump given that the panic happens in the installer. > If anyone could provide them with instructions that would be great. > > -- > Andriy Gapon > ___ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org" ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307150 - head/gnu/usr.bin/groff
Author: emaste Date: Wed Oct 12 15:49:20 2016 New Revision: 307150 URL: https://svnweb.freebsd.org/changeset/base/307150 Log: Avoid using 'head' in generating groff doc date It may not be available in certain cross build cases. Note that this is a slight change in functionality, in that now only the first line of the source ChangeLog file is processed. This is acceptable as groff will be retired and we won't encounter a possibly-different ChangeLog format. Reported by: jhibbits Tested by:jhibbits Modified: head/gnu/usr.bin/groff/mdate.sh Modified: head/gnu/usr.bin/groff/mdate.sh == --- head/gnu/usr.bin/groff/mdate.sh Wed Oct 12 15:29:22 2016 (r307149) +++ head/gnu/usr.bin/groff/mdate.sh Wed Oct 12 15:49:20 2016 (r307150) @@ -4,6 +4,5 @@ set -e test -r "$1" export LC_ALL=C -changelog_date=$(sed -E -n 's/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*$/\1/p' "$1" |\ -head -n 1) +changelog_date=$(sed -E -n '1s/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*$/\1/p' "$1") echo $(date -j -f %Y-%m-%d +"%e %B %Y" $changelog_date) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307166 - stable/11/sys/netinet
Author: jtl Date: Thu Oct 13 02:32:41 2016 New Revision: 307166 URL: https://svnweb.freebsd.org/changeset/base/307166 Log: MFC r306766: Remove declaration of un-defined function tcp_seq_subtract(). Modified: stable/11/sys/netinet/tcp_var.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_var.h == --- stable/11/sys/netinet/tcp_var.h Thu Oct 13 02:31:32 2016 (r307165) +++ stable/11/sys/netinet/tcp_var.h Thu Oct 13 02:32:41 2016 (r307166) @@ -854,7 +854,6 @@ struct sackhole *tcp_sack_output(struct voidtcp_sack_partialack(struct tcpcb *, struct tcphdr *); voidtcp_free_sackholes(struct tcpcb *tp); int tcp_newreno(struct tcpcb *, struct tcphdr *); -u_long tcp_seq_subtract(u_long, u_long ); int tcp_compute_pipe(struct tcpcb *); static inline void ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307167 - in stable/10/sys/dev/hyperv: include netvsc
Author: sephe Date: Thu Oct 13 02:38:46 2016 New Revision: 307167 URL: https://svnweb.freebsd.org/changeset/base/307167 Log: MFC 304204-304206,304252-304256 304204 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. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7500 304205 hyperv/hn: Simplify RNDIS NVS message sending. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7501 304206 hyperv/hn: Simplify RNDIS message checks on RX path. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7502 304252 hyperv/hn: Ignore the useless TX table. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7514 304253 hyperv/hn: Simplify RNDIS RX packets acknowledgement. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7515 304254 hyperv/hn: Remove reference to nvsp_msg Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7516 304255 hyperv/hn: Remove reference to nvsp_status Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7517 304256 hyperv/hn: Get rid of unused bits Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7518 Modified: stable/10/sys/dev/hyperv/include/vmbus.h stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/10/sys/dev/hyperv/netvsc/if_hnreg.h stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/vmbus.h == --- stable/10/sys/dev/hyperv/include/vmbus.hThu Oct 13 02:32:41 2016 (r307166) +++ stable/10/sys/dev/hyperv/include/vmbus.hThu Oct 13 02:38:46 2016 (r307167) @@ -84,6 +84,7 @@ struct vmbus_chanpkt_hdr { #define VMBUS_CHANPKT_TYPE_GPA 0x0009 #define VMBUS_CHANPKT_TYPE_COMP0x000b +#define VMBUS_CHANPKT_FLAG_NONE0 #define VMBUS_CHANPKT_FLAG_RC 0x0001 /* report completion */ #define VMBUS_CHANPKT_CONST_DATA(pkt) \ Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c == --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cThu Oct 13 02:32:41 2016(r307166) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cThu Oct 13 02:38:46 2016(r307167) @@ -71,7 +71,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); @@ -117,7 +117,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++) { @@ -205,9 +205,8 @@ hv_nv_init_rx_buffer_with_net_vsp(struct hn_send_ctx_init_simple(, 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)); + error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, + conn, sizeof(*conn), ); if (error != 0) { if_printf(sc->hn_ifp, "send nvs rxbuf conn failed: %d\n", error); @@ -312,9 +311,8 @@ hv_nv_init_send_buffer_with_net_vsp(stru hn_send_ctx_init_simple(, 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)); + error = hn_nvs_send(sc->hn_prichan, VMBUS_CHANPKT_FLAG_RC, + chim, sizeof(*chim), ); if (error) { if_printf(sc->hn_ifp, "send nvs chim conn failed: %d\n", error); @@ -392,9 +390,10 @@ hv_nv_destroy_rx_buffer(netvsc_dev *net_ disconn.nvs_type = HN_NVS_TYPE_RXBUF_DISCONN; disconn.nvs_sig = HN_NVS_RXBUF_SIG; -
svn commit: r307172 - stable/11/etc/periodic/security
Author: lidl Date: Thu Oct 13 03:08:32 2016 New Revision: 307172 URL: https://svnweb.freebsd.org/changeset/base/307172 Log: MFC r306696: Make 502.pfdenied find blacklistd/* filter names dynamically This change is needed to make the 520.pfdenied script find the new blacklistd/* anchor points for reporting blocked traffic. Sponsored by: The FreeBSD Foundation Modified: stable/11/etc/periodic/security/520.pfdenied Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/periodic/security/520.pfdenied == --- stable/11/etc/periodic/security/520.pfdeniedThu Oct 13 03:06:23 2016(r307171) +++ stable/11/etc/periodic/security/520.pfdeniedThu Oct 13 03:08:32 2016(r307172) @@ -44,8 +44,7 @@ rc=0 if check_yesno_period security_status_pfdenied_enable then TMP=`mktemp -t security` - touch ${TMP} - for _a in "" blacklistd + for _a in "" $(pfctl -a "blacklistd" -sA 2>/dev/null) do pfctl -a ${_a} -sr -v -z 2>/dev/null | \ nawk '{if (/^block/) {buf=$0; getline; gsub(" +"," ",$0); if ($5 > 0) print buf$0;} }' >> ${TMP} ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307173 - stable/11/sys/netinet
Author: lidl Date: Thu Oct 13 03:10:04 2016 New Revision: 307173 URL: https://svnweb.freebsd.org/changeset/base/307173 Log: MFC r306458: Properly preserve ip_tos bits for IPv4 packets Restructure code slightly to save ip_tos bits earlier. Fix the bug where the ip_tos field is zeroed out before assigning to the iptos variable. Restore the ip_tos and ip_ver fields only if they have been zeroed during the pseudo-header checksum calculation. Modified: stable/11/sys/netinet/tcp_input.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_input.c == --- stable/11/sys/netinet/tcp_input.c Thu Oct 13 03:08:32 2016 (r307172) +++ stable/11/sys/netinet/tcp_input.c Thu Oct 13 03:10:04 2016 (r307173) @@ -601,7 +601,7 @@ tcp_input(struct mbuf **mp, int *offp, i #ifdef TCP_SIGNATURE uint8_t sig_checked = 0; #endif - uint8_t iptos = 0; + uint8_t iptos; struct m_tag *fwd_tag = NULL; #ifdef INET6 struct ip6_hdr *ip6 = NULL; @@ -673,6 +673,7 @@ tcp_input(struct mbuf **mp, int *offp, i /* XXX stat */ goto drop; } + iptos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; } #endif #if defined(INET) && defined(INET6) @@ -699,6 +700,7 @@ tcp_input(struct mbuf **mp, int *offp, i th = (struct tcphdr *)((caddr_t)ip + off0); tlen = ntohs(ip->ip_len) - off0; + iptos = ip->ip_tos; if (m->m_pkthdr.csum_flags & CSUM_DATA_VALID) { if (m->m_pkthdr.csum_flags & CSUM_PSEUDO_HDR) th->th_sum = m->m_pkthdr.csum_data; @@ -719,29 +721,20 @@ tcp_input(struct mbuf **mp, int *offp, i ipov->ih_len = htons(tlen); th->th_sum = in_cksum(m, len); /* Reset length for SDT probes. */ - ip->ip_len = htons(tlen + off0); + ip->ip_len = htons(len); + /* Reset TOS bits */ + ip->ip_tos = iptos; + /* Re-initialization for later version check */ + ip->ip_v = IPVERSION; } if (th->th_sum) { TCPSTAT_INC(tcps_rcvbadsum); goto drop; } - /* Re-initialization for later version check */ - ip->ip_v = IPVERSION; } #endif /* INET */ -#ifdef INET6 - if (isipv6) - iptos = (ntohl(ip6->ip6_flow) >> 20) & 0xff; -#endif -#if defined(INET) && defined(INET6) - else -#endif -#ifdef INET - iptos = ip->ip_tos; -#endif - /* * Check that TCP offset makes sense, * pull out TCP options and adjust length. XXX ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r307148 - in head/lib/libc: gen stdlib
On Wed, 12 Oct 2016, Ed Maste wrote: Log: Add comment on use of abort() in libc Suggested by: jonathan (in review D8133) It is almost easier to fix the bugs than add the comment. Modified: head/lib/libc/gen/arc4random.c == --- head/lib/libc/gen/arc4random.c Wed Oct 12 13:51:41 2016 (r307147) +++ head/lib/libc/gen/arc4random.c Wed Oct 12 13:56:14 2016 (r307148) @@ -144,8 +144,15 @@ arc4_stir(void) arc4_init(); rs_initialized = 1; } - if (arc4_sysctl(rdat, KEYSIZE) != KEYSIZE) - abort(); /* Random sysctl cannot fail. */ + if (arc4_sysctl(rdat, KEYSIZE) != KEYSIZE) { + /* +* The sysctl cannot fail. If it does fail on some FreeBSD +* derivative or after some future change, just abort so that +* the problem will be found and fixed. abort is not normally +* suitable for a library but makes sense here. +*/ + abort(); + } The comment starts by being just wrong: 1. "The" sysctl is not used here. Instead, a wrapper arc4_sysctl() is used. The wrapper handles some but not all errors. 2. The sysctl can and does fail. It fails on: - all old kernels mixed with new userlands - with new kernels, at boot time, before the random device is seeded. I couldn't get this to happen in practice, but it used to be a large problem ("Dance fandago on keyboard to unblock"), and source code still has large warnings about it. Apparently des's preseeding based on device attach times fixes it for me. I use the new kernels with 3. The sysctl can, or at least used to, return short reads with nonzero counts. The documentation for this is well hidden, but the arc4_sysctl() wrapper exists to support short reads, or perhaps just the special case of short reads of 0, which it handles poorly by possibly spinning forever. I couldn't get this to happen either. I think it takes O_NONBLOCK. With interrupts but without O_NONBLOCK, I just got nice denial of service attacks with simple dd tests like "dd bs=200m silently truncates to 256 bytes. Then the excuse is wrong. abort() never makes sense in library functions. Here it gives very confusing errors for the delicate boot-time fandago case. Style bugs: - sentence breaks are 2 spaces in KNF, and all old code in this file follows that rule. - 'abort' is not marked up arc4_addrandom(rdat, KEYSIZE); Modified: head/lib/libc/stdlib/random.c == --- head/lib/libc/stdlib/random.c Wed Oct 12 13:51:41 2016 (r307147) +++ head/lib/libc/stdlib/random.c Wed Oct 12 13:56:14 2016 (r307148) @@ -279,8 +279,15 @@ srandomdev(void) mib[0] = CTL_KERN; mib[1] = KERN_ARND; - if (sysctl(mib, 2, state, , NULL, 0) == -1 || len != expected) + if (sysctl(mib, 2, state, , NULL, 0) == -1 || len != expected) { + /* +* The sysctl cannot fail. If it does fail on some FreeBSD This is even more broken, since it doesn't have the wrapper. All the old versions using [_]read() mishandled short reads, but this was less broken when there was a fallback. For some reason the sysctl wrapper in arc4random.c alone handled short reads. +* derivative or after some future change, just abort so that +* the problem will be found and fixed. abort is not normally +* suitable for a library but makes sense here. +*/ abort(); + } if (rand_type != TYPE_0) { fptr = [rand_sep]; There are also gratuitous namespace differences and bugs. arc4random() is less standard than random(), so it can use sysctl() without being technically broken by namespace pollution. But it uses __sysctl(), and has style bugs to declare this. OTOH, random() is now standard in POSIX, so it has a reason to use __sysctl(), but it just uses sysctl(). Both should use _sysctlbyname(), and this should be declared in namespace.h. Old code used _read() instead of read(), but that seems to be nonsense since read() is more standard than random(). The old code with the fallback to read() was not wrong (except for the missing short read heandling). It gave portability to old kernels. If the sysctl were documented, then I think its documentation would say that it acts like a special case of read (without O_NONBLOCK or EINTR handling), perhaps on a slightly different device than /dev/random, except for some technical differences for error reporting. So the read() is just as secure as the sysctl. But with no documentation, we can't tell what the differences are. Bruce ___ svn-src-all@freebsd.org mailing list
svn commit: r307165 - stable/10/sys/netinet
Author: jtl Date: Thu Oct 13 02:31:32 2016 New Revision: 307165 URL: https://svnweb.freebsd.org/changeset/base/307165 Log: MFC r306766: Remove declaration of un-defined function tcp_seq_subtract(). Modified: stable/10/sys/netinet/tcp_var.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_var.h == --- stable/10/sys/netinet/tcp_var.h Thu Oct 13 02:28:40 2016 (r307164) +++ stable/10/sys/netinet/tcp_var.h Thu Oct 13 02:31:32 2016 (r307165) @@ -764,7 +764,6 @@ struct sackhole *tcp_sack_output(struct voidtcp_sack_partialack(struct tcpcb *, struct tcphdr *); voidtcp_free_sackholes(struct tcpcb *tp); int tcp_newreno(struct tcpcb *, struct tcphdr *); -u_long tcp_seq_subtract(u_long, u_long ); int tcp_compute_pipe(struct tcpcb *); void cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307170 - stable/10/sys/dev/hyperv/utilities
Author: sephe Date: Thu Oct 13 03:00:56 2016 New Revision: 307170 URL: https://svnweb.freebsd.org/changeset/base/307170 Log: MFC 304331 hyperv/kvp: Remove unnecessary function parameter. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7550 Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.c == --- stable/10/sys/dev/hyperv/utilities/hv_kvp.c Thu Oct 13 02:58:53 2016 (r307169) +++ stable/10/sys/dev/hyperv/utilities/hv_kvp.c Thu Oct 13 03:00:56 2016 (r307170) @@ -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); /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307160 - stable/10/sys/dev/hyperv/utilities
Author: sephe Date: Thu Oct 13 01:43:15 2016 New Revision: 307160 URL: https://svnweb.freebsd.org/changeset/base/307160 Log: MFC 303822-303824 303822 hyperv/ic: Remove never used second parameter of hv_negotiate_version() Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7422 303823 hyperv/ic: Expose the receive buffer length for callers to use. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7423 303824 hyperv/ic: Pass the channel callback to hv_util_attach() The saved channel callback in util softc is actually never used. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7424 Modified: stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c stable/10/sys/dev/hyperv/utilities/hv_kvp.c stable/10/sys/dev/hyperv/utilities/hv_shutdown.c stable/10/sys/dev/hyperv/utilities/hv_timesync.c stable/10/sys/dev/hyperv/utilities/hv_util.c stable/10/sys/dev/hyperv/utilities/hv_util.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c == --- stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c Wed Oct 12 20:50:17 2016(r307159) +++ stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Oct 13 01:43:15 2016(r307160) @@ -64,7 +64,7 @@ hv_heartbeat_cb(struct vmbus_channel *ch softc = (hv_util_sc*)context; buf = softc->receive_buffer;; - recvlen = PAGE_SIZE; + recvlen = softc->ic_buflen; ret = vmbus_chan_recv(channel, buf, , ); KASSERT(ret != ENOBUFS, ("hvheartbeat recvbuf is not large enough")); /* XXX check recvlen to make sure that it contains enough data */ @@ -75,8 +75,7 @@ hv_heartbeat_cb(struct vmbus_channel *ch [sizeof(struct hv_vmbus_pipe_hdr)]; if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - hv_negotiate_version(icmsghdrp, NULL, buf); - + hv_negotiate_version(icmsghdrp, buf); } else { heartbeat_msg = (struct hv_vmbus_heartbeat_msg_data *) @@ -110,11 +109,7 @@ hv_heartbeat_probe(device_t dev) static int hv_heartbeat_attach(device_t dev) { - hv_util_sc *softc = (hv_util_sc*)device_get_softc(dev); - - softc->callback = hv_heartbeat_cb; - - return hv_util_attach(dev); + return hv_util_attach(dev, hv_heartbeat_cb); } static device_method_t heartbeat_methods[] = { Modified: stable/10/sys/dev/hyperv/utilities/hv_kvp.c == --- stable/10/sys/dev/hyperv/utilities/hv_kvp.c Wed Oct 12 20:50:17 2016 (r307159) +++ stable/10/sys/dev/hyperv/utilities/hv_kvp.c Thu Oct 13 01:43:15 2016 (r307160) @@ -629,7 +629,7 @@ hv_kvp_process_request(void *context, in kvp_buf = sc->util_sc.receive_buffer;; channel = vmbus_get_channel(sc->dev); - recvlen = 2 * PAGE_SIZE; + recvlen = sc->util_sc.ic_buflen; ret = vmbus_chan_recv(channel, kvp_buf, , ); KASSERT(ret != ENOBUFS, ("hvkvp recvbuf is not large enough")); /* XXX check recvlen to make sure that it contains enough data */ @@ -696,7 +696,7 @@ hv_kvp_process_request(void *context, in /* * Try reading next buffer */ - recvlen = 2 * PAGE_SIZE; + recvlen = sc->util_sc.ic_buflen; ret = vmbus_chan_recv(channel, kvp_buf, , ); KASSERT(ret != ENOBUFS, ("hvkvp recvbuf is not large enough")); /* XXX check recvlen to make sure that it contains enough data */ @@ -892,7 +892,6 @@ hv_kvp_attach(device_t dev) hv_kvp_sc *sc = (hv_kvp_sc*)device_get_softc(dev); - sc->util_sc.callback = hv_kvp_callback; sc->dev = dev; sema_init(>dev_sema, 0, "hv_kvp device semaphore"); mtx_init(>pending_mutex, "hv-kvp pending mutex", @@ -920,7 +919,7 @@ hv_kvp_attach(device_t dev) return (error); sc->hv_kvp_dev->si_drv1 = sc; - return hv_util_attach(dev); + return hv_util_attach(dev, hv_kvp_callback); } static int Modified: stable/10/sys/dev/hyperv/utilities/hv_shutdown.c == --- stable/10/sys/dev/hyperv/utilities/hv_shutdown.cWed Oct 12 20:50:17 2016(r307159) +++ stable/10/sys/dev/hyperv/utilities/hv_shutdown.cThu Oct 13 01:43:15 2016(r307160) @@ -68,7 +68,7 @@ hv_shutdown_cb(struct vmbus_channel *cha softc = (hv_util_sc*)context; buf = softc->receive_buffer;; - recv_len = PAGE_SIZE; + recv_len = softc->ic_buflen; ret = vmbus_chan_recv(channel, buf, _len, _id); KASSERT(ret != ENOBUFS, ("hvshutdown
svn commit: r307161 - stable/10/sys/dev/hyperv/netvsc
Author: sephe Date: Thu Oct 13 01:51:49 2016 New Revision: 307161 URL: https://svnweb.freebsd.org/changeset/base/307161 Log: MFC 303867,303901 303867 hyperv/hn: Move gpa array out of netvsc_packet. Prepare to deprecate the netvsc_packet. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7436 303901 hyperv/hn: Reorganize send done callback. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7450 Added: stable/10/sys/dev/hyperv/netvsc/if_hnvar.h - copied unchanged from r303901, head/sys/dev/hyperv/netvsc/if_hnvar.h Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c == --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cThu Oct 13 01:43:15 2016(r307160) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cThu Oct 13 01:51:49 2016(r307161) @@ -67,6 +67,12 @@ static void hv_nv_on_receive_completion( 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); +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); + +static struct hn_send_ctx hn_send_ctx_none = +HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL); /* * @@ -140,6 +146,7 @@ hv_nv_get_next_send_section(netvsc_dev * static int hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *sc) { + struct hn_send_ctx sndc; netvsc_dev *net_dev; nvsp_msg *init_pkt; int ret = 0; @@ -188,9 +195,10 @@ hv_nv_init_rx_buffer_with_net_vsp(struct /* Send the gpadl notification request */ + hn_send_ctx_init_simple(, 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)init_pkt); + init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)); if (ret != 0) { goto cleanup; } @@ -239,6 +247,7 @@ exit: static int hv_nv_init_send_buffer_with_net_vsp(struct hn_softc *sc) { + struct hn_send_ctx sndc; netvsc_dev *net_dev; nvsp_msg *init_pkt; int ret = 0; @@ -286,9 +295,10 @@ hv_nv_init_send_buffer_with_net_vsp(stru /* Send the gpadl notification request */ + hn_send_ctx_init_simple(, 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)init_pkt); + init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)); if (ret != 0) { goto cleanup; } @@ -347,8 +357,7 @@ hv_nv_destroy_rx_buffer(netvsc_dev *net_ ret = vmbus_chan_send(net_dev->sc->hn_prichan, VMBUS_CHANPKT_TYPE_INBAND, 0, revoke_pkt, sizeof(nvsp_msg), - (uint64_t)(uintptr_t)revoke_pkt); - + (uint64_t)(uintptr_t)_send_ctx_none); /* * If we failed here, we might as well return and have a leak * rather than continue and a bugchk @@ -413,9 +422,8 @@ hv_nv_destroy_send_buffer(netvsc_dev *ne NETVSC_SEND_BUFFER_ID; ret = vmbus_chan_send(net_dev->sc->hn_prichan, - VMBUS_CHANPKT_TYPE_INBAND, 0, - revoke_pkt, sizeof(nvsp_msg), - (uint64_t)(uintptr_t)revoke_pkt); + VMBUS_CHANPKT_TYPE_INBAND, 0, revoke_pkt, sizeof(nvsp_msg), + (uint64_t)(uintptr_t)_send_ctx_none); /* * If we failed here, we might as well return and have a leak * rather than continue and a bugchk @@ -465,6 +473,7 @@ static int hv_nv_negotiate_nvsp_protocol(struct hn_softc *sc, netvsc_dev *net_dev, uint32_t nvsp_ver) { + struct hn_send_ctx sndc; nvsp_msg *init_pkt; int ret; @@ -479,9 +488,10 @@ hv_nv_negotiate_nvsp_protocol(struct hn_ init_pkt->msgs.init_msgs.init.protocol_version_2 = nvsp_ver; /* Send the init request */ + hn_send_ctx_init_simple(, 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)init_pkt); + init_pkt, sizeof(nvsp_msg), (uint64_t)(uintptr_t)); if (ret != 0)
svn commit: r307162 - stable/10/sys/cam/scsi
Author: sephe Date: Thu Oct 13 01:58:49 2016 New Revision: 307162 URL: https://svnweb.freebsd.org/changeset/base/307162 Log: MFC 303944 cam/da: Add quirk for I-O Data USB Flash Disk PR: 211716 Submitted by: Jun Su Reported by:Jun Su Sponsored by: Microsoft Modified: stable/10/sys/cam/scsi/scsi_da.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/scsi/scsi_da.c == --- stable/10/sys/cam/scsi/scsi_da.cThu Oct 13 01:51:49 2016 (r307161) +++ stable/10/sys/cam/scsi/scsi_da.cThu Oct 13 01:58:49 2016 (r307162) @@ -713,6 +713,14 @@ static struct da_quirk_entry da_quirk_ta {T_DIRECT, SIP_MEDIA_REMOVABLE, "JetFlash", "Transcend*", "*"}, /*quirks*/ DA_Q_NO_RC16 }, + { + /* +* I-O Data USB Flash Disk +* PR: usb/211716 +*/ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "I-O DATA", "USB Flash Disk*", +"*"}, /*quirks*/ DA_Q_NO_RC16 + }, /* ATA/SATA devices over SAS/USB/... */ { /* Hitachi Advanced Format (4k) drives */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307163 - in head/sys: kern sys
Author: cem Date: Thu Oct 13 02:06:23 2016 New Revision: 307163 URL: https://svnweb.freebsd.org/changeset/base/307163 Log: kern_linker: Handle module-loading failures in preloaded .ko files The runtime kernel loader, linker_load_file, unloads kernel files that failed to load all of their modules. For consistency, treat preloaded (loader.conf loaded) kernel files in the same way. Reviewed by: kib Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D8200 Modified: head/sys/kern/kern_linker.c head/sys/sys/linker.h Modified: head/sys/kern/kern_linker.c == --- head/sys/kern/kern_linker.c Thu Oct 13 01:58:49 2016(r307162) +++ head/sys/kern/kern_linker.c Thu Oct 13 02:06:23 2016(r307163) @@ -1599,7 +1599,6 @@ restart: if (error) panic("cannot add dependency"); } - lf->userrefs++; /* so we can (try to) kldunload it */ error = linker_file_lookup_set(lf, MDT_SETNAME, , , NULL); if (!error) { @@ -1637,6 +1636,8 @@ restart: goto fail; } linker_file_register_modules(lf); + if (!TAILQ_EMPTY(>modules)) + lf->flags |= LINKER_FILE_MODULES; if (linker_file_lookup_set(lf, "sysinit_set", _start, _stop, NULL) == 0) sysinit_add(si_start, si_stop); @@ -1654,6 +1655,41 @@ fail: SYSINIT(preload, SI_SUB_KLD, SI_ORDER_MIDDLE, linker_preload, 0); /* + * Handle preload files that failed to load any modules. + */ +static void +linker_preload_finish(void *arg) +{ + linker_file_t lf, nlf; + + sx_xlock(_sx); + TAILQ_FOREACH_SAFE(lf, _files, link, nlf) { + /* +* If all of the modules in this file failed to load, unload +* the file and return an error of ENOEXEC. (Parity with +* linker_load_file.) +*/ + if ((lf->flags & LINKER_FILE_MODULES) != 0 && + TAILQ_EMPTY(>modules)) { + linker_file_unload(lf, LINKER_UNLOAD_FORCE); + continue; + } + + lf->flags &= ~LINKER_FILE_MODULES; + lf->userrefs++; /* so we can (try to) kldunload it */ + } + sx_xunlock(_sx); +} + +/* + * Attempt to run after all DECLARE_MODULE SYSINITs. Unfortunately they can be + * scheduled at any subsystem and order, so run this as late as possible. init + * becomes runnable in SI_SUB_KTHREAD_INIT, so go slightly before that. + */ +SYSINIT(preload_finish, SI_SUB_KTHREAD_INIT - 100, SI_ORDER_MIDDLE, +linker_preload_finish, 0); + +/* * Search for a not-loaded module by name. * * Modules may be found in the following locations: Modified: head/sys/sys/linker.h == --- head/sys/sys/linker.h Thu Oct 13 01:58:49 2016(r307162) +++ head/sys/sys/linker.h Thu Oct 13 02:06:23 2016(r307163) @@ -73,6 +73,7 @@ struct linker_file { intuserrefs; /* kldload(2) count */ intflags; #define LINKER_FILE_LINKED 0x1 /* file has been fully linked */ +#define LINKER_FILE_MODULES0x2 /* file has >0 modules at preload */ TAILQ_ENTRY(linker_file) link; /* list of all loaded files */ char* filename; /* file which was loaded */ char* pathname; /* file name with full path */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307164 - in stable/10/sys: conf dev/hyperv/include dev/hyperv/netvsc dev/hyperv/vmbus modules/hyperv/vmbus
Author: sephe Date: Thu Oct 13 02:28:40 2016 New Revision: 307164 URL: https://svnweb.freebsd.org/changeset/base/307164 Log: MFC 303945,303947-303949,303989,303992,303998,304001,304002,304109,304111 303945 hyperv/vmbus: Add macro to get channel packet data length. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7455 303947 hyperv/vmbus: Add APIs for various types of transactions. Reviewed by:Jun Su Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7456 303948 hyperv/hn: Switch to vmbus xact APIs for NVS initialization Reviewed by:Jun Su Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7457 303949 hyperv/vmbus: Use xact APIs to implement post message Hypercall APIs Avoid code duplication. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7458 303989 hyperv/hn: Simplify NDIS configuration. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7466 303992 hyperv/hn: Simplify NDIS initialization. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7467 303998 hyperv/hn: Switch to vmbus xact APIs for NVS RXBUF connection. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7469 304001 hyperv/hn: Switch to vmbus xact APIs for NVS chimney buffer connection. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7470 304002 hyperv/hn: Simplify RXBUF disconnection. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7472 304109 hyperv/hn: Simplify chimney sending buffer disconnection. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7479 304111 hyperv/hn: Switch to vmbus xact APIs for sub-channel alloc request. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7480 Added: stable/10/sys/dev/hyperv/include/vmbus_xact.h - copied, changed from r303947, head/sys/dev/hyperv/include/vmbus_xact.h stable/10/sys/dev/hyperv/netvsc/if_hnreg.h - copied, changed from r303948, head/sys/dev/hyperv/netvsc/if_hnreg.h stable/10/sys/dev/hyperv/vmbus/vmbus_xact.c - copied, changed from r303947, head/sys/dev/hyperv/vmbus/vmbus_xact.c Modified: stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/dev/hyperv/include/vmbus.h stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis.h stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h stable/10/sys/dev/hyperv/vmbus/vmbus.c stable/10/sys/dev/hyperv/vmbus/vmbus_var.h stable/10/sys/modules/hyperv/vmbus/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.amd64 == --- stable/10/sys/conf/files.amd64 Thu Oct 13 02:06:23 2016 (r307163) +++ stable/10/sys/conf/files.amd64 Thu Oct 13 02:28:40 2016 (r307164) @@ -278,6 +278,7 @@ dev/hyperv/vmbus/vmbus_br.c optional dev/hyperv/vmbus/vmbus_chan.c optionalhyperv dev/hyperv/vmbus/vmbus_et.coptionalhyperv dev/hyperv/vmbus/vmbus_if.moptionalhyperv +dev/hyperv/vmbus/vmbus_xact.c optionalhyperv dev/hyperv/vmbus/amd64/hyperv_machdep.coptional hyperv dev/hyperv/vmbus/amd64/vmbus_vector.S optionalhyperv dev/lindev/full.c optionallindev Modified: stable/10/sys/conf/files.i386 == --- stable/10/sys/conf/files.i386 Thu Oct 13 02:06:23 2016 (r307163) +++ stable/10/sys/conf/files.i386 Thu Oct 13 02:28:40 2016 (r307164) @@ -255,6 +255,7 @@ dev/hyperv/vmbus/vmbus_br.c optional dev/hyperv/vmbus/vmbus_chan.c optionalhyperv dev/hyperv/vmbus/vmbus_et.coptionalhyperv dev/hyperv/vmbus/vmbus_if.moptionalhyperv +dev/hyperv/vmbus/vmbus_xact.c optionalhyperv dev/hyperv/vmbus/i386/hyperv_machdep.c optionalhyperv dev/hyperv/vmbus/i386/vmbus_vector.S optionalhyperv dev/ichwd/ichwd.c optional ichwd
svn commit: r307168 - stable/10/sys/dev/hyperv/utilities
Author: sephe Date: Thu Oct 13 02:45:08 2016 New Revision: 307168 URL: https://svnweb.freebsd.org/changeset/base/307168 Log: MFC 304270,304273 304270 hyperv/util: Don't reference hn_softc in KVP hn_softc is private data struct. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7519 304273 hyperv/util: Factor out helper for IC device_probe DEVMETHOD Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7530 Modified: stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c stable/10/sys/dev/hyperv/utilities/hv_kvp.c stable/10/sys/dev/hyperv/utilities/hv_shutdown.c stable/10/sys/dev/hyperv/utilities/hv_timesync.c stable/10/sys/dev/hyperv/utilities/hv_util.c stable/10/sys/dev/hyperv/utilities/hv_util.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c == --- stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Oct 13 02:38:46 2016(r307167) +++ stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Oct 13 02:45:08 2016(r307168) @@ -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, _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: stable/10/sys/dev/hyperv/utilities/hv_kvp.c == --- stable/10/sys/dev/hyperv/utilities/hv_kvp.c Thu Oct 13 02:38:46 2016 (r307167) +++ stable/10/sys/dev/hyperv/utilities/hv_kvp.c Thu Oct 13 02:45:08 2016 (r307168) @@ -54,17 +54,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#include -#include -#include - #include -#include #include #include "hv_util.h" @@ -91,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_thv_kvp_dev_open; @@ -333,13 +335,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 +348,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; } } @@ -873,14 +873,8 @@ hv_kvp_dev_daemon_poll(struct cdev *dev, static int hv_kvp_probe(device_t dev) { -
svn commit: r307169 - stable/10/sys/dev/hyperv/netvsc
Author: sephe Date: Thu Oct 13 02:58:53 2016 New Revision: 307169 URL: https://svnweb.freebsd.org/changeset/base/307169 Log: MFC 304327,304329,304330 304327 hyperv/hn: Pass RX packet info to netvsc_recv. This paves to nuke netvsc_packet, which does not serves much purpose now. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7541 304329 hyperv/hn: Constify RNDIS messages on RX path. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7542 304330 hyperv/hn: Get rid of the useless netvsc_packet Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7544 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis.h stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.h stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c == --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cThu Oct 13 02:45:08 2016(r307168) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cThu Oct 13 02:58:53 2016(r307169) @@ -65,7 +65,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); @@ -843,11 +843,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 = _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); @@ -869,16 +866,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); } /* @@ -886,7 +876,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); } /* @@ -895,15 +885,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: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h == --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hThu Oct 13 02:45:08 2016(r307168) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hThu Oct 13 02:58:53 2016(r307169) @@ -274,13 +274,6 @@ typedef void (*pfn_on_send_rx_completion #define BITS_PER_LONG 32 #endif -typedef struct netvsc_packet_ { - uint16_tvlan_tci; - uint32_tstatus; - uint32_ttot_data_buf_len; - void*data; -} netvsc_packet; - typedef struct { uint8_t mac_addr[6]; /* Assumption unsigned long */ uint8_t link_state; Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c
svn commit: r307171 - stable/11/contrib/blacklist/libexec
Author: lidl Date: Thu Oct 13 03:06:23 2016 New Revision: 307171 URL: https://svnweb.freebsd.org/changeset/base/307171 Log: MFC r306695: Make blacklist-helper commands emit a message when successful The blacklistd daemon expects to see a message on stdout, instead of just relying on the exit value from any invoked programs. Change the pf filtering to create multiple filters, attached under a the "blacklist/*" anchor point. This prevents the filtering for each port's filtering rule from overwriting the previously installed filtering rule. Check for an existing filtering rule for each port, so the installation of a given filtering rule only happens once. Reinstalling the same rule resets the counters for the pf rule, and we don't want that. Sponsored by: The FreeBSD Foundation Modified: stable/11/contrib/blacklist/libexec/blacklistd-helper Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/blacklist/libexec/blacklistd-helper == --- stable/11/contrib/blacklist/libexec/blacklistd-helper Thu Oct 13 03:00:56 2016(r307170) +++ stable/11/contrib/blacklist/libexec/blacklistd-helper Thu Oct 13 03:06:23 2016(r307171) @@ -19,8 +19,8 @@ fi if [ -z "$pf" ]; then for f in npf pf ipf; do if [ -f "/etc/$f.conf" ]; then - pf="$f" - break + pf="$f" + break fi done fi @@ -54,8 +54,8 @@ add) ipf) /sbin/ipfstat -io | /sbin/ipf -I -f - >/dev/null 2>&1 echo block in quick $proto from $addr/$mask to \ - any port=$6 head port$6 | \ - /sbin/ipf -I -f - -s >/dev/null 2>&1 + any port=$6 head port$6 | \ + /sbin/ipf -I -f - -s >/dev/null 2>&1 && echo OK ;; ipfw) # use $ipfw_offset+$port for rule number @@ -64,17 +64,21 @@ add) /sbin/ipfw table $tname create type addr 2>/dev/null /sbin/ipfw -q table $tname add "$addr/$mask" /sbin/ipfw -q add $rule drop $3 from "table("$tname")" to \ - any dst-port $6 + any dst-port $6 && echo OK ;; npf) /sbin/npfctl rule "$2" add block in final $proto from \ "$addr/$mask" to any $port ;; pf) - # insert $ip/$mask into per-protocol anchored table - /sbin/pfctl -a "$2" -t "port$6" -T add "$addr/$mask" - echo "block in quick $proto fromto any $port" | \ - /sbin/pfctl -a "$2" -f - + # if the filtering rule does not exist, create it + /sbin/pfctl -a "$2/$6" -sr 2>/dev/null | \ + grep -q " " || \ + echo "block in quick $proto from to any $port" | \ + /sbin/pfctl -a "$2/$6" -f - + # insert $ip/$mask into per-protocol/port anchored table + /sbin/pfctl -a "$2/$6" -t "port$6" -T add "$addr/$mask" && \ + echo OK ;; esac ;; @@ -83,33 +87,35 @@ rem) ipf) /sbin/ipfstat -io | /sbin/ipf -I -f - >/dev/null 2>&1 echo block in quick $proto from $addr/$mask to \ - any port=$6 head port$6 | \ - /sbin/ipf -I -r -f - -s >/dev/null 2>&1 + any port=$6 head port$6 | \ + /sbin/ipf -I -r -f - -s >/dev/null 2>&1 && echo OK ;; ipfw) - /sbin/ipfw table "port$6" delete "$addr/$mask" 2>/dev/null + /sbin/ipfw table "port$6" delete "$addr/$mask" 2>/dev/null && \ + echo OK ;; npf) /sbin/npfctl rule "$2" rem-id "$7" ;; pf) - /sbin/pfctl -a "$2" -t "port$6" -T delete "$addr/$mask" + /sbin/pfctl -a "$2/$6" -t "port$6" -T delete "$addr/$mask" && \ + echo OK ;; esac ;; flush) case "$pf" in ipf) - /sbin/ipf -Z -I -Fi -s > /dev/null + /sbin/ipf -Z -I -Fi -s > /dev/null && echo OK ;; ipfw) - /sbin/ipfw table "port$6" flush 2>/dev/null + /sbin/ipfw table "port$6" flush 2>/dev/null && echo OK ;; npf) /sbin/npfctl rule "$2" flush ;; pf) - /sbin/pfctl -a "$2" -t "port$6" -T flush + /sbin/pfctl -a "$2/$6" -t "port$6" -T flush && echo OK ;; esac ;; ___ svn-src-all@freebsd.org mailing list
svn commit: r307175 - in stable/10/sys: dev/usb/net net
Author: sephe Date: Thu Oct 13 03:23:43 2016 New Revision: 307175 URL: https://svnweb.freebsd.org/changeset/base/307175 Log: MFC 304654,304722,304723 304654 net: Split RNDIS protocol structs/macros out of dev/usb/net/if_urndisreg.h So that Hyper-V can leverage them instead of rolling its own definition. Discussed with: hps Reviewed by:hps Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7592 304722 net/rndis: Add canonical RNDIS major/minor version as of today. Reviewed by:hps Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7593 304723 net/rndis: Fix RNDIS_STATUS_PENDING definition. While I'm here, sort the RNDIS status in ascending order. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7594 Added: stable/10/sys/net/rndis.h - copied, changed from r304654, head/sys/net/rndis.h Modified: stable/10/sys/dev/usb/net/if_urndis.c stable/10/sys/dev/usb/net/if_urndisreg.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/net/if_urndis.c == --- stable/10/sys/dev/usb/net/if_urndis.c Thu Oct 13 03:16:15 2016 (r307174) +++ stable/10/sys/dev/usb/net/if_urndis.c Thu Oct 13 03:23:43 2016 (r307175) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -79,17 +80,17 @@ static uether_fn_t urndis_setmulti; static uether_fn_t urndis_setpromisc; static uint32_turndis_ctrl_query(struct urndis_softc *sc, uint32_t oid, - struct urndis_query_req *msg, uint16_t len, + struct rndis_query_req *msg, uint16_t len, const void **rbuf, uint16_t *rbufsz); static uint32_turndis_ctrl_set(struct urndis_softc *sc, uint32_t oid, - struct urndis_set_req *msg, uint16_t len); + struct rndis_set_req *msg, uint16_t len); static uint32_turndis_ctrl_handle_init(struct urndis_softc *sc, - const struct urndis_comp_hdr *hdr); + const struct rndis_comp_hdr *hdr); static uint32_turndis_ctrl_handle_query(struct urndis_softc *sc, - const struct urndis_comp_hdr *hdr, const void **buf, + const struct rndis_comp_hdr *hdr, const void **buf, uint16_t *bufsz); static uint32_turndis_ctrl_handle_reset(struct urndis_softc *sc, - const struct urndis_comp_hdr *hdr); + const struct rndis_comp_hdr *hdr); static uint32_turndis_ctrl_init(struct urndis_softc *sc); static uint32_turndis_ctrl_halt(struct urndis_softc *sc); @@ -211,8 +212,8 @@ urndis_attach(device_t dev) { static struct { union { - struct urndis_query_req query; - struct urndis_set_req set; + struct rndis_query_req query; + struct rndis_set_req set; } hdr; union { uint8_t eaddr[ETHER_ADDR_LEN]; @@ -452,10 +453,10 @@ urndis_ctrl_send(struct urndis_softc *sc return (err); } -static struct urndis_comp_hdr * +static struct rndis_comp_hdr * urndis_ctrl_recv(struct urndis_softc *sc) { - struct urndis_comp_hdr *hdr; + struct rndis_comp_hdr *hdr; usb_error_t err; err = urndis_ctrl_msg(sc, UT_READ_CLASS_INTERFACE, @@ -465,7 +466,7 @@ urndis_ctrl_recv(struct urndis_softc *sc if (err != USB_ERR_NORMAL_COMPLETION) return (NULL); - hdr = (struct urndis_comp_hdr *)sc->sc_response_buf; + hdr = (struct rndis_comp_hdr *)sc->sc_response_buf; DPRINTF("type 0x%x len %u\n", le32toh(hdr->rm_type), le32toh(hdr->rm_len)); @@ -479,7 +480,7 @@ urndis_ctrl_recv(struct urndis_softc *sc } static uint32_t -urndis_ctrl_handle(struct urndis_softc *sc, struct urndis_comp_hdr *hdr, +urndis_ctrl_handle(struct urndis_softc *sc, struct rndis_comp_hdr *hdr, const void **buf, uint16_t *bufsz) { uint32_t rval; @@ -520,11 +521,11 @@ urndis_ctrl_handle(struct urndis_softc * static uint32_t urndis_ctrl_handle_init(struct urndis_softc *sc, -const struct urndis_comp_hdr *hdr) +const struct rndis_comp_hdr *hdr) { - const struct urndis_init_comp *msg; + const struct rndis_init_comp *msg; - msg = (const struct urndis_init_comp *)hdr; + msg = (const struct rndis_init_comp *)hdr; DPRINTF("len %u rid %u status 0x%x " "ver_major %u ver_minor %u devflags 0x%x medium 0x%x pktmaxcnt %u " @@ -563,12 +564,12 @@ urndis_ctrl_handle_init(struct urndis_so static uint32_t urndis_ctrl_handle_query(struct urndis_softc *sc, -
svn commit: r307176 - stable/10/sys/dev/hyperv/netvsc
Author: sephe Date: Thu Oct 13 04:24:34 2016 New Revision: 307176 URL: https://svnweb.freebsd.org/changeset/base/307176 Log: MFC 304724,304728 304724 hyperv/hn: Remove the redundant rid setting for RNDIS HALT. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7595 304728 hyperv/hn: Log a warning for RESET_CMPLT. RESET is not used by the hn(4) at all, and RESET_CMPLT does not even have a rid to match with the pending requests. So, let's put it onto an independent switch branch and log a warning about it. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7602 Modified: stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c == --- stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Oct 13 03:23:43 2016(r307175) +++ stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c Thu Oct 13 04:24:34 2016(r307176) @@ -325,16 +325,9 @@ hv_rf_receive_response(rndis_device *dev memcpy(>response_msg, response, response->msg_len); } else { - if (response->ndis_msg_type == REMOTE_NDIS_RESET_CMPLT) { - /* Does not have a request id field */ - request->response_msg.msg.reset_complete.status = - STATUS_BUFFER_OVERFLOW; - } else { - request->response_msg.msg.init_complete.status = - STATUS_BUFFER_OVERFLOW; - } + request->response_msg.msg.init_complete.status = + STATUS_BUFFER_OVERFLOW; } - sema_post(>wait_sema); } } @@ -567,29 +560,40 @@ hv_rf_on_receive(struct hn_softc *sc, st rndis_hdr = data; switch (rndis_hdr->ndis_msg_type) { - /* data message */ case REMOTE_NDIS_PACKET_MSG: hv_rf_receive_data(rxr, data, dlen); break; + /* completion messages */ case REMOTE_NDIS_INITIALIZE_CMPLT: case REMOTE_NDIS_QUERY_CMPLT: case REMOTE_NDIS_SET_CMPLT: - case REMOTE_NDIS_RESET_CMPLT: case REMOTE_NDIS_KEEPALIVE_CMPLT: hv_rf_receive_response(rndis_dev, rndis_hdr); break; + /* notification message */ case REMOTE_NDIS_INDICATE_STATUS_MSG: hv_rf_receive_indicate_status(rndis_dev, rndis_hdr); break; + + case REMOTE_NDIS_RESET_CMPLT: + /* +* Reset completed, no rid. +* +* NOTE: +* RESET is not issued by hn(4), so this message should +* _not_ be observed. +*/ + if_printf(sc->hn_ifp, "RESET CMPLT received\n"); + break; + default: - printf("hv_rf_on_receive(): Unknown msg_type 0x%x\n", + if_printf(sc->hn_ifp, "unknown RNDIS message 0x%x\n", rndis_hdr->ndis_msg_type); break; } - return (0); } @@ -929,7 +933,6 @@ static int hv_rf_halt_device(rndis_device *device) { rndis_request *request; - rndis_halt_request *halt; int i, ret; /* Attempt to do a rndis device halt */ @@ -942,12 +945,6 @@ hv_rf_halt_device(rndis_device *device) /* initialize "poor man's semaphore" */ request->halt_complete_flag = 0; - /* Set up the rndis set */ - halt = >request_msg.msg.halt_request; - halt->request_id = atomic_fetchadd_int(>new_request_id, 1); - /* Increment to get the new value (call above returns old value) */ - halt->request_id += 1; - ret = hv_rf_send_request(device, request, REMOTE_NDIS_HALT_MSG); if (ret != 0) { return (-1); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307174 - stable/10/sys/dev/hyperv/netvsc
Author: sephe Date: Thu Oct 13 03:16:15 2016 New Revision: 307174 URL: https://svnweb.freebsd.org/changeset/base/307174 Log: MFC 304441,30,304446,304447,304591,304593-304595 304441 hyperv/hn: Move NVS version to softc Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7553 30 hyperv/hn: Remove assign-only struct field Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7554 304446 hyperv/hn: Remove the useless num_channel Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7555 304447 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. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7556 304591 hyperv/hn: Move chimney sending buffer to hn_softc And don't recreate chimney sending buffer for each primary channel open, it is now created in device_attach DEVMETHOD and destroyed in device_detach DEVMETHOD. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7574 304593 hyperv/hn: Get rid of netvsc_dev Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7575 304594 hyperv/hn: Factor out function to execute NVS transactions. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7577 304595 hyperv/hn: Factor out function to simplify NVS request sending Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7578 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.h stable/10/sys/dev/hyperv/netvsc/if_hnvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c == --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cThu Oct 13 03:10:04 2016(r307173) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cThu Oct 13 03:16:15 2016(r307174) @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -58,85 +59,78 @@ 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_destroy_send_buffer(netvsc_dev *net_dev); -static int hv_nv_destroy_rx_buffer(netvsc_dev *net_dev); +static int hv_nv_init_rx_buffer_with_net_vsp(struct hn_softc *, int); +static int hv_nv_destroy_send_buffer(struct hn_softc *sc); +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, +static void hv_nv_on_send_completion(struct hn_softc *sc, struct vmbus_channel *, const struct vmbus_chanpkt_hdr *pkt); static void hv_nv_on_receive_completion(struct vmbus_channel *chan, uint64_t tid); -static void hv_nv_on_receive(netvsc_dev *net_dev, +static void hv_nv_on_receive(struct hn_softc *sc, struct hn_rx_ring *rxr, struct vmbus_channel *chan, 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, +struct hn_softc *, struct vmbus_channel *chan, const void *, int); +static void hn_nvs_sent_xact(struct hn_send_ctx *, struct hn_softc *sc, +struct vmbus_channel *, const void *, int); static struct hn_send_ctx hn_send_ctx_none = HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL); -/* - * - */ -static inline netvsc_dev * -hv_nv_alloc_net_device(struct hn_softc *sc) +uint32_t +hn_chim_alloc(struct hn_softc *sc) { - netvsc_dev *net_dev; + int i, bmap_cnt = sc->hn_chim_bmap_cnt; + u_long *bmap = sc->hn_chim_bmap; + uint32_t ret = HN_NVS_CHIM_IDX_INVALID; - net_dev = malloc(sizeof(netvsc_dev), M_NETVSC, M_WAITOK | M_ZERO); + for (i = 0; i < bmap_cnt; ++i) { + int idx; - net_dev->sc = sc; - net_dev->destroy = FALSE; - sc->net_dev = net_dev; + idx = ffsl(~bmap[i]); + if (idx == 0) + continue; - return (net_dev); -} + --idx; /* ffsl is 1-based */ + KASSERT(i * LONG_BIT + idx < sc->hn_chim_cnt, + ("invalid i %d and idx %d",
Re: svn commit: r307070 - in head/sys: amd64/amd64 conf dev/efidev i386/include modules/efirt sys
Yea, I'd made most of those changes in git and lost them :( Warner On Wed, Oct 12, 2016 at 5:49 AM, Konstantin Belousovwrote: > On Tue, Oct 11, 2016 at 10:24:30PM +, Warner Losh wrote: > >> Added: head/sys/dev/efidev/efidev.c >> == >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sys/dev/efidev/efidev.c Tue Oct 11 22:24:30 2016 >> (r307070) >> @@ -0,0 +1,199 @@ >> +/*- >> + * Copyright (c) 2016 Netflix, Inc. >> + * 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 >> + *in this position and unchanged. >> + * 2. Redistributions in binary form must reproduce the above copyright >> + *notice, this list of conditions and the following disclaimer in the >> + *documentation and/or other materials provided with the distribution. >> + * >> + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR >> + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES >> + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. >> + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, >> + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT >> + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, >> + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY >> + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >> + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF >> + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >> + */ >> + >> +#include >> +__FBSDID("$FreeBSD$"); >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#include > As I asked in review, please use , not > >> +#include >> + >> +static d_ioctl_t efidev_ioctl; >> + >> +static struct cdevsw efi_cdevsw = { >> + .d_name = "efi", >> + .d_version = D_VERSION, >> + .d_ioctl = efidev_ioctl, >> +}; >> + >> +/* ARGSUSED */ >> +static int >> +efidev_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t addr, >> +int flags __unused, struct thread *td __unused) >> +{ >> + int error; >> + >> + switch (cmd) { >> + case EFIIOC_GET_TABLE: >> + { >> + struct efi_get_table_ioc *egtioc = >> + (struct efi_get_table_ioc *)addr; >> + >> + error = efi_get_table(>uuid, >ptr); >> + break; >> + } >> + case EFIIOC_GET_TIME: >> + { >> + struct efi_tm *tm = (struct efi_tm *)addr; >> + >> + error = efi_get_time(tm); >> + break; >> + } >> + case EFIIOC_SET_TIME: >> + { >> + struct efi_tm *tm = (struct efi_tm *)addr; >> + >> + error = efi_set_time(tm); >> + break; >> + } >> + case EFIIOC_VAR_GET: >> + { >> + struct efi_var_ioc *ev = (struct efi_var_ioc *)addr; >> + void *data; >> + efi_char *name; >> + >> + data = malloc(ev->datasize, M_TEMP, M_WAITOK); >> + name = malloc(ev->namesize, M_TEMP, M_WAITOK); >> + error = copyin(ev->name, name, ev->namesize); >> + if (error) >> + goto vg_out; >> + if (name[ev->namesize / sizeof(efi_char) - 1] != 0) { >> + error = EINVAL; >> + goto vg_out; >> + } >> + >> + error = efi_var_get(name, >vendor, >attrib, >> + >datasize, data); >> + >> + if (error == 0) { >> + error = copyout(data, ev->data, ev->datasize); >> + } else if (error == EOVERFLOW) { >> + /* >> + * Pass back the size we really need, but >> + * convert the error to 0 so the copyout >> + * happens. datasize was updated in the >> + * efi_var_get call. >> + */ >> + ev->data = NULL; >> + error = 0; >> + } >> +vg_out: >> + free(data, M_TEMP); >> + free(name, M_TEMP); >> + break; >> + } >> + case EFIIOC_VAR_NEXT: >> + { >> + struct efi_var_ioc *ev = (struct efi_var_ioc *)addr; >> + efi_char *name; >> + >> + name = malloc(ev->namesize, M_TEMP, M_WAITOK); >> + if (name == NULL) { > The check is for impossible condition. > >> + error = ENOMEM; >> + goto vn_out; >> +
svn commit: r307177 - stable/10/sys/dev/hyperv/utilities
Author: sephe Date: Thu Oct 13 04:32:55 2016 New Revision: 307177 URL: https://svnweb.freebsd.org/changeset/base/307177 Log: MFC 304730 hyperv/ic: Redefine IC version negotiate message. And stringent input IC version negotiate message checks. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7614 Added: stable/10/sys/dev/hyperv/utilities/vmbus_icreg.h - copied unchanged from r304730, head/sys/dev/hyperv/utilities/vmbus_icreg.h Modified: stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c stable/10/sys/dev/hyperv/utilities/hv_shutdown.c stable/10/sys/dev/hyperv/utilities/hv_timesync.c stable/10/sys/dev/hyperv/utilities/hv_util.c stable/10/sys/dev/hyperv/utilities/hv_util.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c == --- stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Oct 13 04:24:34 2016(r307176) +++ stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c Thu Oct 13 04:32:55 2016(r307177) @@ -80,7 +80,11 @@ hv_heartbeat_cb(struct vmbus_channel *ch [sizeof(struct hv_vmbus_pipe_hdr)]; if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - hv_negotiate_version(icmsghdrp, buf); + int error; + + error = vmbus_ic_negomsg(softc, buf, recvlen); + if (error) + return; } else { heartbeat_msg = (struct hv_vmbus_heartbeat_msg_data *) Modified: stable/10/sys/dev/hyperv/utilities/hv_shutdown.c == --- stable/10/sys/dev/hyperv/utilities/hv_shutdown.cThu Oct 13 04:24:34 2016(r307176) +++ stable/10/sys/dev/hyperv/utilities/hv_shutdown.cThu Oct 13 04:32:55 2016(r307177) @@ -85,7 +85,11 @@ hv_shutdown_cb(struct vmbus_channel *cha [sizeof(struct hv_vmbus_pipe_hdr)]; if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - hv_negotiate_version(icmsghdrp, buf); + int error; + + error = vmbus_ic_negomsg(softc, buf, recv_len); + if (error) + return; } else { shutdown_msg = (struct hv_vmbus_shutdown_msg_data *) Modified: stable/10/sys/dev/hyperv/utilities/hv_timesync.c == --- stable/10/sys/dev/hyperv/utilities/hv_timesync.cThu Oct 13 04:24:34 2016(r307176) +++ stable/10/sys/dev/hyperv/utilities/hv_timesync.cThu Oct 13 04:32:55 2016(r307177) @@ -160,7 +160,11 @@ hv_timesync_cb(struct vmbus_channel *cha sizeof(struct hv_vmbus_pipe_hdr)]; if (icmsghdrp->icmsgtype == HV_ICMSGTYPE_NEGOTIATE) { - hv_negotiate_version(icmsghdrp, time_buf); + int error; + + error = vmbus_ic_negomsg(>util_sc, time_buf, recvlen); + if (error) + return; } else { timedatap = (struct hv_ictimesync_data *) _buf[ sizeof(struct hv_vmbus_pipe_hdr) + Modified: stable/10/sys/dev/hyperv/utilities/hv_util.c == --- stable/10/sys/dev/hyperv/utilities/hv_util.cThu Oct 13 04:24:34 2016(r307176) +++ stable/10/sys/dev/hyperv/utilities/hv_util.cThu Oct 13 04:32:55 2016(r307177) @@ -36,44 +36,62 @@ #include #include #include +#include #include -#include #include #include -#include #include +#include #include "vmbus_if.h" #define VMBUS_IC_BRSIZE(4 * PAGE_SIZE) -void -hv_negotiate_version(struct hv_vmbus_icmsg_hdr *icmsghdrp, uint8_t *buf) +CTASSERT(sizeof(struct vmbus_icmsg_negotiate) < VMBUS_IC_BRSIZE); + +int +vmbus_ic_negomsg(struct hv_util_sc *sc, void *data, int dlen) { - struct hv_vmbus_icmsg_negotiate *negop; + struct vmbus_icmsg_negotiate *nego; + int cnt, major; - icmsghdrp->icmsgsize = 0x10; + /* +* Preliminary message size verification +*/ + if (dlen < sizeof(*nego)) { + device_printf(sc->ic_dev, "truncated ic negotiate, len %d\n", + dlen); + return EINVAL; + } + nego = data; - negop = (struct hv_vmbus_icmsg_negotiate *)[ - sizeof(struct hv_vmbus_pipe_hdr) + - sizeof(struct hv_vmbus_icmsg_hdr)]; - - if (negop->icframe_vercnt >= 2 && - negop->icversion_data[1].major == 3) { - negop->icversion_data[0].major = 3; - negop->icversion_data[0].minor = 0; - negop->icversion_data[1].major = 3; -
svn commit: r307178 - in stable/10/sys: dev/hyperv/netvsc net
Author: sephe Date: Thu Oct 13 05:20:31 2016 New Revision: 307178 URL: https://svnweb.freebsd.org/changeset/base/307178 Log: MFC 304783-304785 304783 hyperv/hn: Use definition in net/rndis.h for message type and status code. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7620 304784 hyperv/hn: Add compat code for RNDIS reorganization phase. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7621 304785 hyperv/hn: Use vmbus xact for RNDIS initialize. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7624 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis.h stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h stable/10/sys/net/rndis.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c == --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cThu Oct 13 04:32:55 2016(r307177) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cThu Oct 13 05:20:31 2016(r307178) @@ -76,7 +76,7 @@ static void hn_nvs_sent_none(struct hn_s static void hn_nvs_sent_xact(struct hn_send_ctx *, struct hn_softc *sc, struct vmbus_channel *, const void *, int); -static struct hn_send_ctx hn_send_ctx_none = +struct hn_send_ctx hn_send_ctx_none = HN_SEND_CTX_INITIALIZER(hn_nvs_sent_none, NULL); uint32_t Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h == --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hThu Oct 13 04:32:55 2016(r307177) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hThu Oct 13 05:20:31 2016(r307178) @@ -239,6 +239,11 @@ typedef struct { uint8_t link_state; } netvsc_device_info; +#define HN_XACT_REQ_PGCNT 2 +#define HN_XACT_RESP_PGCNT 2 +#define HN_XACT_REQ_SIZE (HN_XACT_REQ_PGCNT * PAGE_SIZE) +#define HN_XACT_RESP_SIZE (HN_XACT_RESP_PGCNT * PAGE_SIZE) + #ifndef HN_USE_TXDESC_BUFRING struct hn_txdesc; SLIST_HEAD(hn_txdesc_list, hn_txdesc); @@ -376,6 +381,8 @@ typedef struct hn_softc { uint32_thn_chim_gpadl; struct hyperv_dma hn_chim_dma; + + uint32_thn_rndis_rid; } hn_softc_t; #define HN_FLAG_RXBUF_CONNECTED0x0001 Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Oct 13 04:32:55 2016(r307177) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Thu Oct 13 05:20:31 2016(r307178) @@ -127,9 +127,6 @@ __FBSDID("$FreeBSD$"); /* Short for Hyper-V network interface */ #define NETVSC_DEVNAME"hn" -#define HN_XACT_REQ_SIZE (2 * PAGE_SIZE) -#define HN_XACT_RESP_SIZE (2 * PAGE_SIZE) - /* * It looks like offset 0 of buf is reserved to hold the softc pointer. * The sc pointer evidently not needed, and is not presently populated. Modified: stable/10/sys/dev/hyperv/netvsc/hv_rndis.h == --- stable/10/sys/dev/hyperv/netvsc/hv_rndis.h Thu Oct 13 04:32:55 2016 (r307177) +++ stable/10/sys/dev/hyperv/netvsc/hv_rndis.h Thu Oct 13 05:20:31 2016 (r307178) @@ -31,6 +31,7 @@ #ifndef __HV_RNDIS_H__ #define __HV_RNDIS_H__ +#include /* * NDIS protocol version numbers @@ -48,95 +49,6 @@ #define NDIS_VERSION(NDIS_VERSION_5_1) /* - * Status codes - */ - -#define STATUS_SUCCESS (0xL) -#define STATUS_UNSUCCESSFUL (0xC001L) -#define STATUS_PENDING (0x0103L) -#define STATUS_INSUFFICIENT_RESOURCES (0xC09AL) -#define STATUS_BUFFER_OVERFLOW (0x8005L) -#define STATUS_NOT_SUPPORTED(0xC0BBL) - -#define RNDIS_STATUS_SUCCESS(STATUS_SUCCESS) -#define RNDIS_STATUS_PENDING(STATUS_PENDING) -#define RNDIS_STATUS_NOT_RECOGNIZED (0x00010001L) -#define RNDIS_STATUS_NOT_COPIED (0x00010002L) -#define RNDIS_STATUS_NOT_ACCEPTED (0x00010003L) -#define RNDIS_STATUS_CALL_ACTIVE(0x00010007L) - -#define RNDIS_STATUS_ONLINE (0x40010003L) -#define RNDIS_STATUS_RESET_START(0x40010004L) -#define RNDIS_STATUS_RESET_END