From owner-svn-src-head@freebsd.org Sun Mar 25 00:57:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30E33F5D4E7; Sun, 25 Mar 2018 00:57:01 +0000 (UTC) (envelope-from mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4C01690CB; Sun, 25 Mar 2018 00:57:00 +0000 (UTC) (envelope-from mp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0A0516EA0; Sun, 25 Mar 2018 00:57:00 +0000 (UTC) (envelope-from mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2P0v0Ea081045; Sun, 25 Mar 2018 00:57:00 GMT (envelope-from mp@FreeBSD.org) Received: (from mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2P0v0lA081039; Sun, 25 Mar 2018 00:57:00 GMT (envelope-from mp@FreeBSD.org) Message-Id: <201803250057.w2P0v0lA081039@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mp set sender to mp@FreeBSD.org using -f From: Mark Peek Date: Sun, 25 Mar 2018 00:57:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci X-SVN-Group: head X-SVN-Commit-Author: mp X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci X-SVN-Commit-Revision: 331510 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 00:57:01 -0000 Author: mp Date: Sun Mar 25 00:57:00 2018 New Revision: 331510 URL: https://svnweb.freebsd.org/changeset/base/331510 Log: Add VMCI (Virtual Machine Communication Interface) driver In a virtual machine, VMCI is exposed as a regular PCI device. The primary communication mechanisms supported are a point-to-point bidirectional transport based on a pair of memory-mapped queues, and asynchronous notifications in the form of datagrams and doorbells. These features are available to kernel level components such as vSockets through the VMCI kernel API. In addition to this, the VMCI kernel API provides support for receiving events related to the state of the VMCI communication channels, and the virtual machine itself. Submitted by: Vishnu Dasa Reviewed by: bcr, imp Obtained from: VMware Differential Revision: https://reviews.freebsd.org/D14289 Added: head/share/man/man4/vmci.4 (contents, props changed) head/sys/dev/vmware/vmci/ head/sys/dev/vmware/vmci/vmci.c (contents, props changed) head/sys/dev/vmware/vmci/vmci.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_call_defs.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_datagram.c (contents, props changed) head/sys/dev/vmware/vmci/vmci_datagram.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_defs.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_doorbell.c (contents, props changed) head/sys/dev/vmware/vmci/vmci_doorbell.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_driver.c (contents, props changed) head/sys/dev/vmware/vmci/vmci_driver.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_event.c (contents, props changed) head/sys/dev/vmware/vmci/vmci_event.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_hashtable.c (contents, props changed) head/sys/dev/vmware/vmci/vmci_hashtable.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_kernel_api.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_kernel_api_1.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_kernel_api_2.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_kernel_defs.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_kernel_if.c (contents, props changed) head/sys/dev/vmware/vmci/vmci_kernel_if.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_qpair.c (contents, props changed) head/sys/dev/vmware/vmci/vmci_queue.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_queue_pair.c (contents, props changed) head/sys/dev/vmware/vmci/vmci_queue_pair.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_resource.c (contents, props changed) head/sys/dev/vmware/vmci/vmci_resource.h (contents, props changed) head/sys/dev/vmware/vmci/vmci_utils.h (contents, props changed) head/sys/modules/vmware/vmci/ head/sys/modules/vmware/vmci/Makefile (contents, props changed) Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/modules/vmware/Makefile Added: head/share/man/man4/vmci.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/vmci.4 Sun Mar 25 00:57:00 2018 (r331510) @@ -0,0 +1,71 @@ +.\" Copyright (c) 2018 VMware, Inc. All Rights Reserved. +.\" +.\" SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0) +.\" +.\" $FreeBSD$ +.Dd February 10, 2018 +.Dt VMCI 4 +.Os +.Sh NAME +.Nm vmci +.Nd VMware Virtual Machine Communication Interface +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device vmci" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_vmci_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for the VMware Virtual Machine Communication Interface +(VMCI) in virtual machines by VMware. +.Pp +VMCI allows virtual machines to communicate with host kernel modules and the +VMware hypervisors. +User level applications in a virtual machine can use VMCI through vSockets +(also known as VMCI Sockets and not included in this kernel module), a socket +address family designed to be compatible with UDP and TCP at the interface +level. +Today, VMCI and vSockets are used by various VMware Tools components inside +the guest for zero-config, network-less access to VMware host services. +In addition to this, VMware's users are using vSockets for various +applications, where network access of the virtual machine is restricted +or non-existent. +Examples of this are VMs communicating with device proxies for proprietary +hardware running as host applications and automated testing of applications +running within virtual machines. +.Pp +In a virtual machine, VMCI is exposed as a regular PCI device. +The primary communication mechanisms supported are a point-to-point +bidirectional transport based on a pair of memory-mapped queues, and +asynchronous notifications in the form of datagrams and doorbells. +These features are available to kernel level components such as vSockets +through the VMCI kernel API. +In addition to this, the VMCI kernel API provides support for receiving +events related to the state of the VMCI communication channels, and the +virtual machine itself. +.Sh SEE ALSO +.Xr pci 9 , +.Xr socket 2 +.Rs +.%T "VMware vSockets Documentation" +.%U https://www.vmware.com/support/developer/vmci-sdk/ +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +The +.Nm +driver and man page were written by +.An Vishnu Dasa Aq Mt vdasahar@gmail.com . Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Sun Mar 25 00:50:27 2018 (r331509) +++ head/sys/conf/files.amd64 Sun Mar 25 00:57:00 2018 (r331510) @@ -475,6 +475,16 @@ dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_x86.c optional uart dev/viawd/viawd.c optional viawd dev/vmware/vmxnet3/if_vmx.c optional vmx +dev/vmware/vmci/vmci.c optional vmci +dev/vmware/vmci/vmci_datagram.c optional vmci +dev/vmware/vmci/vmci_doorbell.c optional vmci +dev/vmware/vmci/vmci_driver.c optional vmci +dev/vmware/vmci/vmci_event.c optional vmci +dev/vmware/vmci/vmci_hashtable.c optional vmci +dev/vmware/vmci/vmci_kernel_if.c optional vmci +dev/vmware/vmci/vmci_qpair.c optional vmci +dev/vmware/vmci/vmci_queue_pair.c optional vmci +dev/vmware/vmci/vmci_resource.c optional vmci dev/wbwd/wbwd.c optional wbwd dev/xen/pci/xen_acpi_pci.c optional xenhvm dev/xen/pci/xen_pci.c optional xenhvm Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Sun Mar 25 00:50:27 2018 (r331509) +++ head/sys/conf/files.i386 Sun Mar 25 00:57:00 2018 (r331510) @@ -327,6 +327,16 @@ dev/tpm/tpm_isa.c optional tpm isa dev/uart/uart_cpu_x86.c optional uart dev/viawd/viawd.c optional viawd dev/vmware/vmxnet3/if_vmx.c optional vmx +dev/vmware/vmci/vmci.c optional vmci +dev/vmware/vmci/vmci_datagram.c optional vmci +dev/vmware/vmci/vmci_doorbell.c optional vmci +dev/vmware/vmci/vmci_driver.c optional vmci +dev/vmware/vmci/vmci_event.c optional vmci +dev/vmware/vmci/vmci_hashtable.c optional vmci +dev/vmware/vmci/vmci_kernel_if.c optional vmci +dev/vmware/vmci/vmci_qpair.c optional vmci +dev/vmware/vmci/vmci_queue_pair.c optional vmci +dev/vmware/vmci/vmci_resource.c optional vmci dev/acpica/acpi_if.m standard dev/acpica/acpi_hpet.c optional acpi dev/acpica/acpi_timer.c optional acpi Added: head/sys/dev/vmware/vmci/vmci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/vmware/vmci/vmci.c Sun Mar 25 00:57:00 2018 (r331510) @@ -0,0 +1,1177 @@ +/*- + * Copyright (c) 2018 VMware, Inc. All Rights Reserved. + * + * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0) + */ + +/* Driver for VMware Virtual Machine Communication Interface (VMCI) device. */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +#include "vmci.h" +#include "vmci_doorbell.h" +#include "vmci_driver.h" +#include "vmci_kernel_defs.h" +#include "vmci_queue_pair.h" + +static int vmci_probe(device_t); +static int vmci_attach(device_t); +static int vmci_detach(device_t); +static int vmci_shutdown(device_t); + +static int vmci_map_bars(struct vmci_softc *); +static void vmci_unmap_bars(struct vmci_softc *); + +static int vmci_config_capabilities(struct vmci_softc *); + +static int vmci_dma_malloc_int(struct vmci_softc *, bus_size_t, + bus_size_t, struct vmci_dma_alloc *); +static void vmci_dma_free_int(struct vmci_softc *, + struct vmci_dma_alloc *); + +static int vmci_config_interrupts(struct vmci_softc *); +static int vmci_config_interrupt(struct vmci_softc *); +static int vmci_check_intr_cnt(struct vmci_softc *); +static int vmci_allocate_interrupt_resources(struct vmci_softc *); +static int vmci_setup_interrupts(struct vmci_softc *); +static void vmci_dismantle_interrupts(struct vmci_softc *); +static void vmci_interrupt(void *); +static void vmci_interrupt_bm(void *); +static void dispatch_datagrams(void *, int); +static void process_bitmap(void *, int); + +static void vmci_delayed_work_fn_cb(void *context, int data); + +static device_method_t vmci_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, vmci_probe), + DEVMETHOD(device_attach, vmci_attach), + DEVMETHOD(device_detach, vmci_detach), + DEVMETHOD(device_shutdown, vmci_shutdown), + + DEVMETHOD_END +}; + +static driver_t vmci_driver = { + "vmci", vmci_methods, sizeof(struct vmci_softc) +}; + +static devclass_t vmci_devclass; +DRIVER_MODULE(vmci, pci, vmci_driver, vmci_devclass, 0, 0); +MODULE_VERSION(vmci, VMCI_VERSION); + +MODULE_DEPEND(vmci, pci, 1, 1, 1); + +static struct vmci_softc *vmci_sc; + +#define LGPFX "vmci: " +/* + * Allocate a buffer for incoming datagrams globally to avoid repeated + * allocation in the interrupt handler's atomic context. + */ +static uint8_t *data_buffer = NULL; +static uint32_t data_buffer_size = VMCI_MAX_DG_SIZE; + +struct vmci_delayed_work_info { + vmci_work_fn *work_fn; + void *data; + vmci_list_item(vmci_delayed_work_info) entry; +}; + +/* + *------------------------------------------------------------------------------ + * + * vmci_probe -- + * + * Probe to see if the VMCI device is present. + * + * Results: + * BUS_PROBE_DEFAULT if device exists, ENXIO otherwise. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +static int +vmci_probe(device_t dev) +{ + + if (pci_get_vendor(dev) == VMCI_VMWARE_VENDOR_ID && + pci_get_device(dev) == VMCI_VMWARE_DEVICE_ID) { + device_set_desc(dev, + "VMware Virtual Machine Communication Interface"); + + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_attach -- + * + * Attach VMCI device to the system after vmci_probe() has been called and + * the device has been detected. + * + * Results: + * 0 if success, ENXIO otherwise. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +static int +vmci_attach(device_t dev) +{ + struct vmci_softc *sc; + int error, i; + + sc = device_get_softc(dev); + sc->vmci_dev = dev; + vmci_sc = sc; + + data_buffer = NULL; + sc->vmci_num_intr = 0; + for (i = 0; i < VMCI_MAX_INTRS; i++) { + sc->vmci_intrs[i].vmci_irq = NULL; + sc->vmci_intrs[i].vmci_handler = NULL; + } + + TASK_INIT(&sc->vmci_interrupt_dq_task, 0, dispatch_datagrams, sc); + TASK_INIT(&sc->vmci_interrupt_bm_task, 0, process_bitmap, sc); + + TASK_INIT(&sc->vmci_delayed_work_task, 0, vmci_delayed_work_fn_cb, sc); + + pci_enable_busmaster(dev); + + mtx_init(&sc->vmci_spinlock, "VMCI Spinlock", NULL, MTX_SPIN); + mtx_init(&sc->vmci_delayed_work_lock, "VMCI Delayed Work Lock", + NULL, MTX_DEF); + + error = vmci_map_bars(sc); + if (error) { + VMCI_LOG_ERROR(LGPFX"Failed to map PCI BARs.\n"); + goto fail; + } + + error = vmci_config_capabilities(sc); + if (error) { + VMCI_LOG_ERROR(LGPFX"Failed to configure capabilities.\n"); + goto fail; + } + + vmci_list_init(&sc->vmci_delayed_work_infos); + + vmci_components_init(); + vmci_util_init(); + error = vmci_qp_guest_endpoints_init(); + if (error) { + VMCI_LOG_ERROR(LGPFX"vmci_qp_guest_endpoints_init failed.\n"); + goto fail; + } + + error = vmci_config_interrupts(sc); + if (error) + VMCI_LOG_ERROR(LGPFX"Failed to enable interrupts.\n"); + +fail: + if (error) { + vmci_detach(dev); + return (ENXIO); + } + + return (0); +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_detach -- + * + * Detach the VMCI device. + * + * Results: + * 0 + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +static int +vmci_detach(device_t dev) +{ + struct vmci_softc *sc; + + sc = device_get_softc(dev); + + vmci_qp_guest_endpoints_exit(); + vmci_util_exit(); + + vmci_dismantle_interrupts(sc); + + vmci_components_cleanup(); + + taskqueue_drain(taskqueue_thread, &sc->vmci_delayed_work_task); + mtx_destroy(&sc->vmci_delayed_work_lock); + + if (sc->vmci_res0 != NULL) + bus_space_write_4(sc->vmci_iot0, sc->vmci_ioh0, + VMCI_CONTROL_ADDR, VMCI_CONTROL_RESET); + + if (sc->vmci_notifications_bitmap.dma_vaddr != NULL) + vmci_dma_free(&sc->vmci_notifications_bitmap); + + vmci_unmap_bars(sc); + + mtx_destroy(&sc->vmci_spinlock); + + pci_disable_busmaster(dev); + + return (0); +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_shutdown -- + * + * This function is called during system shutdown. We don't do anything. + * + * Results: + * 0 + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +static int +vmci_shutdown(device_t dev) +{ + + return (0); +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_map_bars -- + * + * Maps the PCI I/O and MMIO BARs. + * + * Results: + * 0 on success, ENXIO otherwise. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +static int +vmci_map_bars(struct vmci_softc *sc) +{ + int rid; + + /* Map the PCI I/O BAR: BAR0 */ + rid = PCIR_BAR(0); + sc->vmci_res0 = bus_alloc_resource_any(sc->vmci_dev, SYS_RES_IOPORT, + &rid, RF_ACTIVE); + if (sc->vmci_res0 == NULL) { + VMCI_LOG_ERROR(LGPFX"Could not map: BAR0\n"); + return (ENXIO); + } + + sc->vmci_iot0 = rman_get_bustag(sc->vmci_res0); + sc->vmci_ioh0 = rman_get_bushandle(sc->vmci_res0); + sc->vmci_ioaddr = rman_get_start(sc->vmci_res0); + + /* Map the PCI MMIO BAR: BAR1 */ + rid = PCIR_BAR(1); + sc->vmci_res1 = bus_alloc_resource_any(sc->vmci_dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (sc->vmci_res1 == NULL) { + VMCI_LOG_ERROR(LGPFX"Could not map: BAR1\n"); + return (ENXIO); + } + + sc->vmci_iot1 = rman_get_bustag(sc->vmci_res1); + sc->vmci_ioh1 = rman_get_bushandle(sc->vmci_res1); + + return (0); +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_unmap_bars -- + * + * Unmaps the VMCI PCI I/O and MMIO BARs. + * + * Results: + * None. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +static void +vmci_unmap_bars(struct vmci_softc *sc) +{ + int rid; + + if (sc->vmci_res0 != NULL) { + rid = PCIR_BAR(0); + bus_release_resource(sc->vmci_dev, SYS_RES_IOPORT, rid, + sc->vmci_res0); + sc->vmci_res0 = NULL; + } + + if (sc->vmci_res1 != NULL) { + rid = PCIR_BAR(1); + bus_release_resource(sc->vmci_dev, SYS_RES_MEMORY, rid, + sc->vmci_res1); + sc->vmci_res1 = NULL; + } +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_config_capabilities -- + * + * Check the VMCI device capabilities and configure the device accordingly. + * + * Results: + * 0 if success, ENODEV otherwise. + * + * Side effects: + * Device capabilities are enabled. + * + *------------------------------------------------------------------------------ + */ + +static int +vmci_config_capabilities(struct vmci_softc *sc) +{ + unsigned long bitmap_PPN; + int error; + + /* + * Verify that the VMCI device supports the capabilities that we + * need. Datagrams are necessary and notifications will be used + * if the device supports it. + */ + sc->capabilities = bus_space_read_4(sc->vmci_iot0, sc->vmci_ioh0, + VMCI_CAPS_ADDR); + + if ((sc->capabilities & VMCI_CAPS_DATAGRAM) == 0) { + VMCI_LOG_ERROR(LGPFX"VMCI device does not support " + "datagrams.\n"); + return (ENODEV); + } + + if (sc->capabilities & VMCI_CAPS_NOTIFICATIONS) { + sc->capabilities = VMCI_CAPS_DATAGRAM; + error = vmci_dma_malloc(PAGE_SIZE, 1, + &sc->vmci_notifications_bitmap); + if (error) + VMCI_LOG_ERROR(LGPFX"Failed to alloc memory for " + "notification bitmap.\n"); + else { + memset(sc->vmci_notifications_bitmap.dma_vaddr, 0, + PAGE_SIZE); + sc->capabilities |= VMCI_CAPS_NOTIFICATIONS; + } + } else + sc->capabilities = VMCI_CAPS_DATAGRAM; + + /* Let the host know which capabilities we intend to use. */ + bus_space_write_4(sc->vmci_iot0, sc->vmci_ioh0, + VMCI_CAPS_ADDR, sc->capabilities); + + /* + * Register notification bitmap with device if that capability is + * used. + */ + if (sc->capabilities & VMCI_CAPS_NOTIFICATIONS) { + bitmap_PPN = + sc->vmci_notifications_bitmap.dma_paddr >> PAGE_SHIFT; + vmci_register_notification_bitmap(bitmap_PPN); + } + + /* Check host capabilities. */ + if (!vmci_check_host_capabilities()) + return (ENODEV); + + return (0); +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_dmamap_cb -- + * + * Callback to receive mapping information resulting from the load of a + * bus_dmamap_t via bus_dmamap_load() + * + * Results: + * None. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +static void +vmci_dmamap_cb(void *arg, bus_dma_segment_t *segs, int nseg, int error) +{ + bus_addr_t *baddr = arg; + + if (error == 0) + *baddr = segs->ds_addr; +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_dma_malloc_int -- + * + * Internal function that allocates DMA memory. + * + * Results: + * 0 if success. + * ENOMEM if insufficient memory. + * EINPROGRESS if mapping is deferred. + * EINVAL if the request was invalid. + * + * Side effects: + * DMA memory is allocated. + * + *------------------------------------------------------------------------------ + */ + +static int +vmci_dma_malloc_int(struct vmci_softc *sc, bus_size_t size, bus_size_t align, + struct vmci_dma_alloc *dma) +{ + int error; + + bzero(dma, sizeof(struct vmci_dma_alloc)); + + error = bus_dma_tag_create(bus_get_dma_tag(vmci_sc->vmci_dev), + align, 0, /* alignment, bounds */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + size, /* maxsize */ + 1, /* nsegments */ + size, /* maxsegsize */ + BUS_DMA_ALLOCNOW, /* flags */ + NULL, /* lockfunc */ + NULL, /* lockfuncarg */ + &dma->dma_tag); + if (error) { + VMCI_LOG_ERROR(LGPFX"bus_dma_tag_create failed: %d\n", error); + goto fail; + } + + error = bus_dmamem_alloc(dma->dma_tag, (void **)&dma->dma_vaddr, + BUS_DMA_ZERO | BUS_DMA_NOWAIT, &dma->dma_map); + if (error) { + VMCI_LOG_ERROR(LGPFX"bus_dmamem_alloc failed: %d\n", error); + goto fail; + } + + error = bus_dmamap_load(dma->dma_tag, dma->dma_map, dma->dma_vaddr, + size, vmci_dmamap_cb, &dma->dma_paddr, BUS_DMA_NOWAIT); + if (error) { + VMCI_LOG_ERROR(LGPFX"bus_dmamap_load failed: %d\n", error); + goto fail; + } + + dma->dma_size = size; + +fail: + if (error) + vmci_dma_free(dma); + + return (error); +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_dma_malloc -- + * + * This function is a wrapper around vmci_dma_malloc_int for callers + * outside of this module. Since we only support a single VMCI device, this + * wrapper provides access to the device softc structure. + * + * Results: + * 0 if success. + * ENOMEM if insufficient memory. + * EINPROGRESS if mapping is deferred. + * EINVAL if the request was invalid. + * + * Side effects: + * DMA memory is allocated. + * + *------------------------------------------------------------------------------ + */ + +int +vmci_dma_malloc(bus_size_t size, bus_size_t align, struct vmci_dma_alloc *dma) +{ + + return (vmci_dma_malloc_int(vmci_sc, size, align, dma)); +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_dma_free_int -- + * + * Internal function that frees DMA memory. + * + * Results: + * None. + * + * Side effects: + * Frees DMA memory. + * + *------------------------------------------------------------------------------ + */ + +static void +vmci_dma_free_int(struct vmci_softc *sc, struct vmci_dma_alloc *dma) +{ + + if (dma->dma_tag != NULL) { + if (dma->dma_paddr != 0) { + bus_dmamap_sync(dma->dma_tag, dma->dma_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(dma->dma_tag, dma->dma_map); + } + + if (dma->dma_vaddr != NULL) + bus_dmamem_free(dma->dma_tag, dma->dma_vaddr, + dma->dma_map); + + bus_dma_tag_destroy(dma->dma_tag); + } + bzero(dma, sizeof(struct vmci_dma_alloc)); +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_dma_free -- + * + * This function is a wrapper around vmci_dma_free_int for callers outside + * of this module. Since we only support a single VMCI device, this wrapper + * provides access to the device softc structure. + * + * Results: + * None. + * + * Side effects: + * Frees DMA memory. + * + *------------------------------------------------------------------------------ + */ + +void +vmci_dma_free(struct vmci_dma_alloc *dma) +{ + + vmci_dma_free_int(vmci_sc, dma); +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_config_interrupts -- + * + * Configures and enables interrupts. Try to configure MSI-X. If this fails, + * try to configure MSI. If even this fails, try legacy interrupts. + * + * Results: + * 0 if success. + * ENOMEM if insufficient memory. + * ENODEV if the device doesn't support interrupts. + * ENXIO if the device configuration failed. + * + * Side effects: + * Interrupts get enabled if successful. + * + *------------------------------------------------------------------------------ + */ + +static int +vmci_config_interrupts(struct vmci_softc *sc) +{ + int error; + + data_buffer = malloc(data_buffer_size, M_DEVBUF, M_ZERO | M_NOWAIT); + if (data_buffer == NULL) + return (ENOMEM); + + sc->vmci_intr_type = VMCI_INTR_TYPE_MSIX; + error = vmci_config_interrupt(sc); + if (error) { + sc->vmci_intr_type = VMCI_INTR_TYPE_MSI; + error = vmci_config_interrupt(sc); + } + if (error) { + sc->vmci_intr_type = VMCI_INTR_TYPE_INTX; + error = vmci_config_interrupt(sc); + } + if (error) + return (error); + + /* Enable specific interrupt bits. */ + if (sc->capabilities & VMCI_CAPS_NOTIFICATIONS) + bus_space_write_4(sc->vmci_iot0, sc->vmci_ioh0, + VMCI_IMR_ADDR, VMCI_IMR_DATAGRAM | VMCI_IMR_NOTIFICATION); + else + bus_space_write_4(sc->vmci_iot0, sc->vmci_ioh0, + VMCI_IMR_ADDR, VMCI_IMR_DATAGRAM); + + /* Enable interrupts. */ + bus_space_write_4(sc->vmci_iot0, sc->vmci_ioh0, + VMCI_CONTROL_ADDR, VMCI_CONTROL_INT_ENABLE); + + return (0); +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_config_interrupt -- + * + * Check the number of interrupts supported, allocate resources and setup + * interrupts. + * + * Results: + * 0 if success. + * ENOMEM if insufficient memory. + * ENODEV if the device doesn't support interrupts. + * ENXIO if the device configuration failed. + * + * Side effects: + * Resources get allocated and interrupts get setup (but not enabled) if + * successful. + * + *------------------------------------------------------------------------------ + */ + +static int +vmci_config_interrupt(struct vmci_softc *sc) +{ + int error; + + error = vmci_check_intr_cnt(sc); + if (error) + return (error); + + error = vmci_allocate_interrupt_resources(sc); + if (error) + return (error); + + error = vmci_setup_interrupts(sc); + if (error) + return (error); + + return (0); +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_check_intr_cnt -- + * + * Check the number of interrupts supported by the device and ask PCI bus + * to allocate appropriate number of interrupts. + * + * Results: + * 0 if success. + * ENODEV if the device doesn't support any interrupts. + * ENXIO if the device configuration failed. + * + * Side effects: + * Resources get allocated on success. + * + *------------------------------------------------------------------------------ + */ + +static int +vmci_check_intr_cnt(struct vmci_softc *sc) +{ + + if (sc->vmci_intr_type == VMCI_INTR_TYPE_INTX) { + sc->vmci_num_intr = 1; + return (0); + } + + /* + * Make sure that the device supports the required number of MSI/MSI-X + * messages. We try for 2 MSI-X messages but 1 is good too. We need at + * least 1 MSI message. + */ + sc->vmci_num_intr = (sc->vmci_intr_type == VMCI_INTR_TYPE_MSIX) ? + pci_msix_count(sc->vmci_dev) : pci_msi_count(sc->vmci_dev); + + if (!sc->vmci_num_intr) { + VMCI_LOG_ERROR(LGPFX"Device does not support any interrupt" + " messages"); + return (ENODEV); + } + + sc->vmci_num_intr = (sc->vmci_intr_type == VMCI_INTR_TYPE_MSIX) ? + VMCI_MAX_INTRS : 1; + if (sc->vmci_intr_type == VMCI_INTR_TYPE_MSIX) { + if (pci_alloc_msix(sc->vmci_dev, &sc->vmci_num_intr)) + return (ENXIO); + } else if (sc->vmci_intr_type == VMCI_INTR_TYPE_MSI) { + if (pci_alloc_msi(sc->vmci_dev, &sc->vmci_num_intr)) + return (ENXIO); + } + + return (0); +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_allocate_interrupt_resources -- + * + * Allocate resources necessary for interrupts. + * + * Results: + * 0 if success, ENXIO otherwise. + * + * Side effects: + * Resources get allocated on success. + * + *------------------------------------------------------------------------------ + */ + +static int +vmci_allocate_interrupt_resources(struct vmci_softc *sc) +{ + struct resource *irq; + int flags, i, rid; + + flags = RF_ACTIVE; + flags |= (sc->vmci_num_intr == 1) ? RF_SHAREABLE : 0; + rid = (sc->vmci_intr_type == VMCI_INTR_TYPE_INTX) ? 0 : 1; + + for (i = 0; i < sc->vmci_num_intr; i++, rid++) { + irq = bus_alloc_resource_any(sc->vmci_dev, SYS_RES_IRQ, &rid, + flags); + if (irq == NULL) + return (ENXIO); + sc->vmci_intrs[i].vmci_irq = irq; + sc->vmci_intrs[i].vmci_rid = rid; + } + + return (0); +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_setup_interrupts -- + * + * Sets up the interrupts. + * + * Results: + * 0 if success, appropriate error code from bus_setup_intr otherwise. + * + * Side effects: + * Interrupt handler gets attached. + * + *------------------------------------------------------------------------------ + */ + +static int +vmci_setup_interrupts(struct vmci_softc *sc) +{ + struct vmci_interrupt *intr; + int error, flags; + + flags = INTR_TYPE_NET | INTR_MPSAFE; + if (sc->vmci_num_intr > 1) + flags |= INTR_EXCL; + + intr = &sc->vmci_intrs[0]; + error = bus_setup_intr(sc->vmci_dev, intr->vmci_irq, flags, NULL, + vmci_interrupt, NULL, &intr->vmci_handler); + if (error) + return (error); + bus_describe_intr(sc->vmci_dev, intr->vmci_irq, intr->vmci_handler, + "vmci_interrupt"); + + if (sc->vmci_num_intr == 2) { + intr = &sc->vmci_intrs[1]; + error = bus_setup_intr(sc->vmci_dev, intr->vmci_irq, flags, + NULL, vmci_interrupt_bm, NULL, &intr->vmci_handler); + if (error) + return (error); + bus_describe_intr(sc->vmci_dev, intr->vmci_irq, + intr->vmci_handler, "vmci_interrupt_bm"); + } + + return (0); +} + +/* + *------------------------------------------------------------------------------ + * + * vmci_interrupt -- + * + * Interrupt handler for legacy or MSI interrupt, or for first MSI-X + * interrupt (vector VMCI_INTR_DATAGRAM). + * + * Results: + * None. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +static void +vmci_interrupt(void *arg) +{ + + if (vmci_sc->vmci_num_intr == 2) + taskqueue_enqueue(taskqueue_swi, + &vmci_sc->vmci_interrupt_dq_task); + else { + unsigned int icr; + + icr = inl(vmci_sc->vmci_ioaddr + VMCI_ICR_ADDR); + if (icr == 0 || icr == 0xffffffff) + return; + if (icr & VMCI_ICR_DATAGRAM) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Mar 25 01:27:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D974CF602DE; Sun, 25 Mar 2018 01:27:09 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F9C76AA2A; Sun, 25 Mar 2018 01:27:08 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w2P1R5hm038862; Sat, 24 Mar 2018 18:27:05 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w2P1R59o038861; Sat, 24 Mar 2018 18:27:05 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803250127.w2P1R59o038861@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci In-Reply-To: <201803250057.w2P0v0lA081039@repo.freebsd.org> To: Mark Peek Date: Sat, 24 Mar 2018 18:27:05 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 01:27:10 -0000 > Author: mp > Date: Sun Mar 25 00:57:00 2018 > New Revision: 331510 > URL: https://svnweb.freebsd.org/changeset/base/331510 > > Log: > Add VMCI (Virtual Machine Communication Interface) driver > > In a virtual machine, VMCI is exposed as a regular PCI device. The primary > communication mechanisms supported are a point-to-point bidirectional > transport based on a pair of memory-mapped queues, and asynchronous > notifications in the form of datagrams and doorbells. These features are > available to kernel level components such as vSockets through the VMCI > kernel API. In addition to this, the VMCI kernel API provides support for > receiving events related to the state of the VMCI communication channels, > and the virtual machine itself. > > Submitted by: Vishnu Dasa > Reviewed by: bcr, imp > Obtained from: VMware > Differential Revision: https://reviews.freebsd.org/D14289 These files do not each contain a usable copyright, though they seem to contain SPDX tags that indiate they should contain a BSD 2 clause copyright. > Added: > head/share/man/man4/vmci.4 (contents, props changed) > head/sys/dev/vmware/vmci/ ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Mar 25 05:20:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B81CEF6F544 for ; Sun, 25 Mar 2018 05:20:37 +0000 (UTC) (envelope-from mark@peek.org) Received: from mail-yw0-f196.google.com (mail-yw0-f196.google.com [209.85.161.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5354C74981 for ; Sun, 25 Mar 2018 05:20:37 +0000 (UTC) (envelope-from mark@peek.org) Received: by mail-yw0-f196.google.com with SMTP id z82so5210605ywd.9 for ; Sat, 24 Mar 2018 22:20:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=n+xBHEc3pNiDgliT4aQO4Hd9y7IWwlwLeyOEA9Gs0UA=; b=dkHifHqxFyYvsKha51B/3a0/OOdiRWSZ8L6RlOIB1PdmboFvqgZGGB4NcAzyoXwBtf SHKW4Yf2K/Cl0RRFvzoXkBw0pyBG7HYTEUK1s77yyQUqm3n8ZVXLjb8jxH9VEtZKpaYH DYdRJG9q6On1+sskeVhbPdoQNbzB9Rb2oawvZdNl8KjOm+yB4+LKOZ+7FO7cWgWVjh2X NXd8+LXc293TUPS02+38hWYT+RoLWpTaXR8lHkXnbPbKKe/HkpvnNotksB1n6NBwmzLI zH9GSWjR/rW3NasjNIwmb/yUIZm2mwZGrrs+1t62PnUMHXpowYN2EHCf2vJhZ39CeP8Z k/Eg== X-Gm-Message-State: AElRT7EsP/y4J9lg3iDgjb3V2x5MWJ5wzaOK5xZIexjAO40hA+LLUEui tvCMxtJbzAzdUMcw3GJkbmkXjaDTHsAGsA== X-Google-Smtp-Source: AG47ELtQTdT1SVYHaK+pOOHMIiAMWGzjSBPcJZtZXzjgyKgkAWtt7IdU69w/UdRb8ZMCih8WbdjmIQ== X-Received: by 10.13.230.209 with SMTP id p200mr20691616ywe.20.1521953791092; Sat, 24 Mar 2018 21:56:31 -0700 (PDT) Received: from mail-yb0-f173.google.com (mail-yb0-f173.google.com. [209.85.213.173]) by smtp.gmail.com with ESMTPSA id o6sm4914948ywm.62.2018.03.24.21.56.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Mar 2018 21:56:30 -0700 (PDT) Received: by mail-yb0-f173.google.com with SMTP id i13-v6so5362463ybl.9 for ; Sat, 24 Mar 2018 21:56:30 -0700 (PDT) X-Received: by 2002:a25:a04:: with SMTP id 4-v6mr3766414ybk.475.1521953790311; Sat, 24 Mar 2018 21:56:30 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:1057:0:0:0:0:0 with HTTP; Sat, 24 Mar 2018 21:56:29 -0700 (PDT) X-Originating-IP: [2601:646:c700:35ed:b994:95ae:8633:6d76] In-Reply-To: <201803250127.w2P1R59o038861@pdx.rh.CN85.dnsmgr.net> References: <201803250057.w2P0v0lA081039@repo.freebsd.org> <201803250127.w2P1R59o038861@pdx.rh.CN85.dnsmgr.net> From: Mark Peek Date: Sat, 24 Mar 2018 21:56:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci To: rgrimes@freebsd.org Cc: Mark Peek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 05:20:38 -0000 On Sat, Mar 24, 2018 at 6:27 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > Author: mp > > Date: Sun Mar 25 00:57:00 2018 > > New Revision: 331510 > > URL: https://svnweb.freebsd.org/changeset/base/331510 > > These files do not each contain a usable copyright, though > they seem to contain SPDX tags that indiate they should contain > a BSD 2 clause copyright. IANAL but I believe you meant "...they should contain a BSD 2 clause *license*". The files should contain a valid copyright. The intent of my commit and the author were to use the implied SPDX version of the licenses without burdening the source code with the more heavyweight license text. Having seen SPDX in the src tree, I believed the SPDX-License-Identifier was sufficient. But, to your point, I'm not sure I have seen a discussion or a decision on it. Mark From owner-svn-src-head@freebsd.org Sun Mar 25 06:08:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C264F4A2E2; Sun, 25 Mar 2018 06:08:04 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AAE2375E95; Sun, 25 Mar 2018 06:08:03 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([85.181.253.48]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0LabZr-1eILok3iL1-00mJyR; Sun, 25 Mar 2018 08:08:02 +0200 Date: Sun, 25 Mar 2018 08:07:27 +0200 From: "O. Hartmann" To: Jeff Roberson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331508 - in head: lib/libc/sys share/man/man9 usr.bin/cpuset Message-ID: <20180325080754.4e169d9a@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201803242358.w2ONwiuu051354@repo.freebsd.org> References: <201803242358.w2ONwiuu051354@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/QZ9Mo8ZpX8oTgh.41WmBpJT"; protocol="application/pgp-signature" X-Provags-ID: V03:K0:iu43fMKB0VARt5p5msY3aNEiA8m1LcSdF53MDmq6Su+PP/m4ndC MxJrs0tVmvDTmIN8innOiLPnkMBI8qih/AynjfoozrjxjoZqaFcw0dS7LVmzbGy1SXuluOw j92ajwVLgFf/y8rgETEuUXtJ/CMsJTsnTLFUnb0JSDvOYN6llOvsYtUiqXTd+NI19QewUYp bZiMV9vuK8y84A3Jo5XfQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:tigdHLDCqTs=:S0spv3KpVA7a7RHaFc0uMp oNBiLBbhNWrev7mQAtWRsjqOnDhwZjLgeWPSq7PiTRX2LC3kiq/8izzzbq8kHi0Y8nhwCHEEk F9ZJs3ypr38GhBtkoDHua83iM2qWm9yPSCxWHT0NUh/FAAnjWwf5ZVZB+DNwLku7yUtBnFDkV 68MmjSyWv8r5NX8IUK9RsQgSCJ9vfxobuCu9Fl2dcK/PPLA7dq+fUxT2doAQvf7OLbyN6D9Xw aGmf31aH85Dbnv5aK9zihS1a8bi6naICpsVW0odz6k8tYZg72/svLPaOIrtMhoYBRYRoGAzTi AGRy8ugmijbMF7TkSpnAKwRpgIJ7tp7ruvsqWywam7BxUrmY2wdVp7pb3U/JdKQDy71Rsh+b3 DIgNptoqPoA0PJSPfoLLE6J9NamvADPEDG/r24MLEL+Qciy71XtzRocNRpfbPwDLcGYDnAQdj YySgtHMyrhA3diJjiyGz6yLNBMXCMMVsjBqXV9L3yLdAc1MauD8RRBeNUjkjjpbI0zHhzyE3/ 3CfUTW08fTgCHJ9drhodoGkpV5VzvQmTbvIDpOp82pjfSOqqrw7n007hyzDpkQr1S7E3r6AnJ pITlWF3j3YZhx/gzKF8svsNkiOT/Xt82I8KLMxR7ObFqtRwIigDCMkYXhxrO/NRU7hTdeMIyc Kacu64jNMZGALKM02GqnsdQTM9CI+ZND6LAFL6R0cIWj+3B0wRyaNtfgCgU7OIDeAj/MnRW6E BOY9a1mQUayRWfKFXXKkNbdT8G5NYdDkh7ishd+zMoynkkIlWXL/GaczwhjEz1Piuq5DC19ar EDE4nwmkTS7i4Rtsho+RWBF52ECng== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 06:08:04 -0000 --Sig_/QZ9Mo8ZpX8oTgh.41WmBpJT Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am Sat, 24 Mar 2018 23:58:44 +0000 (UTC) Jeff Roberson schrieb: > Author: jeff > Date: Sat Mar 24 23:58:44 2018 > New Revision: 331508 > URL: https://svnweb.freebsd.org/changeset/base/331508 >=20 > Log: > Document new NUMA related syscalls and utility options. > =20 > Sponsored by: Netflix, Dell/EMC Isilon >=20 > Modified: > head/lib/libc/sys/Makefile.inc > head/lib/libc/sys/cpuset.2 > head/lib/libc/sys/cpuset_getaffinity.2 > head/share/man/man9/Makefile > head/share/man/man9/malloc.9 > head/share/man/man9/zone.9 > head/usr.bin/cpuset/cpuset.1 >=20 > Modified: head/lib/libc/sys/Makefile.inc > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libc/sys/Makefile.inc Sat Mar 24 23:26:54 2018 (r331507) > +++ head/lib/libc/sys/Makefile.inc Sat Mar 24 23:58:44 2018 (r331508) > @@ -174,6 +174,7 @@ MAN+=3D abort2.2 \ > connectat.2 \ > cpuset.2 \ > cpuset_getaffinity.2 \ > + cpuset_getdomain.2 \ > dup.2 \ > execve.2 \ > _exit.2 \ > @@ -371,6 +372,7 @@ MLINKS+=3Dnanosleep.2 clock_nanosleep.2 > MLINKS+=3Dcpuset.2 cpuset_getid.2 \ > cpuset.2 cpuset_setid.2 > MLINKS+=3Dcpuset_getaffinity.2 cpuset_setaffinity.2 > +MLINKS+=3Dcpuset_getdomain.2 cpuset_setdomain.2 > MLINKS+=3Ddup.2 dup2.2 > MLINKS+=3Dexecve.2 fexecve.2 > MLINKS+=3Dextattr_get_file.2 extattr.2 \ >=20 > Modified: head/lib/libc/sys/cpuset.2 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libc/sys/cpuset.2 Sat Mar 24 23:26:54 2018 (r331507) > +++ head/lib/libc/sys/cpuset.2 Sat Mar 24 23:58:44 2018 (r331508) > @@ -48,21 +48,21 @@ > The > .Nm > family of system calls allow applications to control sets of processors = and > -assign processes and threads to these sets. > -Processor sets contain lists of CPUs that members may run on and exist o= nly > -as long as some process is a member of the set. > +memory domains and assign processes and threads to these sets. > +Processor sets contain lists of CPUs and domains that members may run on > +and exist only as long as some process is a member of the set. > All processes in the system have an assigned set. > The default set for all processes in the system is the set numbered 1. > Threads belong to the same set as the process which contains them, > however, they may further restrict their set with the anonymous > -per-thread mask. > +per-thread mask to bind to a specific CPU or subset of CPUs and memory d= omains. > .Pp > Sets are referenced by a number of type > .Ft cpuset_id_t . > Each thread has a root set, an assigned set, and an anonymous mask. > Only the root and assigned sets are numbered. > -The root set is the set of all CPUs available in the system or in the > -system partition the thread is running in. > +The root set is the set of all CPUs and memory domains available in the = system > +or in the system partition the thread is running in. > The assigned set is a subset of the root set and is administratively > assignable on a per-process basis. > Many processes and threads may be members of a numbered set. > @@ -72,7 +72,8 @@ set. > It is intended that administrators will manipulate numbered sets using > .Xr cpuset 1 > while application developers will manipulate anonymous sets using > -.Xr cpuset_setaffinity 2 . > +.Xr cpuset_setaffinity 2 and > +.Xr cpuset_setdomain 2 . > .Pp > To select the correct set a value of type > .Ft cpulevel_t > @@ -175,9 +176,10 @@ with a process or thread is unsupported since > this references the unnumbered anonymous mask. > .Pp > The actual contents of the sets may be retrieved or manipulated using > -.Xr cpuset_getaffinity 2 > -and > -.Xr cpuset_setaffinity 2 . > +.Xr cpuset_getaffinity 2 , > +.Xr cpuset_setaffinity 2 , > +.Xr cpuset_getdomain 2 , and > +.Xr cpuset_setdomain 2 . > See those manual pages for more detail. > .Sh RETURN VALUES > .Rv -std > @@ -220,6 +222,8 @@ for allocation. > .Xr cpuset 1 , > .Xr cpuset_getaffinity 2 , > .Xr cpuset_setaffinity 2 , > +.Xr cpuset_getdomain 2 , > +.Xr cpuset_setdomain 2 , > .Xr pthread_affinity_np 3 , > .Xr pthread_attr_affinity_np 3 , > .Xr cpuset 9 >=20 > Modified: head/lib/libc/sys/cpuset_getaffinity.2 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/lib/libc/sys/cpuset_getaffinity.2 Sat Mar 24 23:26:54 2018 > (r331507) +++ head/lib/libc/sys/cpuset_getaffinity.2 Sat Mar 24 23:58:44 > 2018 (r331508) @@ -160,6 +160,8 @@ See > .Xr cpuset 2 , > .Xr cpuset_getid 2 , > .Xr cpuset_setid 2 , > +.Xr cpuset_getdomain 2 , > +.Xr cpuset_setdomain 2 , > .Xr pthread_affinity_np 3 , > .Xr pthread_attr_affinity_np 3 , > .Xr cpuset 9 >=20 > Modified: head/share/man/man9/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/man/man9/Makefile Sat Mar 24 23:26:54 2018 (r331507) > +++ head/share/man/man9/Makefile Sat Mar 24 23:58:44 2018 (r331508) > @@ -1271,6 +1271,8 @@ MLINKS+=3Dmake_dev.9 destroy_dev.9 \ > make_dev.9 make_dev_p.9 \ > make_dev.9 make_dev_s.9 > MLINKS+=3Dmalloc.9 free.9 \ > + malloc.9 malloc_domain.9 \ > + malloc.9 free_domain.9 \ > malloc.9 mallocarray.9 \ > malloc.9 MALLOC_DECLARE.9 \ > malloc.9 MALLOC_DEFINE.9 \ > @@ -2213,10 +2215,12 @@ MLINKS+=3Dvslock.9 vsunlock.9 > MLINKS+=3Dzone.9 uma.9 \ > zone.9 uma_zalloc.9 \ > zone.9 uma_zalloc_arg.9 \ > + zone.9 uma_zalloc_domain.9 \ > zone.9 uma_zcreate.9 \ > zone.9 uma_zdestroy.9 \ > zone.9 uma_zfree.9 \ > zone.9 uma_zfree_arg.9 \ > + zone.9 uma_zfree_domain.9 \ > zone.9 uma_zone_get_cur.9 \ > zone.9 uma_zone_get_max.9 \ > zone.9 uma_zone_set_max.9 \ >=20 > Modified: head/share/man/man9/malloc.9 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/man/man9/malloc.9 Sat Mar 24 23:26:54 2018 (r331507) > +++ head/share/man/man9/malloc.9 Sat Mar 24 23:58:44 2018 (r331508) > @@ -46,9 +46,13 @@ > .Ft void * > .Fn malloc "size_t size" "struct malloc_type *type" "int flags" > .Ft void * > +.Fn malloc_domain "size_t size" "struct malloc_type *type" "int domain" = "int flags" > +.Ft void * > .Fn mallocarray "size_t nmemb" "size_t size" "struct malloc_type *type" = "int flags" > .Ft void > .Fn free "void *addr" "struct malloc_type *type" > +.Ft void > +.Fn free_domain "void *addr" "struct malloc_type *type" > .Ft void * > .Fn realloc "void *addr" "size_t size" "struct malloc_type *type" "int f= lags" > .Ft void * > @@ -64,6 +68,14 @@ The > function allocates uninitialized memory in kernel address space for an > object whose size is specified by > .Fa size . > +.Pp > +The > +.Fn malloc_domain > +variant allocates the object from the specified memory domain. Memory a= llocated > +with this function should be returned with > +.Fn free_domain . > +See > +.Xr numa 9 for more details. > .Pp > The > .Fn mallocarray >=20 > Modified: head/share/man/man9/zone.9 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/share/man/man9/zone.9 Sat Mar 24 23:26:54 2018 (r331507) > +++ head/share/man/man9/zone.9 Sat Mar 24 23:58:44 2018 (r331508) > @@ -32,8 +32,10 @@ > .Nm uma_zcreate , > .Nm uma_zalloc , > .Nm uma_zalloc_arg , > +.Nm uma_zalloc_domain , > .Nm uma_zfree , > .Nm uma_zfree_arg , > +.Nm uma_zfree_domain , > .Nm uma_zdestroy , > .Nm uma_zone_set_max , > .Nm uma_zone_get_max , > @@ -55,11 +57,15 @@ > .Fn uma_zalloc "uma_zone_t zone" "int flags" > .Ft "void *" > .Fn uma_zalloc_arg "uma_zone_t zone" "void *arg" "int flags" > +.Ft "void *" > +.Fn uma_zalloc_domain "uma_zone_t zone" "void *arg" "int domain" "int fl= ags" > .Ft void > .Fn uma_zfree "uma_zone_t zone" "void *item" > .Ft void > .Fn uma_zfree_arg "uma_zone_t zone" "void *item" "void *arg" > .Ft void > +.Fn uma_zfree_domain "uma_zone_t zone" "void *item" "void *arg" > +.Ft void > .Fn uma_zdestroy "uma_zone_t zone" > .Ft int > .Fn uma_zone_set_max "uma_zone_t zone" "int nitems" > @@ -78,10 +84,13 @@ > .Fn SYSCTL_ADD_UMA_CUR ctx parent nbr name access zone descr > .Sh DESCRIPTION > The zone allocator provides an efficient interface for managing > -dynamically-sized collections of items of similar size. > +dynamically-sized collections of items of identical size. > The zone allocator can work with preallocated zones as well as with > runtime-allocated ones, and is therefore available much earlier in the > -boot process than other memory management routines. > +boot process than other memory management routines. The zone allocator > +provides per-cpu allocation caches with linear scalability on SMP > +systems as well as round-robin and first-touch policies for NUMA > +systems. > .Pp > A zone is an extensible collection of items of identical size. > The zone allocator keeps track of which items are in use and which > @@ -209,6 +218,11 @@ The zone is for the > subsystem. > .It Dv UMA_ZONE_VM > The zone is for the VM subsystem. > +.It Dv UMA_ZONE_NUMA > +The zone should use a first-touch NUMA policy rather than the round-robin > +default. Callers that do not free memory on the same domain it is alloca= ted > +from will cause mixing in per-cpu caches. See > +.Xr numa 9 for more details. > .El > .Pp > To allocate an item from a zone, simply call > @@ -243,12 +257,21 @@ The variations > .Fn uma_zalloc_arg > and > .Fn uma_zfree_arg > -allow to > +allow callers to > specify an argument for the > .Dv ctor > and > .Dv dtor > functions, respectively. > +The=20 > +.Fn uma_zalloc_domain > +function allows callers to specify a fixed > +.Xr numa 9 domain to allocate from. This uses a guaranteed but slow pat= h in > +the allocator which reduces concurrency. The=20 > +.Fn uma_zfree_domain > +function should be used to return memory allocated in this fashion. This > +function infers the domain from the pointer and does not require it as an > +argument. > .Pp > Created zones, > which are empty, >=20 > Modified: head/usr.bin/cpuset/cpuset.1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/cpuset/cpuset.1 Sat Mar 24 23:26:54 2018 (r331507) > +++ head/usr.bin/cpuset/cpuset.1 Sat Mar 24 23:58:44 2018 (r331508) > @@ -34,20 +34,24 @@ > .Sh SYNOPSIS > .Nm > .Op Fl l Ar cpu-list > +.Op Fl n Ar policy:domain-list=20 > .Op Fl s Ar setid > .Ar cmd ... > .Nm > .Op Fl l Ar cpu-list > +.Op Fl n Ar policy:domain-list=20 > .Op Fl s Ar setid > .Fl p Ar pid > .Nm > .Op Fl c > .Op Fl l Ar cpu-list > +.Op Fl n Ar policy:domain-list=20 > .Fl C > .Fl p Ar pid > .Nm > .Op Fl c > .Op Fl l Ar cpu-list > +.Op Fl n Ar policy:domain-list=20 > .Op Fl j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar= irq > .Nm > .Fl g > @@ -57,8 +61,9 @@ > The > .Nm > command can be used to assign processor sets to processes, run commands > -constrained to a given set or list of processors, and query information > -about processor binding, sets, and available processors in the system. > +constrained to a given set or list of processors and memory domains, and= query > +information about processor binding, memory binding and policy, sets, and > +available processors and memory domains in the system. > .Pp > .Nm > requires a target to modify or query. > @@ -92,6 +97,15 @@ This last set is the list of all possible CPUs in the= =20 > queried using > .Fl r . > .Pp > +Most sets include NUMA memory domain and policy information. This can be > +inspected with > +.Fl g > +and set with > +.Fl n . > +This will specify which NUMA domains are visible to the process and > +affect where anonymous memory and file pages will be stored on first acc= ess. > +Files accessed first by other processes may specify conflicting policy. > +.Pp > When running a command it may join a set specified with > .Fl s > otherwise a new set is created. > @@ -110,7 +124,8 @@ Create a new cpuset and assign the target process to t > The requested operation should reference the cpuset available via the > target specifier. > .It Fl d Ar domain > -Specifies a NUMA domain id as the target of the operation. > +Specifies a NUMA domain id as the target of the operation. This can only > +be used to query the cpus visible in each numberd domain. > .It Fl g > Causes > .Nm > @@ -130,6 +145,13 @@ numbers separated by '-' for ranges and commas separ= at > A special list of > .Dq all > may be specified in which case the list includes all CPUs from the root = set. > +.It Fl n Ar domain-list:policy > +Specifies a list of domains and allocation policy to apply to a target. = Ranges > +may be specified as in > +.Fl l . > +Valid policies include first-touch, ft, round-robin, rr, and prefer. Th= e prefer > +policy accepts only a single domain in the set. The parent of the set is > +consulted if the preferred domain is unavailable. > .It Fl p Ar pid > Specifies a pid as the target of the operation. > .It Fl s Ar setid > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" A buildkernel fails with: [...] --- all_subdir_lib/libc --- make[4]: make[4]: don't know how to make cpuset_getdomain.2. Stop make[4]: stopped in /usr/src/lib/libc --=20 O. Hartmann Ich widerspreche der Nutzung oder =C3=9Cbermittlung meiner Daten f=C3=BCr Werbezwecke oder f=C3=BCr die Markt- oder Meinungsforschung (=C2=A7 28 Abs.= 4 BDSG). --Sig_/QZ9Mo8ZpX8oTgh.41WmBpJT Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iLUEARMKAB0WIQQZVZMzAtwC2T/86TrS528fyFhYlAUCWrc8ugAKCRDS528fyFhY lN9DAgCnRCCpE6cj40tcvmnqoDFyfJD+DI7FkN+QCCG+Pr8umqnF6l7YifUDGN8n /wm0goHPYAJSmn7YWNxfRijjW42EAgCWq/HLvXRaXmr5p46SVtZHibXNC7gO3guy fQrK/by0WskDYFD4NMec7wsBi8R3uUOkKJZ5UDy9T92WfYEnamsL =PD5m -----END PGP SIGNATURE----- --Sig_/QZ9Mo8ZpX8oTgh.41WmBpJT-- From owner-svn-src-head@freebsd.org Sun Mar 25 06:08:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24813F4A344; Sun, 25 Mar 2018 06:08:19 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBD5975F87; Sun, 25 Mar 2018 06:08:18 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C25E91A396; Sun, 25 Mar 2018 06:08:18 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2P68IjF036765; Sun, 25 Mar 2018 06:08:18 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2P68Ip3036764; Sun, 25 Mar 2018 06:08:18 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201803250608.w2P68Ip3036764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Sun, 25 Mar 2018 06:08:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331528 - head/sys/dev/ciss X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/dev/ciss X-SVN-Commit-Revision: 331528 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 06:08:19 -0000 Author: scottl Date: Sun Mar 25 06:08:18 2018 New Revision: 331528 URL: https://svnweb.freebsd.org/changeset/base/331528 Log: Update a TBD string with a real model number Submitted by: Sam Gwydir Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Sun Mar 25 03:50:38 2018 (r331527) +++ head/sys/dev/ciss/ciss.c Sun Mar 25 06:08:18 2018 (r331528) @@ -360,7 +360,7 @@ static struct { 0x103C, 0x21C8, CISS_BOARD_SA5, "HP Smart Array H241" }, { 0x103C, 0x21CA, CISS_BOARD_SA5, "HP Smart Array P246br" }, { 0x103C, 0x21CB, CISS_BOARD_SA5, "HP Smart Array P840" }, - { 0x103C, 0x21CC, CISS_BOARD_SA5, "HP Smart Array TBD" }, + { 0x103C, 0x21CC, CISS_BOARD_SA5, "HP Smart Array P542d" }, { 0x103C, 0x21CD, CISS_BOARD_SA5, "HP Smart Array P240nr" }, { 0x103C, 0x21CE, CISS_BOARD_SA5, "HP Smart Array H240nr" }, { 0, 0, 0, NULL } From owner-svn-src-head@freebsd.org Sun Mar 25 07:42:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A9FCF51E7A; Sun, 25 Mar 2018 07:42:45 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFD4478F86; Sun, 25 Mar 2018 07:42:44 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAC361B37B; Sun, 25 Mar 2018 07:42:44 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2P7giif085992; Sun, 25 Mar 2018 07:42:44 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2P7gidh085991; Sun, 25 Mar 2018 07:42:44 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201803250742.w2P7gidh085991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sun, 25 Mar 2018 07:42:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331529 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 331529 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 07:42:45 -0000 Author: jeff Date: Sun Mar 25 07:42:44 2018 New Revision: 331529 URL: https://svnweb.freebsd.org/changeset/base/331529 Log: Add missing file from 4331508 Document cpuset_{get,set}domain() Added: head/lib/libc/sys/cpuset_getdomain.2 (contents, props changed) Added: head/lib/libc/sys/cpuset_getdomain.2 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/cpuset_getdomain.2 Sun Mar 25 07:42:44 2018 (r331529) @@ -0,0 +1,188 @@ +.\" Copyright (c) 2018 Jeffrey Roberson +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd Mar 19, 2018 +.Dt CPUSET_GETDOMAIN 2 +.Os +.Sh NAME +.Nm cpuset_getdomain , +.Nm cpuset_setdomain +.Nd manage memory domain policy +.Sh LIBRARY +.Lb libc +.Sh SYNOPSIS +.In sys/param.h +.In sys/domainset.h +.Ft int +.Fn cpuset_getdomain "cpulevel_t level" "cpuwhich_t which" "id_t id" "size_t setsize" "domainet_t *mask" "int *policy" +.Ft int +.Fn cpuset_setdomain "cpulevel_t level" "cpuwhich_t which" "id_t id" "size_t setsize" "const domainset_t *mask" "int policy" +.Sh DESCRIPTION +.Fn cpuset_getdomain +and +.Fn cpuset_setdomain +allow the manipulation of sets of memory domains and allocation policy available +to processes, threads, jails and other resources. +These functions may manipulate sets of memory domains that contain many processes +or per-object anonymous masks that effect only a single object. +.Pp +The valid values for the +.Fa level +and +.Fa which +arguments are documented in +.Xr cpuset 2 . +These arguments specify which object and which set of the object we are +referring to. +Not all possible combinations are valid. +For example, only processes may belong to a numbered set accessed by a +.Fa level +argument of +.Dv CPU_LEVEL_CPUSET . +All resources, however, have a mask which may be manipulated with +.Dv CPU_LEVEL_WHICH . +.Pp +Masks of type +.Ft domainset_t +are composed using the +.Dv DOMAINSET +macros. +The kernel tolerates large sets as long as all domains specified +in the set exist. +Sets smaller than the kernel uses generate an error on calls to +.Fn cpuset_getdomain +even if the result set would fit within the user supplied set. +Calls to +.Fn cpuset_setdomain +tolerate small sets with no restrictions. +.Pp +The supplied mask should have a size of +.Fa setsize +bytes. +This size is usually provided by calling +.Li sizeof(mask) +which is ultimately determined by the value of +.Dv DOMAINSET_SETSIZE +as defined in +.In sys/domainset.h . +.Pp +.Fn cpuset_getdomain +retrieves the +mask and policy from the object specified by +.Fa level , +.Fa which +and +.Fa id +and stores it in the space provided by +.Fa mask and +.Fa policy . +.Pp +.Fn cpuset_setdomain +attempts to set the mask and policy for the object specified by +.Fa level , +.Fa which +and +.Fa id +to the values in +.Fa mask and +.Fa policy . +.Sh ALLOCATION POLICIES +Valid policy values are as follows: +.Bl -tag -width "foo" +.It Dv DOMAINSET_POLICY_ROUNDROBIN +Memory is allocated on a round-robin basis by cycling through each domain in +.Fa mask . +.It Dv DOMAINSET_POLICY_FIRSTTOUCH +Memory is allocated on the domain local to the CPU the requesting thread is +running on. Failure to allocate from this domain will fallback to round-robin. +.It Dv DOMAINSET_POLICY_PREFER +Memory is allocated preferentially from the single domain specified in the mask. +If memory is unavailable the domains listed in the parent cpuset will be +visited in a round-robin order. +.El +.Sh RETURN VALUES +.Rv -std +.Sh ERRORS +The following error codes may be set in +.Va errno : +.Bl -tag -width Er +.\" When changing this list, consider updating share/man/man3/pthread_create.3, +.\" since that function can return any of these errors. +.It Bq Er EINVAL +The +.Fa level +or +.Fa which +argument was not a valid value. +.It Bq Er EINVAL +The +.Fa mask or +.Fa policy +argument specified when calling +.Fn cpuset_setdomain +was not a valid value. +.It Bq Er EDEADLK +The +.Fn cpuset_setdomain +call would leave a thread without a valid CPU to run on because the set +does not overlap with the thread's anonymous mask. +.It Bq Er EFAULT +The mask pointer passed was invalid. +.It Bq Er ESRCH +The object specified by the +.Fa id +and +.Fa which +arguments could not be found. +.It Bq Er ERANGE +The +.Fa domainsetsize +was either preposterously large or smaller than the kernel set size. +.It Bq Er EPERM +The calling process did not have the credentials required to complete the +operation. +.It Bq Er ECAPMODE +The calling process attempted to act on a process other than itself, while +in capability mode. +See +.Xr capsicum 4 . +.El +.Sh SEE ALSO +.Xr capsicum 4 , +.Xr cpuset 1 , +.Xr cpuset 2 , +.Xr cpuset_getid 2 , +.Xr cpuset_setid 2 , +.Xr cpuset_getaffinity 2 , +.Xr cpuset_setaffinity 2 , +.Xr cpuset 9 +.Sh HISTORY +The +.Nm +family of system calls first appeared in +.Fx 12.0 . +.Sh AUTHORS +.An Jeffrey Roberson Aq Mt jeff@FreeBSD.org From owner-svn-src-head@freebsd.org Sun Mar 25 07:48:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2511DF523DE for ; Sun, 25 Mar 2018 07:48:12 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pl0-x22e.google.com (mail-pl0-x22e.google.com [IPv6:2607:f8b0:400e:c01::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9922A792BE for ; Sun, 25 Mar 2018 07:48:11 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pl0-x22e.google.com with SMTP id 91-v6so2208950pld.3 for ; Sun, 25 Mar 2018 00:48:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=OPcCc/ZISf5EXf+HKq6oLN4v0IHiX25/SFt7ek0YKzM=; b=a1HyDB4JDrmv+y6COfg1rxhCEiie3FniIwqI/TVRK8M/JWIpcBLveTgZx8ZKeF2b1K pCjoRWtsB/VMfk+7yFInuT1AX0Uyl9P4sJnFZz+z+pbj9coxCX0G6HOMxAR5rgPD3WnM Y4TYHJf4wBysHm670PuyYfPhx5+bIEdEFT8a7IMUWZ8F8CLRKewm4eV6jU9tuhWJXe3y R5MritcAmu2aneifM6mePV4rg1QGQSnVRZq0F1uvXcfC4j38FYscT3AxOaxJ9rVUdBJu cnKB7IosL2jA22Qe/dWJctRW5mvqdAGbHk8iDPuy3WCCJBXB+PsBExsoY/69K1SbPOfr WYmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=OPcCc/ZISf5EXf+HKq6oLN4v0IHiX25/SFt7ek0YKzM=; b=VYdmPstO1Rpuq83CMbUeAYD0kVCI68xfRcjnRMWW3dQqCbFdh27N8487+mg7Ml+yfT RDvf/XwDrFV3MQfI4OVWsxEzzOx0Kg5U2+LKl5Y9q6uB0IC7IbqnAaRSx5jpMaKxbHXR vxoRFRGeRask0e7dKpg41ujKvj6LlCXd/az4uIZKnfhIZpU+Dtc3s9JRxzxN0BoZqgtk fXvBM68XOxEcaIEGaK6uGEnS4nqeDun8OscCestOxto7wxdzdO7PsYHjZRpOr8ZgzF+Y V7nlgesWwitqVi3p7rH0xuLuMoHSE8tvCUO0VrU7NEF9uGq6QczjjSF4RFbra4rmZWu4 TaZw== X-Gm-Message-State: AElRT7FilLw9/kGzGdz4ZpbgoF8MdddQQFs9R+jk/3nWpMO9qt5KyCmR YdP72wu20x8nUzgMnhBWUm3lVg== X-Google-Smtp-Source: AG47ELte2iGS++eYZOXh64v+Ei5cRUCS6P4m6Etm68fqxxNoGzC2xdYrya4IvIFVCTz4K0Y3tp8zLg== X-Received: by 2002:a17:902:ac96:: with SMTP id h22-v6mr35346402plr.93.1521964090470; Sun, 25 Mar 2018 00:48:10 -0700 (PDT) Received: from rrcs-66-91-135-210.west.biz.rr.com (rrcs-66-91-135-210.west.biz.rr.com. [66.91.135.210]) by smtp.gmail.com with ESMTPSA id j65sm15410650pge.58.2018.03.25.00.48.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Mar 2018 00:48:09 -0700 (PDT) Date: Sat, 24 Mar 2018 21:47:07 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Hans Petter Selasky cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331447 - head/sys/dev/mlx5/mlx5_core In-Reply-To: <201803231811.w2NIB6o8051699@repo.freebsd.org> Message-ID: References: <201803231811.w2NIB6o8051699@repo.freebsd.org> User-Agent: Alpine 2.21 (BSF 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 07:48:12 -0000 > Author: hselasky > Date: Fri Mar 23 18:11:06 2018 > New Revision: 331447 > URL: https://svnweb.freebsd.org/changeset/base/331447 > > Log: > Hide verbose proclamation of error when forced in mlx5core. > > When mlx5_enter_error_state() operation is forced by shutdown, the > messages surrounding setting the error state are not informational > and confuse users. > > Submitted by: kib@ > MFC after: 1 week > Sponsored by: Mellanox Technologies This broke on sparc64 build: In file included from /usr/head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c:41: /usr/head/sys/dev/mlx5/mlx5_core/mlx5_core.h:86: warning: redundant redeclaration of 'm lx5_enter_error_state' [-Wredundant-decls] /usr/head/sys/dev/mlx5/driver.h:871: warning: previous declaration of 'mlx5_enter_error _state' was here --- mlx5_alloc.o --- cc1: warnings being treated as errors Thanks, Jeff > > Modified: > head/sys/dev/mlx5/mlx5_core/mlx5_health.c > > Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c > ============================================================================== > --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Fri Mar 23 18:09:09 2018 (r331446) > +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Fri Mar 23 18:11:06 2018 (r331447) > @@ -99,14 +99,16 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev, > return; > } > > - mlx5_core_err(dev, "start\n"); > + if (!force) > + mlx5_core_err(dev, "internal state error detected\n"); > if (pci_channel_offline(dev->pdev) || in_fatal(dev) || force) { > dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR; > mlx5_trigger_cmd_completions(dev); > } > > mlx5_core_event(dev, MLX5_DEV_EVENT_SYS_ERROR, 0); > - mlx5_core_err(dev, "end\n"); > + if (!force) > + mlx5_core_err(dev, "system error event triggered\n"); > > unlock: > mutex_unlock(&dev->intf_state_mutex); > From owner-svn-src-head@freebsd.org Sun Mar 25 08:54:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 463CBF57652 for ; Sun, 25 Mar 2018 08:54:13 +0000 (UTC) (envelope-from dch@skunkwerks.at) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB1517BBFC; Sun, 25 Mar 2018 08:54:12 +0000 (UTC) (envelope-from dch@skunkwerks.at) Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id E023E21B6E; Sun, 25 Mar 2018 04:54:05 -0400 (EDT) Received: from web6 ([10.202.2.216]) by compute7.internal (MEProxy); Sun, 25 Mar 2018 04:54:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skunkwerks.at; h=content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=aIAShD2LrqnbaeyvEBMJ7tDJYMj/o KVOMa3e6tlPALg=; b=EfP+tA9y5ibNWxEPW9APnnTEBWw6FvD2uH7Kp0HU1WlRo oBtLWU8UQFj8WMNmUBWXAAgIN8RDf5p3t1Wxr8ECCoY2wL6P/V5XRxuCoM80x3de kYOlUA1Z2WHXmHYOgEDyEKnbZ7IrKkOAtxV6wUMVSp8LqwuKU6ZaF0IscwzaONIr SL5d7qwY6p32/CKAfv9c6mvtcxGVvyNu0NDDdFt1ww7hC4Aenrl0sg+5nTM4KjG1 zozQYpLQayHby4WGIX2vFOw+d0b8D6vQeJq2zGxpWtEcAOP39TzV6aF6h59ZyjJq 8Xyi1q/CuH3qATjKr8CGsDZLD/xjmonMcmu+UImag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=aIAShD 2LrqnbaeyvEBMJ7tDJYMj/oKVOMa3e6tlPALg=; b=D38u5n06kWulUmxW80hZZG kZAcffWeEgckyhtYY+eFuH7Y4xI0lJahQki7ICFUlxM/gyGxC1aL3TaMq4H6RIt3 ZnGXcb0xqSwVfYqROHKVnataAcpVOD2GWueylUnFRFO4mbirvSmXcXs2YrzaYw8v c5/HXh89ORpD0ZaS1vkZx+MV70ymB08sn+EXc/cGdKzvC66H3Edpbzir/WWAtCV0 TRK8/jgkS6O3hRnqf5CrW4Fclbo5P+Z7ABJercbNCG0Hc5CagMp1yJCL808gFP0w JnXgI+/1X4sQcZiW8LffNpoNwH/frgYU1tzdJTHzeDj6ON7mdxWeefoxAr0VPrNg == X-ME-Sender: Received: by mailuser.nyi.internal (Postfix, from userid 99) id BAF5640E5; Sun, 25 Mar 2018 04:54:05 -0400 (EDT) Message-Id: <1521968045.2210546.1315137584.4D202E01@webmail.messagingengine.com> From: Dave Cottlehuber To: svn-src-head@freebsd.org, benno@freebsd.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-5ce6c4ba Date: Sun, 25 Mar 2018 09:54:05 +0100 Subject: Re: svn commit: r331463 - in head: release/amd64 usr.sbin/makefs/cd9660 In-Reply-To: <201803232056.w2NKuJr5037840@repo.freebsd.org> References: <201803232056.w2NKuJr5037840@repo.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 08:54:13 -0000 On Fri, 23 Mar 2018, at 21:56, Benno Rice wrote: > Author: benno > Date: Fri Mar 23 20:56:18 2018 > New Revision: 331463 > URL: https://svnweb.freebsd.org/changeset/base/331463 > > Log: > Allow makefs to properly tag UEFI El Torito boot images. Use them in > amd64 ISOs. > > UEFI booting requires an EFI System Partition (ESP). On most storage devices > this will be in a specific partition type. To allow booting from CD/ISO > filesystems, UEFI will look for an ESP in the form of a FAT filesystem image > embedded in the image. Historically FreeBSD has added one of these to its > amd64 ISO images but marked it as simply another i386 boot image. Luckily for > us most UEFI implementations are rather forgiving and work this out for us. > > This change adds the ability to mark a boot image as being a UEFI image. It > also modifies our ISO generation to use this marking for the UEFI image we > embed. > > Reported by: Thomas Schmitt > Reviewed by: emaste, imp > MFC after: 1 week > Sponsored by: iXsystems, Inc. > Differential Revision: https://reviews.freebsd.org/D14809 > > Modified: > head/release/amd64/mkisoimages.sh > head/usr.sbin/makefs/cd9660/cd9660_eltorito.c > head/usr.sbin/makefs/cd9660/cd9660_eltorito.h > > Modified: head/release/amd64/mkisoimages.sh > ============================================================================== > --- head/release/amd64/mkisoimages.sh Fri Mar 23 20:32:54 2018 (r331462) > +++ head/release/amd64/mkisoimages.sh Fri Mar 23 20:56:18 2018 (r331463) > @@ -38,7 +38,7 @@ if [ "$1" = "-b" ]; then > umount efi > rmdir efi > mdconfig -d -u $device > - bootable="-o bootimage=i386;efiboot.img -o no-emul-boot $bootable" > + bootable="-o bootimage=efi;efiboot.img -o no-emul-boot $bootable" > > shift > else > > Modified: head/usr.sbin/makefs/cd9660/cd9660_eltorito.c > ============================================================================== > --- head/usr.sbin/makefs/cd9660/cd9660_eltorito.c Fri Mar 23 20:32:54 > 2018 (r331462) > +++ head/usr.sbin/makefs/cd9660/cd9660_eltorito.c Fri Mar 23 20:56:18 > 2018 (r331463) > @@ -104,9 +104,12 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, > cons > else if (strcmp(sysname, "macppc") == 0 || > strcmp(sysname, "mac68k") == 0) > new_image->system = ET_SYS_MAC; > + else if (strcmp(sysname, "efi") == 0 || > + strcmp(sysname, "uefi") == 0) > + new_image->system = ET_SYS_UEFI; > else { > warnx("boot disk system must be " > - "i386, powerpc, macppc, or mac68k"); > + "efi, i386, powerpc, macppc, mac68k"); > free(temp); > free(new_image); > return 0; > @@ -338,12 +341,12 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int > fir > int used_sectors; > int num_entries = 0; > int catalog_sectors; > - struct boot_catalog_entry *x86_head, *mac_head, *ppc_head, > + struct boot_catalog_entry *x86_head, *mac_head, *ppc_head, *uefi_head, > *valid_entry, *default_entry, *temp, *head, **headp, *next; > struct cd9660_boot_image *tmp_disk; > > headp = NULL; > - x86_head = mac_head = ppc_head = NULL; > + x86_head = mac_head = ppc_head = uefi_head = NULL; > > /* If there are no boot disks, don't bother building boot information */ > if (TAILQ_EMPTY(&diskStructure->boot_images)) > @@ -421,6 +424,9 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int fir > break; > case ET_SYS_MAC: > headp = &mac_head; > + break; > + case ET_SYS_UEFI: > + headp = &uefi_head; > break; > default: > warnx("%s: internal error: unknown system type", > > Modified: head/usr.sbin/makefs/cd9660/cd9660_eltorito.h > ============================================================================== > --- head/usr.sbin/makefs/cd9660/cd9660_eltorito.h Fri Mar 23 20:32:54 > 2018 (r331462) > +++ head/usr.sbin/makefs/cd9660/cd9660_eltorito.h Fri Mar 23 20:56:18 > 2018 (r331463) > @@ -44,6 +44,7 @@ > #define ET_SYS_X86 0 > #define ET_SYS_PPC 1 > #define ET_SYS_MAC 2 > +#define ET_SYS_UEFI 0xef > > #define ET_BOOT_ENTRY_SIZE 0x20 > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" Hi Benno, This breaks `make -DNOPORTS -s memstick ftp cdrom` for me. Rolling back to r331462 is the last working commit. This is the failure I see: 819200 bytes transferred in 0.007027 secs (116577317 bytes/sec) newfs_msdos: cannot get number of sectors per track: Operation not supported newfs_msdos: cannot get number of heads: Operation not supported /dev/md0: 1557 sectors in 1557 FAT12 clusters (512 bytes/cluster) BytesPerSec=512 SecPerClust=1 ResSectors=1 FATs=2 RootDirEnts=512 Sectors=1600 Media=0xf8 FATsecs=5 SecPerTrack=63 Heads=1 HiddenSecs=0 makefs: boot disk system must be i386, powerpc, macppc, or mac68k Usage: makefs [-xZ] [-B endian] [-b free-blocks] [-d debug-mask] [-F mtree-specfile] [-f free-files] [-M minimum-size] [-m maximum-size] [-N userdb-dir] [-O offset] [-o fs-options] [-R roundup-size] [-S sector-size] [-s image-size] [-T ] [-t fs-type] image-file directory | manifest [extra-directory ...] cd9660 specific options: l, isolevel ISO Level ... for completeness, this is my build script: #!/bin/sh -ex date -u +%Y%m%d-%H%M sudo kldload filemon || /usr/bin/true echo 'WITH_CCACHE_BUILD=yes' > /etc/src.conf echo 'WITH_META_MODE=yes' > /etc/src-env.conf NCPU=$(sysctl -n hw.ncpu) cd /usr/src sudo zfs rollback -rRf embiggen/usr/obj/release@empty git reset --hard git clean -fdx sudo zfs snapshot \ -r envy/usr/src@$(date -u +%Y%m%d-%H%M:bebuild-$(git rev-parse --verify --short=7 HEAD)) \ || /usr/bin/true time make -j${NCPU} buildworld -s echo DONE BW date -u +%Y%m%d-%H%M time make -j${NCPU} buildkernel -s echo DONE BK date -u +%Y%m%d-%H%M sudo time /usr/bin/env NO_PKG_UPGRADE=1 /usr/src/tools/build/beinstall.sh sudo zfs set canmount=noauto \ envy/ROOT/$(beadm list -H | egrep '\bN*R\b' | cut -f 1) echo DONE BE date -u +%Y%m%d-%H%M cd /usr/src/release time make -DNOPORTS -s memstick ftp cdrom echo DONE IMG echo y| poudriere jail -d -j current_amd64 poudriere jail -c -j current_amd64 -v 12.0-CURRENT -a amd64 -m \ tar=/usr/obj/usr/src/amd64.amd64/release/base.txz echo DONE POUDRIERE date -u +%Y%m%d-%H%M echo DONE ALL From owner-svn-src-head@freebsd.org Sun Mar 25 08:55:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A251F5786A; Sun, 25 Mar 2018 08:55:54 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0B9F7BC93; Sun, 25 Mar 2018 08:55:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA26D1BEAD; Sun, 25 Mar 2018 08:55:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2P8trYG021697; Sun, 25 Mar 2018 08:55:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2P8trVg021696; Sun, 25 Mar 2018 08:55:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201803250855.w2P8trVg021696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Mar 2018 08:55:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331531 - head/sys/dev/mlx5 X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/mlx5 X-SVN-Commit-Revision: 331531 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 08:55:54 -0000 Author: hselasky Date: Sun Mar 25 08:55:53 2018 New Revision: 331531 URL: https://svnweb.freebsd.org/changeset/base/331531 Log: Remove redundant prototype to fix compilation with GCC. Reported by: jeff@ MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/mlx5/driver.h Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Sun Mar 25 08:39:51 2018 (r331530) +++ head/sys/dev/mlx5/driver.h Sun Mar 25 08:55:53 2018 (r331531) @@ -868,7 +868,6 @@ static inline u32 mlx5_base_mkey(const u32 key) return key & 0xffffff00u; } -void mlx5_enter_error_state(struct mlx5_core_dev *dev, bool force); int mlx5_cmd_init(struct mlx5_core_dev *dev); void mlx5_cmd_cleanup(struct mlx5_core_dev *dev); void mlx5_cmd_use_events(struct mlx5_core_dev *dev); From owner-svn-src-head@freebsd.org Sun Mar 25 08:57:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AD7CF57A70; Sun, 25 Mar 2018 08:57:29 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D06507BE2B; Sun, 25 Mar 2018 08:57:28 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 97923260596; Sun, 25 Mar 2018 10:57:20 +0200 (CEST) Subject: Re: svn commit: r331447 - head/sys/dev/mlx5/mlx5_core To: Jeff Roberson Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803231811.w2NIB6o8051699@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <14ae19c4-99fb-8639-d211-b247e099db0f@selasky.org> Date: Sun, 25 Mar 2018 10:57:14 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 08:57:29 -0000 On 03/25/18 09:47, Jeff Roberson wrote: > >> Author: hselasky >> Date: Fri Mar 23 18:11:06 2018 >> New Revision: 331447 >> URL: https://svnweb.freebsd.org/changeset/base/331447 >> >> Log: >>  Hide verbose proclamation of error when forced in mlx5core. >> >>  When mlx5_enter_error_state() operation is forced by shutdown, the >>  messages surrounding setting the error state are not informational >>  and confuse users. >> >>  Submitted by:    kib@ >>  MFC after:    1 week >>  Sponsored by:    Mellanox Technologies > > > This broke on sparc64 build: > > In file included from /usr/head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c:41: > /usr/head/sys/dev/mlx5/mlx5_core/mlx5_core.h:86: warning: redundant > redeclaration of 'm > lx5_enter_error_state' [-Wredundant-decls] > /usr/head/sys/dev/mlx5/driver.h:871: warning: previous declaration of > 'mlx5_enter_error > _state' was here > --- mlx5_alloc.o --- > cc1: warnings being treated as errors > > Thanks, > Jeff > >> >> Modified: >>  head/sys/dev/mlx5/mlx5_core/mlx5_health.c >> >> Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c >> ============================================================================== >> >> --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c    Fri Mar 23 18:09:09 >> 2018    (r331446) >> +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c    Fri Mar 23 18:11:06 >> 2018    (r331447) >> @@ -99,14 +99,16 @@ void mlx5_enter_error_state(struct mlx5_core_dev >> *dev, >>         return; >>     } >> >> -    mlx5_core_err(dev, "start\n"); >> +    if (!force) >> +        mlx5_core_err(dev, "internal state error detected\n"); >>     if (pci_channel_offline(dev->pdev) || in_fatal(dev) || force) { >>         dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR; >>         mlx5_trigger_cmd_completions(dev); >>     } >> >>     mlx5_core_event(dev, MLX5_DEV_EVENT_SYS_ERROR, 0); >> -    mlx5_core_err(dev, "end\n"); >> +    if (!force) >> +        mlx5_core_err(dev, "system error event triggered\n"); >> >> unlock: >>     mutex_unlock(&dev->intf_state_mutex); >> > > Hi, See here: https://svnweb.freebsd.org/changeset/base/331531 --HPS From owner-svn-src-head@freebsd.org Sun Mar 25 11:49:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12541F65B07; Sun, 25 Mar 2018 11:49:51 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8034C80FB0; Sun, 25 Mar 2018 11:49:50 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w2PBnk7f041040; Sun, 25 Mar 2018 04:49:46 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w2PBnj3R041039; Sun, 25 Mar 2018 04:49:45 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803251149.w2PBnj3R041039@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci In-Reply-To: To: Mark Peek Date: Sun, 25 Mar 2018 04:49:45 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 11:49:51 -0000 > On Sat, Mar 24, 2018 at 6:27 PM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > Author: mp > > > Date: Sun Mar 25 00:57:00 2018 > > > New Revision: 331510 > > > URL: https://svnweb.freebsd.org/changeset/base/331510 > > > > These files do not each contain a usable copyright, though > > they seem to contain SPDX tags that indiate they should contain > > a BSD 2 clause copyright. > > > IANAL but I believe you meant "...they should contain a BSD 2 clause > *license*". The files should contain a valid copyright. A valid, but unusable. As the copyright is it is a full copyright held by vmware without any rights to be published or redistributed any any manner by anyone but vmware. "Copyright (c) 2018 VMware, Inc. All Rights Reserved." That is a restrictive copyright, allowing no one to publish, or in our case, redistribute, without a further license of some form. > The intent of my commit and the author were to use the implied SPDX version > of the licenses without burdening the source code with the more heavyweight > license text. Having seen SPDX in the src tree, I believed > the SPDX-License-Identifier was sufficient. But, to your point, I'm not > sure I have seen a discussion or a decision on it. SPDX tags are purely to be treated as "advisory" and in no one imply or create any license agreement. > Mark -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Mar 25 14:35:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C404F4A883 for ; Sun, 25 Mar 2018 14:35:15 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic309-27.consmr.mail.bf2.yahoo.com (sonic309-27.consmr.mail.bf2.yahoo.com [74.6.129.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25F7C87AFF for ; Sun, 25 Mar 2018 14:35:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1521988514; bh=GTofx2AjJB/NwK7Kh0w8oVoEPlbKsCIFa7PyAl0WC9g=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=psnyi/17jbprPInX97BQFQFjGUTCVe6LJut0bs7Blsa6DnbfCUbs4cnIn5PnG2PFvv+jzGlD8usS95tzx1Klmd6Fxz1ZhYRgQ6wATjS78uv2mg5YOy8F7omH5f8NynMDfpSmzEnSQEJJv8KCuv2aXOg77l6MpOP+Hi4ATTjKInlipS8+YJkNvfwIt7ZVtRChgCQ6ShzYfumBn3gh8ycoeIOT2V6WRu7jPEK1zqVqBQfoyPx3k8T9hFwU2k7Q7QwYVB1ck9MCYjaawBZYFdvLFQAEGIPh09ZFqW4jDd0WgPLTzVxpEbfj+a7NMWh3An7IdrhqSM0NjrW02Yg/Feeb1w== X-YMail-OSG: Asq4sqwVM1kSgmJe1PPLiEeYCt22tC.v14ZfoB7z6UipGFRuBp1wTPoCQK0qjaz Ls2UTEGUjg11sWuz4hUuyZhATapaPHp1iTNEURtA7yFqERu9dTrcvu36OnrPSPutibQo_sXrHH2G KPBVxTnBR5QF6cnUBwuzgISMC1GoOMlqaetiBMBFa3wFrK70FAONKac7J0w8QngLNv7NwOF5dPWV HjNiCMk7UW8oyUwCEX9RouN_FHdsWoVLWz1SF8J1yV2MJWfmUcsJmXmrjaXzuu90wTAg41NgJrh_ gp1mq5Mv6Z9tz2BOWXcsSKl1ZnAXAd_gok.WBz6jigizS6m1BR8hTUtWAz5Oq_D8ts1D7o0fHFa. SmjKahtfdmuj_c.SjafmOXwKvibp_.QZkmQoiUwD5TgKrhvxBybrHJecmMchlokfw3pLrv5H.yUB 6WtC9vl35O4emn_R.ItIfgJTPfZGCBhKwKC5tU9_ZBlIccXlG3orRqmX9_7Q37QKA4nM4ny5xRAC ClrIzPGLyGw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic309.consmr.mail.bf2.yahoo.com with HTTP; Sun, 25 Mar 2018 14:35:14 +0000 Received: from 181.52.72.201 (EHLO [192.168.0.5]) ([181.52.72.201]) by smtp427.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 5bc48b565e8e40f15a151ddc15a5547f; Sun, 25 Mar 2018 14:15:00 +0000 (UTC) Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci To: rgrimes@freebsd.org, Mark Peek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803251149.w2PBnj3R041039@pdx.rh.CN85.dnsmgr.net> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <8dffed54-3319-d826-5ec1-fd80155a3921@FreeBSD.org> Date: Sun, 25 Mar 2018 09:15:00 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201803251149.w2PBnj3R041039@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 14:35:15 -0000 On 25/03/2018 06:49, Rodney W. Grimes wrote: >> On Sat, Mar 24, 2018 at 6:27 PM, Rodney W. Grimes < >> freebsd@pdx.rh.cn85.dnsmgr.net> wrote: >> >>>> Author: mp >>>> Date: Sun Mar 25 00:57:00 2018 >>>> New Revision: 331510 >>>> URL: https://svnweb.freebsd.org/changeset/base/331510 >>> These files do not each contain a usable copyright, though >>> they seem to contain SPDX tags that indiate they should contain >>> a BSD 2 clause copyright. >> >> IANAL but I believe you meant "...they should contain a BSD 2 clause >> *license*". The files should contain a valid copyright. > A valid, but unusable. As the copyright is it is a full copyright > held by vmware without any rights to be published or redistributed > any any manner by anyone but vmware. > > "Copyright (c) 2018 VMware, Inc. All Rights Reserved." > > That is a restrictive copyright, allowing no one to publish, or > in our case, redistribute, without a further license of some form. > >> The intent of my commit and the author were to use the implied SPDX version >> of the licenses without burdening the source code with the more heavyweight >> license text. Having seen SPDX in the src tree, I believed >> the SPDX-License-Identifier was sufficient. But, to your point, I'm not >> sure I have seen a discussion or a decision on it. > SPDX tags are purely to be treated as "advisory" and in no one imply > or create any license agreement. As happens in economics, different lawyers can have different interpretations. Our practices were consulted with the SPDX guys but other projects have different practices. While the sound practice, especially when you don't own the code, is to add the SPDX tag in addition to the license text, the linux developers are encouraging replacing it altogether with the SPDX tag. In their case they keep a reference to the complete license text elsewhere and they have some repository log where the copyright owner did the change. For contrib code we just follow upstream. In no case can anyone other than the copyright owner clarify, or otherwise change, a license. Pedro. From owner-svn-src-head@freebsd.org Sun Mar 25 16:03:33 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CA93F533EE; Sun, 25 Mar 2018 16:03:33 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F8916B271; Sun, 25 Mar 2018 16:03:31 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w2PG3MDv041798; Sun, 25 Mar 2018 09:03:22 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w2PG3KLQ041797; Sun, 25 Mar 2018 09:03:20 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803251603.w2PG3KLQ041797@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci In-Reply-To: <8dffed54-3319-d826-5ec1-fd80155a3921@FreeBSD.org> To: Pedro Giffuni Date: Sun, 25 Mar 2018 09:03:20 -0700 (PDT) CC: rgrimes@freebsd.org, Mark Peek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 16:03:33 -0000 > > > On 25/03/2018 06:49, Rodney W. Grimes wrote: > >> On Sat, Mar 24, 2018 at 6:27 PM, Rodney W. Grimes < > >> freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > >> > >>>> Author: mp > >>>> Date: Sun Mar 25 00:57:00 2018 > >>>> New Revision: 331510 > >>>> URL: https://svnweb.freebsd.org/changeset/base/331510 > >>> These files do not each contain a usable copyright, though > >>> they seem to contain SPDX tags that indiate they should contain > >>> a BSD 2 clause copyright. > >> > >> IANAL but I believe you meant "...they should contain a BSD 2 clause > >> *license*". The files should contain a valid copyright. > > A valid, but unusable. As the copyright is it is a full copyright > > held by vmware without any rights to be published or redistributed > > any any manner by anyone but vmware. > > > > "Copyright (c) 2018 VMware, Inc. All Rights Reserved." > > > > That is a restrictive copyright, allowing no one to publish, or > > in our case, redistribute, without a further license of some form. > > > >> The intent of my commit and the author were to use the implied SPDX version > >> of the licenses without burdening the source code with the more heavyweight > >> license text. Having seen SPDX in the src tree, I believed > >> the SPDX-License-Identifier was sufficient. But, to your point, I'm not > >> sure I have seen a discussion or a decision on it. > > SPDX tags are purely to be treated as "advisory" and in no one imply > > or create any license agreement. > > As happens in economics, different lawyers can have different > interpretations. Our practices were consulted with the SPDX guys but > other projects have different practices. > > While the sound practice, especially when you don't own the code, is to > add the SPDX tag in addition to the license text, the linux developers > are encouraging replacing it altogether with the SPDX tag. In their case > they keep a reference to the complete license text elsewhere and they > have some repository log where the copyright owner did the change. They have grown use to this from the way the GPL is handled, since the length of the body of that license would be impractical to include. > For contrib code we just follow upstream. In no case can anyone other > than the copyright owner clarify, or otherwise change, a license. That does bring a question of why this code is not either on a vendor import branch, or in contrib? Can you point to any files in /usr/src that lack a full and complete standalone license? Sans perhaps some GPL code that has a pointer to COPYING and files that can not such as Makefile and .mk's. Kirk would have to back me up on this, but my understanding of the decisions that the UCB Regents legal staff came to was that each file should have a complete copyright and license clause and any thing less causes problems because of "seprability", and "alterability" because of seperate files. The exception to this is files that can not be copyrighted such as Makefiles, and I have seen those now with copyrights in them, which is not enforceable as a Makefile is usually considered a receipt. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Mar 25 16:16:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E7B2F54429 for ; Sun, 25 Mar 2018 16:16:10 +0000 (UTC) (envelope-from mark@peek.org) Received: from mail-yw0-f173.google.com (mail-yw0-f173.google.com [209.85.161.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27C316BAFE for ; Sun, 25 Mar 2018 16:16:09 +0000 (UTC) (envelope-from mark@peek.org) Received: by mail-yw0-f173.google.com with SMTP id z82so5435575ywd.9 for ; Sun, 25 Mar 2018 09:16:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=KQ7fvCEYpHcf6LcKNUlPotZ+MIG9omkqxvSFPPIQqzQ=; b=gi7Bkwe6S+FVtlf6ZQli/eaywvcQ1EMOYnmI6JYqi4f9z4iFczLL6r7c5icjFb0xc3 U48J0Qv5GcqtysQ/X9sME1CadDzVXpnMtQey7apK+p7N6fbZW10gixaUeugWHAD9StG1 T7rkGaiDfVJN8Ka1HJsxT8/ubwNFWaWXD1B63qP56KOq8E1XP6Sa4JVgH0PUdUS3HVZQ bIknGlHysZvzRKOVt26i+SOI+z0QH6fJhNu30RYcGJCc+Wxz1A4IRLxTv7GTU4wtLsYH eQ2pH4975I1/UwxEqBeOm96HTRjKjuk6J6H6y/Td4F5HZIzQa7OAL9BUid/yEf1THsoj Gi/Q== X-Gm-Message-State: AElRT7FJFbelBXDfXveOuplKjsut6VdWiVIM4gRncp1Fbf3G0gvlhsr4 IhzQMud1aTVHff+av82Wue0ye1cxfC+UrA== X-Google-Smtp-Source: AG47ELsc27f3RozgPRDKfwLBjLsmd3EimVYUb2BE6Xor7A+TiXnrvtOch5VtVTTaCcVhVn17cKrOgQ== X-Received: by 10.129.145.79 with SMTP id i76mr20956840ywg.369.1521994568919; Sun, 25 Mar 2018 09:16:08 -0700 (PDT) Received: from mail-yw0-f170.google.com (mail-yw0-f170.google.com. [209.85.161.170]) by smtp.gmail.com with ESMTPSA id i63sm4276408ywf.90.2018.03.25.09.16.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Mar 2018 09:16:08 -0700 (PDT) Received: by mail-yw0-f170.google.com with SMTP id y23so5435461ywy.4 for ; Sun, 25 Mar 2018 09:16:08 -0700 (PDT) X-Received: by 10.129.69.31 with SMTP id s31mr12583715ywa.367.1521994568039; Sun, 25 Mar 2018 09:16:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:4206:0:0:0:0:0 with HTTP; Sun, 25 Mar 2018 09:16:07 -0700 (PDT) X-Originating-IP: [2601:646:c700:35ed:2193:d6c4:780d:4bcb] In-Reply-To: <201803251603.w2PG3KLQ041797@pdx.rh.CN85.dnsmgr.net> References: <8dffed54-3319-d826-5ec1-fd80155a3921@FreeBSD.org> <201803251603.w2PG3KLQ041797@pdx.rh.CN85.dnsmgr.net> From: Mark Peek Date: Sun, 25 Mar 2018 09:16:07 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci To: rgrimes@freebsd.org Cc: Pedro Giffuni , Mark Peek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 16:16:11 -0000 On Sun, Mar 25, 2018 at 9:03 AM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > On 25/03/2018 06:49, Rodney W. Grimes wrote: > > >> On Sat, Mar 24, 2018 at 6:27 PM, Rodney W. Grimes < > > >> freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > >> > > >>>> Author: mp > > >>>> Date: Sun Mar 25 00:57:00 2018 > > >>>> New Revision: 331510 > > >>>> URL: https://svnweb.freebsd.org/changeset/base/331510 > > >>> These files do not each contain a usable copyright, though > > >>> they seem to contain SPDX tags that indiate they should contain > > >>> a BSD 2 clause copyright. > > >> > > >> IANAL but I believe you meant "...they should contain a BSD 2 clause > > >> *license*". The files should contain a valid copyright. > > > A valid, but unusable. As the copyright is it is a full copyright > > > held by vmware without any rights to be published or redistributed > > > any any manner by anyone but vmware. > > > > > > "Copyright (c) 2018 VMware, Inc. All Rights Reserved." > > > > > > That is a restrictive copyright, allowing no one to publish, or > > > in our case, redistribute, without a further license of some form. > > > > > >> The intent of my commit and the author were to use the implied SPDX > version > > >> of the licenses without burdening the source code with the more > heavyweight > > >> license text. Having seen SPDX in the src tree, I believed > > >> the SPDX-License-Identifier was sufficient. But, to your point, I'm > not > > >> sure I have seen a discussion or a decision on it. > > > SPDX tags are purely to be treated as "advisory" and in no one imply > > > or create any license agreement. > > > > As happens in economics, different lawyers can have different > > interpretations. Our practices were consulted with the SPDX guys but > > other projects have different practices. > > > > While the sound practice, especially when you don't own the code, is to > > add the SPDX tag in addition to the license text, the linux developers > > are encouraging replacing it altogether with the SPDX tag. In their case > > they keep a reference to the complete license text elsewhere and they > > have some repository log where the copyright owner did the change. > > They have grown use to this from the way the GPL is handled, since > the length of the body of that license would be impractical to > include. > > > For contrib code we just follow upstream. In no case can anyone other > > than the copyright owner clarify, or otherwise change, a license. > > That does bring a question of why this code is not either on > a vendor import branch, or in contrib? > > Can you point to any files in /usr/src that lack a full and complete > standalone license? Sans perhaps some GPL code that has a pointer > to COPYING and files that can not such as Makefile and .mk's. > > Kirk would have to back me up on this, but my understanding of the > decisions that the UCB Regents legal staff came to was that each > file should have a complete copyright and license clause and any > thing less causes problems because of "seprability", and "alterability" > because of seperate files. > > The exception to this is files that can not be copyrighted such as > Makefiles, and I have seen those now with copyrights in them, > which is not enforceable as a Makefile is usually considered > a receipt. > > Was the discussion with Kirk and the USB regents done recently? In the context of SPDX? The main point is ensuring we know the copyright and license for any source file in our repository. The use of a SPDX identifier (along with a copyright statement is intended to give an immutable copy of the specific license without copying the entire license text into the source files. The issue isn't whether I will commit the entire dual license text as I can easily and will do that per your concerns. I'd prefer to see us allow SPDX only since it implies the same thing. Mark From owner-svn-src-head@freebsd.org Sun Mar 25 16:34:53 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 184EAF55D59; Sun, 25 Mar 2018 16:34:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com [209.85.214.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9EB906C544; Sun, 25 Mar 2018 16:34:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f46.google.com with SMTP id z7-v6so10019904iti.1; Sun, 25 Mar 2018 09:34:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=1+U+U7TYFlnklqKbi+NdVrJWTSnlCGhOe5ySWAziTy4=; b=msqMiaJ1SWMFSUO+zwSXYm1ZEaavumHSCRjuBh/twOwwsm45CDyRes6akgkcY7jJao M2byDxh4iJ2fEjtcmY++01V3czGyp+CQM3FyTwB2G6GXzkVU7KGt7aoiA4j1yapyuYIb zFiSVFGJt40g+z37Tax6mxbv2TRjQQVMV6HioxplWYLzZUvWXoVyTZ5qY+6iRfWGf2xH rjz0e88a2KdeQ695PKZ1nwqn9IxwbQnyYWSIaN6FUpkHg418HEjWEWP7ju23Kkmyvm72 NBu2fmbDDOvrTOsno49Tb71TZLQvfW1aUJjBdXWLa5bkE+Ss2Fof4Quvk1EOI+7SaRUd 0avg== X-Gm-Message-State: AElRT7HepT7ZaCsdXDmqHmB8X5qB/O8cApElEzS1zZ5zwnv4VQqGpYmd xN5/HxrA6m0cmUsr3mXYYo3lToif X-Google-Smtp-Source: AIpwx48caxDjP7n3OBtrH2mh+G/aUcjLlnY1urlvWeW5wHS0quOf7BWoG/wWrMdr9T9RtNyIexfwPg== X-Received: by 2002:a24:a445:: with SMTP id v5-v6mr7905048iti.126.1521994213381; Sun, 25 Mar 2018 09:10:13 -0700 (PDT) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com. [209.85.214.43]) by smtp.gmail.com with ESMTPSA id o186-v6sm8691769ita.28.2018.03.25.09.10.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Mar 2018 09:10:13 -0700 (PDT) Received: by mail-it0-f43.google.com with SMTP id v194-v6so7873423itb.0; Sun, 25 Mar 2018 09:10:13 -0700 (PDT) X-Received: by 2002:a24:2b52:: with SMTP id h79-v6mr3005001ita.135.1521994212897; Sun, 25 Mar 2018 09:10:12 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.62.19 with HTTP; Sun, 25 Mar 2018 09:10:12 -0700 (PDT) In-Reply-To: References: <201803231811.w2NIB6o8051699@repo.freebsd.org> From: Conrad Meyer Date: Sun, 25 Mar 2018 09:10:12 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331447 - head/sys/dev/mlx5/mlx5_core To: Jeff Roberson Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 16:34:53 -0000 It seems it slipped back in via r331445 after I had removed it in r330714. On Sun, Mar 25, 2018 at 12:47 AM, Jeff Roberson wrote: > >> Author: hselasky >> Date: Fri Mar 23 18:11:06 2018 >> New Revision: 331447 >> URL: https://svnweb.freebsd.org/changeset/base/331447 >> >> Log: >> Hide verbose proclamation of error when forced in mlx5core. >> >> When mlx5_enter_error_state() operation is forced by shutdown, the >> messages surrounding setting the error state are not informational >> and confuse users. >> >> Submitted by: kib@ >> MFC after: 1 week >> Sponsored by: Mellanox Technologies > > > > This broke on sparc64 build: > > In file included from /usr/head/sys/dev/mlx5/mlx5_core/mlx5_cmd.c:41: > /usr/head/sys/dev/mlx5/mlx5_core/mlx5_core.h:86: warning: redundant > redeclaration of 'm > lx5_enter_error_state' [-Wredundant-decls] > /usr/head/sys/dev/mlx5/driver.h:871: warning: previous declaration of > 'mlx5_enter_error > _state' was here > --- mlx5_alloc.o --- > cc1: warnings being treated as errors > > Thanks, > Jeff > > >> >> Modified: >> head/sys/dev/mlx5/mlx5_core/mlx5_health.c >> >> Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c >> >> ============================================================================== >> --- head/sys/dev/mlx5/mlx5_core/mlx5_health.c Fri Mar 23 18:09:09 2018 >> (r331446) >> +++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c Fri Mar 23 18:11:06 2018 >> (r331447) >> @@ -99,14 +99,16 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev, >> return; >> } >> >> - mlx5_core_err(dev, "start\n"); >> + if (!force) >> + mlx5_core_err(dev, "internal state error detected\n"); >> if (pci_channel_offline(dev->pdev) || in_fatal(dev) || force) { >> dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR; >> mlx5_trigger_cmd_completions(dev); >> } >> >> mlx5_core_event(dev, MLX5_DEV_EVENT_SYS_ERROR, 0); >> - mlx5_core_err(dev, "end\n"); >> + if (!force) >> + mlx5_core_err(dev, "system error event triggered\n"); >> >> unlock: >> mutex_unlock(&dev->intf_state_mutex); >> > From owner-svn-src-head@freebsd.org Sun Mar 25 16:36:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6DB6F55FA1; Sun, 25 Mar 2018 16:36:40 +0000 (UTC) (envelope-from joerg@bec.de) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 650086C6ED; Sun, 25 Mar 2018 16:36:40 +0000 (UTC) (envelope-from joerg@bec.de) X-Originating-IP: 93.205.161.31 Received: from britannica.bec.de (unknown [93.205.161.31]) (Authenticated sender: joerg@bec.de) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id D8AF7C000B; Sun, 25 Mar 2018 18:36:32 +0200 (CEST) Date: Sun, 25 Mar 2018 18:35:34 +0200 From: Joerg Sonnenberger To: rgrimes@freebsd.org Cc: Pedro Giffuni , Mark Peek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci Message-ID: <20180325163534.GB23474@britannica.bec.de> References: <8dffed54-3319-d826-5ec1-fd80155a3921@FreeBSD.org> <201803251603.w2PG3KLQ041797@pdx.rh.CN85.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201803251603.w2PG3KLQ041797@pdx.rh.CN85.dnsmgr.net> User-Agent: Mutt/1.9.0 (2017-09-02) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 16:36:40 -0000 On Sun, Mar 25, 2018 at 09:03:20AM -0700, Rodney W. Grimes wrote: > Kirk would have to back me up on this, but my understanding of the > decisions that the UCB Regents legal staff came to was that each > file should have a complete copyright and license clause and any > thing less causes problems because of "seprability", and "alterability" > because of seperate files. Are you talking about a decision made before the USA joined the rest of the civilised world as signee of the Berne Convention? The copyright notice was certainly required at the time. A full license clause is nicer for "stealing" things, but certainly not required. Joerg From owner-svn-src-head@freebsd.org Sun Mar 25 16:42:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BE04F568BD; Sun, 25 Mar 2018 16:42:49 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 857FC6CCB9; Sun, 25 Mar 2018 16:42:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w2PGgkbS041970; Sun, 25 Mar 2018 09:42:46 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w2PGgkcx041969; Sun, 25 Mar 2018 09:42:46 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803251642.w2PGgkcx041969@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci In-Reply-To: To: Mark Peek Date: Sun, 25 Mar 2018 09:42:46 -0700 (PDT) CC: rgrimes@freebsd.org, Pedro Giffuni , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 16:42:49 -0000 > On Sun, Mar 25, 2018 at 9:03 AM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > > > > > > > > On 25/03/2018 06:49, Rodney W. Grimes wrote: > > > >> On Sat, Mar 24, 2018 at 6:27 PM, Rodney W. Grimes < > > > >> freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > >> > > > >>>> Author: mp > > > >>>> Date: Sun Mar 25 00:57:00 2018 > > > >>>> New Revision: 331510 > > > >>>> URL: https://svnweb.freebsd.org/changeset/base/331510 > > > >>> These files do not each contain a usable copyright, though > > > >>> they seem to contain SPDX tags that indiate they should contain > > > >>> a BSD 2 clause copyright. > > > >> > > > >> IANAL but I believe you meant "...they should contain a BSD 2 clause > > > >> *license*". The files should contain a valid copyright. > > > > A valid, but unusable. As the copyright is it is a full copyright > > > > held by vmware without any rights to be published or redistributed > > > > any any manner by anyone but vmware. > > > > > > > > "Copyright (c) 2018 VMware, Inc. All Rights Reserved." > > > > > > > > That is a restrictive copyright, allowing no one to publish, or > > > > in our case, redistribute, without a further license of some form. > > > > > > > >> The intent of my commit and the author were to use the implied SPDX > > version > > > >> of the licenses without burdening the source code with the more > > heavyweight > > > >> license text. Having seen SPDX in the src tree, I believed > > > >> the SPDX-License-Identifier was sufficient. But, to your point, I'm > > not > > > >> sure I have seen a discussion or a decision on it. > > > > SPDX tags are purely to be treated as "advisory" and in no one imply > > > > or create any license agreement. > > > > > > As happens in economics, different lawyers can have different > > > interpretations. Our practices were consulted with the SPDX guys but > > > other projects have different practices. > > > > > > While the sound practice, especially when you don't own the code, is to > > > add the SPDX tag in addition to the license text, the linux developers > > > are encouraging replacing it altogether with the SPDX tag. In their case > > > they keep a reference to the complete license text elsewhere and they > > > have some repository log where the copyright owner did the change. > > > > They have grown use to this from the way the GPL is handled, since > > the length of the body of that license would be impractical to > > include. > > > > > For contrib code we just follow upstream. In no case can anyone other > > > than the copyright owner clarify, or otherwise change, a license. > > > > That does bring a question of why this code is not either on > > a vendor import branch, or in contrib? > > > > Can you point to any files in /usr/src that lack a full and complete > > standalone license? Sans perhaps some GPL code that has a pointer > > to COPYING and files that can not such as Makefile and .mk's. > > > > Kirk would have to back me up on this, but my understanding of the > > decisions that the UCB Regents legal staff came to was that each > > file should have a complete copyright and license clause and any > > thing less causes problems because of "seprability", and "alterability" > > because of seperate files. > > > > The exception to this is files that can not be copyrighted such as > > Makefiles, and I have seen those now with copyrights in them, > > which is not enforceable as a Makefile is usually considered > > a receipt. > > > > > Was the discussion with Kirk and the USB regents done recently? In the > context of SPDX? No, this discussion occured I believe near the time of Net/2, I believe it was Kirk who had the task of plaing the UCB 4 clause license in all the files. If you look around the whole of "free source code" (not open source, free as in BSD style licenses) that is coming out of sizeable entities who either can afford, or already have, legal staff no one that I have seen at any time in the last 25 years deviats from this behavior. I am actally rather suprized to see these files in the current form outside of VMWare without an embeded license clause. > The main point is ensuring we know the copyright and license for any source > file in our repository. The use of a SPDX identifier (along with a > copyright statement is > intended to give an immutable copy of the specific license without copying > the entire > license text into the source files. When the SPDX stuff was added, I raised some concerns, and was repeatedly told "these are just advisory anyway." So to now see them being used as "this IS the license" comes contrary to those assertions. > > The issue isn't whether I will commit the entire dual license text as I can > easily and will do > that per your concerns. I'd prefer to see us allow SPDX only since it > implies the same thing. Other than it has already been stated that the SPDX tags are purely advisory tags, and when I apply that principal to these file as they are now I have no valid license to use them. Nor does the Project or Foundation have any license to distribute them. If we try to say "well, these SPDX tags are 'the one truth', but these are 'simply advisory'" we would be going down a very slippery slope. Did VMWare provide the files with the dual license text in them? Or did they provide files with SPDX tags in them? Or ? Does VMWare have these files published some place, with terms of use and such? > Mark -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Mar 25 16:46:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DFEAF56D34; Sun, 25 Mar 2018 16:46:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27F8D6CFD7; Sun, 25 Mar 2018 16:46:18 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w2PGkGql042005; Sun, 25 Mar 2018 09:46:16 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w2PGkG3Z042004; Sun, 25 Mar 2018 09:46:16 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803251646.w2PGkG3Z042004@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci In-Reply-To: <20180325163534.GB23474@britannica.bec.de> To: Joerg Sonnenberger Date: Sun, 25 Mar 2018 09:46:16 -0700 (PDT) CC: rgrimes@freebsd.org, Pedro Giffuni , Mark Peek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 16:46:19 -0000 > On Sun, Mar 25, 2018 at 09:03:20AM -0700, Rodney W. Grimes wrote: > > Kirk would have to back me up on this, but my understanding of the > > decisions that the UCB Regents legal staff came to was that each > > file should have a complete copyright and license clause and any > > thing less causes problems because of "seprability", and "alterability" > > because of seperate files. > > Are you talking about a decision made before the USA joined the rest of > the civilised world as signee of the Berne Convention? > The copyright > notice was certainly required at the time. A full license clause is > nicer for "stealing" things, but certainly not required. With or without application of Berne Convention, without a license you (us, FreeBSD project, foundation) have no rights to publish (redistribute) the work, unless that copyright is a of the form that it would "placed in the public domain" the work. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Mar 25 16:56:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33119F57A43; Sun, 25 Mar 2018 16:56:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7CEE6D6A9; Sun, 25 Mar 2018 16:56:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D2C5A20C33; Sun, 25 Mar 2018 16:56:49 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2PGun5L061279; Sun, 25 Mar 2018 16:56:49 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2PGunC0061278; Sun, 25 Mar 2018 16:56:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803251656.w2PGunC0061278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 25 Mar 2018 16:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331532 - head/sys/crypto/ccp X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/crypto/ccp X-SVN-Commit-Revision: 331532 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 16:56:50 -0000 Author: imp Date: Sun Mar 25 16:56:49 2018 New Revision: 331532 URL: https://svnweb.freebsd.org/changeset/base/331532 Log: The PNP info has to follow the module definition. Move it from just after the array to its proper location. Otherwise, the linker.hints file has things out of order and we associated it with whatever was the previous module. Modified: head/sys/crypto/ccp/ccp.c Modified: head/sys/crypto/ccp/ccp.c ============================================================================== --- head/sys/crypto/ccp/ccp.c Sun Mar 25 08:55:53 2018 (r331531) +++ head/sys/crypto/ccp/ccp.c Sun Mar 25 16:56:49 2018 (r331532) @@ -79,8 +79,6 @@ static struct pciid { { 0x14561022, "AMD CCP-5a" }, { 0x14681022, "AMD CCP-5b" }, }; -MODULE_PNP_INFO("W32:vendor/device", pci, ccp, ccp_ids, sizeof(ccp_ids[0]), - nitems(ccp_ids)); static struct random_source random_ccp = { .rs_ident = "AMD CCP TRNG", @@ -783,6 +781,8 @@ DRIVER_MODULE(ccp, pci, ccp_driver, ccp_devclass, NULL MODULE_VERSION(ccp, 1); MODULE_DEPEND(ccp, crypto, 1, 1, 1); MODULE_DEPEND(ccp, random_device, 1, 1, 1); +MODULE_PNP_INFO("W32:vendor/device", pci, ccp, ccp_ids, sizeof(ccp_ids[0]), + nitems(ccp_ids)); static int ccp_queue_reserve_space(struct ccp_queue *qp, unsigned n, int mflags) From owner-svn-src-head@freebsd.org Sun Mar 25 16:57:22 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC56FF57B54; Sun, 25 Mar 2018 16:57:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A16C6D802; Sun, 25 Mar 2018 16:57:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8390120C34; Sun, 25 Mar 2018 16:57:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2PGvLjS061347; Sun, 25 Mar 2018 16:57:21 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2PGvLSq061346; Sun, 25 Mar 2018 16:57:21 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803251657.w2PGvLSq061346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 25 Mar 2018 16:57:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331533 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 331533 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 16:57:22 -0000 Author: eadler Date: Sun Mar 25 16:57:21 2018 New Revision: 331533 URL: https://svnweb.freebsd.org/changeset/base/331533 Log: [pci-vendors] Update to 2018-03-21 MFC After: 3 days Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Sun Mar 25 16:56:49 2018 (r331532) +++ head/share/misc/pci_vendors Sun Mar 25 16:57:21 2018 (r331533) @@ -1,10 +1,9 @@ # $FreeBSD$ -# # List of PCI ID's # -# Version: 2018.03.06 -# Date: 2018-03-06 03:15:02 +# Version: 2018.03.21 +# Date: 2018-03-21 03:15:01 # # Maintained by Albert Pool, Martin Mares, and other volunteers from # the PCI ID Project at http://pci-ids.ucw.cz/. @@ -6393,6 +6392,7 @@ 1077 000b 25GE 2P QL41262HxCU-DE Adapter 1077 0011 FastLinQ QL41212H 25GbE Adapter 1077 0012 FastLinQ QL41112H 10GbE Adapter + 1077 0039 QLogic QL41262 PCIe 25Gb 2-Port SFP28 Ethernet Adapter 1590 021d 10/25GbE 2P QL41222HLCU-HP Adapter 1590 021e 10/25GbE 2P QL41162HMRJ-HP Adapter 1590 021f 10/25GbE 2P QL41262HMCU-HP Adapter @@ -8334,8 +8334,10 @@ 0100 Lightning 1200 10dd 0023 Lightning 1200 15+16M 10de NVIDIA Corporation - 0008 NV1 [EDGE 3D] - 0009 NV1 [EDGE 3D] + 0008 NV1 [STG2000X-B Series] + 0009 NV1 [NV1 Series] + 0018 NV3 [Riva 128] + 0019 NV3 [Riva 128ZX] 0020 NV4 [Riva TNT] 1043 0200 V3400 TNT 1048 0c18 Erazor II SGRAM @@ -8706,12 +8708,12 @@ 00f9 NV40 [GeForce 6800 GT/GTO/Ultra] 10de 00f9 NV40 [GeForce 6800 GT] 1682 2120 GEFORCE 6800 GT PCI-E - 00fa NV36 [GeForce PCX 5750] - 00fb NV38 [GeForce PCX 5900] + 00fa NV39 [GeForce PCX 5750] + 00fb NV35 [GeForce PCX 5900] 00fc NV37GL [Quadro FX 330/GeForce PCX 5300] 00fd NV37GL [Quadro PCI-E Series] 00fe NV38GL [Quadro FX 1300] - 00ff NV18 [GeForce PCX 4300] + 00ff NV19 [GeForce PCX 4300] 0100 NV10 [GeForce 256 SDR] 1043 0200 AGP-V6600 SGRAM 1043 0201 AGP-V6600 SDRAM @@ -11072,7 +11074,7 @@ 1b80 GP104 [GeForce GTX 1080] 1b81 GP104 [GeForce GTX 1070] 1b82 GP104 [GeForce GTX 1070 Ti] - 1b83 GP104 + 1b83 GP104 [GeForce GTX 1060 6GB] 1b84 GP104 [GeForce GTX 1060 3GB] 1b87 GP104 [P104-100] 1ba0 GP104M [GeForce GTX 1080 Mobile] @@ -13398,6 +13400,8 @@ 1170 Inventec Corporation 1171 Loughborough Sound Images Plc 1172 Altera Corporation + 00a7 Stratix V + 0530 Stratix IV 1173 Adobe Systems, Inc 1174 Bridgeport Machines 1175 Mitron Computer Inc. @@ -15569,6 +15573,9 @@ 5163 RealSSD P425m 5180 9100 PRO NVMe SSD 5181 9100 MAX NVMe SSD + 5190 9200 ECO NVMe SSD + 5191 9200 PRO NVMe SSD + 5192 9200 MAX NVMe SSD 1345 Arescom Inc 1347 Odetics 1349 Sumitomo Electric Industries, Ltd. @@ -17068,7 +17075,7 @@ 1028 1fc1 Express Flash NVMe PM1725 800GB SFF 1028 1fc2 Express Flash NVMe PM1725 1.6TB SFF 1028 1fc4 Express Flash NVMe PM1725 1.6TB AIC - a822 NVMe SSD Controller 172Xa + a822 NVMe SSD Controller 172Xa/172Xb 1014 0621 PCIe3 1.6TB NVMe Flash Adapter II x8 1014 0622 PCIe3 3.2TB NVMe Flash Adapter II x8 1014 0629 PCIe3 6.4TB NVMe Flash Adapter II x8 @@ -17079,6 +17086,14 @@ 1028 1fdd Express Flash PM1725a 1.6TB AIC 1028 1fde Express Flash PM1725a 3.2TB AIC 1028 1fdf Express Flash PM1725a 6.4TB AIC + 1028 1ff3 Express Flash PM1725b 1.6TB SFF + 1028 1ff4 Express Flash PM1725b 3.2TB SFF + 1028 1ff5 Express Flash PM1725b 6.4TB SFF + 1028 1ff6 Express Flash PM1725b 12.8TB SFF + 1028 1ff7 Express Flash PM1725b 1.6TB AIC + 1028 1ff8 Express Flash PM1725b 3.2TB AIC + 1028 1ff9 Express Flash PM1725b 6.4TB AIC + 1028 1ffa Express Flash PM1725b 12.8TB AIC 144e OLITEC 144f Askey Computer Corp. 1450 Octave Communications Ind. @@ -19921,6 +19936,7 @@ 1914 VirtexUS ASIC Emulation Board [DNVUF2A] 1915 Arria10 PCIe MainRef Design [DNPCIe_80G_A10_LL] 1916 VirtexUS PCIe Accelerator Board [DNVUF2_HPC_PCIe] + 1917 UltrascalePlus PCIe Accelerator Board [DNPCIe_400G_VU_LL] 1a00 Virtex6 PCIe DMA Netlist Design 1a01 Virtex6 PCIe Darklite Design [DNPCIe_HXT_10G_LL] 1a02 Virtex7 PCIe DMA Netlist Design @@ -19931,6 +19947,7 @@ 1a08 KintexUS PCIe Darklite Design [DNPCIe_40G_KU_LL_QSFP] 1a09 Arria10 PCIe Darklite Design [DNPCIe_80G_A10_LL] 1a0a VirtexUS PCIe Darklite Design [DNVUF2_HPC_PCIe] + 1a0b UltrascalePlus PCIe Darklite Design [DNPCIe_400G_VU_LL] 17e4 Sectra AB 0001 KK671 Cardbus encryption board 0002 KK672 Cardbus encryption board @@ -20786,7 +20803,7 @@ 2010 PCI-Express EVR # PC-260-101-03 2020 PGP-GEN3 PCIe - 2030 data_dev + 2030 AXI Stream DAQ PCIe card 1a51 Hectronic AB 1a55 Rohde & Schwarz DVS GmbH 0010 SDStationOEM @@ -20946,6 +20963,7 @@ 1849 1080 Motherboard 1142 ASM1042A USB 3.0 Host Controller 1242 ASM1142 USB 3.1 Host Controller + 1343 ASM1143 USB 3.1 Host Controller 1b2c Opal-RT Technologies Inc. 1b36 Red Hat, Inc. 0001 QEMU PCI-PCI bridge @@ -21031,8 +21049,8 @@ # 2xHDMI and 2xHD-SDI inputs e5f4 MPEG2 and H264 Encoder-Transcoder f1c4 Dual ASI-RX/TX-CI card -1b66 Deltacast - 0007 Delta-3G-elp-11 SDI I/O Board +1b66 DELTACAST + 0007 DELTA-3G-elp-d 1b6f Etron Technology, Inc. 7023 EJ168 USB 3.0 Host Controller 7052 EJ188/EJ198 USB 3.0 Host Controller @@ -23919,6 +23937,7 @@ 1563 Ethernet Controller 10G X550T 1028 1fa8 Ethernet 10G 4P X550/I350 rNDC 1028 1fa9 Ethernet 10G 4P X550 rNDC + 1170 0001 Intel Ethernet Controller X550-T2 OCP card 14c0 1201 X550 10Gb 2P RJ45 OCP Mezz 1590 00d1 Ethernet 10Gb 2-port 562T Adapter 1590 00d2 Ethernet 10Gb 2-port 562FLR-T Adapter @@ -29137,6 +29156,7 @@ a2ed 200 Series PCH PCI Express Root Port #23 a2ee 200 Series PCH PCI Express Root Port #24 a2f0 200 Series PCH HD Audio + a370 Wireless-AC 9560 [Jefferson Peak] a620 6400/6402 Advanced Memory Buffer (AMB) abc0 Omni-Path Fabric Switch Silicon 100 Series b152 21152 PCI-to-PCI Bridge From owner-svn-src-head@freebsd.org Sun Mar 25 17:00:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9984F59116 for ; Sun, 25 Mar 2018 17:00:19 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E42A6DBE0 for ; Sun, 25 Mar 2018 17:00:18 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: d67c3236-304d-11e8-b951-f99fef315fd9 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id d67c3236-304d-11e8-b951-f99fef315fd9; Sun, 25 Mar 2018 16:59:10 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w2PH0GoE055165; Sun, 25 Mar 2018 11:00:16 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1521997216.49673.2.camel@freebsd.org> Subject: Re: svn commit: r331532 - head/sys/crypto/ccp From: Ian Lepore To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 25 Mar 2018 11:00:16 -0600 In-Reply-To: <201803251656.w2PGunC0061278@repo.freebsd.org> References: <201803251656.w2PGunC0061278@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 17:00:20 -0000 On Sun, 2018-03-25 at 16:56 +0000, Warner Losh wrote: > Author: imp > Date: Sun Mar 25 16:56:49 2018 > New Revision: 331532 > URL: https://svnweb.freebsd.org/changeset/base/331532 > > Log: > The PNP info has to follow the module definition. Move it from just > after the array to its proper location. Otherwise, the linker.hints > file has things out of order and we associated it with whatever was > the previous module. Wow, that seems like a subtle thing that'll be easy to get wrong and hard to detect when you have. Would it be possible for the PNP macro to have some kind of reference to the structures generated by the module definition macro, to force a compile-time error if they're out of order? -- Ian From owner-svn-src-head@freebsd.org Sun Mar 25 17:12:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AEB9F5A213; Sun, 25 Mar 2018 17:12:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 505B46E6B2; Sun, 25 Mar 2018 17:12:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4AD1B20E7F; Sun, 25 Mar 2018 17:12:10 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2PHCAKP071832; Sun, 25 Mar 2018 17:12:10 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2PHCAf7071831; Sun, 25 Mar 2018 17:12:10 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201803251712.w2PHCAf7071831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 25 Mar 2018 17:12:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331534 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 331534 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 17:12:10 -0000 Author: imp Date: Sun Mar 25 17:12:09 2018 New Revision: 331534 URL: https://svnweb.freebsd.org/changeset/base/331534 Log: Note that MODULE_PNP_INFO has to come after a DRIVER_MODULE. Modified: head/share/man/man9/MODULE_PNP_INFO.9 Modified: head/share/man/man9/MODULE_PNP_INFO.9 ============================================================================== --- head/share/man/man9/MODULE_PNP_INFO.9 Sun Mar 25 16:57:21 2018 (r331533) +++ head/share/man/man9/MODULE_PNP_INFO.9 Sun Mar 25 17:12:09 2018 (r331534) @@ -49,6 +49,9 @@ macro registers a .Fa table of device-identifying data for use by .Xr devmatch 8 . +Since it is built off module marking macros, it must follow a +.Xr DRIVER_MODULE 9 +line. .Pp The macro takes a .Fa descriptor_string @@ -164,6 +167,7 @@ static struct my_pciids { { 0x12345678, "Foo bar" }, { 0x9abcdef0, "Baz fizz" }, }; + MODULE_PNP_INFO("W32:vendor/device", pci, my_driver, my_ids, sizeof(my_ids[0]), nitems(my_ids)); .Ed @@ -176,7 +180,7 @@ MODULE_PNP_INFO("W32:vendor/device", pci, my_driver, m The macro .Nm appeared in -.Fx 12.0 . +.Fx 11.0 . .Sh AUTHORS The PNP framework and .Xr devmatch 8 From owner-svn-src-head@freebsd.org Sun Mar 25 17:19:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98374F5ACFC for ; Sun, 25 Mar 2018 17:19:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2DD926EB2F for ; Sun, 25 Mar 2018 17:19:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x233.google.com with SMTP id b20so20526438iof.5 for ; Sun, 25 Mar 2018 10:19:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=wIFHXIas1Gipb1YlJk9CY9ThSKSF8La4i7C1Y1OFtzs=; b=xL73cLpUIIivt3iqciw7fbV/LFZjREZqusZ+eT3frkPEU5N7TdMuV0raABEJy0fsLl uXsqN4UTTcocAjLn9rbLFLIUvmAKQjhA8uGBZNxVkj1LfxrcBOqmm4dHw4T+sWEihJu5 zMZUwL4EktQd47jWx8H7x6NZ2A3QGyYOZdmR8tEh9K4MVLYl+d/hH7Flv1Yz8pDn/tcE xuJlHLU0fcxw4czxSqj9jnsR/8d1jAi2/OdtEAqR+Y95jeY0yBofsQViCEZPGY7OyAWd wL/D8HG01OrhjbOJcs9Ib4OTWuqxnkXbBz7rbczP/xFOE4oFVGB+oTLatlq11djwPE6d yoLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=wIFHXIas1Gipb1YlJk9CY9ThSKSF8La4i7C1Y1OFtzs=; b=KqwRkDwlrr7S38BHUJ8AQzt1hAPvmGBJiNta1oetBNRQYkytvV7vKogzV56LxOqmYf q2vxn/iSMBajTBmY6brPTzHd5Hw5tuZ8e5R4+yEzjepc7Wcx2blj8ploUo6/iT5u9I1y 6D6mvxk8Vxg/OmYWQVE+wACye3CA363MkImvZ/wAV77xmGJHK1PeOWxr+Oesczw2vW6j ud5hCdlX1Ab65SHaFwdX8wPEBe+vwMMsVTDg0L0TIltCstgUnWUjqqK6UdoI3/RUrZ3b Lecz4MzYYV2vu04juwI+ydmIWMjIHwl0KGIenBKJjVgRb3dqaP10yLwJE9/Fhs8q8LfS +2hg== X-Gm-Message-State: AElRT7EUP9sUXzBmTckwLXuYiTCJqSVbJQDPaVm5b8KheobF/+lq/PS4 mV6C3QCNe2s4qZ+05RfF+BW+mxtKLiPV2NnpPCcb4g== X-Google-Smtp-Source: AG47ELsgPs5aVNoiVQNtN9Flia2chyknBnnYJHYUPULdZhRIldeGDtyiE5tcLuoDjT/fuHD+LWxPwWTIwz1w1y9wNzg= X-Received: by 10.107.58.134 with SMTP id h128mr36501893ioa.299.1521998384360; Sun, 25 Mar 2018 10:19:44 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Sun, 25 Mar 2018 10:19:43 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201803251646.w2PGkG3Z042004@pdx.rh.CN85.dnsmgr.net> References: <20180325163534.GB23474@britannica.bec.de> <201803251646.w2PGkG3Z042004@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 25 Mar 2018 11:19:43 -0600 X-Google-Sender-Auth: 2qujWIlKu-DzWiQA8nG1MGskKFg Message-ID: Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci To: "Rodney W. Grimes" Cc: Joerg Sonnenberger , Pedro Giffuni , Mark Peek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 17:19:45 -0000 On Sun, Mar 25, 2018 at 10:46 AM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > On Sun, Mar 25, 2018 at 09:03:20AM -0700, Rodney W. Grimes wrote: > > > Kirk would have to back me up on this, but my understanding of the > > > decisions that the UCB Regents legal staff came to was that each > > > file should have a complete copyright and license clause and any > > > thing less causes problems because of "seprability", and "alterability" > > > because of seperate files. > > > > Are you talking about a decision made before the USA joined the rest of > > the civilised world as signee of the Berne Convention? > > The copyright > > notice was certainly required at the time. A full license clause is > > nicer for "stealing" things, but certainly not required. > > With or without application of Berne Convention, without a license > you (us, FreeBSD project, foundation) have no rights to publish > (redistribute) the work, unless that copyright is a of the form > that it would "placed in the public domain" the work. > True. However, not relevant: we have a license here. The code tells us what it is. This is no different than commercial code that says something like "Copyright Sun, use governed by source license agreement" or Copyright Digital... Reference "/usr/src/COPYRIGHT" for applicable restrictions." or similar things that have been done. There's absolutely zero problem with indirection to a neutral third party that retains a copy of the license either. I reviewed the code before Mark committed it. The copyright notice and license SPDX entries were totally legit and completely sufficient. While other entries in the tree have both, so the SPDX is not controlling, in this case there's just the pointer and that's legally defensible. Until we get a qualified legal opinion to the contrary, we should just drop it. Warner From owner-svn-src-head@freebsd.org Sun Mar 25 17:24:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7095BF5B51C for ; Sun, 25 Mar 2018 17:24:44 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x234.google.com (mail-io0-x234.google.com [IPv6:2607:f8b0:4001:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E457D6F1EC for ; Sun, 25 Mar 2018 17:24:43 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x234.google.com with SMTP id l3so20525545iog.0 for ; Sun, 25 Mar 2018 10:24:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=NnkhenFs0qR55nb23IGFVy5PF2zKxc2yOB86fKsl/zU=; b=p4S8EFuZF/oRnxRj0zWVgcLuAkMq8MS1ep0Gov9o2q4HrM7STXip389Joie3nmugJb VRTExCfbyScsmMGgjJIl1AfMjheONSQ48gZDx3bjnU3+jNs+4NcPruis1gPC/eRKsqGI 6Bw+GWF2Jj2bVlsG5iwqVbP5TN89wY8o7RtpdVVWBD78o97rATgzyA0g343kN/cdtF9j h80ujWaWgCOJoMK0I/3fXaQJrF7CMyCuJTnayAAgklexSp8cEYxPC5nX56n/fTUduZuv jzAZXxLKeu0e36R8AnjJwABQf5aZ3q7SCKok5lMzjAGZsK5lEO9bIVh0nvk8ilABCwm+ GcBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=NnkhenFs0qR55nb23IGFVy5PF2zKxc2yOB86fKsl/zU=; b=IQxCUJuT/1r0Y0zQprwilpS+CjwE+EzPpYsIQQ6OhRdRtKFg3al418SbZ0eARzFJfP nGQACUinIlmovXKyMbFzJ9BC17HgGj1L+HszRdRft/mPyKqDSZinTpFnvxIwqUgh/hPF xx92cbkrpN8vIX4QjS/N1nyAmGFGkMwpPNrO5/dRN7dKVfkcYECzIlm1AaaHX9t2dtlt emjmOgq7WkUjkU4aLcYvZNwnuTEvtIANHLIsTj/1H+tUPUbHVisfuVoJgt0jm9knFflx 1EjQi8ukvQE8LgoPBn+32XKf6aTC2b1/+7jUW5K1fq+OID4uG6cqaC747movaTqPgM7Z B1Pg== X-Gm-Message-State: AElRT7Gt+BDp5L1UOBmxdc3CAP0cUuHHVUHqo6NSnEZJVPoSgXt053eU I+48d9gasxQx/mqlRsC6YU6f9Ke9WGxRZxzHVFU+mg== X-Google-Smtp-Source: AG47ELtc8LeM/3YeYkIor57ZYh5DYj/XBM06rZs55/GgpTvF8kNtt3mAJ2frtNs3L7Lt610ueg2z0QHQ7kfaHuW2B4w= X-Received: by 10.107.12.230 with SMTP id 99mr36316538iom.117.1521998683312; Sun, 25 Mar 2018 10:24:43 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Sun, 25 Mar 2018 10:24:42 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <201803251642.w2PGgkcx041969@pdx.rh.CN85.dnsmgr.net> References: <201803251642.w2PGgkcx041969@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Sun, 25 Mar 2018 11:24:42 -0600 X-Google-Sender-Auth: Dvm-917NdlAmTS-GN8iQjM6tkIk Message-ID: Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci To: "Rodney W. Grimes" Cc: Mark Peek , Pedro Giffuni , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 17:24:44 -0000 On Sun, Mar 25, 2018 at 10:42 AM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > Did VMWare provide the files with the dual license text in them? > Or did they provide files with SPDX tags in them? > Or ? > Does VMWare have these files published some place, with terms of > use and such? VMWare provided the files exactly as Mark committed them. They were provided by someone from VMware to our code review system. The SPDX stuff is fine. there's nothing to get upset out here: they are just as much a legal license as if the license had been included inline. It's widespread practice in the industry dating back to the 80's when DEC had an indirection notice in their Ultrix source code. In fact, you can find examples of that going back to the early 70's, though we were under a different copyright regime. Warner From owner-svn-src-head@freebsd.org Sun Mar 25 17:31:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 526CEF5BEBE for ; Sun, 25 Mar 2018 17:31:06 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8FB06F5D4 for ; Sun, 25 Mar 2018 17:31:05 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22e.google.com with SMTP id 19-v6so7991533itw.3 for ; Sun, 25 Mar 2018 10:31:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=0higJyM+KY3i8lfsdrQfPLobsEwQGk39B9yY6Sbv3pQ=; b=N1bLzgSjl7nS8T8yUZHmJwc+izM5HNFwbIcwkF7UFMkWoz8fNzu2BK5wa7x0Q7/Pow BfejXi4arirW6COMEdsSSNkm/iHldd6e+G+NJWmliggyaQR1gv/ltmGfkxf/TskGM6sS ph7QfdC7JAn633EFqC3TsjVobfk5AptslFn2KXKa3/dmescxy43r3/dzcn0mj9xkPBn4 7kNB4gGkaUEoNELa27ZCrQAACr1z4MEbLM0aKiCQwcx6zXqvYSUJYPSGWRDduM5LRwhM v/YjhGjbwPFC3nnEensiMZh4MVs1as8Np+hDxDywkmnu2g43qYyWkkKq+WyvPDVMK1yk LDEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=0higJyM+KY3i8lfsdrQfPLobsEwQGk39B9yY6Sbv3pQ=; b=qs6CIMwnCEaUxnJVufunWgSnjE6vYUlCuGLa9UTlSlpuU00426V6XByHDFDuedDx76 rssUHORDNybXVb5we2hDYRPUXUtRH7FHKDjVPWbsdFCG4Endd3HDjet7gzuNrxf8f4Wf usUaEqoa3jwRsV8XyYRLzwhezDl3K+3SHPAomvtUtv3khksaPnPhK+6Z3NEqx0L68uga P/kVoGfhsddw6S87uT6iJf3F4Tcmj3WnxzgcWRW8rE+aspo/0LJm9WlcA4cvNMggtD7g VuekIbtR4mGlEIqGopRKcBvcCAjqE/p3C+URrWvVJ1+hz1FidmfVplRtrVtJT9Tth/IB u1dw== X-Gm-Message-State: AElRT7EMGF2xRM+7zLHX4O24oo0Uj3TK82f109SHEIkIGH9QCCLvDjzy pqm9BO1sVr6Port2CJdWaCKTYcpC0v3QbBdIIsVD8w== X-Google-Smtp-Source: AIpwx49rXgMCxcsYYccoxAsAxMsLzve/LE4s1DmzGZjQvxgQUoaKiMA/a8tUrNlzoTU9rgl7UlgqXeNQdrT3ojdJwV4= X-Received: by 2002:a24:6f04:: with SMTP id x4-v6mr4558272itb.51.1521999065256; Sun, 25 Mar 2018 10:31:05 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Sun, 25 Mar 2018 10:31:04 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <1521997216.49673.2.camel@freebsd.org> References: <201803251656.w2PGunC0061278@repo.freebsd.org> <1521997216.49673.2.camel@freebsd.org> From: Warner Losh Date: Sun, 25 Mar 2018 11:31:04 -0600 X-Google-Sender-Auth: C7HulPBxgUBgxkOgBV0BXqCyymA Message-ID: Subject: Re: svn commit: r331532 - head/sys/crypto/ccp To: Ian Lepore Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 17:31:06 -0000 On Sun, Mar 25, 2018 at 11:00 AM, Ian Lepore wrote: > On Sun, 2018-03-25 at 16:56 +0000, Warner Losh wrote: > > Author: imp > > Date: Sun Mar 25 16:56:49 2018 > > New Revision: 331532 > > URL: https://svnweb.freebsd.org/changeset/base/331532 > > > > Log: > > The PNP info has to follow the module definition. Move it from just > > after the array to its proper location. Otherwise, the linker.hints > > file has things out of order and we associated it with whatever was > > the previous module. > > Wow, that seems like a subtle thing that'll be easy to get wrong and > hard to detect when you have. Would it be possible for the PNP macro > to have some kind of reference to the structures generated by the > module definition macro, to force a compile-time error if they're out > of order? > Yes. I'm working on the best way to enforce it. The easy way is in kldxref, but I'm pondering ways to do it at compile time. Warner From owner-svn-src-head@freebsd.org Sun Mar 25 17:42:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF6DDF5CF86 for ; Sun, 25 Mar 2018 17:42:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 398687002D for ; Sun, 25 Mar 2018 17:42:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22e.google.com with SMTP id m83so20542244ioi.8 for ; Sun, 25 Mar 2018 10:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=SRhWUf/GVdm4T+xjueHbq2fYLu5MOrpT/rP2MOyZmDc=; b=h1dG/tEoLJTblHU2p/KfP5tX5tjjYZYzzZywVrD9rYgoG4MWeaxnam4lX2eBBvtDUx ZYGUhpihA9wIC5WN2BpxtquJGMsqKDjGsh+OMdPl7WNFJSERhBBcQqVx0p8PBYrzqxAW jWNmSxN2oEm2vIkE3gG1kASw8S4REHsSw5A8ypkc9/e5GrL6r/8HAWO6g1D93OiHWkEK alcse/J0j9y12OEulIDg9Y4nw0EIrY2aofa2U3nYBHjAZ7wCkRDE5+TZzN86qoJhxp69 +CKU60OFXvv689FmRzRlZogDd19xXZ8YxcSDyJJonxCnXZQ5I0ZIcBOSZPGK/n2QvJd4 YKPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=SRhWUf/GVdm4T+xjueHbq2fYLu5MOrpT/rP2MOyZmDc=; b=NeDRF1Vo3uem3+qnb2PqQZ/H0wNx5aQaRLvHXa5PCZS3FQzfk+iMX06llIQCEYQMLT WOPRpB95V2AnrWhfa0RgI0h/d+tgtX7oQ77hQCDGVjMaL83D8+QkQ42TlUPVwSMmCw+3 OlgBuhY1AbQrw71XBw4lzPo4+z27Xmlt8a1Xqm6Pc10TmsI/XemFjIzbGxWsL75Dh9vS LOIDPWh4ulCDoLLJVRA3Nf3KrXO+gHssD3hTNQne3I+ywRTBAIXaSE7x2AVJh8U3NjnQ axNyjPmwvPF0//S0yb4+BUv7ivwyPsxWda7IfBgzq64SWwIfZzjrm6vh7XfDUo1FxTaa qgFw== X-Gm-Message-State: AElRT7HEiNlSLTuAaTP2CEdtrwjr1Fphwsa29bQqps0ymwMiBHo/RpQ4 Dr9FNlYPdDCaKb6WZ2XUVkqkGQsS1EF0OlLCO78shg== X-Google-Smtp-Source: AG47ELvRCganQ+Yj7wTknsRx/2+ZvwfUSoPLMk+jecjCxstPVsy798HQFQyz+cOzFlWm9HGRouFGoilVQ/0V7HbRptQ= X-Received: by 10.107.162.146 with SMTP id l140mr32542849ioe.39.1521999771543; Sun, 25 Mar 2018 10:42:51 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Sun, 25 Mar 2018 10:42:50 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20180325163534.GB23474@britannica.bec.de> References: <8dffed54-3319-d826-5ec1-fd80155a3921@FreeBSD.org> <201803251603.w2PG3KLQ041797@pdx.rh.CN85.dnsmgr.net> <20180325163534.GB23474@britannica.bec.de> From: Warner Losh Date: Sun, 25 Mar 2018 11:42:50 -0600 X-Google-Sender-Auth: LrdHTSOLowqxQldyfYyS3ph6sD0 Message-ID: Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci To: Joerg Sonnenberger Cc: "Rodney W. Grimes" , Pedro Giffuni , Mark Peek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 17:42:52 -0000 On Sun, Mar 25, 2018 at 10:35 AM, Joerg Sonnenberger wrote: > On Sun, Mar 25, 2018 at 09:03:20AM -0700, Rodney W. Grimes wrote: > > Kirk would have to back me up on this, but my understanding of the > > decisions that the UCB Regents legal staff came to was that each > > file should have a complete copyright and license clause and any > > thing less causes problems because of "seprability", and "alterability" > > because of seperate files. > > Are you talking about a decision made before the USA joined the rest of > the civilised world as signee of the Berne Convention? The copyright > notice was certainly required at the time. A full license clause is > nicer for "stealing" things, but certainly not required. > BSD 2.11 has an indirection notice: * Copyright (c) 1986 Regents of the University of California. * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. for example. 4.1 and 4.2 didn't have license notices added. 4.3 had something similar to BSD 2.11's notices. NET/2 is where they were added inline, and is the first place I can find additions to the license that talk about 'this software was contributed by XXX under contract to YYYY' and variations of the BSD license appear. 4.4 take this to a new level. So this isn't the Berne Convention thing, but rather a conscious decision at Berkeley to do something different, I think because they were starting to get / include software that wasn't under the exact BSD license, but some variant or something different that was compatible with it, so they needed to mark each file. However, the SPDX accomplishes that task in a format that properly separates out the copyright notice from the licensing notice. So I see nothing fundamentally wrong with this approach, and requiring copies of a license that buys us nothing just creates friction for external contributors that make them less willing to contribute without buying us any additional benefit. Warner From owner-svn-src-head@freebsd.org Sun Mar 25 17:44:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17ACBF5D244 for ; Sun, 25 Mar 2018 17:44:40 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic303-17.consmr.mail.bf2.yahoo.com (sonic303-17.consmr.mail.bf2.yahoo.com [74.6.131.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEC087023A for ; Sun, 25 Mar 2018 17:44:39 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1521999879; bh=Xatf63oPMOQtxJrubAJzxRNGY6LYcJn7ck/vyzBqaYI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=XZ29d/RQGDw/ZN0hqVStDC28oHKYXWWRWS8f6pO4jfTLvBXgj7eFOWiTxjznUlLYo36qmT9aE4h1vD3cD5V127AEVd0jCWyhSoda7VB1hkilwZ6I16XGJKnJaeVEZlI68jMMIqR56iKjQpcRk++RIYfmYaiWia+VrAIo8E2E0AqgJbVubnN4Lz9e7IWeBcj5BIhnyo8mEXP9eBc4bERCkHefPKWJVPtGiGIO3/80Hido2qaNjJKE1wBCO72MKQAP6UZv+EyZWii2XXTia2pbVXVVWCpBbdDUVv0rvypZWOu05WZVJu7UZ5rlirLEBSWQ9WBOebXIbQrsiTC4IGrzEg== X-YMail-OSG: _gSw5MEVM1kQ7yI64FBVsLiWFUcNiKDJHZtlLBQ_Z9FN0.M9N0eR0gfiBkx9PUm NHA9s7uano3ts9fpgDcCQied0mDAVkiXTJJEZfs3tC790JTDFxK4s2.bwTFVK6f.aujkRRZ9mOf9 ysHiu4r2RE58NqigMOYZ8b1BewjFat6hXUE4RIc.uit3YmdxJ.bTZLtdHlKRVhA20qgy1XWyjw_G XY146P5fZEVHMZrwlqL6dFpaTGyPfYS6du3ZPcWxURC53lOGMeiT8rbyrvTHJb_3K8BJvgY_uF_9 gq2ydq6_mUulehWD4Vfdnl09oR4Br0me8PCJmUHgUK5qB8TR_OEjoD9aLg2Q.oRlHNz1KXPMGhbv LvRKepjWDW1pZ_3mThvKV5L0N9qmJIK2aXyq_AfyhkVEZaJ_BbWvaX8Iu5WGtmuYKsjz2eoOfu1o geD7NxFgcbfAAQ0MdizhOE3jU2AbXTPrMVK1DmwnqrUuuuJ7lfb3lDBavnuT6AHvnMoT4e5dAzDa UDNf.XJLmKg-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.bf2.yahoo.com with HTTP; Sun, 25 Mar 2018 17:44:39 +0000 Received: from 181.52.72.201 (EHLO [192.168.0.5]) ([181.52.72.201]) by smtp418.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID b8bd6c2cb4c8fc06ea5f9493f5a94354; Sun, 25 Mar 2018 17:34:30 +0000 (UTC) Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci To: rgrimes@freebsd.org Cc: Mark Peek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803251603.w2PG3KLQ041797@pdx.rh.CN85.dnsmgr.net> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <3abca0b5-8820-b937-d468-1021e3b7bbe6@FreeBSD.org> Date: Sun, 25 Mar 2018 12:34:28 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <201803251603.w2PG3KLQ041797@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 17:44:40 -0000 On 25/03/2018 11:03, Rodney W. Grimes wrote: >> >> On 25/03/2018 06:49, Rodney W. Grimes wrote: >>>> On Sat, Mar 24, 2018 at 6:27 PM, Rodney W. Grimes < >>>> freebsd@pdx.rh.cn85.dnsmgr.net> wrote: >>>> >>>>>> Author: mp >>>>>> Date: Sun Mar 25 00:57:00 2018 >>>>>> New Revision: 331510 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/331510 >>>>> These files do not each contain a usable copyright, though >>>>> they seem to contain SPDX tags that indiate they should contain >>>>> a BSD 2 clause copyright. >>>> IANAL but I believe you meant "...they should contain a BSD 2 clause >>>> *license*". The files should contain a valid copyright. >>> A valid, but unusable. As the copyright is it is a full copyright >>> held by vmware without any rights to be published or redistributed >>> any any manner by anyone but vmware. >>> >>> "Copyright (c) 2018 VMware, Inc. All Rights Reserved." >>> >>> That is a restrictive copyright, allowing no one to publish, or >>> in our case, redistribute, without a further license of some form. >>> >>>> The intent of my commit and the author were to use the implied SPDX version >>>> of the licenses without burdening the source code with the more heavyweight >>>> license text. Having seen SPDX in the src tree, I believed >>>> the SPDX-License-Identifier was sufficient. But, to your point, I'm not >>>> sure I have seen a discussion or a decision on it. >>> SPDX tags are purely to be treated as "advisory" and in no one imply >>> or create any license agreement. >> As happens in economics, different lawyers can have different >> interpretations. Our practices were consulted with the SPDX guys but >> other projects have different practices. >> >> While the sound practice, especially when you don't own the code, is to >> add the SPDX tag in addition to the license text, the linux developers >> are encouraging replacing it altogether with the SPDX tag. In their case >> they keep a reference to the complete license text elsewhere and they >> have some repository log where the copyright owner did the change. > They have grown use to this from the way the GPL is handled, since > the length of the body of that license would be impractical to > include. > >> For contrib code we just follow upstream. In no case can anyone other >> than the copyright owner clarify, or otherwise change, a license. > That does bring a question of why this code is not either on > a vendor import branch, or in contrib? > > Can you point to any files in /usr/src that lack a full and complete > standalone license? Sans perhaps some GPL code that has a pointer > to COPYING and files that can not such as Makefile and .mk's. There are some. Here is an outstanding example: usr.sbin/bhyve/bhyvegc.c FWIW, the one time I did a change I added a copyright disclaimer to the commit log  to avoid future issues: https://svnweb.freebsd.org/base?view=revision&revision=318788 Cheers, Pedro. From owner-svn-src-head@freebsd.org Sun Mar 25 18:59:11 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 066F9F63F00; Sun, 25 Mar 2018 18:59:11 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 97CAE74037; Sun, 25 Mar 2018 18:59:10 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id CB86D2600A0; Sun, 25 Mar 2018 20:59:08 +0200 (CEST) Subject: Re: svn commit: r331447 - head/sys/dev/mlx5/mlx5_core To: cem@freebsd.org, Jeff Roberson Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803231811.w2NIB6o8051699@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <706716f4-18d0-7857-a502-0ecd44e27316@selasky.org> Date: Sun, 25 Mar 2018 20:59:03 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 18:59:11 -0000 On 03/25/18 18:10, Conrad Meyer wrote: > It seems it slipped back in via r331445 after I had removed it in r330714. > That might be. When this round of mlx5 patching is done I'll pull in all upstream changes. --HPS From owner-svn-src-head@freebsd.org Sun Mar 25 19:09:09 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4A8BF64C7F; Sun, 25 Mar 2018 19:09:09 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x234.google.com (mail-oi0-x234.google.com [IPv6:2607:f8b0:4003:c06::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55DD874656; Sun, 25 Mar 2018 19:09:09 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x234.google.com with SMTP id 71-v6so14300486oie.12; Sun, 25 Mar 2018 12:09:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=YLMGgb2Jr4HuDrqKyPt21mRbistSpbJ+GbAc4/0jqys=; b=ERM16rm9NZaiE2q0KCvAg/j6h3W26MmFURs8TAeO6deaNWXpGirwvpP8tW9GiQD+Tj s3K1dWbzCN5H+xyYSvtGQQhb2tSuljVPk80GV8VNWxYabD9y+9MgYjwBrW3I4HzfRolE iYLalGlqTnShMen3Lbdmo8qDmYIN6ydQZ8cW5G4fpDVIwsJ/A8Rl1GQtqUUNdOcp24Kx aJHzPeiCE5iOkIfdKFRYzrPUqOrax7Ipw0ij11doFuI+PQoc93PKaDjtwlA5se8rhXTA 9hmSGnqtP373XL9hJywtkHurr2eYZnDj/Zx2NwARjzML4MgJrhRROKbAyb+oFB229O03 0FWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=YLMGgb2Jr4HuDrqKyPt21mRbistSpbJ+GbAc4/0jqys=; b=JcWYSiH7kkusdfZlcX67qj9QVhAMnyW/634i0W7k7/8qI8TcpUV5fKBRr5EkD3vCnq o+0WteJWYdG93EcrPaW/0W7eAath8XwPzRcACuvkHcjSbvEg7SXra1yDcQ6zoQ2gyqAB rQ3TxcTZdQ650FjezelF71x4o7Nc7ljPm5aiGdZef3RJlQYP6pm7zaLfa8wteyOUgy8B YnlwEeE62lza95HyOpE8gZBthFSximbqs92OxEE4/2o7bcDOuQF022wwqGs8kWxg3u6A S8+TVH52gwVS7m/cNI+AqeNdQgr6+9Nle2PIuysTkpLH342rYC/rGHbw67+RwqSMAxCO DuVQ== X-Gm-Message-State: AElRT7GCp1JftyXV4datbFMoeeMPp6IUzOW1mrQpu1ueRH/2eIf8q4qE 4IY4Gui0CvPRBQ4AvMiiH1LVGBKKHqrkXmQLJyIiFQ== X-Google-Smtp-Source: AIpwx489hgR3qUivrwwz+FRBTufI9BrPNwGbDaPdpCjJCp8hdghvxgiv8zhPIm/Ye3ygPUpSwiL46XQIMpFuiF1FTWg= X-Received: by 10.202.69.213 with SMTP id s204mr5985670oia.77.1522004948327; Sun, 25 Mar 2018 12:09:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:34b1:0:0:0:0:0 with HTTP; Sun, 25 Mar 2018 12:09:07 -0700 (PDT) In-Reply-To: <3abca0b5-8820-b937-d468-1021e3b7bbe6@FreeBSD.org> References: <201803251603.w2PG3KLQ041797@pdx.rh.CN85.dnsmgr.net> <3abca0b5-8820-b937-d468-1021e3b7bbe6@FreeBSD.org> From: Benjamin Kaduk Date: Sun, 25 Mar 2018 14:09:07 -0500 Message-ID: Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci To: Pedro Giffuni Cc: rgrimes@freebsd.org, Mark Peek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 19:09:10 -0000 I am surprised that no one has yet quoted the commit message from r325966 when the first SPDX tags appear to have been added to base: We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. (There was also some internal discussion around the same time, which I of course cannot quote here.) -Ben From owner-svn-src-head@freebsd.org Sun Mar 25 19:50:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADDF3F67EDC for ; Sun, 25 Mar 2018 19:50:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22e.google.com (mail-it0-x22e.google.com [IPv6:2607:f8b0:4001:c0b::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B1CC75C48 for ; Sun, 25 Mar 2018 19:50:19 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22e.google.com with SMTP id m134-v6so3458925itb.3 for ; Sun, 25 Mar 2018 12:50:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=vScgvWwwCnjJQcDhiRGrQrnKXlY+mt5wTbw4RkS+QFw=; b=Jaz58mEvCgSq2CS9kDnRVzuEN0ohdxnXeEv9rvGAaag+30NDb8SL63BMM4L+QyuTCD /0zJ2PRQBvQopNHfNPxwpxl5hu7NVWz8XMfEDc3DlRipDyfJxVIO9b1tBxkVH7P76Gx9 6yI8ltNkdWuU+f82glyH67ocVefd1NOx4nSJHBQGfmgn9b+SFM9q+3OsBoVCuC3K+c1j tXPiDNvweHjV2RbO89Wop75yBtjxJz+8s8YF+nx8GO6SOqqxL7Hc+9vJ7qzVy8wGD9Zg 5SviYhGs8MRNkI1UAWTkobxSqZKAclB4hReKKBcpQ51EIGjTIeHnsN5Usx+dusfprEay rEJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=vScgvWwwCnjJQcDhiRGrQrnKXlY+mt5wTbw4RkS+QFw=; b=nG5agSAyCBG9Y/w4rfGJUoLzuZWR3zQGTEvMRdax2+kqkznXU5YdDSebIZl2oFC0Cz UXT2NBN0rHi/CRwkvbK6KrKN66JTJu4tvsaTuXNtMN7az4LrwwURoRDVoA/pO+11lWn9 45u+H2R2Cc0W0bb+w7Xb4CgfibHno9yv47XlN3cpoy1yCqQbf6kRsZ5ZObYWeS9k96FV 5w3lPpxwjd3mlTQuDalrV0WiDcUJftySq8vnnJz7FAbQLhY4VZsKnXW03HtMSX6wYVW5 jHwQ94ZW4rsonptQBHqSHVs/25vGLmQl0Kyi/sq3Z5ctw8UFYecBj/Jm2n3X53+0vUNT vR8w== X-Gm-Message-State: AElRT7Ff204uW0TUUxaectiWL2H3/ykVd4yloW6YMKWb3vB+MFLix0Ka TeoF9c0/fmBHRNHjhtBaywqPOYKv+WN6QaxjurkgBQ== X-Google-Smtp-Source: AIpwx4+wuy1MT+YM1D7nBlL4gaMMk3aKfFP0j/br6imoaAr94wW8eMB6fT+2GmONwApoivMLg+ZbhOerhT7svoh1M/I= X-Received: by 2002:a24:19c9:: with SMTP id b192-v6mr5327791itb.1.1522007418477; Sun, 25 Mar 2018 12:50:18 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.203.196 with HTTP; Sun, 25 Mar 2018 12:50:17 -0700 (PDT) X-Originating-IP: [2607:fb90:6c82:b467:8188:b02:331c:4031] Received: by 10.79.203.196 with HTTP; Sun, 25 Mar 2018 12:50:17 -0700 (PDT) In-Reply-To: References: <201803251603.w2PG3KLQ041797@pdx.rh.CN85.dnsmgr.net> <3abca0b5-8820-b937-d468-1021e3b7bbe6@FreeBSD.org> From: Warner Losh Date: Sun, 25 Mar 2018 13:50:17 -0600 X-Google-Sender-Auth: 0N-r_ZlO4GcYTDd7AQRtiQAbFFY Message-ID: Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci To: Benjamin Kaduk Cc: Pedro Giffuni , "Rodney W. Grimes" , Mark Peek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 19:50:19 -0000 On Mar 25, 2018 1:09 PM, "Benjamin Kaduk" wrote: I am surprised that no one has yet quoted the commit message from r325966 when the first SPDX tags appear to have been added to base: We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. (There was also some internal discussion around the same time, which I of course cannot quote here.) Right. For cases where both are present, the text controls. But when it's just there alone, there is no ambiguity. It would certainly help with the slightly different wording issue if we did this more often. I may do it to all my code in the tree. I'm careful about this stuff, and i have at least three variations in the tree for no good reason... Warner From owner-svn-src-head@freebsd.org Sun Mar 25 20:12:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D4F3F6950A; Sun, 25 Mar 2018 20:12:15 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C2E87767B0; Sun, 25 Mar 2018 20:12:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BDCBF22D32; Sun, 25 Mar 2018 20:12:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2PKCECX062125; Sun, 25 Mar 2018 20:12:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2PKCEJY062124; Sun, 25 Mar 2018 20:12:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201803252012.w2PKCEJY062124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 25 Mar 2018 20:12:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331536 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 331536 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 20:12:15 -0000 Author: markj Date: Sun Mar 25 20:12:14 2018 New Revision: 331536 URL: https://svnweb.freebsd.org/changeset/base/331536 Log: Use LIST_FOREACH_SAFE in sleepq_chains_remove_matching(). We may remove a sleepqueue from the hash table in sleepq_resume_thread(). Reviewed by: kib MFC after: 3 days Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D14847 Modified: head/sys/kern/subr_sleepqueue.c Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Sun Mar 25 18:10:00 2018 (r331535) +++ head/sys/kern/subr_sleepqueue.c Sun Mar 25 20:12:14 2018 (r331536) @@ -1103,7 +1103,7 @@ void sleepq_chains_remove_matching(bool (*matches)(struct thread *)) { struct sleepqueue_chain *sc; - struct sleepqueue *sq; + struct sleepqueue *sq, *sq1; int i, wakeup_swapper; wakeup_swapper = 0; @@ -1112,7 +1112,7 @@ sleepq_chains_remove_matching(bool (*matches)(struct t continue; } mtx_lock_spin(&sc->sc_lock); - LIST_FOREACH(sq, &sc->sc_queues, sq_hash) { + LIST_FOREACH_SAFE(sq, &sc->sc_queues, sq_hash, sq1) { for (i = 0; i < NR_SLEEPQS; ++i) { wakeup_swapper |= sleepq_remove_matching(sq, i, matches, 0); From owner-svn-src-head@freebsd.org Sun Mar 25 20:21:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 155A8F6A12D; Sun, 25 Mar 2018 20:21:07 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E8D176CD5; Sun, 25 Mar 2018 20:21:05 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w2PKL4Bt043592; Sun, 25 Mar 2018 13:21:04 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w2PKL4X4043591; Sun, 25 Mar 2018 13:21:04 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803252021.w2PKL4X4043591@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci In-Reply-To: To: Warner Losh Date: Sun, 25 Mar 2018 13:21:04 -0700 (PDT) CC: "Rodney W. Grimes" , Mark Peek , Pedro Giffuni , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 20:21:07 -0000 > On Sun, Mar 25, 2018 at 10:42 AM, Rodney W. Grimes < > freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > > > Did VMWare provide the files with the dual license text in them? > > Or did they provide files with SPDX tags in them? > > Or ? > > Does VMWare have these files published some place, with terms of > > use and such? > > > VMWare provided the files exactly as Mark committed them. They were > provided by someone from VMware to our code review system. Without a license to redistributed clearly included some place? > > The SPDX stuff is fine. there's nothing to get upset out here: they are > just as much a legal license as if the license had been included inline. I disagree, especially when I have repeatedly been told "SPDX" is purely advisory by the person who commited them to the tree. > It's widespread practice in the industry dating back to the 80's when DEC > had an indirection notice in their Ultrix source code. In fact, you can > find examples of that going back to the early 70's, though we were under a > different copyright regime. Those "references" to an external license involved a license that was usually executed as a signed document. You could not get the files until you had executed the signed license, and that license in no way allowed you rights to redistribute. Those are big differences in what we have here. You appear to be willing to make an arbitrary depature from what has been, and currently is, the standard form of the FreeBSD source tree. I disagree with your assesment of the situation. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Mar 25 21:00:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F789F6CD12 for ; Sun, 25 Mar 2018 21:00:57 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AED3C78235 for ; Sun, 25 Mar 2018 21:00:56 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id EC19620CCD; Sun, 25 Mar 2018 17:00:55 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Sun, 25 Mar 2018 17:00:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=8iRqqo d4ut5yMtKrDsas7CBuvNs7ZlNGMONVTwZOsYE=; b=SgUGybk5iGV+xotyDutYcq 01JE2pSEVS5LFDoElcfaMGB7Io0VMQfsrRpzNP6Al2OHsLP6XaAXjRJx6RLJy95V eSlPkzJNb1wxW/PW5P7a0cmOQ5ymapMVqKt7qqPNAxKKFUVJKmkHpOZ5Uc4bqOaB VqjdLY41Rcpr9FUfsR4prI31+uPMJk9UGxbCqBsj+YZ8IBlIc7q/zRRHd0nTjN+B 1zf5uVmp+qub+u/utmU8edMvvo2Zsudibpkvg+X6jr0AjtION1V0Jy4O+Q/6zpc5 7RWiz4nL/XAGO9vPa8PVlyoceeLauZnIMOIQ/Q7zK3wNez4slqwOC4hUBE0MIbjg == X-ME-Sender: Received: from benno-mac.jeamland.net (c-71-231-121-16.hsd1.wa.comcast.net [71.231.121.16]) by mail.messagingengine.com (Postfix) with ESMTPA id 6F51D240DB; Sun, 25 Mar 2018 17:00:55 -0400 (EDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Subject: Re: svn commit: r331463 - in head: release/amd64 usr.sbin/makefs/cd9660 From: Benno Rice In-Reply-To: <1521968045.2210546.1315137584.4D202E01@webmail.messagingengine.com> Date: Sun, 25 Mar 2018 14:00:53 -0700 Cc: svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201803232056.w2NKuJr5037840@repo.freebsd.org> <1521968045.2210546.1315137584.4D202E01@webmail.messagingengine.com> To: Dave Cottlehuber X-Mailer: Apple Mail (2.3445.5.20) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 21:00:57 -0000 > On Mar 25, 2018, at 1:54 AM, Dave Cottlehuber = wrote: >=20 > On Fri, 23 Mar 2018, at 21:56, Benno Rice wrote: [commit message snipped] > Hi Benno, >=20 > This breaks `make -DNOPORTS -s memstick ftp cdrom` for me. Rolling = back to r331462 is the last working commit. >=20 > This is the failure I see: >=20 > 819200 bytes transferred in 0.007027 secs (116577317 bytes/sec) > newfs_msdos: cannot get number of sectors per track: Operation not = supported > newfs_msdos: cannot get number of heads: Operation not supported > /dev/md0: 1557 sectors in 1557 FAT12 clusters (512 bytes/cluster) > BytesPerSec=3D512 SecPerClust=3D1 ResSectors=3D1 FATs=3D2 = RootDirEnts=3D512 Sectors=3D1600 Media=3D0xf8 FATsecs=3D5 SecPerTrack=3D63= Heads=3D1 HiddenSecs=3D0 > makefs: boot disk system must be i386, powerpc, macppc, or mac68k > Usage: makefs [-xZ] [-B endian] [-b free-blocks] [-d debug-mask] > [-F mtree-specfile] [-f free-files] [-M minimum-size] [-m = maximum-size] > [-N userdb-dir] [-O offset] [-o fs-options] [-R roundup-size] > [-S sector-size] [-s image-size] [-T ] [-t = fs-type] > image-file directory | manifest [extra-directory ...] [snip] Hi Dave, You'll need to install makefs from the new tree before running make = release. I=E2=80=99ll put a note in UPDATING to that effect. It should be as simple as: $ cd $SRCDIR/usr.sbin/makefs $ make depend all install Sorry for the confusion. Thanks, Benno.= From owner-svn-src-head@freebsd.org Sun Mar 25 21:01:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BD20F6CE15; Sun, 25 Mar 2018 21:01:23 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B37478367; Sun, 25 Mar 2018 21:01:22 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w2PL1Itv043801; Sun, 25 Mar 2018 14:01:18 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w2PL1HpJ043800; Sun, 25 Mar 2018 14:01:17 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201803252101.w2PL1HpJ043800@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci In-Reply-To: To: Warner Losh Date: Sun, 25 Mar 2018 14:01:17 -0700 (PDT) CC: Benjamin Kaduk , Pedro Giffuni , "Rodney W. Grimes" , Mark Peek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 21:01:23 -0000 [ Charset UTF-8 unsupported, converting... ] > On Mar 25, 2018 1:09 PM, "Benjamin Kaduk" wrote: > > I am surprised that no one has yet quoted the commit message from r325966 > when the first SPDX tags appear to have been added to base: > > We are gradually adopting the specification, noting > that the tags are considered only advisory and do not, in any way, > superceed or replace the license texts. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Here a SPDX tag is being used to stand in place, ie replace, the license text. > (There was also some internal discussion around the same time, which I of > course cannot quote here.) > > > > Right. For cases where both are present, the text controls. But when it's > just there alone, there is no ambiguity. There is ambiguity, as your replacing the license text with a tag in direct conflict with the documented status of SPDX tags. That is a HUGE ambiguity. Your also creating a small handful of files that seem to be in conflict with the projects standard MO for 25 years. Now, if you want to take this change to @developers as a proposal, and actually get legal advice on the aspects of this, I am all ears, but please do not just go making decisions that are contray to current practice without that. > It would certainly help with the slightly different wording issue if we did > this more often. I may do it to all my code in the tree. I'm careful about > this stuff, and i have at least three variations in the tree for no good > reason... > > Warner -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Mar 25 21:08:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99B6BF6D7BD; Sun, 25 Mar 2018 21:08:00 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 474CB78875; Sun, 25 Mar 2018 21:08:00 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 424CB2356B; Sun, 25 Mar 2018 21:08:00 +0000 (UTC) (envelope-from benno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2PL808W092862; Sun, 25 Mar 2018 21:08:00 GMT (envelope-from benno@FreeBSD.org) Received: (from benno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2PL80G4092861; Sun, 25 Mar 2018 21:08:00 GMT (envelope-from benno@FreeBSD.org) Message-Id: <201803252108.w2PL80G4092861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: benno set sender to benno@FreeBSD.org using -f From: Benno Rice Date: Sun, 25 Mar 2018 21:08:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331537 - head X-SVN-Group: head X-SVN-Commit-Author: benno X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 331537 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 21:08:00 -0000 Author: benno Date: Sun Mar 25 21:07:59 2018 New Revision: 331537 URL: https://svnweb.freebsd.org/changeset/base/331537 Log: Add an entry dealing with the makefs ISO9660 EFI tagging changes. If you're building -CURRENT releases and it fails when building ISO images on amd64 you'll need to update makefs. Reported by: dch Sponsored by: iXsystems, Inc. Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Sun Mar 25 20:12:14 2018 (r331536) +++ head/UPDATING Sun Mar 25 21:07:59 2018 (r331537) @@ -51,6 +51,17 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW: ****************************** SPECIAL WARNING: ****************************** +20180323: + makefs was modified to be able to tag ISO9660 El Torito boot catalog + entries as EFI instead of overloading the i386 tag as done previously. + The amd64 mkisoimages.sh script used to build amd64 ISO images for + release was updated to use this. This may mean that makefs must be + updated before "make cdrom" can be run in the release directory. This + should be as simple as: + + $ cd $SRCDIR/usr.sbin/makefs + $ make depend all install + 20180212: FreeBSD boot loader enhanced with Lua scripting. It's purely opt-in for now by building WITH_LOADER_LUA and WITHOUT_FORTH in /etc/src.conf. From owner-svn-src-head@freebsd.org Sun Mar 25 22:03:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80C6FF43FB8 for ; Sun, 25 Mar 2018 22:03:44 +0000 (UTC) (envelope-from mark@peek.org) Received: from mail-yw0-f174.google.com (mail-yw0-f174.google.com [209.85.161.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EBB27C23D for ; Sun, 25 Mar 2018 22:03:43 +0000 (UTC) (envelope-from mark@peek.org) Received: by mail-yw0-f174.google.com with SMTP id i187so306504ywd.10 for ; Sun, 25 Mar 2018 15:03:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zkuxXbd5UB5mzCZrHS/mZ68jjIEaTPHS+VexKfx6Zko=; b=NpRPlKpquyEC8hEl7PngLtWAfUEPl1nL5Ju+uZEYIcPPwEpe3DMx2y2DX0V6Bl6GVn hkWiahKm1rPEjExGYkqzfY9LRLpeljFKQxbHtOHya5wjyWvVCIE2dlxT+HxYPpobzlaI qwn4GJFmktFbA+YAjxKv5koDzHGCkGdC+bdXFfOmGMLxM9Y1oa/a+HMezJ+3DJxDy3F0 LdaWkVZvNYCJaV7GEirEXCgdjm96Rs0mt8wx2g+jB23D3kSYRfr2wTKfZsLggwN+R4bj QY3kvXNQMU4MfhVWJjqJD8BMDgORCEaf2lMYynHiaO97k6PPBwB3SZCAQwTtrxsPhB// tpEA== X-Gm-Message-State: AElRT7FHZyLCD8G5h/ChfSC1vadqvUTFQEqT8t8/fy6brG2MZuPHbFSi iNqb5PyPD9WZrydIfkXbKb7glqp4/i8ydA== X-Google-Smtp-Source: AG47ELvj3uLV+qGUhytd0s2VGIIU6V7eJjr+asi7VxXmEWMkI+ZfN8hQh3M7qbGLx7Yymze0ji074Q== X-Received: by 10.129.87.75 with SMTP id l72mr22431934ywb.216.1522015423041; Sun, 25 Mar 2018 15:03:43 -0700 (PDT) Received: from mail-yw0-f179.google.com (mail-yw0-f179.google.com. [209.85.161.179]) by smtp.gmail.com with ESMTPSA id q11sm5439225ywc.106.2018.03.25.15.03.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Mar 2018 15:03:42 -0700 (PDT) Received: by mail-yw0-f179.google.com with SMTP id y64so5576521ywa.3 for ; Sun, 25 Mar 2018 15:03:42 -0700 (PDT) X-Received: by 10.129.146.195 with SMTP id j186mr22517523ywg.294.1522015422181; Sun, 25 Mar 2018 15:03:42 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:4206:0:0:0:0:0 with HTTP; Sun, 25 Mar 2018 15:03:41 -0700 (PDT) X-Originating-IP: [2601:646:c700:35ed:2193:d6c4:780d:4bcb] In-Reply-To: <201803252101.w2PL1HpJ043800@pdx.rh.CN85.dnsmgr.net> References: <201803252101.w2PL1HpJ043800@pdx.rh.CN85.dnsmgr.net> From: Mark Peek Date: Sun, 25 Mar 2018 15:03:41 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r331510 - in head: share/man/man4 sys/conf sys/dev/vmware/vmci sys/modules/vmware sys/modules/vmware/vmci To: rgrimes@freebsd.org Cc: Warner Losh , Benjamin Kaduk , Pedro Giffuni , Mark Peek , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 22:03:44 -0000 On Sun, Mar 25, 2018 at 2:01 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > On Mar 25, 2018 1:09 PM, "Benjamin Kaduk" wrote: > > > > I am surprised that no one has yet quoted the commit message from r325966 > > when the first SPDX tags appear to have been added to base: > > > > We are gradually adopting the specification, noting > > that the tags are considered only advisory and do not, in any way, > > superceed or replace the license texts. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > Here a SPDX tag is being used to stand in place, ie replace, the > license text. > > > (There was also some internal discussion around the same time, which I of > > course cannot quote here.) > > > > > > > > Right. For cases where both are present, the text controls. But when it's > > just there alone, there is no ambiguity. > > There is ambiguity, as your replacing the license text with a tag in > direct conflict with the documented status of SPDX tags. > That is a HUGE ambiguity. > > Your also creating a small handful of files that seem to be in conflict > with the projects standard MO for 25 years. > > Now, if you want to take this change to @developers as a proposal, and > actually get legal advice on the aspects of this, I am all ears, but please > do not just go making decisions that are contray to current practice > without that. As this may require a legal opinion and clarification I have asked on core@ rather than further discussion here or on the developers list. Mark From owner-svn-src-head@freebsd.org Sun Mar 25 23:23:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D1A8F518AF; Sun, 25 Mar 2018 23:23:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D78E7F06D; Sun, 25 Mar 2018 23:23:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3867624C0E; Sun, 25 Mar 2018 23:23:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2PNNKHn075023; Sun, 25 Mar 2018 23:23:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2PNNK5f075022; Sun, 25 Mar 2018 23:23:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201803252323.w2PNNK5f075022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 25 Mar 2018 23:23:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331538 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 331538 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2018 23:23:20 -0000 Author: markj Date: Sun Mar 25 23:23:19 2018 New Revision: 331538 URL: https://svnweb.freebsd.org/changeset/base/331538 Log: Clamp IFLIB_RX_COPY_THRESH to MHLEN in iflib_rxd_pkt_get(). If one has added fields to struct mbuf such that MHLEN is smaller than this threshold (128), iflib_rxd_pkt_get() may otherwise overrun the internal mbuf buffer while copying. Reviewed by: mmacy MFC after: 3 days Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D14843 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Sun Mar 25 21:07:59 2018 (r331537) +++ head/sys/net/iflib.c Sun Mar 25 23:23:19 2018 (r331538) @@ -2450,7 +2450,7 @@ iflib_rxd_pkt_get(iflib_rxq_t rxq, if_rxd_info_t ri) /* should I merge this back in now that the two paths are basically duplicated? */ if (ri->iri_nfrags == 1 && - ri->iri_frags[0].irf_len <= IFLIB_RX_COPY_THRESH) { + ri->iri_frags[0].irf_len <= MIN(IFLIB_RX_COPY_THRESH, MHLEN)) { rxd_frag_to_sd(rxq, &ri->iri_frags[0], FALSE, &sd); m = *sd.ifsd_m; *sd.ifsd_m = NULL; From owner-svn-src-head@freebsd.org Mon Mar 26 09:36:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3003EF57E84; Mon, 26 Mar 2018 09:36:23 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D38DE74726; Mon, 26 Mar 2018 09:36:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C64A42EEE; Mon, 26 Mar 2018 09:36:22 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2Q9aMuN082759; Mon, 26 Mar 2018 09:36:22 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2Q9aMfD082758; Mon, 26 Mar 2018 09:36:22 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201803260936.w2Q9aMfD082758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 26 Mar 2018 09:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331546 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 331546 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 09:36:23 -0000 Author: kp Date: Mon Mar 26 09:36:22 2018 New Revision: 331546 URL: https://svnweb.freebsd.org/changeset/base/331546 Log: pf: reload and resync do the same thing The reload and resync commands for the startup script do exactly the same thing, so implement one as a call to the other. MFC after: 3 weeks Modified: head/etc/rc.d/pf Modified: head/etc/rc.d/pf ============================================================================== --- head/etc/rc.d/pf Mon Mar 26 09:07:16 2018 (r331545) +++ head/etc/rc.d/pf Mon Mar 26 09:36:22 2018 (r331546) @@ -53,12 +53,12 @@ pf_check() pf_reload() { echo "Reloading pf rules." - $pf_program -n -f "$pf_rules" $pf_flags || return 1 - $pf_program -f "$pf_rules" $pf_flags + pf_resync } pf_resync() { + $pf_program -n -f "$pf_rules" $pf_flags || return 1 $pf_program -f "$pf_rules" $pf_flags } From owner-svn-src-head@freebsd.org Mon Mar 26 13:45:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 846DDF6E667; Mon, 26 Mar 2018 13:45:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34E4E7EC37; Mon, 26 Mar 2018 13:45:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B8465B43; Mon, 26 Mar 2018 13:45:18 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QDjI6f011792; Mon, 26 Mar 2018 13:45:18 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QDjIJc011791; Mon, 26 Mar 2018 13:45:18 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803261345.w2QDjIJc011791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Mar 2018 13:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331547 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 331547 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 13:45:18 -0000 Author: kevans Date: Mon Mar 26 13:45:17 2018 New Revision: 331547 URL: https://svnweb.freebsd.org/changeset/base/331547 Log: loader efifb: implement uga_autoresize as a call to text_autoresize UGA does not have the same kind of mode enumeration that GOP does. Implement it instead as a call to text_autoresize so that firmwares with only UGA present still get some kind of autoresizing behavior. While here, rename a typo'd "gop" to "uga", although it will remain unused for the time being. Modified: head/stand/efi/loader/framebuffer.c Modified: head/stand/efi/loader/framebuffer.c ============================================================================== --- head/stand/efi/loader/framebuffer.c Mon Mar 26 09:36:22 2018 (r331546) +++ head/stand/efi/loader/framebuffer.c Mon Mar 26 13:45:17 2018 (r331547) @@ -611,10 +611,10 @@ text_autoresize() } static int -uga_autoresize(EFI_UGA_DRAW_PROTOCOL *gop) +uga_autoresize(EFI_UGA_DRAW_PROTOCOL *uga) { - return (CMD_OK); + return (text_autoresize()); } COMMAND_SET(efi_autoresize, "efi-autoresizecons", "EFI Auto-resize Console", command_autoresize); From owner-svn-src-head@freebsd.org Mon Mar 26 14:03:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5527DF6FCC2; Mon, 26 Mar 2018 14:03:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 05BAF7F88A; Mon, 26 Mar 2018 14:03:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 005B65E5F; Mon, 26 Mar 2018 14:03:40 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QE3dLP021286; Mon, 26 Mar 2018 14:03:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QE3dA9021285; Mon, 26 Mar 2018 14:03:39 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803261403.w2QE3dA9021285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Mar 2018 14:03:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331548 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 331548 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 14:03:40 -0000 Author: kevans Date: Mon Mar 26 14:03:39 2018 New Revision: 331548 URL: https://svnweb.freebsd.org/changeset/base/331548 Log: aw_sid(4): Release resources and destroy mutex on failure Submitted by: Eugene Sevastyanov Modified: head/sys/arm/allwinner/aw_sid.c Modified: head/sys/arm/allwinner/aw_sid.c ============================================================================== --- head/sys/arm/allwinner/aw_sid.c Mon Mar 26 13:45:17 2018 (r331547) +++ head/sys/arm/allwinner/aw_sid.c Mon Mar 26 14:03:39 2018 (r331548) @@ -207,7 +207,7 @@ aw_sid_attach(device_t dev) for (i = 0; i < sc->sid_conf->efuse_size; i += 4) if (aw_sid_prctl_read(dev, i, &val) != 0) { device_printf(dev, "failed prctl read\n"); - return (ENXIO); + goto fail; } SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), @@ -217,6 +217,11 @@ aw_sid_attach(device_t dev) dev, AW_SID_ROOT_KEY, aw_sid_sysctl, "A", "Root Key"); return (0); + +fail: + bus_release_resources(dev, aw_sid_spec, &sc->res); + mtx_destroy(&sc->prctl_mtx); + return (ENXIO); } int From owner-svn-src-head@freebsd.org Mon Mar 26 16:31:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF690F53259; Mon, 26 Mar 2018 16:31:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A1F02858F8; Mon, 26 Mar 2018 16:31:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CCC7768C; Mon, 26 Mar 2018 16:31:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QGVCia092787; Mon, 26 Mar 2018 16:31:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QGVCll092785; Mon, 26 Mar 2018 16:31:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201803261631.w2QGVCll092785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 26 Mar 2018 16:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331557 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 331557 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 16:31:13 -0000 Author: kib Date: Mon Mar 26 16:31:12 2018 New Revision: 331557 URL: https://svnweb.freebsd.org/changeset/base/331557 Log: Allow to specify for vm_fault_quick_hold_pages() that nofault mode should be honored. We must not sleep or acquire any MI VM locks if TDP_NOFAULTING is specified. On the other hand, there were some callers in the tree which set TDP_NOFAULTING for larger scope than needed, I fixed the code which I wrote, but I suspect that linuxkpi and out of tree drm drivers might abuse this still. So only enable the mode for vm_fault_quick_hold_pages() where vm_fault_hold() is not called when specifically asked by user. I decided to use vm_prot_t flag to not change KPI. Since number of flags in vm_prot_t is limited, I reused the same flag which was already consumed for vm_map_lookup(). Reported and tested by: pho (as part of the larger patch) Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D14825 Modified: head/sys/vm/vm.h head/sys/vm/vm_fault.c Modified: head/sys/vm/vm.h ============================================================================== --- head/sys/vm/vm.h Mon Mar 26 16:06:04 2018 (r331556) +++ head/sys/vm/vm.h Mon Mar 26 16:31:12 2018 (r331557) @@ -80,7 +80,9 @@ typedef u_char vm_prot_t; /* protection codes */ #define VM_PROT_WRITE ((vm_prot_t) 0x02) #define VM_PROT_EXECUTE ((vm_prot_t) 0x04) #define VM_PROT_COPY ((vm_prot_t) 0x08) /* copy-on-read */ -#define VM_PROT_FAULT_LOOKUP ((vm_prot_t) 0x010) +#define VM_PROT_PRIV_FLAG ((vm_prot_t) 0x10) +#define VM_PROT_FAULT_LOOKUP VM_PROT_PRIV_FLAG +#define VM_PROT_QUICK_NOFAULT VM_PROT_PRIV_FLAG /* same to save bits */ #define VM_PROT_ALL (VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE) #define VM_PROT_RW (VM_PROT_READ|VM_PROT_WRITE) Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Mon Mar 26 16:06:04 2018 (r331556) +++ head/sys/vm/vm_fault.c Mon Mar 26 16:31:12 2018 (r331557) @@ -1524,7 +1524,18 @@ vm_fault_quick_hold_pages(vm_map_t map, vm_offset_t ad * page was mapped at the specified virtual address or that * mapping had insufficient permissions. Attempt to fault in * and hold these pages. + * + * If vm_fault_disable_pagefaults() was called, + * i.e., TDP_NOFAULTING is set, we must not sleep nor + * acquire MD VM locks, which means we must not call + * vm_fault_hold(). Some (out of tree) callers mark + * too wide a code area with vm_fault_disable_pagefaults() + * already, use the VM_PROT_QUICK_NOFAULT flag to request + * the proper behaviour explicitly. */ + if ((prot & VM_PROT_QUICK_NOFAULT) != 0 && + (curthread->td_pflags & TDP_NOFAULTING) != 0) + goto error; for (mp = ma, va = addr; va < end; mp++, va += PAGE_SIZE) if (*mp == NULL && vm_fault_hold(map, va, prot, VM_FAULT_NORMAL, mp) != KERN_SUCCESS) From owner-svn-src-head@freebsd.org Mon Mar 26 18:20:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45067F5DB0E; Mon, 26 Mar 2018 18:20:30 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: from mail-qk0-x22d.google.com (mail-qk0-x22d.google.com [IPv6:2607:f8b0:400d:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D18356B0E9; Mon, 26 Mar 2018 18:20:29 +0000 (UTC) (envelope-from garga.bsd@gmail.com) Received: by mail-qk0-x22d.google.com with SMTP id 132so21151496qkd.5; Mon, 26 Mar 2018 11:20:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=itMTfGC4NLlNespFtRbVT+SgTHSAT++oST6b97AUV/Q=; b=crjIySOHfAN8e8mItVAoteWdSfK3B5tWfccQSUokClk8d/EBxxHOIU/r9EKLU3lXk4 urSWDKlVBtOnaXBMBn2h6Hbjv/4xznCXSHDhCpWPsniYe9RSh1nY0DEqtPlfOILQGtZV bKRTaAjfBC7mXfc/UKE3oDlIr0n0DapyszIhnmT1qIC8dE1oazYUNjtM86okMaOb68t5 pzhgvwYhxlzcdxIzU7hdcHhzhxfAa12yUZHJN1q7xcewOQbzKBtv+28M4me7uE12ndpc uvV/Och+XzNVCXr8csm0WR7hRY7Rf6msghnByKBlIdcHETcpVjC8Xkhf/TDXT6bpNsEe hstA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=itMTfGC4NLlNespFtRbVT+SgTHSAT++oST6b97AUV/Q=; b=UoO/N+xgyccYzgy1Dz77bMGw99AfgOOlnrJW6UN8+Vn3jZ6tnIp9R9siks1Id+L2ZJ tUzeD4/jV0JtHwANlRKcg6iWWA2mSMAjFBqloDGB9PnWMzcxqzrbEegaPaaG5luRPtIl qKYg15u8Dw6z6S2z2d8Lr99LDTdvWFUfSY3fc68vnHBvtaUT1l+g468Q/ULzxy0qcho6 mpI/gpr+ixfh3ELxYvIg0SuFrdl6eQT3+clay6TaAENJOVSxQpxaPLIpRmB+5i+S+vFx QHG6AdiY56KI4DFehwq8IljLkzk5tvwNQnvEh1Q9HcO9jsjYQvd5wmeIzHUi+guHlxOA FMkw== X-Gm-Message-State: AElRT7GAQYcbpsBc7Q141+Wp7CqdCcrL9txmCjsi22ZVlmveBzILIhTB AHiGSz+dFXXGDwrxlwcZjJa8yTHx X-Google-Smtp-Source: AIpwx49MTPH59uBxfLYuueNUtP2wSS+8HsmwkIV3z5QKjqW0jkTPP1R33hzUkqVEa8PA++H9x3cjaw== X-Received: by 10.55.75.146 with SMTP id y140mr16142383qka.222.1522088429151; Mon, 26 Mar 2018 11:20:29 -0700 (PDT) Received: from mbp.home ([177.53.86.172]) by smtp.gmail.com with ESMTPSA id r125sm11922800qkd.46.2018.03.26.11.20.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Mar 2018 11:20:28 -0700 (PDT) Sender: Renato Botelho Subject: Re: svn commit: r331364 - head/release/tools To: Glen Barber , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201803221749.w2MHnRNR012755@repo.freebsd.org> From: Renato Botelho Message-ID: Date: Mon, 26 Mar 2018 15:20:25 -0300 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <201803221749.w2MHnRNR012755@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 18:20:30 -0000 On 22/03/18 14:49, Glen Barber wrote: > Author: gjb > Date: Thu Mar 22 17:49:27 2018 > New Revision: 331364 > URL: https://svnweb.freebsd.org/changeset/base/331364 > > Log: > Remove google_accounts_manager from VM_RC_LIST in the GCE configuration > file, no longer needed. > > PR: 221714 > MFC after: 3 days > Sponsored by: The FreeBSD Foundation > > Modified: > head/release/tools/gce.conf > > Modified: head/release/tools/gce.conf > ============================================================================== > --- head/release/tools/gce.conf Thu Mar 22 17:46:38 2018 (r331363) > +++ head/release/tools/gce.conf Thu Mar 22 17:49:27 2018 (r331364) > @@ -9,7 +9,7 @@ export VM_EXTRA_PACKAGES="firstboot-freebsd-update fir > sysutils/py-google-compute-engine" > > # Set to a list of third-party software to enable in rc.conf(5). > -export VM_RC_LIST="google_accounts_manager ntpd sshd firstboot_growfs \ > +export VM_RC_LIST="ntpd sshd firstboot_growfs \ > firstboot_pkgs firstboot_freebsd_update google_startup \ > google_accounts_daemon google_clock_skew_daemon > google_instance_setup google_ip_forwarding_daemon First 2 lines end up with '\' but following 2 lines don't. It would be nice to add just to keep it consistent IMO -- Renato Botelho From owner-svn-src-head@freebsd.org Mon Mar 26 18:24:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3DD3F5E05F; Mon, 26 Mar 2018 18:24:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A9CE6B632; Mon, 26 Mar 2018 18:24:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85829108C9; Mon, 26 Mar 2018 18:24:16 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QIOGWm054500; Mon, 26 Mar 2018 18:24:16 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QIOGFX054499; Mon, 26 Mar 2018 18:24:16 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201803261824.w2QIOGFX054499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 26 Mar 2018 18:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331559 - head/release/tools X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/tools X-SVN-Commit-Revision: 331559 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 18:24:17 -0000 Author: gjb Date: Mon Mar 26 18:24:16 2018 New Revision: 331559 URL: https://svnweb.freebsd.org/changeset/base/331559 Log: Escape trailing newlines in a long variable list for consistency. Submitted by: garga MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/release/tools/gce.conf Modified: head/release/tools/gce.conf ============================================================================== --- head/release/tools/gce.conf Mon Mar 26 18:23:16 2018 (r331558) +++ head/release/tools/gce.conf Mon Mar 26 18:24:16 2018 (r331559) @@ -11,8 +11,8 @@ export VM_EXTRA_PACKAGES="firstboot-freebsd-update fir # Set to a list of third-party software to enable in rc.conf(5). export VM_RC_LIST="ntpd sshd firstboot_growfs \ firstboot_pkgs firstboot_freebsd_update google_startup \ - google_accounts_daemon google_clock_skew_daemon - google_instance_setup google_ip_forwarding_daemon + google_accounts_daemon google_clock_skew_daemon \ + google_instance_setup google_ip_forwarding_daemon \ google_network_setup" vm_extra_install_base() { From owner-svn-src-head@freebsd.org Mon Mar 26 18:24:52 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D6B1F5E108; Mon, 26 Mar 2018 18:24:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 590F96B783; Mon, 26 Mar 2018 18:24:51 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id EAD47BF37; Mon, 26 Mar 2018 18:24:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Mon, 26 Mar 2018 18:24:49 +0000 From: Glen Barber To: Renato Botelho Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r331364 - head/release/tools Message-ID: <20180326182449.GG81123@FreeBSD.org> References: <201803221749.w2MHnRNR012755@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sLx0z+5FKKtIVDwd" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 18:24:52 -0000 --sLx0z+5FKKtIVDwd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 26, 2018 at 03:20:25PM -0300, Renato Botelho wrote: > On 22/03/18 14:49, Glen Barber wrote: > > Author: gjb > > Date: Thu Mar 22 17:49:27 2018 > > New Revision: 331364 > > URL: https://svnweb.freebsd.org/changeset/base/331364 > >=20 > > Log: > > Remove google_accounts_manager from VM_RC_LIST in the GCE configurati= on > > file, no longer needed. > > =20 > > PR: 221714 > > MFC after: 3 days > > Sponsored by: The FreeBSD Foundation > >=20 > > Modified: > > head/release/tools/gce.conf > >=20 > > Modified: head/release/tools/gce.conf > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/release/tools/gce.conf Thu Mar 22 17:46:38 2018 (r331363) > > +++ head/release/tools/gce.conf Thu Mar 22 17:49:27 2018 (r331364) > > @@ -9,7 +9,7 @@ export VM_EXTRA_PACKAGES=3D"firstboot-freebsd-update fir > > sysutils/py-google-compute-engine" > > =20 > > # Set to a list of third-party software to enable in rc.conf(5). > > -export VM_RC_LIST=3D"google_accounts_manager ntpd sshd firstboot_growf= s \ > > +export VM_RC_LIST=3D"ntpd sshd firstboot_growfs \ > > firstboot_pkgs firstboot_freebsd_update google_startup \ > > google_accounts_daemon google_clock_skew_daemon > > google_instance_setup google_ip_forwarding_daemon >=20 > First 2 lines end up with '\' but following 2 lines don't. It would be > nice to add just to keep it consistent IMO >=20 Agreed. Thanks for noticing. Fixed in r331559. Glen --sLx0z+5FKKtIVDwd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEjRJAPC5sqwhs9k2jAxRYpUeP4pMFAlq5OuwACgkQAxRYpUeP 4pMyfA//RdjWlz0zwtKTFikA8mDhKhxtRR6y8734dhijkLdBeNh1cwZVs9luURLc rfitlKK35YtyfVrwHplTjsp1sN3PCAIQEK3FFxj/g5/p0IqGhfhGk7SEMvzdi14J o3QBBgx5s3mePBXYINEXEmoV6h+tzxAl7nVHhYw8jBSZibEafzlypCPNMhJPKZ4c n2/3v7KpvTNkIcPJ6QZKd8/jMWGpnIQYyos72Wdal8I/wxqdF7bcOnB/3N7u3jwO Ebo1mwPMY21GkBFZEBIdMx3ENtekd2qGMhe6/QyhrPMZlvhGqNd+MnWH1QdYTwQp murD4ygYOF2utYnnakZ5EC7LkicgcJzhTitCyl1lO1Oes7YutPZQdLciC/8G3LIW 1YU4nkyyYR8hlVY+uKNLJY4QmPHe/M3Ma3HiU/NzYGC2H5QYzPOqW3Vm9gRSKu23 HKfBEO/Y4Qcn418Eye20DSiQBnlxo9PnWT1wM6yZKFJnLT6PCuJyMWygb18dQRil Jy2zHUU10PCNTSs+FbG4ihYPglledcKeHcG6u+C4aJ+no9P/bvg9mKqrKmXoDDFr DRoaP4XXRGxe/qEAjnPVuOLHo412UhZs6JCV9c7g01Ubq8O1TWJsFA6eJhEeN3Rm leqZCHEdOfScCkwtfLSwmMnpQ4mY4WtihuyX4h52lXNBF/R5p74= =BnKx -----END PGP SIGNATURE----- --sLx0z+5FKKtIVDwd-- From owner-svn-src-head@freebsd.org Mon Mar 26 18:36:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86F6BF5F046; Mon, 26 Mar 2018 18:36:18 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39DBD6C235; Mon, 26 Mar 2018 18:36:18 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25DB310AA1; Mon, 26 Mar 2018 18:36:18 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QIaHMw059755; Mon, 26 Mar 2018 18:36:17 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QIaHA3059754; Mon, 26 Mar 2018 18:36:17 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201803261836.w2QIaHA3059754@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Mon, 26 Mar 2018 18:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331561 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 331561 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 18:36:18 -0000 Author: jeff Date: Mon Mar 26 18:36:17 2018 New Revision: 331561 URL: https://svnweb.freebsd.org/changeset/base/331561 Log: Fix a bug introduced in r329612 that slowly invalidates all clean bufs. Reported by: bde Reviewed by: bde Sponsored by: Netflix, Dell/EMC Isilon Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Mon Mar 26 18:34:03 2018 (r331560) +++ head/sys/kern/vfs_bio.c Mon Mar 26 18:36:17 2018 (r331561) @@ -821,7 +821,8 @@ bufspace_daemon(void *arg) * which will inefficiently trade bufs with bqrelse * until we return to condition 2. */ - do { + while (bd->bd_bufspace > bd->bd_lobufspace || + bd->bd_freebuffers < bd->bd_hifreebuffers) { if (buf_recycle(bd, false) != 0) { if (bd_flushall(bd)) continue; @@ -842,9 +843,7 @@ bufspace_daemon(void *arg) BD_UNLOCK(bd); } maybe_yield(); - } while (bd->bd_bufspace > bd->bd_lobufspace || - bd->bd_freebuffers < bd->bd_hifreebuffers); - + } bufspace_daemon_wait(bd); } } From owner-svn-src-head@freebsd.org Mon Mar 26 18:39:40 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13454F5F414; Mon, 26 Mar 2018 18:39:40 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B95816C4B0; Mon, 26 Mar 2018 18:39:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B403B10ACF; Mon, 26 Mar 2018 18:39:39 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QIddQI059921; Mon, 26 Mar 2018 18:39:39 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QIdc6H059911; Mon, 26 Mar 2018 18:39:38 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201803261839.w2QIdc6H059911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Mon, 26 Mar 2018 18:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331562 - head/release/arm X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/release/arm X-SVN-Commit-Revision: 331562 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 18:39:40 -0000 Author: manu Date: Mon Mar 26 18:39:38 2018 New Revision: 331562 URL: https://svnweb.freebsd.org/changeset/base/331562 Log: release: arm: Copy boot.scr from ports Latest u-boot update need u-boot script to load and start ubldr. (See D14230 for more details) Copy this file for our arm release on the fat partition. Approved by: gjb Modified: head/release/arm/BANANAPI.conf head/release/arm/BEAGLEBONE.conf head/release/arm/CUBIEBOARD.conf head/release/arm/CUBIEBOARD2.conf head/release/arm/CUBOX-HUMMINGBOARD.conf head/release/arm/GUMSTIX.conf head/release/arm/PANDABOARD.conf head/release/arm/RPI-B.conf head/release/arm/RPI2.conf head/release/arm/WANDBOARD.conf Modified: head/release/arm/BANANAPI.conf ============================================================================== --- head/release/arm/BANANAPI.conf Mon Mar 26 18:36:17 2018 (r331561) +++ head/release/arm/BANANAPI.conf Mon Mar 26 18:39:38 2018 (r331562) @@ -25,6 +25,7 @@ arm_install_uboot() { of=/dev/${mddev} bs=1k seek=8 conv=sync chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} cp ${UBOOT_DIR}/boot.scr ${FATMOUNT}/boot.scr chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin Modified: head/release/arm/BEAGLEBONE.conf ============================================================================== --- head/release/arm/BEAGLEBONE.conf Mon Mar 26 18:36:17 2018 (r331561) +++ head/release/arm/BEAGLEBONE.conf Mon Mar 26 18:39:38 2018 (r331562) @@ -25,6 +25,7 @@ arm_install_uboot() { chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img + chroot ${CHROOTDIR} cp ${UBOOT_DIR}/boot.scr ${FATMOUNT}/boot.scr chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot Modified: head/release/arm/CUBIEBOARD.conf ============================================================================== --- head/release/arm/CUBIEBOARD.conf Mon Mar 26 18:36:17 2018 (r331561) +++ head/release/arm/CUBIEBOARD.conf Mon Mar 26 18:39:38 2018 (r331562) @@ -25,6 +25,7 @@ arm_install_uboot() { of=/dev/${mddev} bs=1k seek=8 conv=sync chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} cp ${UBOOT_DIR}/boot.scr ${FATMOUNT}/boot.scr chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin Modified: head/release/arm/CUBIEBOARD2.conf ============================================================================== --- head/release/arm/CUBIEBOARD2.conf Mon Mar 26 18:36:17 2018 (r331561) +++ head/release/arm/CUBIEBOARD2.conf Mon Mar 26 18:39:38 2018 (r331562) @@ -25,6 +25,7 @@ arm_install_uboot() { of=/dev/${mddev} bs=1k seek=8 conv=sync chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} cp ${UBOOT_DIR}/boot.scr ${FATMOUNT}/boot.scr chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin Modified: head/release/arm/CUBOX-HUMMINGBOARD.conf ============================================================================== --- head/release/arm/CUBOX-HUMMINGBOARD.conf Mon Mar 26 18:36:17 2018 (r331561) +++ head/release/arm/CUBOX-HUMMINGBOARD.conf Mon Mar 26 18:39:38 2018 (r331562) @@ -25,6 +25,7 @@ arm_install_uboot() { of=/dev/${mddev} bs=512 seek=2 conv=sync chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} cp ${UBOOT_DIR}/boot.scr ${FATMOUNT}/boot.scr chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin Modified: head/release/arm/GUMSTIX.conf ============================================================================== --- head/release/arm/GUMSTIX.conf Mon Mar 26 18:36:17 2018 (r331561) +++ head/release/arm/GUMSTIX.conf Mon Mar 26 18:39:38 2018 (r331562) @@ -24,6 +24,7 @@ arm_install_uboot() { chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img + chroot ${CHROOTDIR} cp ${UBOOT_DIR}/boot.scr ${FATMOUNT}/boot.scr chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot Modified: head/release/arm/PANDABOARD.conf ============================================================================== --- head/release/arm/PANDABOARD.conf Mon Mar 26 18:36:17 2018 (r331561) +++ head/release/arm/PANDABOARD.conf Mon Mar 26 18:39:38 2018 (r331562) @@ -25,6 +25,7 @@ arm_install_uboot() { chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/MLO ${FATMOUNT}/MLO chroot ${CHROOTDIR} cp -p ${UBOOT_DIR}/u-boot.img ${FATMOUNT}/u-boot.img + chroot ${CHROOTDIR} cp ${UBOOT_DIR}/boot.scr ${FATMOUNT}/boot.scr chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot Modified: head/release/arm/RPI-B.conf ============================================================================== --- head/release/arm/RPI-B.conf Mon Mar 26 18:36:17 2018 (r331561) +++ head/release/arm/RPI-B.conf Mon Mar 26 18:39:38 2018 (r331562) @@ -39,6 +39,7 @@ arm_install_uboot() { ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/dtb/rpi.dtb \ ${FATMOUNT}/rpi.dtb + chroot ${CHROOTDIR} cp ${UBOOT_DIR}/boot.scr ${FATMOUNT}/boot.scr chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} Modified: head/release/arm/RPI2.conf ============================================================================== --- head/release/arm/RPI2.conf Mon Mar 26 18:36:17 2018 (r331561) +++ head/release/arm/RPI2.conf Mon Mar 26 18:39:38 2018 (r331562) @@ -40,6 +40,7 @@ arm_install_uboot() { ${FATMOUNT}/ubldr.bin chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/dtb/rpi2.dtb \ ${FATMOUNT}/rpi2.dtb + chroot ${CHROOTDIR} cp ${UBOOT_DIR}/boot.scr ${FATMOUNT}/boot.scr chroot ${CHROOTDIR} touch ${UFSMOUNT}/firstboot sync umount_loop ${CHROOTDIR}/${FATMOUNT} Modified: head/release/arm/WANDBOARD.conf ============================================================================== --- head/release/arm/WANDBOARD.conf Mon Mar 26 18:36:17 2018 (r331561) +++ head/release/arm/WANDBOARD.conf Mon Mar 26 18:39:38 2018 (r331562) @@ -25,6 +25,7 @@ arm_install_uboot() { of=/dev/${mddev} bs=512 seek=2 conv=sync chroot ${CHROOTDIR} mkdir -p "${FATMOUNT}" "${UFSMOUNT}" chroot ${CHROOTDIR} mount_msdosfs /dev/${mddev}s1 ${FATMOUNT} + chroot ${CHROOTDIR} cp ${UBOOT_DIR}/boot.scr ${FATMOUNT}/boot.scr chroot ${CHROOTDIR} mount /dev/${mddev}s2a ${UFSMOUNT} chroot ${CHROOTDIR} cp -p ${UFSMOUNT}/boot/ubldr.bin \ ${FATMOUNT}/ubldr.bin From owner-svn-src-head@freebsd.org Mon Mar 26 19:01:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F78DF60FD2; Mon, 26 Mar 2018 19:01:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E7436D5E6; Mon, 26 Mar 2018 19:01:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1921710E39; Mon, 26 Mar 2018 19:01:23 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QJ1MM6074383; Mon, 26 Mar 2018 19:01:22 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QJ1MUj074381; Mon, 26 Mar 2018 19:01:22 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803261901.w2QJ1MUj074381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Mar 2018 19:01:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331563 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 331563 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 19:01:23 -0000 Author: kevans Date: Mon Mar 26 19:01:22 2018 New Revision: 331563 URL: https://svnweb.freebsd.org/changeset/base/331563 Log: lualoader: Implement try_include and use it for including the local module This provides a way to optionally include a module without having to wrap it in filesystem checks. try_include is a little more robust, using the lua search path instead of forcing us to explicitly consider all of the places we could want to include a module. Errors are still generally raised from trying to load the module, but ENOENT will not get raised unless we're doing a verbose load. This will also be used to split out logo/brand graphics into their own files so that we can safely scale up the number of graphics included without worrying about the extra memory consumption- opting to lazily load graphics instead. Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D14658 Modified: head/stand/lua/core.lua head/stand/lua/loader.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Mon Mar 26 18:39:38 2018 (r331562) +++ head/stand/lua/core.lua Mon Mar 26 19:01:22 2018 (r331563) @@ -41,6 +41,26 @@ local function composeLoaderCmd(cmd_name, argstr) return cmd_name end +-- Globals +-- try_include will return the loaded module on success, or nil on failure. +-- A message will also be printed on failure, with one exception: non-verbose +-- loading will suppress 'module not found' errors. +function try_include(module) + local status, ret = pcall(require, module) + -- ret is the module if we succeeded. + if status then + return ret + end + -- Otherwise, ret is just a message; filter out ENOENT unless we're + -- doing a verbose load. As a consequence, try_include prior to loading + -- configuration will not display 'module not found'. All other errors + -- in loading will be printed. + if config.verbose or ret:match("^module .+ not found") == nil then + print(ret) + end + return nil +end + -- Module exports -- Commonly appearing constants core.KEY_BACKSPACE = 8 Modified: head/stand/lua/loader.lua ============================================================================== --- head/stand/lua/loader.lua Mon Mar 26 18:39:38 2018 (r331562) +++ head/stand/lua/loader.lua Mon Mar 26 19:01:22 2018 (r331563) @@ -43,11 +43,7 @@ if not core.isMenuSkipped() then end local password = require("password") -local result = lfs.attributes("/boot/lua/local.lua") --- Effectively discard any errors; we'll just act if it succeeds. -if result ~= nil then - require("local") -end +try_include("local") config.load() if core.isUEFIBoot() then From owner-svn-src-head@freebsd.org Mon Mar 26 19:06:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C9F5F617D7; Mon, 26 Mar 2018 19:06:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2360C6DA99; Mon, 26 Mar 2018 19:06:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 172B710F9A; Mon, 26 Mar 2018 19:06:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QJ6P9M074786; Mon, 26 Mar 2018 19:06:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QJ6PSW074785; Mon, 26 Mar 2018 19:06:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803261906.w2QJ6PSW074785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Mar 2018 19:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331564 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 331564 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 19:06:26 -0000 Author: kevans Date: Mon Mar 26 19:06:25 2018 New Revision: 331564 URL: https://svnweb.freebsd.org/changeset/base/331564 Log: lualoader: Actually re-raise error in try_include It was previously only printed, but we do actually want to raise it as a full blown error so that things don't look OK when they've actually gone wrong. The second parameter to error, level, is set to 2 here so that the error message reflects the position of the try_include caller, rather than the try_include itself. Example: LUA ERROR: /boot/lua/loader.lua:46: /boot/lua/local.lua:1: attempt to call a nil value (global 'cxcint'). Modified: head/stand/lua/core.lua Modified: head/stand/lua/core.lua ============================================================================== --- head/stand/lua/core.lua Mon Mar 26 19:01:22 2018 (r331563) +++ head/stand/lua/core.lua Mon Mar 26 19:06:25 2018 (r331564) @@ -56,7 +56,7 @@ function try_include(module) -- configuration will not display 'module not found'. All other errors -- in loading will be printed. if config.verbose or ret:match("^module .+ not found") == nil then - print(ret) + error(ret, 2) end return nil end From owner-svn-src-head@freebsd.org Mon Mar 26 19:08:20 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FD5EF61AA2; Mon, 26 Mar 2018 19:08:20 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D18C66DCD7; Mon, 26 Mar 2018 19:08:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C81EF10F9B; Mon, 26 Mar 2018 19:08:19 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QJ8JLh074888; Mon, 26 Mar 2018 19:08:19 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QJ8Jni074887; Mon, 26 Mar 2018 19:08:19 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803261908.w2QJ8Jni074887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 26 Mar 2018 19:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331565 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 331565 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 19:08:20 -0000 Author: kevans Date: Mon Mar 26 19:08:19 2018 New Revision: 331565 URL: https://svnweb.freebsd.org/changeset/base/331565 Log: lua-lint: Hint that try_include is now an accepted global try_include was added in r331563. Modified: head/tools/boot/lua-lint.sh Modified: head/tools/boot/lua-lint.sh ============================================================================== --- head/tools/boot/lua-lint.sh Mon Mar 26 19:06:25 2018 (r331564) +++ head/tools/boot/lua-lint.sh Mon Mar 26 19:08:19 2018 (r331565) @@ -17,4 +17,4 @@ LUACHECK=$(which luacheck) cd $(make -V SRCTOP)/stand ${LUACHECK} . --globals loader --globals lfs --globals io.getchar \ --globals io.ischar --globals printc --globals cli_execute \ - --globals cli_execute_unparsed --std lua53 + --globals cli_execute_unparsed --globals try_include --std lua53 From owner-svn-src-head@freebsd.org Mon Mar 26 19:53:03 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 921FEF65C49; Mon, 26 Mar 2018 19:53:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41CFC70187; Mon, 26 Mar 2018 19:53:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23990117FF; Mon, 26 Mar 2018 19:53:03 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QJr3NE001083; Mon, 26 Mar 2018 19:53:03 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QJr2VB001080; Mon, 26 Mar 2018 19:53:02 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803261953.w2QJr2VB001080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 26 Mar 2018 19:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331566 - head/sys/dev/vmware/vmci X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/vmware/vmci X-SVN-Commit-Revision: 331566 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 19:53:03 -0000 Author: cem Date: Mon Mar 26 19:53:02 2018 New Revision: 331566 URL: https://svnweb.freebsd.org/changeset/base/331566 Log: vmci(4): Fix GCC build and rationalize vmci_kernel_defs.h To fix the GCC build, remove multiple redundant declarations of vmci_send_datagram() (the copy in vmci.h as well as the extern definition in vmci_queue_pair.c were wholly redundant). Also to fix the GCC build, include a non-empty format string in the vmci(4) definition of ASSERT(). It seems harmless either way, but adding the stringified invariant is easier than masking the warning. The other vmci_kernel_defs.h changes are cosmetic and simply match macros to existing definitions. Reported by: GCC 6.4.0 Sponsored by: Dell EMC Isilon Modified: head/sys/dev/vmware/vmci/vmci.h head/sys/dev/vmware/vmci/vmci_kernel_defs.h head/sys/dev/vmware/vmci/vmci_queue_pair.c Modified: head/sys/dev/vmware/vmci/vmci.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci.h Mon Mar 26 19:08:19 2018 (r331565) +++ head/sys/dev/vmware/vmci/vmci.h Mon Mar 26 19:53:02 2018 (r331566) @@ -73,7 +73,6 @@ struct vmci_softc { int vmci_dma_malloc(bus_size_t size, bus_size_t align, struct vmci_dma_alloc *dma); void vmci_dma_free(struct vmci_dma_alloc *); -int vmci_send_datagram(struct vmci_datagram *dg); int vmci_schedule_delayed_work_fn(vmci_work_fn *work_fn, void *data); #endif /* !_VMCI_H_ */ Modified: head/sys/dev/vmware/vmci/vmci_kernel_defs.h ============================================================================== --- head/sys/dev/vmware/vmci/vmci_kernel_defs.h Mon Mar 26 19:08:19 2018 (r331565) +++ head/sys/dev/vmware/vmci/vmci_kernel_defs.h Mon Mar 26 19:53:02 2018 (r331566) @@ -16,17 +16,17 @@ typedef uint32_t PPN; -#define ASSERT(cond) KASSERT(cond, ("")) +#define ASSERT(cond) KASSERT(cond, ("%s", #cond)) #define ASSERT_ON_COMPILE(e) _Static_assert(e, #e); -#define LIKELY(_exp) __builtin_expect(!!(_exp), 1) -#define UNLIKELY(_exp) __builtin_expect((_exp), 0) +#define LIKELY(_exp) __predict_true(_exp) +#define UNLIKELY(_exp) __predict_false(_exp) -#define CONST64U(c) c##uL +#define CONST64U(c) UINT64_C(c) -#define ARRAYSIZE(a) (sizeof(a) / sizeof(*(a))) +#define ARRAYSIZE(a) nitems(a) -#define ROUNDUP(x, y) (((x) + (y) - 1) / (y) * (y)) -#define CEILING(x, y) (((x) + (y) - 1) / (y)) +#define ROUNDUP(x, y) roundup(x, y) +#define CEILING(x, y) howmany(x, y) #endif /* !_VMCI_KERNEL_DEFS_H_ */ Modified: head/sys/dev/vmware/vmci/vmci_queue_pair.c ============================================================================== --- head/sys/dev/vmware/vmci/vmci_queue_pair.c Mon Mar 26 19:08:19 2018 (r331565) +++ head/sys/dev/vmware/vmci/vmci_queue_pair.c Mon Mar 26 19:53:02 2018 (r331566) @@ -74,8 +74,6 @@ static int vmci_queue_pair_alloc_guest_work(struct vmc static int vmci_queue_pair_detach_guest_work(struct vmci_handle handle); static int vmci_queue_pair_detach_hypercall(struct vmci_handle handle); -extern int vmci_send_datagram(struct vmci_datagram *); - /* *------------------------------------------------------------------------------ * From owner-svn-src-head@freebsd.org Mon Mar 26 19:53:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E781F65D21; Mon, 26 Mar 2018 19:53:37 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B91B2702E5; Mon, 26 Mar 2018 19:53:36 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3DA911800; Mon, 26 Mar 2018 19:53:36 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QJraSg001148; Mon, 26 Mar 2018 19:53:36 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QJraXx001144; Mon, 26 Mar 2018 19:53:36 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201803261953.w2QJraXx001144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Mon, 26 Mar 2018 19:53:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331567 - head/sys/netinet/cc X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/netinet/cc X-SVN-Commit-Revision: 331567 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 19:53:37 -0000 Author: sbruno Date: Mon Mar 26 19:53:36 2018 New Revision: 331567 URL: https://svnweb.freebsd.org/changeset/base/331567 Log: CC Cubic: fix underflow for cubic_cwnd() Singed calculations in cubic_cwnd() can result in negative cwnd value which is then cast to an unsigned value. Values less than 1 mss are generally bad for other parts of the code, also fixed. Submitted by: Jason Eggleston Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D14141 Modified: head/sys/netinet/cc/cc.h head/sys/netinet/cc/cc_cubic.c head/sys/netinet/cc/cc_cubic.h Modified: head/sys/netinet/cc/cc.h ============================================================================== --- head/sys/netinet/cc/cc.h Mon Mar 26 19:53:02 2018 (r331566) +++ head/sys/netinet/cc/cc.h Mon Mar 26 19:53:36 2018 (r331567) @@ -102,6 +102,8 @@ struct cc_var { #define CCF_ACKNOW 0x0008 /* Will this ack be sent now? */ #define CCF_IPHDR_CE 0x0010 /* Does this packet set CE bit? */ #define CCF_TCPHDR_CWR 0x0020 /* Does this packet set CWR bit? */ +#define CCF_MAX_CWND 0x0040 /* Have we reached maximum cwnd? */ +#define CCF_CHG_MAX_CWND 0x0080 /* Cubic max_cwnd changed, for K */ /* ACK types passed to the ack_received() hook. */ #define CC_ACK 0x0001 /* Regular in sequence ACK. */ Modified: head/sys/netinet/cc/cc_cubic.c ============================================================================== --- head/sys/netinet/cc/cc_cubic.c Mon Mar 26 19:53:02 2018 (r331566) +++ head/sys/netinet/cc/cc_cubic.c Mon Mar 26 19:53:36 2018 (r331567) @@ -88,6 +88,8 @@ struct cubic { unsigned long max_cwnd; /* cwnd at the previous congestion event. */ unsigned long prev_max_cwnd; + /* Cached value for t_maxseg when K was computed */ + uint32_t k_maxseg; /* Number of congestion events. */ uint32_t num_cong_events; /* Minimum observed rtt in ticks. */ @@ -124,6 +126,9 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) cubic_data = ccv->cc_data; cubic_record_rtt(ccv); + if (ccv->flags & CCF_MAX_CWND) + return; + /* * Regular ACK and we're not in cong/fast recovery and we're cwnd * limited and we're either not doing ABC or are slow starting or are @@ -151,6 +156,12 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) cubic_data->mean_rtt_ticks, cubic_data->max_cwnd, CCV(ccv, t_maxseg)); + if (ccv->flags & CCF_CHG_MAX_CWND || cubic_data->k_maxseg != CCV(ccv, t_maxseg)) { + cubic_data->K = cubic_k(cubic_data->max_cwnd / CCV(ccv, t_maxseg)); + cubic_data->k_maxseg = CCV(ccv, t_maxseg); + ccv->flags &= ~(CCF_MAX_CWND|CCF_CHG_MAX_CWND); + } + w_cubic_next = cubic_cwnd(ticks_since_cong + cubic_data->mean_rtt_ticks, cubic_data->max_cwnd, CCV(ccv, t_maxseg), cubic_data->K); @@ -162,13 +173,18 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) * TCP-friendly region, follow tf * cwnd growth. */ - CCV(ccv, snd_cwnd) = w_tf; + CCV(ccv, snd_cwnd) = ulmin(w_tf, TCP_MAXWIN << CCV(ccv, snd_scale)); else if (CCV(ccv, snd_cwnd) < w_cubic_next) { /* * Concave or convex region, follow CUBIC * cwnd growth. */ + if (w_cubic_next >= TCP_MAXWIN << CCV(ccv, snd_scale)) { + w_cubic_next = TCP_MAXWIN << CCV(ccv, snd_scale); + ccv->flags |= CCF_MAX_CWND; + } + w_cubic_next = ulmin(w_cubic_next, TCP_MAXWIN << CCV(ccv, snd_scale)); if (V_tcp_do_rfc3465) CCV(ccv, snd_cwnd) = w_cubic_next; else @@ -186,8 +202,10 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) * max_cwnd. */ if (cubic_data->num_cong_events == 0 && - cubic_data->max_cwnd < CCV(ccv, snd_cwnd)) + cubic_data->max_cwnd < CCV(ccv, snd_cwnd)) { cubic_data->max_cwnd = CCV(ccv, snd_cwnd); + ccv->flags |= CCF_CHG_MAX_CWND; + } } } } @@ -238,6 +256,7 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) cubic_data->num_cong_events++; cubic_data->prev_max_cwnd = cubic_data->max_cwnd; cubic_data->max_cwnd = CCV(ccv, snd_cwnd); + ccv->flags |= CCF_CHG_MAX_CWND; } ENTER_RECOVERY(CCV(ccv, t_flags)); } @@ -250,6 +269,8 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) cubic_data->prev_max_cwnd = cubic_data->max_cwnd; cubic_data->max_cwnd = CCV(ccv, snd_cwnd); cubic_data->t_last_cong = ticks; + ccv->flags |= CCF_CHG_MAX_CWND; + ccv->flags &= ~CCF_MAX_CWND; CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); ENTER_CONGRECOVERY(CCV(ccv, t_flags)); } @@ -266,6 +287,7 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) if (CCV(ccv, t_rxtshift) >= 2) { cubic_data->num_cong_events++; cubic_data->t_last_cong = ticks; + ccv->flags &= ~CCF_MAX_CWND; } break; } @@ -284,6 +306,7 @@ cubic_conn_init(struct cc_var *ccv) * get used. */ cubic_data->max_cwnd = CCV(ccv, snd_cwnd); + ccv->flags |= CCF_CHG_MAX_CWND; } static int @@ -308,9 +331,11 @@ cubic_post_recovery(struct cc_var *ccv) pipe = 0; /* Fast convergence heuristic. */ - if (cubic_data->max_cwnd < cubic_data->prev_max_cwnd) + if (cubic_data->max_cwnd < cubic_data->prev_max_cwnd) { cubic_data->max_cwnd = (cubic_data->max_cwnd * CUBIC_FC_FACTOR) >> CUBIC_SHIFT; + ccv->flags |= CCF_CHG_MAX_CWND; + } if (IN_FASTRECOVERY(CCV(ccv, t_flags))) { /* @@ -333,6 +358,7 @@ cubic_post_recovery(struct cc_var *ccv) cubic_data->max_cwnd) >> CUBIC_SHIFT)); } cubic_data->t_last_cong = ticks; + ccv->flags &= ~CCF_MAX_CWND; /* Calculate the average RTT between congestion epochs. */ if (cubic_data->epoch_ack_count > 0 && @@ -343,7 +369,6 @@ cubic_post_recovery(struct cc_var *ccv) cubic_data->epoch_ack_count = 0; cubic_data->sum_rtt_ticks = 0; - cubic_data->K = cubic_k(cubic_data->max_cwnd / CCV(ccv, t_maxseg)); } /* Modified: head/sys/netinet/cc/cc_cubic.h ============================================================================== --- head/sys/netinet/cc/cc_cubic.h Mon Mar 26 19:53:02 2018 (r331566) +++ head/sys/netinet/cc/cc_cubic.h Mon Mar 26 19:53:36 2018 (r331567) @@ -41,6 +41,8 @@ #ifndef _NETINET_CC_CUBIC_H_ #define _NETINET_CC_CUBIC_H_ +#include + /* Number of bits of precision for fixed point math calcs. */ #define CUBIC_SHIFT 8 @@ -162,8 +164,6 @@ cubic_k(unsigned long wmax_pkts) /* * Compute the new cwnd value using an implementation of eqn 1 from the I-D. * Thanks to Kip Macy for help debugging this function. - * - * XXXLAS: Characterise bounds for overflow. */ static __inline unsigned long cubic_cwnd(int ticks_since_cong, unsigned long wmax, uint32_t smss, int64_t K) @@ -175,6 +175,15 @@ cubic_cwnd(int ticks_since_cong, unsigned long wmax, u /* t - K, with CUBIC_SHIFT worth of precision. */ cwnd = ((int64_t)(ticks_since_cong << CUBIC_SHIFT) - (K * hz)) / hz; + /* moved this calculation up because it cannot overflow or underflow */ + cwnd *= CUBIC_C_FACTOR * smss; + + if (cwnd > 2097151) /* 2^21 cubed is long max */ + return INT_MAX; + + if (cwnd < -2097152) /* -2^21 cubed is long min */ + return smss; + /* (t - K)^3, with CUBIC_SHIFT^3 worth of precision. */ cwnd *= (cwnd * cwnd); @@ -183,8 +192,17 @@ cubic_cwnd(int ticks_since_cong, unsigned long wmax, u * The down shift by CUBIC_SHIFT_4 is because cwnd has 4 lots of * CUBIC_SHIFT included in the value. 3 from the cubing of cwnd above, * and an extra from multiplying through by CUBIC_C_FACTOR. + * + * The original formula was this: + * cwnd = ((cwnd * CUBIC_C_FACTOR * smss) >> CUBIC_SHIFT_4) + wmax; + * + * CUBIC_C_FACTOR and smss factors were moved up to an earlier + * calculation to simplify overflow and underflow detection. */ - cwnd = ((cwnd * CUBIC_C_FACTOR * smss) >> CUBIC_SHIFT_4) + wmax; + cwnd = (cwnd >> CUBIC_SHIFT_4) + wmax; + + if (cwnd < 0) + return 1; return ((unsigned long)cwnd); } From owner-svn-src-head@freebsd.org Mon Mar 26 20:30:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4047FF68E57; Mon, 26 Mar 2018 20:30:08 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB614724B9; Mon, 26 Mar 2018 20:30:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E646C11D45; Mon, 26 Mar 2018 20:30:07 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QKU7tS016768; Mon, 26 Mar 2018 20:30:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QKU7cB016767; Mon, 26 Mar 2018 20:30:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803262030.w2QKU7cB016767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 26 Mar 2018 20:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331579 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 331579 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 20:30:08 -0000 Author: cem Date: Mon Mar 26 20:30:07 2018 New Revision: 331579 URL: https://svnweb.freebsd.org/changeset/base/331579 Log: cryptodev: Match intent for enc_xform ciphers with blocksize != ivsize No functional change for Skipjack, AES-ICM, Blowfish, CAST-128, Camellia, DES3, Rijndael128, DES. All of these have identical IV and blocksizes declared in the associated enc_xform. Functional changes for: * AES-GCM: block len of 1, IV len of 12 * AES-XTS: block len of 16, IV len of 8 * NULL: block len of 4, IV len of 0 For these, it seems like the IV specified in the enc_xform is correct (and the blocksize used before was wrong). Additionally, the not-yet-OCFed cipher Chacha20 has a logical block length of 1 byte, and a 16 byte IV + nonce. Rationalize references to IV lengths to refer to the declared ivsize, rather than declared blocksize. Sponsored by: Dell EMC Isilon Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Mon Mar 26 20:28:50 2018 (r331578) +++ head/sys/opencrypto/cryptodev.c Mon Mar 26 20:30:07 2018 (r331579) @@ -854,7 +854,7 @@ cryptodev_op( goto bail; } if ((error = copyin(cop->iv, crde->crd_iv, - cse->txform->blocksize))) { + cse->txform->ivsize))) { SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } @@ -864,8 +864,8 @@ cryptodev_op( crde->crd_skip = 0; } else if (crde) { crde->crd_flags |= CRD_F_IV_PRESENT; - crde->crd_skip = cse->txform->blocksize; - crde->crd_len -= cse->txform->blocksize; + crde->crd_skip = cse->txform->ivsize; + crde->crd_len -= cse->txform->ivsize; } if (cop->mac && crda == NULL) { @@ -1032,8 +1032,8 @@ cryptodev_aead( crde->crd_flags |= CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; } else { crde->crd_flags |= CRD_F_IV_PRESENT; - crde->crd_skip += cse->txform->blocksize; - crde->crd_len -= cse->txform->blocksize; + crde->crd_skip += cse->txform->ivsize; + crde->crd_len -= cse->txform->ivsize; } if ((error = copyin(caead->tag, (caddr_t)cod->uio.uio_iov[0].iov_base + From owner-svn-src-head@freebsd.org Mon Mar 26 21:57:45 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 207B9F6EECC; Mon, 26 Mar 2018 21:57:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C310D764FE; Mon, 26 Mar 2018 21:57:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B9AAC12C4B; Mon, 26 Mar 2018 21:57:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QLviVk062795; Mon, 26 Mar 2018 21:57:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QLvinQ062794; Mon, 26 Mar 2018 21:57:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803262157.w2QLvinQ062794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 26 Mar 2018 21:57:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331594 - head/cddl/contrib/opensolaris/lib/libctf/common X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/lib/libctf/common X-SVN-Commit-Revision: 331594 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 21:57:45 -0000 Author: cem Date: Mon Mar 26 21:57:44 2018 New Revision: 331594 URL: https://svnweb.freebsd.org/changeset/base/331594 Log: libctf: Appease Coverity overrun warnings Rather than zeroing and reading into the a smaller union member the full union size, just zero and read directly into the union. No functional change intended. Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Modified: head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Mon Mar 26 21:14:20 2018 (r331593) +++ head/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Mon Mar 26 21:57:44 2018 (r331594) @@ -230,12 +230,12 @@ ctf_fdopen(int fd, int *errp) bzero(&ctfsect, sizeof (ctf_sect_t)); bzero(&symsect, sizeof (ctf_sect_t)); bzero(&strsect, sizeof (ctf_sect_t)); - bzero(&hdr.ctf, sizeof (hdr)); + bzero(&hdr, sizeof (hdr)); if (fstat64(fd, &st) == -1) return (ctf_set_open_errno(errp, errno)); - if ((nbytes = pread64(fd, &hdr.ctf, sizeof (hdr), 0)) <= 0) + if ((nbytes = pread64(fd, &hdr, sizeof (hdr), 0)) <= 0) return (ctf_set_open_errno(errp, nbytes < 0? errno : ECTF_FMT)); /* From owner-svn-src-head@freebsd.org Mon Mar 26 22:02:37 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 259E2F6F567; Mon, 26 Mar 2018 22:02:37 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7659776C96; Mon, 26 Mar 2018 22:02:36 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7155812DF3; Mon, 26 Mar 2018 22:02:36 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QM2ae6067800; Mon, 26 Mar 2018 22:02:36 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QM2aJh067799; Mon, 26 Mar 2018 22:02:36 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803262202.w2QM2aJh067799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 26 Mar 2018 22:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331595 - head/cddl/contrib/opensolaris/common/ctf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/common/ctf X-SVN-Commit-Revision: 331595 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 22:02:37 -0000 Author: cem Date: Mon Mar 26 22:02:36 2018 New Revision: 331595 URL: https://svnweb.freebsd.org/changeset/base/331595 Log: libctf: Don't construct pointers to out of bounds array offsets Just attempting to do the pointer arithmetic is undefined behavior. No functional change intended. Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c Modified: head/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c ============================================================================== --- head/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c Mon Mar 26 21:57:44 2018 (r331594) +++ head/cddl/contrib/opensolaris/common/ctf/ctf_lookup.c Mon Mar 26 22:02:36 2018 (r331595) @@ -59,10 +59,12 @@ isqualifier(const char *s, size_t len) }; int h = s[len - 1] + (int)len - 105; - const struct qual *qp = &qhash[h]; + const struct qual *qp; - return (h >= 0 && h < sizeof (qhash) / sizeof (qhash[0]) && - len == qp->q_len && strncmp(qp->q_name, s, qp->q_len) == 0); + if (h < 0 || h >= sizeof (qhash) / sizeof (qhash[0])) + return (0); + qp = &qhash[h]; + return (len == qp->q_len && strncmp(qp->q_name, s, qp->q_len) == 0); } /* From owner-svn-src-head@freebsd.org Mon Mar 26 22:10:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84691F6FE16; Mon, 26 Mar 2018 22:10:21 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F251977272; Mon, 26 Mar 2018 22:10:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED44312DF8; Mon, 26 Mar 2018 22:10:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QMAK8M068145; Mon, 26 Mar 2018 22:10:20 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QMAK7c068144; Mon, 26 Mar 2018 22:10:20 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803262210.w2QMAK7c068144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 26 Mar 2018 22:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331596 - head/usr.sbin/wpa/wpa_supplicant X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/usr.sbin/wpa/wpa_supplicant X-SVN-Commit-Revision: 331596 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 22:10:21 -0000 Author: cem Date: Mon Mar 26 22:10:20 2018 New Revision: 331596 URL: https://svnweb.freebsd.org/changeset/base/331596 Log: wpa_supplicant.conf.5: Document minimal eduroam configuration PR: 226939 Submitted by: Mateusz Piotrowski (0mp@) Sponsored by: Dell EMC Isilon Modified: head/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5 Modified: head/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5 ============================================================================== --- head/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5 Mon Mar 26 22:02:36 2018 (r331595) +++ head/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5 Mon Mar 26 22:10:20 2018 (r331596) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2010 +.Dd March 26, 2018 .Dt WPA_SUPPLICANT.CONF 5 .Os .Sh NAME @@ -554,6 +554,21 @@ network={ wep_key0=42FEEDDEAFBABEDEAFBEEFAA55 # ASCII keys denoted with quotes. wep_key1="FreeBSDr0cks!" +} +.Ed +.Pp +Minimal eduroam configuration. +.Bd -literal +ctrl_interface=/var/run/wpa_supplicant +ctrl_interface_group=wheel +network={ + ssid="eduroam" + scan_ssid=1 + key_mgmt=WPA-EAP + eap=TTLS + identity="user@example.org" + password="foobar" + phase2="auth=MSCHAPV2" } .Ed .Sh SEE ALSO From owner-svn-src-head@freebsd.org Mon Mar 26 22:30:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDAFFF718BD; Mon, 26 Mar 2018 22:30:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3FDFD78789; Mon, 26 Mar 2018 22:30:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3657F13119; Mon, 26 Mar 2018 22:30:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QMUIl1078289; Mon, 26 Mar 2018 22:30:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QMUIls078288; Mon, 26 Mar 2018 22:30:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201803262230.w2QMUIls078288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 26 Mar 2018 22:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331597 - head/tools/tools/crypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tools/tools/crypto X-SVN-Commit-Revision: 331597 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 22:30:19 -0000 Author: jhb Date: Mon Mar 26 22:30:17 2018 New Revision: 331597 URL: https://svnweb.freebsd.org/changeset/base/331597 Log: Update the license to note my work on cryptocheck was sponsored. Sponsored by: Chelsio Communications Modified: head/tools/tools/crypto/cryptocheck.c Modified: head/tools/tools/crypto/cryptocheck.c ============================================================================== --- head/tools/tools/crypto/cryptocheck.c Mon Mar 26 22:10:20 2018 (r331596) +++ head/tools/tools/crypto/cryptocheck.c Mon Mar 26 22:30:17 2018 (r331597) @@ -1,5 +1,30 @@ /*- - * Copyright (c) 2017 John Baldwin, + * Copyright (c) 2017 Chelsio Communications, Inc. + * All rights reserved. + * Written by: John Baldwin + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +/*- * Copyright (c) 2004 Sam Leffler, Errno Consulting * All rights reserved. * From owner-svn-src-head@freebsd.org Mon Mar 26 22:31:30 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F9BCF71BBE; Mon, 26 Mar 2018 22:31:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 257BA78A77; Mon, 26 Mar 2018 22:31:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 204691315F; Mon, 26 Mar 2018 22:31:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QMVTnl078372; Mon, 26 Mar 2018 22:31:29 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QMVTt7078370; Mon, 26 Mar 2018 22:31:29 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803262231.w2QMVTt7078370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 26 Mar 2018 22:31:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331598 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 331598 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 22:31:30 -0000 Author: cem Date: Mon Mar 26 22:31:29 2018 New Revision: 331598 URL: https://svnweb.freebsd.org/changeset/base/331598 Log: OCF: CRYPTDEB(): Enhance to allow formatted logging Sponsored by: Dell EMC Isilon Modified: head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon Mar 26 22:30:17 2018 (r331597) +++ head/sys/opencrypto/crypto.c Mon Mar 26 22:31:29 2018 (r331598) @@ -525,7 +525,7 @@ crypto_newsession(u_int64_t *sid, struct cryptoini *cr (*sid) |= (lid & 0xffffffff); cap->cc_sessions++; } else - CRYPTDEB("dev newsession failed"); + CRYPTDEB("dev newsession failed: %d", err); } else { CRYPTDEB("no driver"); err = EOPNOTSUPP; Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Mon Mar 26 22:30:17 2018 (r331597) +++ head/sys/opencrypto/cryptodev.h Mon Mar 26 22:31:29 2018 (r331598) @@ -348,10 +348,11 @@ struct cryptostats { #ifdef _KERNEL #if 0 -#define CRYPTDEB(s) do { printf("%s:%d: %s\n", __FILE__, __LINE__, s); \ - } while (0) +#define CRYPTDEB(s, ...) do { \ + printf("%s:%d: " s "\n", __FILE__, __LINE__, ## __VA_ARGS__); \ +} while (0) #else -#define CRYPTDEB(s) do { } while (0) +#define CRYPTDEB(...) do { } while (0) #endif /* Standard initialization structure beginning */ From owner-svn-src-head@freebsd.org Mon Mar 26 23:20:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E61D6F51468; Mon, 26 Mar 2018 23:20:38 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59B337C39E; Mon, 26 Mar 2018 23:20:38 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54A5813966; Mon, 26 Mar 2018 23:20:38 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QNKcvs003775; Mon, 26 Mar 2018 23:20:38 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QNKc2R003774; Mon, 26 Mar 2018 23:20:38 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803262320.w2QNKc2R003774@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 26 Mar 2018 23:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331600 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Commit-Revision: 331600 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 23:20:39 -0000 Author: cem Date: Mon Mar 26 23:20:37 2018 New Revision: 331600 URL: https://svnweb.freebsd.org/changeset/base/331600 Log: ctfconvert/ctfmerge: Fix a memory leak enumerating DWARF files Reported by: Coverity Sponsored by: Dell EMC Isilon Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Mon Mar 26 22:39:48 2018 (r331599) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Mon Mar 26 23:20:37 2018 (r331600) @@ -1613,6 +1613,7 @@ die_function_create(dwarf_t *dw, Dwarf_Die die, Dwarf_ ii->ii_vargs = 1; continue; } + free(name1); ii->ii_nargs++; } From owner-svn-src-head@freebsd.org Mon Mar 26 23:32:26 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A5B9F5267C for ; Mon, 26 Mar 2018 23:32:26 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yb0-x235.google.com (mail-yb0-x235.google.com [IPv6:2607:f8b0:4002:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0E1277D0AE for ; Mon, 26 Mar 2018 23:32:26 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yb0-x235.google.com with SMTP id u5-v6so6997088ybf.4 for ; Mon, 26 Mar 2018 16:32:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=MRm5CYiIPgeyFUSYLkUs4HGJYz5my+AOuBXoK1F3IDI=; b=CharHPFCCBMJaLDpl3VUrD7u1zaiuoaC0Yk7wWJb3x6fCcmlrm9x9koWstbVgb1e6r mM72+ehznWWSZtItIjQulRAvaitWmofpKKUr7o673DazkOGVW4Dakdhpx11rkHmlswQQ /H5VOTLM8E4FfPIKUa7pOLisgjJvSmnPBWaMjwTNu2TSEjHk1dZbagXDhaQJ7tWyvqel ElXQ7/roxaz0Nxee9eghHXKtwm0OKzXu63ifnPDKQ0nagPxo9pYo0gRdLSY7d0LASwOV 4o0k2L7uNafMKrGx6ILdxESwHkxRF4SQ/elyG5NjsrXUW3NUe0YVAwNNSQRRmlXkR1uj RvBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=MRm5CYiIPgeyFUSYLkUs4HGJYz5my+AOuBXoK1F3IDI=; b=MdT3anGIDu2ZpiBCJPFN2nxGZn5FGlXZYiZdgmwrdPaGcLQOR0UZ4TGU9u1IW6UUkJ ID7opLy6I8Hkjis/FM4YZnE/2SkYN994qHmmGtsvuiSs8G11slz6pnYcT4p6UddjDTh2 o5F27NdKXr92DWISwduni62V6OyhpIhLUq8wNwNipC4RroH3mRuD/kBicQnBxiBPYiSM g7TJboIgRvSPWZnThu3Ye2cp7gn1v6B+Lxc0iQnLH/PGPaGGnRKU2Nogl1X/AO/YJUu6 cUsxl+jDfOhVg5T6H3fqtHAc65EY21xfXeWuUUugRn7Xh7h3T1m5/8YiXgHvbEGPKRCw ocrQ== X-Gm-Message-State: AElRT7HKyT/r3cYoZqH2usKqpgeUvppR1ES78uxm/Hf35+vFb3rElEV1 qpMOkOGrWstBY0TXRVA4uQtC1eizz6FNgeJgP/GZag== X-Google-Smtp-Source: AG47ELv3HiCpk1dDppVbWv1i/RN9ml0xKPTLvRAGzZQUzAq/1MD12jV1j4eYQcE6Sa5lW3Ezpmp/1WpwCxtsp6SzTT8= X-Received: by 2002:a25:c791:: with SMTP id w139-v6mr24741567ybe.199.1522107145526; Mon, 26 Mar 2018 16:32:25 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:61c5:0:0:0:0:0 with HTTP; Mon, 26 Mar 2018 16:32:25 -0700 (PDT) In-Reply-To: <201801121530.w0CFUmE6095683@repo.freebsd.org> References: <201801121530.w0CFUmE6095683@repo.freebsd.org> From: Oliver Pinter Date: Tue, 27 Mar 2018 01:32:25 +0200 Message-ID: Subject: Re: svn commit: r327877 - head/usr.sbin/efibootmgr To: Warner Losh Cc: "svn-src-head@freebsd.org" , Kyle Evans Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 23:32:26 -0000 Hi Warner! Did you plan to MFC this to 11-stable? I think other parts (both kernel and loader parts are mostly MFCd back by Kyle). Thanks, Oliver On Friday, January 12, 2018, Warner Losh wrote: > Author: imp > Date: Fri Jan 12 15:30:48 2018 > New Revision: 327877 > URL: https://svnweb.freebsd.org/changeset/base/327877 > > Log: > Fix error in determining the next available boot slot. > > Sponsored by: Netflix > > Modified: > head/usr.sbin/efibootmgr/efibootmgr.c > > Modified: head/usr.sbin/efibootmgr/efibootmgr.c > ============================================================ > ================== > --- head/usr.sbin/efibootmgr/efibootmgr.c Fri Jan 12 14:01:38 2018 > (r327876) > +++ head/usr.sbin/efibootmgr/efibootmgr.c Fri Jan 12 15:30:48 2018 > (r327877) > @@ -563,7 +563,7 @@ make_next_boot_var_name(void) > } else { > /* now just run the list looking for the first hole */ > for (i = 0; i < cnt - 1 && next_free == 0; i++) > - if (vals[i] != vals[i + 1] + 1) > + if (vals[i] + 1 != vals[i + 1]) > next_free = vals[i] + 1; > if (next_free == 0) > next_free = vals[cnt - 1] + 1; > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Mon Mar 26 23:55:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD4C2F54108; Mon, 26 Mar 2018 23:55:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F2B87DF11; Mon, 26 Mar 2018 23:55:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C27013FDE; Mon, 26 Mar 2018 23:55:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2QNt1PU023682; Mon, 26 Mar 2018 23:55:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2QNt00j023669; Mon, 26 Mar 2018 23:55:00 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201803262355.w2QNt00j023669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 26 Mar 2018 23:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331602 - in head/sys/contrib/zstd: . contrib/gen_html contrib/meson contrib/seekable_format doc doc/images lib lib/common lib/compress lib/decompress lib/dictBuilder lib/legacy program... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/contrib/zstd: . contrib/gen_html contrib/meson contrib/seekable_format doc doc/images lib lib/common lib/compress lib/decompress lib/dictBuilder lib/legacy programs tests tests/fuzz zlibWr... X-SVN-Commit-Revision: 331602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Mar 2018 23:55:02 -0000 Author: cem Date: Mon Mar 26 23:54:59 2018 New Revision: 331602 URL: https://svnweb.freebsd.org/changeset/base/331602 Log: Update to Zstandard 1.3.4 Includes our local patch to conditionalize use of __builtin_clz(ll) on Clang's __has_builtin() (which is just defined to false when building with GCC). The issue is tracked upstream at https://github.com/facebook/zstd/pull/884 . Otherwise, these are vanilla Zstandard 1.3.4 files. Reported by: allanjude, Yann Collet Sponsored by: Dell EMC Isilon Added: head/sys/contrib/zstd/doc/images/CSpeed2.png (contents, props changed) head/sys/contrib/zstd/doc/images/DSpeed3.png (contents, props changed) head/sys/contrib/zstd/lib/common/cpu.h (contents, props changed) head/sys/contrib/zstd/tests/checkTag.c (contents, props changed) Deleted: head/sys/contrib/zstd/doc/images/Cspeed4.png head/sys/contrib/zstd/doc/images/Dspeed4.png Modified: head/sys/contrib/zstd/Makefile head/sys/contrib/zstd/NEWS head/sys/contrib/zstd/README.md head/sys/contrib/zstd/appveyor.yml head/sys/contrib/zstd/contrib/gen_html/Makefile head/sys/contrib/zstd/contrib/meson/meson.build head/sys/contrib/zstd/contrib/meson/meson_options.txt head/sys/contrib/zstd/contrib/seekable_format/zstdseek_compress.c head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c head/sys/contrib/zstd/doc/README.md head/sys/contrib/zstd/doc/images/dict-cr.png head/sys/contrib/zstd/doc/images/dict-cs.png head/sys/contrib/zstd/doc/images/dict-ds.png head/sys/contrib/zstd/doc/zstd_compression_format.md head/sys/contrib/zstd/doc/zstd_manual.html head/sys/contrib/zstd/lib/BUCK head/sys/contrib/zstd/lib/README.md head/sys/contrib/zstd/lib/common/bitstream.h head/sys/contrib/zstd/lib/common/compiler.h head/sys/contrib/zstd/lib/common/error_private.c head/sys/contrib/zstd/lib/common/fse.h head/sys/contrib/zstd/lib/common/fse_decompress.c head/sys/contrib/zstd/lib/common/huf.h head/sys/contrib/zstd/lib/common/pool.c head/sys/contrib/zstd/lib/common/pool.h head/sys/contrib/zstd/lib/common/threading.h head/sys/contrib/zstd/lib/common/zstd_errors.h head/sys/contrib/zstd/lib/common/zstd_internal.h head/sys/contrib/zstd/lib/compress/fse_compress.c head/sys/contrib/zstd/lib/compress/huf_compress.c head/sys/contrib/zstd/lib/compress/zstd_compress.c head/sys/contrib/zstd/lib/compress/zstd_compress_internal.h head/sys/contrib/zstd/lib/compress/zstd_double_fast.c head/sys/contrib/zstd/lib/compress/zstd_double_fast.h head/sys/contrib/zstd/lib/compress/zstd_fast.c head/sys/contrib/zstd/lib/compress/zstd_fast.h head/sys/contrib/zstd/lib/compress/zstd_lazy.c head/sys/contrib/zstd/lib/compress/zstd_lazy.h head/sys/contrib/zstd/lib/compress/zstd_ldm.c head/sys/contrib/zstd/lib/compress/zstd_ldm.h head/sys/contrib/zstd/lib/compress/zstd_opt.c head/sys/contrib/zstd/lib/compress/zstd_opt.h head/sys/contrib/zstd/lib/compress/zstdmt_compress.c head/sys/contrib/zstd/lib/compress/zstdmt_compress.h head/sys/contrib/zstd/lib/decompress/huf_decompress.c head/sys/contrib/zstd/lib/decompress/zstd_decompress.c head/sys/contrib/zstd/lib/dictBuilder/cover.c head/sys/contrib/zstd/lib/dictBuilder/zdict.c head/sys/contrib/zstd/lib/dictBuilder/zdict.h head/sys/contrib/zstd/lib/legacy/zstd_legacy.h head/sys/contrib/zstd/lib/legacy/zstd_v04.c head/sys/contrib/zstd/lib/legacy/zstd_v06.c head/sys/contrib/zstd/lib/legacy/zstd_v07.c head/sys/contrib/zstd/lib/zstd.h head/sys/contrib/zstd/programs/Makefile head/sys/contrib/zstd/programs/README.md head/sys/contrib/zstd/programs/bench.c head/sys/contrib/zstd/programs/bench.h head/sys/contrib/zstd/programs/fileio.c head/sys/contrib/zstd/programs/fileio.h head/sys/contrib/zstd/programs/platform.h head/sys/contrib/zstd/programs/util.h head/sys/contrib/zstd/programs/zstd.1 head/sys/contrib/zstd/programs/zstd.1.md head/sys/contrib/zstd/programs/zstdcli.c head/sys/contrib/zstd/tests/.gitignore head/sys/contrib/zstd/tests/Makefile head/sys/contrib/zstd/tests/fullbench.c head/sys/contrib/zstd/tests/fuzz/zstd_helpers.c head/sys/contrib/zstd/tests/fuzzer.c head/sys/contrib/zstd/tests/legacy.c head/sys/contrib/zstd/tests/paramgrill.c head/sys/contrib/zstd/tests/playTests.sh head/sys/contrib/zstd/tests/roundTripCrash.c head/sys/contrib/zstd/tests/zstreamtest.c head/sys/contrib/zstd/zlibWrapper/examples/zwrapbench.c Modified: head/sys/contrib/zstd/Makefile ============================================================================== --- head/sys/contrib/zstd/Makefile Mon Mar 26 23:23:11 2018 (r331601) +++ head/sys/contrib/zstd/Makefile Mon Mar 26 23:54:59 2018 (r331602) @@ -27,7 +27,7 @@ endif default: lib-release zstd-release .PHONY: all -all: | allmost examples manual +all: | allmost examples manual contrib .PHONY: allmost allmost: allzstd @@ -72,14 +72,18 @@ zstdmt: zlibwrapper: $(MAKE) -C $(ZWRAPDIR) test -.PHONY: check -check: shortest +.PHONY: test +test: + $(MAKE) -C $(PRGDIR) allVariants MOREFLAGS+="-g -DZSTD_DEBUG=1" + $(MAKE) -C $(TESTDIR) $@ -.PHONY: test shortest -test shortest: - $(MAKE) -C $(PRGDIR) allVariants MOREFLAGS="-g -DZSTD_DEBUG=1" +.PHONY: shortest +shortest: $(MAKE) -C $(TESTDIR) $@ +.PHONY: check +check: shortest + .PHONY: examples examples: CPPFLAGS=-I../lib LDFLAGS=-L../lib $(MAKE) -C examples/ all @@ -88,6 +92,12 @@ examples: manual: $(MAKE) -C contrib/gen_html $@ +.PHONY: contrib +contrib: lib + $(MAKE) -C contrib/pzstd all + $(MAKE) -C contrib/seekable_format/examples all + $(MAKE) -C contrib/adaptive-compression all + .PHONY: cleanTabs cleanTabs: cd contrib; ./cleanTabs @@ -100,6 +110,9 @@ clean: @$(MAKE) -C $(ZWRAPDIR) $@ > $(VOID) @$(MAKE) -C examples/ $@ > $(VOID) @$(MAKE) -C contrib/gen_html $@ > $(VOID) + @$(MAKE) -C contrib/pzstd $@ > $(VOID) + @$(MAKE) -C contrib/seekable_format/examples $@ > $(VOID) + @$(MAKE) -C contrib/adaptive-compression $@ > $(VOID) @$(RM) zstd$(EXT) zstdmt$(EXT) tmp* @$(RM) -r lz4 @echo Cleaning completed @@ -231,31 +244,31 @@ msanregressiontest: # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63303 usan: clean - $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=undefined" + $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=undefined -Werror" asan: clean - $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=address" + $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=address -Werror" asan-%: clean - LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address" $(MAKE) -C $(TESTDIR) $* + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=address -Werror" $(MAKE) -C $(TESTDIR) $* msan: clean - $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer" HAVE_LZMA=0 # datagen.c fails this test for no obvious reason + $(MAKE) test CC=clang MOREFLAGS="-g -fsanitize=memory -fno-omit-frame-pointer -Werror" HAVE_LZMA=0 # datagen.c fails this test for no obvious reason msan-%: clean - LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) HAVE_LZMA=0 $* + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=memory -fno-omit-frame-pointer -Werror" FUZZER_FLAGS=--no-big-tests $(MAKE) -C $(TESTDIR) HAVE_LZMA=0 $* asan32: clean $(MAKE) -C $(TESTDIR) test32 CC=clang MOREFLAGS="-g -fsanitize=address" uasan: clean - $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" + $(MAKE) test CC=clang MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined -Werror" uasan-%: clean - LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined" $(MAKE) -C $(TESTDIR) $* + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize-recover=signed-integer-overflow -fsanitize=address,undefined -Werror" $(MAKE) -C $(TESTDIR) $* tsan-%: clean - LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread" $(MAKE) -C $(TESTDIR) $* FUZZER_FLAGS=--no-big-tests + LDFLAGS=-fuse-ld=gold MOREFLAGS="-g -fno-sanitize-recover=all -fsanitize=thread -Werror" $(MAKE) -C $(TESTDIR) $* FUZZER_FLAGS=--no-big-tests apt-install: sudo apt-get -yq --no-install-suggests --no-install-recommends --force-yes install $(APT_PACKAGES) @@ -278,6 +291,9 @@ libc6install: gcc6install: apt-add-repo APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-6 gcc-6-multilib" $(MAKE) apt-install + +gcc7install: apt-add-repo + APT_PACKAGES="libc6-dev-i386 gcc-multilib gcc-7 gcc-7-multilib" $(MAKE) apt-install gpp6install: apt-add-repo APT_PACKAGES="libc6-dev-i386 g++-multilib gcc-6 g++-6 g++-6-multilib" $(MAKE) apt-install Modified: head/sys/contrib/zstd/NEWS ============================================================================== --- head/sys/contrib/zstd/NEWS Mon Mar 26 23:23:11 2018 (r331601) +++ head/sys/contrib/zstd/NEWS Mon Mar 26 23:54:59 2018 (r331602) @@ -1,5 +1,23 @@ +v1.3.4 +perf: faster speed (especially decoding speed) on recent cpus (haswell+) +perf: much better performance associating --long with multi-threading, by @terrelln +perf: better compression at levels 13-15 +cli : asynchronous compression by default, for faster experience (use --single-thread for former behavior) +cli : smoother status report in multi-threading mode +cli : added command --fast=#, for faster compression modes +cli : fix crash when not overwriting existing files, by Pádraig Brady (@pixelb) +api : `nbThreads` becomes `nbWorkers` : 1 triggers asynchronous mode +api : compression levels can be negative, for even more speed +api : ZSTD_getFrameProgression() : get precise progress status of ZSTDMT anytime +api : ZSTDMT can accept new compression parameters during compression +api : implemented all advanced dictionary decompression prototypes +build: improved meson recipe, by Shawn Landden (@shawnl) +build: VS2017 scripts, by @HaydnTrigg +misc: all /contrib projects fixed +misc: added /contrib/docker script by @gyscos + v1.3.3 -perf: faster zstd_opt strategy (levels 17-19) +perf: faster zstd_opt strategy (levels 16-19) fix : bug #944 : multithreading with shared ditionary and large data, reported by @gsliepen cli : fix : content size written in header by default cli : fix : improved LZ4 format support, by @felixhandte Modified: head/sys/contrib/zstd/README.md ============================================================================== --- head/sys/contrib/zstd/README.md Mon Mar 26 23:23:11 2018 (r331601) +++ head/sys/contrib/zstd/README.md Mon Mar 26 23:54:59 2018 (r331602) @@ -1,4 +1,4 @@ -

Zstandard

+

Zstandard

__Zstandard__, or `zstd` as short version, is a fast lossless compression algorithm, targeting real-time compression scenarios at zlib-level and better compression ratios. @@ -21,24 +21,25 @@ Development branch status : [![Build Status][travisDev ### Benchmarks For reference, several fast compression algorithms were tested and compared -on a server running Linux Debian (`Linux version 4.8.0-1-amd64`), +on a server running Linux Debian (`Linux version 4.14.0-3-amd64`), with a Core i7-6700K CPU @ 4.0GHz, using [lzbench], an open-source in-memory benchmark by @inikep -compiled with GCC 6.3.0, +compiled with [gcc] 7.3.0, on the [Silesia compression corpus]. [lzbench]: https://github.com/inikep/lzbench [Silesia compression corpus]: http://sun.aei.polsl.pl/~sdeor/index.php?page=silesia +[gcc]: https://gcc.gnu.org/ | Compressor name | Ratio | Compression| Decompress.| | --------------- | ------| -----------| ---------- | -| **zstd 1.1.3 -1** | 2.877 | 430 MB/s | 1110 MB/s | -| zlib 1.2.8 -1 | 2.743 | 110 MB/s | 400 MB/s | -| brotli 0.5.2 -0 | 2.708 | 400 MB/s | 430 MB/s | +| **zstd 1.3.4 -1** | 2.877 | 470 MB/s | 1380 MB/s | +| zlib 1.2.11 -1 | 2.743 | 110 MB/s | 400 MB/s | +| brotli 1.0.2 -0 | 2.701 | 410 MB/s | 430 MB/s | | quicklz 1.5.0 -1 | 2.238 | 550 MB/s | 710 MB/s | | lzo1x 2.09 -1 | 2.108 | 650 MB/s | 830 MB/s | -| lz4 1.7.5 | 2.101 | 720 MB/s | 3600 MB/s | -| snappy 1.1.3 | 2.091 | 500 MB/s | 1650 MB/s | +| lz4 1.8.1 | 2.101 | 750 MB/s | 3700 MB/s | +| snappy 1.1.4 | 2.091 | 530 MB/s | 1800 MB/s | | lzf 3.6 -1 | 2.077 | 400 MB/s | 860 MB/s | [zlib]:http://www.zlib.net/ @@ -50,15 +51,15 @@ Decompression speed is preserved and remains roughly t a property shared by most LZ compression algorithms, such as [zlib] or lzma. The following tests were run -on a server running Linux Debian (`Linux version 4.8.0-1-amd64`) +on a server running Linux Debian (`Linux version 4.14.0-3-amd64`) with a Core i7-6700K CPU @ 4.0GHz, using [lzbench], an open-source in-memory benchmark by @inikep -compiled with GCC 6.3.0, +compiled with [gcc] 7.3.0, on the [Silesia compression corpus]. Compression Speed vs Ratio | Decompression Speed ---------------------------|-------------------- -![Compression Speed vs Ratio](doc/images/Cspeed4.png "Compression Speed vs Ratio") | ![Decompression Speed](doc/images/Dspeed4.png "Decompression Speed") +![Compression Speed vs Ratio](doc/images/CSpeed2.png "Compression Speed vs Ratio") | ![Decompression Speed](doc/images/DSpeed3.png "Decompression Speed") A few other algorithms can produce higher compression ratios at slower speeds, falling outside of the graph. For a larger picture including slow modes, [click on this link](doc/images/DCspeed5.png). @@ -128,8 +129,8 @@ A Meson project is provided within `contrib/meson`. Going into `build` directory, you will find additional possibilities: - Projects for Visual Studio 2005, 2008 and 2010. - + VS2010 project is compatible with VS2012, VS2013 and VS2015. -- Automated build scripts for Visual compiler by @KrzysFR , in `build/VS_scripts`, + + VS2010 project is compatible with VS2012, VS2013, VS2015 and VS2017. +- Automated build scripts for Visual compiler by [@KrzysFR](https://github.com/KrzysFR), in `build/VS_scripts`, which will build `zstd` cli and `libzstd` library without any need to open Visual Studio solution. Modified: head/sys/contrib/zstd/appveyor.yml ============================================================================== --- head/sys/contrib/zstd/appveyor.yml Mon Mar 26 23:23:11 2018 (r331601) +++ head/sys/contrib/zstd/appveyor.yml Mon Mar 26 23:54:59 2018 (r331602) @@ -2,14 +2,13 @@ version: 1.0.{build} branches: only: - - dev - master environment: matrix: - COMPILER: "gcc" HOST: "mingw" PLATFORM: "x64" - SCRIPT: "make allzstd MOREFLAGS=-static && make -C tests test-symbols fullbench-dll fullbench-lib" + SCRIPT: "make allzstd MOREFLAGS=-static && make -C tests test-symbols fullbench-lib" ARTIFACT: "true" BUILD: "true" - COMPILER: "gcc" @@ -80,12 +79,22 @@ SET "LDFLAGS=../../zlib/libz.a" && sh -c "%SCRIPT%" && ( if [%COMPILER%]==[gcc] if [%ARTIFACT%]==[true] + ECHO Creating artifacts && + ECHO %cd% && lib\dll\example\build_package.bat && make -C programs DEBUGFLAGS= clean zstd && cd programs\ && 7z a -tzip -mx9 zstd-win-binary-%PLATFORM%.zip zstd.exe && appveyor PushArtifact zstd-win-binary-%PLATFORM%.zip && cp zstd.exe ..\bin\zstd.exe && - cd ..\bin\ && 7z a -tzip -mx9 zstd-win-release-%PLATFORM%.zip * && + git clone --depth 1 --branch master https://github.com/facebook/zstd && + cd zstd && + git archive --format=tar master -o zstd-src.tar && + ..\zstd -19 zstd-src.tar && + appveyor PushArtifact zstd-src.tar.zst && + certUtil -hashfile zstd-src.tar.zst SHA256 > zstd-src.tar.zst.sha256.sig && + appveyor PushArtifact zstd-src.tar.zst.sha256.sig && + cd ..\..\bin\ && + 7z a -tzip -mx9 zstd-win-release-%PLATFORM%.zip * && appveyor PushArtifact zstd-win-release-%PLATFORM%.zip ) ) Modified: head/sys/contrib/zstd/contrib/gen_html/Makefile ============================================================================== --- head/sys/contrib/zstd/contrib/gen_html/Makefile Mon Mar 26 23:23:11 2018 (r331601) +++ head/sys/contrib/zstd/contrib/gen_html/Makefile Mon Mar 26 23:54:59 2018 (r331602) @@ -7,10 +7,10 @@ # in the COPYING file in the root directory of this source tree). # ################################################################ -CFLAGS ?= -O3 -CFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wno-comment -CFLAGS += $(MOREFLAGS) -FLAGS = $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS) $(LDFLAGS) +CXXFLAGS ?= -O3 +CXXFLAGS += -Wall -Wextra -Wcast-qual -Wcast-align -Wshadow -Wstrict-aliasing=1 -Wswitch-enum -Wno-comment +CXXFLAGS += $(MOREFLAGS) +FLAGS = $(CPPFLAGS) $(CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) ZSTDAPI = ../../lib/zstd.h ZSTDMANUAL = ../../doc/zstd_manual.html Modified: head/sys/contrib/zstd/contrib/meson/meson.build ============================================================================== --- head/sys/contrib/zstd/contrib/meson/meson.build Mon Mar 26 23:23:11 2018 (r331601) +++ head/sys/contrib/zstd/contrib/meson/meson.build Mon Mar 26 23:54:59 2018 (r331602) @@ -38,21 +38,45 @@ libzstd_srcs = [ libzstd_includes = [include_directories(common_dir, dictbuilder_dir, compress_dir, lib_dir)] -if get_option('legacy_support') - message('Enabling legacy support') - libzstd_cflags = ['-DZSTD_LEGACY_SUPPORT=4'] +legacy = get_option('legacy_support') +if legacy == '0' + legacy = 'false' +endif +if legacy != 'false' + if legacy == 'true' + legacy = '1' + endif + #See ZSTD_LEGACY_SUPPORT of programs/README.md + message('Enabling legacy support back to version 0.' + legacy) + legacy_int = legacy.to_int() + if legacy_int > 7 + legacy_int = 7 + endif + libzstd_cflags = ['-DZSTD_LEGACY_SUPPORT=' + legacy] legacy_dir = join_paths(lib_dir, 'legacy') libzstd_includes += [include_directories(legacy_dir)] - libzstd_srcs += [ - join_paths(legacy_dir, 'zstd_v01.c'), - join_paths(legacy_dir, 'zstd_v02.c'), - join_paths(legacy_dir, 'zstd_v03.c'), - join_paths(legacy_dir, 'zstd_v04.c'), - join_paths(legacy_dir, 'zstd_v05.c'), - join_paths(legacy_dir, 'zstd_v06.c'), - join_paths(legacy_dir, 'zstd_v07.c') - ] + if legacy_int <= 1 + libzstd_srcs += join_paths(legacy_dir, 'zstd_v01.c') + endif + if legacy_int <= 2 + libzstd_srcs += join_paths(legacy_dir, 'zstd_v02.c') + endif + if legacy_int <= 3 + libzstd_srcs += join_paths(legacy_dir, 'zstd_v03.c') + endif + if legacy_int <= 4 + libzstd_srcs += join_paths(legacy_dir, 'zstd_v04.c') + endif + if legacy_int <= 5 + libzstd_srcs += join_paths(legacy_dir, 'zstd_v05.c') + endif + if legacy_int <= 6 + libzstd_srcs += join_paths(legacy_dir, 'zstd_v06.c') + endif + if legacy_int <= 7 + libzstd_srcs += join_paths(legacy_dir, 'zstd_v07.c') + endif else libzstd_cflags = [] endif @@ -70,7 +94,9 @@ libzstd = library('zstd', include_directories: libzstd_includes, c_args: libzstd_cflags, dependencies: libzstd_deps, - install: true) + install: true, + soversion: '1', + ) programs_dir = join_paths('..', '..', 'programs') Modified: head/sys/contrib/zstd/contrib/meson/meson_options.txt ============================================================================== --- head/sys/contrib/zstd/contrib/meson/meson_options.txt Mon Mar 26 23:23:11 2018 (r331601) +++ head/sys/contrib/zstd/contrib/meson/meson_options.txt Mon Mar 26 23:54:59 2018 (r331602) @@ -1,2 +1,3 @@ option('multithread', type: 'boolean', value: false) -option('legacy_support', type: 'boolean', value: false) +option('legacy_support', type: 'string', value: '4', + description: 'True or false, or 7 to 1 for v0.7+ to v0.1+.') Modified: head/sys/contrib/zstd/contrib/seekable_format/zstdseek_compress.c ============================================================================== --- head/sys/contrib/zstd/contrib/seekable_format/zstdseek_compress.c Mon Mar 26 23:23:11 2018 (r331601) +++ head/sys/contrib/zstd/contrib/seekable_format/zstdseek_compress.c Mon Mar 26 23:54:59 2018 (r331602) @@ -147,7 +147,7 @@ size_t ZSTD_seekable_initCStream(ZSTD_seekable_CStream /* make sure maxFrameSize has a reasonable value */ if (maxFrameSize > ZSTD_SEEKABLE_MAX_FRAME_DECOMPRESSED_SIZE) { - return ERROR(compressionParameter_unsupported); + return ERROR(frameParameter_unsupported); } zcs->maxFrameSize = maxFrameSize Modified: head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c ============================================================================== --- head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c Mon Mar 26 23:23:11 2018 (r331601) +++ head/sys/contrib/zstd/contrib/seekable_format/zstdseek_decompress.c Mon Mar 26 23:54:59 2018 (r331602) @@ -125,7 +125,7 @@ static int ZSTD_seekable_seek_buff(void* opaque, S64 o newOffset = (unsigned long long)buff->size - offset; break; } - if (newOffset < 0 || newOffset > buff->size) { + if (newOffset > buff->size) { return -1; } buff->pos = newOffset; @@ -145,7 +145,7 @@ typedef struct { int checksumFlag; } seekTable_t; -#define SEEKABLE_BUFF_SIZE ZSTD_BLOCKSIZE_ABSOLUTEMAX +#define SEEKABLE_BUFF_SIZE ZSTD_BLOCKSIZE_MAX struct ZSTD_seekable_s { ZSTD_DStream* dstream; Modified: head/sys/contrib/zstd/doc/README.md ============================================================================== --- head/sys/contrib/zstd/doc/README.md Mon Mar 26 23:23:11 2018 (r331601) +++ head/sys/contrib/zstd/doc/README.md Mon Mar 26 23:54:59 2018 (r331602) @@ -2,19 +2,24 @@ Zstandard Documentation ======================= This directory contains material defining the Zstandard format, -as well as for help using the `zstd` library. +as well as detailed instructions to use `zstd` library. +__`zstd_manual.html`__ : Documentation of `zstd.h` API, in html format. +Click on this link: [http://zstd.net/zstd_manual.html](http://zstd.net/zstd_manual.html) +to display documentation of latest release in readable format within a browser. + __`zstd_compression_format.md`__ : This document defines the Zstandard compression format. Compliant decoders must adhere to this document, and compliant encoders must generate data that follows it. +Should you look for ressources to develop your own port of Zstandard algorithm, +you may find the following ressources useful : + __`educational_decoder`__ : This directory contains an implementation of a Zstandard decoder, compliant with the Zstandard compression format. It can be used, for example, to better understand the format, -or as the basis for a separate implementation a Zstandard decoder/encoder. +or as the basis for a separate implementation of Zstandard decoder. -__`zstd_manual.html`__ : Documentation on the functions found in `zstd.h`. -See [http://zstd.net/zstd_manual.html](http://zstd.net/zstd_manual.html) for -the manual released with the latest official `zstd` release. - - +[__`decode_corpus`__](https://github.com/facebook/zstd/tree/dev/tests#decodecorpus---tool-to-generate-zstandard-frames-for-decoder-testing) : +This tool, stored in `/tests` directory, is able to generate random valid frames, +which is useful if you wish to test your decoder and verify it fully supports the specification. Added: head/sys/contrib/zstd/doc/images/CSpeed2.png ============================================================================== Binary file. No diff available. Added: head/sys/contrib/zstd/doc/images/DSpeed3.png ============================================================================== Binary file. No diff available. Modified: head/sys/contrib/zstd/doc/images/dict-cr.png ============================================================================== Binary file (source and/or target). No diff available. Modified: head/sys/contrib/zstd/doc/images/dict-cs.png ============================================================================== Binary file (source and/or target). No diff available. Modified: head/sys/contrib/zstd/doc/images/dict-ds.png ============================================================================== Binary file (source and/or target). No diff available. Modified: head/sys/contrib/zstd/doc/zstd_compression_format.md ============================================================================== --- head/sys/contrib/zstd/doc/zstd_compression_format.md Mon Mar 26 23:23:11 2018 (r331601) +++ head/sys/contrib/zstd/doc/zstd_compression_format.md Mon Mar 26 23:54:59 2018 (r331602) @@ -257,7 +257,7 @@ a decoder is allowed to reject a compressed frame which requests a memory size beyond decoder's authorized range. For improved interoperability, -decoders are recommended to be compatible with `Window_Size >= 8 MB`, +decoders are recommended to be compatible with `Window_Size <= 8 MB`, and encoders are recommended to not request more than 8 MB. It's merely a recommendation though, decoders are free to support larger or lower limits, Modified: head/sys/contrib/zstd/doc/zstd_manual.html ============================================================================== --- head/sys/contrib/zstd/doc/zstd_manual.html Mon Mar 26 23:23:11 2018 (r331601) +++ head/sys/contrib/zstd/doc/zstd_manual.html Mon Mar 26 23:54:59 2018 (r331602) @@ -1,17 +1,17 @@ -zstd 1.3.3 Manual +zstd 1.3.4 Manual -

zstd 1.3.3 Manual

+

zstd 1.3.4 Manual


Contents

  1. Introduction
  2. Version
  3. Simple API
  4. -
  5. Explicit memory management
  6. +
  7. Explicit context
  8. Simple dictionary API
  9. Bulk processing dictionary API
  10. Streaming
  11. @@ -19,17 +19,16 @@
  12. Streaming decompression - HowTo
  13. START OF ADVANCED AND EXPERIMENTAL FUNCTIONS
  14. Advanced types
  15. -
  16. Custom memory allocation functions
  17. -
  18. Frame size functions
  19. -
  20. Context memory usage
  21. -
  22. Advanced compression functions
  23. -
  24. Advanced decompression functions
  25. -
  26. Advanced streaming functions
  27. -
  28. Buffer-less and synchronous inner streaming functions
  29. -
  30. Buffer-less streaming compression (synchronous mode)
  31. -
  32. Buffer-less streaming decompression (synchronous mode)
  33. -
  34. New advanced API (experimental)
  35. -
  36. Block level API
  37. +
  38. Frame size functions
  39. +
  40. Memory management
  41. +
  42. Advanced compression functions
  43. +
  44. Advanced decompression functions
  45. +
  46. Advanced streaming functions
  47. +
  48. Buffer-less and synchronous inner streaming functions
  49. +
  50. Buffer-less streaming compression (synchronous mode)
  51. +
  52. Buffer-less streaming decompression (synchronous mode)
  53. +
  54. New advanced API (experimental)
  55. +
  56. Block level API

Introduction

@@ -40,11 +39,11 @@
   Levels >= 20, labeled `--ultra`, should be used with caution, as they require more memory.
   Compression can be done in:
     - a single step (described as Simple API)
-    - a single step, reusing a context (described as Explicit memory management)
+    - a single step, reusing a context (described as Explicit context)
     - unbounded multiple steps (described as Streaming compression)
   The compression ratio achievable on small data can be highly improved using a dictionary in:
     - a single step (described as Simple dictionary API)
-    - a single step, reusing a dictionary (described as Fast dictionary API)
+    - a single step, reusing a dictionary (described as Bulk-processing dictionary API)
 
   Advanced experimental functions can be accessed using #define ZSTD_STATIC_LINKING_ONLY before including zstd.h.
   Advanced experimental APIs shall never be used with a dynamic library.
@@ -103,22 +102,20 @@ unsigned long long ZSTD_getFrameContentSize(const void
 
 
unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);
 

NOTE: This function is now obsolete, in favor of ZSTD_getFrameContentSize(). - Both functions work the same way, - but ZSTD_getDecompressedSize() blends - "empty", "unknown" and "error" results in the same return value (0), - while ZSTD_getFrameContentSize() distinguishes them. - - 'src' is the start of a zstd compressed frame. - @return : content size to be decompressed, as a 64-bits value _if known and not empty_, 0 otherwise. + Both functions work the same way, but ZSTD_getDecompressedSize() blends + "empty", "unknown" and "error" results to the same return value (0), + while ZSTD_getFrameContentSize() gives them separate return values. + `src` is the start of a zstd compressed frame. + @return : content size to be decompressed, as a 64-bits value _if known and not empty_, 0 otherwise.


Helper functions

#define ZSTD_COMPRESSBOUND(srcSize)   ((srcSize) + ((srcSize)>>8) + (((srcSize) < (128<<10)) ? (((128<<10) - (srcSize)) >> 11) /* margin, from 64 to 0 */ : 0))  /* this formula ensures that bound(A) + bound(B) <= bound(A+B) as long as A and B >= 128 KB */
-size_t      ZSTD_compressBound(size_t srcSize); /*!< maximum compressed size in worst case scenario */
+size_t      ZSTD_compressBound(size_t srcSize); /*!< maximum compressed size in worst case single-pass scenario */
 unsigned    ZSTD_isError(size_t code);          /*!< tells if a `size_t` function result is an error code */
 const char* ZSTD_getErrorName(size_t code);     /*!< provides readable string from an error code */
 int         ZSTD_maxCLevel(void);               /*!< maximum compression level available */
 

-

Explicit memory management


+

Explicit context


 
 

Compression context

  When compressing many times,
   it is recommended to allocate a context just once, and re-use it for each successive compression operation.
@@ -347,11 +344,18 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_o
     ZSTD_frameParameters fParams;
 } ZSTD_parameters;
 

-

Custom memory allocation functions


-
-
typedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; void* opaque; } ZSTD_customMem;
+
typedef enum {
+    ZSTD_dct_auto=0,      /* dictionary is "full" when starting with ZSTD_MAGIC_DICTIONARY, otherwise it is "rawContent" */
+    ZSTD_dct_rawContent,  /* ensures dictionary is always loaded as rawContent, even if it starts with ZSTD_MAGIC_DICTIONARY */
+    ZSTD_dct_fullDict     /* refuses to load a dictionary if it does not respect Zstandard's specification */
+} ZSTD_dictContentType_e;
 

-

Frame size functions


+
typedef enum {
+    ZSTD_dlm_byCopy = 0, /**< Copy dictionary content internally */
+    ZSTD_dlm_byRef,      /**< Reference dictionary content -- the dictionary buffer must outlive its users. */
+} ZSTD_dictLoadMethod_e;
+

+

Frame size functions


 
 
size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize);
 

`src` should point to the start of a ZSTD encoded frame or skippable frame @@ -390,7 +394,7 @@ size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_o @return : size of the Frame Header


-

Context memory usage


+

Memory management


 
 
size_t ZSTD_sizeof_CCtx(const ZSTD_CCtx* cctx);
 size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);
@@ -399,7 +403,7 @@ size_t ZSTD_sizeof_DStream(const ZSTD_DStream* zds);
 size_t ZSTD_sizeof_CDict(const ZSTD_CDict* cdict);
 size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
 

These functions give the current memory usage of selected object. - Object memory usage can evolve when re-used multiple times. + Object memory usage can evolve when re-used.


size_t ZSTD_estimateCCtxSize(int compressionLevel);
@@ -412,8 +416,8 @@ size_t ZSTD_estimateDCtxSize(void);
   It will also consider src size to be arbitrarily "large", which is worst case.
   If srcSize is known to always be small, ZSTD_estimateCCtxSize_usingCParams() can provide a tighter estimation.
   ZSTD_estimateCCtxSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel.
-  ZSTD_estimateCCtxSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParam_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_p_nbThreads is > 1.
-  Note : CCtx estimation is only correct for single-threaded compression 
+  ZSTD_estimateCCtxSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParam_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_p_nbWorkers is >= 1.
+  Note : CCtx size estimation is only correct for single-threaded compression. 
 


size_t ZSTD_estimateCStreamSize(int compressionLevel);
@@ -425,8 +429,8 @@ size_t ZSTD_estimateDStreamSize_fromFrame(const void* 
   It will also consider src size to be arbitrarily "large", which is worst case.
   If srcSize is known to always be small, ZSTD_estimateCStreamSize_usingCParams() can provide a tighter estimation.
   ZSTD_estimateCStreamSize_usingCParams() can be used in tandem with ZSTD_getCParams() to create cParams from compressionLevel.
-  ZSTD_estimateCStreamSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParam_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_p_nbThreads is set to a value > 1.
-  Note : CStream estimation is only correct for single-threaded compression.
+  ZSTD_estimateCStreamSize_usingCCtxParams() can be used in tandem with ZSTD_CCtxParam_setParameter(). Only single-threaded compression is supported. This function will return an error code if ZSTD_p_nbWorkers is >= 1.
+  Note : CStream size estimation is only correct for single-threaded compression.
   ZSTD_DStream memory budget depends on window Size.
   This information can be passed manually, using ZSTD_estimateDStreamSize,
   or deducted from a valid frame Header, using ZSTD_estimateDStreamSize_fromFrame();
@@ -435,83 +439,59 @@ size_t ZSTD_estimateDStreamSize_fromFrame(const void* 
          In this case, get total size by adding ZSTD_estimate?DictSize 
 


-
typedef enum {
-    ZSTD_dlm_byCopy = 0,     /**< Copy dictionary content internally */
-    ZSTD_dlm_byRef,          /**< Reference dictionary content -- the dictionary buffer must outlive its users. */
-} ZSTD_dictLoadMethod_e;
-

size_t ZSTD_estimateCDictSize(size_t dictSize, int compressionLevel);
 size_t ZSTD_estimateCDictSize_advanced(size_t dictSize, ZSTD_compressionParameters cParams, ZSTD_dictLoadMethod_e dictLoadMethod);
 size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_dictLoadMethod_e dictLoadMethod);
 

ZSTD_estimateCDictSize() will bet that src size is relatively "small", and content is copied, like ZSTD_createCDict(). - ZSTD_estimateCStreamSize_advanced_usingCParams() makes it possible to control precisely compression parameters, like ZSTD_createCDict_advanced(). - Note : dictionary created by reference using ZSTD_dlm_byRef are smaller + ZSTD_estimateCDictSize_advanced() makes it possible to control compression parameters precisely, like ZSTD_createCDict_advanced(). + Note : dictionaries created by reference (`ZSTD_dlm_byRef`) are logically smaller.


-

Advanced compression functions


-
-
ZSTD_CCtx* ZSTD_createCCtx_advanced(ZSTD_customMem customMem);
-

Create a ZSTD compression context using external alloc and free functions +

ZSTD_CCtx*    ZSTD_initStaticCCtx(void* workspace, size_t workspaceSize);
+ZSTD_CStream* ZSTD_initStaticCStream(void* workspace, size_t workspaceSize);    /**< same as ZSTD_initStaticCCtx() */
+

Initialize an object using a pre-allocated fixed-size buffer. + workspace: The memory area to emplace the object into. + Provided pointer *must be 8-bytes aligned*. + Buffer must outlive object. + workspaceSize: Use ZSTD_estimate*Size() to determine + how large workspace must be to support target scenario. + @return : pointer to object (same address as workspace, just different type), + or NULL if error (size too small, incorrect alignment, etc.) + Note : zstd will never resize nor malloc() when using a static buffer. + If the object requires more memory than available, + zstd will just error out (typically ZSTD_error_memory_allocation). + Note 2 : there is no corresponding "free" function. + Since workspace is allocated externally, it must be freed externally too. + Note 3 : cParams : use ZSTD_getCParams() to convert a compression level + into its associated cParams. + Limitation 1 : currently not compatible with internal dictionary creation, triggered by + ZSTD_CCtx_loadDictionary(), ZSTD_initCStream_usingDict() or ZSTD_initDStream_usingDict(). + Limitation 2 : static cctx currently not compatible with multi-threading. + Limitation 3 : static dctx is incompatible with legacy support. +


-
ZSTD_CCtx* ZSTD_initStaticCCtx(void* workspace, size_t workspaceSize);
-

workspace: The memory area to emplace the context into. - Provided pointer must 8-bytes aligned. - It must outlive context usage. - workspaceSize: Use ZSTD_estimateCCtxSize() or ZSTD_estimateCStreamSize() - to determine how large workspace must be to support scenario. - @return : pointer to ZSTD_CCtx* (same address as workspace, but different type), - or NULL if error (typically size too small) - Note : zstd will never resize nor malloc() when using a static cctx. - If it needs more memory than available, it will simply error out. - Note 2 : there is no corresponding "free" function. - Since workspace was allocated externally, it must be freed externally too. - Limitation 1 : currently not compatible with internal CDict creation, such as - ZSTD_CCtx_loadDictionary() or ZSTD_initCStream_usingDict(). - Limitation 2 : currently not compatible with multi-threading +

ZSTD_DStream* ZSTD_initStaticDStream(void* workspace, size_t workspaceSize);    /**< same as ZSTD_initStaticDCtx() */
+

+
typedef void* (*ZSTD_allocFunction) (void* opaque, size_t size);
+typedef void  (*ZSTD_freeFunction) (void* opaque, void* address);
+typedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; void* opaque; } ZSTD_customMem;
+static ZSTD_customMem const ZSTD_defaultCMem = { NULL, NULL, NULL };  /**< this constant defers to stdlib's functions */
+

These prototypes make it possible to pass your own allocation/free functions. + ZSTD_customMem is provided at creation time, using ZSTD_create*_advanced() variants listed below. + All allocation/free operations will be completed using these custom variants instead of regular ones.


+

Advanced compression functions


+
 
ZSTD_CDict* ZSTD_createCDict_byReference(const void* dictBuffer, size_t dictSize, int compressionLevel);
 

Create a digested dictionary for compression Dictionary content is simply referenced, and therefore stays in dictBuffer. It is important that dictBuffer outlives CDict, it must remain read accessible throughout the lifetime of CDict


-
typedef enum { ZSTD_dm_auto=0,        /* dictionary is "full" if it starts with ZSTD_MAGIC_DICTIONARY, otherwise it is "rawContent" */
-               ZSTD_dm_rawContent,    /* ensures dictionary is always loaded as rawContent, even if it starts with ZSTD_MAGIC_DICTIONARY */
-               ZSTD_dm_fullDict       /* refuses to load a dictionary if it does not respect Zstandard's specification */
-} ZSTD_dictMode_e;
-

-
ZSTD_CDict* ZSTD_createCDict_advanced(const void* dict, size_t dictSize,
-                                      ZSTD_dictLoadMethod_e dictLoadMethod,
-                                      ZSTD_dictMode_e dictMode,
-                                      ZSTD_compressionParameters cParams,
-                                      ZSTD_customMem customMem);
-

Create a ZSTD_CDict using external alloc and free, and customized compression parameters -


- -
ZSTD_CDict* ZSTD_initStaticCDict(
-                void* workspace, size_t workspaceSize,
-          const void* dict, size_t dictSize,
-                ZSTD_dictLoadMethod_e dictLoadMethod, ZSTD_dictMode_e dictMode,
-                ZSTD_compressionParameters cParams);
-

Generate a digested dictionary in provided memory area. - workspace: The memory area to emplace the dictionary into. - Provided pointer must 8-bytes aligned. - It must outlive dictionary usage. - workspaceSize: Use ZSTD_estimateCDictSize() - to determine how large workspace must be. - cParams : use ZSTD_getCParams() to transform a compression level - into its relevants cParams. - @return : pointer to ZSTD_CDict* (same address as workspace, but different type), - or NULL if error (typically, size too small). - Note : there is no corresponding "free" function. - Since workspace was allocated externally, it must be freed externally. - -


-
ZSTD_compressionParameters ZSTD_getCParams(int compressionLevel, unsigned long long estimatedSrcSize, size_t dictSize);
 

@return ZSTD_compressionParameters structure for a selected compression level and estimated srcSize. `estimatedSrcSize` value is optional, select 0 if not known @@ -546,7 +526,7 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_di

Same as ZSTD_compress_usingCDict(), with fine-tune control over frame parameters


-

Advanced decompression functions


+

Advanced decompression functions


 
 
unsigned ZSTD_isFrame(const void* buffer, size_t size);
 

Tells if the content of `buffer` starts with a valid Frame Identifier. @@ -555,28 +535,6 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_di Note 3 : Skippable Frame Identifiers are considered valid.


-
ZSTD_DCtx* ZSTD_createDCtx_advanced(ZSTD_customMem customMem);
-

Create a ZSTD decompression context using external alloc and free functions -


- -
ZSTD_DCtx* ZSTD_initStaticDCtx(void* workspace, size_t workspaceSize);
-

workspace: The memory area to emplace the context into. - Provided pointer must 8-bytes aligned. - It must outlive context usage. - workspaceSize: Use ZSTD_estimateDCtxSize() or ZSTD_estimateDStreamSize() - to determine how large workspace must be to support scenario. - @return : pointer to ZSTD_DCtx* (same address as workspace, but different type), - or NULL if error (typically size too small) - Note : zstd will never resize nor malloc() when using a static dctx. - If it needs more memory than available, it will simply error out. - Note 2 : static dctx is incompatible with legacy support - Note 3 : there is no corresponding "free" function. - Since workspace was allocated externally, it must be freed externally. - Limitation : currently not compatible with internal DDict creation, - such as ZSTD_initDStream_usingDict(). - -


-
ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize);
 

Create a digested dictionary, ready to start decompression operation without startup delay. Dictionary content is referenced, and therefore stays in dictBuffer. @@ -584,27 +542,6 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_di it must remain read accessible throughout the lifetime of DDict


-
ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize,
-                                      ZSTD_dictLoadMethod_e dictLoadMethod,
-                                      ZSTD_customMem customMem);
-

Create a ZSTD_DDict using external alloc and free, optionally by reference -


- -
ZSTD_DDict* ZSTD_initStaticDDict(void* workspace, size_t workspaceSize,
-                                 const void* dict, size_t dictSize,
-                                 ZSTD_dictLoadMethod_e dictLoadMethod);
-

Generate a digested dictionary in provided memory area. - workspace: The memory area to emplace the dictionary into. - Provided pointer must 8-bytes aligned. - It must outlive dictionary usage. - workspaceSize: Use ZSTD_estimateDDictSize() - to determine how large workspace must be. - @return : pointer to ZSTD_DDict*, or NULL if error (size too small) - Note : there is no corresponding "free" function. - Since workspace was allocated externally, it must be freed externally. - -


-
unsigned ZSTD_getDictID_fromDict(const void* dict, size_t dictSize);
 

Provides the dictID stored within dictionary. if @return == 0, the dictionary is not conformant with Zstandard specification. @@ -629,11 +566,9 @@ size_t ZSTD_estimateDDictSize(size_t dictSize, ZSTD_di When identifying the exact failure cause, it's possible to use ZSTD_getFrameHeader(), which will provide a more precise error code.


-

Advanced streaming functions


+

Advanced streaming functions


 
-

Advanced Streaming compression functions

ZSTD_CStream* ZSTD_createCStream_advanced(ZSTD_customMem customMem);
-ZSTD_CStream* ZSTD_initStaticCStream(void* workspace, size_t workspaceSize);    /**< same as ZSTD_initStaticCCtx() */
-size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pledgedSrcSize);   /**< pledgedSrcSize must be correct. If it is not known at init time, use ZSTD_CONTENTSIZE_UNKNOWN. Note that, for compatibility with older programs, "0" also disables frame content size field. It may be enabled in the future. */
+

Advanced Streaming compression functions

size_t ZSTD_initCStream_srcSize(ZSTD_CStream* zcs, int compressionLevel, unsigned long long pledgedSrcSize);   /**< pledgedSrcSize must be correct. If it is not known at init time, use ZSTD_CONTENTSIZE_UNKNOWN. Note that, for compatibility with older programs, "0" also disables frame content size field. It may be enabled in the future. */
 size_t ZSTD_initCStream_usingDict(ZSTD_CStream* zcs, const void* dict, size_t dictSize, int compressionLevel); /**< creates of an internal CDict (incompatible with static CCtx), except if dict == NULL or dictSize < 8, in which case no dict is used. Note: dict is loaded with ZSTD_dm_auto (treated as a full zstd dictionary if it begins with ZSTD_MAGIC_DICTIONARY, else as raw content) and ZSTD_dlm_byCopy.*/
 size_t ZSTD_initCStream_advanced(ZSTD_CStream* zcs, const void* dict, size_t dictSize,
                                              ZSTD_parameters params, unsigned long long pledgedSrcSize);  /**< pledgedSrcSize must be correct. If srcSize is not known at init time, use value ZSTD_CONTENTSIZE_UNKNOWN. dict is loaded with ZSTD_dm_auto and ZSTD_dlm_byCopy. */
@@ -647,26 +582,30 @@ size_t ZSTD_initCStream_usingCDict_advanced(ZSTD_CStre
   If pledgedSrcSize is not known at reset time, use macro ZSTD_CONTENTSIZE_UNKNOWN.
   If pledgedSrcSize > 0, its value must be correct, as it will be written in header, and controlled at the end.
   For the time being, pledgedSrcSize==0 is interpreted as "srcSize unknown" for compatibility with older programs,
-  but it may change to mean "empty" in some future version, so prefer using macro ZSTD_CONTENTSIZE_UNKNOWN.
+  but it will change to mean "empty" in future version, so use macro ZSTD_CONTENTSIZE_UNKNOWN instead.
  @return : 0, or an error code (which can be tested using ZSTD_isError()) 
 


-

Advanced Streaming decompression functions

ZSTD_DStream* ZSTD_createDStream_advanced(ZSTD_customMem customMem);
-ZSTD_DStream* ZSTD_initStaticDStream(void* workspace, size_t workspaceSize);    /**< same as ZSTD_initStaticDCtx() */
-typedef enum { DStream_p_maxWindowSize } ZSTD_DStreamParameter_e;
+
typedef struct {
+    unsigned long long ingested;
+    unsigned long long consumed;
+    unsigned long long produced;
+} ZSTD_frameProgression;
+

+

Advanced Streaming decompression functions

typedef enum { DStream_p_maxWindowSize } ZSTD_DStreamParameter_e;
 size_t ZSTD_setDStreamParameter(ZSTD_DStream* zds, ZSTD_DStreamParameter_e paramType, unsigned paramValue);   /* obsolete : this API will be removed in a future version */
 size_t ZSTD_initDStream_usingDict(ZSTD_DStream* zds, const void* dict, size_t dictSize); /**< note: no dictionary will be used if dict == NULL or dictSize < 8 */
 size_t ZSTD_initDStream_usingDDict(ZSTD_DStream* zds, const ZSTD_DDict* ddict);  /**< note : ddict is referenced, it must outlive decompression session */
 size_t ZSTD_resetDStream(ZSTD_DStream* zds);  /**< re-use decompression parameters from previous init; saves dictionary loading */
 

-

Buffer-less and synchronous inner streaming functions

+

Buffer-less and synchronous inner streaming functions

   This is an advanced API, giving full control over buffer management, for users which need direct control over memory.
   But it's also a complex one, with several restrictions, documented below.
   Prefer normal streaming API for an easier experience.
  
 
-

Buffer-less streaming compression (synchronous mode)

+

Buffer-less streaming compression (synchronous mode)

   A ZSTD_CCtx object is required to track streaming operations.
   Use ZSTD_createCCtx() / ZSTD_freeCCtx() to manage resource.
   ZSTD_CCtx object can be re-used multiple times within successive compression operations.
@@ -702,7 +641,7 @@ size_t ZSTD_compressBegin_usingCDict(ZSTD_CCtx* cctx, 
 size_t ZSTD_compressBegin_usingCDict_advanced(ZSTD_CCtx* const cctx, const ZSTD_CDict* const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize);   /* compression parameters are already set within cdict. pledgedSrcSize must be correct. If srcSize is not known, use macro ZSTD_CONTENTSIZE_UNKNOWN */
 size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned long long pledgedSrcSize); /**<  note: if pledgedSrcSize is not known, use ZSTD_CONTENTSIZE_UNKNOWN */
 

-

Buffer-less streaming decompression (synchronous mode)

+

Buffer-less streaming decompression (synchronous mode)

   A ZSTD_DCtx object is required to track streaming operations.
   Use ZSTD_createDCtx() / ZSTD_freeDCtx() to manage it.
   A ZSTD_DCtx object can be re-used multiple times.
@@ -788,15 +727,15 @@ size_t ZSTD_decodingBufferSize_min(unsigned long long 
 

typedef enum { ZSTDnit_frameHeader, ZSTDnit_blockHeader, ZSTDnit_block, ZSTDnit_lastBlock, ZSTDnit_checksum, ZSTDnit_skippableFrame } ZSTD_nextInputType_e;
 

-

New advanced API (experimental)


+

New advanced API (experimental)


 
 
typedef enum {
-    /* Question : should we have a format ZSTD_f_auto ?
-     * For the time being, it would mean exactly the same as ZSTD_f_zstd1.
-     * But, in the future, should several formats be supported,
+    /* Opened question : should we have a format ZSTD_f_auto ?
+     * Today, it would mean exactly the same as ZSTD_f_zstd1.
+     * But, in the future, should several formats become supported,
      * on the compression side, it would mean "default format".
-     * On the decompression side, it would mean "multi format",
-     * and ZSTD_f_zstd1 could be reserved to mean "accept *only* zstd frames".
+     * On the decompression side, it would mean "automatic format detection",
+     * so that ZSTD_f_zstd1 would mean "accept *only* zstd frames".
      * Since meaning is a little different, another option could be to define different enums for compression and decompression.
      * This question could be kept for later, when there are actually multiple formats to support,
      * but there is also the question of pinning enum values, and pinning value `0` is especially important */
@@ -814,43 +753,77 @@ size_t ZSTD_decodingBufferSize_min(unsigned long long 
     /* compression parameters */
     ZSTD_p_compressionLevel=100, /* Update all compression parameters according to pre-defined cLevel table
                               * Default level is ZSTD_CLEVEL_DEFAULT==3.
-                              * Special: value 0 means "do not change cLevel". */
+                              * Special: value 0 means "do not change cLevel".
+                              * Note 1 : it's possible to pass a negative compression level by casting it to unsigned type.
+                              * Note 2 : setting a level sets all default values of other compression parameters.
+                              * Note 3 : setting compressionLevel automatically updates ZSTD_p_compressLiterals. */
     ZSTD_p_windowLog,        /* Maximum allowed back-reference distance, expressed as power of 2.
                               * Must be clamped between ZSTD_WINDOWLOG_MIN and ZSTD_WINDOWLOG_MAX.
-                              * Special: value 0 means "do not change windowLog".
+                              * Special: value 0 means "use default windowLog".
                               * Note: Using a window size greater than ZSTD_MAXWINDOWSIZE_DEFAULT (default: 2^27)
-                              * requires setting the maximum window size at least as large during decompression. */
+                              *       requires explicitly allowing such window size during decompression stage. */
     ZSTD_p_hashLog,          /* Size of the probe table, as a power of 2.
                               * Resulting table size is (1 << (hashLog+2)).
                               * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX.
                               * Larger tables improve compression ratio of strategies <= dFast,
                               * and improve speed of strategies > dFast.
-                              * Special: value 0 means "do not change hashLog". */
+                              * Special: value 0 means "use default hashLog". */
     ZSTD_p_chainLog,         /* Size of the full-search table, as a power of 2.
                               * Resulting table size is (1 << (chainLog+2)).
                               * Larger tables result in better and slower compression.
                               * This parameter is useless when using "fast" strategy.
-                              * Special: value 0 means "do not change chainLog". */
+                              * Special: value 0 means "use default chainLog". */
     ZSTD_p_searchLog,        /* Number of search attempts, as a power of 2.
                               * More attempts result in better and slower compression.
                               * This parameter is useless when using "fast" and "dFast" strategies.
-                              * Special: value 0 means "do not change searchLog". */
+                              * Special: value 0 means "use default searchLog". */
     ZSTD_p_minMatch,         /* Minimum size of searched matches (note : repCode matches can be smaller).
                               * Larger values make faster compression and decompression, but decrease ratio.
                               * Must be clamped between ZSTD_SEARCHLENGTH_MIN and ZSTD_SEARCHLENGTH_MAX.
                               * Note that currently, for all strategies < btopt, effective minimum is 4.
-                              * Note that currently, for all strategies > fast, effective maximum is 6.
-                              * Special: value 0 means "do not change minMatchLength". */
-    ZSTD_p_targetLength,     /* Only useful for strategies >= btopt.
-                              * Length of Match considered "good enough" to stop search.
-                              * Larger values make compression stronger and slower.
-                              * Special: value 0 means "do not change targetLength". */
+                              *                    , for all strategies > fast, effective maximum is 6.
+                              * Special: value 0 means "use default minMatchLength". */
+    ZSTD_p_targetLength,     /* Impact of this field depends on strategy.
+                              * For strategies btopt & btultra:
+                              *     Length of Match considered "good enough" to stop search.
+                              *     Larger values make compression stronger, and slower.
+                              * For strategy fast:
+                              *     Distance between match sampling.
+                              *     Larger values make compression faster, and weaker.
+                              * Special: value 0 means "use default targetLength". */
     ZSTD_p_compressionStrategy, /* See ZSTD_strategy enum definition.
                               * Cast selected strategy as unsigned for ZSTD_CCtx_setParameter() compatibility.
                               * The higher the value of selected strategy, the more complex it is,
                               * resulting in stronger and slower compression.
-                              * Special: value 0 means "do not change strategy". */
+                              * Special: value 0 means "use default strategy". */
 
+    ZSTD_p_enableLongDistanceMatching=160, /* Enable long distance matching.
+                                         * This parameter is designed to improve compression ratio
+                                         * for large inputs, by finding large matches at long distance.
+                                         * It increases memory usage and window size.
+                                         * Note: enabling this parameter increases ZSTD_p_windowLog to 128 MB
+                                         * except when expressly set to a different value. */
+    ZSTD_p_ldmHashLog,       /* Size of the table for long distance matching, as a power of 2.
+                              * Larger values increase memory usage and compression ratio,
+                              * but decrease compression speed.
+                              * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX
+                              * default: windowlog - 7.
+                              * Special: value 0 means "automatically determine hashlog". */
+    ZSTD_p_ldmMinMatch,      /* Minimum match size for long distance matcher.
+                              * Larger/too small values usually decrease compression ratio.
+                              * Must be clamped between ZSTD_LDM_MINMATCH_MIN and ZSTD_LDM_MINMATCH_MAX.
+                              * Special: value 0 means "use default value" (default: 64). */
+    ZSTD_p_ldmBucketSizeLog, /* Log size of each bucket in the LDM hash table for collision resolution.
+                              * Larger values improve collision resolution but decrease compression speed.
+                              * The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX .
+                              * Special: value 0 means "use default value" (default: 3). */
+    ZSTD_p_ldmHashEveryLog,  /* Frequency of inserting/looking up entries in the LDM hash table.
+                              * Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN).
+                              * Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage.
+                              * Larger values improve compression speed.
+                              * Deviating far from default value will likely result in a compression ratio decrease.
+                              * Special: value 0 means "automatically determine hashEveryLog". */
+
     /* frame parameters */
     ZSTD_p_contentSizeFlag=200, /* Content size will be written into frame header _whenever known_ (default:1)
                               * Content size must be known at the beginning of compression,
@@ -859,57 +832,44 @@ size_t ZSTD_decodingBufferSize_min(unsigned long long 
     ZSTD_p_dictIDFlag,       /* When applicable, dictionary's ID is written into frame header (default:1) */
 
     /* multi-threading parameters */
-    ZSTD_p_nbThreads=400,    /* Select how many threads a compression job can spawn (default:1)
-                              * More threads improve speed, but also increase memory usage.
-                              * Can only receive a value > 1 if ZSTD_MULTITHREAD is enabled.
-                              * Special: value 0 means "do not change nbThreads" */
-    ZSTD_p_jobSize,          /* Size of a compression job. This value is only enforced in streaming (non-blocking) mode.
-                              * Each compression job is completed in parallel, so indirectly controls the nb of active threads.
+    /* These parameters are only useful if multi-threading is enabled (ZSTD_MULTITHREAD).
+     * They return an error otherwise. */
+    ZSTD_p_nbWorkers=400,    /* Select how many threads will be spawned to compress in parallel.
+                              * When nbWorkers >= 1, triggers asynchronous mode :
+                              * ZSTD_compress_generic() consumes some input, flush some output if possible, and immediately gives back control to caller,
+                              * while compression work is performed in parallel, within worker threads.
+                              * (note : a strong exception to this rule is when first invocation sets ZSTD_e_end : it becomes a blocking call).
+                              * More workers improve speed, but also increase memory usage.
+                              * Default value is `0`, aka "single-threaded mode" : no worker is spawned, compression is performed inside Caller's thread, all invocations are blocking */
+    ZSTD_p_jobSize,          /* Size of a compression job. This value is enforced only in non-blocking mode.
+                              * Each compression job is completed in parallel, so this value indirectly controls the nb of active threads.
                               * 0 means default, which is dynamically determined based on compression parameters.
-                              * Job size must be a minimum of overlapSize, or 1 KB, whichever is largest
+                              * Job size must be a minimum of overlapSize, or 1 MB, whichever is largest.
                               * The minimum size is automatically and transparently enforced */
     ZSTD_p_overlapSizeLog,   /* Size of previous input reloaded at the beginning of each job.
                               * 0 => no overlap, 6(default) => use 1/8th of windowSize, >=9 => use full windowSize */
 
-    /* advanced parameters - may not remain available after API update */
+    /* =================================================================== */
+    /* experimental parameters - no stability guaranteed                   */
+    /* =================================================================== */
+
+    ZSTD_p_compressLiterals=1000, /* control huffman compression of literals (enabled) by default.
+                              * disabling it improves speed and decreases compression ratio by a large amount.
+                              * note : this setting is automatically updated when changing compression level.
+                              *        positive compression levels set ZSTD_p_compressLiterals to 1.
+                              *        negative compression levels set ZSTD_p_compressLiterals to 0. */
+
     ZSTD_p_forceMaxWindow=1100, /* Force back-reference distances to remain < windowSize,
                               * even when referencing into Dictionary content (default:0) */
-    ZSTD_p_enableLongDistanceMatching=1200,  /* Enable long distance matching.
-                                         * This parameter is designed to improve the compression
-                                         * ratio for large inputs with long distance matches.
-                                         * This increases the memory usage as well as window size.
-                                         * Note: setting this parameter sets all the LDM parameters
-                                         * as well as ZSTD_p_windowLog. It should be set after
-                                         * ZSTD_p_compressionLevel and before ZSTD_p_windowLog and
-                                         * other LDM parameters. Setting the compression level
-                                         * after this parameter overrides the window log, though LDM
-                                         * will remain enabled until explicitly disabled. */
-    ZSTD_p_ldmHashLog,   /* Size of the table for long distance matching, as a power of 2.
-                          * Larger values increase memory usage and compression ratio, but decrease
-                          * compression speed.
-                          * Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX
-                          * (default: windowlog - 7). */
-    ZSTD_p_ldmMinMatch,  /* Minimum size of searched matches for long distance matcher.
-                          * Larger/too small values usually decrease compression ratio.
-                          * Must be clamped between ZSTD_LDM_MINMATCH_MIN
-                          * and ZSTD_LDM_MINMATCH_MAX (default: 64). */
-    ZSTD_p_ldmBucketSizeLog,  /* Log size of each bucket in the LDM hash table for collision resolution.
-                               * Larger values usually improve collision resolution but may decrease
-                               * compression speed.
-                               * The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX (default: 3). */
-    ZSTD_p_ldmHashEveryLog,  /* Frequency of inserting/looking up entries in the LDM hash table.

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@freebsd.org  Tue Mar 27 00:25:39 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D637F56AA3;
 Tue, 27 Mar 2018 00:25:39 +0000 (UTC) (envelope-from devin@shxd.cx)
Received: from shxd.cx (mail.shxd.cx [64.201.244.140])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 2EC1A7F3CB;
 Tue, 27 Mar 2018 00:25:39 +0000 (UTC) (envelope-from devin@shxd.cx)
Received: from [74.217.198.10] (port=59888 helo=[10.1.4.66])
 by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD))
 (envelope-from )
 id 1f0Z1k-000BEs-AB; Mon, 26 Mar 2018 20:47:36 +0000
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
Subject: Re: svn commit: r331563 - head/stand/lua
From: Devin Teske 
In-Reply-To: <201803261901.w2QJ1MUj074381@repo.freebsd.org>
Date: Mon, 26 Mar 2018 17:25:31 -0700
Cc: Devin Teske ,
 src-committers , svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <9CF74768-8B7D-4F29-AAD1-A2802665635E@freebsd.org>
References: <201803261901.w2QJ1MUj074381@repo.freebsd.org>
To: Kyle Evans 
X-Mailer: Apple Mail (2.3273)
Sender: devin@shxd.cx
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 00:25:39 -0000

Woot!

That is all.
--=20
Devin

> On Mar 26, 2018, at 12:01 PM, Kyle Evans  wrote:
>=20
> Author: kevans
> Date: Mon Mar 26 19:01:22 2018
> New Revision: 331563
> URL: https://svnweb.freebsd.org/changeset/base/331563
>=20
> Log:
>  lualoader: Implement try_include and use it for including the local =
module
>=20
>  This provides a way to optionally include a module without having to =
wrap it
>  in filesystem checks. try_include is a little more robust, using the =
lua
>  search path instead of forcing us to explicitly consider all of the =
places
>  we could want to include a module. Errors are still generally raised =
from
>  trying to load the module, but ENOENT will not get raised unless =
we're doing
>  a verbose load.
>=20
>  This will also be used to split out logo/brand graphics into their =
own files
>  so that we can safely scale up the number of graphics included =
without
>  worrying about the extra memory consumption- opting to lazily load =
graphics
>  instead.
>=20
>  Reviewed by:	cem
>  Differential Revision:	https://reviews.freebsd.org/D14658
>=20
> Modified:
>  head/stand/lua/core.lua
>  head/stand/lua/loader.lua
>=20
> Modified: head/stand/lua/core.lua
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/stand/lua/core.lua	Mon Mar 26 18:39:38 2018	=
(r331562)
> +++ head/stand/lua/core.lua	Mon Mar 26 19:01:22 2018	=
(r331563)
> @@ -41,6 +41,26 @@ local function composeLoaderCmd(cmd_name, argstr)
> 	return cmd_name
> end
>=20
> +-- Globals
> +-- try_include will return the loaded module on success, or nil on =
failure.
> +-- A message will also be printed on failure, with one exception: =
non-verbose
> +-- loading will suppress 'module not found' errors.
> +function try_include(module)
> +	local status, ret =3D pcall(require, module)
> +	-- ret is the module if we succeeded.
> +	if status then
> +		return ret
> +	end
> +	-- Otherwise, ret is just a message; filter out ENOENT unless =
we're
> +	-- doing a verbose load. As a consequence, try_include prior to =
loading
> +	-- configuration will not display 'module not found'. All other =
errors
> +	-- in loading will be printed.
> +	if config.verbose or ret:match("^module .+ not found") =3D=3D =
nil then
> +		print(ret)
> +	end
> +	return nil
> +end
> +
> -- Module exports
> -- Commonly appearing constants
> core.KEY_BACKSPACE	=3D 8
>=20
> Modified: head/stand/lua/loader.lua
> =
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
> --- head/stand/lua/loader.lua	Mon Mar 26 18:39:38 2018	=
(r331562)
> +++ head/stand/lua/loader.lua	Mon Mar 26 19:01:22 2018	=
(r331563)
> @@ -43,11 +43,7 @@ if not core.isMenuSkipped() then
> end
> local password =3D require("password")
>=20
> -local result =3D lfs.attributes("/boot/lua/local.lua")
> --- Effectively discard any errors; we'll just act if it succeeds.
> -if result ~=3D nil then
> -	require("local")
> -end
> +try_include("local")
>=20
> config.load()
> if core.isUEFIBoot() then
>=20


From owner-svn-src-head@freebsd.org  Tue Mar 27 00:41:14 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13FB9F5908D
 for ;
 Tue, 27 Mar 2018 00:41:14 +0000 (UTC)
 (envelope-from byond.lenox@gmail.com)
Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com
 [209.85.215.45])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 7845B7FEBF;
 Tue, 27 Mar 2018 00:41:13 +0000 (UTC)
 (envelope-from byond.lenox@gmail.com)
Received: by mail-lf0-f45.google.com with SMTP id x205-v6so30791227lfa.0;
 Mon, 26 Mar 2018 17:41:13 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=KakVayuB50Q1W7yvOy/updL3DDKR944M1GUWOTrLlBE=;
 b=A+5WJClESPhCTceU7vhhE/ibyx/1a8P06gCvGyCaadKSPu6NvUVZbsar5W0odqsQuh
 ec7c9uoYwmBXmYJsx2QhS1mU30EB3rMsBelMxJvDJbYTAQ9Y7e4QAVFOC6XDboaHwJR8
 8y0/i2DuQ+Ko0JAMhoM+sLsTi+Y/b4Dju8ECR+g8VtigDSoSsuN6tCzk2Ncav52KE8sK
 lXQSvkZQ1rYjus6C4Qa1JL/PcbfFK7qGGlQNZ5lJSeB/FW+ss/fCzhRFCPPA0pyv2sQ8
 i+A3ssgBCMv0Csr+4UiEnODTM0ANrT1Gp5YkCHY/o3Y8LpdxOJo4/mjZEJcbCOnjFsWa
 bqag==
X-Gm-Message-State: AElRT7GF3pDpUwplFmGf+gJ0o6Le5EqKVioO4i0PeuTDwGOuRmQJxxQR
 CKg+qLNi0ow4KhnXwC/nLue7Rc8/
X-Google-Smtp-Source: AG47ELs9aPhyEIwV9SzxS5tOBrT+j4/68cluWCjj9rNpqAABmHV3sDN2ANEYfnk54MBwhsfgfAiIrw==
X-Received: by 10.46.71.12 with SMTP id u12mr21036338lja.36.1522111265399;
 Mon, 26 Mar 2018 17:41:05 -0700 (PDT)
Received: from mail-lf0-f53.google.com (mail-lf0-f53.google.com.
 [209.85.215.53])
 by smtp.gmail.com with ESMTPSA id x17-v6sm3197lfi.30.2018.03.26.17.41.05
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 26 Mar 2018 17:41:05 -0700 (PDT)
Received: by mail-lf0-f53.google.com with SMTP id p142-v6so30761786lfd.6;
 Mon, 26 Mar 2018 17:41:05 -0700 (PDT)
X-Received: by 2002:a19:6919:: with SMTP id
 e25-v6mr27139443lfc.52.1522111265105; 
 Mon, 26 Mar 2018 17:41:05 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.46.129.90 with HTTP; Mon, 26 Mar 2018 17:40:44 -0700 (PDT)
In-Reply-To: 
References: <201801121530.w0CFUmE6095683@repo.freebsd.org>
 
From: Kyle Evans 
Date: Mon, 26 Mar 2018 19:40:44 -0500
X-Gmail-Original-Message-ID: 
Message-ID: 
Subject: Re: svn commit: r327877 - head/usr.sbin/efibootmgr
To: Oliver Pinter 
Cc: Warner Losh ,
 "svn-src-head@freebsd.org" 
Content-Type: text/plain; charset="UTF-8"
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 00:41:14 -0000

On Mon, Mar 26, 2018 at 6:32 PM, Oliver Pinter
 wrote:
> On Friday, January 12, 2018, Warner Losh  wrote:
>>
>> Author: imp
>> Date: Fri Jan 12 15:30:48 2018
>> New Revision: 327877
>> URL: https://svnweb.freebsd.org/changeset/base/327877
>>
>> Log:
>>   Fix error in determining the next available boot slot.
>>
>>   Sponsored by: Netflix
>>
>> Modified:
>>   head/usr.sbin/efibootmgr/efibootmgr.c
>>
>> Modified: head/usr.sbin/efibootmgr/efibootmgr.c
>>
>> ==============================================================================
>> --- head/usr.sbin/efibootmgr/efibootmgr.c       Fri Jan 12 14:01:38 2018
>> (r327876)
>> +++ head/usr.sbin/efibootmgr/efibootmgr.c       Fri Jan 12 15:30:48 2018
>> (r327877)
>> @@ -563,7 +563,7 @@ make_next_boot_var_name(void)
>>         } else {
>>                 /* now just run the list looking for the first hole */
>>                 for (i = 0; i < cnt - 1 && next_free == 0; i++)
>> -                       if (vals[i] != vals[i + 1] + 1)
>> +                       if (vals[i] + 1 != vals[i + 1])
>>                                 next_free = vals[i] + 1;
>>                 if (next_free == 0)
>>                         next_free = vals[cnt - 1] + 1;
>> _______________________________________________
>> svn-src-head@freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/svn-src-head
>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"
>
> Hi Warner!
>
> Did you plan to MFC this to 11-stable? I think other parts (both kernel and
> loader parts are mostly MFCd back by Kyle).
>
> Thanks,
> Oliver

If Warner has no plans or doesn't get to it by April 4th (date
mentioned in my call for testing [1] to -current@), I'll go ahead and
sweep up any outstanding efibootmgr/efivar MFC's along with the rest
of my EFI changes (SetVirtualAddressMap, GOP setting). As of now, I'm
still intending to hit my target and MFC these on April 4th since
testing has boiled out some of the more subtle EFIRT gotchas (like the
SYSINIT ordering).

[1] https://lists.freebsd.org/pipermail/freebsd-current/2018-March/068908.html

From owner-svn-src-head@freebsd.org  Tue Mar 27 03:27:03 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D160F6D266;
 Tue, 27 Mar 2018 03:27:03 +0000 (UTC)
 (envelope-from jeff@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id B558768F91;
 Tue, 27 Mar 2018 03:27:02 +0000 (UTC)
 (envelope-from jeff@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B02BE16675;
 Tue, 27 Mar 2018 03:27:02 +0000 (UTC)
 (envelope-from jeff@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2R3R2ir030320;
 Tue, 27 Mar 2018 03:27:02 GMT (envelope-from jeff@FreeBSD.org)
Received: (from jeff@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2R3R2f9030318;
 Tue, 27 Mar 2018 03:27:02 GMT (envelope-from jeff@FreeBSD.org)
Message-Id: <201803270327.w2R3R2f9030318@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jeff set sender to
 jeff@FreeBSD.org using -f
From: Jeff Roberson 
Date: Tue, 27 Mar 2018 03:27:02 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331605 - head/sys/vm
X-SVN-Group: head
X-SVN-Commit-Author: jeff
X-SVN-Commit-Paths: head/sys/vm
X-SVN-Commit-Revision: 331605
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 03:27:03 -0000

Author: jeff
Date: Tue Mar 27 03:27:02 2018
New Revision: 331605
URL: https://svnweb.freebsd.org/changeset/base/331605

Log:
  Move vm_ndomains to vm.h where it can be used with a single header include
  rather than requiring a half-dozen.  Many non-vm files may want to know
  the number of valid domains.
  
  Sponsored by:	Netflix, Dell/EMC Isilon

Modified:
  head/sys/vm/vm.h
  head/sys/vm/vm_phys.h

Modified: head/sys/vm/vm.h
==============================================================================
--- head/sys/vm/vm.h	Tue Mar 27 01:02:42 2018	(r331604)
+++ head/sys/vm/vm.h	Tue Mar 27 03:27:02 2018	(r331605)
@@ -148,6 +148,8 @@ extern void vm_ksubmap_init(struct kva_md_info *);
 
 extern int old_mlock;
 
+extern int vm_ndomains;
+
 struct ucred;
 int swap_reserve(vm_ooffset_t incr);
 int swap_reserve_by_cred(vm_ooffset_t incr, struct ucred *cred);

Modified: head/sys/vm/vm_phys.h
==============================================================================
--- head/sys/vm/vm_phys.h	Tue Mar 27 01:02:42 2018	(r331604)
+++ head/sys/vm/vm_phys.h	Tue Mar 27 03:27:02 2018	(r331605)
@@ -52,7 +52,6 @@ struct mem_affinity {
 extern struct mem_affinity *mem_affinity;
 extern int *mem_locality;
 #endif
-extern int vm_ndomains;
 
 struct vm_freelist {
 	struct pglist pl;

From owner-svn-src-head@freebsd.org  Tue Mar 27 03:37:05 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90B93F6E005;
 Tue, 27 Mar 2018 03:37:05 +0000 (UTC)
 (envelope-from jeff@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 676FE697EB;
 Tue, 27 Mar 2018 03:37:05 +0000 (UTC)
 (envelope-from jeff@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6263F16829;
 Tue, 27 Mar 2018 03:37:05 +0000 (UTC)
 (envelope-from jeff@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2R3b5sO035292;
 Tue, 27 Mar 2018 03:37:05 GMT (envelope-from jeff@FreeBSD.org)
Received: (from jeff@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2R3b4iv035285;
 Tue, 27 Mar 2018 03:37:04 GMT (envelope-from jeff@FreeBSD.org)
Message-Id: <201803270337.w2R3b4iv035285@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jeff set sender to
 jeff@FreeBSD.org using -f
From: Jeff Roberson 
Date: Tue, 27 Mar 2018 03:37:04 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331606 - in head/sys: amd64/include i386/include x86/x86
 x86/xen
X-SVN-Group: head
X-SVN-Commit-Author: jeff
X-SVN-Commit-Paths: in head/sys: amd64/include i386/include x86/x86 x86/xen
X-SVN-Commit-Revision: 331606
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 03:37:05 -0000

Author: jeff
Date: Tue Mar 27 03:37:04 2018
New Revision: 331606
URL: https://svnweb.freebsd.org/changeset/base/331606

Log:
  Only use CPUs in the domain the device is attached to for default
  assignment.  Device drivers are able to override the default assignment
  if they bind directly.  There are severe performance penalties for
  handling interrupts on remote CPUs and this should only be done in
  very controlled circumstances.
  
  Reviewed by:	jhb, kib
  Tested by:	pho (earlier version)
  Sponsored by:	Netflix, Dell/EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D14838

Modified:
  head/sys/amd64/include/intr_machdep.h
  head/sys/i386/include/intr_machdep.h
  head/sys/x86/x86/intr_machdep.c
  head/sys/x86/x86/io_apic.c
  head/sys/x86/x86/msi.c
  head/sys/x86/x86/nexus.c
  head/sys/x86/xen/xen_intr.c

Modified: head/sys/amd64/include/intr_machdep.h
==============================================================================
--- head/sys/amd64/include/intr_machdep.h	Tue Mar 27 03:27:02 2018	(r331605)
+++ head/sys/amd64/include/intr_machdep.h	Tue Mar 27 03:37:04 2018	(r331606)
@@ -132,6 +132,7 @@ struct intsrc {
 	u_long *is_straycount;
 	u_int is_index;
 	u_int is_handlers;
+	u_int is_domain;
 	u_int is_cpu;
 };
 
@@ -168,7 +169,7 @@ void	intr_add_cpu(u_int cpu);
 #endif
 int	intr_add_handler(const char *name, int vector, driver_filter_t filter, 
 			 driver_intr_t handler, void *arg, enum intr_type flags, 
-			 void **cookiep);    
+			 void **cookiep, int domain);    
 #ifdef SMP
 int	intr_bind(u_int vector, u_char cpu);
 #endif
@@ -176,7 +177,7 @@ int	intr_config_intr(int vector, enum intr_trigger tri
     enum intr_polarity pol);
 int	intr_describe(u_int vector, void *ih, const char *descr);
 void	intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame);
-u_int	intr_next_cpu(void);
+u_int	intr_next_cpu(int domain);
 struct intsrc *intr_lookup_source(int vector);
 int	intr_register_pic(struct pic *pic);
 int	intr_register_source(struct intsrc *isrc);

Modified: head/sys/i386/include/intr_machdep.h
==============================================================================
--- head/sys/i386/include/intr_machdep.h	Tue Mar 27 03:27:02 2018	(r331605)
+++ head/sys/i386/include/intr_machdep.h	Tue Mar 27 03:37:04 2018	(r331606)
@@ -132,6 +132,7 @@ struct intsrc {
 	u_long *is_straycount;
 	u_int is_index;
 	u_int is_handlers;
+	u_int is_domain;
 	u_int is_cpu;
 };
 
@@ -158,7 +159,8 @@ void	elcr_write_trigger(u_int irq, enum intr_trigger t
 void	intr_add_cpu(u_int cpu);
 #endif
 int	intr_add_handler(const char *name, int vector, driver_filter_t filter,
-    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep);
+    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep,
+    int domain);
 #ifdef SMP
 int	intr_bind(u_int vector, u_char cpu);
 #endif
@@ -166,7 +168,7 @@ int	intr_config_intr(int vector, enum intr_trigger tri
     enum intr_polarity pol);
 int	intr_describe(u_int vector, void *ih, const char *descr);
 void	intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame);
-u_int	intr_next_cpu(void);
+u_int	intr_next_cpu(int domain);
 struct intsrc *intr_lookup_source(int vector);
 int	intr_register_pic(struct pic *pic);
 int	intr_register_source(struct intsrc *isrc);

Modified: head/sys/x86/x86/intr_machdep.c
==============================================================================
--- head/sys/x86/x86/intr_machdep.c	Tue Mar 27 03:27:02 2018	(r331605)
+++ head/sys/x86/x86/intr_machdep.c	Tue Mar 27 03:37:04 2018	(r331606)
@@ -71,6 +71,8 @@
 #include 
 #endif
 
+#include 
+
 #define	MAX_STRAY_LOG	5
 
 typedef void (*mask_fn)(void *);
@@ -185,7 +187,8 @@ intr_lookup_source(int vector)
 
 int
 intr_add_handler(const char *name, int vector, driver_filter_t filter,
-    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep)
+    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep,
+    int domain)
 {
 	struct intsrc *isrc;
 	int error;
@@ -200,6 +203,7 @@ intr_add_handler(const char *name, int vector, driver_
 		intrcnt_updatename(isrc);
 		isrc->is_handlers++;
 		if (isrc->is_handlers == 1) {
+			isrc->is_domain = domain;
 			isrc->is_pic->pic_enable_intr(isrc);
 			isrc->is_pic->pic_enable_source(isrc);
 		}
@@ -507,14 +511,27 @@ DB_SHOW_COMMAND(irqs, db_show_irqs)
  */
 
 cpuset_t intr_cpus = CPUSET_T_INITIALIZER(0x1);
-static int current_cpu;
+static int current_cpu[MAXMEMDOM];
 
+static void
+intr_init_cpus(void)
+{
+	int i;
+
+	for (i = 0; i < vm_ndomains; i++) {
+		current_cpu[i] = 0;
+		if (!CPU_ISSET(current_cpu[i], &intr_cpus) ||
+		    !CPU_ISSET(current_cpu[i], &cpuset_domain[i]))
+			intr_next_cpu(i);
+	}
+}
+
 /*
  * Return the CPU that the next interrupt source should use.  For now
  * this just returns the next local APIC according to round-robin.
  */
 u_int
-intr_next_cpu(void)
+intr_next_cpu(int domain)
 {
 	u_int apic_id;
 
@@ -529,12 +546,13 @@ intr_next_cpu(void)
 #endif
 
 	mtx_lock_spin(&icu_lock);
-	apic_id = cpu_apic_ids[current_cpu];
+	apic_id = cpu_apic_ids[current_cpu[domain]];
 	do {
-		current_cpu++;
-		if (current_cpu > mp_maxid)
-			current_cpu = 0;
-	} while (!CPU_ISSET(current_cpu, &intr_cpus));
+		current_cpu[domain]++;
+		if (current_cpu[domain] > mp_maxid)
+			current_cpu[domain] = 0;
+	} while (!CPU_ISSET(current_cpu[domain], &intr_cpus) ||
+	    !CPU_ISSET(current_cpu[domain], &cpuset_domain[domain]));
 	mtx_unlock_spin(&icu_lock);
 	return (apic_id);
 }
@@ -568,7 +586,18 @@ intr_add_cpu(u_int cpu)
 	CPU_SET(cpu, &intr_cpus);
 }
 
-#ifndef EARLY_AP_STARTUP
+#ifdef EARLY_AP_STARTUP
+static void
+intr_smp_startup(void *arg __unused)
+{
+
+	intr_init_cpus();
+	return;
+}
+SYSINIT(intr_smp_startup, SI_SUB_SMP, SI_ORDER_SECOND, intr_smp_startup,
+    NULL);
+
+#else
 /*
  * Distribute all the interrupt sources among the available CPUs once the
  * AP's have been launched.
@@ -580,6 +609,7 @@ intr_shuffle_irqs(void *arg __unused)
 	u_int cpu;
 	int i;
 
+	intr_init_cpus();
 	/* Don't bother on UP. */
 	if (mp_ncpus == 1)
 		return;
@@ -599,12 +629,12 @@ intr_shuffle_irqs(void *arg __unused)
 			 */
 			cpu = isrc->is_event->ie_cpu;
 			if (cpu == NOCPU)
-				cpu = current_cpu;
+				cpu = current_cpu[isrc->is_domain];
 			if (isrc->is_pic->pic_assign_cpu(isrc,
 			    cpu_apic_ids[cpu]) == 0) {
 				isrc->is_cpu = cpu;
 				if (isrc->is_event->ie_cpu == NOCPU)
-					intr_next_cpu();
+					intr_next_cpu(isrc->is_domain);
 			}
 		}
 	}
@@ -635,10 +665,11 @@ sysctl_hw_intrs(SYSCTL_HANDLER_ARGS)
 		isrc = interrupt_sources[i];
 		if (isrc == NULL)
 			continue;
-		sbuf_printf(&sbuf, "%s:%d @%d: %ld\n",
+		sbuf_printf(&sbuf, "%s:%d @cpu%d(domain%d): %ld\n",
 		    isrc->is_event->ie_fullname,
 		    isrc->is_index,
 		    isrc->is_cpu,
+		    isrc->is_domain,
 		    *isrc->is_count);
 	}
 
@@ -697,7 +728,7 @@ intr_balance(void *dummy __unused, int pending __unuse
 	 * Restart the scan from the same location to avoid moving in the
 	 * common case.
 	 */
-	current_cpu = 0;
+	intr_init_cpus();
 
 	/*
 	 * Assign round-robin from most loaded to least.
@@ -706,8 +737,8 @@ intr_balance(void *dummy __unused, int pending __unuse
 		isrc = interrupt_sorted[i];
 		if (isrc == NULL  || isrc->is_event->ie_cpu != NOCPU)
 			continue;
-		cpu = current_cpu;
-		intr_next_cpu();
+		cpu = current_cpu[isrc->is_domain];
+		intr_next_cpu(isrc->is_domain);
 		if (isrc->is_cpu != cpu &&
 		    isrc->is_pic->pic_assign_cpu(isrc,
 		    cpu_apic_ids[cpu]) == 0)
@@ -735,7 +766,7 @@ SYSINIT(intr_balance_init, SI_SUB_SMP, SI_ORDER_ANY, i
  * Always route interrupts to the current processor in the UP case.
  */
 u_int
-intr_next_cpu(void)
+intr_next_cpu(int domain)
 {
 
 	return (PCPU_GET(apic_id));

Modified: head/sys/x86/x86/io_apic.c
==============================================================================
--- head/sys/x86/x86/io_apic.c	Tue Mar 27 03:27:02 2018	(r331605)
+++ head/sys/x86/x86/io_apic.c	Tue Mar 27 03:37:04 2018	(r331606)
@@ -499,7 +499,7 @@ ioapic_enable_intr(struct intsrc *isrc)
 	struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc;
 
 	if (intpin->io_vector == 0)
-		if (ioapic_assign_cpu(isrc, intr_next_cpu()) != 0)
+		if (ioapic_assign_cpu(isrc, intr_next_cpu(isrc->is_domain)) != 0)
 			panic("Couldn't find an APIC vector for IRQ %d",
 			    intpin->io_irq);
 	apic_enable_vector(intpin->io_cpu, intpin->io_vector);

Modified: head/sys/x86/x86/msi.c
==============================================================================
--- head/sys/x86/x86/msi.c	Tue Mar 27 03:27:02 2018	(r331605)
+++ head/sys/x86/x86/msi.c	Tue Mar 27 03:37:04 2018	(r331606)
@@ -363,7 +363,7 @@ int
 msi_alloc(device_t dev, int count, int maxcount, int *irqs)
 {
 	struct msi_intsrc *msi, *fsrc;
-	u_int cpu;
+	u_int cpu, domain;
 	int cnt, i, *mirqs, vector;
 #ifdef ACPI_DMAR
 	u_int cookies[count];
@@ -373,6 +373,9 @@ msi_alloc(device_t dev, int count, int maxcount, int *
 	if (!msi_enabled)
 		return (ENXIO);
 
+	if (bus_get_domain(dev, &domain) != 0)
+		domain = 0;
+
 	if (count > 1)
 		mirqs = malloc(count * sizeof(*mirqs), M_MSI, M_WAITOK);
 	else
@@ -420,7 +423,7 @@ again:
 	KASSERT(cnt == count, ("count mismatch"));
 
 	/* Allocate 'count' IDT vectors. */
-	cpu = intr_next_cpu();
+	cpu = intr_next_cpu(domain);
 	vector = apic_alloc_vectors(cpu, irqs, count, maxcount);
 	if (vector == 0) {
 		mtx_unlock(&msi_lock);
@@ -610,7 +613,7 @@ int
 msix_alloc(device_t dev, int *irq)
 {
 	struct msi_intsrc *msi;
-	u_int cpu;
+	u_int cpu, domain;
 	int i, vector;
 #ifdef ACPI_DMAR
 	u_int cookie;
@@ -620,6 +623,9 @@ msix_alloc(device_t dev, int *irq)
 	if (!msi_enabled)
 		return (ENXIO);
 
+	if (bus_get_domain(dev, &domain) != 0)
+		domain = 0;
+
 again:
 	mtx_lock(&msi_lock);
 
@@ -651,7 +657,7 @@ again:
 	}
 
 	/* Allocate an IDT vector. */
-	cpu = intr_next_cpu();
+	cpu = intr_next_cpu(domain);
 	vector = apic_alloc_vector(cpu, i);
 	if (vector == 0) {
 		mtx_unlock(&msi_lock);

Modified: head/sys/x86/x86/nexus.c
==============================================================================
--- head/sys/x86/x86/nexus.c	Tue Mar 27 03:27:02 2018	(r331605)
+++ head/sys/x86/x86/nexus.c	Tue Mar 27 03:37:04 2018	(r331606)
@@ -573,7 +573,7 @@ nexus_setup_intr(device_t bus, device_t child, struct 
 		 int flags, driver_filter_t filter, void (*ihand)(void *),
 		 void *arg, void **cookiep)
 {
-	int		error;
+	int		error, domain;
 
 	/* somebody tried to setup an irq that failed to allocate! */
 	if (irq == NULL)
@@ -589,9 +589,11 @@ nexus_setup_intr(device_t bus, device_t child, struct 
 	error = rman_activate_resource(irq);
 	if (error)
 		return (error);
+	if (bus_get_domain(child, &domain) != 0)
+		domain = 0;
 
 	error = intr_add_handler(device_get_nameunit(child),
-	    rman_get_start(irq), filter, ihand, arg, flags, cookiep);
+	    rman_get_start(irq), filter, ihand, arg, flags, cookiep, domain);
 
 	return (error);
 }

Modified: head/sys/x86/xen/xen_intr.c
==============================================================================
--- head/sys/x86/xen/xen_intr.c	Tue Mar 27 03:27:02 2018	(r331605)
+++ head/sys/x86/xen/xen_intr.c	Tue Mar 27 03:37:04 2018	(r331606)
@@ -430,7 +430,7 @@ xen_intr_bind_isrc(struct xenisrc **isrcp, evtchn_port
 		 * unless specified otherwise, so shuffle them to balance
 		 * the interrupt load.
 		 */
-		xen_intr_assign_cpu(&isrc->xi_intsrc, intr_next_cpu());
+		xen_intr_assign_cpu(&isrc->xi_intsrc, intr_next_cpu(0));
 	}
 #endif
 
@@ -1562,7 +1562,7 @@ xen_intr_add_handler(const char *name, driver_filter_t
 		return (EINVAL);
 
 	error = intr_add_handler(name, isrc->xi_vector,filter, handler, arg,
-	    flags|INTR_EXCL, &isrc->xi_cookie);
+	    flags|INTR_EXCL, &isrc->xi_cookie, 0);
 	if (error != 0) {
 		printf(
 		    "%s: xen_intr_add_handler: intr_add_handler failed: %d\n",

From owner-svn-src-head@freebsd.org  Tue Mar 27 05:19:13 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58927F4E4DE;
 Tue, 27 Mar 2018 05:19:13 +0000 (UTC)
 (envelope-from danfe@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "freefall.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 0C13B6D6F8;
 Tue, 27 Mar 2018 05:19:13 +0000 (UTC)
 (envelope-from danfe@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 1033)
 id 0297C1C031; Tue, 27 Mar 2018 05:19:12 +0000 (UTC)
Date: Tue, 27 Mar 2018 05:19:12 +0000
From: Alexey Dokuchaev 
To: John Baldwin 
Cc: Warner Losh , Kyle Evans ,
 svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers 
Subject: Re: svn commit: r331209 - head
Message-ID: <20180327051912.GA5729@FreeBSD.org>
References: <201803191527.w2JFRr7B058668@repo.freebsd.org>
 
 <20180322043938.GA8311@FreeBSD.org>
 <3226647.aiAOVF4eaK@ralph.baldwin.cx>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <3226647.aiAOVF4eaK@ralph.baldwin.cx>
User-Agent: Mutt/1.9.2 (2017-12-15)
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 05:19:13 -0000

On Thu, Mar 22, 2018 at 08:52:47AM -0700, John Baldwin wrote:
> On Thursday, March 22, 2018 04:39:38 AM Alexey Dokuchaev wrote:
> > > ...
> > Right, but John had mentioned extra reboot *between* installkernel and
> > installworld, which I've never heard of before.
> 
> From the end up of src/UPDATING:
> 
>         
>         make buildworld
>         make kernel KERNCONF=YOUR_KERNEL_HERE
>         

If by "reboot" in your original message you meant "drop to single user"
then there's no confusion.  It's just that in my understanding "reboot"
means, well, reboot.

./danfe

From owner-svn-src-head@freebsd.org  Tue Mar 27 06:15:54 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E56B7F5211B;
 Tue, 27 Mar 2018 06:15:53 +0000 (UTC)
 (envelope-from ohartmann@walstatt.org)
Received: from mout.gmx.net (mout.gmx.net [212.227.17.21])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 4D39F6FE1A;
 Tue, 27 Mar 2018 06:15:52 +0000 (UTC)
 (envelope-from ohartmann@walstatt.org)
Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by
 mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id
 0LkSOt-1ePSKw36Mt-00cO5C; Tue, 27 Mar 2018 08:15:45 +0200
Date: Tue, 27 Mar 2018 08:15:35 +0200
From: "O. Hartmann" 
To: Jeff Roberson 
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r331606 - in head/sys: amd64/include i386/include
 x86/x86 x86/xen
Message-ID: <20180327081535.0dacffcb@freyja.zeit4.iv.bundesimmobilien.de>
In-Reply-To: <201803270337.w2R3b4iv035285@repo.freebsd.org>
References: <201803270337.w2R3b4iv035285@repo.freebsd.org>
Organization: Walstatt
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:ozmCPne46YJYThQ9vFU2u/r++3JOuYy/JqhAnwU/6Z0Nz8stslX
 ZEBT5bByn7yQn6Fo/FNAAtWD/xPIQ0xWeEmzrXnGRaw1/McckAz5xxHnUdyyribyA0NIhg0
 ky3WOkL/v3ACtHA+JKBDNRsyehcsQl8A2RYrJDS1ffxb3tIz6AXLjZleZqmvFLlsh9UkNwC
 YcwPPuMwQ0WHXOOMW9NXA==
X-UI-Out-Filterresults: notjunk:1;V01:K0:jksG2GyoapA=:YgwsPycWyXESzAu9kPiVAi
 VjeHu4E1au/GjOX/cvp/TamTefRAQvsPg8kyrSZVTkdYYTe8evB26fpeBk5fzc0QwVZ0Qzgmd
 jVq9I5TdXmKYya43vlkDakbKDolkX7Ra++qeZz6gvjRRw/ur1jl3WbGDYysuEpsMhkyw2RH9f
 pNlXQjIMCQl2sOE9u9N1LGgHudQQpbSqtAbO/rN9zovMP4dmire1RwqxiMJLA1k6RSkcYMx7V
 sK7KOgaw6+MnrOAQg2Xvskgvje6xSnjCpoGAABvC5eLlV2kQzJfRDevpA+keaEagt8fTJedeC
 g195grn0OHOe5SadY95h1DDhdx89xQ6dZpIj1kLyFCZmP4mmFnlqh31bIexN+kZR8IoERywv0
 bEz8xTlvSDoMtncIJEfzQCUbSbnnbuxul0cmMRU9IwJ4dtsw6m+QcQacVIB2u8phLEA9ZmMWi
 /6ppOW7AS1Uy/G95K8Q3MnuZsi0DWT6/rNwZxQzBxy83aKPwEAWyzusvQOjGPQX358d3GFIA7
 iShG79x1OAC4sk93AnSrlhHrHQBZUtDxJbrSSgnGy9rmAjOXhOVxdYAd4A5LLiGUAI1iIonBg
 KwS2efaBOFgnFi+m57b6IjXvnDyLe2LoqmFhEj3jYLct9ILcSQyr8EO2+UnqQh958TQQz7wgm
 NVZMUuoRdrTL6fwuO5Zo9J0PrM5CzC2Sql3D0JKKoX32T4aa5sMdwgwPMQJPDQvw1+styIBXH
 6CIU7vJHxhvBpgkPMzOlY/HU8hhdF4kmM8iGlpNc8EDfbBdhCb8J9ZPqqilmwBEzjY+Ohb2oZ
 uffdCaU3+1h6vcNMZ9qU7LnfG/Hf+qFoURy3RJb3rvHLyKNZIY=
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 06:15:54 -0000

On Tue, 27 Mar 2018 03:37:04 +0000 (UTC)
Jeff Roberson  wrote:

> Author: jeff
> Date: Tue Mar 27 03:37:04 2018
> New Revision: 331606
> URL: https://svnweb.freebsd.org/changeset/base/331606
> 
> Log:
>   Only use CPUs in the domain the device is attached to for default
>   assignment.  Device drivers are able to override the default assignment
>   if they bind directly.  There are severe performance penalties for
>   handling interrupts on remote CPUs and this should only be done in
>   very controlled circumstances.
>   
>   Reviewed by:	jhb, kib
>   Tested by:	pho (earlier version)
>   Sponsored by:	Netflix, Dell/EMC Isilon
>   Differential Revision:	https://reviews.freebsd.org/D14838
> 
> Modified:
>   head/sys/amd64/include/intr_machdep.h
>   head/sys/i386/include/intr_machdep.h
>   head/sys/x86/x86/intr_machdep.c
>   head/sys/x86/x86/io_apic.c
>   head/sys/x86/x86/msi.c
>   head/sys/x86/x86/nexus.c
>   head/sys/x86/xen/xen_intr.c
> 
> Modified: head/sys/amd64/include/intr_machdep.h
> ==============================================================================
> --- head/sys/amd64/include/intr_machdep.h	Tue Mar 27 03:27:02
> 2018	(r331605) +++ head/sys/amd64/include/intr_machdep.h	Tue
> Mar 27 03:37:04 2018	(r331606) @@ -132,6 +132,7 @@ struct intsrc {
>  	u_long *is_straycount;
>  	u_int is_index;
>  	u_int is_handlers;
> +	u_int is_domain;
>  	u_int is_cpu;
>  };
>  
> @@ -168,7 +169,7 @@ void	intr_add_cpu(u_int cpu);
>  #endif
>  int	intr_add_handler(const char *name, int vector, driver_filter_t
> filter, driver_intr_t handler, void *arg, enum intr_type flags, 
> -			 void **cookiep);    
> +			 void **cookiep, int domain);    
>  #ifdef SMP
>  int	intr_bind(u_int vector, u_char cpu);
>  #endif
> @@ -176,7 +177,7 @@ int	intr_config_intr(int vector, enum intr_trigger
> tri enum intr_polarity pol);
>  int	intr_describe(u_int vector, void *ih, const char *descr);
>  void	intr_execute_handlers(struct intsrc *isrc, struct trapframe
> *frame); -u_int	intr_next_cpu(void);
> +u_int	intr_next_cpu(int domain);
>  struct intsrc *intr_lookup_source(int vector);
>  int	intr_register_pic(struct pic *pic);
>  int	intr_register_source(struct intsrc *isrc);
> 
> Modified: head/sys/i386/include/intr_machdep.h
> ==============================================================================
> --- head/sys/i386/include/intr_machdep.h	Tue Mar 27 03:27:02
> 2018	(r331605) +++ head/sys/i386/include/intr_machdep.h	Tue Mar
> 27 03:37:04 2018	(r331606) @@ -132,6 +132,7 @@ struct intsrc {
>  	u_long *is_straycount;
>  	u_int is_index;
>  	u_int is_handlers;
> +	u_int is_domain;
>  	u_int is_cpu;
>  };
>  
> @@ -158,7 +159,8 @@ void	elcr_write_trigger(u_int irq, enum
> intr_trigger t void	intr_add_cpu(u_int cpu);
>  #endif
>  int	intr_add_handler(const char *name, int vector, driver_filter_t
> filter,
> -    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep);
> +    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep,
> +    int domain);
>  #ifdef SMP
>  int	intr_bind(u_int vector, u_char cpu);
>  #endif
> @@ -166,7 +168,7 @@ int	intr_config_intr(int vector, enum intr_trigger
> tri enum intr_polarity pol);
>  int	intr_describe(u_int vector, void *ih, const char *descr);
>  void	intr_execute_handlers(struct intsrc *isrc, struct trapframe
> *frame); -u_int	intr_next_cpu(void);
> +u_int	intr_next_cpu(int domain);
>  struct intsrc *intr_lookup_source(int vector);
>  int	intr_register_pic(struct pic *pic);
>  int	intr_register_source(struct intsrc *isrc);
> 
> Modified: head/sys/x86/x86/intr_machdep.c
> ==============================================================================
> --- head/sys/x86/x86/intr_machdep.c	Tue Mar 27 03:27:02 2018
> (r331605) +++ head/sys/x86/x86/intr_machdep.c	Tue Mar 27 03:37:04
> 2018	(r331606) @@ -71,6 +71,8 @@
>  #include 
>  #endif
>  
> +#include 
> +
>  #define	MAX_STRAY_LOG	5
>  
>  typedef void (*mask_fn)(void *);
> @@ -185,7 +187,8 @@ intr_lookup_source(int vector)
>  
>  int
>  intr_add_handler(const char *name, int vector, driver_filter_t filter,
> -    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep)
> +    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep,
> +    int domain)
>  {
>  	struct intsrc *isrc;
>  	int error;
> @@ -200,6 +203,7 @@ intr_add_handler(const char *name, int vector, driver_
>  		intrcnt_updatename(isrc);
>  		isrc->is_handlers++;
>  		if (isrc->is_handlers == 1) {
> +			isrc->is_domain = domain;
>  			isrc->is_pic->pic_enable_intr(isrc);
>  			isrc->is_pic->pic_enable_source(isrc);
>  		}
> @@ -507,14 +511,27 @@ DB_SHOW_COMMAND(irqs, db_show_irqs)
>   */
>  
>  cpuset_t intr_cpus = CPUSET_T_INITIALIZER(0x1);
> -static int current_cpu;
> +static int current_cpu[MAXMEMDOM];
>  
> +static void
> +intr_init_cpus(void)
> +{
> +	int i;
> +
> +	for (i = 0; i < vm_ndomains; i++) {
> +		current_cpu[i] = 0;
> +		if (!CPU_ISSET(current_cpu[i], &intr_cpus) ||
> +		    !CPU_ISSET(current_cpu[i], &cpuset_domain[i]))
> +			intr_next_cpu(i);
> +	}
> +}
> +
>  /*
>   * Return the CPU that the next interrupt source should use.  For now
>   * this just returns the next local APIC according to round-robin.
>   */
>  u_int
> -intr_next_cpu(void)
> +intr_next_cpu(int domain)
>  {
>  	u_int apic_id;
>  
> @@ -529,12 +546,13 @@ intr_next_cpu(void)
>  #endif
>  
>  	mtx_lock_spin(&icu_lock);
> -	apic_id = cpu_apic_ids[current_cpu];
> +	apic_id = cpu_apic_ids[current_cpu[domain]];
>  	do {
> -		current_cpu++;
> -		if (current_cpu > mp_maxid)
> -			current_cpu = 0;
> -	} while (!CPU_ISSET(current_cpu, &intr_cpus));
> +		current_cpu[domain]++;
> +		if (current_cpu[domain] > mp_maxid)
> +			current_cpu[domain] = 0;
> +	} while (!CPU_ISSET(current_cpu[domain], &intr_cpus) ||
> +	    !CPU_ISSET(current_cpu[domain], &cpuset_domain[domain]));
>  	mtx_unlock_spin(&icu_lock);
>  	return (apic_id);
>  }
> @@ -568,7 +586,18 @@ intr_add_cpu(u_int cpu)
>  	CPU_SET(cpu, &intr_cpus);
>  }
>  
> -#ifndef EARLY_AP_STARTUP
> +#ifdef EARLY_AP_STARTUP
> +static void
> +intr_smp_startup(void *arg __unused)
> +{
> +
> +	intr_init_cpus();
> +	return;
> +}
> +SYSINIT(intr_smp_startup, SI_SUB_SMP, SI_ORDER_SECOND, intr_smp_startup,
> +    NULL);
> +
> +#else
>  /*
>   * Distribute all the interrupt sources among the available CPUs once the
>   * AP's have been launched.
> @@ -580,6 +609,7 @@ intr_shuffle_irqs(void *arg __unused)
>  	u_int cpu;
>  	int i;
>  
> +	intr_init_cpus();
>  	/* Don't bother on UP. */
>  	if (mp_ncpus == 1)
>  		return;
> @@ -599,12 +629,12 @@ intr_shuffle_irqs(void *arg __unused)
>  			 */
>  			cpu = isrc->is_event->ie_cpu;
>  			if (cpu == NOCPU)
> -				cpu = current_cpu;
> +				cpu = current_cpu[isrc->is_domain];
>  			if (isrc->is_pic->pic_assign_cpu(isrc,
>  			    cpu_apic_ids[cpu]) == 0) {
>  				isrc->is_cpu = cpu;
>  				if (isrc->is_event->ie_cpu == NOCPU)
> -					intr_next_cpu();
> +					intr_next_cpu(isrc->is_domain);
>  			}
>  		}
>  	}
> @@ -635,10 +665,11 @@ sysctl_hw_intrs(SYSCTL_HANDLER_ARGS)
>  		isrc = interrupt_sources[i];
>  		if (isrc == NULL)
>  			continue;
> -		sbuf_printf(&sbuf, "%s:%d @%d: %ld\n",
> +		sbuf_printf(&sbuf, "%s:%d @cpu%d(domain%d): %ld\n",
>  		    isrc->is_event->ie_fullname,
>  		    isrc->is_index,
>  		    isrc->is_cpu,
> +		    isrc->is_domain,
>  		    *isrc->is_count);
>  	}
>  
> @@ -697,7 +728,7 @@ intr_balance(void *dummy __unused, int pending __unuse
>  	 * Restart the scan from the same location to avoid moving in the
>  	 * common case.
>  	 */
> -	current_cpu = 0;
> +	intr_init_cpus();
>  
>  	/*
>  	 * Assign round-robin from most loaded to least.
> @@ -706,8 +737,8 @@ intr_balance(void *dummy __unused, int pending __unuse
>  		isrc = interrupt_sorted[i];
>  		if (isrc == NULL  || isrc->is_event->ie_cpu != NOCPU)
>  			continue;
> -		cpu = current_cpu;
> -		intr_next_cpu();
> +		cpu = current_cpu[isrc->is_domain];
> +		intr_next_cpu(isrc->is_domain);
>  		if (isrc->is_cpu != cpu &&
>  		    isrc->is_pic->pic_assign_cpu(isrc,
>  		    cpu_apic_ids[cpu]) == 0)
> @@ -735,7 +766,7 @@ SYSINIT(intr_balance_init, SI_SUB_SMP, SI_ORDER_ANY, i
>   * Always route interrupts to the current processor in the UP case.
>   */
>  u_int
> -intr_next_cpu(void)
> +intr_next_cpu(int domain)
>  {
>  
>  	return (PCPU_GET(apic_id));
> 
> Modified: head/sys/x86/x86/io_apic.c
> ==============================================================================
> --- head/sys/x86/x86/io_apic.c	Tue Mar 27 03:27:02 2018
> (r331605) +++ head/sys/x86/x86/io_apic.c	Tue Mar 27 03:37:04
> 2018	(r331606) @@ -499,7 +499,7 @@ ioapic_enable_intr(struct intsrc
> *isrc) struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc;
>  
>  	if (intpin->io_vector == 0)
> -		if (ioapic_assign_cpu(isrc, intr_next_cpu()) != 0)
> +		if (ioapic_assign_cpu(isrc,
> intr_next_cpu(isrc->is_domain)) != 0) panic("Couldn't find an APIC vector for
> IRQ %d", intpin->io_irq);
>  	apic_enable_vector(intpin->io_cpu, intpin->io_vector);
> 
> Modified: head/sys/x86/x86/msi.c
> ==============================================================================
> --- head/sys/x86/x86/msi.c	Tue Mar 27 03:27:02 2018	(r331605)
> +++ head/sys/x86/x86/msi.c	Tue Mar 27 03:37:04 2018	(r331606)
> @@ -363,7 +363,7 @@ int
>  msi_alloc(device_t dev, int count, int maxcount, int *irqs)
>  {
>  	struct msi_intsrc *msi, *fsrc;
> -	u_int cpu;
> +	u_int cpu, domain;
>  	int cnt, i, *mirqs, vector;
>  #ifdef ACPI_DMAR
>  	u_int cookies[count];
> @@ -373,6 +373,9 @@ msi_alloc(device_t dev, int count, int maxcount, int *
>  	if (!msi_enabled)
>  		return (ENXIO);
>  
> +	if (bus_get_domain(dev, &domain) != 0)
> +		domain = 0;
> +
>  	if (count > 1)
>  		mirqs = malloc(count * sizeof(*mirqs), M_MSI, M_WAITOK);
>  	else
> @@ -420,7 +423,7 @@ again:
>  	KASSERT(cnt == count, ("count mismatch"));
>  
>  	/* Allocate 'count' IDT vectors. */
> -	cpu = intr_next_cpu();
> +	cpu = intr_next_cpu(domain);
>  	vector = apic_alloc_vectors(cpu, irqs, count, maxcount);
>  	if (vector == 0) {
>  		mtx_unlock(&msi_lock);
> @@ -610,7 +613,7 @@ int
>  msix_alloc(device_t dev, int *irq)
>  {
>  	struct msi_intsrc *msi;
> -	u_int cpu;
> +	u_int cpu, domain;
>  	int i, vector;
>  #ifdef ACPI_DMAR
>  	u_int cookie;
> @@ -620,6 +623,9 @@ msix_alloc(device_t dev, int *irq)
>  	if (!msi_enabled)
>  		return (ENXIO);
>  
> +	if (bus_get_domain(dev, &domain) != 0)
> +		domain = 0;
> +
>  again:
>  	mtx_lock(&msi_lock);
>  
> @@ -651,7 +657,7 @@ again:
>  	}
>  
>  	/* Allocate an IDT vector. */
> -	cpu = intr_next_cpu();
> +	cpu = intr_next_cpu(domain);
>  	vector = apic_alloc_vector(cpu, i);
>  	if (vector == 0) {
>  		mtx_unlock(&msi_lock);
> 
> Modified: head/sys/x86/x86/nexus.c
> ==============================================================================
> --- head/sys/x86/x86/nexus.c	Tue Mar 27 03:27:02 2018	(r331605)
> +++ head/sys/x86/x86/nexus.c	Tue Mar 27 03:37:04 2018	(r331606)
> @@ -573,7 +573,7 @@ nexus_setup_intr(device_t bus, device_t child, struct 
>  		 int flags, driver_filter_t filter, void (*ihand)(void *),
>  		 void *arg, void **cookiep)
>  {
> -	int		error;
> +	int		error, domain;
>  
>  	/* somebody tried to setup an irq that failed to allocate! */
>  	if (irq == NULL)
> @@ -589,9 +589,11 @@ nexus_setup_intr(device_t bus, device_t child, struct 
>  	error = rman_activate_resource(irq);
>  	if (error)
>  		return (error);
> +	if (bus_get_domain(child, &domain) != 0)
> +		domain = 0;
>  
>  	error = intr_add_handler(device_get_nameunit(child),
> -	    rman_get_start(irq), filter, ihand, arg, flags, cookiep);
> +	    rman_get_start(irq), filter, ihand, arg, flags, cookiep, domain);
>  
>  	return (error);
>  }
> 
> Modified: head/sys/x86/xen/xen_intr.c
> ==============================================================================
> --- head/sys/x86/xen/xen_intr.c	Tue Mar 27 03:27:02 2018
> (r331605) +++ head/sys/x86/xen/xen_intr.c	Tue Mar 27 03:37:04
> 2018	(r331606) @@ -430,7 +430,7 @@ xen_intr_bind_isrc(struct xenisrc
> **isrcp, evtchn_port
>  		 * unless specified otherwise, so shuffle them to balance
>  		 * the interrupt load.
>  		 */
> -		xen_intr_assign_cpu(&isrc->xi_intsrc, intr_next_cpu());
> +		xen_intr_assign_cpu(&isrc->xi_intsrc, intr_next_cpu(0));
>  	}
>  #endif
>  
> @@ -1562,7 +1562,7 @@ xen_intr_add_handler(const char *name, driver_filter_t
>  		return (EINVAL);
>  
>  	error = intr_add_handler(name, isrc->xi_vector,filter, handler, arg,
> -	    flags|INTR_EXCL, &isrc->xi_cookie);
> +	    flags|INTR_EXCL, &isrc->xi_cookie, 0);
>  	if (error != 0) {
>  		printf(
>  		    "%s: xen_intr_add_handler: intr_add_handler failed:
> %d\n", _______________________________________________
> svn-src-head@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"

Has this been ever tested?

This commit makes ALL multi CPU systems I tested it on getting stuck on
detecting and reporting the physical and virtual (SMP) CPUs on all boxes.

Boot process is then stuck forever.

Kind regards

oh

From owner-svn-src-head@freebsd.org  Tue Mar 27 06:32:11 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF417F538FE;
 Tue, 27 Mar 2018 06:32:10 +0000 (UTC)
 (envelope-from o.hartmann@walstatt.org)
Received: from mout.gmx.net (mout.gmx.net [212.227.15.15])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3CE3C70AEB;
 Tue, 27 Mar 2018 06:32:10 +0000 (UTC)
 (envelope-from o.hartmann@walstatt.org)
Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by
 mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id
 0LvVYZ-1eaLkN0OlX-010e7z; Tue, 27 Mar 2018 08:26:52 +0200
Date: Tue, 27 Mar 2018 08:26:51 +0200
From: "O. Hartmann" 
Cc: Jeff Roberson , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r331606 - in head/sys: amd64/include i386/include
 x86/x86 x86/xen
Message-ID: <20180327082651.28258a8c@freyja.zeit4.iv.bundesimmobilien.de>
In-Reply-To: <20180327081535.0dacffcb@freyja.zeit4.iv.bundesimmobilien.de>
References: <201803270337.w2R3b4iv035285@repo.freebsd.org>
 <20180327081535.0dacffcb@freyja.zeit4.iv.bundesimmobilien.de>
Organization: Walstatt
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:vJ8wdcAw/BvXBIpJbhR7apMWcDwgOkK55thTQpLn1brhi+O5a9b
 jsk5T2HRvezauYzX7uVn3xXG/6EZrAkz4cKYEmvKDWsMv2Yos1tdctCPCIVgywLN0j9x073
 JmdkmZTuqccupjWf0n56vCxey09c6K6Qk0VP6IfaCj3fN9EnHaPOHolnSFj1LRzEn6ygcdw
 +dapFNqBMtsmlM8NpRAqw==
X-UI-Out-Filterresults: notjunk:1;V01:K0:VbJ0Iew+aJc=:62UIWDh7GHLPhlbY7MpjPN
 m4LPw7gyjbftXji7m2MM+uaQeHaATpoG6POpELRW5aaNXD/vBp7v4szpd0ixjDgZBYgqSwRbe
 UrIhbPe7TmrWbHd7YUxhb7frpyPBcEDIwoiMT9s7sfEPqIz/GSIkEYCWIPG/AY8NNyfVYH8Is
 aVG/guscP7rRPXKsrhQUhkyUM/Beidp19qh4lXy0Kcbg9v3X/f8XZ/w3SDQKzsKzViOKMbPHX
 76fqBNOHAXQpyo7sFn5BhG31DU28ck/1zJyjn6GCcihQeLjCtH66I+kv2aBHbLj+//02OY/Eo
 efse8vDEdsmxes8padF5DNtwKGTYpSgcktWS4k2WdKfkDgxn9xmxJMNgmjSi81tcbxUCj1e6Y
 islKu4b/qpedCv6tec5pj9z3rt1JgOKwIUxrmz3J67fVSiXpXs5sv+mFA7WeJgoho5FG7w4G2
 CqH2fp/MA7lSX5FoomZekF1vWLFC/UMVaWcgxLOkLjpjyAA9q/yIWOc1vbPjh71/rKGrVtRce
 70mzqtWLXUGoV2aW6oMVN8yfp7U5c389zemt5u3BkH+l0T53yjTxNZ+PKHL8ZvIzxazRc05K1
 dFMwhvEE4gT6zqWYBY4velapiwsx5mQFwqmlFjZlzBamCxKAS8OwvVrkbYqmkDsYnjagbQsrF
 Qpr+Xir97s+6XPUfV2vWO3S23p7/s0OWvxkXSax01qxi3UQscYQHCokNU3kvJgD8fvK/x+mTL
 5Semmh5qPriE8VntEAK5MVgH7sTK2xZqEy86DU7j2gNchnQHG+HYjAH5rtvY1OqOxi0U+HK0n
 E/UFPKQmjPmz7Lumb1rCWAmzOK9W4T/F2SKQ9feIxsNIpSfAt8=
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 06:32:11 -0000

On Tue, 27 Mar 2018 08:15:35 +0200
"O. Hartmann"  wrote:

> On Tue, 27 Mar 2018 03:37:04 +0000 (UTC)
> Jeff Roberson  wrote:
> 
> > Author: jeff
> > Date: Tue Mar 27 03:37:04 2018
> > New Revision: 331606
> > URL: https://svnweb.freebsd.org/changeset/base/331606
> > 
> > Log:
> >   Only use CPUs in the domain the device is attached to for default
> >   assignment.  Device drivers are able to override the default assignment
> >   if they bind directly.  There are severe performance penalties for
> >   handling interrupts on remote CPUs and this should only be done in
> >   very controlled circumstances.
> >   
> >   Reviewed by:	jhb, kib
> >   Tested by:	pho (earlier version)
> >   Sponsored by:	Netflix, Dell/EMC Isilon
> >   Differential Revision:	https://reviews.freebsd.org/D14838
> > 
> > Modified:
> >   head/sys/amd64/include/intr_machdep.h
> >   head/sys/i386/include/intr_machdep.h
> >   head/sys/x86/x86/intr_machdep.c
> >   head/sys/x86/x86/io_apic.c
> >   head/sys/x86/x86/msi.c
> >   head/sys/x86/x86/nexus.c
> >   head/sys/x86/xen/xen_intr.c
> > 
> > Modified: head/sys/amd64/include/intr_machdep.h
> > ==============================================================================
> > --- head/sys/amd64/include/intr_machdep.h	Tue Mar 27 03:27:02
> > 2018	(r331605) +++ head/sys/amd64/include/intr_machdep.h	Tue
> > Mar 27 03:37:04 2018	(r331606) @@ -132,6 +132,7 @@ struct intsrc {
> >  	u_long *is_straycount;
> >  	u_int is_index;
> >  	u_int is_handlers;
> > +	u_int is_domain;
> >  	u_int is_cpu;
> >  };
> >  
> > @@ -168,7 +169,7 @@ void	intr_add_cpu(u_int cpu);
> >  #endif
> >  int	intr_add_handler(const char *name, int vector, driver_filter_t
> > filter, driver_intr_t handler, void *arg, enum intr_type flags, 
> > -			 void **cookiep);    
> > +			 void **cookiep, int domain);    
> >  #ifdef SMP
> >  int	intr_bind(u_int vector, u_char cpu);
> >  #endif
> > @@ -176,7 +177,7 @@ int	intr_config_intr(int vector, enum
> > intr_trigger tri enum intr_polarity pol);
> >  int	intr_describe(u_int vector, void *ih, const char *descr);
> >  void	intr_execute_handlers(struct intsrc *isrc, struct trapframe
> > *frame); -u_int	intr_next_cpu(void);
> > +u_int	intr_next_cpu(int domain);
> >  struct intsrc *intr_lookup_source(int vector);
> >  int	intr_register_pic(struct pic *pic);
> >  int	intr_register_source(struct intsrc *isrc);
> > 
> > Modified: head/sys/i386/include/intr_machdep.h
> > ==============================================================================
> > --- head/sys/i386/include/intr_machdep.h	Tue Mar 27 03:27:02
> > 2018	(r331605) +++ head/sys/i386/include/intr_machdep.h	Tue
> > Mar 27 03:37:04 2018	(r331606) @@ -132,6 +132,7 @@ struct intsrc {
> >  	u_long *is_straycount;
> >  	u_int is_index;
> >  	u_int is_handlers;
> > +	u_int is_domain;
> >  	u_int is_cpu;
> >  };
> >  
> > @@ -158,7 +159,8 @@ void	elcr_write_trigger(u_int irq, enum
> > intr_trigger t void	intr_add_cpu(u_int cpu);
> >  #endif
> >  int	intr_add_handler(const char *name, int vector, driver_filter_t
> > filter,
> > -    driver_intr_t handler, void *arg, enum intr_type flags, void
> > **cookiep);
> > +    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep,
> > +    int domain);
> >  #ifdef SMP
> >  int	intr_bind(u_int vector, u_char cpu);
> >  #endif
> > @@ -166,7 +168,7 @@ int	intr_config_intr(int vector, enum
> > intr_trigger tri enum intr_polarity pol);
> >  int	intr_describe(u_int vector, void *ih, const char *descr);
> >  void	intr_execute_handlers(struct intsrc *isrc, struct trapframe
> > *frame); -u_int	intr_next_cpu(void);
> > +u_int	intr_next_cpu(int domain);
> >  struct intsrc *intr_lookup_source(int vector);
> >  int	intr_register_pic(struct pic *pic);
> >  int	intr_register_source(struct intsrc *isrc);
> > 
> > Modified: head/sys/x86/x86/intr_machdep.c
> > ==============================================================================
> > --- head/sys/x86/x86/intr_machdep.c	Tue Mar 27 03:27:02 2018
> > (r331605) +++ head/sys/x86/x86/intr_machdep.c	Tue Mar 27 03:37:04
> > 2018	(r331606) @@ -71,6 +71,8 @@
> >  #include 
> >  #endif
> >  
> > +#include 
> > +
> >  #define	MAX_STRAY_LOG	5
> >  
> >  typedef void (*mask_fn)(void *);
> > @@ -185,7 +187,8 @@ intr_lookup_source(int vector)
> >  
> >  int
> >  intr_add_handler(const char *name, int vector, driver_filter_t filter,
> > -    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep)
> > +    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep,
> > +    int domain)
> >  {
> >  	struct intsrc *isrc;
> >  	int error;
> > @@ -200,6 +203,7 @@ intr_add_handler(const char *name, int vector, driver_
> >  		intrcnt_updatename(isrc);
> >  		isrc->is_handlers++;
> >  		if (isrc->is_handlers == 1) {
> > +			isrc->is_domain = domain;
> >  			isrc->is_pic->pic_enable_intr(isrc);
> >  			isrc->is_pic->pic_enable_source(isrc);
> >  		}
> > @@ -507,14 +511,27 @@ DB_SHOW_COMMAND(irqs, db_show_irqs)
> >   */
> >  
> >  cpuset_t intr_cpus = CPUSET_T_INITIALIZER(0x1);
> > -static int current_cpu;
> > +static int current_cpu[MAXMEMDOM];
> >  
> > +static void
> > +intr_init_cpus(void)
> > +{
> > +	int i;
> > +
> > +	for (i = 0; i < vm_ndomains; i++) {
> > +		current_cpu[i] = 0;
> > +		if (!CPU_ISSET(current_cpu[i], &intr_cpus) ||
> > +		    !CPU_ISSET(current_cpu[i], &cpuset_domain[i]))
> > +			intr_next_cpu(i);
> > +	}
> > +}
> > +
> >  /*
> >   * Return the CPU that the next interrupt source should use.  For now
> >   * this just returns the next local APIC according to round-robin.
> >   */
> >  u_int
> > -intr_next_cpu(void)
> > +intr_next_cpu(int domain)
> >  {
> >  	u_int apic_id;
> >  
> > @@ -529,12 +546,13 @@ intr_next_cpu(void)
> >  #endif
> >  
> >  	mtx_lock_spin(&icu_lock);
> > -	apic_id = cpu_apic_ids[current_cpu];
> > +	apic_id = cpu_apic_ids[current_cpu[domain]];
> >  	do {
> > -		current_cpu++;
> > -		if (current_cpu > mp_maxid)
> > -			current_cpu = 0;
> > -	} while (!CPU_ISSET(current_cpu, &intr_cpus));
> > +		current_cpu[domain]++;
> > +		if (current_cpu[domain] > mp_maxid)
> > +			current_cpu[domain] = 0;
> > +	} while (!CPU_ISSET(current_cpu[domain], &intr_cpus) ||
> > +	    !CPU_ISSET(current_cpu[domain], &cpuset_domain[domain]));
> >  	mtx_unlock_spin(&icu_lock);
> >  	return (apic_id);
> >  }
> > @@ -568,7 +586,18 @@ intr_add_cpu(u_int cpu)
> >  	CPU_SET(cpu, &intr_cpus);
> >  }
> >  
> > -#ifndef EARLY_AP_STARTUP
> > +#ifdef EARLY_AP_STARTUP
> > +static void
> > +intr_smp_startup(void *arg __unused)
> > +{
> > +
> > +	intr_init_cpus();
> > +	return;
> > +}
> > +SYSINIT(intr_smp_startup, SI_SUB_SMP, SI_ORDER_SECOND, intr_smp_startup,
> > +    NULL);
> > +
> > +#else
> >  /*
> >   * Distribute all the interrupt sources among the available CPUs once the
> >   * AP's have been launched.
> > @@ -580,6 +609,7 @@ intr_shuffle_irqs(void *arg __unused)
> >  	u_int cpu;
> >  	int i;
> >  
> > +	intr_init_cpus();
> >  	/* Don't bother on UP. */
> >  	if (mp_ncpus == 1)
> >  		return;
> > @@ -599,12 +629,12 @@ intr_shuffle_irqs(void *arg __unused)
> >  			 */
> >  			cpu = isrc->is_event->ie_cpu;
> >  			if (cpu == NOCPU)
> > -				cpu = current_cpu;
> > +				cpu = current_cpu[isrc->is_domain];
> >  			if (isrc->is_pic->pic_assign_cpu(isrc,
> >  			    cpu_apic_ids[cpu]) == 0) {
> >  				isrc->is_cpu = cpu;
> >  				if (isrc->is_event->ie_cpu == NOCPU)
> > -					intr_next_cpu();
> > +					intr_next_cpu(isrc->is_domain);
> >  			}
> >  		}
> >  	}
> > @@ -635,10 +665,11 @@ sysctl_hw_intrs(SYSCTL_HANDLER_ARGS)
> >  		isrc = interrupt_sources[i];
> >  		if (isrc == NULL)
> >  			continue;
> > -		sbuf_printf(&sbuf, "%s:%d @%d: %ld\n",
> > +		sbuf_printf(&sbuf, "%s:%d @cpu%d(domain%d): %ld\n",
> >  		    isrc->is_event->ie_fullname,
> >  		    isrc->is_index,
> >  		    isrc->is_cpu,
> > +		    isrc->is_domain,
> >  		    *isrc->is_count);
> >  	}
> >  
> > @@ -697,7 +728,7 @@ intr_balance(void *dummy __unused, int pending __unuse
> >  	 * Restart the scan from the same location to avoid moving in the
> >  	 * common case.
> >  	 */
> > -	current_cpu = 0;
> > +	intr_init_cpus();
> >  
> >  	/*
> >  	 * Assign round-robin from most loaded to least.
> > @@ -706,8 +737,8 @@ intr_balance(void *dummy __unused, int pending __unuse
> >  		isrc = interrupt_sorted[i];
> >  		if (isrc == NULL  || isrc->is_event->ie_cpu != NOCPU)
> >  			continue;
> > -		cpu = current_cpu;
> > -		intr_next_cpu();
> > +		cpu = current_cpu[isrc->is_domain];
> > +		intr_next_cpu(isrc->is_domain);
> >  		if (isrc->is_cpu != cpu &&
> >  		    isrc->is_pic->pic_assign_cpu(isrc,
> >  		    cpu_apic_ids[cpu]) == 0)
> > @@ -735,7 +766,7 @@ SYSINIT(intr_balance_init, SI_SUB_SMP, SI_ORDER_ANY, i
> >   * Always route interrupts to the current processor in the UP case.
> >   */
> >  u_int
> > -intr_next_cpu(void)
> > +intr_next_cpu(int domain)
> >  {
> >  
> >  	return (PCPU_GET(apic_id));
> > 
> > Modified: head/sys/x86/x86/io_apic.c
> > ==============================================================================
> > --- head/sys/x86/x86/io_apic.c	Tue Mar 27 03:27:02 2018
> > (r331605) +++ head/sys/x86/x86/io_apic.c	Tue Mar 27 03:37:04
> > 2018	(r331606) @@ -499,7 +499,7 @@ ioapic_enable_intr(struct intsrc
> > *isrc) struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc;
> >  
> >  	if (intpin->io_vector == 0)
> > -		if (ioapic_assign_cpu(isrc, intr_next_cpu()) != 0)
> > +		if (ioapic_assign_cpu(isrc,
> > intr_next_cpu(isrc->is_domain)) != 0) panic("Couldn't find an APIC vector
> > for IRQ %d", intpin->io_irq);
> >  	apic_enable_vector(intpin->io_cpu, intpin->io_vector);
> > 
> > Modified: head/sys/x86/x86/msi.c
> > ==============================================================================
> > --- head/sys/x86/x86/msi.c	Tue Mar 27 03:27:02 2018	(r331605)
> > +++ head/sys/x86/x86/msi.c	Tue Mar 27 03:37:04 2018	(r331606)
> > @@ -363,7 +363,7 @@ int
> >  msi_alloc(device_t dev, int count, int maxcount, int *irqs)
> >  {
> >  	struct msi_intsrc *msi, *fsrc;
> > -	u_int cpu;
> > +	u_int cpu, domain;
> >  	int cnt, i, *mirqs, vector;
> >  #ifdef ACPI_DMAR
> >  	u_int cookies[count];
> > @@ -373,6 +373,9 @@ msi_alloc(device_t dev, int count, int maxcount, int *
> >  	if (!msi_enabled)
> >  		return (ENXIO);
> >  
> > +	if (bus_get_domain(dev, &domain) != 0)
> > +		domain = 0;
> > +
> >  	if (count > 1)
> >  		mirqs = malloc(count * sizeof(*mirqs), M_MSI, M_WAITOK);
> >  	else
> > @@ -420,7 +423,7 @@ again:
> >  	KASSERT(cnt == count, ("count mismatch"));
> >  
> >  	/* Allocate 'count' IDT vectors. */
> > -	cpu = intr_next_cpu();
> > +	cpu = intr_next_cpu(domain);
> >  	vector = apic_alloc_vectors(cpu, irqs, count, maxcount);
> >  	if (vector == 0) {
> >  		mtx_unlock(&msi_lock);
> > @@ -610,7 +613,7 @@ int
> >  msix_alloc(device_t dev, int *irq)
> >  {
> >  	struct msi_intsrc *msi;
> > -	u_int cpu;
> > +	u_int cpu, domain;
> >  	int i, vector;
> >  #ifdef ACPI_DMAR
> >  	u_int cookie;
> > @@ -620,6 +623,9 @@ msix_alloc(device_t dev, int *irq)
> >  	if (!msi_enabled)
> >  		return (ENXIO);
> >  
> > +	if (bus_get_domain(dev, &domain) != 0)
> > +		domain = 0;
> > +
> >  again:
> >  	mtx_lock(&msi_lock);
> >  
> > @@ -651,7 +657,7 @@ again:
> >  	}
> >  
> >  	/* Allocate an IDT vector. */
> > -	cpu = intr_next_cpu();
> > +	cpu = intr_next_cpu(domain);
> >  	vector = apic_alloc_vector(cpu, i);
> >  	if (vector == 0) {
> >  		mtx_unlock(&msi_lock);
> > 
> > Modified: head/sys/x86/x86/nexus.c
> > ==============================================================================
> > --- head/sys/x86/x86/nexus.c	Tue Mar 27 03:27:02 2018
> > (r331605) +++ head/sys/x86/x86/nexus.c	Tue Mar 27 03:37:04
> > 2018	(r331606) @@ -573,7 +573,7 @@ nexus_setup_intr(device_t bus,
> > device_t child, struct int flags, driver_filter_t filter, void
> > (*ihand)(void *), void *arg, void **cookiep)
> >  {
> > -	int		error;
> > +	int		error, domain;
> >  
> >  	/* somebody tried to setup an irq that failed to allocate! */
> >  	if (irq == NULL)
> > @@ -589,9 +589,11 @@ nexus_setup_intr(device_t bus, device_t child, struct 
> >  	error = rman_activate_resource(irq);
> >  	if (error)
> >  		return (error);
> > +	if (bus_get_domain(child, &domain) != 0)
> > +		domain = 0;
> >  
> >  	error = intr_add_handler(device_get_nameunit(child),
> > -	    rman_get_start(irq), filter, ihand, arg, flags, cookiep);
> > +	    rman_get_start(irq), filter, ihand, arg, flags, cookiep,
> > domain); 
> >  	return (error);
> >  }
> > 
> > Modified: head/sys/x86/xen/xen_intr.c
> > ==============================================================================
> > --- head/sys/x86/xen/xen_intr.c	Tue Mar 27 03:27:02 2018
> > (r331605) +++ head/sys/x86/xen/xen_intr.c	Tue Mar 27 03:37:04
> > 2018	(r331606) @@ -430,7 +430,7 @@ xen_intr_bind_isrc(struct xenisrc
> > **isrcp, evtchn_port
> >  		 * unless specified otherwise, so shuffle them to balance
> >  		 * the interrupt load.
> >  		 */
> > -		xen_intr_assign_cpu(&isrc->xi_intsrc, intr_next_cpu());
> > +		xen_intr_assign_cpu(&isrc->xi_intsrc, intr_next_cpu(0));
> >  	}
> >  #endif
> >  
> > @@ -1562,7 +1562,7 @@ xen_intr_add_handler(const char *name, driver_filter_t
> >  		return (EINVAL);
> >  
> >  	error = intr_add_handler(name, isrc->xi_vector,filter, handler,
> > arg,
> > -	    flags|INTR_EXCL, &isrc->xi_cookie);
> > +	    flags|INTR_EXCL, &isrc->xi_cookie, 0);
> >  	if (error != 0) {
> >  		printf(
> >  		    "%s: xen_intr_add_handler: intr_add_handler failed:
> > %d\n", _______________________________________________
> > svn-src-head@freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/svn-src-head
> > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"  
> 
> Has this been ever tested?
> 
> This commit makes ALL multi CPU systems I tested it on getting stuck on
> detecting and reporting the physical and virtual (SMP) CPUs on all boxes.
> 
> Boot process is then stuck forever.
> 
> Kind regards
> 
> oh
> _______________________________________________
> svn-src-head@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"


Reverting to r331605 solves booting failure.

From owner-svn-src-head@freebsd.org  Tue Mar 27 06:33:03 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70672F53B44;
 Tue, 27 Mar 2018 06:33:03 +0000 (UTC) (envelope-from mp@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 1E77270C9F;
 Tue, 27 Mar 2018 06:33:03 +0000 (UTC) (envelope-from mp@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1951318619;
 Tue, 27 Mar 2018 06:33:03 +0000 (UTC) (envelope-from mp@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2R6X3iS024388;
 Tue, 27 Mar 2018 06:33:03 GMT (envelope-from mp@FreeBSD.org)
Received: (from mp@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2R6X0Vh024356;
 Tue, 27 Mar 2018 06:33:00 GMT (envelope-from mp@FreeBSD.org)
Message-Id: <201803270633.w2R6X0Vh024356@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mp set sender to mp@FreeBSD.org
 using -f
From: Mark Peek 
Date: Tue, 27 Mar 2018 06:33:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331609 - in head: share/man/man4 sys/dev/vmware/vmci
 sys/modules/vmware/vmci
X-SVN-Group: head
X-SVN-Commit-Author: mp
X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/vmware/vmci
 sys/modules/vmware/vmci
X-SVN-Commit-Revision: 331609
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 06:33:03 -0000

Author: mp
Date: Tue Mar 27 06:33:00 2018
New Revision: 331609
URL: https://svnweb.freebsd.org/changeset/base/331609

Log:
  Rectify VMCI SPDX license
  
  Approved by: Vishnu Dasa 

Modified:
  head/share/man/man4/vmci.4
  head/sys/dev/vmware/vmci/vmci.c
  head/sys/dev/vmware/vmci/vmci.h
  head/sys/dev/vmware/vmci/vmci_call_defs.h
  head/sys/dev/vmware/vmci/vmci_datagram.c
  head/sys/dev/vmware/vmci/vmci_datagram.h
  head/sys/dev/vmware/vmci/vmci_defs.h
  head/sys/dev/vmware/vmci/vmci_doorbell.c
  head/sys/dev/vmware/vmci/vmci_doorbell.h
  head/sys/dev/vmware/vmci/vmci_driver.c
  head/sys/dev/vmware/vmci/vmci_driver.h
  head/sys/dev/vmware/vmci/vmci_event.c
  head/sys/dev/vmware/vmci/vmci_event.h
  head/sys/dev/vmware/vmci/vmci_hashtable.c
  head/sys/dev/vmware/vmci/vmci_hashtable.h
  head/sys/dev/vmware/vmci/vmci_kernel_api.h
  head/sys/dev/vmware/vmci/vmci_kernel_api_1.h
  head/sys/dev/vmware/vmci/vmci_kernel_api_2.h
  head/sys/dev/vmware/vmci/vmci_kernel_defs.h
  head/sys/dev/vmware/vmci/vmci_kernel_if.c
  head/sys/dev/vmware/vmci/vmci_kernel_if.h
  head/sys/dev/vmware/vmci/vmci_qpair.c
  head/sys/dev/vmware/vmci/vmci_queue.h
  head/sys/dev/vmware/vmci/vmci_queue_pair.c
  head/sys/dev/vmware/vmci/vmci_queue_pair.h
  head/sys/dev/vmware/vmci/vmci_resource.c
  head/sys/dev/vmware/vmci/vmci_resource.h
  head/sys/dev/vmware/vmci/vmci_utils.h
  head/sys/modules/vmware/vmci/Makefile

Modified: head/share/man/man4/vmci.4
==============================================================================
--- head/share/man/man4/vmci.4	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/share/man/man4/vmci.4	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,6 +1,6 @@
 .\" Copyright (c) 2018 VMware, Inc. All Rights Reserved.
 .\"
-.\" SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+.\" SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
 .\"
 .\" $FreeBSD$
 .Dd February 10, 2018

Modified: head/sys/dev/vmware/vmci/vmci.c
==============================================================================
--- head/sys/dev/vmware/vmci/vmci.c	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci.c	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  */
 
 /* Driver for VMware Virtual Machine Communication Interface (VMCI) device. */

Modified: head/sys/dev/vmware/vmci/vmci.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_call_defs.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_call_defs.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_call_defs.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_datagram.c
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_datagram.c	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_datagram.c	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  */
 
 /* This file implements the VMCI Simple Datagram API on the host. */

Modified: head/sys/dev/vmware/vmci/vmci_datagram.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_datagram.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_datagram.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_defs.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_defs.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_defs.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_doorbell.c
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_doorbell.c	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_doorbell.c	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  */
 
 /* This file implements the VMCI doorbell API. */

Modified: head/sys/dev/vmware/vmci/vmci_doorbell.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_doorbell.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_doorbell.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_driver.c
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_driver.c	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_driver.c	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  */
 
 /* VMCI initialization. */

Modified: head/sys/dev/vmware/vmci/vmci_driver.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_driver.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_driver.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_event.c
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_event.c	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_event.c	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  */
 
 /* This file implements VMCI Event code. */

Modified: head/sys/dev/vmware/vmci/vmci_event.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_event.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_event.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_hashtable.c
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_hashtable.c	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_hashtable.c	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  */
 
 /* Implementation of the VMCI Hashtable. */

Modified: head/sys/dev/vmware/vmci/vmci_hashtable.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_hashtable.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_hashtable.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_kernel_api.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_kernel_api.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_kernel_api.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_kernel_api_1.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_kernel_api_1.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_kernel_api_1.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_kernel_api_2.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_kernel_api_2.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_kernel_api_2.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_kernel_defs.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_kernel_defs.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_kernel_defs.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_kernel_if.c
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_kernel_if.c	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_kernel_if.c	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  */
 
 /* This file implements defines and helper functions. */

Modified: head/sys/dev/vmware/vmci/vmci_kernel_if.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_kernel_if.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_kernel_if.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_qpair.c
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_qpair.c	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_qpair.c	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  */
 
 /* This file implements Queue accessor methods. */

Modified: head/sys/dev/vmware/vmci/vmci_queue.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_queue.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_queue.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_queue_pair.c
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_queue_pair.c	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_queue_pair.c	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  */
 
 /* VMCI QueuePair API implementation. */

Modified: head/sys/dev/vmware/vmci/vmci_queue_pair.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_queue_pair.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_queue_pair.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_resource.c
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_resource.c	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_resource.c	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  */
 
 /* Implementation of the VMCI Resource Access Control API. */

Modified: head/sys/dev/vmware/vmci/vmci_resource.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_resource.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_resource.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/dev/vmware/vmci/vmci_utils.h
==============================================================================
--- head/sys/dev/vmware/vmci/vmci_utils.h	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/dev/vmware/vmci/vmci_utils.h	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 /*-
  * Copyright (c) 2018 VMware, Inc. All Rights Reserved.
  *
- * SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+ * SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
  *
  * $FreeBSD$
  */

Modified: head/sys/modules/vmware/vmci/Makefile
==============================================================================
--- head/sys/modules/vmware/vmci/Makefile	Tue Mar 27 05:33:44 2018	(r331608)
+++ head/sys/modules/vmware/vmci/Makefile	Tue Mar 27 06:33:00 2018	(r331609)
@@ -1,7 +1,7 @@
 #
 # Copyright (c) 2018 VMware, Inc. All Rights Reserved.
 #
-# SPDX-License-Identifier: (BSD-2-Clause AND GPL-2.0)
+# SPDX-License-Identifier: (BSD-2-Clause OR GPL-2.0)
 #
 # $FreeBSD$
 

From owner-svn-src-head@freebsd.org  Tue Mar 27 06:36:21 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45B66F5403F
 for ;
 Tue, 27 Mar 2018 06:36:21 +0000 (UTC)
 (envelope-from jroberson@jroberson.net)
Received: from mail-io0-x242.google.com (mail-io0-x242.google.com
 [IPv6:2607:f8b0:4001:c06::242])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id C1DDD70F27
 for ; Tue, 27 Mar 2018 06:36:20 +0000 (UTC)
 (envelope-from jroberson@jroberson.net)
Received: by mail-io0-x242.google.com with SMTP id d7so10822900ioc.11
 for ; Mon, 26 Mar 2018 23:36:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=jroberson-net.20150623.gappssmtp.com; s=20150623;
 h=date:from:to:cc:subject:in-reply-to:message-id:references
 :user-agent:mime-version;
 bh=tlK8mbPfeZntgUFN/VaFzZzTnQk4sbOrQRuBOjbKgME=;
 b=vO3Y1R692kus/SYr3KKepluEfC3vx4JmQ1HENZ1USrFS6T8Zi7Wwghig+35DJygu3M
 vO6tukMwmtD6ZBZBNLEcFxUWNc/J2HqcXTGecldMZNSoXYsb+0a4zDateCDLMRO0NyAO
 TnUYn90fVfnZGEvEmtyMyMmAqaZiK2fFuVojj91AOEU1rkn1W2sCI11Tfmr7zinf7Z5O
 x3DGboy6TZE5onbwFaV/tQXixmsxTylmYvGpYIbev4JUgJdyK9xxUTviJO6mhRtWu7D1
 AokayYAcZDkXznX+Tux48QU0XMlb/smu+uk4CrrTY1Hu3AK9pSBKwkpVjsUYXgAezwGh
 tYrg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id
 :references:user-agent:mime-version;
 bh=tlK8mbPfeZntgUFN/VaFzZzTnQk4sbOrQRuBOjbKgME=;
 b=d5OEjYGHJDxxyAkPgKZlS6UgyJiOn+qWHrvwn67AaNiz7z36FPI7XuhAM9y0DZ4NQh
 e8L0fUzesaPwHupfbFQVk9QWhcW2cxu1LwIqzKi3uL6l46dNLQb6oa+MqIJMjzLnjbtv
 iOlL6g1KM6iuuOEFD7YWSaFB3bufB7uuuvFPM4FAuSylM0oe1Rd4QE1ocja3T5Ef5FF6
 pPocFdsWMfHpDDMFSYREvKuwfrI3iekj8iDFoI8VRw8V2e3oMyW/Yh9nnAHPFhsctjEc
 5gbiPkgSQVlsKLjkhxz52w3jswY4/ki0kFwNsJnEWAbIbtfqNNP3FtIQgiu2sxeSOIgn
 Igag==
X-Gm-Message-State: AElRT7E3zIOunuFGP7Z6v0NFTWVlqS+Zc9OeW/iSSjlHM2hovWRK2QzP
 j8r1pKZteNshz1nRjLc3/UyLzg==
X-Google-Smtp-Source: AG47ELvWnRxkBZhaYulL4pAkMIwIMWZ3byhNqepl+VpcDE0of4v/RZMY5t+aDSkRpwJWeS3a9W6l6w==
X-Received: by 10.107.178.70 with SMTP id b67mr41063413iof.186.1522132579751; 
 Mon, 26 Mar 2018 23:36:19 -0700 (PDT)
Received: from rrcs-66-91-135-210.west.biz.rr.com
 (rrcs-66-91-135-210.west.biz.rr.com. [66.91.135.210])
 by smtp.gmail.com with ESMTPSA id b34-v6sm507008itd.12.2018.03.26.23.36.18
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Mon, 26 Mar 2018 23:36:19 -0700 (PDT)
Date: Mon, 26 Mar 2018 20:35:12 -1000 (HST)
From: Jeff Roberson 
X-X-Sender: jroberson@desktop
To: "O. Hartmann" 
cc: Jeff Roberson , svn-src-head@freebsd.org, 
 svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r331606 - in head/sys: amd64/include i386/include
 x86/x86 x86/xen
In-Reply-To: <20180327082651.28258a8c@freyja.zeit4.iv.bundesimmobilien.de>
Message-ID: 
References: <201803270337.w2R3b4iv035285@repo.freebsd.org>
 <20180327081535.0dacffcb@freyja.zeit4.iv.bundesimmobilien.de>
 <20180327082651.28258a8c@freyja.zeit4.iv.bundesimmobilien.de>
User-Agent: Alpine 2.21 (BSF 202 2017-01-01)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII; format=flowed
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 06:36:21 -0000

On Tue, 27 Mar 2018, O. Hartmann wrote:

> On Tue, 27 Mar 2018 08:15:35 +0200
> "O. Hartmann"  wrote:
>
>> On Tue, 27 Mar 2018 03:37:04 +0000 (UTC)
>> Jeff Roberson  wrote:
>>
>>> Author: jeff
>>> Date: Tue Mar 27 03:37:04 2018
>>> New Revision: 331606
>>> URL: https://svnweb.freebsd.org/changeset/base/331606
>>>
>>> Log:
>>>   Only use CPUs in the domain the device is attached to for default
>>>   assignment.  Device drivers are able to override the default assignment
>>>   if they bind directly.  There are severe performance penalties for
>>>   handling interrupts on remote CPUs and this should only be done in
>>>   very controlled circumstances.
>>>
>>>   Reviewed by:	jhb, kib
>>>   Tested by:	pho (earlier version)
>>>   Sponsored by:	Netflix, Dell/EMC Isilon
>>>   Differential Revision:	https://reviews.freebsd.org/D14838
>>>
>>> Modified:
>>>   head/sys/amd64/include/intr_machdep.h
>>>   head/sys/i386/include/intr_machdep.h
>>>   head/sys/x86/x86/intr_machdep.c
>>>   head/sys/x86/x86/io_apic.c
>>>   head/sys/x86/x86/msi.c
>>>   head/sys/x86/x86/nexus.c
>>>   head/sys/x86/xen/xen_intr.c
>>>
>>> Modified: head/sys/amd64/include/intr_machdep.h
>>> ==============================================================================
>>> --- head/sys/amd64/include/intr_machdep.h	Tue Mar 27 03:27:02
>>> 2018	(r331605) +++ head/sys/amd64/include/intr_machdep.h	Tue
>>> Mar 27 03:37:04 2018	(r331606) @@ -132,6 +132,7 @@ struct intsrc {
>>>  	u_long *is_straycount;
>>>  	u_int is_index;
>>>  	u_int is_handlers;
>>> +	u_int is_domain;
>>>  	u_int is_cpu;
>>>  };
>>>
>>> @@ -168,7 +169,7 @@ void	intr_add_cpu(u_int cpu);
>>>  #endif
>>>  int	intr_add_handler(const char *name, int vector, driver_filter_t
>>> filter, driver_intr_t handler, void *arg, enum intr_type flags,
>>> -			 void **cookiep);
>>> +			 void **cookiep, int domain);
>>>  #ifdef SMP
>>>  int	intr_bind(u_int vector, u_char cpu);
>>>  #endif
>>> @@ -176,7 +177,7 @@ int	intr_config_intr(int vector, enum
>>> intr_trigger tri enum intr_polarity pol);
>>>  int	intr_describe(u_int vector, void *ih, const char *descr);
>>>  void	intr_execute_handlers(struct intsrc *isrc, struct trapframe
>>> *frame); -u_int	intr_next_cpu(void);
>>> +u_int	intr_next_cpu(int domain);
>>>  struct intsrc *intr_lookup_source(int vector);
>>>  int	intr_register_pic(struct pic *pic);
>>>  int	intr_register_source(struct intsrc *isrc);
>>>
>>> Modified: head/sys/i386/include/intr_machdep.h
>>> ==============================================================================
>>> --- head/sys/i386/include/intr_machdep.h	Tue Mar 27 03:27:02
>>> 2018	(r331605) +++ head/sys/i386/include/intr_machdep.h	Tue
>>> Mar 27 03:37:04 2018	(r331606) @@ -132,6 +132,7 @@ struct intsrc {
>>>  	u_long *is_straycount;
>>>  	u_int is_index;
>>>  	u_int is_handlers;
>>> +	u_int is_domain;
>>>  	u_int is_cpu;
>>>  };
>>>
>>> @@ -158,7 +159,8 @@ void	elcr_write_trigger(u_int irq, enum
>>> intr_trigger t void	intr_add_cpu(u_int cpu);
>>>  #endif
>>>  int	intr_add_handler(const char *name, int vector, driver_filter_t
>>> filter,
>>> -    driver_intr_t handler, void *arg, enum intr_type flags, void
>>> **cookiep);
>>> +    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep,
>>> +    int domain);
>>>  #ifdef SMP
>>>  int	intr_bind(u_int vector, u_char cpu);
>>>  #endif
>>> @@ -166,7 +168,7 @@ int	intr_config_intr(int vector, enum
>>> intr_trigger tri enum intr_polarity pol);
>>>  int	intr_describe(u_int vector, void *ih, const char *descr);
>>>  void	intr_execute_handlers(struct intsrc *isrc, struct trapframe
>>> *frame); -u_int	intr_next_cpu(void);
>>> +u_int	intr_next_cpu(int domain);
>>>  struct intsrc *intr_lookup_source(int vector);
>>>  int	intr_register_pic(struct pic *pic);
>>>  int	intr_register_source(struct intsrc *isrc);
>>>
>>> Modified: head/sys/x86/x86/intr_machdep.c
>>> ==============================================================================
>>> --- head/sys/x86/x86/intr_machdep.c	Tue Mar 27 03:27:02 2018
>>> (r331605) +++ head/sys/x86/x86/intr_machdep.c	Tue Mar 27 03:37:04
>>> 2018	(r331606) @@ -71,6 +71,8 @@
>>>  #include 
>>>  #endif
>>>
>>> +#include 
>>> +
>>>  #define	MAX_STRAY_LOG	5
>>>
>>>  typedef void (*mask_fn)(void *);
>>> @@ -185,7 +187,8 @@ intr_lookup_source(int vector)
>>>
>>>  int
>>>  intr_add_handler(const char *name, int vector, driver_filter_t filter,
>>> -    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep)
>>> +    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep,
>>> +    int domain)
>>>  {
>>>  	struct intsrc *isrc;
>>>  	int error;
>>> @@ -200,6 +203,7 @@ intr_add_handler(const char *name, int vector, driver_
>>>  		intrcnt_updatename(isrc);
>>>  		isrc->is_handlers++;
>>>  		if (isrc->is_handlers == 1) {
>>> +			isrc->is_domain = domain;
>>>  			isrc->is_pic->pic_enable_intr(isrc);
>>>  			isrc->is_pic->pic_enable_source(isrc);
>>>  		}
>>> @@ -507,14 +511,27 @@ DB_SHOW_COMMAND(irqs, db_show_irqs)
>>>   */
>>>
>>>  cpuset_t intr_cpus = CPUSET_T_INITIALIZER(0x1);
>>> -static int current_cpu;
>>> +static int current_cpu[MAXMEMDOM];
>>>
>>> +static void
>>> +intr_init_cpus(void)
>>> +{
>>> +	int i;
>>> +
>>> +	for (i = 0; i < vm_ndomains; i++) {
>>> +		current_cpu[i] = 0;
>>> +		if (!CPU_ISSET(current_cpu[i], &intr_cpus) ||
>>> +		    !CPU_ISSET(current_cpu[i], &cpuset_domain[i]))
>>> +			intr_next_cpu(i);
>>> +	}
>>> +}
>>> +
>>>  /*
>>>   * Return the CPU that the next interrupt source should use.  For now
>>>   * this just returns the next local APIC according to round-robin.
>>>   */
>>>  u_int
>>> -intr_next_cpu(void)
>>> +intr_next_cpu(int domain)
>>>  {
>>>  	u_int apic_id;
>>>
>>> @@ -529,12 +546,13 @@ intr_next_cpu(void)
>>>  #endif
>>>
>>>  	mtx_lock_spin(&icu_lock);
>>> -	apic_id = cpu_apic_ids[current_cpu];
>>> +	apic_id = cpu_apic_ids[current_cpu[domain]];
>>>  	do {
>>> -		current_cpu++;
>>> -		if (current_cpu > mp_maxid)
>>> -			current_cpu = 0;
>>> -	} while (!CPU_ISSET(current_cpu, &intr_cpus));
>>> +		current_cpu[domain]++;
>>> +		if (current_cpu[domain] > mp_maxid)
>>> +			current_cpu[domain] = 0;
>>> +	} while (!CPU_ISSET(current_cpu[domain], &intr_cpus) ||
>>> +	    !CPU_ISSET(current_cpu[domain], &cpuset_domain[domain]));
>>>  	mtx_unlock_spin(&icu_lock);
>>>  	return (apic_id);
>>>  }
>>> @@ -568,7 +586,18 @@ intr_add_cpu(u_int cpu)
>>>  	CPU_SET(cpu, &intr_cpus);
>>>  }
>>>
>>> -#ifndef EARLY_AP_STARTUP
>>> +#ifdef EARLY_AP_STARTUP
>>> +static void
>>> +intr_smp_startup(void *arg __unused)
>>> +{
>>> +
>>> +	intr_init_cpus();
>>> +	return;
>>> +}
>>> +SYSINIT(intr_smp_startup, SI_SUB_SMP, SI_ORDER_SECOND, intr_smp_startup,
>>> +    NULL);
>>> +
>>> +#else
>>>  /*
>>>   * Distribute all the interrupt sources among the available CPUs once the
>>>   * AP's have been launched.
>>> @@ -580,6 +609,7 @@ intr_shuffle_irqs(void *arg __unused)
>>>  	u_int cpu;
>>>  	int i;
>>>
>>> +	intr_init_cpus();
>>>  	/* Don't bother on UP. */
>>>  	if (mp_ncpus == 1)
>>>  		return;
>>> @@ -599,12 +629,12 @@ intr_shuffle_irqs(void *arg __unused)
>>>  			 */
>>>  			cpu = isrc->is_event->ie_cpu;
>>>  			if (cpu == NOCPU)
>>> -				cpu = current_cpu;
>>> +				cpu = current_cpu[isrc->is_domain];
>>>  			if (isrc->is_pic->pic_assign_cpu(isrc,
>>>  			    cpu_apic_ids[cpu]) == 0) {
>>>  				isrc->is_cpu = cpu;
>>>  				if (isrc->is_event->ie_cpu == NOCPU)
>>> -					intr_next_cpu();
>>> +					intr_next_cpu(isrc->is_domain);
>>>  			}
>>>  		}
>>>  	}
>>> @@ -635,10 +665,11 @@ sysctl_hw_intrs(SYSCTL_HANDLER_ARGS)
>>>  		isrc = interrupt_sources[i];
>>>  		if (isrc == NULL)
>>>  			continue;
>>> -		sbuf_printf(&sbuf, "%s:%d @%d: %ld\n",
>>> +		sbuf_printf(&sbuf, "%s:%d @cpu%d(domain%d): %ld\n",
>>>  		    isrc->is_event->ie_fullname,
>>>  		    isrc->is_index,
>>>  		    isrc->is_cpu,
>>> +		    isrc->is_domain,
>>>  		    *isrc->is_count);
>>>  	}
>>>
>>> @@ -697,7 +728,7 @@ intr_balance(void *dummy __unused, int pending __unuse
>>>  	 * Restart the scan from the same location to avoid moving in the
>>>  	 * common case.
>>>  	 */
>>> -	current_cpu = 0;
>>> +	intr_init_cpus();
>>>
>>>  	/*
>>>  	 * Assign round-robin from most loaded to least.
>>> @@ -706,8 +737,8 @@ intr_balance(void *dummy __unused, int pending __unuse
>>>  		isrc = interrupt_sorted[i];
>>>  		if (isrc == NULL  || isrc->is_event->ie_cpu != NOCPU)
>>>  			continue;
>>> -		cpu = current_cpu;
>>> -		intr_next_cpu();
>>> +		cpu = current_cpu[isrc->is_domain];
>>> +		intr_next_cpu(isrc->is_domain);
>>>  		if (isrc->is_cpu != cpu &&
>>>  		    isrc->is_pic->pic_assign_cpu(isrc,
>>>  		    cpu_apic_ids[cpu]) == 0)
>>> @@ -735,7 +766,7 @@ SYSINIT(intr_balance_init, SI_SUB_SMP, SI_ORDER_ANY, i
>>>   * Always route interrupts to the current processor in the UP case.
>>>   */
>>>  u_int
>>> -intr_next_cpu(void)
>>> +intr_next_cpu(int domain)
>>>  {
>>>
>>>  	return (PCPU_GET(apic_id));
>>>
>>> Modified: head/sys/x86/x86/io_apic.c
>>> ==============================================================================
>>> --- head/sys/x86/x86/io_apic.c	Tue Mar 27 03:27:02 2018
>>> (r331605) +++ head/sys/x86/x86/io_apic.c	Tue Mar 27 03:37:04
>>> 2018	(r331606) @@ -499,7 +499,7 @@ ioapic_enable_intr(struct intsrc
>>> *isrc) struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc;
>>>
>>>  	if (intpin->io_vector == 0)
>>> -		if (ioapic_assign_cpu(isrc, intr_next_cpu()) != 0)
>>> +		if (ioapic_assign_cpu(isrc,
>>> intr_next_cpu(isrc->is_domain)) != 0) panic("Couldn't find an APIC vector
>>> for IRQ %d", intpin->io_irq);
>>>  	apic_enable_vector(intpin->io_cpu, intpin->io_vector);
>>>
>>> Modified: head/sys/x86/x86/msi.c
>>> ==============================================================================
>>> --- head/sys/x86/x86/msi.c	Tue Mar 27 03:27:02 2018	(r331605)
>>> +++ head/sys/x86/x86/msi.c	Tue Mar 27 03:37:04 2018	(r331606)
>>> @@ -363,7 +363,7 @@ int
>>>  msi_alloc(device_t dev, int count, int maxcount, int *irqs)
>>>  {
>>>  	struct msi_intsrc *msi, *fsrc;
>>> -	u_int cpu;
>>> +	u_int cpu, domain;
>>>  	int cnt, i, *mirqs, vector;
>>>  #ifdef ACPI_DMAR
>>>  	u_int cookies[count];
>>> @@ -373,6 +373,9 @@ msi_alloc(device_t dev, int count, int maxcount, int *
>>>  	if (!msi_enabled)
>>>  		return (ENXIO);
>>>
>>> +	if (bus_get_domain(dev, &domain) != 0)
>>> +		domain = 0;
>>> +
>>>  	if (count > 1)
>>>  		mirqs = malloc(count * sizeof(*mirqs), M_MSI, M_WAITOK);
>>>  	else
>>> @@ -420,7 +423,7 @@ again:
>>>  	KASSERT(cnt == count, ("count mismatch"));
>>>
>>>  	/* Allocate 'count' IDT vectors. */
>>> -	cpu = intr_next_cpu();
>>> +	cpu = intr_next_cpu(domain);
>>>  	vector = apic_alloc_vectors(cpu, irqs, count, maxcount);
>>>  	if (vector == 0) {
>>>  		mtx_unlock(&msi_lock);
>>> @@ -610,7 +613,7 @@ int
>>>  msix_alloc(device_t dev, int *irq)
>>>  {
>>>  	struct msi_intsrc *msi;
>>> -	u_int cpu;
>>> +	u_int cpu, domain;
>>>  	int i, vector;
>>>  #ifdef ACPI_DMAR
>>>  	u_int cookie;
>>> @@ -620,6 +623,9 @@ msix_alloc(device_t dev, int *irq)
>>>  	if (!msi_enabled)
>>>  		return (ENXIO);
>>>
>>> +	if (bus_get_domain(dev, &domain) != 0)
>>> +		domain = 0;
>>> +
>>>  again:
>>>  	mtx_lock(&msi_lock);
>>>
>>> @@ -651,7 +657,7 @@ again:
>>>  	}
>>>
>>>  	/* Allocate an IDT vector. */
>>> -	cpu = intr_next_cpu();
>>> +	cpu = intr_next_cpu(domain);
>>>  	vector = apic_alloc_vector(cpu, i);
>>>  	if (vector == 0) {
>>>  		mtx_unlock(&msi_lock);
>>>
>>> Modified: head/sys/x86/x86/nexus.c
>>> ==============================================================================
>>> --- head/sys/x86/x86/nexus.c	Tue Mar 27 03:27:02 2018
>>> (r331605) +++ head/sys/x86/x86/nexus.c	Tue Mar 27 03:37:04
>>> 2018	(r331606) @@ -573,7 +573,7 @@ nexus_setup_intr(device_t bus,
>>> device_t child, struct int flags, driver_filter_t filter, void
>>> (*ihand)(void *), void *arg, void **cookiep)
>>>  {
>>> -	int		error;
>>> +	int		error, domain;
>>>
>>>  	/* somebody tried to setup an irq that failed to allocate! */
>>>  	if (irq == NULL)
>>> @@ -589,9 +589,11 @@ nexus_setup_intr(device_t bus, device_t child, struct
>>>  	error = rman_activate_resource(irq);
>>>  	if (error)
>>>  		return (error);
>>> +	if (bus_get_domain(child, &domain) != 0)
>>> +		domain = 0;
>>>
>>>  	error = intr_add_handler(device_get_nameunit(child),
>>> -	    rman_get_start(irq), filter, ihand, arg, flags, cookiep);
>>> +	    rman_get_start(irq), filter, ihand, arg, flags, cookiep,
>>> domain);
>>>  	return (error);
>>>  }
>>>
>>> Modified: head/sys/x86/xen/xen_intr.c
>>> ==============================================================================
>>> --- head/sys/x86/xen/xen_intr.c	Tue Mar 27 03:27:02 2018
>>> (r331605) +++ head/sys/x86/xen/xen_intr.c	Tue Mar 27 03:37:04
>>> 2018	(r331606) @@ -430,7 +430,7 @@ xen_intr_bind_isrc(struct xenisrc
>>> **isrcp, evtchn_port
>>>  		 * unless specified otherwise, so shuffle them to balance
>>>  		 * the interrupt load.
>>>  		 */
>>> -		xen_intr_assign_cpu(&isrc->xi_intsrc, intr_next_cpu());
>>> +		xen_intr_assign_cpu(&isrc->xi_intsrc, intr_next_cpu(0));
>>>  	}
>>>  #endif
>>>
>>> @@ -1562,7 +1562,7 @@ xen_intr_add_handler(const char *name, driver_filter_t
>>>  		return (EINVAL);
>>>
>>>  	error = intr_add_handler(name, isrc->xi_vector,filter, handler,
>>> arg,
>>> -	    flags|INTR_EXCL, &isrc->xi_cookie);
>>> +	    flags|INTR_EXCL, &isrc->xi_cookie, 0);
>>>  	if (error != 0) {
>>>  		printf(
>>>  		    "%s: xen_intr_add_handler: intr_add_handler failed:
>>> %d\n", _______________________________________________
>>> svn-src-head@freebsd.org mailing list
>>> https://lists.freebsd.org/mailman/listinfo/svn-src-head
>>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"
>>
>> Has this been ever tested?
>>
>> This commit makes ALL multi CPU systems I tested it on getting stuck on
>> detecting and reporting the physical and virtual (SMP) CPUs on all boxes.
>>
>> Boot process is then stuck forever.
>>
>> Kind regards
>>
>> oh
>> _______________________________________________
>> svn-src-head@freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/svn-src-head
>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"
>
>
> Reverting to r331605 solves booting failure.
>

The patch has been on my branch for weeks and has been tested by a half 
dozen people.  I'm sorry it does not work for you.  If you reverted 331605 
the change that followed should not have built properly.  Did you build 
cleanly?  Can you share your kernel config?

I tried with and without EARLY_AP_STARTUP and with and without NUMA.  I'm 
not having any trouble booting.  Did you make cleandepend && make depend?

Thanks,
Jeff

From owner-svn-src-head@freebsd.org  Tue Mar 27 07:30:35 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24BA0F594A1;
 Tue, 27 Mar 2018 07:30:35 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au
 [211.29.132.80])
 by mx1.freebsd.org (Postfix) with ESMTP id 97188734FD;
 Tue, 27 Mar 2018 07:30:34 +0000 (UTC)
 (envelope-from brde@optusnet.com.au)
Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au
 [110.21.101.228])
 by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 843A3D76207;
 Tue, 27 Mar 2018 18:30:26 +1100 (AEDT)
Date: Tue, 27 Mar 2018 18:30:25 +1100 (EST)
From: Bruce Evans 
X-X-Sender: bde@besplex.bde.org
To: Jeff Roberson 
cc: src-committers@freebsd.org, svn-src-all@freebsd.org, 
 svn-src-head@freebsd.org
Subject: Re: svn commit: r331605 - head/sys/vm
In-Reply-To: <201803270327.w2R3R2f9030318@repo.freebsd.org>
Message-ID: <20180327173756.A876@besplex.bde.org>
References: <201803270327.w2R3R2f9030318@repo.freebsd.org>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
X-Optus-CM-Score: 0
X-Optus-CM-Analysis: v=2.2 cv=VJytp5HX c=1 sm=1 tr=0
 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17
 a=kj9zAlcOel0A:10 a=0HglesBrfFw4nKaTcNAA:9 a=CjuIK1q_8ugA:10
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 07:30:35 -0000

On Tue, 27 Mar 2018, Jeff Roberson wrote:

> Log:
>  Move vm_ndomains to vm.h where it can be used with a single header include
>  rather than requiring a half-dozen.  Many non-vm files may want to know
>  the number of valid domains.

Shouldn't it go in vm_extern.h?  What is the point of having vm_extern.h
if you don't declare extern variables in it?

Well, vm_extern.h contains (implicitly extern) prototypes but no externs
variables , so the main style bugs are actually its name and having
prototypes in vm.h instead if in vm_extern.h.

Extern variables should probably go in vm_extern.h too, leaving only
central type definitions and macros in vm.h, and vm_extern.h should
have been named vm_var.h.

There are mounds of other style bugs in vm.h and vm_extern.h.  vm.h was
almost correct in FreeBSD-4.  Then it had no prototypes, no namespace
pollution, and only minor style bugs like naming its include guard VM_H
(which is not namespace pollution since VM_* is reserved for other reasons).

> Modified: head/sys/vm/vm.h
> ==============================================================================
> --- head/sys/vm/vm.h	Tue Mar 27 01:02:42 2018	(r331604)
> +++ head/sys/vm/vm.h	Tue Mar 27 03:27:02 2018	(r331605)
> @@ -148,6 +148,8 @@ extern void vm_ksubmap_init(struct kva_md_info *);
>
> extern int old_mlock;

This is especially gratuitous namespace pollution.  The obj* names at
least have something to do with vm.

>
> +extern int vm_ndomains;
> +
> struct ucred;
> int swap_reserve(vm_ooffset_t incr);
> int swap_reserve_by_cred(vm_ooffset_t incr, struct ucred *cred);

swap_* also has something to do with vm, but needs a vm_ prefix more
for exporting out of vm.

Kernel prototypes don't belong here.  One reason they are supposed to
be in vm_extern.h is to keep them out of here so that userland can
include this without getting kernel prototypes and/or so this file
doesn't need so many ifdefs.

Parameter names in prototypes are documented as being kernel style in
style(9), but this is a bug in style(9).  This is optional, and old vm
prototypes in vm_extern.h don't do it.

Bruce

From owner-svn-src-head@freebsd.org  Tue Mar 27 08:45:24 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0756CF5FFAD;
 Tue, 27 Mar 2018 08:45:24 +0000 (UTC) (envelope-from hps@selasky.org)
Received: from mail.turbocat.net (turbocat.net [88.99.82.50])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9B60B76842;
 Tue, 27 Mar 2018 08:45:22 +0000 (UTC) (envelope-from hps@selasky.org)
Received: from hps2016.home.selasky.org (unknown [62.141.128.70])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by mail.turbocat.net (Postfix) with ESMTPSA id CA5E026027E;
 Tue, 27 Mar 2018 10:45:20 +0200 (CEST)
Subject: Re: svn commit: r331606 - in head/sys: amd64/include i386/include
 x86/x86 x86/xen
To: Jeff Roberson , src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
References: <201803270337.w2R3b4iv035285@repo.freebsd.org>
From: Hans Petter Selasky 
Message-ID: 
Date: Tue, 27 Mar 2018 10:45:15 +0200
User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101
 Thunderbird/52.6.0
MIME-Version: 1.0
In-Reply-To: <201803270337.w2R3b4iv035285@repo.freebsd.org>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 08:45:24 -0000

On 03/27/18 05:37, Jeff Roberson wrote:
>   	do {
> -		current_cpu++;
> -		if (current_cpu > mp_maxid)
> -			current_cpu = 0;
> -	} while (!CPU_ISSET(current_cpu, &intr_cpus));
> +		current_cpu[domain]++;
> +		if (current_cpu[domain] > mp_maxid)
> +			current_cpu[domain] = 0;
> +	} while (!CPU_ISSET(current_cpu[domain], &intr_cpus) ||
> +	    !CPU_ISSET(current_cpu[domain], &cpuset_domain[domain]));

Can it happen that cpuset_domain[domain] is all zero? Won't this loop 
hang then?

--HPS

From owner-svn-src-head@freebsd.org  Tue Mar 27 09:52:10 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 711FDF67242
 for ;
 Tue, 27 Mar 2018 09:52:10 +0000 (UTC)
 (envelope-from lists@eitanadler.com)
Received: from mail-yw0-x236.google.com (mail-yw0-x236.google.com
 [IPv6:2607:f8b0:4002:c05::236])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 07EE97A51F
 for ; Tue, 27 Mar 2018 09:52:09 +0000 (UTC)
 (envelope-from lists@eitanadler.com)
Received: by mail-yw0-x236.google.com with SMTP id v130so6768385ywa.0
 for ; Tue, 27 Mar 2018 02:52:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=eitanadler.com; s=0xdeadbeef;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=lCM5xOkcWquCo97eK4TXjJkXEgQg3nCmDxbFriu46WI=;
 b=EDRCUUsMWMKYCuwxBnnF41JExf/ddpbjQO2SAGIGds+U/2t8fLZDI/YitmmNnj/CNh
 7JCUeOpUgGDD8UjjC0x+mnn09gt0sP2iZ2CH+gOkhk3NkFV7yqSeyMZIybiA5HOTzh7s
 dZH06F69pOjlOLQovGTQ2LlkO2qhvo9IlUpbo=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=lCM5xOkcWquCo97eK4TXjJkXEgQg3nCmDxbFriu46WI=;
 b=TrgKoMUxnxD+PReLk3iwcYwhyThLNBo9P6zSEdfOyUwsEmCuQ0MJpYs/QZEBQBhPY1
 Jd/JOG0PwMToJ0iqA5gTJ4VY/Pzih8wcAQ7a20CD/0jA7fsj6Nk7SPr2rcq3xsJe9PqO
 M6oN6Tdob0VDgOeVFiIFs1q4QVVtqZzUwhqPiYidXoVy0evq0SxYJn82taDqAu2Iv/Vn
 OSuLdFKE8NWHvqAWKxkUhwr6pT807OhB8hoT0X/VPvQmvEBibM5XW9ZHBtUOrgemoAep
 x8XHWIELmTruOmZBhaTZaXVK7QtY4juLilkB01Hakb++KTzMnrHW2b4R8NNHil06PsDQ
 bkpg==
X-Gm-Message-State: AElRT7ER9TCim+ktteQ5FB/uS4Vfzi5D5jHf7AB8CbBjwrvnEvSVAK/X
 6Omfa3lFFwmn02Tu+gq2qJITHSXIQMaqboyJDcpPww==
X-Google-Smtp-Source: AG47ELuqdpxoYq/6Ug8GWIZm6uW5SdxZIIAk108ep3sv15pz8uAp54BrSAttjP9UB4AmgtyBY7blUteVo4QM/+rrjnQ=
X-Received: by 10.129.114.6 with SMTP id n6mr21470525ywc.113.1522144329281;
 Tue, 27 Mar 2018 02:52:09 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a5b:990:0:0:0:0:0 with HTTP;
 Tue, 27 Mar 2018 02:51:38 -0700 (PDT)
In-Reply-To: 
References: <201803270337.w2R3b4iv035285@repo.freebsd.org>
 
From: Eitan Adler 
Date: Tue, 27 Mar 2018 02:51:38 -0700
Message-ID: 
Subject: Re: svn commit: r331606 - in head/sys: amd64/include i386/include
 x86/x86 x86/xen
To: Hans Petter Selasky 
Cc: Jeff Roberson ,
 src-committers , 
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Content-Type: text/plain; charset="UTF-8"
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 09:52:10 -0000

On 27 March 2018 at 01:45, Hans Petter Selasky  wrote:
> On 03/27/18 05:37, Jeff Roberson wrote:
>>
>>         do {
>> -               current_cpu++;
>> -               if (current_cpu > mp_maxid)
>> -                       current_cpu = 0;
>> -       } while (!CPU_ISSET(current_cpu, &intr_cpus));
>> +               current_cpu[domain]++;
>> +               if (current_cpu[domain] > mp_maxid)
>> +                       current_cpu[domain] = 0;
>> +       } while (!CPU_ISSET(current_cpu[domain], &intr_cpus) ||
>> +           !CPU_ISSET(current_cpu[domain], &cpuset_domain[domain]));
>
>
> Can it happen that cpuset_domain[domain] is all zero? Won't this loop hang
> then?

I can replicate the hang. Let me know what other debugging information
you might need.



-- 
Eitan Adler

From owner-svn-src-head@freebsd.org  Tue Mar 27 10:13:09 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EE24F6967A;
 Tue, 27 Mar 2018 10:13:09 +0000 (UTC)
 (envelope-from lwhsu@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "freefall.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 2EC787B795;
 Tue, 27 Mar 2018 10:13:09 +0000 (UTC)
 (envelope-from lwhsu@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 1129)
 id 2805B29F5; Tue, 27 Mar 2018 10:13:09 +0000 (UTC)
Date: Tue, 27 Mar 2018 10:13:09 +0000
From: Li-Wen Hsu 
To: Jeff Roberson 
Cc: "O. Hartmann" ,
 Jeff Roberson , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r331606 - in head/sys: amd64/include i386/include
 x86/x86 x86/xen
Message-ID: <20180327101309.GA75720@freefall.freebsd.org>
References: <201803270337.w2R3b4iv035285@repo.freebsd.org>
 <20180327081535.0dacffcb@freyja.zeit4.iv.bundesimmobilien.de>
 <20180327082651.28258a8c@freyja.zeit4.iv.bundesimmobilien.de>
 
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: 
User-Agent: Mutt/1.9.2 (2017-12-15)
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 10:13:09 -0000

On Mon, Mar 26, 2018 at 20:35:12 -1000, Jeff Roberson wrote:
> The patch has been on my branch for weeks and has been tested by a half 
> dozen people.  I'm sorry it does not work for you.  If you reverted 331605 
> the change that followed should not have built properly.  Did you build 
> cleanly?  Can you share your kernel config?
> 
> I tried with and without EARLY_AP_STARTUP and with and without NUMA.  I'm 
> not having any trouble booting.  Did you make cleandepend && make depend?

It also hangs in our testing system:

https://ci.freebsd.org/job/FreeBSD-head-amd64-test/6817/console
https://ci.freebsd.org/job/FreeBSD-head-i386-test/1000/console

It is built cleanly and uses unmodified GENERIC config.

The artifacts used are available here:

https://artifact.ci.freebsd.org/snapshot/head/r331606/amd64/amd64/
https://artifact.ci.freebsd.org/snapshot/head/r331606/i386/i386/

Hope these information help.

Li-Wen

-- 
Li-Wen Hsu 
https://lwhsu.org

From owner-svn-src-head@freebsd.org  Tue Mar 27 10:20:52 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6F49F6A646;
 Tue, 27 Mar 2018 10:20:51 +0000 (UTC)
 (envelope-from jeff@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 6D76B7BD40;
 Tue, 27 Mar 2018 10:20:51 +0000 (UTC)
 (envelope-from jeff@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 686511AB71;
 Tue, 27 Mar 2018 10:20:51 +0000 (UTC)
 (envelope-from jeff@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RAKpvm037405;
 Tue, 27 Mar 2018 10:20:51 GMT (envelope-from jeff@FreeBSD.org)
Received: (from jeff@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RAKoBP037397;
 Tue, 27 Mar 2018 10:20:50 GMT (envelope-from jeff@FreeBSD.org)
Message-Id: <201803271020.w2RAKoBP037397@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jeff set sender to
 jeff@FreeBSD.org using -f
From: Jeff Roberson 
Date: Tue, 27 Mar 2018 10:20:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331610 - in head/sys: amd64/include i386/include x86/x86
 x86/xen
X-SVN-Group: head
X-SVN-Commit-Author: jeff
X-SVN-Commit-Paths: in head/sys: amd64/include i386/include x86/x86 x86/xen
X-SVN-Commit-Revision: 331610
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 10:20:52 -0000

Author: jeff
Date: Tue Mar 27 10:20:50 2018
New Revision: 331610
URL: https://svnweb.freebsd.org/changeset/base/331610

Log:
  Backout r331606 until I can identify why it does not boot on some
  machines.

Modified:
  head/sys/amd64/include/intr_machdep.h
  head/sys/i386/include/intr_machdep.h
  head/sys/x86/x86/intr_machdep.c
  head/sys/x86/x86/io_apic.c
  head/sys/x86/x86/msi.c
  head/sys/x86/x86/nexus.c
  head/sys/x86/xen/xen_intr.c

Modified: head/sys/amd64/include/intr_machdep.h
==============================================================================
--- head/sys/amd64/include/intr_machdep.h	Tue Mar 27 06:33:00 2018	(r331609)
+++ head/sys/amd64/include/intr_machdep.h	Tue Mar 27 10:20:50 2018	(r331610)
@@ -132,7 +132,6 @@ struct intsrc {
 	u_long *is_straycount;
 	u_int is_index;
 	u_int is_handlers;
-	u_int is_domain;
 	u_int is_cpu;
 };
 
@@ -169,7 +168,7 @@ void	intr_add_cpu(u_int cpu);
 #endif
 int	intr_add_handler(const char *name, int vector, driver_filter_t filter, 
 			 driver_intr_t handler, void *arg, enum intr_type flags, 
-			 void **cookiep, int domain);    
+			 void **cookiep);    
 #ifdef SMP
 int	intr_bind(u_int vector, u_char cpu);
 #endif
@@ -177,7 +176,7 @@ int	intr_config_intr(int vector, enum intr_trigger tri
     enum intr_polarity pol);
 int	intr_describe(u_int vector, void *ih, const char *descr);
 void	intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame);
-u_int	intr_next_cpu(int domain);
+u_int	intr_next_cpu(void);
 struct intsrc *intr_lookup_source(int vector);
 int	intr_register_pic(struct pic *pic);
 int	intr_register_source(struct intsrc *isrc);

Modified: head/sys/i386/include/intr_machdep.h
==============================================================================
--- head/sys/i386/include/intr_machdep.h	Tue Mar 27 06:33:00 2018	(r331609)
+++ head/sys/i386/include/intr_machdep.h	Tue Mar 27 10:20:50 2018	(r331610)
@@ -132,7 +132,6 @@ struct intsrc {
 	u_long *is_straycount;
 	u_int is_index;
 	u_int is_handlers;
-	u_int is_domain;
 	u_int is_cpu;
 };
 
@@ -159,8 +158,7 @@ void	elcr_write_trigger(u_int irq, enum intr_trigger t
 void	intr_add_cpu(u_int cpu);
 #endif
 int	intr_add_handler(const char *name, int vector, driver_filter_t filter,
-    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep,
-    int domain);
+    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep);
 #ifdef SMP
 int	intr_bind(u_int vector, u_char cpu);
 #endif
@@ -168,7 +166,7 @@ int	intr_config_intr(int vector, enum intr_trigger tri
     enum intr_polarity pol);
 int	intr_describe(u_int vector, void *ih, const char *descr);
 void	intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame);
-u_int	intr_next_cpu(int domain);
+u_int	intr_next_cpu(void);
 struct intsrc *intr_lookup_source(int vector);
 int	intr_register_pic(struct pic *pic);
 int	intr_register_source(struct intsrc *isrc);

Modified: head/sys/x86/x86/intr_machdep.c
==============================================================================
--- head/sys/x86/x86/intr_machdep.c	Tue Mar 27 06:33:00 2018	(r331609)
+++ head/sys/x86/x86/intr_machdep.c	Tue Mar 27 10:20:50 2018	(r331610)
@@ -71,8 +71,6 @@
 #include 
 #endif
 
-#include 
-
 #define	MAX_STRAY_LOG	5
 
 typedef void (*mask_fn)(void *);
@@ -187,8 +185,7 @@ intr_lookup_source(int vector)
 
 int
 intr_add_handler(const char *name, int vector, driver_filter_t filter,
-    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep,
-    int domain)
+    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep)
 {
 	struct intsrc *isrc;
 	int error;
@@ -203,7 +200,6 @@ intr_add_handler(const char *name, int vector, driver_
 		intrcnt_updatename(isrc);
 		isrc->is_handlers++;
 		if (isrc->is_handlers == 1) {
-			isrc->is_domain = domain;
 			isrc->is_pic->pic_enable_intr(isrc);
 			isrc->is_pic->pic_enable_source(isrc);
 		}
@@ -511,27 +507,14 @@ DB_SHOW_COMMAND(irqs, db_show_irqs)
  */
 
 cpuset_t intr_cpus = CPUSET_T_INITIALIZER(0x1);
-static int current_cpu[MAXMEMDOM];
+static int current_cpu;
 
-static void
-intr_init_cpus(void)
-{
-	int i;
-
-	for (i = 0; i < vm_ndomains; i++) {
-		current_cpu[i] = 0;
-		if (!CPU_ISSET(current_cpu[i], &intr_cpus) ||
-		    !CPU_ISSET(current_cpu[i], &cpuset_domain[i]))
-			intr_next_cpu(i);
-	}
-}
-
 /*
  * Return the CPU that the next interrupt source should use.  For now
  * this just returns the next local APIC according to round-robin.
  */
 u_int
-intr_next_cpu(int domain)
+intr_next_cpu(void)
 {
 	u_int apic_id;
 
@@ -546,13 +529,12 @@ intr_next_cpu(int domain)
 #endif
 
 	mtx_lock_spin(&icu_lock);
-	apic_id = cpu_apic_ids[current_cpu[domain]];
+	apic_id = cpu_apic_ids[current_cpu];
 	do {
-		current_cpu[domain]++;
-		if (current_cpu[domain] > mp_maxid)
-			current_cpu[domain] = 0;
-	} while (!CPU_ISSET(current_cpu[domain], &intr_cpus) ||
-	    !CPU_ISSET(current_cpu[domain], &cpuset_domain[domain]));
+		current_cpu++;
+		if (current_cpu > mp_maxid)
+			current_cpu = 0;
+	} while (!CPU_ISSET(current_cpu, &intr_cpus));
 	mtx_unlock_spin(&icu_lock);
 	return (apic_id);
 }
@@ -586,18 +568,7 @@ intr_add_cpu(u_int cpu)
 	CPU_SET(cpu, &intr_cpus);
 }
 
-#ifdef EARLY_AP_STARTUP
-static void
-intr_smp_startup(void *arg __unused)
-{
-
-	intr_init_cpus();
-	return;
-}
-SYSINIT(intr_smp_startup, SI_SUB_SMP, SI_ORDER_SECOND, intr_smp_startup,
-    NULL);
-
-#else
+#ifndef EARLY_AP_STARTUP
 /*
  * Distribute all the interrupt sources among the available CPUs once the
  * AP's have been launched.
@@ -609,7 +580,6 @@ intr_shuffle_irqs(void *arg __unused)
 	u_int cpu;
 	int i;
 
-	intr_init_cpus();
 	/* Don't bother on UP. */
 	if (mp_ncpus == 1)
 		return;
@@ -629,12 +599,12 @@ intr_shuffle_irqs(void *arg __unused)
 			 */
 			cpu = isrc->is_event->ie_cpu;
 			if (cpu == NOCPU)
-				cpu = current_cpu[isrc->is_domain];
+				cpu = current_cpu;
 			if (isrc->is_pic->pic_assign_cpu(isrc,
 			    cpu_apic_ids[cpu]) == 0) {
 				isrc->is_cpu = cpu;
 				if (isrc->is_event->ie_cpu == NOCPU)
-					intr_next_cpu(isrc->is_domain);
+					intr_next_cpu();
 			}
 		}
 	}
@@ -665,11 +635,10 @@ sysctl_hw_intrs(SYSCTL_HANDLER_ARGS)
 		isrc = interrupt_sources[i];
 		if (isrc == NULL)
 			continue;
-		sbuf_printf(&sbuf, "%s:%d @cpu%d(domain%d): %ld\n",
+		sbuf_printf(&sbuf, "%s:%d @%d: %ld\n",
 		    isrc->is_event->ie_fullname,
 		    isrc->is_index,
 		    isrc->is_cpu,
-		    isrc->is_domain,
 		    *isrc->is_count);
 	}
 
@@ -728,7 +697,7 @@ intr_balance(void *dummy __unused, int pending __unuse
 	 * Restart the scan from the same location to avoid moving in the
 	 * common case.
 	 */
-	intr_init_cpus();
+	current_cpu = 0;
 
 	/*
 	 * Assign round-robin from most loaded to least.
@@ -737,8 +706,8 @@ intr_balance(void *dummy __unused, int pending __unuse
 		isrc = interrupt_sorted[i];
 		if (isrc == NULL  || isrc->is_event->ie_cpu != NOCPU)
 			continue;
-		cpu = current_cpu[isrc->is_domain];
-		intr_next_cpu(isrc->is_domain);
+		cpu = current_cpu;
+		intr_next_cpu();
 		if (isrc->is_cpu != cpu &&
 		    isrc->is_pic->pic_assign_cpu(isrc,
 		    cpu_apic_ids[cpu]) == 0)
@@ -766,7 +735,7 @@ SYSINIT(intr_balance_init, SI_SUB_SMP, SI_ORDER_ANY, i
  * Always route interrupts to the current processor in the UP case.
  */
 u_int
-intr_next_cpu(int domain)
+intr_next_cpu(void)
 {
 
 	return (PCPU_GET(apic_id));

Modified: head/sys/x86/x86/io_apic.c
==============================================================================
--- head/sys/x86/x86/io_apic.c	Tue Mar 27 06:33:00 2018	(r331609)
+++ head/sys/x86/x86/io_apic.c	Tue Mar 27 10:20:50 2018	(r331610)
@@ -499,7 +499,7 @@ ioapic_enable_intr(struct intsrc *isrc)
 	struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc;
 
 	if (intpin->io_vector == 0)
-		if (ioapic_assign_cpu(isrc, intr_next_cpu(isrc->is_domain)) != 0)
+		if (ioapic_assign_cpu(isrc, intr_next_cpu()) != 0)
 			panic("Couldn't find an APIC vector for IRQ %d",
 			    intpin->io_irq);
 	apic_enable_vector(intpin->io_cpu, intpin->io_vector);

Modified: head/sys/x86/x86/msi.c
==============================================================================
--- head/sys/x86/x86/msi.c	Tue Mar 27 06:33:00 2018	(r331609)
+++ head/sys/x86/x86/msi.c	Tue Mar 27 10:20:50 2018	(r331610)
@@ -363,7 +363,7 @@ int
 msi_alloc(device_t dev, int count, int maxcount, int *irqs)
 {
 	struct msi_intsrc *msi, *fsrc;
-	u_int cpu, domain;
+	u_int cpu;
 	int cnt, i, *mirqs, vector;
 #ifdef ACPI_DMAR
 	u_int cookies[count];
@@ -373,9 +373,6 @@ msi_alloc(device_t dev, int count, int maxcount, int *
 	if (!msi_enabled)
 		return (ENXIO);
 
-	if (bus_get_domain(dev, &domain) != 0)
-		domain = 0;
-
 	if (count > 1)
 		mirqs = malloc(count * sizeof(*mirqs), M_MSI, M_WAITOK);
 	else
@@ -423,7 +420,7 @@ again:
 	KASSERT(cnt == count, ("count mismatch"));
 
 	/* Allocate 'count' IDT vectors. */
-	cpu = intr_next_cpu(domain);
+	cpu = intr_next_cpu();
 	vector = apic_alloc_vectors(cpu, irqs, count, maxcount);
 	if (vector == 0) {
 		mtx_unlock(&msi_lock);
@@ -613,7 +610,7 @@ int
 msix_alloc(device_t dev, int *irq)
 {
 	struct msi_intsrc *msi;
-	u_int cpu, domain;
+	u_int cpu;
 	int i, vector;
 #ifdef ACPI_DMAR
 	u_int cookie;
@@ -623,9 +620,6 @@ msix_alloc(device_t dev, int *irq)
 	if (!msi_enabled)
 		return (ENXIO);
 
-	if (bus_get_domain(dev, &domain) != 0)
-		domain = 0;
-
 again:
 	mtx_lock(&msi_lock);
 
@@ -657,7 +651,7 @@ again:
 	}
 
 	/* Allocate an IDT vector. */
-	cpu = intr_next_cpu(domain);
+	cpu = intr_next_cpu();
 	vector = apic_alloc_vector(cpu, i);
 	if (vector == 0) {
 		mtx_unlock(&msi_lock);

Modified: head/sys/x86/x86/nexus.c
==============================================================================
--- head/sys/x86/x86/nexus.c	Tue Mar 27 06:33:00 2018	(r331609)
+++ head/sys/x86/x86/nexus.c	Tue Mar 27 10:20:50 2018	(r331610)
@@ -573,7 +573,7 @@ nexus_setup_intr(device_t bus, device_t child, struct 
 		 int flags, driver_filter_t filter, void (*ihand)(void *),
 		 void *arg, void **cookiep)
 {
-	int		error, domain;
+	int		error;
 
 	/* somebody tried to setup an irq that failed to allocate! */
 	if (irq == NULL)
@@ -589,11 +589,9 @@ nexus_setup_intr(device_t bus, device_t child, struct 
 	error = rman_activate_resource(irq);
 	if (error)
 		return (error);
-	if (bus_get_domain(child, &domain) != 0)
-		domain = 0;
 
 	error = intr_add_handler(device_get_nameunit(child),
-	    rman_get_start(irq), filter, ihand, arg, flags, cookiep, domain);
+	    rman_get_start(irq), filter, ihand, arg, flags, cookiep);
 
 	return (error);
 }

Modified: head/sys/x86/xen/xen_intr.c
==============================================================================
--- head/sys/x86/xen/xen_intr.c	Tue Mar 27 06:33:00 2018	(r331609)
+++ head/sys/x86/xen/xen_intr.c	Tue Mar 27 10:20:50 2018	(r331610)
@@ -430,7 +430,7 @@ xen_intr_bind_isrc(struct xenisrc **isrcp, evtchn_port
 		 * unless specified otherwise, so shuffle them to balance
 		 * the interrupt load.
 		 */
-		xen_intr_assign_cpu(&isrc->xi_intsrc, intr_next_cpu(0));
+		xen_intr_assign_cpu(&isrc->xi_intsrc, intr_next_cpu());
 	}
 #endif
 
@@ -1562,7 +1562,7 @@ xen_intr_add_handler(const char *name, driver_filter_t
 		return (EINVAL);
 
 	error = intr_add_handler(name, isrc->xi_vector,filter, handler, arg,
-	    flags|INTR_EXCL, &isrc->xi_cookie, 0);
+	    flags|INTR_EXCL, &isrc->xi_cookie);
 	if (error != 0) {
 		printf(
 		    "%s: xen_intr_add_handler: intr_add_handler failed: %d\n",

From owner-svn-src-head@freebsd.org  Tue Mar 27 11:49:20 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E393EF71F9D;
 Tue, 27 Mar 2018 11:49:19 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 8DADF7FF41;
 Tue, 27 Mar 2018 11:49:19 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 871FD1BA72;
 Tue, 27 Mar 2018 11:49:19 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RBnJnP082200;
 Tue, 27 Mar 2018 11:49:19 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RBnGIx082165;
 Tue, 27 Mar 2018 11:49:16 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201803271149.w2RBnGIx082165@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon 
Date: Tue, 27 Mar 2018 11:49:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331613 - in head/tests/sys/cddl/zfs: bin include
 tests/cli_root/zpool_add tests/delegate tests/devices tests/hotspare
 tests/interop tests/largest_pool tests/slog tests/utils_test tests...
X-SVN-Group: head
X-SVN-Commit-Author: avg
X-SVN-Commit-Paths: in head/tests/sys/cddl/zfs: bin include
 tests/cli_root/zpool_add tests/delegate tests/devices tests/hotspare
 tests/interop tests/largest_pool tests/slog tests/utils_test tests/xattr
 tests/zones tests/...
X-SVN-Commit-Revision: 331613
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 11:49:20 -0000

Author: avg
Date: Tue Mar 27 11:49:15 2018
New Revision: 331613
URL: https://svnweb.freebsd.org/changeset/base/331613

Log:
  ZFS test suite: fix uses of illumos /dev/[r]dsk/ and /dev/zvol/[r]dsk/

Modified:
  head/tests/sys/cddl/zfs/bin/devname2devid.c
  head/tests/sys/cddl/zfs/bin/zpool_bsd.ksh
  head/tests/sys/cddl/zfs/bin/zpool_smi.ksh
  head/tests/sys/cddl/zfs/include/libtest.kshlib
  head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib
  head/tests/sys/cddl/zfs/tests/delegate/delegate_common.kshlib
  head/tests/sys/cddl/zfs/tests/devices/devices_common.kshlib
  head/tests/sys/cddl/zfs/tests/hotspare/hotspare_add_003_neg.ksh
  head/tests/sys/cddl/zfs/tests/hotspare/hotspare_create_001_neg.ksh
  head/tests/sys/cddl/zfs/tests/hotspare/hotspare_remove_002_neg.ksh
  head/tests/sys/cddl/zfs/tests/interop/interop.cfg
  head/tests/sys/cddl/zfs/tests/largest_pool/largest_pool.cfg
  head/tests/sys/cddl/zfs/tests/slog/slog_013_pos.ksh
  head/tests/sys/cddl/zfs/tests/utils_test/utils_test_001_pos.ksh
  head/tests/sys/cddl/zfs/tests/utils_test/utils_test_002_pos.ksh
  head/tests/sys/cddl/zfs/tests/utils_test/utils_test_005_pos.ksh
  head/tests/sys/cddl/zfs/tests/utils_test/utils_test_006_pos.ksh
  head/tests/sys/cddl/zfs/tests/utils_test/utils_test_008_pos.ksh
  head/tests/sys/cddl/zfs/tests/utils_test/utils_test_009_pos.ksh
  head/tests/sys/cddl/zfs/tests/xattr/xattr_004_pos.ksh
  head/tests/sys/cddl/zfs/tests/zones/zones_001_pos.ksh
  head/tests/sys/cddl/zfs/tests/zvol/zvol_common.kshlib
  head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_001_neg.ksh
  head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_003_neg.ksh
  head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_004_pos.ksh
  head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_005_neg.ksh
  head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_006_pos.ksh
  head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/cleanup.ksh
  head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_001_pos.ksh
  head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_002_pos.ksh
  head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_003_pos.ksh
  head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_004_pos.ksh
  head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_005_pos.ksh
  head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_006_pos.ksh

Modified: head/tests/sys/cddl/zfs/bin/devname2devid.c
==============================================================================
--- head/tests/sys/cddl/zfs/bin/devname2devid.c	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/bin/devname2devid.c	Tue Mar 27 11:49:15 2018	(r331613)
@@ -39,11 +39,11 @@
  * Usage: devname2devid 
  *
  * Examples:
- *	# ./devname2devid /dev/dsk/c1t4d0s0
+ *	# ./devname2devid /dev/c1t4d0s0
  *	devid id1,sd@SSEAGATE_ST318404LSUN18G_3BT2G0Z300002146G4CR/a
- *	# ./devname2devid /dev/dsk/c1t4d0
+ *	# ./devname2devid /dev/c1t4d0
  *	devid id1,sd@SSEAGATE_ST318404LSUN18G_3BT2G0Z300002146G4CR/wd
- *	# ./devname2devid /dev/dsk/c1t4d0s1
+ *	# ./devname2devid /dev/c1t4d0s1
  *	devid id1,sd@SSEAGATE_ST318404LSUN18G_3BT2G0Z300002146G4CR/b
  *	#
  *
@@ -99,7 +99,7 @@ main(int argc, char *argv[])
 	if (argc == 3) {
 		search_path = argv[2];
 	} else {
-		search_path = "/dev/rdsk";
+		search_path = "/dev/";
 	}
 
 	if (devid_deviceid_to_nmlist(search_path, devid, DEVID_MINOR_NAME_ALL,

Modified: head/tests/sys/cddl/zfs/bin/zpool_bsd.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/bin/zpool_bsd.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/bin/zpool_bsd.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -16,8 +16,8 @@ typeset option
 case $cmd in
 	create|add|attach|detach|replace|remove|online|offline|clear)
 		for arg in $@; do
-			if [[ $arg == "/dev/dsk/"* ]]; then
-				arg=${arg#/dev/dsk/}
+			if [[ $arg == "/dev/"* ]]; then
+				arg=${arg#/dev/}
 				arg="/dev/"$arg
 			fi
 			if [[ $arg == "/dev/"* ]]; then

Modified: head/tests/sys/cddl/zfs/bin/zpool_smi.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/bin/zpool_smi.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/bin/zpool_smi.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -42,7 +42,7 @@ label
 yes
 _EOF
 
-	labeltype=$(/usr/sbin/prtvtoc -fh /dev/rdsk/${disk}s2 | \
+	labeltype=$(/usr/sbin/prtvtoc -fh /dev/${disk}s2 | \
 		awk '{print $1}' | awk -F= '{print $2}' )
 	if [[ -z $labeltype ]]; then
 		print "${disk} not exist."
@@ -61,7 +61,7 @@ _EOF
 		 	print "q" >> $label_file
 		 	print "q" >> $label_file
 
-		 	fdisk -B /dev/rdsk/${disk}p0 >/dev/null 2>&1
+		 	fdisk -B /dev/${disk}p0 >/dev/null 2>&1
 		 	# wait a while for fdisk finishes
 			/usr/sbin/devfsadm > /dev/null 2>&1
 		elif [[ $arch == "sparc" ]]; then
@@ -105,8 +105,8 @@ typeset option
 case $cmd in
 	create|add|attach|detach|replace|remove|online|offline|clear)
 		for arg in $@; do
-			if [[ $arg == "/dev/dsk/"* ]]; then
-				arg=${arg#/dev/dsk/}
+			if [[ $arg == "/dev/"* ]]; then
+				arg=${arg#/dev/}
 			fi
 
 			print $arg | egrep "^c[0-F]+([td][0-F]+)+$" > /dev/null 2>&1

Modified: head/tests/sys/cddl/zfs/include/libtest.kshlib
==============================================================================
--- head/tests/sys/cddl/zfs/include/libtest.kshlib	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/include/libtest.kshlib	Tue Mar 27 11:49:15 2018	(r331613)
@@ -1235,12 +1235,12 @@ function zfs_zones_setup #zone_name zone_root zone_ip
 
 	# add our zvol to the zone
 	$ECHO "add device" >> $zone_conf
-	$ECHO "set match=/dev/zvol/dsk/$pool_name/zone_zvol" >> $zone_conf
+	$ECHO "set match=/dev/zvol/$pool_name/zone_zvol" >> $zone_conf
 	$ECHO "end" >> $zone_conf
 
-	# add a corresponding zvol rdsk to the zone
+	# add a corresponding zvol to the zone
 	$ECHO "add device" >> $zone_conf
-	$ECHO "set match=/dev/zvol/rdsk/$pool_name/zone_zvol" >> $zone_conf
+	$ECHO "set match=/dev/zvol/$pool_name/zone_zvol" >> $zone_conf
 	$ECHO "end" >> $zone_conf
 	
 	# once it's supported, we'll add our filesystem to the zone
@@ -1349,9 +1349,9 @@ function wait_for # timeout dt  [args...]
 function check_state # pool disk stateexpr
 {
 	typeset pool=$1
-	typeset disk=${2#/dev/dsk/}
-	disk=${disk#/dev/rdsk/}
+	typeset disk=${2#/dev/}
 	disk=${disk#/dev/}
+	disk=${disk#/dev/}
 	typeset stateexpr=$3
 
 	$ZPOOL status -v $pool | grep "$disk"  \
@@ -1561,9 +1561,9 @@ function check_version # 
 function check_hotspare_state # pool disk state{inuse,avail}
 {
 	typeset pool=$1
-	typeset disk=${2#/dev/dsk/}
-	disk=${disk#/dev/rdsk/}
+	typeset disk=${2#/dev/}
 	disk=${disk#/dev/}
+	disk=${disk#/dev/}
 	typeset state=$3
 
 	cur_state=$(get_device_state $pool $disk "spares")
@@ -1582,9 +1582,9 @@ function check_hotspare_state # pool disk state{inuse,
 function check_slog_state # pool disk state{online,offline,unavail}
 {
 	typeset pool=$1
-	typeset disk=${2#/dev/dsk/}
-	disk=${disk#/dev/rdsk/}
+	typeset disk=${2#/dev/}
 	disk=${disk#/dev/}
+	disk=${disk#/dev/}
 	typeset state=$3
 
 	cur_state=$(get_device_state $pool $disk "logs")
@@ -1603,9 +1603,9 @@ function check_slog_state # pool disk state{online,off
 function check_vdev_state # pool disk state{online,offline,unavail}
 {
 	typeset pool=$1
-	typeset disk=${2#/dev/dsk/}
-	disk=${disk#/dev/rdsk/}
+	typeset disk=${2#/dev/}
 	disk=${disk#/dev/}
+	disk=${disk#/dev/}
 	typeset state=$3
 
 	if [[ $WRAPPER == *"smi"* ]]; then
@@ -2176,7 +2176,7 @@ function safe_to_destroy_pool { # $1 the pool name
 			$AWK '{print $1}')
 
 		# this is a list of the zvols that make up the pool
-		ZVOLPOOL=$($ZPOOL status -v $pool | $GREP "/dev/zvol/dsk/$1$" | \
+		ZVOLPOOL=$($ZPOOL status -v $pool | $GREP "/dev/zvol/$1$" | \
 			$AWK '{print $1}')
 
 		# also want to determine if it's a file-based pool using an
@@ -2728,8 +2728,8 @@ function checksum
 function get_device_state #pool disk field("", "spares","logs")
 {
 	typeset pool=$1
-	typeset disk=${2#/dev/dsk/}
-	disk=${disk#/dev/rdsk/}
+	typeset disk=${2#/dev/}
+	disk=${disk#/dev/}
 	disk=${disk#/dev/}
 	typeset field=${3:-$pool}
 

Modified: head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib
==============================================================================
--- head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/cli_root/zpool_add/zpool_add.kshlib	Tue Mar 27 11:49:15 2018	(r331613)
@@ -54,7 +54,7 @@ function iscontained
 
 	for vdev in $@; do
 
-# remove /dev/dsk in vdev if there is
+# remove /dev/ in vdev if there is
 		vdev=${vdev#/dev/}
 
 		$ZPOOL status "$pool" | $AWK '$1 == vdevname {exit 1}' \

Modified: head/tests/sys/cddl/zfs/tests/delegate/delegate_common.kshlib
==============================================================================
--- head/tests/sys/cddl/zfs/tests/delegate/delegate_common.kshlib	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/delegate/delegate_common.kshlib	Tue Mar 27 11:49:15 2018	(r331613)
@@ -1531,7 +1531,7 @@ function verify_vol_rollback
 	log_must $ZFS snapshot $snap
 	oldval=$(datasetcksum $vol)
 
-	log_must $DD if=/dev/random of=/dev/zvol/rdsk/$vol \
+	log_must $DD if=/dev/random of=/dev/zvol/$vol \
 		bs=512 count=1
 
 	user_run $user $ZFS rollback -R $snap

Modified: head/tests/sys/cddl/zfs/tests/devices/devices_common.kshlib
==============================================================================
--- head/tests/sys/cddl/zfs/tests/devices/devices_common.kshlib	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/devices/devices_common.kshlib	Tue Mar 27 11:49:15 2018	(r331613)
@@ -57,7 +57,7 @@ function create_dev_file
 						$AWK '{print $1}')
 					[[ -z $devstr ]] && \
 						log_fail "Can not get block device file."
-					devstr=/dev/dsk/${devstr}
+					devstr=/dev/${devstr}
 					;;
 				ufs)
 			#
@@ -65,7 +65,7 @@ function create_dev_file
 			# And bring out the first one.
 			#
 					devstr=$($DF -lht ufs | \
-						$GREP "^/dev/dsk" | \
+						$GREP "^/dev/" | \
 						$AWK '{print $1}')
 					devstr=$($ECHO "$devstr" | \
 						$AWK '{print $1}')
@@ -81,7 +81,7 @@ function create_dev_file
 
 			#
 			# Get the device file information. i.e:
-			# /dev/dsk/c0t0d0s0:      block special (28/768)
+			# /dev/c0t0d0s0:      block special (28/768)
 			#
 			devstr=$($FILE $devstr)
 

Modified: head/tests/sys/cddl/zfs/tests/hotspare/hotspare_add_003_neg.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/hotspare/hotspare_add_003_neg.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/hotspare/hotspare_add_003_neg.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -130,7 +130,7 @@ done
 # This part of the test can only be run on platforms for which DUMPADM is
 # defined; ie Solaris
 if [[ -n $DUMPADM ]]; then
-	log_must $DUMPADM -u -d /dev/dsk/$dump_dev
+	log_must $DUMPADM -u -d /dev/$dump_dev
 	log_mustnot $ZPOOL add "$TESTPOOL" spare $dump_dev
 	log_mustnot $ZPOOL add -f "$TESTPOOL" spare $dump_dev
 fi

Modified: head/tests/sys/cddl/zfs/tests/hotspare/hotspare_create_001_neg.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/hotspare/hotspare_create_001_neg.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/hotspare/hotspare_create_001_neg.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -131,7 +131,7 @@ if [[ -n $DUMPADM ]]; then
     # back to something normal so we can use this $disk as a dump device
     cleanup_devices $dump_dev
 
-    log_must $DUMPADM -u -d /dev/dsk/$dump_dev
+    log_must $DUMPADM -u -d /dev/$dump_dev
     log_mustnot $ZPOOL create $TESTPOOL1 ${pooldevs[1]} spare "$dump_dev"
     log_mustnot $ZPOOL create -f $TESTPOOL1 ${pooldevs[1]} spare "$dump_dev"
 fi

Modified: head/tests/sys/cddl/zfs/tests/hotspare/hotspare_remove_002_neg.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/hotspare/hotspare_remove_002_neg.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/hotspare/hotspare_remove_002_neg.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -86,11 +86,11 @@ typeset dev_nonexist dev_notinlist
 
 case $DISK_ARRAY_NUM in
 0|1)
-	dev_nonexist=/dev/dsk/${disk}sbad_slice_num
+	dev_nonexist=/dev/${disk}sbad_slice_num
 	dev_notinlist=${disk}
 	;;
 2|*)
-	dev_nonexist=/dev/dsk/${DISK0}sbad_slice_num
+	dev_nonexist=/dev/${DISK0}sbad_slice_num
 	dev_notinlist="${DISK0} ${DISK1}"
 	;;
 esac

Modified: head/tests/sys/cddl/zfs/tests/interop/interop.cfg
==============================================================================
--- head/tests/sys/cddl/zfs/tests/interop/interop.cfg	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/interop/interop.cfg	Tue Mar 27 11:49:15 2018	(r331613)
@@ -77,6 +77,6 @@ export META_SIDE0 META_SIDE1 ZFS_SIDE2 SINGLE_DISK
 export TESTFILE=testfile
 export FS_SIZE=500m
 export META_DEVICE_ID=d99
-export META_DEVICE_PATH=/dev/md/dsk/$META_DEVICE_ID
+export META_DEVICE_PATH=/dev/md/$META_DEVICE_ID
 export FILE_COUNT=20
 export FILE_SIZE=$(( 1024 * 1024 ))

Modified: head/tests/sys/cddl/zfs/tests/largest_pool/largest_pool.cfg
==============================================================================
--- head/tests/sys/cddl/zfs/tests/largest_pool/largest_pool.cfg	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/largest_pool/largest_pool.cfg	Tue Mar 27 11:49:15 2018	(r331613)
@@ -31,7 +31,7 @@
 
 export TESTVOL=testvol${TESTCASE_ID}
 export STF_TIMEOUT=1800
-export VOL_PATH=/dev/zvol/dsk/${TESTPOOL2}/$TESTVOL
+export VOL_PATH=/dev/zvol/${TESTPOOL2}/$TESTVOL
 export VOLSIZES=${VOLSIZES-"2pb 5pb 10pb 2eb 5eb 8eb 9eb"}
 
 # There're 3 different prompt messages while create

Modified: head/tests/sys/cddl/zfs/tests/slog/slog_013_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/slog/slog_013_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/slog/slog_013_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -104,4 +104,4 @@ log_must $ZPOOL add $TESTPOOL $mntpnt/vdev
 # Add ZFS volume
 vol=$TESTPOOL/vol
 log_must $ZPOOL create -V 64M $vol
-log_must $ZPOOL add $TESTPOOL /dev/zvol/dsk/$vol
+log_must $ZPOOL add $TESTPOOL /dev/zvol/$vol

Modified: head/tests/sys/cddl/zfs/tests/utils_test/utils_test_001_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/utils_test/utils_test_001_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/utils_test/utils_test_001_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -69,7 +69,7 @@ log_assert "Ensure that the clri(1M) utility fails on 
 populate_dir $TESTDIR/$TESTFILE $NUM_FILES $WRITE_COUNT $BLOCKSZ $DATA
 
 inode=`$LS -i $TESTDIR/$TESTFILE.0 | $AWK '{print $1}'`
-log_mustnot $CLRI /dev/rdsk/$DISK $inode
-log_mustnot $CLRI -F zfs /dev/rdsk/$DISK $inode
+log_mustnot $CLRI /dev/$DISK $inode
+log_mustnot $CLRI -F zfs /dev/$DISK $inode
 
 log_pass "clri(1M) returned an error as expected."

Modified: head/tests/sys/cddl/zfs/tests/utils_test/utils_test_002_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/utils_test/utils_test_002_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/utils_test/utils_test_002_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -76,6 +76,6 @@ populate_dir $TESTDIR/$TESTFILE $NUM_FILES $WRITE_COUN
 
 log_must $ZFS unmount $TESTDIR
 
-log_mustnot $LABELIT /dev/rdsk/${DISK}s0 mfiles ${DISK}s0
+log_mustnot $LABELIT /dev/${DISK}s0 mfiles ${DISK}s0
 
 log_pass "labelit(1M) returned an error as expected."

Modified: head/tests/sys/cddl/zfs/tests/utils_test/utils_test_005_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/utils_test/utils_test_005_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/utils_test/utils_test_005_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -70,6 +70,6 @@ log_assert "Ensure that the ff(1M) utility fails on a 
 
 populate_dir $TESTDIR/$TESTFILE $NUM_FILES $WRITE_COUNT $BLOCKSZ $DATA
 
-log_mustnot $FF -F zfs /dev/rdsk/${DISK}s0
+log_mustnot $FF -F zfs /dev/${DISK}s0
 
 log_pass "ff(1M) returned an error as expected."

Modified: head/tests/sys/cddl/zfs/tests/utils_test/utils_test_006_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/utils_test/utils_test_006_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/utils_test/utils_test_006_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -74,6 +74,6 @@ populate_dir $TESTDIR/$TESTFILE $NUM_FILES $WRITE_COUN
 
 log_must $ZFS unmount $TESTDIR
 
-log_mustnot $FSIRAND /dev/rdsk/${DISK}s0
+log_mustnot $FSIRAND /dev/${DISK}s0
 
 log_pass "fsirand(1M) returned an error as expected."

Modified: head/tests/sys/cddl/zfs/tests/utils_test/utils_test_008_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/utils_test/utils_test_008_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/utils_test/utils_test_008_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -76,6 +76,6 @@ populate_dir $TESTDIR/$TESTFILE $NUM_FILES $WRITE_COUN
 
 log_must $ZFS unmount $TESTDIR
 
-log_mustnot $NCHECK /dev/rdsk/${DISK}s0
+log_mustnot $NCHECK /dev/${DISK}s0
 
 log_pass "ncheck(1M) returned an error as expected."

Modified: head/tests/sys/cddl/zfs/tests/utils_test/utils_test_009_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/utils_test/utils_test_009_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/utils_test/utils_test_009_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -68,6 +68,6 @@ log_assert "Ensure that the tunefs(1M) utility fails o
 
 populate_dir $TESTDIR/$TESTFILE $NUM_FILES $WRITE_COUNT $BLOCKSZ $DATA
 
-log_mustnot $TUNEFS -m 80 /dev/dsk/${DISK}s0
+log_mustnot $TUNEFS -m 80 /dev/${DISK}s0
 
 log_pass "tunefs(1M) returned an error as expected."

Modified: head/tests/sys/cddl/zfs/tests/xattr/xattr_004_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/xattr/xattr_004_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/xattr/xattr_004_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -78,10 +78,10 @@ test_requires RUNAT
 
 # Create a UFS file system that we can work in
 log_must $ZFS create -V128m $TESTPOOL/$TESTFS/zvol
-log_must eval "$ECHO y | $NEWFS /dev/zvol/dsk/$TESTPOOL/$TESTFS/zvol > /dev/null 2>&1"
+log_must eval "$ECHO y | $NEWFS /dev/zvol/$TESTPOOL/$TESTFS/zvol > /dev/null 2>&1"
 
 log_must $MKDIR $TMPDIR/ufs.${TESTCASE_ID}
-log_must $MOUNT /dev/zvol/dsk/$TESTPOOL/$TESTFS/zvol $TMPDIR/ufs.${TESTCASE_ID}
+log_must $MOUNT /dev/zvol/$TESTPOOL/$TESTFS/zvol $TMPDIR/ufs.${TESTCASE_ID}
 
 # Create files in ufs and tmpfs, and set some xattrs on them.
 log_must $TOUCH $TMPDIR/ufs.${TESTCASE_ID}/ufs-file.${TESTCASE_ID}

Modified: head/tests/sys/cddl/zfs/tests/zones/zones_001_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/zones/zones_001_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/zones/zones_001_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -64,18 +64,18 @@ log_assert "Local zone contains ZFS datasets as expect
 
 
 # check to see if our zvol exists:
-if [ ! -b /dev/zvol/dsk/zonepool/zone_zvol ]
+if [ ! -b /dev/zvol/zonepool/zone_zvol ]
 then
-    log_fail "block device /dev/zvol/dsk/zonepool/zone_zvol not found!"
+    log_fail "block device /dev/zvol/zonepool/zone_zvol not found!"
 fi
 
-if [ ! -c /dev/zvol/rdsk/zonepool/zone_zvol ]
+if [ ! -c /dev/zvol/zonepool/zone_zvol ]
 then
-    log_fail "char device /dev/zvol/rdsk/zonepool/zone_zvol not found!"
+    log_fail "char device /dev/zvol/zonepool/zone_zvol not found!"
 fi
 
 # check to see if the device appears sane - create a UFS filesystem on it.
-$ECHO y | $NEWFS /dev/zvol/rdsk/zonepool/zone_zvol > /dev/null
+$ECHO y | $NEWFS /dev/zvol/zonepool/zone_zvol > /dev/null
 
 if [ $? -ne 0 ]
 then
@@ -83,7 +83,7 @@ then
 fi
 
 $MKDIR /ufs.${TESTCASE_ID}
-log_must $MOUNT /dev/zvol/dsk/zonepool/zone_zvol /ufs.${TESTCASE_ID}
+log_must $MOUNT /dev/zvol/zonepool/zone_zvol /ufs.${TESTCASE_ID}
 log_must $UMOUNT /ufs.${TESTCASE_ID}
 $RM -rf /ufs.${TESTCASE_ID}
 

Modified: head/tests/sys/cddl/zfs/tests/zvol/zvol_common.kshlib
==============================================================================
--- head/tests/sys/cddl/zfs/tests/zvol/zvol_common.kshlib	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/zvol/zvol_common.kshlib	Tue Mar 27 11:49:15 2018	(r331613)
@@ -106,7 +106,7 @@ function set_dumpsize
 
 	log_must $ZFS set volsize=64m $volume
 
-	output=$($DUMPADM -d /dev/zvol/dsk/$volume 2>&1 | \
+	output=$($DUMPADM -d /dev/zvol/$volume 2>&1 | \
 			$TAIL -1 | $AWK '{print $3}')
 
 	if [[ -n $output ]]; then
@@ -125,8 +125,8 @@ function safe_dumpadm
 		log_note "No dump device volume specified."
 		return 1
 	fi
-	if [[ $device == "/dev/zvol/dsk/"* ]] ; then
-		typeset volume=${device#/dev/zvol/dsk/}
+	if [[ $device == "/dev/zvol/"* ]] ; then
+		typeset volume=${device#/dev/zvol/}
 		set_dumpsize $volume
 		log_must $DUMPADM -d $device
 	else

Modified: head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_001_neg.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_001_neg.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_001_neg.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -73,7 +73,7 @@ log_onexit cleanup
 
 test_requires DUMPADM
 
-voldev=/dev/zvol/dsk/$TESTPOOL/$TESTVOL
+voldev=/dev/zvol/$TESTPOOL/$TESTVOL
 savedumpdev=$(get_dumpdevice)
 
 if ! is_dumpswap_supported $TESTPOOL ; then

Modified: head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_003_neg.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_003_neg.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_003_neg.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -78,7 +78,7 @@ log_onexit cleanup
 
 test_requires DUMPADM
 
-voldev=/dev/zvol/dsk/$TESTPOOL/$TESTVOL
+voldev=/dev/zvol/$TESTPOOL/$TESTVOL
 savedumpdev=$(get_dumpdevice)
 
 safe_dumpadm $voldev

Modified: head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_004_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_004_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_004_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -104,7 +104,7 @@ log_onexit cleanup
 
 test_requires DUMPADM
 
-voldev=/dev/zvol/dsk/$TESTPOOL/$TESTVOL
+voldev=/dev/zvol/$TESTPOOL/$TESTVOL
 savedumpdev=$(get_dumpdevice)
 
 # create snapshot over dump zvol

Modified: head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_005_neg.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_005_neg.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_005_neg.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -79,7 +79,7 @@ log_onexit cleanup
 
 test_requires DUMPADM
 
-voldev=/dev/zvol/dsk/$TESTPOOL/$TESTVOL
+voldev=/dev/zvol/$TESTPOOL/$TESTVOL
 savedumpdev=$(get_dumpdevice)
 
 # If device in swap list, it cannot be dump device

Modified: head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_006_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_006_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/zvol/zvol_misc/zvol_misc_006_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -75,7 +75,7 @@ log_onexit cleanup
 
 test_requires DUMPADM
 
-voldev=/dev/zvol/dsk/$TESTPOOL/$TESTVOL
+voldev=/dev/zvol/$TESTPOOL/$TESTVOL
 savedumpdev=$(get_dumpdevice)
 
 typeset oblksize=$($ZFS get -H -o value volblocksize $TESTPOOL/$TESTVOL)

Modified: head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/cleanup.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/cleanup.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/cleanup.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -42,7 +42,7 @@ do
 	fi
 done
 
-voldev=/dev/zvol/dsk/$TESTPOOL/$TESTVOL
+voldev=/dev/zvol/$TESTPOOL/$TESTVOL
 if is_swap_inuse $voldev ; then
 	log_must $SWAP -d $voldev
 fi

Modified: head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_001_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_001_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_001_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -74,7 +74,7 @@ log_onexit cleanup
 
 test_requires SWAP
 
-voldev=/dev/zvol/dsk/$TESTPOOL/$TESTVOL
+voldev=/dev/zvol/$TESTPOOL/$TESTVOL
 log_note "Add zvol volume as swap space"
 log_must $SWAP -a $voldev
 

Modified: head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_002_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_002_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_002_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -78,7 +78,7 @@ fi
 
 log_onexit cleanup
 
-voldev=/dev/zvol/dsk/$TESTPOOL/$TESTVOL
+voldev=/dev/zvol/$TESTPOOL/$TESTVOL
 
 $SWAP -l | $GREP zvol
 if (( $? != 0 )) ; then

Modified: head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_003_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_003_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_003_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -97,7 +97,7 @@ log_onexit cleanup
 
 test_requires SWAPADD
 
-voldev=/dev/zvol/dsk/$TESTPOOL/$TESTVOL
+voldev=/dev/zvol/$TESTPOOL/$TESTVOL
 VFSTAB_FILE=/etc/vfstab
 NEW_VFSTAB_FILE=$TMPDIR/zvol_vfstab.${TESTCASE_ID}
 PREV_VFSTAB_FILE=$TMPDIR/zvol_vfstab.PREV.${TESTCASE_ID}

Modified: head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_004_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_004_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_004_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -94,7 +94,7 @@ while ((i < ${#array[@]})); do
 	
 	log_must $ZFS create -b $volblksize -V ${array[$i]} $vol
 
-	swapname="/dev/zvol/dsk/$vol"
+	swapname="/dev/zvol/$vol"
 	if [[ ${array[((i+1))]} == "fail" ]]; then
 		log_mustnot $SWAP -a $swapname
 	else

Modified: head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_005_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_005_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_005_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -95,7 +95,7 @@ while ((i < 10)) ; do
 	# The minimum swap size should be 2 pagesize.
 	((swaplow + swaplen < pageblocks * 2)) && continue
 
-	swapname="/dev/zvol/dsk/$vol"
+	swapname="/dev/zvol/$vol"
 	if is_swap_inuse $swapname ; then
 		log_must $SWAP -d $swapname
 	fi

Modified: head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_006_pos.ksh
==============================================================================
--- head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_006_pos.ksh	Tue Mar 27 11:34:34 2018	(r331612)
+++ head/tests/sys/cddl/zfs/tests/zvol/zvol_swap/zvol_swap_006_pos.ksh	Tue Mar 27 11:49:15 2018	(r331613)
@@ -95,7 +95,7 @@ set -A swap_opt	$((pageblocks))	    \
 		$(((volblocks*2) / 3))  \
 		$((pageblocks * ((RANDOM % 50) + 1) + (RANDOM % pageblocks) )) 
 
-swapname=/dev/zvol/dsk/$vol
+swapname=/dev/zvol/$vol
 typeset -i i=0 count=0
 
 if is_swap_inuse $swapname ; then

From owner-svn-src-head@freebsd.org  Tue Mar 27 14:31:42 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C412FF5A4AB;
 Tue, 27 Mar 2018 14:31:42 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 7661E6884B;
 Tue, 27 Mar 2018 14:31:42 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 715B01D4C3;
 Tue, 27 Mar 2018 14:31:42 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2REVglH065595;
 Tue, 27 Mar 2018 14:31:42 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2REVgO7065593;
 Tue, 27 Mar 2018 14:31:42 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201803271431.w2REVgO7065593@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon 
Date: Tue, 27 Mar 2018 14:31:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331616 - in head: sbin/mount sys/kern
X-SVN-Group: head
X-SVN-Commit-Author: avg
X-SVN-Commit-Paths: in head: sbin/mount sys/kern
X-SVN-Commit-Revision: 331616
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 14:31:43 -0000

Author: avg
Date: Tue Mar 27 14:31:42 2018
New Revision: 331616
URL: https://svnweb.freebsd.org/changeset/base/331616

Log:
  vfs_donmount: in certain cases try r/o mount if r/w mount fails
  
  If the operation is not an update, if neither r/w nor r/o mode is
  explicitly requested, if the error code hints at the possibility of the
  media being read-only, and if the fallback is allowed, then we can try
  to automatically downgrade to the readonly mode.
  
  This is especially useful for auto-mounting of removable media that
  sometimes can happen to be write-protected.
  
  The fallback to r/o is not enabled by default.  It can be requested on a
  per-mount basis with a new mount option, 'autoro'.  Or it can be
  globally allowed by setting vfs.default_autoro.
  
  Reviewed by:	cem, kib
  MFC after:	3 weeks
  Relnotes:	yes
  Differential Revision: https://reviews.freebsd.org/D13361

Modified:
  head/sbin/mount/mount.8
  head/sys/kern/vfs_mount.c

Modified: head/sbin/mount/mount.8
==============================================================================
--- head/sbin/mount/mount.8	Tue Mar 27 13:59:57 2018	(r331615)
+++ head/sbin/mount/mount.8	Tue Mar 27 14:31:42 2018	(r331616)
@@ -155,6 +155,10 @@ This flag indicates that the file system was mounted b
 .Xr automountd 8 .
 Automounted file systems are automatically unmounted by
 .Xr autounmountd 8 .
+.It Cm autoro
+Mount the file system read-write.
+If that fails with an error that suggests that the media could be read-only,
+then automatically try to mount the file system read-only.
 .It Cm current
 When used with the
 .Fl u

Modified: head/sys/kern/vfs_mount.c
==============================================================================
--- head/sys/kern/vfs_mount.c	Tue Mar 27 13:59:57 2018	(r331615)
+++ head/sys/kern/vfs_mount.c	Tue Mar 27 14:31:42 2018	(r331616)
@@ -81,6 +81,10 @@ static int	usermount = 0;
 SYSCTL_INT(_vfs, OID_AUTO, usermount, CTLFLAG_RW, &usermount, 0,
     "Unprivileged users may mount and unmount file systems");
 
+static bool	default_autoro = false;
+SYSCTL_BOOL(_vfs, OID_AUTO, default_autoro, CTLFLAG_RW, &default_autoro, 0,
+    "Retry failed r/w mount as r/o if no explicit ro/rw option is specified");
+
 MALLOC_DEFINE(M_MOUNT, "mount", "vfs mount structure");
 MALLOC_DEFINE(M_STATFS, "statfs", "statfs structure");
 static uma_zone_t mount_zone;
@@ -546,6 +550,31 @@ vfs_mount_destroy(struct mount *mp)
 	uma_zfree(mount_zone, mp);
 }
 
+static bool
+vfs_should_downgrade_to_ro_mount(uint64_t fsflags, int error)
+{
+	/* This is an upgrade of an exisiting mount. */
+	if ((fsflags & MNT_UPDATE) != 0)
+		return (false);
+	/* This is already an R/O mount. */
+	if ((fsflags & MNT_RDONLY) != 0)
+		return (false);
+
+	switch (error) {
+	case ENODEV:	/* generic, geom, ... */
+	case EACCES:	/* cam/scsi, ... */
+	case EROFS:	/* md, mmcsd, ... */
+		/*
+		 * These errors can be returned by the storage layer to signal
+		 * that the media is read-only.  No harm in the R/O mount
+		 * attempt if the error was returned for some other reason.
+		 */
+		return (true);
+	default:
+		return (false);
+	}
+}
+
 int
 vfs_donmount(struct thread *td, uint64_t fsflags, struct uio *fsoptions)
 {
@@ -553,10 +582,12 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru
 	struct vfsopt *opt, *tmp_opt;
 	char *fstype, *fspath, *errmsg;
 	int error, fstypelen, fspathlen, errmsg_len, errmsg_pos;
+	bool autoro;
 
 	errmsg = fspath = NULL;
 	errmsg_len = fspathlen = 0;
 	errmsg_pos = -1;
+	autoro = default_autoro;
 
 	error = vfs_buildopts(fsoptions, &optlist);
 	if (error)
@@ -648,17 +679,28 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru
 			free(opt->name, M_MOUNT);
 			opt->name = strdup("nonosymfollow", M_MOUNT);
 		}
-		else if (strcmp(opt->name, "noro") == 0)
+		else if (strcmp(opt->name, "noro") == 0) {
 			fsflags &= ~MNT_RDONLY;
-		else if (strcmp(opt->name, "rw") == 0)
+			autoro = false;
+		}
+		else if (strcmp(opt->name, "rw") == 0) {
 			fsflags &= ~MNT_RDONLY;
-		else if (strcmp(opt->name, "ro") == 0)
+			autoro = false;
+		}
+		else if (strcmp(opt->name, "ro") == 0) {
 			fsflags |= MNT_RDONLY;
+			autoro = false;
+		}
 		else if (strcmp(opt->name, "rdonly") == 0) {
 			free(opt->name, M_MOUNT);
 			opt->name = strdup("ro", M_MOUNT);
 			fsflags |= MNT_RDONLY;
+			autoro = false;
 		}
+		else if (strcmp(opt->name, "autoro") == 0) {
+			vfs_freeopt(optlist, opt);
+			autoro = true;
+		}
 		else if (strcmp(opt->name, "suiddir") == 0)
 			fsflags |= MNT_SUIDDIR;
 		else if (strcmp(opt->name, "sync") == 0)
@@ -682,6 +724,19 @@ vfs_donmount(struct thread *td, uint64_t fsflags, stru
 	}
 
 	error = vfs_domount(td, fstype, fspath, fsflags, &optlist);
+
+	/*
+	 * See if we can mount in the read-only mode if the error code suggests
+	 * that it could be possible and the mount options allow for that.
+	 * Never try it if "[no]{ro|rw}" has been explicitly requested and not
+	 * overridden by "autoro".
+	 */
+	if (autoro && vfs_should_downgrade_to_ro_mount(fsflags, error)) {
+		printf("%s: R/W mount failed, possibly R/O media,"
+		    " trying R/O mount\n", __func__);
+		fsflags |= MNT_RDONLY;
+		error = vfs_domount(td, fstype, fspath, fsflags, &optlist);
+	}
 bail:
 	/* copyout the errmsg */
 	if (errmsg_pos != -1 && ((2 * errmsg_pos + 1) < fsoptions->uio_iovcnt)

From owner-svn-src-head@freebsd.org  Tue Mar 27 14:50:13 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53DEEF5C3BC;
 Tue, 27 Mar 2018 14:50:13 +0000 (UTC)
 (envelope-from trasz@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id F188769972;
 Tue, 27 Mar 2018 14:50:12 +0000 (UTC)
 (envelope-from trasz@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E815D1D7C0;
 Tue, 27 Mar 2018 14:50:12 +0000 (UTC)
 (envelope-from trasz@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2REoC2L074199;
 Tue, 27 Mar 2018 14:50:12 GMT (envelope-from trasz@FreeBSD.org)
Received: (from trasz@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2REoCAN074198;
 Tue, 27 Mar 2018 14:50:12 GMT (envelope-from trasz@FreeBSD.org)
Message-Id: <201803271450.w2REoCAN074198@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: trasz set sender to
 trasz@FreeBSD.org using -f
From: Edward Tomasz Napierala 
Date: Tue, 27 Mar 2018 14:50:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331617 - head/share/man/man7
X-SVN-Group: head
X-SVN-Commit-Author: trasz
X-SVN-Commit-Paths: head/share/man/man7
X-SVN-Commit-Revision: 331617
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 14:50:13 -0000

Author: trasz
Date: Tue Mar 27 14:50:12 2018
New Revision: 331617
URL: https://svnweb.freebsd.org/changeset/base/331617

Log:
  Fix capitalization.
  
  MFC after:	2 weeks

Modified:
  head/share/man/man7/development.7

Modified: head/share/man/man7/development.7
==============================================================================
--- head/share/man/man7/development.7	Tue Mar 27 14:31:42 2018	(r331616)
+++ head/share/man/man7/development.7	Tue Mar 27 14:50:12 2018	(r331617)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 13, 2018
+.Dd March 27, 2018
 .Dt DEVELOPMENT 7
 .Os
 .Sh NAME
@@ -83,7 +83,7 @@ such as freebsd-arch@ and freebsd-hackers@:
 .Pp
 .Lk https://lists.FreeBSD.org/
 .Pp
-To get your patches integrated into the main freebsd repository use Phabricator;
+To get your patches integrated into the main FreeBSD repository use Phabricator;
 it is a code review tool that allows other developers to review the changes,
 suggest improvements, and, eventually, allows them to pick up the change and
 commit it:

From owner-svn-src-head@freebsd.org  Tue Mar 27 14:51:20 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 417C0F5C5DD;
 Tue, 27 Mar 2018 14:51:20 +0000 (UTC)
 (envelope-from trasz@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 189DF69DB4;
 Tue, 27 Mar 2018 14:51:20 +0000 (UTC)
 (envelope-from trasz@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1381E1D805;
 Tue, 27 Mar 2018 14:51:20 +0000 (UTC)
 (envelope-from trasz@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2REpJhL078198;
 Tue, 27 Mar 2018 14:51:19 GMT (envelope-from trasz@FreeBSD.org)
Received: (from trasz@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2REpJP9078197;
 Tue, 27 Mar 2018 14:51:19 GMT (envelope-from trasz@FreeBSD.org)
Message-Id: <201803271451.w2REpJP9078197@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: trasz set sender to
 trasz@FreeBSD.org using -f
From: Edward Tomasz Napierala 
Date: Tue, 27 Mar 2018 14:51:19 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331618 - head/share/man/man7
X-SVN-Group: head
X-SVN-Commit-Author: trasz
X-SVN-Commit-Paths: head/share/man/man7
X-SVN-Commit-Revision: 331618
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 14:51:20 -0000

Author: trasz
Date: Tue Mar 27 14:51:19 2018
New Revision: 331618
URL: https://svnweb.freebsd.org/changeset/base/331618

Log:
  Use https:// instead of http://.
  
  MFC after:	2 weeks

Modified:
  head/share/man/man7/development.7

Modified: head/share/man/man7/development.7
==============================================================================
--- head/share/man/man7/development.7	Tue Mar 27 14:50:12 2018	(r331617)
+++ head/share/man/man7/development.7	Tue Mar 27 14:51:19 2018	(r331618)
@@ -57,7 +57,7 @@ can be found at:
 FreeBSD src development takes place in the CURRENT branch in Subversion,
 located at:
 .Pp
-.Lk http://svn.FreeBSD.org/base/head
+.Lk https://svn.FreeBSD.org/base/head
 .Pp
 There is also a read-only GitHub mirror at:
 .Pp

From owner-svn-src-head@freebsd.org  Tue Mar 27 14:54:03 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6FB5F5CC2F;
 Tue, 27 Mar 2018 14:54:03 +0000 (UTC)
 (envelope-from trasz@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 4B6C16A25B;
 Tue, 27 Mar 2018 14:54:03 +0000 (UTC)
 (envelope-from trasz@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 45DB91D950;
 Tue, 27 Mar 2018 14:54:03 +0000 (UTC)
 (envelope-from trasz@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2REs3J8079347;
 Tue, 27 Mar 2018 14:54:03 GMT (envelope-from trasz@FreeBSD.org)
Received: (from trasz@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2REs3sw079346;
 Tue, 27 Mar 2018 14:54:03 GMT (envelope-from trasz@FreeBSD.org)
Message-Id: <201803271454.w2REs3sw079346@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: trasz set sender to
 trasz@FreeBSD.org using -f
From: Edward Tomasz Napierala 
Date: Tue, 27 Mar 2018 14:54:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331619 - head/share/man/man7
X-SVN-Group: head
X-SVN-Commit-Author: trasz
X-SVN-Commit-Paths: head/share/man/man7
X-SVN-Commit-Revision: 331619
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 14:54:03 -0000

Author: trasz
Date: Tue Mar 27 14:54:02 2018
New Revision: 331619
URL: https://svnweb.freebsd.org/changeset/base/331619

Log:
  Add trailing slash for consistency.
  
  For some reason, the other link - https://lists.FreeBSD.org/ - needs
  the trailing slash, otherwise man(8) renders it in a weird way.  No
  idea why's that.  At least try to be consistent.  Revert it when the
  other link gets fixed.
  
  MFC after:	2 weeks

Modified:
  head/share/man/man7/development.7

Modified: head/share/man/man7/development.7
==============================================================================
--- head/share/man/man7/development.7	Tue Mar 27 14:51:19 2018	(r331618)
+++ head/share/man/man7/development.7	Tue Mar 27 14:54:02 2018	(r331619)
@@ -88,7 +88,7 @@ it is a code review tool that allows other developers 
 suggest improvements, and, eventually, allows them to pick up the change and
 commit it:
 .Pp
-.Lk https://reviews.FreeBSD.org
+.Lk https://reviews.FreeBSD.org/
 .Pp
 .Sh EXAMPLES
 Check out the CURRENT branch, build it, and install, overwriting the current

From owner-svn-src-head@freebsd.org  Tue Mar 27 14:55:02 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0536CF5CDA0;
 Tue, 27 Mar 2018 14:55:02 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id AC6EF6A3C8;
 Tue, 27 Mar 2018 14:55:01 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A73F31D951;
 Tue, 27 Mar 2018 14:55:01 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2REt1mn079480;
 Tue, 27 Mar 2018 14:55:01 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2REt1Cs079478;
 Tue, 27 Mar 2018 14:55:01 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201803271455.w2REt1Cs079478@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: Conrad Meyer 
Date: Tue, 27 Mar 2018 14:55:01 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331620 - in head/sys: contrib/libb2 crypto/blake2
X-SVN-Group: head
X-SVN-Commit-Author: cem
X-SVN-Commit-Paths: in head/sys: contrib/libb2 crypto/blake2
X-SVN-Commit-Revision: 331620
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 14:55:02 -0000

Author: cem
Date: Tue Mar 27 14:55:01 2018
New Revision: 331620
URL: https://svnweb.freebsd.org/changeset/base/331620

Log:
  MFV: libb2: use native calls for secure memory clearance
  
  Drop our local patch and restore full vanilla upstream code in
  contrib/libb2.
  
  No functional change intended.  explicit_bzero() should continue to be used.
  
  Obtained from:	libb2 b4b241a34824b51956a7866606329a065d397525
  Sponsored by:	Dell EMC Isilon

Modified:
  head/sys/contrib/libb2/blake2-impl.h
  head/sys/crypto/blake2/config.h

Modified: head/sys/contrib/libb2/blake2-impl.h
==============================================================================
--- head/sys/contrib/libb2/blake2-impl.h	Tue Mar 27 14:54:02 2018	(r331619)
+++ head/sys/contrib/libb2/blake2-impl.h	Tue Mar 27 14:55:01 2018	(r331620)
@@ -131,11 +131,20 @@ static inline uint64_t rotr64( const uint64_t w, const
 /* prevents compiler optimizing out memset() */
 static inline void secure_zero_memory(void *v, size_t n)
 {
-#ifdef __FreeBSD__
+#if defined(_WIN32) || defined(WIN32)
+  SecureZeroMemory(v, n);
+#else
+// prioritize first the general C11 call
+#if defined(HAVE_MEMSET_S)
+  memset_s(v, n, 0, n);
+#elif defined(HAVE_EXPLICIT_BZERO)
   explicit_bzero(v, n);
+#elif defined(HAVE_EXPLICIT_MEMSET)
+  explicit_memset(v, 0, n);
 #else
-  static void *(*const volatile memset_v)(void *, int, size_t) = &memset;
-  memset_v(v, 0, n);
+  memset(v, 0, n);
+  __asm__ __volatile__("" :: "r"(v) : "memory");
+#endif
 #endif
 }
 

Modified: head/sys/crypto/blake2/config.h
==============================================================================
--- head/sys/crypto/blake2/config.h	Tue Mar 27 14:54:02 2018	(r331619)
+++ head/sys/crypto/blake2/config.h	Tue Mar 27 14:55:01 2018	(r331620)
@@ -17,3 +17,5 @@
 #else
 #define HAVE_ALIGNED_ACCESS_REQUIRED 1
 #endif
+
+#define HAVE_EXPLICIT_BZERO 1

From owner-svn-src-head@freebsd.org  Tue Mar 27 14:57:08 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9454CF5D13F;
 Tue, 27 Mar 2018 14:57:08 +0000 (UTC)
 (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C7A476A5D3;
 Tue, 27 Mar 2018 14:57:07 +0000 (UTC)
 (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1])
 by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w2REv6j2052498;
 Tue, 27 Mar 2018 07:57:06 -0700 (PDT)
 (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
Received: (from freebsd@localhost)
 by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w2REv6tH052497;
 Tue, 27 Mar 2018 07:57:06 -0700 (PDT) (envelope-from freebsd)
From: "Rodney W. Grimes" 
Message-Id: <201803271457.w2REv6tH052497@pdx.rh.CN85.dnsmgr.net>
Subject: Re: svn commit: r331618 - head/share/man/man7
In-Reply-To: <201803271451.w2REpJP9078197@repo.freebsd.org>
To: Edward Tomasz Napierala 
Date: Tue, 27 Mar 2018 07:57:06 -0700 (PDT)
CC: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Reply-To: rgrimes@freebsd.org
X-Mailer: ELM [version 2.4ME+ PL121h (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 14:57:08 -0000

> Author: trasz
> Date: Tue Mar 27 14:51:19 2018
> New Revision: 331618
> URL: https://svnweb.freebsd.org/changeset/base/331618
> 
> Log:
>   Use https:// instead of http://.
>   
>   MFC after:	2 weeks
> 
> Modified:
>   head/share/man/man7/development.7
> 
> Modified: head/share/man/man7/development.7
> ==============================================================================
> --- head/share/man/man7/development.7	Tue Mar 27 14:50:12 2018	(r331617)
> +++ head/share/man/man7/development.7	Tue Mar 27 14:51:19 2018	(r331618)
> @@ -57,7 +57,7 @@ can be found at:
>  FreeBSD src development takes place in the CURRENT branch in Subversion,
>  located at:
>  .Pp
> -.Lk http://svn.FreeBSD.org/base/head
> +.Lk https://svn.FreeBSD.org/base/head
>  .Pp
>  There is also a read-only GitHub mirror at:
>  .Pp

Why do we want to run the load of TLS for what are public bits?
And fyi a default install of FreeBSD can not use https, you have
to install certs from ports before any of these https links
can even work, and that can be a royal pita in some situations.

I spent an hour one night in IRC helping a user get around this
specific issue, it was not fun!

-- 
Rod Grimes                                                 rgrimes@freebsd.org

From owner-svn-src-head@freebsd.org  Tue Mar 27 15:01:34 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 795F2F5DA15;
 Tue, 27 Mar 2018 15:01:34 +0000 (UTC)
 (envelope-from bjkfbsd@gmail.com)
Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com
 [IPv6:2607:f8b0:4003:c06::231])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 177886AB3F;
 Tue, 27 Mar 2018 15:01:34 +0000 (UTC)
 (envelope-from bjkfbsd@gmail.com)
Received: by mail-oi0-x231.google.com with SMTP id z8-v6so1014506oix.2;
 Tue, 27 Mar 2018 08:01:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=B5LfCLzC5wPDrmrE9Z+nm9Z7P9CNE7wDRsGB2lgEUos=;
 b=V7vK01iKEyJrT6glo3bxSpYj76cFBrDNw6NssUMOjAeuvbxlBpQBIaXcYBmjlLnpyr
 E3EgF8IU1CAtSxqNMWwYDMdtP5N/mr+Cb4CtXCmQYgF3f+k+8Ch7Eg+mnZNFvWLxhqiK
 W3KSQLOLb48wd/2w3t7JZeSd+Sa4UASAMNHgdnLoyBlHTIwgZ6OEVwPlSC4jAkvmwbQq
 tFWeXcRaQo97PXjx9GM8GsouoshyaF0gZrP8bkTpCG5U3EOIRLdm2GaBOLK9nnskkN9+
 Lz7Dn+cRhKfficACv0Ape/ovYpfc74rMDn9JMnlubebC6Y+CB8IoGqwt1SVLHyhWGGzn
 qf6Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=B5LfCLzC5wPDrmrE9Z+nm9Z7P9CNE7wDRsGB2lgEUos=;
 b=OfOWiDesUW9MU2/ncv06NYngn/Lw17aD+piDKAsMVHBg4nHYk8wWVpzxzrYzjA+Mql
 V8GPUvjUuwTpOkTG5GYEfNSW4KzJKWQ04/0MbiXLoqrmeynPKJXKxg9Xr+PH2PcgRHZB
 iL2GTats8EYMzpDPIe6F2rbNCRrr7ICvgizpzzqP2lw9xux8F1ezANv5cjJtvr8g41ZO
 A6NyuMYJgCotfR+IrxTcPlT0gB5MCLOoNPq8y0ic/F76Rf5StS9HgApC8dliR46hB0jP
 H1aQrm6Nbf5ToVAn0xXtZkAaK8Il+M5TcVy0dD6/101w8H/dCXZlQYi6GEoLR7jeLvKt
 tJlg==
X-Gm-Message-State: AElRT7GVllQLb0TtGn7XAU2gNTaQ9zvk42n+vTSrRa9JQl8gOOpnlig1
 Xw0j9CGeHZPuvDfpJOy+MK/FU6zH0ZFhT6VkbiU=
X-Google-Smtp-Source: AG47ELuKTvHm0ylqBy0MMLNZr7Y969nZgm0kqbQAyFfiG5mjXKDsP312fupHYD6avni/W6Pwaug6O3XV+SSdBMTZZWE=
X-Received: by 10.202.212.146 with SMTP id l140mr17310823oig.325.1522162892433; 
 Tue, 27 Mar 2018 08:01:32 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a9d:34b1:0:0:0:0:0 with HTTP; Tue, 27 Mar 2018 08:01:32
 -0700 (PDT)
In-Reply-To: <201803271457.w2REv6tH052497@pdx.rh.CN85.dnsmgr.net>
References: <201803271451.w2REpJP9078197@repo.freebsd.org>
 <201803271457.w2REv6tH052497@pdx.rh.CN85.dnsmgr.net>
From: Benjamin Kaduk 
Date: Tue, 27 Mar 2018 10:01:32 -0500
Message-ID: 
Subject: Re: svn commit: r331618 - head/share/man/man7
To: rgrimes@freebsd.org
Cc: Edward Tomasz Napierala , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers 
Content-Type: text/plain; charset="UTF-8"
X-Content-Filtered-By: Mailman/MimeDel 2.1.25
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 15:01:34 -0000

On Tue, Mar 27, 2018 at 9:57 AM, Rodney W. Grimes <
freebsd@pdx.rh.cn85.dnsmgr.net> wrote:

> > Author: trasz
> > Date: Tue Mar 27 14:51:19 2018
> > New Revision: 331618
> > URL: https://svnweb.freebsd.org/changeset/base/331618
> >
> > Log:
> >   Use https:// instead of http://.
> >
> >   MFC after:  2 weeks
> >
> > Modified:
> >   head/share/man/man7/development.7
> >
> > Modified: head/share/man/man7/development.7
> > ============================================================
> ==================
> > --- head/share/man/man7/development.7 Tue Mar 27 14:50:12 2018
> (r331617)
> > +++ head/share/man/man7/development.7 Tue Mar 27 14:51:19 2018
> (r331618)
> > @@ -57,7 +57,7 @@ can be found at:
> >  FreeBSD src development takes place in the CURRENT branch in Subversion,
> >  located at:
> >  .Pp
> > -.Lk http://svn.FreeBSD.org/base/head
> > +.Lk https://svn.FreeBSD.org/base/head
> >  .Pp
> >  There is also a read-only GitHub mirror at:
> >  .Pp
>
> Why do we want to run the load of TLS for what are public bits?
> And fyi a default install of FreeBSD can not use https, you have
> to install certs from ports before any of these https links
> can even work, and that can be a royal pita in some situations.
>

Many of us are used to thinking of the network as controlled by an attacker.
Running http-not-s to fetch the sources lets "the attacker" supply an
arbitrary
collection of bits under the name FreeBSD without a good way for the user to
check that the bits on their disk match what the FreeBSD Project expects
them to be.
TLS provides data integrity as well as confidentiality...

-Ben

From owner-svn-src-head@freebsd.org  Tue Mar 27 15:20:04 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0035F5F679;
 Tue, 27 Mar 2018 15:20:04 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 631E86BB01;
 Tue, 27 Mar 2018 15:20:04 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DD661DC9A;
 Tue, 27 Mar 2018 15:20:04 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RFK4Fb091237;
 Tue, 27 Mar 2018 15:20:04 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RFK3Rr091228;
 Tue, 27 Mar 2018 15:20:03 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803271520.w2RFK3Rr091228@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Tue, 27 Mar 2018 15:20:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331621 - in head/sys: compat/freebsd32 dev/md kern sys
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: in head/sys: compat/freebsd32 dev/md kern sys
X-SVN-Commit-Revision: 331621
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 15:20:05 -0000

Author: brooks
Date: Tue Mar 27 15:20:03 2018
New Revision: 331621
URL: https://svnweb.freebsd.org/changeset/base/331621

Log:
  Move uio enums to sys/_uio.h.
  
  Include _uio.h instead of uio.h in several headers to reduce header
  polution.
  
  Fix a few places that relied on header polution to get the uio.h header.
  
  I have not moved struct uio as many more things that use it rely on
  header polution to get other definitions from uio.h.
  
  Reviewed by:	cem, kib, markj
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14811

Added:
  head/sys/sys/_uio.h   (contents, props changed)
Modified:
  head/sys/compat/freebsd32/freebsd32_ioctl.c
  head/sys/dev/md/md.c
  head/sys/kern/tty_pts.c
  head/sys/kern/uipc_syscalls.c
  head/sys/sys/imgact.h
  head/sys/sys/namei.h
  head/sys/sys/syscallsubr.h
  head/sys/sys/uio.h

Modified: head/sys/compat/freebsd32/freebsd32_ioctl.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_ioctl.c	Tue Mar 27 14:55:01 2018	(r331620)
+++ head/sys/compat/freebsd32/freebsd32_ioctl.c	Tue Mar 27 15:20:03 2018	(r331621)
@@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 

Modified: head/sys/dev/md/md.c
==============================================================================
--- head/sys/dev/md/md.c	Tue Mar 27 14:55:01 2018	(r331620)
+++ head/sys/dev/md/md.c	Tue Mar 27 15:20:03 2018	(r331621)
@@ -89,6 +89,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 

Modified: head/sys/kern/tty_pts.c
==============================================================================
--- head/sys/kern/tty_pts.c	Tue Mar 27 14:55:01 2018	(r331620)
+++ head/sys/kern/tty_pts.c	Tue Mar 27 15:20:03 2018	(r331621)
@@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 

Modified: head/sys/kern/uipc_syscalls.c
==============================================================================
--- head/sys/kern/uipc_syscalls.c	Tue Mar 27 14:55:01 2018	(r331620)
+++ head/sys/kern/uipc_syscalls.c	Tue Mar 27 15:20:03 2018	(r331621)
@@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #ifdef KTRACE
 #include 
 #endif

Added: head/sys/sys/_uio.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/sys/_uio.h	Tue Mar 27 15:20:03 2018	(r331621)
@@ -0,0 +1,52 @@
+/*-
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Copyright (c) 1982, 1986, 1993, 1994
+ *	The Regents of the University of California.  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.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)uio.h	8.5 (Berkeley) 2/22/94
+ * $FreeBSD$
+ */
+
+#ifndef _SYS__UIO_H_
+#define	_SYS__UIO_H_
+
+#if __BSD_VISIBLE
+enum uio_rw {
+	UIO_READ,
+	UIO_WRITE
+};
+
+/* Segment flag values. */
+enum uio_seg {
+	UIO_USERSPACE,		/* from user data space */
+	UIO_SYSSPACE,		/* from system space */
+	UIO_NOCOPY		/* don't copy, already in object */
+};
+#endif /* __BSD_VISIBLE */
+
+#endif /* !_SYS__UIO_H_ */

Modified: head/sys/sys/imgact.h
==============================================================================
--- head/sys/sys/imgact.h	Tue Mar 27 14:55:01 2018	(r331620)
+++ head/sys/sys/imgact.h	Tue Mar 27 15:20:03 2018	(r331621)
@@ -34,7 +34,7 @@
 #ifndef _SYS_IMGACT_H_
 #define	_SYS_IMGACT_H_
 
-#include 
+#include 
 
 #include 
 

Modified: head/sys/sys/namei.h
==============================================================================
--- head/sys/sys/namei.h	Tue Mar 27 14:55:01 2018	(r331620)
+++ head/sys/sys/namei.h	Tue Mar 27 15:20:03 2018	(r331621)
@@ -38,7 +38,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 struct componentname {
 	/*

Modified: head/sys/sys/syscallsubr.h
==============================================================================
--- head/sys/sys/syscallsubr.h	Tue Mar 27 14:55:01 2018	(r331620)
+++ head/sys/sys/syscallsubr.h	Tue Mar 27 15:20:03 2018	(r331621)
@@ -31,13 +31,14 @@
 #define _SYS_SYSCALLSUBR_H_
 
 #include 
-#include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
+struct __wrusage;
 struct file;
 struct filecaps;
 enum idtype;
@@ -55,12 +56,12 @@ struct pollfd;
 struct ogetdirentries_args;
 struct rlimit;
 struct rusage;
+struct sched_param;
 union semun;
 struct sockaddr;
 struct stat;
 struct thr_param;
-struct sched_param;
-struct __wrusage;
+struct uio;
 
 int	kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg,
 	    size_t buflen, size_t path_max);

Modified: head/sys/sys/uio.h
==============================================================================
--- head/sys/sys/uio.h	Tue Mar 27 14:55:01 2018	(r331620)
+++ head/sys/sys/uio.h	Tue Mar 27 15:20:03 2018	(r331621)
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #ifndef _SSIZE_T_DECLARED
 typedef	__ssize_t	ssize_t;
@@ -47,17 +48,6 @@ typedef	__ssize_t	ssize_t;
 #ifndef _OFF_T_DECLARED
 typedef	__off_t	off_t;
 #define	_OFF_T_DECLARED
-#endif
-
-#if __BSD_VISIBLE
-enum	uio_rw { UIO_READ, UIO_WRITE };
-
-/* Segment flag values. */
-enum uio_seg {
-	UIO_USERSPACE,		/* from user data space */
-	UIO_SYSSPACE,		/* from system space */
-	UIO_NOCOPY		/* don't copy, already in object */
-};
 #endif
 
 #ifdef _KERNEL

From owner-svn-src-head@freebsd.org  Tue Mar 27 15:29:34 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7002F60729;
 Tue, 27 Mar 2018 15:29:33 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 89CB36C3F3;
 Tue, 27 Mar 2018 15:29:33 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 679451DE35;
 Tue, 27 Mar 2018 15:29:33 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RFTX6Z096757;
 Tue, 27 Mar 2018 15:29:33 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RFTWx1096745;
 Tue, 27 Mar 2018 15:29:32 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201803271529.w2RFTWx1096745@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov 
Date: Tue, 27 Mar 2018 15:29:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331622 - in head: sbin/ifconfig sys/net sys/sys
X-SVN-Group: head
X-SVN-Commit-Author: kib
X-SVN-Commit-Paths: in head: sbin/ifconfig sys/net sys/sys
X-SVN-Commit-Revision: 331622
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 15:29:34 -0000

Author: kib
Date: Tue Mar 27 15:29:32 2018
New Revision: 331622
URL: https://svnweb.freebsd.org/changeset/base/331622

Log:
  Allow to specify PCP on packets not belonging to any VLAN.
  
  According to 802.1Q-2014, VLAN tagged packets with VLAN id 0 should be
  considered as untagged, and only PCP and DEI values from the VLAN tag
  are meaningful.  See for instance
  https://www.cisco.com/c/en/us/td/docs/switches/connectedgrid/cg-switch-sw-master/software/configuration/guide/vlan0/b_vlan_0.html.
  
  Make it possible to specify PCP value for outgoing packets on an
  ethernet interface.  When PCP is supplied, the tag is appended, VLAN
  id set to 0, and PCP is filled by the supplied value.  The code to do
  VLAN tag encapsulation is refactored from the if_vlan.c and moved into
  if_ethersubr.c.
  
  Drivers might have issues with filtering VID 0 packets on
  receive.  This bug should be fixed for each driver.
  
  Reviewed by:	ae (previous version), hselasky, melifaro
  Sponsored by:	Mellanox Technologies
  MFC after:	2 weeks
  Differential revision:	https://reviews.freebsd.org/D14702

Modified:
  head/sbin/ifconfig/af_link.c
  head/sbin/ifconfig/ifconfig.c
  head/sys/net/ethernet.h
  head/sys/net/if.c
  head/sys/net/if.h
  head/sys/net/if_ethersubr.c
  head/sys/net/if_var.h
  head/sys/net/if_vlan.c
  head/sys/net/if_vlan_var.h
  head/sys/sys/priv.h
  head/sys/sys/sockio.h

Modified: head/sbin/ifconfig/af_link.c
==============================================================================
--- head/sbin/ifconfig/af_link.c	Tue Mar 27 15:20:03 2018	(r331621)
+++ head/sbin/ifconfig/af_link.c	Tue Mar 27 15:29:32 2018	(r331622)
@@ -60,78 +60,78 @@ static void
 link_status(int s __unused, const struct ifaddrs *ifa)
 {
 	/* XXX no const 'cuz LLADDR is defined wrong */
-	struct sockaddr_dl *sdl = (struct sockaddr_dl *) ifa->ifa_addr;
+	struct sockaddr_dl *sdl;
 	char *ether_format, *format_char;
+	struct ifreq ifr;
+	int n, rc, sock_hw;
+	static const u_char laggaddr[6] = {0};
 
-	if (sdl != NULL && sdl->sdl_alen > 0) {
-		if ((sdl->sdl_type == IFT_ETHER ||
-		    sdl->sdl_type == IFT_L2VLAN ||
-		    sdl->sdl_type == IFT_BRIDGE) &&
-		    sdl->sdl_alen == ETHER_ADDR_LEN) {
-			ether_format = ether_ntoa((struct ether_addr *)LLADDR(sdl));
-			if (f_ether != NULL && strcmp(f_ether, "dash") == 0) {
-				for (format_char = strchr(ether_format, ':');
-				    format_char != NULL; 
-				    format_char = strchr(ether_format, ':'))
-					*format_char = '-';
-			}
-			printf("\tether %s\n", ether_format);
-		} else {
-			int n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0;
+	sdl = (struct sockaddr_dl *) ifa->ifa_addr;
+	if (sdl == NULL || sdl->sdl_alen == 0)
+		return;
 
-			printf("\tlladdr %s\n", link_ntoa(sdl) + n);
+	if ((sdl->sdl_type == IFT_ETHER || sdl->sdl_type == IFT_L2VLAN ||
+	    sdl->sdl_type == IFT_BRIDGE) && sdl->sdl_alen == ETHER_ADDR_LEN) {
+		ether_format = ether_ntoa((struct ether_addr *)LLADDR(sdl));
+		if (f_ether != NULL && strcmp(f_ether, "dash") == 0) {
+			for (format_char = strchr(ether_format, ':');
+			    format_char != NULL;
+			    format_char = strchr(ether_format, ':'))
+				*format_char = '-';
 		}
-		/* Best-effort (i.e. failures are silent) to get original
-		 * hardware address, as read by NIC driver at attach time. Only
-		 * applies to Ethernet NICs (IFT_ETHER). However, laggX
-		 * interfaces claim to be IFT_ETHER, and re-type their component
-		 * Ethernet NICs as IFT_IEEE8023ADLAG. So, check for both. If
-		 * the MAC is zeroed, then it's actually a lagg.
-		 */
-		if ((sdl->sdl_type == IFT_ETHER ||
-		    sdl->sdl_type == IFT_IEEE8023ADLAG) &&
-		    sdl->sdl_alen == ETHER_ADDR_LEN) {
-			struct ifreq ifr;
-			int sock_hw;
-			int rc;
-			static const u_char laggaddr[6] = {0};
+		printf("\tether %s\n", ether_format);
+	} else {
+		n = sdl->sdl_nlen > 0 ? sdl->sdl_nlen + 1 : 0;
+		printf("\tlladdr %s\n", link_ntoa(sdl) + n);
+	}
 
-			strncpy(ifr.ifr_name, ifa->ifa_name,
-			    sizeof(ifr.ifr_name));
-			memcpy(&ifr.ifr_addr, ifa->ifa_addr,
-			    sizeof(ifa->ifa_addr->sa_len));
-			ifr.ifr_addr.sa_family = AF_LOCAL;
-			if ((sock_hw = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0) {
-				warn("socket(AF_LOCAL,SOCK_DGRAM)");
-				return;
-			}
-			rc = ioctl(sock_hw, SIOCGHWADDR, &ifr);
-			close(sock_hw);
-			if (rc != 0) {
-				return;
-			}
+	/*
+	 * Best-effort (i.e. failures are silent) to get original
+	 * hardware address, as read by NIC driver at attach time. Only
+	 * applies to Ethernet NICs (IFT_ETHER). However, laggX
+	 * interfaces claim to be IFT_ETHER, and re-type their component
+	 * Ethernet NICs as IFT_IEEE8023ADLAG. So, check for both. If
+	 * the MAC is zeroed, then it's actually a lagg.
+	 */
+	if ((sdl->sdl_type != IFT_ETHER &&
+	    sdl->sdl_type != IFT_IEEE8023ADLAG) ||
+	    sdl->sdl_alen != ETHER_ADDR_LEN)
+		return;
 
-			/*
-			 * If this is definitely a lagg device or the hwaddr
-			 * matches the link addr, don't bother.
-			 */
-			if (memcmp(ifr.ifr_addr.sa_data, laggaddr,
-			    sdl->sdl_alen) == 0 ||
-			    memcmp(ifr.ifr_addr.sa_data, LLADDR(sdl),
-			    sdl->sdl_alen) == 0) {
-				return;
-			}
-			ether_format = ether_ntoa((const struct ether_addr *)
-			    &ifr.ifr_addr.sa_data);
-			if (f_ether != NULL && strcmp(f_ether, "dash") == 0) {
-				for (format_char = strchr(ether_format, ':');
-				    format_char != NULL; 
-				    format_char = strchr(ether_format, ':'))
-					*format_char = '-';
-			}
-			printf("\thwaddr %s\n", ether_format);
-		}
+	strncpy(ifr.ifr_name, ifa->ifa_name, sizeof(ifr.ifr_name));
+	memcpy(&ifr.ifr_addr, ifa->ifa_addr, sizeof(ifa->ifa_addr->sa_len));
+	ifr.ifr_addr.sa_family = AF_LOCAL;
+	if ((sock_hw = socket(AF_LOCAL, SOCK_DGRAM, 0)) < 0) {
+		warn("socket(AF_LOCAL,SOCK_DGRAM)");
+		return;
 	}
+	rc = ioctl(sock_hw, SIOCGHWADDR, &ifr);
+	close(sock_hw);
+	if (rc != 0)
+		return;
+
+	/*
+	 * If this is definitely a lagg device or the hwaddr
+	 * matches the link addr, don't bother.
+	 */
+	if (memcmp(ifr.ifr_addr.sa_data, laggaddr, sdl->sdl_alen) == 0 ||
+	    memcmp(ifr.ifr_addr.sa_data, LLADDR(sdl), sdl->sdl_alen) == 0)
+		goto pcp;
+
+	ether_format = ether_ntoa((const struct ether_addr *)
+	    &ifr.ifr_addr.sa_data);
+	if (f_ether != NULL && strcmp(f_ether, "dash") == 0) {
+		for (format_char = strchr(ether_format, ':');
+		     format_char != NULL;
+		     format_char = strchr(ether_format, ':'))
+			*format_char = '-';
+	}
+	printf("\thwaddr %s\n", ether_format);
+
+pcp:
+	if (ioctl(s, SIOCGLANPCP, (caddr_t)&ifr) == 0 &&
+	    ifr.ifr_lan_pcp != IFNET_PCP_NONE)
+		printf("\tpcp %d\n", ifr.ifr_lan_pcp);
 }
 
 static void

Modified: head/sbin/ifconfig/ifconfig.c
==============================================================================
--- head/sbin/ifconfig/ifconfig.c	Tue Mar 27 15:20:03 2018	(r331621)
+++ head/sbin/ifconfig/ifconfig.c	Tue Mar 27 15:29:32 2018	(r331622)
@@ -1080,6 +1080,32 @@ setifmtu(const char *val, int dummy __unused, int s, 
 }
 
 static void
+setifpcp(const char *val, int arg __unused, int s, const struct afswtch *afp)
+{
+	u_long ul;
+	char *endp;
+
+	ul = strtoul(val, &endp, 0);
+	if (*endp != '\0')
+		errx(1, "invalid value for pcp");
+	if (ul > 7)
+		errx(1, "value for pcp out of range");
+	ifr.ifr_lan_pcp = ul;
+	if (ioctl(s, SIOCSLANPCP, (caddr_t)&ifr) == -1)
+		err(1, "SIOCSLANPCP");
+}
+
+static void
+disableifpcp(const char *val, int arg __unused, int s,
+    const struct afswtch *afp)
+{
+
+	ifr.ifr_lan_pcp = IFNET_PCP_NONE;
+	if (ioctl(s, SIOCSLANPCP, (caddr_t)&ifr) == -1)
+		err(1, "SIOCSLANPCP");
+}
+
+static void
 setifname(const char *val, int dummy __unused, int s, 
     const struct afswtch *afp)
 {
@@ -1436,6 +1462,8 @@ static struct cmd basic_cmds[] = {
 	DEF_CMD("-txcsum",	-IFCAP_TXCSUM,	setifcap),
 	DEF_CMD("netcons",	IFCAP_NETCONS,	setifcap),
 	DEF_CMD("-netcons",	-IFCAP_NETCONS,	setifcap),
+	DEF_CMD_ARG("pcp",			setifpcp),
+	DEF_CMD("-pcp", 0,			disableifpcp),
 	DEF_CMD("polling",	IFCAP_POLLING,	setifcap),
 	DEF_CMD("-polling",	-IFCAP_POLLING,	setifcap),
 	DEF_CMD("tso6",		IFCAP_TSO6,	setifcap),

Modified: head/sys/net/ethernet.h
==============================================================================
--- head/sys/net/ethernet.h	Tue Mar 27 15:20:03 2018	(r331621)
+++ head/sys/net/ethernet.h	Tue Mar 27 15:29:32 2018	(r331622)
@@ -385,6 +385,20 @@ struct ether_vlan_header {
 	}								\
 } while (0)
 
+/*
+ * Names for 802.1q priorities ("802.1p").  Notice that in this scheme,
+ * (0 < 1), allowing default 0-tagged traffic to take priority over background
+ * tagged traffic.
+ */
+#define	IEEE8021Q_PCP_BK	1	/* Background (lowest) */
+#define	IEEE8021Q_PCP_BE	0	/* Best effort (default) */
+#define	IEEE8021Q_PCP_EE	2	/* Excellent effort */
+#define	IEEE8021Q_PCP_CA	3	/* Critical applications */
+#define	IEEE8021Q_PCP_VI	4	/* Video, < 100ms latency */
+#define	IEEE8021Q_PCP_VO	5	/* Video, < 10ms latency */
+#define	IEEE8021Q_PCP_IC	6	/* Internetwork control */
+#define	IEEE8021Q_PCP_NC	7	/* Network control (highest) */
+
 #ifdef _KERNEL
 
 struct ifnet;
@@ -406,6 +420,8 @@ extern	char *ether_sprintf(const u_int8_t *);
 void	ether_vlan_mtap(struct bpf_if *, struct mbuf *,
 	    void *, u_int);
 struct mbuf  *ether_vlanencap(struct mbuf *, uint16_t);
+bool	ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, struct ifnet *p,
+	    uint16_t vid, uint8_t pcp);
 
 #ifdef _SYS_EVENTHANDLER_H_
 /* new ethernet interface attached event */

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Tue Mar 27 15:20:03 2018	(r331621)
+++ head/sys/net/if.c	Tue Mar 27 15:29:32 2018	(r331622)
@@ -485,6 +485,7 @@ if_alloc(u_char type)
 	for (int i = 0; i < IFCOUNTERS; i++)
 		ifp->if_counters[i] = counter_u64_alloc(M_WAITOK);
 	ifp->if_get_counter = if_get_counter_default;
+	ifp->if_pcp = IFNET_PCP_NONE;
 	ifnet_setbyindex(ifp->if_index, ifp);
 	return (ifp);
 }

Modified: head/sys/net/if.h
==============================================================================
--- head/sys/net/if.h	Tue Mar 27 15:20:03 2018	(r331621)
+++ head/sys/net/if.h	Tue Mar 27 15:29:32 2018	(r331622)
@@ -416,6 +416,7 @@ struct	ifreq {
 #define	ifr_index	ifr_ifru.ifru_index	/* interface index */
 #define	ifr_fib		ifr_ifru.ifru_fib	/* interface fib */
 #define	ifr_vlan_pcp	ifr_ifru.ifru_vlan_pcp	/* VLAN priority */
+#define	ifr_lan_pcp	ifr_ifru.ifru_vlan_pcp	/* VLAN priority */
 };
 
 #define	_SIZEOF_ADDR_IFREQ(ifr) \
@@ -564,6 +565,8 @@ struct ifrsshash {
 	uint16_t	ifrh_spare1;
 	uint32_t	ifrh_types;		/* RSS_TYPE_ */
 };
+
+#define	IFNET_PCP_NONE	0xff	/* PCP disabled */
 
 #endif /* __BSD_VISIBLE */
 

Modified: head/sys/net/if_ethersubr.c
==============================================================================
--- head/sys/net/if_ethersubr.c	Tue Mar 27 15:20:03 2018	(r331621)
+++ head/sys/net/if_ethersubr.c	Tue Mar 27 15:29:32 2018	(r331622)
@@ -47,6 +47,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -437,6 +438,19 @@ bad:			if (m != NULL)
 	return ether_output_frame(ifp, m);
 }
 
+static bool
+ether_set_pcp(struct mbuf **mp, struct ifnet *ifp, uint8_t pcp)
+{
+	struct ether_header *eh;
+
+	eh = mtod(*mp, struct ether_header *);
+	if (ntohs(eh->ether_type) == ETHERTYPE_VLAN ||
+	    ether_8021q_frame(mp, ifp, ifp, 0, pcp))
+		return (true);
+	if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
+	return (false);
+}
+
 /*
  * Ethernet link layer output routine to send a raw frame to the device.
  *
@@ -446,13 +460,17 @@ bad:			if (m != NULL)
 int
 ether_output_frame(struct ifnet *ifp, struct mbuf *m)
 {
-	int i;
+	int error;
+	uint8_t pcp;
 
-	if (PFIL_HOOKED(&V_link_pfil_hook)) {
-		i = pfil_run_hooks(&V_link_pfil_hook, &m, ifp, PFIL_OUT, 0,
-		    NULL);
+	pcp = ifp->if_pcp;
+	if (pcp != IFNET_PCP_NONE && !ether_set_pcp(&m, ifp, pcp))
+		return (0);
 
-		if (i != 0)
+	if (PFIL_HOOKED(&V_link_pfil_hook)) {
+		error = pfil_run_hooks(&V_link_pfil_hook, &m, ifp,
+		    PFIL_OUT, 0, NULL);
+		if (error != 0)
 			return (EACCES);
 
 		if (m == NULL)
@@ -1109,6 +1127,22 @@ ether_ioctl(struct ifnet *ifp, u_long command, caddr_t
 			ifp->if_mtu = ifr->ifr_mtu;
 		}
 		break;
+
+	case SIOCSLANPCP:
+		error = priv_check(curthread, PRIV_NET_SETLANPCP);
+		if (error != 0)
+			break;
+		if (ifr->ifr_lan_pcp > 7 &&
+		    ifr->ifr_lan_pcp != IFNET_PCP_NONE)
+			error = EINVAL;
+		else
+			ifp->if_pcp = ifr->ifr_lan_pcp;
+		break;
+
+	case SIOCGLANPCP:
+		ifr->ifr_lan_pcp = ifp->if_pcp;
+		break;
+
 	default:
 		error = EINVAL;			/* XXX netbsd has ENOTTY??? */
 		break;
@@ -1255,6 +1289,87 @@ ether_vlanencap(struct mbuf *m, uint16_t tag)
 	evl->evl_encap_proto = htons(ETHERTYPE_VLAN);
 	evl->evl_tag = htons(tag);
 	return (m);
+}
+
+static SYSCTL_NODE(_net_link, IFT_L2VLAN, vlan, CTLFLAG_RW, 0,
+    "IEEE 802.1Q VLAN");
+static SYSCTL_NODE(_net_link_vlan, PF_LINK, link, CTLFLAG_RW, 0,
+    "for consistency");
+
+static VNET_DEFINE(int, soft_pad);
+#define	V_soft_pad	VNET(soft_pad)
+SYSCTL_INT(_net_link_vlan, OID_AUTO, soft_pad, CTLFLAG_RW | CTLFLAG_VNET,
+    &VNET_NAME(soft_pad), 0,
+    "pad short frames before tagging");
+
+/*
+ * For now, make preserving PCP via an mbuf tag optional, as it increases
+ * per-packet memory allocations and frees.  In the future, it would be
+ * preferable to reuse ether_vtag for this, or similar.
+ */
+int vlan_mtag_pcp = 0;
+SYSCTL_INT(_net_link_vlan, OID_AUTO, mtag_pcp, CTLFLAG_RW,
+    &vlan_mtag_pcp, 0,
+    "Retain VLAN PCP information as packets are passed up the stack");
+
+bool
+ether_8021q_frame(struct mbuf **mp, struct ifnet *ife, struct ifnet *p,
+    uint16_t vid, uint8_t pcp)
+{
+	struct m_tag *mtag;
+	int n;
+	uint16_t tag;
+	static const char pad[8];	/* just zeros */
+
+	/*
+	 * Pad the frame to the minimum size allowed if told to.
+	 * This option is in accord with IEEE Std 802.1Q, 2003 Ed.,
+	 * paragraph C.4.4.3.b.  It can help to work around buggy
+	 * bridges that violate paragraph C.4.4.3.a from the same
+	 * document, i.e., fail to pad short frames after untagging.
+	 * E.g., a tagged frame 66 bytes long (incl. FCS) is OK, but
+	 * untagging it will produce a 62-byte frame, which is a runt
+	 * and requires padding.  There are VLAN-enabled network
+	 * devices that just discard such runts instead or mishandle
+	 * them somehow.
+	 */
+	if (V_soft_pad && p->if_type == IFT_ETHER) {
+		for (n = ETHERMIN + ETHER_HDR_LEN - (*mp)->m_pkthdr.len;
+		     n > 0; n -= sizeof(pad)) {
+			if (!m_append(*mp, min(n, sizeof(pad)), pad))
+				break;
+		}
+		if (n > 0) {
+			m_freem(*mp);
+			*mp = NULL;
+			if_printf(ife, "cannot pad short frame");
+			return (false);
+		}
+	}
+
+	/*
+	 * If underlying interface can do VLAN tag insertion itself,
+	 * just pass the packet along. However, we need some way to
+	 * tell the interface where the packet came from so that it
+	 * knows how to find the VLAN tag to use, so we attach a
+	 * packet tag that holds it.
+	 */
+	if (vlan_mtag_pcp && (mtag = m_tag_locate(*mp, MTAG_8021Q,
+	    MTAG_8021Q_PCP_OUT, NULL)) != NULL)
+		tag = EVL_MAKETAG(vid, *(uint8_t *)(mtag + 1), 0);
+	else
+		tag = EVL_MAKETAG(vid, pcp, 0);
+	if (p->if_capenable & IFCAP_VLAN_HWTAGGING) {
+		(*mp)->m_pkthdr.ether_vtag = tag;
+		(*mp)->m_flags |= M_VLANTAG;
+	} else {
+		*mp = ether_vlanencap(*mp, tag);
+		if (*mp == NULL) {
+			if_printf(ife, "unable to prepend 802.1Q header");
+			return (false);
+		}
+	}
+	return (true);
 }
 
 DECLARE_MODULE(ether, ether_mod, SI_SUB_INIT_IF, SI_ORDER_ANY);

Modified: head/sys/net/if_var.h
==============================================================================
--- head/sys/net/if_var.h	Tue Mar 27 15:20:03 2018	(r331621)
+++ head/sys/net/if_var.h	Tue Mar 27 15:29:32 2018	(r331622)
@@ -365,6 +365,9 @@ struct ifnet {
 	if_snd_tag_query_t *if_snd_tag_query;
 	if_snd_tag_free_t *if_snd_tag_free;
 
+	/* Ethernet PCP */
+	uint8_t if_pcp;
+
 	/*
 	 * Spare fields to be added before branching a stable branch, so
 	 * that structure can be enhanced without changing the kernel

Modified: head/sys/net/if_vlan.c
==============================================================================
--- head/sys/net/if_vlan.c	Tue Mar 27 15:20:03 2018	(r331621)
+++ head/sys/net/if_vlan.c	Tue Mar 27 15:29:32 2018	(r331622)
@@ -196,26 +196,8 @@ static struct {
 	{0, NULL}
 };
 
-SYSCTL_DECL(_net_link);
-static SYSCTL_NODE(_net_link, IFT_L2VLAN, vlan, CTLFLAG_RW, 0,
-    "IEEE 802.1Q VLAN");
-static SYSCTL_NODE(_net_link_vlan, PF_LINK, link, CTLFLAG_RW, 0,
-    "for consistency");
+extern int vlan_mtag_pcp;
 
-static VNET_DEFINE(int, soft_pad);
-#define	V_soft_pad	VNET(soft_pad)
-SYSCTL_INT(_net_link_vlan, OID_AUTO, soft_pad, CTLFLAG_RW | CTLFLAG_VNET,
-    &VNET_NAME(soft_pad), 0, "pad short frames before tagging");
-
-/*
- * For now, make preserving PCP via an mbuf tag optional, as it increases
- * per-packet memory allocations and frees.  In the future, it would be
- * preferable to reuse ether_vtag for this, or similar.
- */
-static int vlan_mtag_pcp = 0;
-SYSCTL_INT(_net_link_vlan, OID_AUTO, mtag_pcp, CTLFLAG_RW, &vlan_mtag_pcp, 0,
-	"Retain VLAN PCP information as packets are passed up the stack");
-
 static const char vlanname[] = "vlan";
 static MALLOC_DEFINE(M_VLAN, vlanname, "802.1Q Virtual LAN Interface");
 
@@ -1171,8 +1153,6 @@ vlan_transmit(struct ifnet *ifp, struct mbuf *m)
 {
 	struct ifvlan *ifv;
 	struct ifnet *p;
-	struct m_tag *mtag;
-	uint16_t tag;
 	int error, len, mcast;
 	VLAN_LOCK_READER;
 
@@ -1201,59 +1181,10 @@ vlan_transmit(struct ifnet *ifp, struct mbuf *m)
 		return (ENETDOWN);
 	}
 
-	/*
-	 * Pad the frame to the minimum size allowed if told to.
-	 * This option is in accord with IEEE Std 802.1Q, 2003 Ed.,
-	 * paragraph C.4.4.3.b.  It can help to work around buggy
-	 * bridges that violate paragraph C.4.4.3.a from the same
-	 * document, i.e., fail to pad short frames after untagging.
-	 * E.g., a tagged frame 66 bytes long (incl. FCS) is OK, but
-	 * untagging it will produce a 62-byte frame, which is a runt
-	 * and requires padding.  There are VLAN-enabled network
-	 * devices that just discard such runts instead or mishandle
-	 * them somehow.
-	 */
-	if (V_soft_pad && p->if_type == IFT_ETHER) {
-		static char pad[8];	/* just zeros */
-		int n;
-
-		for (n = ETHERMIN + ETHER_HDR_LEN - m->m_pkthdr.len;
-		     n > 0; n -= sizeof(pad))
-			if (!m_append(m, min(n, sizeof(pad)), pad))
-				break;
-
-		if (n > 0) {
-			if_printf(ifp, "cannot pad short frame\n");
-			if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
-			VLAN_RUNLOCK();
-			m_freem(m);
-			return (0);
-		}
-	}
-
-	/*
-	 * If underlying interface can do VLAN tag insertion itself,
-	 * just pass the packet along. However, we need some way to
-	 * tell the interface where the packet came from so that it
-	 * knows how to find the VLAN tag to use, so we attach a
-	 * packet tag that holds it.
-	 */
-	if (vlan_mtag_pcp && (mtag = m_tag_locate(m, MTAG_8021Q,
-	    MTAG_8021Q_PCP_OUT, NULL)) != NULL)
-		tag = EVL_MAKETAG(ifv->ifv_vid, *(uint8_t *)(mtag + 1), 0);
-	else
-              tag = ifv->ifv_tag;
-	if (p->if_capenable & IFCAP_VLAN_HWTAGGING) {
-		m->m_pkthdr.ether_vtag = tag;
-		m->m_flags |= M_VLANTAG;
-	} else {
-		m = ether_vlanencap(m, tag);
-		if (m == NULL) {
-			if_printf(ifp, "unable to prepend VLAN header\n");
-			if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
-			VLAN_RUNLOCK();
-			return (0);
-		}
+	if (!ether_8021q_frame(&m, ifp, p, ifv->ifv_vid, ifv->ifv_pcp)) {
+		if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
+		VLAN_RUNLOCK();
+		return (0);
 	}
 
 	/*

Modified: head/sys/net/if_vlan_var.h
==============================================================================
--- head/sys/net/if_vlan_var.h	Tue Mar 27 15:20:03 2018	(r331621)
+++ head/sys/net/if_vlan_var.h	Tue Mar 27 15:29:32 2018	(r331622)
@@ -73,22 +73,8 @@ struct	vlanreq {
 #define	SIOCSETVLAN	SIOCSIFGENERIC
 #define	SIOCGETVLAN	SIOCGIFGENERIC
 
-#define	SIOCGVLANPCP	_IOWR('i', 152, struct ifreq)	/* Get VLAN PCP */
-#define	SIOCSVLANPCP	 _IOW('i', 153, struct ifreq)	/* Set VLAN PCP */
-
-/*
- * Names for 802.1q priorities ("802.1p").  Notice that in this scheme,
- * (0 < 1), allowing default 0-tagged traffic to take priority over background
- * tagged traffic.
- */
-#define	IEEE8021Q_PCP_BK	1	/* Background (lowest) */
-#define	IEEE8021Q_PCP_BE	0	/* Best effort (default) */
-#define	IEEE8021Q_PCP_EE	2	/* Excellent effort */
-#define	IEEE8021Q_PCP_CA	3	/* Critical applications */
-#define	IEEE8021Q_PCP_VI	4	/* Video, < 100ms latency */
-#define	IEEE8021Q_PCP_VO	5	/* Video, < 10ms latency */
-#define	IEEE8021Q_PCP_IC	6	/* Internetwork control */
-#define	IEEE8021Q_PCP_NC	7	/* Network control (highest) */
+#define	SIOCGVLANPCP	SIOCGLANPCP	/* Get VLAN PCP */
+#define	SIOCSVLANPCP	SIOCSLANPCP	/* Set VLAN PCP */
 
 #ifdef _KERNEL
 /*

Modified: head/sys/sys/priv.h
==============================================================================
--- head/sys/sys/priv.h	Tue Mar 27 15:20:03 2018	(r331621)
+++ head/sys/sys/priv.h	Tue Mar 27 15:29:32 2018	(r331622)
@@ -344,7 +344,8 @@
 #define	PRIV_NET_SETIFDESCR	418	/* Set interface description. */
 #define	PRIV_NET_SETIFFIB	419	/* Set interface fib. */
 #define	PRIV_NET_VXLAN		420	/* Administer vxlan. */
-#define	PRIV_NET_SETVLANPCP	421	/* Set VLAN priority. */
+#define	PRIV_NET_SETLANPCP	421	/* Set LAN priority. */
+#define	PRIV_NET_SETVLANPCP	PRIV_NET_SETLANPCP /* Alias Set VLAN priority */
 
 /*
  * 802.11-related privileges.

Modified: head/sys/sys/sockio.h
==============================================================================
--- head/sys/sys/sockio.h	Tue Mar 27 15:20:03 2018	(r331621)
+++ head/sys/sys/sockio.h	Tue Mar 27 15:29:32 2018	(r331622)
@@ -140,4 +140,7 @@
 #define	SIOCGIFRSSHASH	_IOWR('i', 151, struct ifrsshash)/* get the current RSS
 							type/func settings */
 
+#define	SIOCGLANPCP	_IOWR('i', 152, struct ifreq)	/* Get (V)LAN PCP */
+#define	SIOCSLANPCP	 _IOW('i', 153, struct ifreq)	/* Set (V)LAN PCP */
+
 #endif /* !_SYS_SOCKIO_H_ */

From owner-svn-src-head@freebsd.org  Tue Mar 27 15:30:11 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50886F607E9;
 Tue, 27 Mar 2018 15:30:11 +0000 (UTC)
 (envelope-from cse.cem@gmail.com)
Received: from mail-io0-f178.google.com (mail-io0-f178.google.com
 [209.85.223.178])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id DD1FE6C5BC;
 Tue, 27 Mar 2018 15:30:10 +0000 (UTC)
 (envelope-from cse.cem@gmail.com)
Received: by mail-io0-f178.google.com with SMTP id q80so17161894ioi.13;
 Tue, 27 Mar 2018 08:30:10 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:reply-to:in-reply-to:references
 :from:date:message-id:subject:to:cc:content-transfer-encoding;
 bh=pmSdjxBghO1vqyU3uibPtwbrI/QppnU2Lr1ja3qdr84=;
 b=EKWJK5sNF/D/vMOdfuHXuJ7MN4XOO7yrRQP4W77MyoU0YxdDAhWv5KYallYhmwVVqY
 4tTso7zTUPoRdx7hLKq4g2ngtgilZ46y2rjU7Elat0n3OO1m3vPxsm9b55qFhccBXIYG
 oLnnsxnfbikkgQ0V6MvIoGyMmPnRkyQ6B6ZqR0PzaCilQsUpZs2hs1YQ3Z1XpJ7OFgIn
 0MTyqAHba7Yb6fpmr0tKoAOX5Js4YEJxASJkWfsabKksjiitGb3v+gNP6fdqx83QCZak
 CBvFgcq9DLOU8MFBGVx/Q8JbuZkXxO6flIn6vKsgx0Ya9hspy/pZ+fhTbrZesEtxIPCK
 Czfg==
X-Gm-Message-State: AElRT7E96cHkKop+1fQSdRyOAp8FoJKE+JaGzjamqb/3tfFWJ88wK8Ob
 z3R1Tdw7G92pJe8zpgj146GYsntb
X-Google-Smtp-Source: AIpwx48hP3QtutDDIbRwavPs1LufinpUCge4mzy/+Umsff9xtPg4/mDjeBjolsJ7UERWQnn7QnoPSA==
X-Received: by 10.107.178.200 with SMTP id b191mr3641700iof.138.1522164609663; 
 Tue, 27 Mar 2018 08:30:09 -0700 (PDT)
Received: from mail-io0-f179.google.com (mail-io0-f179.google.com.
 [209.85.223.179])
 by smtp.gmail.com with ESMTPSA id k4-v6sm1310029ith.4.2018.03.27.08.30.09
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 27 Mar 2018 08:30:09 -0700 (PDT)
Received: by mail-io0-f179.google.com with SMTP id b20so28084514iof.5;
 Tue, 27 Mar 2018 08:30:09 -0700 (PDT)
X-Received: by 10.107.181.72 with SMTP id e69mr29772476iof.267.1522164608767; 
 Tue, 27 Mar 2018 08:30:08 -0700 (PDT)
MIME-Version: 1.0
Reply-To: cem@freebsd.org
Received: by 10.2.62.19 with HTTP; Tue, 27 Mar 2018 08:30:08 -0700 (PDT)
In-Reply-To: 
References: <201803271451.w2REpJP9078197@repo.freebsd.org>
 <201803271457.w2REv6tH052497@pdx.rh.CN85.dnsmgr.net>
 
From: Conrad Meyer 
Date: Tue, 27 Mar 2018 08:30:08 -0700
X-Gmail-Original-Message-ID: 
Message-ID: 
Subject: Re: svn commit: r331618 - head/share/man/man7
To: Benjamin Kaduk 
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, 
 src-committers 
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 15:30:11 -0000

Thinking of the network as attacker-controlled is fine, but without
the CA certificate database in ports, TLS provides neither data
integrity nor confidentiality.[0]

Even with certificate validation, it's unlikely that TLS provides
meaningful confidentiality for svn.freebsd.org =E2=80=94 IP still exposes t=
he
server's address:

$ host 8.8.178.107
107.178.8.8.in-addr.arpa domain name pointer svnmir.ysv.freebsd.org

Even a naive network attacker can determine that you are interacting
with a FreeBSD source mirror, and can determine the direction of the
flow of information based on simple count of upload / download bytes.

Best,
Conrad

P.S., we should probably ship a CA database in base.  Maybe with an
override version in ports to match our release model.  But, base
should be able to authenticate certificates out of the box.

[0]: https://github.com/moxie0/sslsniff

On Tue, Mar 27, 2018 at 8:01 AM, Benjamin Kaduk  wrote:
> On Tue, Mar 27, 2018 at 9:57 AM, Rodney W. Grimes
>  wrote:
>>
>> > Author: trasz
>> > Date: Tue Mar 27 14:51:19 2018
>> > New Revision: 331618
>> > URL: https://svnweb.freebsd.org/changeset/base/331618
>> >
>> > Log:
>> >   Use https:// instead of http://.
>> >
>> >   MFC after:  2 weeks
>> >
>> > Modified:
>> >   head/share/man/man7/development.7
>> >
>> > Modified: head/share/man/man7/development.7
>> >
>> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
>> > --- head/share/man/man7/development.7 Tue Mar 27 14:50:12 2018
>> > (r331617)
>> > +++ head/share/man/man7/development.7 Tue Mar 27 14:51:19 2018
>> > (r331618)
>> > @@ -57,7 +57,7 @@ can be found at:
>> >  FreeBSD src development takes place in the CURRENT branch in
>> > Subversion,
>> >  located at:
>> >  .Pp
>> > -.Lk http://svn.FreeBSD.org/base/head
>> > +.Lk https://svn.FreeBSD.org/base/head
>> >  .Pp
>> >  There is also a read-only GitHub mirror at:
>> >  .Pp
>>
>> Why do we want to run the load of TLS for what are public bits?
>> And fyi a default install of FreeBSD can not use https, you have
>> to install certs from ports before any of these https links
>> can even work, and that can be a royal pita in some situations.
>
>
> Many of us are used to thinking of the network as controlled by an attack=
er.
> Running http-not-s to fetch the sources lets "the attacker" supply an
> arbitrary
> collection of bits under the name FreeBSD without a good way for the user=
 to
> check that the bits on their disk match what the FreeBSD Project expects
> them to be.
> TLS provides data integrity as well as confidentiality...
>
> -Ben

From owner-svn-src-head@freebsd.org  Tue Mar 27 15:41:04 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C22C8F627CC;
 Tue, 27 Mar 2018 15:41:04 +0000 (UTC)
 (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 476736CF10;
 Tue, 27 Mar 2018 15:41:04 +0000 (UTC)
 (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1])
 by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w2RFf2dO052689;
 Tue, 27 Mar 2018 08:41:02 -0700 (PDT)
 (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
Received: (from freebsd@localhost)
 by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w2RFf2YM052688;
 Tue, 27 Mar 2018 08:41:02 -0700 (PDT) (envelope-from freebsd)
From: "Rodney W. Grimes" 
Message-Id: <201803271541.w2RFf2YM052688@pdx.rh.CN85.dnsmgr.net>
Subject: Re: svn commit: r331618 - head/share/man/man7
In-Reply-To: 
To: cem@freebsd.org
Date: Tue, 27 Mar 2018 08:41:02 -0700 (PDT)
CC: Benjamin Kaduk , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers 
Reply-To: rgrimes@freebsd.org
X-Mailer: ELM [version 2.4ME+ PL121h (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 15:41:04 -0000

> Thinking of the network as attacker-controlled is fine, but without
> the CA certificate database in ports, TLS provides neither data
> integrity nor confidentiality.[0]
> 
> Even with certificate validation, it's unlikely that TLS provides
> meaningful confidentiality for svn.freebsd.org ? IP still exposes the
> server's address:
> 
> $ host 8.8.178.107
> 107.178.8.8.in-addr.arpa domain name pointer svnmir.ysv.freebsd.org
> 
> Even a naive network attacker can determine that you are interacting
> with a FreeBSD source mirror, and can determine the direction of the
> flow of information based on simple count of upload / download bytes.

Without the private part of the TLS they can not alter that data,
correct?

I know there are TLS intercepts, but they require you to get the
client to accept an alternate cert to proxy the connection.

> 
> Best,
> Conrad
> 
> P.S., we should probably ship a CA database in base.  Maybe with an
> override version in ports to match our release model.  But, base
> should be able to authenticate certificates out of the box.

I believe there is a group of people working on that issue
some place, or at least I recall seeing it as an adgenda item.

> [0]: https://github.com/moxie0/sslsniff
> 
> On Tue, Mar 27, 2018 at 8:01 AM, Benjamin Kaduk  wrote:
> > On Tue, Mar 27, 2018 at 9:57 AM, Rodney W. Grimes
> >  wrote:
> >>
> >> > Author: trasz
> >> > Date: Tue Mar 27 14:51:19 2018
> >> > New Revision: 331618
> >> > URL: https://svnweb.freebsd.org/changeset/base/331618
...

-- 
Rod Grimes                                                 rgrimes@freebsd.org

From owner-svn-src-head@freebsd.org  Tue Mar 27 15:50:04 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCEE2F635E1;
 Tue, 27 Mar 2018 15:50:03 +0000 (UTC)
 (envelope-from cse.cem@gmail.com)
Received: from mail-io0-f179.google.com (mail-io0-f179.google.com
 [209.85.223.179])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 779116D7B4;
 Tue, 27 Mar 2018 15:50:03 +0000 (UTC)
 (envelope-from cse.cem@gmail.com)
Received: by mail-io0-f179.google.com with SMTP id d7so12777196ioc.11;
 Tue, 27 Mar 2018 08:50:03 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:reply-to:in-reply-to:references
 :from:date:message-id:subject:to:cc:content-transfer-encoding;
 bh=94JsRnegbCDdQ20stDw+aoJ1CsUltrSEIdvNYRky4qY=;
 b=hs7B92L742g7lUEybTc9/F61YVNxL+m8eciJsXx9wJu67Pkz6EEdf6OzRUgr/wXDCq
 gY+FZKckwT+TJaxUSXHIOGJUy3i8oOi8+S4iyem/duesL0L5QBCyc+HDcW+y9jr8O6Ds
 P33N3S6ihTuzft7rMvdHM+OzibtUDC6kasP2HZ/7vSL2CG3y37tn+3uj0j29wyCiRErT
 zAGYQqnl8juSNINQMqn2yTmUnoFRWpWn15C7VGaN/hUBE5MAjT2LcJiQRQHKXU3s0sdN
 Gr4gLSfiOTjxigtDgJSvsxW6Zyiktwdp2gSXlkUUZdzfvi26BPd2YuLQ7k+vn1GI3kmb
 xnkA==
X-Gm-Message-State: AElRT7FxHHSaG7wlUxlFGZ5oZ5GiNblLYKFqswjU9Fm68FozrCJ/bfbo
 wl6czIdwSZiY0E5g1ErCCmgHd4w1
X-Google-Smtp-Source: AIpwx48yKzpWH0IyXWvqz7Qo52pRNdf2HPAtYIlBOn+WVFUvEgj6O0OwwfcchugQK7vKxnE2ZJ87ww==
X-Received: by 10.107.80.15 with SMTP id e15mr6049270iob.40.1522165796630;
 Tue, 27 Mar 2018 08:49:56 -0700 (PDT)
Received: from mail-it0-f49.google.com (mail-it0-f49.google.com.
 [209.85.214.49])
 by smtp.gmail.com with ESMTPSA id m75sm1098034iom.71.2018.03.27.08.49.55
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 27 Mar 2018 08:49:56 -0700 (PDT)
Received: by mail-it0-f49.google.com with SMTP id y20-v6so15878685itc.5;
 Tue, 27 Mar 2018 08:49:55 -0700 (PDT)
X-Received: by 2002:a24:e14e:: with SMTP id
 n75-v6mr26985508ith.58.1522165795780; 
 Tue, 27 Mar 2018 08:49:55 -0700 (PDT)
MIME-Version: 1.0
Reply-To: cem@freebsd.org
Received: by 10.2.62.19 with HTTP; Tue, 27 Mar 2018 08:49:55 -0700 (PDT)
In-Reply-To: <201803271541.w2RFf2YM052688@pdx.rh.CN85.dnsmgr.net>
References: 
 <201803271541.w2RFf2YM052688@pdx.rh.CN85.dnsmgr.net>
From: Conrad Meyer 
Date: Tue, 27 Mar 2018 08:49:55 -0700
X-Gmail-Original-Message-ID: 
Message-ID: 
Subject: Re: svn commit: r331618 - head/share/man/man7
To: "Rodney W. Grimes" 
Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, 
 src-committers 
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 15:50:04 -0000

On Tue, Mar 27, 2018 at 8:41 AM, Rodney W. Grimes
 wrote:
> Without the private part of the TLS they can not alter that data,
> correct?

Correct =E2=80=94 a property typically referred to as "integrity."  (Well,
obviously they can truncate streams with RST, but that isn't very
subtle to any client.)

> I know there are TLS intercepts, but they require you to get the
> client to accept an alternate cert to proxy the connection.

Yep.  Without a CA trust database, clients cannot distinguish valid
certifications from invalid ones.

>> P.S., we should probably ship a CA database in base.  Maybe with an
>> override version in ports to match our release model.  But, base
>> should be able to authenticate certificates out of the box.
>
> I believe there is a group of people working on that issue
> some place, or at least I recall seeing it as an adgenda item.

There was some contention even having the port install somewhere base
SSL libraries could access it.  We've made that change, though there
is a non-default port option to turn it off.  I too have seen it on
Core's agenda for months, without any outward visible progress.

Best,
Conrad

From owner-svn-src-head@freebsd.org  Tue Mar 27 16:07:55 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CF08F65564;
 Tue, 27 Mar 2018 16:07:55 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E03206E8C7;
 Tue, 27 Mar 2018 16:07:54 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAE1C1E4D0;
 Tue, 27 Mar 2018 16:07:54 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RG7ski018083;
 Tue, 27 Mar 2018 16:07:54 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RG7svT018080;
 Tue, 27 Mar 2018 16:07:54 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803271607.w2RG7svT018080@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Tue, 27 Mar 2018 16:07:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331623 - in head/sys: compat/freebsd32 dev/md
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: in head/sys: compat/freebsd32 dev/md
X-SVN-Commit-Revision: 331623
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 16:07:55 -0000

Author: brooks
Date: Tue Mar 27 16:07:54 2018
New Revision: 331623
URL: https://svnweb.freebsd.org/changeset/base/331623

Log:
  Move 32-bit compat for md(4) ioctls into the md code.
  
  This is more correct in that ioctl commands have no meaning until they
  hit the handler associated with the file descriptor.
  
  Add support for MDIOCRESIZE_32 which was missed when it was added.
  
  Reviewed by:	cem, kib, markj (various versions)
  Obtained from:	CheriBSD
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14714

Modified:
  head/sys/compat/freebsd32/freebsd32_ioctl.c
  head/sys/compat/freebsd32/freebsd32_ioctl.h
  head/sys/dev/md/md.c

Modified: head/sys/compat/freebsd32/freebsd32_ioctl.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_ioctl.c	Tue Mar 27 15:29:32 2018	(r331622)
+++ head/sys/compat/freebsd32/freebsd32_ioctl.c	Tue Mar 27 16:07:54 2018	(r331623)
@@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -58,90 +57,13 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-CTASSERT((sizeof(struct md_ioctl32)) == 436);
 CTASSERT(sizeof(struct ioc_read_toc_entry32) == 8);
 CTASSERT(sizeof(struct mem_range_op32) == 12);
 CTASSERT(sizeof(struct pci_conf_io32) == 36);
 CTASSERT(sizeof(struct pci_match_conf32) == 44);
 CTASSERT(sizeof(struct pci_conf32) == 44);
 
-
 static int
-freebsd32_ioctl_md(struct thread *td, struct freebsd32_ioctl_args *uap,
-    struct file *fp)
-{
-	struct md_ioctl mdv;
-	struct md_ioctl32 md32;
-	u_long com = 0;
-	int i, error;
-
-	if (uap->com & IOC_IN) {
-		if ((error = copyin(uap->data, &md32, sizeof(md32)))) {
-			return (error);
-		}
-		CP(md32, mdv, md_version);
-		CP(md32, mdv, md_unit);
-		CP(md32, mdv, md_type);
-		PTRIN_CP(md32, mdv, md_file);
-		CP(md32, mdv, md_mediasize);
-		CP(md32, mdv, md_sectorsize);
-		CP(md32, mdv, md_options);
-		CP(md32, mdv, md_base);
-		CP(md32, mdv, md_fwheads);
-		CP(md32, mdv, md_fwsectors);
-		PTRIN_CP(md32, mdv, md_label);
-	} else if (uap->com & IOC_OUT) {
-		/*
-		 * Zero the buffer so the user always
-		 * gets back something deterministic.
-		 */
-		bzero(&mdv, sizeof mdv);
-	}
-
-	switch (uap->com) {
-	case MDIOCATTACH_32:
-		com = MDIOCATTACH;
-		break;
-	case MDIOCDETACH_32:
-		com = MDIOCDETACH;
-		break;
-	case MDIOCQUERY_32:
-		com = MDIOCQUERY;
-		break;
-	case MDIOCLIST_32:
-		com = MDIOCLIST;
-		break;
-	default:
-		panic("%s: unknown MDIOC %#x", __func__, uap->com);
-	}
-	error = fo_ioctl(fp, com, (caddr_t)&mdv, td->td_ucred, td);
-	if (error == 0 && (com & IOC_OUT)) {
-		CP(mdv, md32, md_version);
-		CP(mdv, md32, md_unit);
-		CP(mdv, md32, md_type);
-		PTROUT_CP(mdv, md32, md_file);
-		CP(mdv, md32, md_mediasize);
-		CP(mdv, md32, md_sectorsize);
-		CP(mdv, md32, md_options);
-		CP(mdv, md32, md_base);
-		CP(mdv, md32, md_fwheads);
-		CP(mdv, md32, md_fwsectors);
-		PTROUT_CP(mdv, md32, md_label);
-		if (com == MDIOCLIST) {
-			/*
-			 * Use MDNPAD, and not MDNPAD32.  Padding is
-			 * allocated and used by compat32 ABI.
-			 */
-			for (i = 0; i < MDNPAD; i++)
-				CP(mdv, md32, md_pad[i]);
-		}
-		error = copyout(&md32, uap->data, sizeof(md32));
-	}
-	return error;
-}
-
-
-static int
 freebsd32_ioctl_ioc_read_toc(struct thread *td,
     struct freebsd32_ioctl_args *uap, struct file *fp)
 {
@@ -414,13 +336,6 @@ freebsd32_ioctl(struct thread *td, struct freebsd32_io
 	}
 
 	switch (uap->com) {
-	case MDIOCATTACH_32:	/* FALLTHROUGH */
-	case MDIOCDETACH_32:	/* FALLTHROUGH */
-	case MDIOCQUERY_32:	/* FALLTHROUGH */
-	case MDIOCLIST_32:
-		error = freebsd32_ioctl_md(td, uap, fp);
-		break;
-
 	case CDIOREADTOCENTRYS_32:
 		error = freebsd32_ioctl_ioc_read_toc(td, uap, fp);
 		break;

Modified: head/sys/compat/freebsd32/freebsd32_ioctl.h
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_ioctl.h	Tue Mar 27 15:29:32 2018	(r331622)
+++ head/sys/compat/freebsd32/freebsd32_ioctl.h	Tue Mar 27 16:07:54 2018	(r331623)
@@ -45,22 +45,6 @@ struct ioc_read_toc_entry32 {
 	uint32_t data;		/* struct cd_toc_entry* */
 };
 
-#define	MDNPAD32	MDNPAD
-struct md_ioctl32 {
-	unsigned	md_version;	/* Structure layout version */
-	unsigned	md_unit;	/* unit number */
-	enum md_types	md_type;	/* type of disk */
-	caddr_t32	md_file;	/* pathname of file to mount */
-	off_t		md_mediasize;	/* size of disk in bytes */
-	unsigned	md_sectorsize;	/* sectorsize */
-	unsigned	md_options;	/* options */
-	u_int64_t	md_base;	/* base address */
-	int		md_fwheads;	/* firmware heads */
-	int		md_fwsectors;	/* firmware sectors */
-	caddr_t32	md_label;	/* label of the device */
-	int		md_pad[MDNPAD32]; /* padding for future ideas */
-} __attribute__((__packed__));
-
 struct fiodgname_arg32 {
 	int		len;
 	caddr_t32	buf;
@@ -112,10 +96,6 @@ struct pci_conf_io32 {
 };
 
 #define	CDIOREADTOCENTRYS_32 _IOWR('c', 5, struct ioc_read_toc_entry32)
-#define	MDIOCATTACH_32	_IOC(IOC_INOUT, 'm', 0, sizeof(struct md_ioctl32))
-#define	MDIOCDETACH_32	_IOC(IOC_INOUT, 'm', 1, sizeof(struct md_ioctl32))
-#define	MDIOCQUERY_32	_IOC(IOC_INOUT, 'm', 2, sizeof(struct md_ioctl32))
-#define	MDIOCLIST_32	_IOC(IOC_INOUT, 'm', 3, sizeof(struct md_ioctl32))
 #define	FIODGNAME_32	_IOW('f', 120, struct fiodgname_arg32)
 #define	MEMRANGE_GET32	_IOWR('m', 50, struct mem_range_op32)
 #define	MEMRANGE_SET32	_IOW('m', 51, struct mem_range_op32)

Modified: head/sys/dev/md/md.c
==============================================================================
--- head/sys/dev/md/md.c	Tue Mar 27 15:29:32 2018	(r331622)
+++ head/sys/dev/md/md.c	Tue Mar 27 16:07:54 2018	(r331623)
@@ -60,6 +60,7 @@
  * From: src/sys/dev/vn/vn.c,v 1.122 2000/12/16 16:06:03
  */
 
+#include "opt_compat.h"
 #include "opt_rootdevname.h"
 #include "opt_geom.h"
 #include "opt_md.h"
@@ -130,6 +131,30 @@ struct md_req {
 	size_t		md_units_nitems; /* items in md_units array */
 };
 
+#ifdef COMPAT_FREEBSD32
+struct md_ioctl32 {
+	unsigned	md_version;
+	unsigned	md_unit;
+	enum md_types	md_type;
+	uint32_t	md_file;
+	off_t		md_mediasize;
+	unsigned	md_sectorsize;
+	unsigned	md_options;
+	uint64_t	md_base;
+	int		md_fwheads;
+	int		md_fwsectors;
+	uint32_t	md_label;
+	int		md_pad[MDNPAD];
+} __attribute__((__packed__));
+CTASSERT((sizeof(struct md_ioctl32)) == 436);
+
+#define	MDIOCATTACH_32	_IOC_NEWTYPE(MDIOCATTACH, struct md_ioctl32)
+#define	MDIOCDETACH_32	_IOC_NEWTYPE(MDIOCDETACH, struct md_ioctl32)
+#define	MDIOCQUERY_32	_IOC_NEWTYPE(MDIOCQUERY, struct md_ioctl32)
+#define	MDIOCLIST_32	_IOC_NEWTYPE(MDIOCLIST, struct md_ioctl32)
+#define	MDIOCRESIZE_32	_IOC_NEWTYPE(MDIOCRESIZE, struct md_ioctl32)
+#endif /* COMPAT_FREEBSD32 */
+
 static MALLOC_DEFINE(M_MD, "md_disk", "Memory Disk");
 static MALLOC_DEFINE(M_MDSECT, "md_sectors", "Memory Disk Sectors");
 
@@ -1396,8 +1421,10 @@ mdcreate_vnode(struct md_s *sc, struct md_req *mdr, st
 		error = copyinstr(fname, sc->file, sizeof(sc->file), NULL);
 		if (error != 0)
 			return (error);
-	} else
+	} else if (mdr->md_file_seg == UIO_SYSSPACE)
 		strlcpy(sc->file, fname, sizeof(sc->file));
+	else
+		return (EDOOFUS);
 
 	/*
 	 * If the user specified that this is a read only device, don't
@@ -1859,61 +1886,111 @@ kern_mdlist(struct md_req *mdr)
 	return (error);
 }
 
+/* Copy members that are not userspace pointers. */
+#define	MD_IOCTL2REQ(mdio, mdr) do {					\
+	(mdr)->md_unit = (mdio)->md_unit;				\
+	(mdr)->md_type = (mdio)->md_type;				\
+	(mdr)->md_mediasize = (mdio)->md_mediasize;			\
+	(mdr)->md_sectorsize = (mdio)->md_sectorsize;			\
+	(mdr)->md_options = (mdio)->md_options;				\
+	(mdr)->md_fwheads = (mdio)->md_fwheads;				\
+	(mdr)->md_fwsectors = (mdio)->md_fwsectors;			\
+	(mdr)->md_units = &(mdio)->md_pad[0];				\
+	(mdr)->md_units_nitems = nitems((mdio)->md_pad);		\
+} while(0)
+
+/* Copy members that might have been updated */
+#define MD_REQ2IOCTL(mdr, mdio) do {					\
+	(mdio)->md_unit = (mdr)->md_unit;				\
+	(mdio)->md_type = (mdr)->md_type;				\
+	(mdio)->md_mediasize = (mdr)->md_mediasize;			\
+	(mdio)->md_sectorsize = (mdr)->md_sectorsize;			\
+	(mdio)->md_options = (mdr)->md_options;				\
+	(mdio)->md_fwheads = (mdr)->md_fwheads;				\
+	(mdio)->md_fwsectors = (mdr)->md_fwsectors;			\
+} while(0)
+
 static int
 mdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags,
     struct thread *td)
 {
 	struct md_req mdr;
-	struct md_ioctl *mdio;
 	int error;
 
 	if (md_debug)
 		printf("mdctlioctl(%s %lx %p %x %p)\n",
 			devtoname(dev), cmd, addr, flags, td);
 
+	bzero(&mdr, sizeof(mdr));
 	switch (cmd) {
 	case MDIOCATTACH:
 	case MDIOCDETACH:
 	case MDIOCRESIZE:
 	case MDIOCQUERY:
-	case MDIOCLIST:
-		mdio = (struct md_ioctl *)addr;
+	case MDIOCLIST: {
+		struct md_ioctl *mdio = (struct md_ioctl *)addr;
 		if (mdio->md_version != MDIOVERSION)
 			return (EINVAL);
-		mdr.md_unit = mdio->md_unit;
-		mdr.md_type = mdio->md_type;
-		mdr.md_mediasize = mdio->md_mediasize;
-		mdr.md_sectorsize = mdio->md_sectorsize;
-		mdr.md_options = mdio->md_options;
-		mdr.md_fwheads = mdio->md_fwheads;
-		mdr.md_fwsectors = mdio->md_fwsectors;
+		MD_IOCTL2REQ(mdio, &mdr);
 		mdr.md_file = mdio->md_file;
+		mdr.md_file_seg = UIO_USERSPACE;
 		/* If the file is adjacent to the md_ioctl it's in kernel. */
 		if ((void *)mdio->md_file == (void *)(mdio + 1))
 			mdr.md_file_seg = UIO_SYSSPACE;
-		else
-			mdr.md_file_seg = UIO_USERSPACE;
 		mdr.md_label = mdio->md_label;
-		mdr.md_units = &mdio->md_pad[0];
-		mdr.md_units_nitems = nitems(mdio->md_pad);
 		break;
 	}
+#ifdef COMPAT_FREEBSD32
+	case MDIOCATTACH_32:
+	case MDIOCDETACH_32:
+	case MDIOCRESIZE_32:
+	case MDIOCQUERY_32:
+	case MDIOCLIST_32: {
+		struct md_ioctl32 *mdio = (struct md_ioctl32 *)addr;
+		if (mdio->md_version != MDIOVERSION)
+			return (EINVAL);
+		MD_IOCTL2REQ(mdio, &mdr);
+		mdr.md_file = (void *)(uintptr_t)mdio->md_file;
+		mdr.md_file_seg = UIO_USERSPACE;
+		mdr.md_label = (void *)(uintptr_t)mdio->md_label;
+		break;
+	}
+#endif
+	default:
+		/* Fall through to handler switch. */
+		break;
+	}
 
 	error = 0;
 	switch (cmd) {
 	case MDIOCATTACH:
+#ifdef COMPAT_FREEBSD32
+	case MDIOCATTACH_32:
+#endif
 		error = kern_mdattach(td, &mdr);
 		break;
 	case MDIOCDETACH:
+#ifdef COMPAT_FREEBSD32
+	case MDIOCDETACH_32:
+#endif
 		error = kern_mddetach(td, &mdr);
 		break;
 	case MDIOCRESIZE:
+#ifdef COMPAT_FREEBSD32
+	case MDIOCRESIZE_32:
+#endif
 		error = kern_mdresize(&mdr);
 		break;
 	case MDIOCQUERY:
+#ifdef COMPAT_FREEBSD32
+	case MDIOCQUERY_32:
+#endif
 		error = kern_mdquery(&mdr);
 		break;
 	case MDIOCLIST:
+#ifdef COMPAT_FREEBSD32
+	case MDIOCLIST_32:
+#endif
 		error = kern_mdlist(&mdr);
 		break;
 	default:
@@ -1922,14 +1999,21 @@ mdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr,
 
 	switch (cmd) {
 	case MDIOCATTACH:
-	case MDIOCQUERY:
-		mdio->md_unit = mdr.md_unit;
-		mdio->md_type = mdr.md_type;
-		mdio->md_mediasize = mdr.md_mediasize;
-		mdio->md_sectorsize = mdr.md_sectorsize;
-		mdio->md_options = mdr.md_options;
-		mdio->md_fwheads = mdr.md_fwheads;
-		mdio->md_fwsectors = mdr.md_fwsectors;
+	case MDIOCQUERY: {
+		struct md_ioctl *mdio = (struct md_ioctl *)addr;
+		MD_REQ2IOCTL(&mdr, mdio);
+		break;
+	}
+#ifdef COMPAT_FREEBSD32
+	case MDIOCATTACH_32:
+	case MDIOCQUERY_32: {
+		struct md_ioctl32 *mdio = (struct md_ioctl32 *)addr;
+		MD_REQ2IOCTL(&mdr, mdio);
+		break;
+	}
+#endif
+	default:
+		/* Other commands to not alter mdr. */
 		break;
 	}
 

From owner-svn-src-head@freebsd.org  Tue Mar 27 16:38:32 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE5FCF6878A;
 Tue, 27 Mar 2018 16:38:32 +0000 (UTC)
 (envelope-from trasz@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 9248D704F4;
 Tue, 27 Mar 2018 16:38:32 +0000 (UTC)
 (envelope-from trasz@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 891001E9B2;
 Tue, 27 Mar 2018 16:38:32 +0000 (UTC)
 (envelope-from trasz@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RGcWHG034188;
 Tue, 27 Mar 2018 16:38:32 GMT (envelope-from trasz@FreeBSD.org)
Received: (from trasz@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RGcWtb034187;
 Tue, 27 Mar 2018 16:38:32 GMT (envelope-from trasz@FreeBSD.org)
Message-Id: <201803271638.w2RGcWtb034187@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: trasz set sender to
 trasz@FreeBSD.org using -f
From: Edward Tomasz Napierala 
Date: Tue, 27 Mar 2018 16:38:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331624 - head/sbin/savecore
X-SVN-Group: head
X-SVN-Commit-Author: trasz
X-SVN-Commit-Paths: head/sbin/savecore
X-SVN-Commit-Revision: 331624
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 16:38:33 -0000

Author: trasz
Date: Tue Mar 27 16:38:32 2018
New Revision: 331624
URL: https://svnweb.freebsd.org/changeset/base/331624

Log:
  Bump .Dd after r331113.
  
  Reported by:	oshogbo@
  MFC after:	2 weeks

Modified:
  head/sbin/savecore/savecore.8

Modified: head/sbin/savecore/savecore.8
==============================================================================
--- head/sbin/savecore/savecore.8	Tue Mar 27 16:07:54 2018	(r331623)
+++ head/sbin/savecore/savecore.8	Tue Mar 27 16:38:32 2018	(r331624)
@@ -28,7 +28,7 @@
 .\"     From: @(#)savecore.8	8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd October 24, 2017
+.Dd March 17, 2018
 .Dt SAVECORE 8
 .Os
 .Sh NAME

From owner-svn-src-head@freebsd.org  Tue Mar 27 16:45:28 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFAE4F693F2;
 Tue, 27 Mar 2018 16:45:27 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 7D6CA70F44;
 Tue, 27 Mar 2018 16:45:27 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215])
 by mail.baldwin.cx (Postfix) with ESMTPSA id 7CC4310A87D;
 Tue, 27 Mar 2018 12:45:26 -0400 (EDT)
From: John Baldwin 
To: Conrad Meyer 
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r331602 - in head/sys/contrib/zstd: .
 contrib/gen_html contrib/meson contrib/seekable_format doc doc/images lib
 lib/common lib/compress lib/decompress lib/dictBuilder lib/legacy program...
Date: Tue, 27 Mar 2018 09:41:44 -0700
Message-ID: <1800672.WX48MoC0qd@ralph.baldwin.cx>
User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; )
In-Reply-To: <201803262355.w2QNt00j023669@repo.freebsd.org>
References: <201803262355.w2QNt00j023669@repo.freebsd.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3
 (mail.baldwin.cx); Tue, 27 Mar 2018 12:45:26 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx
X-Virus-Status: Clean
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 16:45:28 -0000

On Monday, March 26, 2018 11:55:00 PM Conrad Meyer wrote:
> Author: cem
> Date: Mon Mar 26 23:54:59 2018
> New Revision: 331602
> URL: https://svnweb.freebsd.org/changeset/base/331602
> 
> Log:
>   Update to Zstandard 1.3.4
>   
>   Includes our local patch to conditionalize use of __builtin_clz(ll) on
>   Clang's __has_builtin() (which is just defined to false when building with
>   GCC).
>   
>   The issue is tracked upstream at https://github.com/facebook/zstd/pull/884 .
>   Otherwise, these are vanilla Zstandard 1.3.4 files.

Note that there is an existing ^/vendor/zstd tree that zstd updates should probably
be committed to first and then merged over.  You can probably repair this by importing
1.3.4 as normal to the vendor area following the normal instructions and then doing
an 'svn merge --record-only' to update the merge info.

-- 
John Baldwin

From owner-svn-src-head@freebsd.org  Tue Mar 27 17:18:02 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D5DBF6CA38;
 Tue, 27 Mar 2018 17:18:01 +0000 (UTC)
 (envelope-from jkim@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 35B4473033;
 Tue, 27 Mar 2018 17:18:01 +0000 (UTC)
 (envelope-from jkim@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E8AE1F094;
 Tue, 27 Mar 2018 17:18:01 +0000 (UTC)
 (envelope-from jkim@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RHI1xs054837;
 Tue, 27 Mar 2018 17:18:01 GMT (envelope-from jkim@FreeBSD.org)
Received: (from jkim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RHHw8X054810;
 Tue, 27 Mar 2018 17:17:58 GMT (envelope-from jkim@FreeBSD.org)
Message-Id: <201803271717.w2RHHw8X054810@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jkim set sender to
 jkim@FreeBSD.org using -f
From: Jung-uk Kim 
Date: Tue, 27 Mar 2018 17:17:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331627 - in head: crypto/openssl crypto/openssl/apps
 crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bf
 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto...
X-SVN-Group: head
X-SVN-Commit-Author: jkim
X-SVN-Commit-Paths: in head: crypto/openssl crypto/openssl/apps
 crypto/openssl/crypto crypto/openssl/crypto/asn1 crypto/openssl/crypto/bf
 crypto/openssl/crypto/bio crypto/openssl/crypto/bn crypto/openssl/crypto/conf
 cryp...
X-SVN-Commit-Revision: 331627
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 17:18:02 -0000

Author: jkim
Date: Tue Mar 27 17:17:58 2018
New Revision: 331627
URL: https://svnweb.freebsd.org/changeset/base/331627

Log:
  Merge OpenSSL 1.0.2o.

Modified:
  head/crypto/openssl/CHANGES
  head/crypto/openssl/Configure
  head/crypto/openssl/LICENSE
  head/crypto/openssl/Makefile
  head/crypto/openssl/NEWS
  head/crypto/openssl/README
  head/crypto/openssl/apps/app_rand.c
  head/crypto/openssl/apps/apps.c
  head/crypto/openssl/apps/ca.c
  head/crypto/openssl/apps/ciphers.c
  head/crypto/openssl/apps/cms.c
  head/crypto/openssl/apps/dgst.c
  head/crypto/openssl/apps/dsaparam.c
  head/crypto/openssl/apps/ecparam.c
  head/crypto/openssl/apps/enc.c
  head/crypto/openssl/apps/errstr.c
  head/crypto/openssl/apps/ocsp.c
  head/crypto/openssl/apps/openssl.c
  head/crypto/openssl/apps/passwd.c
  head/crypto/openssl/apps/pkcs12.c
  head/crypto/openssl/apps/pkcs8.c
  head/crypto/openssl/apps/rand.c
  head/crypto/openssl/apps/req.c
  head/crypto/openssl/apps/s_client.c
  head/crypto/openssl/apps/s_server.c
  head/crypto/openssl/apps/s_socket.c
  head/crypto/openssl/apps/s_time.c
  head/crypto/openssl/apps/speed.c
  head/crypto/openssl/apps/x509.c
  head/crypto/openssl/crypto/asn1/a_gentm.c
  head/crypto/openssl/crypto/asn1/a_mbstr.c
  head/crypto/openssl/crypto/asn1/a_object.c
  head/crypto/openssl/crypto/asn1/a_strex.c
  head/crypto/openssl/crypto/asn1/a_time.c
  head/crypto/openssl/crypto/asn1/a_utctm.c
  head/crypto/openssl/crypto/asn1/asn1.h
  head/crypto/openssl/crypto/asn1/asn1_err.c
  head/crypto/openssl/crypto/asn1/asn1_lib.c
  head/crypto/openssl/crypto/asn1/asn1_par.c
  head/crypto/openssl/crypto/asn1/asn_mime.c
  head/crypto/openssl/crypto/asn1/t_x509a.c
  head/crypto/openssl/crypto/asn1/tasn_dec.c
  head/crypto/openssl/crypto/asn1/tasn_prn.c
  head/crypto/openssl/crypto/bf/bftest.c
  head/crypto/openssl/crypto/bio/b_dump.c
  head/crypto/openssl/crypto/bio/b_print.c
  head/crypto/openssl/crypto/bio/bio_cb.c
  head/crypto/openssl/crypto/bio/bss_bio.c
  head/crypto/openssl/crypto/bio/bss_conn.c
  head/crypto/openssl/crypto/bio/bss_file.c
  head/crypto/openssl/crypto/bn/bn_exp.c
  head/crypto/openssl/crypto/bn/bn_lib.c
  head/crypto/openssl/crypto/bn/bn_mont.c
  head/crypto/openssl/crypto/bn/bn_print.c
  head/crypto/openssl/crypto/bn/bntest.c
  head/crypto/openssl/crypto/bn/expspeed.c
  head/crypto/openssl/crypto/bn/exptest.c
  head/crypto/openssl/crypto/conf/conf_def.c
  head/crypto/openssl/crypto/conf/conf_mod.c
  head/crypto/openssl/crypto/des/destest.c
  head/crypto/openssl/crypto/des/ecb_enc.c
  head/crypto/openssl/crypto/des/fcrypt.c
  head/crypto/openssl/crypto/des/read_pwd.c
  head/crypto/openssl/crypto/des/set_key.c
  head/crypto/openssl/crypto/dh/dhtest.c
  head/crypto/openssl/crypto/dsa/dsatest.c
  head/crypto/openssl/crypto/ec/ec_lib.c
  head/crypto/openssl/crypto/ec/ec_mult.c
  head/crypto/openssl/crypto/ec/ecp_nistp224.c
  head/crypto/openssl/crypto/ec/ecp_nistp256.c
  head/crypto/openssl/crypto/ec/ecp_nistp521.c
  head/crypto/openssl/crypto/ec/ecp_nistz256.c
  head/crypto/openssl/crypto/ec/ecp_smpl.c
  head/crypto/openssl/crypto/ec/ectest.c
  head/crypto/openssl/crypto/ecdh/ecdhtest.c
  head/crypto/openssl/crypto/engine/eng_cryptodev.c
  head/crypto/openssl/crypto/engine/eng_table.c
  head/crypto/openssl/crypto/err/err.c
  head/crypto/openssl/crypto/err/err_prn.c
  head/crypto/openssl/crypto/evp/bio_b64.c
  head/crypto/openssl/crypto/evp/digest.c
  head/crypto/openssl/crypto/evp/e_aes.c
  head/crypto/openssl/crypto/evp/e_camellia.c
  head/crypto/openssl/crypto/evp/evp_enc.c
  head/crypto/openssl/crypto/evp/evp_locl.h
  head/crypto/openssl/crypto/evp/evp_pbe.c
  head/crypto/openssl/crypto/evp/evp_test.c
  head/crypto/openssl/crypto/evp/openbsd_hw.c
  head/crypto/openssl/crypto/evp/p5_crpt2.c
  head/crypto/openssl/crypto/hmac/hmac.c
  head/crypto/openssl/crypto/jpake/jpake.c
  head/crypto/openssl/crypto/md2/md2_dgst.c
  head/crypto/openssl/crypto/md4/md4.c
  head/crypto/openssl/crypto/mem_dbg.c
  head/crypto/openssl/crypto/o_init.c
  head/crypto/openssl/crypto/o_time.c
  head/crypto/openssl/crypto/objects/o_names.c
  head/crypto/openssl/crypto/objects/obj_dat.c
  head/crypto/openssl/crypto/opensslv.h
  head/crypto/openssl/crypto/pem/pem_info.c
  head/crypto/openssl/crypto/pem/pem_lib.c
  head/crypto/openssl/crypto/pkcs7/pk7_doit.c
  head/crypto/openssl/crypto/rand/md_rand.c
  head/crypto/openssl/crypto/rand/rand_egd.c
  head/crypto/openssl/crypto/rand/rand_unix.c
  head/crypto/openssl/crypto/rsa/rsa_crpt.c
  head/crypto/openssl/crypto/rsa/rsa_gen.c
  head/crypto/openssl/crypto/rsa/rsa_pss.c
  head/crypto/openssl/crypto/rsa/rsa_test.c
  head/crypto/openssl/crypto/srp/srp_grps.h
  head/crypto/openssl/crypto/threads/mttest.c
  head/crypto/openssl/crypto/ts/Makefile
  head/crypto/openssl/crypto/ts/ts_rsp_sign.c
  head/crypto/openssl/crypto/ui/ui_openssl.c
  head/crypto/openssl/crypto/x509/x509_txt.c
  head/crypto/openssl/crypto/x509/x509_v3.c
  head/crypto/openssl/crypto/x509/x509_vpm.c
  head/crypto/openssl/crypto/x509v3/v3_alt.c
  head/crypto/openssl/crypto/x509v3/v3_conf.c
  head/crypto/openssl/crypto/x509v3/v3_info.c
  head/crypto/openssl/doc/apps/ca.pod
  head/crypto/openssl/doc/apps/ecparam.pod
  head/crypto/openssl/doc/apps/s_client.pod
  head/crypto/openssl/doc/apps/verify.pod
  head/crypto/openssl/doc/apps/x509.pod
  head/crypto/openssl/doc/crypto/ASN1_STRING_length.pod
  head/crypto/openssl/doc/crypto/BIO_s_mem.pod
  head/crypto/openssl/doc/crypto/BN_zero.pod
  head/crypto/openssl/doc/crypto/EVP_EncryptInit.pod
  head/crypto/openssl/doc/crypto/X509_VERIFY_PARAM_set_flags.pod
  head/crypto/openssl/doc/crypto/threads.pod
  head/crypto/openssl/engines/ccgost/README.gost
  head/crypto/openssl/engines/ccgost/gost_eng.c
  head/crypto/openssl/engines/e_atalla.c
  head/crypto/openssl/ssl/Makefile
  head/crypto/openssl/ssl/bad_dtls_test.c
  head/crypto/openssl/ssl/d1_lib.c
  head/crypto/openssl/ssl/d1_pkt.c
  head/crypto/openssl/ssl/fatalerrtest.c
  head/crypto/openssl/ssl/kssl.c
  head/crypto/openssl/ssl/s23_srvr.c
  head/crypto/openssl/ssl/s2_clnt.c
  head/crypto/openssl/ssl/s2_enc.c
  head/crypto/openssl/ssl/s2_lib.c
  head/crypto/openssl/ssl/s2_srvr.c
  head/crypto/openssl/ssl/s3_clnt.c
  head/crypto/openssl/ssl/s3_lib.c
  head/crypto/openssl/ssl/s3_pkt.c
  head/crypto/openssl/ssl/s3_srvr.c
  head/crypto/openssl/ssl/ssl_cert.c
  head/crypto/openssl/ssl/ssl_lib.c
  head/crypto/openssl/ssl/ssl_sess.c
  head/crypto/openssl/ssl/ssltest.c
  head/crypto/openssl/ssl/t1_enc.c
  head/crypto/openssl/ssl/t1_lib.c
  head/crypto/openssl/ssl/t1_trce.c
  head/secure/lib/libcrypto/Makefile.inc
  head/secure/lib/libcrypto/man/ASN1_OBJECT_new.3
  head/secure/lib/libcrypto/man/ASN1_STRING_length.3
  head/secure/lib/libcrypto/man/ASN1_STRING_new.3
  head/secure/lib/libcrypto/man/ASN1_STRING_print_ex.3
  head/secure/lib/libcrypto/man/ASN1_TIME_set.3
  head/secure/lib/libcrypto/man/ASN1_generate_nconf.3
  head/secure/lib/libcrypto/man/BIO_ctrl.3
  head/secure/lib/libcrypto/man/BIO_f_base64.3
  head/secure/lib/libcrypto/man/BIO_f_buffer.3
  head/secure/lib/libcrypto/man/BIO_f_cipher.3
  head/secure/lib/libcrypto/man/BIO_f_md.3
  head/secure/lib/libcrypto/man/BIO_f_null.3
  head/secure/lib/libcrypto/man/BIO_f_ssl.3
  head/secure/lib/libcrypto/man/BIO_find_type.3
  head/secure/lib/libcrypto/man/BIO_new.3
  head/secure/lib/libcrypto/man/BIO_new_CMS.3
  head/secure/lib/libcrypto/man/BIO_push.3
  head/secure/lib/libcrypto/man/BIO_read.3
  head/secure/lib/libcrypto/man/BIO_s_accept.3
  head/secure/lib/libcrypto/man/BIO_s_bio.3
  head/secure/lib/libcrypto/man/BIO_s_connect.3
  head/secure/lib/libcrypto/man/BIO_s_fd.3
  head/secure/lib/libcrypto/man/BIO_s_file.3
  head/secure/lib/libcrypto/man/BIO_s_mem.3
  head/secure/lib/libcrypto/man/BIO_s_null.3
  head/secure/lib/libcrypto/man/BIO_s_socket.3
  head/secure/lib/libcrypto/man/BIO_set_callback.3
  head/secure/lib/libcrypto/man/BIO_should_retry.3
  head/secure/lib/libcrypto/man/BN_BLINDING_new.3
  head/secure/lib/libcrypto/man/BN_CTX_new.3
  head/secure/lib/libcrypto/man/BN_CTX_start.3
  head/secure/lib/libcrypto/man/BN_add.3
  head/secure/lib/libcrypto/man/BN_add_word.3
  head/secure/lib/libcrypto/man/BN_bn2bin.3
  head/secure/lib/libcrypto/man/BN_cmp.3
  head/secure/lib/libcrypto/man/BN_copy.3
  head/secure/lib/libcrypto/man/BN_generate_prime.3
  head/secure/lib/libcrypto/man/BN_mod_inverse.3
  head/secure/lib/libcrypto/man/BN_mod_mul_montgomery.3
  head/secure/lib/libcrypto/man/BN_mod_mul_reciprocal.3
  head/secure/lib/libcrypto/man/BN_new.3
  head/secure/lib/libcrypto/man/BN_num_bytes.3
  head/secure/lib/libcrypto/man/BN_rand.3
  head/secure/lib/libcrypto/man/BN_set_bit.3
  head/secure/lib/libcrypto/man/BN_swap.3
  head/secure/lib/libcrypto/man/BN_zero.3
  head/secure/lib/libcrypto/man/CMS_add0_cert.3
  head/secure/lib/libcrypto/man/CMS_add1_recipient_cert.3
  head/secure/lib/libcrypto/man/CMS_add1_signer.3
  head/secure/lib/libcrypto/man/CMS_compress.3
  head/secure/lib/libcrypto/man/CMS_decrypt.3
  head/secure/lib/libcrypto/man/CMS_encrypt.3
  head/secure/lib/libcrypto/man/CMS_final.3
  head/secure/lib/libcrypto/man/CMS_get0_RecipientInfos.3
  head/secure/lib/libcrypto/man/CMS_get0_SignerInfos.3
  head/secure/lib/libcrypto/man/CMS_get0_type.3
  head/secure/lib/libcrypto/man/CMS_get1_ReceiptRequest.3
  head/secure/lib/libcrypto/man/CMS_sign.3
  head/secure/lib/libcrypto/man/CMS_sign_receipt.3
  head/secure/lib/libcrypto/man/CMS_uncompress.3
  head/secure/lib/libcrypto/man/CMS_verify.3
  head/secure/lib/libcrypto/man/CMS_verify_receipt.3
  head/secure/lib/libcrypto/man/CONF_modules_free.3
  head/secure/lib/libcrypto/man/CONF_modules_load_file.3
  head/secure/lib/libcrypto/man/CRYPTO_set_ex_data.3
  head/secure/lib/libcrypto/man/DH_generate_key.3
  head/secure/lib/libcrypto/man/DH_generate_parameters.3
  head/secure/lib/libcrypto/man/DH_get_ex_new_index.3
  head/secure/lib/libcrypto/man/DH_new.3
  head/secure/lib/libcrypto/man/DH_set_method.3
  head/secure/lib/libcrypto/man/DH_size.3
  head/secure/lib/libcrypto/man/DSA_SIG_new.3
  head/secure/lib/libcrypto/man/DSA_do_sign.3
  head/secure/lib/libcrypto/man/DSA_dup_DH.3
  head/secure/lib/libcrypto/man/DSA_generate_key.3
  head/secure/lib/libcrypto/man/DSA_generate_parameters.3
  head/secure/lib/libcrypto/man/DSA_get_ex_new_index.3
  head/secure/lib/libcrypto/man/DSA_new.3
  head/secure/lib/libcrypto/man/DSA_set_method.3
  head/secure/lib/libcrypto/man/DSA_sign.3
  head/secure/lib/libcrypto/man/DSA_size.3
  head/secure/lib/libcrypto/man/EC_GFp_simple_method.3
  head/secure/lib/libcrypto/man/EC_GROUP_copy.3
  head/secure/lib/libcrypto/man/EC_GROUP_new.3
  head/secure/lib/libcrypto/man/EC_KEY_new.3
  head/secure/lib/libcrypto/man/EC_POINT_add.3
  head/secure/lib/libcrypto/man/EC_POINT_new.3
  head/secure/lib/libcrypto/man/ERR_GET_LIB.3
  head/secure/lib/libcrypto/man/ERR_clear_error.3
  head/secure/lib/libcrypto/man/ERR_error_string.3
  head/secure/lib/libcrypto/man/ERR_get_error.3
  head/secure/lib/libcrypto/man/ERR_load_crypto_strings.3
  head/secure/lib/libcrypto/man/ERR_load_strings.3
  head/secure/lib/libcrypto/man/ERR_print_errors.3
  head/secure/lib/libcrypto/man/ERR_put_error.3
  head/secure/lib/libcrypto/man/ERR_remove_state.3
  head/secure/lib/libcrypto/man/ERR_set_mark.3
  head/secure/lib/libcrypto/man/EVP_BytesToKey.3
  head/secure/lib/libcrypto/man/EVP_DigestInit.3
  head/secure/lib/libcrypto/man/EVP_DigestSignInit.3
  head/secure/lib/libcrypto/man/EVP_DigestVerifyInit.3
  head/secure/lib/libcrypto/man/EVP_EncodeInit.3
  head/secure/lib/libcrypto/man/EVP_EncryptInit.3
  head/secure/lib/libcrypto/man/EVP_OpenInit.3
  head/secure/lib/libcrypto/man/EVP_PKEY_CTX_ctrl.3
  head/secure/lib/libcrypto/man/EVP_PKEY_CTX_new.3
  head/secure/lib/libcrypto/man/EVP_PKEY_cmp.3
  head/secure/lib/libcrypto/man/EVP_PKEY_decrypt.3
  head/secure/lib/libcrypto/man/EVP_PKEY_derive.3
  head/secure/lib/libcrypto/man/EVP_PKEY_encrypt.3
  head/secure/lib/libcrypto/man/EVP_PKEY_get_default_digest.3
  head/secure/lib/libcrypto/man/EVP_PKEY_keygen.3
  head/secure/lib/libcrypto/man/EVP_PKEY_meth_new.3
  head/secure/lib/libcrypto/man/EVP_PKEY_new.3
  head/secure/lib/libcrypto/man/EVP_PKEY_print_private.3
  head/secure/lib/libcrypto/man/EVP_PKEY_set1_RSA.3
  head/secure/lib/libcrypto/man/EVP_PKEY_sign.3
  head/secure/lib/libcrypto/man/EVP_PKEY_verify.3
  head/secure/lib/libcrypto/man/EVP_PKEY_verify_recover.3
  head/secure/lib/libcrypto/man/EVP_SealInit.3
  head/secure/lib/libcrypto/man/EVP_SignInit.3
  head/secure/lib/libcrypto/man/EVP_VerifyInit.3
  head/secure/lib/libcrypto/man/OBJ_nid2obj.3
  head/secure/lib/libcrypto/man/OPENSSL_Applink.3
  head/secure/lib/libcrypto/man/OPENSSL_VERSION_NUMBER.3
  head/secure/lib/libcrypto/man/OPENSSL_config.3
  head/secure/lib/libcrypto/man/OPENSSL_ia32cap.3
  head/secure/lib/libcrypto/man/OPENSSL_instrument_bus.3
  head/secure/lib/libcrypto/man/OPENSSL_load_builtin_modules.3
  head/secure/lib/libcrypto/man/OpenSSL_add_all_algorithms.3
  head/secure/lib/libcrypto/man/PEM_write_bio_CMS_stream.3
  head/secure/lib/libcrypto/man/PEM_write_bio_PKCS7_stream.3
  head/secure/lib/libcrypto/man/PKCS12_create.3
  head/secure/lib/libcrypto/man/PKCS12_parse.3
  head/secure/lib/libcrypto/man/PKCS7_decrypt.3
  head/secure/lib/libcrypto/man/PKCS7_encrypt.3
  head/secure/lib/libcrypto/man/PKCS7_sign.3
  head/secure/lib/libcrypto/man/PKCS7_sign_add_signer.3
  head/secure/lib/libcrypto/man/PKCS7_verify.3
  head/secure/lib/libcrypto/man/RAND_add.3
  head/secure/lib/libcrypto/man/RAND_bytes.3
  head/secure/lib/libcrypto/man/RAND_cleanup.3
  head/secure/lib/libcrypto/man/RAND_egd.3
  head/secure/lib/libcrypto/man/RAND_load_file.3
  head/secure/lib/libcrypto/man/RAND_set_rand_method.3
  head/secure/lib/libcrypto/man/RSA_blinding_on.3
  head/secure/lib/libcrypto/man/RSA_check_key.3
  head/secure/lib/libcrypto/man/RSA_generate_key.3
  head/secure/lib/libcrypto/man/RSA_get_ex_new_index.3
  head/secure/lib/libcrypto/man/RSA_new.3
  head/secure/lib/libcrypto/man/RSA_padding_add_PKCS1_type_1.3
  head/secure/lib/libcrypto/man/RSA_print.3
  head/secure/lib/libcrypto/man/RSA_private_encrypt.3
  head/secure/lib/libcrypto/man/RSA_public_encrypt.3
  head/secure/lib/libcrypto/man/RSA_set_method.3
  head/secure/lib/libcrypto/man/RSA_sign.3
  head/secure/lib/libcrypto/man/RSA_sign_ASN1_OCTET_STRING.3
  head/secure/lib/libcrypto/man/RSA_size.3
  head/secure/lib/libcrypto/man/SMIME_read_CMS.3
  head/secure/lib/libcrypto/man/SMIME_read_PKCS7.3
  head/secure/lib/libcrypto/man/SMIME_write_CMS.3
  head/secure/lib/libcrypto/man/SMIME_write_PKCS7.3
  head/secure/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3
  head/secure/lib/libcrypto/man/X509_NAME_add_entry_by_txt.3
  head/secure/lib/libcrypto/man/X509_NAME_get_index_by_NID.3
  head/secure/lib/libcrypto/man/X509_NAME_print_ex.3
  head/secure/lib/libcrypto/man/X509_STORE_CTX_get_error.3
  head/secure/lib/libcrypto/man/X509_STORE_CTX_get_ex_new_index.3
  head/secure/lib/libcrypto/man/X509_STORE_CTX_new.3
  head/secure/lib/libcrypto/man/X509_STORE_CTX_set_verify_cb.3
  head/secure/lib/libcrypto/man/X509_STORE_set_verify_cb_func.3
  head/secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
  head/secure/lib/libcrypto/man/X509_check_host.3
  head/secure/lib/libcrypto/man/X509_check_private_key.3
  head/secure/lib/libcrypto/man/X509_new.3
  head/secure/lib/libcrypto/man/X509_verify_cert.3
  head/secure/lib/libcrypto/man/bio.3
  head/secure/lib/libcrypto/man/blowfish.3
  head/secure/lib/libcrypto/man/bn.3
  head/secure/lib/libcrypto/man/bn_internal.3
  head/secure/lib/libcrypto/man/buffer.3
  head/secure/lib/libcrypto/man/crypto.3
  head/secure/lib/libcrypto/man/d2i_ASN1_OBJECT.3
  head/secure/lib/libcrypto/man/d2i_CMS_ContentInfo.3
  head/secure/lib/libcrypto/man/d2i_DHparams.3
  head/secure/lib/libcrypto/man/d2i_DSAPublicKey.3
  head/secure/lib/libcrypto/man/d2i_ECPKParameters.3
  head/secure/lib/libcrypto/man/d2i_ECPrivateKey.3
  head/secure/lib/libcrypto/man/d2i_PKCS8PrivateKey.3
  head/secure/lib/libcrypto/man/d2i_PrivateKey.3
  head/secure/lib/libcrypto/man/d2i_RSAPublicKey.3
  head/secure/lib/libcrypto/man/d2i_X509.3
  head/secure/lib/libcrypto/man/d2i_X509_ALGOR.3
  head/secure/lib/libcrypto/man/d2i_X509_CRL.3
  head/secure/lib/libcrypto/man/d2i_X509_NAME.3
  head/secure/lib/libcrypto/man/d2i_X509_REQ.3
  head/secure/lib/libcrypto/man/d2i_X509_SIG.3
  head/secure/lib/libcrypto/man/des.3
  head/secure/lib/libcrypto/man/dh.3
  head/secure/lib/libcrypto/man/dsa.3
  head/secure/lib/libcrypto/man/ec.3
  head/secure/lib/libcrypto/man/ecdsa.3
  head/secure/lib/libcrypto/man/engine.3
  head/secure/lib/libcrypto/man/err.3
  head/secure/lib/libcrypto/man/evp.3
  head/secure/lib/libcrypto/man/hmac.3
  head/secure/lib/libcrypto/man/i2d_CMS_bio_stream.3
  head/secure/lib/libcrypto/man/i2d_PKCS7_bio_stream.3
  head/secure/lib/libcrypto/man/lh_stats.3
  head/secure/lib/libcrypto/man/lhash.3
  head/secure/lib/libcrypto/man/md5.3
  head/secure/lib/libcrypto/man/mdc2.3
  head/secure/lib/libcrypto/man/pem.3
  head/secure/lib/libcrypto/man/rand.3
  head/secure/lib/libcrypto/man/rc4.3
  head/secure/lib/libcrypto/man/ripemd.3
  head/secure/lib/libcrypto/man/rsa.3
  head/secure/lib/libcrypto/man/sha.3
  head/secure/lib/libcrypto/man/threads.3
  head/secure/lib/libcrypto/man/ui.3
  head/secure/lib/libcrypto/man/ui_compat.3
  head/secure/lib/libcrypto/man/x509.3
  head/secure/lib/libssl/man/SSL_CIPHER_get_name.3
  head/secure/lib/libssl/man/SSL_COMP_add_compression_method.3
  head/secure/lib/libssl/man/SSL_CONF_CTX_new.3
  head/secure/lib/libssl/man/SSL_CONF_CTX_set1_prefix.3
  head/secure/lib/libssl/man/SSL_CONF_CTX_set_flags.3
  head/secure/lib/libssl/man/SSL_CONF_CTX_set_ssl_ctx.3
  head/secure/lib/libssl/man/SSL_CONF_cmd.3
  head/secure/lib/libssl/man/SSL_CONF_cmd_argv.3
  head/secure/lib/libssl/man/SSL_CTX_add1_chain_cert.3
  head/secure/lib/libssl/man/SSL_CTX_add_extra_chain_cert.3
  head/secure/lib/libssl/man/SSL_CTX_add_session.3
  head/secure/lib/libssl/man/SSL_CTX_ctrl.3
  head/secure/lib/libssl/man/SSL_CTX_flush_sessions.3
  head/secure/lib/libssl/man/SSL_CTX_free.3
  head/secure/lib/libssl/man/SSL_CTX_get0_param.3
  head/secure/lib/libssl/man/SSL_CTX_get_ex_new_index.3
  head/secure/lib/libssl/man/SSL_CTX_get_verify_mode.3
  head/secure/lib/libssl/man/SSL_CTX_load_verify_locations.3
  head/secure/lib/libssl/man/SSL_CTX_new.3
  head/secure/lib/libssl/man/SSL_CTX_sess_number.3
  head/secure/lib/libssl/man/SSL_CTX_sess_set_cache_size.3
  head/secure/lib/libssl/man/SSL_CTX_sess_set_get_cb.3
  head/secure/lib/libssl/man/SSL_CTX_sessions.3
  head/secure/lib/libssl/man/SSL_CTX_set1_curves.3
  head/secure/lib/libssl/man/SSL_CTX_set1_verify_cert_store.3
  head/secure/lib/libssl/man/SSL_CTX_set_alpn_select_cb.3
  head/secure/lib/libssl/man/SSL_CTX_set_cert_cb.3
  head/secure/lib/libssl/man/SSL_CTX_set_cert_store.3
  head/secure/lib/libssl/man/SSL_CTX_set_cert_verify_callback.3
  head/secure/lib/libssl/man/SSL_CTX_set_cipher_list.3
  head/secure/lib/libssl/man/SSL_CTX_set_client_CA_list.3
  head/secure/lib/libssl/man/SSL_CTX_set_client_cert_cb.3
  head/secure/lib/libssl/man/SSL_CTX_set_custom_cli_ext.3
  head/secure/lib/libssl/man/SSL_CTX_set_default_passwd_cb.3
  head/secure/lib/libssl/man/SSL_CTX_set_generate_session_id.3
  head/secure/lib/libssl/man/SSL_CTX_set_info_callback.3
  head/secure/lib/libssl/man/SSL_CTX_set_max_cert_list.3
  head/secure/lib/libssl/man/SSL_CTX_set_mode.3
  head/secure/lib/libssl/man/SSL_CTX_set_msg_callback.3
  head/secure/lib/libssl/man/SSL_CTX_set_options.3
  head/secure/lib/libssl/man/SSL_CTX_set_psk_client_callback.3
  head/secure/lib/libssl/man/SSL_CTX_set_quiet_shutdown.3
  head/secure/lib/libssl/man/SSL_CTX_set_read_ahead.3
  head/secure/lib/libssl/man/SSL_CTX_set_session_cache_mode.3
  head/secure/lib/libssl/man/SSL_CTX_set_session_id_context.3
  head/secure/lib/libssl/man/SSL_CTX_set_ssl_version.3
  head/secure/lib/libssl/man/SSL_CTX_set_timeout.3
  head/secure/lib/libssl/man/SSL_CTX_set_tlsext_servername_callback.3
  head/secure/lib/libssl/man/SSL_CTX_set_tlsext_status_cb.3
  head/secure/lib/libssl/man/SSL_CTX_set_tlsext_ticket_key_cb.3
  head/secure/lib/libssl/man/SSL_CTX_set_tmp_dh_callback.3
  head/secure/lib/libssl/man/SSL_CTX_set_tmp_rsa_callback.3
  head/secure/lib/libssl/man/SSL_CTX_set_verify.3
  head/secure/lib/libssl/man/SSL_CTX_use_certificate.3
  head/secure/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3
  head/secure/lib/libssl/man/SSL_CTX_use_serverinfo.3
  head/secure/lib/libssl/man/SSL_SESSION_free.3
  head/secure/lib/libssl/man/SSL_SESSION_get_ex_new_index.3
  head/secure/lib/libssl/man/SSL_SESSION_get_time.3
  head/secure/lib/libssl/man/SSL_accept.3
  head/secure/lib/libssl/man/SSL_alert_type_string.3
  head/secure/lib/libssl/man/SSL_check_chain.3
  head/secure/lib/libssl/man/SSL_clear.3
  head/secure/lib/libssl/man/SSL_connect.3
  head/secure/lib/libssl/man/SSL_do_handshake.3
  head/secure/lib/libssl/man/SSL_export_keying_material.3
  head/secure/lib/libssl/man/SSL_free.3
  head/secure/lib/libssl/man/SSL_get_SSL_CTX.3
  head/secure/lib/libssl/man/SSL_get_ciphers.3
  head/secure/lib/libssl/man/SSL_get_client_CA_list.3
  head/secure/lib/libssl/man/SSL_get_current_cipher.3
  head/secure/lib/libssl/man/SSL_get_default_timeout.3
  head/secure/lib/libssl/man/SSL_get_error.3
  head/secure/lib/libssl/man/SSL_get_ex_data_X509_STORE_CTX_idx.3
  head/secure/lib/libssl/man/SSL_get_ex_new_index.3
  head/secure/lib/libssl/man/SSL_get_fd.3
  head/secure/lib/libssl/man/SSL_get_peer_cert_chain.3
  head/secure/lib/libssl/man/SSL_get_peer_certificate.3
  head/secure/lib/libssl/man/SSL_get_psk_identity.3
  head/secure/lib/libssl/man/SSL_get_rbio.3
  head/secure/lib/libssl/man/SSL_get_session.3
  head/secure/lib/libssl/man/SSL_get_verify_result.3
  head/secure/lib/libssl/man/SSL_get_version.3
  head/secure/lib/libssl/man/SSL_library_init.3
  head/secure/lib/libssl/man/SSL_load_client_CA_file.3
  head/secure/lib/libssl/man/SSL_new.3
  head/secure/lib/libssl/man/SSL_pending.3
  head/secure/lib/libssl/man/SSL_read.3
  head/secure/lib/libssl/man/SSL_rstate_string.3
  head/secure/lib/libssl/man/SSL_session_reused.3
  head/secure/lib/libssl/man/SSL_set_bio.3
  head/secure/lib/libssl/man/SSL_set_connect_state.3
  head/secure/lib/libssl/man/SSL_set_fd.3
  head/secure/lib/libssl/man/SSL_set_session.3
  head/secure/lib/libssl/man/SSL_set_shutdown.3
  head/secure/lib/libssl/man/SSL_set_verify_result.3
  head/secure/lib/libssl/man/SSL_shutdown.3
  head/secure/lib/libssl/man/SSL_state_string.3
  head/secure/lib/libssl/man/SSL_want.3
  head/secure/lib/libssl/man/SSL_write.3
  head/secure/lib/libssl/man/d2i_SSL_SESSION.3
  head/secure/lib/libssl/man/ssl.3
  head/secure/usr.bin/openssl/man/CA.pl.1
  head/secure/usr.bin/openssl/man/asn1parse.1
  head/secure/usr.bin/openssl/man/ca.1
  head/secure/usr.bin/openssl/man/ciphers.1
  head/secure/usr.bin/openssl/man/cms.1
  head/secure/usr.bin/openssl/man/crl.1
  head/secure/usr.bin/openssl/man/crl2pkcs7.1
  head/secure/usr.bin/openssl/man/dgst.1
  head/secure/usr.bin/openssl/man/dhparam.1
  head/secure/usr.bin/openssl/man/dsa.1
  head/secure/usr.bin/openssl/man/dsaparam.1
  head/secure/usr.bin/openssl/man/ec.1
  head/secure/usr.bin/openssl/man/ecparam.1
  head/secure/usr.bin/openssl/man/enc.1
  head/secure/usr.bin/openssl/man/errstr.1
  head/secure/usr.bin/openssl/man/gendsa.1
  head/secure/usr.bin/openssl/man/genpkey.1
  head/secure/usr.bin/openssl/man/genrsa.1
  head/secure/usr.bin/openssl/man/nseq.1
  head/secure/usr.bin/openssl/man/ocsp.1
  head/secure/usr.bin/openssl/man/openssl.1
  head/secure/usr.bin/openssl/man/passwd.1
  head/secure/usr.bin/openssl/man/pkcs12.1
  head/secure/usr.bin/openssl/man/pkcs7.1
  head/secure/usr.bin/openssl/man/pkcs8.1
  head/secure/usr.bin/openssl/man/pkey.1
  head/secure/usr.bin/openssl/man/pkeyparam.1
  head/secure/usr.bin/openssl/man/pkeyutl.1
  head/secure/usr.bin/openssl/man/rand.1
  head/secure/usr.bin/openssl/man/req.1
  head/secure/usr.bin/openssl/man/rsa.1
  head/secure/usr.bin/openssl/man/rsautl.1
  head/secure/usr.bin/openssl/man/s_client.1
  head/secure/usr.bin/openssl/man/s_server.1
  head/secure/usr.bin/openssl/man/s_time.1
  head/secure/usr.bin/openssl/man/sess_id.1
  head/secure/usr.bin/openssl/man/smime.1
  head/secure/usr.bin/openssl/man/speed.1
  head/secure/usr.bin/openssl/man/spkac.1
  head/secure/usr.bin/openssl/man/ts.1
  head/secure/usr.bin/openssl/man/tsget.1
  head/secure/usr.bin/openssl/man/verify.1
  head/secure/usr.bin/openssl/man/version.1
  head/secure/usr.bin/openssl/man/x509.1
  head/secure/usr.bin/openssl/man/x509v3_config.1
Directory Properties:
  head/crypto/openssl/   (props changed)

Modified: head/crypto/openssl/CHANGES
==============================================================================
--- head/crypto/openssl/CHANGES	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/CHANGES	Tue Mar 27 17:17:58 2018	(r331627)
@@ -7,6 +7,21 @@
  https://github.com/openssl/openssl/commits/ and pick the appropriate
  release branch.
 
+ Changes between 1.0.2n and 1.0.2o [27 Mar 2018]
+
+  *) Constructed ASN.1 types with a recursive definition could exceed the stack
+
+     Constructed ASN.1 types with a recursive definition (such as can be found
+     in PKCS7) could eventually exceed the stack given malicious input with
+     excessive recursion. This could result in a Denial Of Service attack. There
+     are no such structures used within SSL/TLS that come from untrusted sources
+     so this is considered safe.
+
+     This issue was reported to OpenSSL on 4th January 2018 by the OSS-fuzz
+     project.
+     (CVE-2018-0739)
+     [Matt Caswell]
+
  Changes between 1.0.2m and 1.0.2n [7 Dec 2017]
 
   *) Read/write after SSL object in error state
@@ -2012,8 +2027,11 @@
      to work with OPENSSL_NO_SSL_INTERN defined.
      [Steve Henson]
 
-  *) Add SRP support.
-     [Tom Wu  and Ben Laurie]
+  *) A long standing patch to add support for SRP from EdelWeb (Peter
+     Sylvester and Christophe Renou) was integrated.
+     [Christophe Renou , Peter Sylvester
+     , Tom Wu , and
+     Ben Laurie]
 
   *) Add functions to copy EVP_PKEY_METHOD and retrieve flags and id.
      [Steve Henson]

Modified: head/crypto/openssl/Configure
==============================================================================
--- head/crypto/openssl/Configure	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/Configure	Tue Mar 27 17:17:58 2018	(r331627)
@@ -354,7 +354,7 @@ my %table=(
 "hpux-gcc",	"gcc:-DB_ENDIAN -DBN_DIV2W -O3::(unknown)::-Wl,+s -ldld:DES_PTR DES_UNROLL DES_RISC1:${no_asm}:dl:hpux-shared:-fPIC:-shared:.sl.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 
 #### HP MPE/iX http://jazz.external.hp.com/src/openssl/
-"MPE/iX-gcc",	"gcc:-D_ENDIAN -DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB::(unknown):MPE:-L/SYSLOG/PUB -lsyslog -lsocket -lcurses:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::",
+"MPE/iX-gcc",	"gcc:-DBN_DIV2W -O3 -D_POSIX_SOURCE -D_SOCKET_SOURCE -I/SYSLOG/PUB::(unknown):MPE:-L/SYSLOG/PUB -lsyslog -lsocket -lcurses:BN_LLONG DES_PTR DES_UNROLL DES_RISC1:::",
 
 # DEC Alpha OSF/1/Tru64 targets.
 #
@@ -1269,7 +1269,7 @@ my ($prelflags,$postlflags)=split('%',$lflags);
 if (defined($postlflags))	{ $lflags=$postlflags;	}
 else				{ $lflags=$prelflags; undef $prelflags;	}
 
-if ($target =~ /^mingw/ && `$cc --target-help 2>&1` !~ m/\-mno\-cygwin/m)
+if ($target =~ /^mingw/ && `$cross_compile_prefix$cc --target-help 2>&1` !~ m/\-mno\-cygwin/m)
 	{
 	$cflags =~ s/\-mno\-cygwin\s*//;
 	$shared_ldflag =~ s/\-mno\-cygwin\s*//;
@@ -1661,18 +1661,25 @@ if ($shlib_version_number =~ /(^[0-9]*)\.([0-9\.]*)/)
 	$shlib_minor=$2;
 	}
 
-my $ecc = $cc;
-$ecc = "clang" if `$cc --version 2>&1` =~ /clang/;
+my %predefined;
 
+# collect compiler pre-defines from gcc or gcc-alike...
+open(PIPE, "$cross_compile_prefix$cc -dM -E -x c /dev/null 2>&1 |");
+while () {
+  m/^#define\s+(\w+(?:\(\w+\))?)(?:\s+(.+))?/ or last;
+  $predefined{$1} = defined($2) ? $2 : "";
+}
+close(PIPE);
+
 if ($strict_warnings)
 	{
 	my $wopt;
-	die "ERROR --strict-warnings requires gcc or clang" unless ($ecc =~ /gcc$/ or $ecc =~ /clang$/);
+	die "ERROR --strict-warnings requires gcc or clang" unless defined($predefined{__GNUC__});
 	foreach $wopt (split /\s+/, $gcc_devteam_warn)
 		{
 		$cflags .= " $wopt" unless ($cflags =~ /(^|\s)$wopt(\s|$)/)
 		}
-	if ($ecc eq "clang")
+	if (defined($predefined{__clang__}))
 		{
 		foreach $wopt (split /\s+/, $clang_devteam_warn)
 			{
@@ -1723,15 +1730,14 @@ while ()
 		s/^NM=\s*/NM= \$\(CROSS_COMPILE\)/;
 		s/^RANLIB=\s*/RANLIB= \$\(CROSS_COMPILE\)/;
 		s/^RC=\s*/RC= \$\(CROSS_COMPILE\)/;
-		s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $cc eq "gcc";
+		s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $predefined{__GNUC__} >= 3;
 		}
 	else	{
 		s/^CC=.*$/CC= $cc/;
 		s/^AR=\s*ar/AR= $ar/;
 		s/^RANLIB=.*/RANLIB= $ranlib/;
 		s/^RC=.*/RC= $windres/;
-		s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc";
-		s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $ecc eq "gcc" || $ecc eq "clang";
+		s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $predefined{__GNUC__} >= 3;
 		}
 	s/^CFLAG=.*$/CFLAG= $cflags/;
 	s/^DEPFLAG=.*$/DEPFLAG=$depflags/;

Modified: head/crypto/openssl/LICENSE
==============================================================================
--- head/crypto/openssl/LICENSE	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/LICENSE	Tue Mar 27 17:17:58 2018	(r331627)
@@ -12,7 +12,7 @@
   ---------------
 
 /* ====================================================================
- * Copyright (c) 1998-2017 The OpenSSL Project.  All rights reserved.
+ * Copyright (c) 1998-2018 The OpenSSL Project.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions

Modified: head/crypto/openssl/Makefile
==============================================================================
--- head/crypto/openssl/Makefile	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/Makefile	Tue Mar 27 17:17:58 2018	(r331627)
@@ -4,7 +4,7 @@
 ## Makefile for OpenSSL
 ##
 
-VERSION=1.0.2n
+VERSION=1.0.2o
 MAJOR=1
 MINOR=0.2
 SHLIB_VERSION_NUMBER=1.0.0
@@ -73,7 +73,7 @@ NM= nm
 PERL= /usr/bin/perl
 TAR= tar
 TARFLAGS= --no-recursion
-MAKEDEPPROG=makedepend
+MAKEDEPPROG= cc
 LIBDIR=lib
 
 # We let the C compiler driver to take care of .s files. This is done in

Modified: head/crypto/openssl/NEWS
==============================================================================
--- head/crypto/openssl/NEWS	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/NEWS	Tue Mar 27 17:17:58 2018	(r331627)
@@ -5,6 +5,11 @@
   This file gives a brief overview of the major changes between each OpenSSL
   release. For more details please read the CHANGES file.
 
+  Major changes between OpenSSL 1.0.2n and OpenSSL 1.0.2o [27 Mar 2018]
+
+      o Constructed ASN.1 types with a recursive definition could exceed the
+        stack (CVE-2018-0739)
+
   Major changes between OpenSSL 1.0.2m and OpenSSL 1.0.2n [7 Dec 2017]
 
       o Read/write after SSL object in error state (CVE-2017-3737)

Modified: head/crypto/openssl/README
==============================================================================
--- head/crypto/openssl/README	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/README	Tue Mar 27 17:17:58 2018	(r331627)
@@ -1,5 +1,5 @@
 
- OpenSSL 1.0.2n 7 Dec 2017
+ OpenSSL 1.0.2o 27 Mar 2018
 
  Copyright (c) 1998-2015 The OpenSSL Project
  Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson

Modified: head/crypto/openssl/apps/app_rand.c
==============================================================================
--- head/crypto/openssl/apps/app_rand.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/app_rand.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -128,7 +128,7 @@ int app_RAND_load_file(const char *file, BIO *bio_e, i
 #endif
 
     if (file == NULL)
-        file = RAND_file_name(buffer, sizeof buffer);
+        file = RAND_file_name(buffer, sizeof(buffer));
     else if (RAND_egd(file) > 0) {
         /*
          * we try if the given filename is an EGD socket. if it is, we don't
@@ -203,7 +203,7 @@ int app_RAND_write_file(const char *file, BIO *bio_e)
         return 0;
 
     if (file == NULL)
-        file = RAND_file_name(buffer, sizeof buffer);
+        file = RAND_file_name(buffer, sizeof(buffer));
     if (file == NULL || !RAND_write_file(file)) {
         BIO_printf(bio_e, "unable to write 'random state'\n");
         return 0;

Modified: head/crypto/openssl/apps/apps.c
==============================================================================
--- head/crypto/openssl/apps/apps.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/apps.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -1738,9 +1738,9 @@ int save_serial(char *serialfile, char *suffix, BIGNUM
         BUF_strlcpy(buf[0], serialfile, BSIZE);
     else {
 #ifndef OPENSSL_SYS_VMS
-        j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, suffix);
+        j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", serialfile, suffix);
 #else
-        j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", serialfile, suffix);
+        j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", serialfile, suffix);
 #endif
     }
 #ifdef RL_DEBUG
@@ -1789,14 +1789,14 @@ int rotate_serial(char *serialfile, char *new_suffix, 
         goto err;
     }
 #ifndef OPENSSL_SYS_VMS
-    j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", serialfile, new_suffix);
+    j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", serialfile, new_suffix);
 #else
-    j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", serialfile, new_suffix);
+    j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", serialfile, new_suffix);
 #endif
 #ifndef OPENSSL_SYS_VMS
-    j = BIO_snprintf(buf[1], sizeof buf[1], "%s.%s", serialfile, old_suffix);
+    j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s.%s", serialfile, old_suffix);
 #else
-    j = BIO_snprintf(buf[1], sizeof buf[1], "%s-%s", serialfile, old_suffix);
+    j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s-%s", serialfile, old_suffix);
 #endif
 #ifdef RL_DEBUG
     BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n",
@@ -1877,9 +1877,9 @@ CA_DB *load_index(char *dbfile, DB_ATTR *db_attr)
         goto err;
 
 #ifndef OPENSSL_SYS_VMS
-    BIO_snprintf(buf[0], sizeof buf[0], "%s.attr", dbfile);
+    BIO_snprintf(buf[0], sizeof(buf[0]), "%s.attr", dbfile);
 #else
-    BIO_snprintf(buf[0], sizeof buf[0], "%s-attr", dbfile);
+    BIO_snprintf(buf[0], sizeof(buf[0]), "%s-attr", dbfile);
 #endif
     dbattr_conf = NCONF_new(NULL);
     if (NCONF_load(dbattr_conf, buf[0], &errorline) <= 0) {
@@ -1967,19 +1967,19 @@ int save_index(const char *dbfile, const char *suffix,
         goto err;
     }
 #ifndef OPENSSL_SYS_VMS
-    j = BIO_snprintf(buf[2], sizeof buf[2], "%s.attr", dbfile);
+    j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s.attr", dbfile);
 #else
-    j = BIO_snprintf(buf[2], sizeof buf[2], "%s-attr", dbfile);
+    j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s-attr", dbfile);
 #endif
 #ifndef OPENSSL_SYS_VMS
-    j = BIO_snprintf(buf[1], sizeof buf[1], "%s.attr.%s", dbfile, suffix);
+    j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s.attr.%s", dbfile, suffix);
 #else
-    j = BIO_snprintf(buf[1], sizeof buf[1], "%s-attr-%s", dbfile, suffix);
+    j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s-attr-%s", dbfile, suffix);
 #endif
 #ifndef OPENSSL_SYS_VMS
-    j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", dbfile, suffix);
+    j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", dbfile, suffix);
 #else
-    j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", dbfile, suffix);
+    j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", dbfile, suffix);
 #endif
 #ifdef RL_DEBUG
     BIO_printf(bio_err, "DEBUG: writing \"%s\"\n", buf[0]);
@@ -2028,29 +2028,29 @@ int rotate_index(const char *dbfile, const char *new_s
         goto err;
     }
 #ifndef OPENSSL_SYS_VMS
-    j = BIO_snprintf(buf[4], sizeof buf[4], "%s.attr", dbfile);
+    j = BIO_snprintf(buf[4], sizeof(buf[4]), "%s.attr", dbfile);
 #else
-    j = BIO_snprintf(buf[4], sizeof buf[4], "%s-attr", dbfile);
+    j = BIO_snprintf(buf[4], sizeof(buf[4]), "%s-attr", dbfile);
 #endif
 #ifndef OPENSSL_SYS_VMS
-    j = BIO_snprintf(buf[2], sizeof buf[2], "%s.attr.%s", dbfile, new_suffix);
+    j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s.attr.%s", dbfile, new_suffix);
 #else
-    j = BIO_snprintf(buf[2], sizeof buf[2], "%s-attr-%s", dbfile, new_suffix);
+    j = BIO_snprintf(buf[2], sizeof(buf[2]), "%s-attr-%s", dbfile, new_suffix);
 #endif
 #ifndef OPENSSL_SYS_VMS
-    j = BIO_snprintf(buf[0], sizeof buf[0], "%s.%s", dbfile, new_suffix);
+    j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s.%s", dbfile, new_suffix);
 #else
-    j = BIO_snprintf(buf[0], sizeof buf[0], "%s-%s", dbfile, new_suffix);
+    j = BIO_snprintf(buf[0], sizeof(buf[0]), "%s-%s", dbfile, new_suffix);
 #endif
 #ifndef OPENSSL_SYS_VMS
-    j = BIO_snprintf(buf[1], sizeof buf[1], "%s.%s", dbfile, old_suffix);
+    j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s.%s", dbfile, old_suffix);
 #else
-    j = BIO_snprintf(buf[1], sizeof buf[1], "%s-%s", dbfile, old_suffix);
+    j = BIO_snprintf(buf[1], sizeof(buf[1]), "%s-%s", dbfile, old_suffix);
 #endif
 #ifndef OPENSSL_SYS_VMS
-    j = BIO_snprintf(buf[3], sizeof buf[3], "%s.attr.%s", dbfile, old_suffix);
+    j = BIO_snprintf(buf[3], sizeof(buf[3]), "%s.attr.%s", dbfile, old_suffix);
 #else
-    j = BIO_snprintf(buf[3], sizeof buf[3], "%s-attr-%s", dbfile, old_suffix);
+    j = BIO_snprintf(buf[3], sizeof(buf[3]), "%s-attr-%s", dbfile, old_suffix);
 #endif
 #ifdef RL_DEBUG
     BIO_printf(bio_err, "DEBUG: renaming \"%s\" to \"%s\"\n", dbfile, buf[1]);
@@ -2604,7 +2604,7 @@ static void jpake_send_step3a(BIO *bconn, JPAKE_CTX *c
 
     JPAKE_STEP3A_init(&s3a);
     JPAKE_STEP3A_generate(&s3a, ctx);
-    BIO_write(bconn, s3a.hhk, sizeof s3a.hhk);
+    BIO_write(bconn, s3a.hhk, sizeof(s3a.hhk));
     (void)BIO_flush(bconn);
     JPAKE_STEP3A_release(&s3a);
 }
@@ -2615,7 +2615,7 @@ static void jpake_send_step3b(BIO *bconn, JPAKE_CTX *c
 
     JPAKE_STEP3B_init(&s3b);
     JPAKE_STEP3B_generate(&s3b, ctx);
-    BIO_write(bconn, s3b.hk, sizeof s3b.hk);
+    BIO_write(bconn, s3b.hk, sizeof(s3b.hk));
     (void)BIO_flush(bconn);
     JPAKE_STEP3B_release(&s3b);
 }
@@ -2625,7 +2625,7 @@ static void readbn(BIGNUM **bn, BIO *bconn)
     char buf[10240];
     int l;
 
-    l = BIO_gets(bconn, buf, sizeof buf);
+    l = BIO_gets(bconn, buf, sizeof(buf));
     assert(l > 0);
     assert(buf[l - 1] == '\n');
     buf[l - 1] = '\0';
@@ -2672,8 +2672,8 @@ static void jpake_receive_step3a(JPAKE_CTX *ctx, BIO *
     int l;
 
     JPAKE_STEP3A_init(&s3a);
-    l = BIO_read(bconn, s3a.hhk, sizeof s3a.hhk);
-    assert(l == sizeof s3a.hhk);
+    l = BIO_read(bconn, s3a.hhk, sizeof(s3a.hhk));
+    assert(l == sizeof(s3a.hhk));
     if (!JPAKE_STEP3A_process(ctx, &s3a)) {
         ERR_print_errors(bio_err);
         exit(1);
@@ -2687,8 +2687,8 @@ static void jpake_receive_step3b(JPAKE_CTX *ctx, BIO *
     int l;
 
     JPAKE_STEP3B_init(&s3b);
-    l = BIO_read(bconn, s3b.hk, sizeof s3b.hk);
-    assert(l == sizeof s3b.hk);
+    l = BIO_read(bconn, s3b.hk, sizeof(s3b.hk));
+    assert(l == sizeof(s3b.hk));
     if (!JPAKE_STEP3B_process(ctx, &s3b)) {
         ERR_print_errors(bio_err);
         exit(1);

Modified: head/crypto/openssl/apps/ca.c
==============================================================================
--- head/crypto/openssl/apps/ca.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/ca.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -1628,8 +1628,7 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *
                    CONF *lconf, unsigned long certopt, unsigned long nameopt,
                    int default_op, int ext_copy, int selfsign)
 {
-    X509_NAME *name = NULL, *CAname = NULL, *subject = NULL, *dn_subject =
-        NULL;
+    X509_NAME *name = NULL, *CAname = NULL, *subject = NULL;
     ASN1_UTCTIME *tm, *tmptm;
     ASN1_STRING *str, *str2;
     ASN1_OBJECT *obj;
@@ -1817,8 +1816,6 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *
 
             if (push != NULL) {
                 if (!X509_NAME_add_entry(subject, push, -1, 0)) {
-                    if (push != NULL)
-                        X509_NAME_ENTRY_free(push);
                     BIO_printf(bio_err, "Memory allocation failure\n");
                     goto err;
                 }
@@ -1836,104 +1833,6 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *
             goto err;
     }
 
-    if (verbose)
-        BIO_printf(bio_err,
-                   "The subject name appears to be ok, checking data base for clashes\n");
-
-    /* Build the correct Subject if no e-mail is wanted in the subject */
-    /*
-     * and add it later on because of the method extensions are added
-     * (altName)
-     */
-
-    if (email_dn)
-        dn_subject = subject;
-    else {
-        X509_NAME_ENTRY *tmpne;
-        /*
-         * Its best to dup the subject DN and then delete any email addresses
-         * because this retains its structure.
-         */
-        if (!(dn_subject = X509_NAME_dup(subject))) {
-            BIO_printf(bio_err, "Memory allocation failure\n");
-            goto err;
-        }
-        while ((i = X509_NAME_get_index_by_NID(dn_subject,
-                                               NID_pkcs9_emailAddress,
-                                               -1)) >= 0) {
-            tmpne = X509_NAME_get_entry(dn_subject, i);
-            X509_NAME_delete_entry(dn_subject, i);
-            X509_NAME_ENTRY_free(tmpne);
-        }
-    }
-
-    if (BN_is_zero(serial))
-        row[DB_serial] = BUF_strdup("00");
-    else
-        row[DB_serial] = BN_bn2hex(serial);
-    if (row[DB_serial] == NULL) {
-        BIO_printf(bio_err, "Memory allocation failure\n");
-        goto err;
-    }
-
-    if (db->attributes.unique_subject) {
-        OPENSSL_STRING *crow = row;
-
-        rrow = TXT_DB_get_by_index(db->db, DB_name, crow);
-        if (rrow != NULL) {
-            BIO_printf(bio_err,
-                       "ERROR:There is already a certificate for %s\n",
-                       row[DB_name]);
-        }
-    }
-    if (rrow == NULL) {
-        rrow = TXT_DB_get_by_index(db->db, DB_serial, row);
-        if (rrow != NULL) {
-            BIO_printf(bio_err,
-                       "ERROR:Serial number %s has already been issued,\n",
-                       row[DB_serial]);
-            BIO_printf(bio_err,
-                       "      check the database/serial_file for corruption\n");
-        }
-    }
-
-    if (rrow != NULL) {
-        BIO_printf(bio_err, "The matching entry has the following details\n");
-        if (rrow[DB_type][0] == 'E')
-            p = "Expired";
-        else if (rrow[DB_type][0] == 'R')
-            p = "Revoked";
-        else if (rrow[DB_type][0] == 'V')
-            p = "Valid";
-        else
-            p = "\ninvalid type, Data base error\n";
-        BIO_printf(bio_err, "Type          :%s\n", p);;
-        if (rrow[DB_type][0] == 'R') {
-            p = rrow[DB_exp_date];
-            if (p == NULL)
-                p = "undef";
-            BIO_printf(bio_err, "Was revoked on:%s\n", p);
-        }
-        p = rrow[DB_exp_date];
-        if (p == NULL)
-            p = "undef";
-        BIO_printf(bio_err, "Expires on    :%s\n", p);
-        p = rrow[DB_serial];
-        if (p == NULL)
-            p = "undef";
-        BIO_printf(bio_err, "Serial Number :%s\n", p);
-        p = rrow[DB_file];
-        if (p == NULL)
-            p = "undef";
-        BIO_printf(bio_err, "File name     :%s\n", p);
-        p = rrow[DB_name];
-        if (p == NULL)
-            p = "undef";
-        BIO_printf(bio_err, "Subject Name  :%s\n", p);
-        ok = -1;                /* This is now a 'bad' error. */
-        goto err;
-    }
-
     /* We are now totally happy, lets make and sign the certificate */
     if (verbose)
         BIO_printf(bio_err,
@@ -2056,12 +1955,126 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *
                 goto err;
     }
 
-    /* Set the right value for the noemailDN option */
-    if (email_dn == 0) {
-        if (!X509_set_subject_name(ret, dn_subject))
+    if (verbose)
+        BIO_printf(bio_err,
+                   "The subject name appears to be ok, checking data base for clashes\n");
+
+    /* Build the correct Subject if no e-mail is wanted in the subject */
+
+    if (!email_dn) {
+        X509_NAME_ENTRY *tmpne;
+        X509_NAME *dn_subject;
+
+        /*
+         * Its best to dup the subject DN and then delete any email addresses
+         * because this retains its structure.
+         */
+        if (!(dn_subject = X509_NAME_dup(subject))) {
+            BIO_printf(bio_err, "Memory allocation failure\n");
             goto err;
+        }
+        while ((i = X509_NAME_get_index_by_NID(dn_subject,
+                                               NID_pkcs9_emailAddress,
+                                               -1)) >= 0) {
+            tmpne = X509_NAME_get_entry(dn_subject, i);
+            X509_NAME_delete_entry(dn_subject, i);
+            X509_NAME_ENTRY_free(tmpne);
+        }
+
+        if (!X509_set_subject_name(ret, dn_subject)) {
+            X509_NAME_free(dn_subject);
+            goto err;
+        }
+        X509_NAME_free(dn_subject);
     }
 
+    row[DB_name] = X509_NAME_oneline(X509_get_subject_name(ret), NULL, 0);
+    if (row[DB_name] == NULL) {
+        BIO_printf(bio_err, "Memory allocation failure\n");
+        goto err;
+    }
+
+    if (BN_is_zero(serial))
+        row[DB_serial] = BUF_strdup("00");
+    else
+        row[DB_serial] = BN_bn2hex(serial);
+    if (row[DB_serial] == NULL) {
+        BIO_printf(bio_err, "Memory allocation failure\n");
+        goto err;
+    }
+
+    if (row[DB_name][0] == '\0') {
+        /*
+         * An empty subject! We'll use the serial number instead. If
+         * unique_subject is in use then we don't want different entries with
+         * empty subjects matching each other.
+         */
+        OPENSSL_free(row[DB_name]);
+        row[DB_name] = OPENSSL_strdup(row[DB_serial]);
+        if (row[DB_name] == NULL) {
+            BIO_printf(bio_err, "Memory allocation failure\n");
+            goto err;
+        }
+    }
+
+    if (db->attributes.unique_subject) {
+        OPENSSL_STRING *crow = row;
+
+        rrow = TXT_DB_get_by_index(db->db, DB_name, crow);
+        if (rrow != NULL) {
+            BIO_printf(bio_err,
+                       "ERROR:There is already a certificate for %s\n",
+                       row[DB_name]);
+        }
+    }
+    if (rrow == NULL) {
+        rrow = TXT_DB_get_by_index(db->db, DB_serial, row);
+        if (rrow != NULL) {
+            BIO_printf(bio_err,
+                       "ERROR:Serial number %s has already been issued,\n",
+                       row[DB_serial]);
+            BIO_printf(bio_err,
+                       "      check the database/serial_file for corruption\n");
+        }
+    }
+
+    if (rrow != NULL) {
+        BIO_printf(bio_err, "The matching entry has the following details\n");
+        if (rrow[DB_type][0] == 'E')
+            p = "Expired";
+        else if (rrow[DB_type][0] == 'R')
+            p = "Revoked";
+        else if (rrow[DB_type][0] == 'V')
+            p = "Valid";
+        else
+            p = "\ninvalid type, Data base error\n";
+        BIO_printf(bio_err, "Type          :%s\n", p);;
+        if (rrow[DB_type][0] == 'R') {
+            p = rrow[DB_exp_date];
+            if (p == NULL)
+                p = "undef";
+            BIO_printf(bio_err, "Was revoked on:%s\n", p);
+        }
+        p = rrow[DB_exp_date];
+        if (p == NULL)
+            p = "undef";
+        BIO_printf(bio_err, "Expires on    :%s\n", p);
+        p = rrow[DB_serial];
+        if (p == NULL)
+            p = "undef";
+        BIO_printf(bio_err, "Serial Number :%s\n", p);
+        p = rrow[DB_file];
+        if (p == NULL)
+            p = "undef";
+        BIO_printf(bio_err, "File name     :%s\n", p);
+        p = rrow[DB_name];
+        if (p == NULL)
+            p = "undef";
+        BIO_printf(bio_err, "Subject Name  :%s\n", p);
+        ok = -1;                /* This is now a 'bad' error. */
+        goto err;
+    }
+
     if (!default_op) {
         BIO_printf(bio_err, "Certificate Details:\n");
         /*
@@ -2110,10 +2123,9 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *
     row[DB_exp_date] = OPENSSL_malloc(tm->length + 1);
     row[DB_rev_date] = OPENSSL_malloc(1);
     row[DB_file] = OPENSSL_malloc(8);
-    row[DB_name] = X509_NAME_oneline(X509_get_subject_name(ret), NULL, 0);
     if ((row[DB_type] == NULL) || (row[DB_exp_date] == NULL) ||
         (row[DB_rev_date] == NULL) ||
-        (row[DB_file] == NULL) || (row[DB_name] == NULL)) {
+        (row[DB_file] == NULL)) {
         BIO_printf(bio_err, "Memory allocation failure\n");
         goto err;
     }
@@ -2143,18 +2155,16 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *
     irow = NULL;
     ok = 1;
  err:
-    if (irow != NULL) {
+    if (ok != 1) {
         for (i = 0; i < DB_NUMBER; i++)
             OPENSSL_free(row[i]);
-        OPENSSL_free(irow);
     }
+    OPENSSL_free(irow);
 
     if (CAname != NULL)
         X509_NAME_free(CAname);
     if (subject != NULL)
         X509_NAME_free(subject);
-    if ((dn_subject != NULL) && !email_dn)
-        X509_NAME_free(dn_subject);
     if (tmptm != NULL)
         ASN1_UTCTIME_free(tmptm);
     if (ok <= 0) {
@@ -2357,6 +2367,11 @@ static int do_revoke(X509 *x509, CA_DB *db, int type, 
     else
         row[DB_serial] = BN_bn2hex(bn);
     BN_free(bn);
+    if (row[DB_name] != NULL && row[DB_name][0] == '\0') {
+        /* Entries with empty Subjects actually use the serial number instead */
+        OPENSSL_free(row[DB_name]);
+        row[DB_name] = OPENSSL_strdup(row[DB_serial]);
+    }
     if ((row[DB_name] == NULL) || (row[DB_serial] == NULL)) {
         BIO_printf(bio_err, "Memory allocation failure\n");
         goto err;

Modified: head/crypto/openssl/apps/ciphers.c
==============================================================================
--- head/crypto/openssl/apps/ciphers.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/ciphers.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -217,7 +217,7 @@ int MAIN(int argc, char **argv)
                 BIO_printf(STDout, "%s - ", nm);
             }
 #endif
-            BIO_puts(STDout, SSL_CIPHER_description(c, buf, sizeof buf));
+            BIO_puts(STDout, SSL_CIPHER_description(c, buf, sizeof(buf)));
         }
     }
 

Modified: head/crypto/openssl/apps/cms.c
==============================================================================
--- head/crypto/openssl/apps/cms.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/cms.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -4,7 +4,7 @@
  * project.
  */
 /* ====================================================================
- * Copyright (c) 2008 The OpenSSL Project.  All rights reserved.
+ * Copyright (c) 2008-2018 The OpenSSL Project.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -977,12 +977,16 @@ int MAIN(int argc, char **argv)
 
             signer = load_cert(bio_err, signerfile, FORMAT_PEM, NULL,
                                e, "signer certificate");
-            if (!signer)
+            if (!signer) {
+                ret = 2;
                 goto end;
+            }
             key = load_key(bio_err, keyfile, keyform, 0, passin, e,
                            "signing key file");
-            if (!key)
+            if (!key) {
+                ret = 2;
                 goto end;
+            }
             for (kparam = key_first; kparam; kparam = kparam->next) {
                 if (kparam->idx == i) {
                     tflags |= CMS_KEY_PARAM;

Modified: head/crypto/openssl/apps/dgst.c
==============================================================================
--- head/crypto/openssl/apps/dgst.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/dgst.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -145,7 +145,7 @@ int MAIN(int argc, char **argv)
         goto end;
 
     /* first check the program name */
-    program_name(argv[0], pname, sizeof pname);
+    program_name(argv[0], pname, sizeof(pname));
 
     md = EVP_get_digestbyname(pname);
 

Modified: head/crypto/openssl/apps/dsaparam.c
==============================================================================
--- head/crypto/openssl/apps/dsaparam.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/dsaparam.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -382,6 +382,9 @@ int MAIN(int argc, char **argv)
         printf("\treturn(dsa);\n\t}\n");
     }
 
+    if (outformat == FORMAT_ASN1 && genkey)
+        noout = 1;
+
     if (!noout) {
         if (outformat == FORMAT_ASN1)
             i = i2d_DSAparams_bio(out, dsa);

Modified: head/crypto/openssl/apps/ecparam.c
==============================================================================
--- head/crypto/openssl/apps/ecparam.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/ecparam.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -3,7 +3,7 @@
  * Written by Nils Larsch for the OpenSSL project.
  */
 /* ====================================================================
- * Copyright (c) 1998-2005 The OpenSSL Project.  All rights reserved.
+ * Copyright (c) 1998-2018 The OpenSSL Project.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -546,6 +546,9 @@ int MAIN(int argc, char **argv)
         BIO_printf(out, "\treturn(group);\n\t}\n");
     }
 
+    if (outformat == FORMAT_ASN1 && genkey)
+        noout = 1;
+
     if (!noout) {
         if (outformat == FORMAT_ASN1)
             i = i2d_ECPKParameters_bio(out, group);
@@ -581,6 +584,9 @@ int MAIN(int argc, char **argv)
 
         if (EC_KEY_set_group(eckey, group) == 0)
             goto end;
+
+        if (new_form)
+            EC_KEY_set_conv_form(eckey, form);
 
         if (!EC_KEY_generate_key(eckey)) {
             EC_KEY_free(eckey);

Modified: head/crypto/openssl/apps/enc.c
==============================================================================
--- head/crypto/openssl/apps/enc.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/enc.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -114,7 +114,7 @@ int MAIN(int, char **);
 int MAIN(int argc, char **argv)
 {
     static const char magic[] = "Salted__";
-    char mbuf[sizeof magic - 1];
+    char mbuf[sizeof(magic) - 1];
     char *strbuf = NULL;
     unsigned char *buff = NULL, *bufsize = NULL;
     int bsize = BSIZE, verbose = 0;
@@ -154,7 +154,7 @@ int MAIN(int argc, char **argv)
         goto end;
 
     /* first check the program name */
-    program_name(argv[0], pname, sizeof pname);
+    program_name(argv[0], pname, sizeof(pname));
     if (strcmp(pname, "base64") == 0)
         base64 = 1;
 #ifdef ZLIB
@@ -247,7 +247,7 @@ int MAIN(int argc, char **argv)
                 goto bad;
             }
             buf[0] = '\0';
-            if (!fgets(buf, sizeof buf, infile)) {
+            if (!fgets(buf, sizeof(buf), infile)) {
                 BIO_printf(bio_err, "unable to read key from '%s'\n", file);
                 goto bad;
             }
@@ -432,7 +432,7 @@ int MAIN(int argc, char **argv)
         for (;;) {
             char buf[200];
 
-            BIO_snprintf(buf, sizeof buf, "enter %s %s password:",
+            BIO_snprintf(buf, sizeof(buf), "enter %s %s password:",
                          OBJ_nid2ln(EVP_CIPHER_nid(cipher)),
                          (enc) ? "encryption" : "decryption");
             strbuf[0] = '\0';
@@ -517,31 +517,31 @@ int MAIN(int argc, char **argv)
             else {
                 if (enc) {
                     if (hsalt) {
-                        if (!set_hex(hsalt, salt, sizeof salt)) {
+                        if (!set_hex(hsalt, salt, sizeof(salt))) {
                             BIO_printf(bio_err, "invalid hex salt value\n");
                             goto end;
                         }
-                    } else if (RAND_bytes(salt, sizeof salt) <= 0)
+                    } else if (RAND_bytes(salt, sizeof(salt)) <= 0)
                         goto end;
                     /*
                      * If -P option then don't bother writing
                      */
                     if ((printkey != 2)
                         && (BIO_write(wbio, magic,
-                                      sizeof magic - 1) != sizeof magic - 1
+                                      sizeof(magic) - 1) != sizeof(magic) - 1
                             || BIO_write(wbio,
                                          (char *)salt,
-                                         sizeof salt) != sizeof salt)) {
+                                         sizeof(salt)) != sizeof(salt))) {
                         BIO_printf(bio_err, "error writing output file\n");
                         goto end;
                     }
-                } else if (BIO_read(rbio, mbuf, sizeof mbuf) != sizeof mbuf
+                } else if (BIO_read(rbio, mbuf, sizeof(mbuf)) != sizeof(mbuf)
                            || BIO_read(rbio,
                                        (unsigned char *)salt,
-                                       sizeof salt) != sizeof salt) {
+                                       sizeof(salt)) != sizeof(salt)) {
                     BIO_printf(bio_err, "error reading input file\n");
                     goto end;
-                } else if (memcmp(mbuf, magic, sizeof magic - 1)) {
+                } else if (memcmp(mbuf, magic, sizeof(magic) - 1)) {
                     BIO_printf(bio_err, "bad magic number\n");
                     goto end;
                 }
@@ -564,7 +564,7 @@ int MAIN(int argc, char **argv)
             int siz = EVP_CIPHER_iv_length(cipher);
             if (siz == 0) {
                 BIO_printf(bio_err, "warning: iv not use by this cipher\n");
-            } else if (!set_hex(hiv, iv, sizeof iv)) {
+            } else if (!set_hex(hiv, iv, sizeof(iv))) {
                 BIO_printf(bio_err, "invalid hex iv value\n");
                 goto end;
             }

Modified: head/crypto/openssl/apps/errstr.c
==============================================================================
--- head/crypto/openssl/apps/errstr.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/errstr.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -108,7 +108,7 @@ int MAIN(int argc, char **argv)
 
     for (i = 1; i < argc; i++) {
         if (sscanf(argv[i], "%lx", &l)) {
-            ERR_error_string_n(l, buf, sizeof buf);
+            ERR_error_string_n(l, buf, sizeof(buf));
             printf("%s\n", buf);
         } else {
             printf("%s: bad error code\n", argv[i]);

Modified: head/crypto/openssl/apps/ocsp.c
==============================================================================
--- head/crypto/openssl/apps/ocsp.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/ocsp.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -1195,7 +1195,7 @@ static int do_responder(OCSP_REQUEST **preq, BIO **pcb
     *pcbio = cbio;
 
     for (;;) {
-        len = BIO_gets(cbio, inbuf, sizeof inbuf);
+        len = BIO_gets(cbio, inbuf, sizeof(inbuf));
         if (len <= 0)
             return 1;
         /* Look for "POST" signalling start of query */

Modified: head/crypto/openssl/apps/openssl.c
==============================================================================
--- head/crypto/openssl/apps/openssl.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/openssl.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -351,7 +351,7 @@ int main(int Argc, char *ARGV[])
     prog = prog_init();
 
     /* first check the program name */
-    program_name(Argv[0], pname, sizeof pname);
+    program_name(Argv[0], pname, sizeof(pname));
 
     f.name = pname;
     fp = lh_FUNCTION_retrieve(prog, &f);
@@ -379,7 +379,7 @@ int main(int Argc, char *ARGV[])
     for (;;) {
         ret = 0;
         p = buf;
-        n = sizeof buf;
+        n = sizeof(buf);
         i = 0;
         for (;;) {
             p[0] = '\0';
@@ -685,7 +685,7 @@ static LHASH_OF(FUNCTION) *prog_init(void)
 
     /* Purely so it looks nice when the user hits ? */
     for (i = 0, f = functions; f->name != NULL; ++f, ++i) ;
-    qsort(functions, i, sizeof *functions, SortFnByName);
+    qsort(functions, i, sizeof(*functions), SortFnByName);
 
     if ((ret = lh_FUNCTION_new()) == NULL)
         return (NULL);

Modified: head/crypto/openssl/apps/passwd.c
==============================================================================
--- head/crypto/openssl/apps/passwd.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/passwd.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -252,7 +252,7 @@ int MAIN(int argc, char **argv)
                     /* ignore rest of line */
                     char trash[BUFSIZ];
                     do
-                        r = BIO_gets(in, trash, sizeof trash);
+                        r = BIO_gets(in, trash, sizeof(trash));
                     while ((r > 0) && (!strchr(trash, '\n')));
                 }
 
@@ -329,8 +329,8 @@ static char *md5crypt(const char *passwd, const char *
     EVP_DigestUpdate(&md2, passwd, passwd_len);
     EVP_DigestFinal_ex(&md2, buf, NULL);
 
-    for (i = passwd_len; i > sizeof buf; i -= sizeof buf)
-        EVP_DigestUpdate(&md, buf, sizeof buf);
+    for (i = passwd_len; i > sizeof(buf); i -= sizeof(buf))
+        EVP_DigestUpdate(&md, buf, sizeof(buf));
     EVP_DigestUpdate(&md, buf, i);
 
     n = passwd_len;
@@ -343,13 +343,13 @@ static char *md5crypt(const char *passwd, const char *
     for (i = 0; i < 1000; i++) {
         EVP_DigestInit_ex(&md2, EVP_md5(), NULL);
         EVP_DigestUpdate(&md2, (i & 1) ? (unsigned const char *)passwd : buf,
-                         (i & 1) ? passwd_len : sizeof buf);
+                         (i & 1) ? passwd_len : sizeof(buf));
         if (i % 3)
             EVP_DigestUpdate(&md2, salt_out, salt_len);
         if (i % 7)
             EVP_DigestUpdate(&md2, passwd, passwd_len);
         EVP_DigestUpdate(&md2, (i & 1) ? buf : (unsigned const char *)passwd,
-                         (i & 1) ? sizeof buf : passwd_len);
+                         (i & 1) ? sizeof(buf) : passwd_len);
         EVP_DigestFinal_ex(&md2, buf, NULL);
     }
     EVP_MD_CTX_cleanup(&md2);
@@ -357,7 +357,7 @@ static char *md5crypt(const char *passwd, const char *
     {
         /* transform buf into output string */
 
-        unsigned char buf_perm[sizeof buf];
+        unsigned char buf_perm[sizeof(buf)];
         int dest, source;
         char *output;
 
@@ -369,7 +369,7 @@ static char *md5crypt(const char *passwd, const char *
         buf_perm[15] = buf[11];
 #  ifndef PEDANTIC              /* Unfortunately, this generates a "no
                                  * effect" warning */
-        assert(16 == sizeof buf_perm);
+        assert(16 == sizeof(buf_perm));
 #  endif
 
         output = salt_out + salt_len;

Modified: head/crypto/openssl/apps/pkcs12.c
==============================================================================
--- head/crypto/openssl/apps/pkcs12.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/pkcs12.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -481,7 +481,7 @@ int MAIN(int argc, char **argv)
         CRYPTO_push_info("read MAC password");
 # endif
         if (EVP_read_pw_string
-            (macpass, sizeof macpass, "Enter MAC Password:", export_cert)) {
+            (macpass, sizeof(macpass), "Enter MAC Password:", export_cert)) {
             BIO_printf(bio_err, "Can't read Password\n");
             goto end;
         }
@@ -629,13 +629,13 @@ int MAIN(int argc, char **argv)
 # endif
 
         if (!noprompt &&
-            EVP_read_pw_string(pass, sizeof pass, "Enter Export Password:",
+            EVP_read_pw_string(pass, sizeof(pass), "Enter Export Password:",
                                1)) {
             BIO_printf(bio_err, "Can't read Password\n");
             goto export_end;
         }
         if (!twopass)
-            BUF_strlcpy(macpass, pass, sizeof macpass);
+            BUF_strlcpy(macpass, pass, sizeof(macpass));
 
 # ifdef CRYPTO_MDEBUG
         CRYPTO_pop_info();
@@ -698,7 +698,7 @@ int MAIN(int argc, char **argv)
     CRYPTO_push_info("read import password");
 # endif
     if (!noprompt
-        && EVP_read_pw_string(pass, sizeof pass, "Enter Import Password:",
+        && EVP_read_pw_string(pass, sizeof(pass), "Enter Import Password:",
                               0)) {
         BIO_printf(bio_err, "Can't read Password\n");
         goto end;
@@ -708,7 +708,7 @@ int MAIN(int argc, char **argv)
 # endif
 
     if (!twopass)
-        BUF_strlcpy(macpass, pass, sizeof macpass);
+        BUF_strlcpy(macpass, pass, sizeof(macpass));
 
     if ((options & INFO) && p12->mac)
         BIO_printf(bio_err, "MAC Iteration %ld\n",

Modified: head/crypto/openssl/apps/pkcs8.c
==============================================================================
--- head/crypto/openssl/apps/pkcs8.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/pkcs8.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -277,7 +277,7 @@ int MAIN(int argc, char **argv)
             else {
                 p8pass = pass;
                 if (EVP_read_pw_string
-                    (pass, sizeof pass, "Enter Encryption Password:", 1))
+                    (pass, sizeof(pass), "Enter Encryption Password:", 1))
                     goto end;
             }
             app_RAND_load_file(NULL, bio_err, 0);
@@ -331,7 +331,7 @@ int MAIN(int argc, char **argv)
             p8pass = passin;
         else {
             p8pass = pass;
-            EVP_read_pw_string(pass, sizeof pass, "Enter Password:", 0);
+            EVP_read_pw_string(pass, sizeof(pass), "Enter Password:", 0);
         }
         p8inf = PKCS8_decrypt(p8, p8pass, strlen(p8pass));
     }

Modified: head/crypto/openssl/apps/rand.c
==============================================================================
--- head/crypto/openssl/apps/rand.c	Tue Mar 27 17:04:01 2018	(r331626)
+++ head/crypto/openssl/apps/rand.c	Tue Mar 27 17:17:58 2018	(r331627)
@@ -198,7 +198,7 @@ int MAIN(int argc, char **argv)
 
         chunk = num;
         if (chunk > (int)sizeof(buf))

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@freebsd.org  Tue Mar 27 17:31:46 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89F27F6E131;
 Tue, 27 Mar 2018 17:31:46 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 3130A73DF7;
 Tue, 27 Mar 2018 17:31:46 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215])
 by mail.baldwin.cx (Postfix) with ESMTPSA id 7FAE210A8C2;
 Tue, 27 Mar 2018 13:31:45 -0400 (EDT)
From: John Baldwin 
To: Alexey Dokuchaev 
Cc: Warner Losh , Kyle Evans ,
 svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers 
Subject: Re: svn commit: r331209 - head
Date: Tue, 27 Mar 2018 09:48:43 -0700
Message-ID: <11592636.Xep9SDNT9W@ralph.baldwin.cx>
User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; )
In-Reply-To: <20180327051912.GA5729@FreeBSD.org>
References: <201803191527.w2JFRr7B058668@repo.freebsd.org>
 <3226647.aiAOVF4eaK@ralph.baldwin.cx> <20180327051912.GA5729@FreeBSD.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3
 (mail.baldwin.cx); Tue, 27 Mar 2018 13:31:45 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx
X-Virus-Status: Clean
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 17:31:46 -0000

On Tuesday, March 27, 2018 05:19:12 AM Alexey Dokuchaev wrote:
> On Thu, Mar 22, 2018 at 08:52:47AM -0700, John Baldwin wrote:
> > On Thursday, March 22, 2018 04:39:38 AM Alexey Dokuchaev wrote:
> > > > ...
> > > Right, but John had mentioned extra reboot *between* installkernel and
> > > installworld, which I've never heard of before.
> > 
> > From the end up of src/UPDATING:
> > 
> >         
> >         make buildworld
> >         make kernel KERNCONF=YOUR_KERNEL_HERE
> >         
> 
> If by "reboot" in your original message you meant "drop to single user"
> then there's no confusion.  It's just that in my understanding "reboot"
> means, well, reboot.

No, I meant reboot and it clearly says here "reboot".  Note that
'make kernel' does 'make buildkernel' and 'make installkernel', so
the reboot quoted above is after installkernel but before installworld.
Perhaps 'make kernel' should be expanded into separate lines for
'buildkernel' and 'installkernel' if that is confusing.

-- 
John Baldwin

From owner-svn-src-head@freebsd.org  Tue Mar 27 17:34:29 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FF2BF6E467;
 Tue, 27 Mar 2018 17:34:29 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 4C78174169;
 Tue, 27 Mar 2018 17:34:29 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 476871F3CF;
 Tue, 27 Mar 2018 17:34:29 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RHYTrb064698;
 Tue, 27 Mar 2018 17:34:29 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RHYTTU064697;
 Tue, 27 Mar 2018 17:34:29 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201803271734.w2RHYTTU064697@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: Conrad Meyer 
Date: Tue, 27 Mar 2018 17:34:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331628 - head/tools/tools/crypto
X-SVN-Group: head
X-SVN-Commit-Author: cem
X-SVN-Commit-Paths: head/tools/tools/crypto
X-SVN-Commit-Revision: 331628
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 17:34:29 -0000

Author: cem
Date: Tue Mar 27 17:34:28 2018
New Revision: 331628
URL: https://svnweb.freebsd.org/changeset/base/331628

Log:
  cryptotest: Add blake2 hashes to tool
  
  Sponsored by:	Dell EMC Isilon

Modified:
  head/tools/tools/crypto/cryptotest.c

Modified: head/tools/tools/crypto/cryptotest.c
==============================================================================
--- head/tools/tools/crypto/cryptotest.c	Tue Mar 27 17:17:58 2018	(r331627)
+++ head/tools/tools/crypto/cryptotest.c	Tue Mar 27 17:34:28 2018	(r331628)
@@ -56,6 +56,8 @@
  *	aes	rijndael/aes 128-bit cbc
  *	aes192	rijndael/aes 192-bit cbc
  *	aes256	rijndael/aes 256-bit cbc
+ *	blake2b	Blake2b
+ *	blake2s	Blake2s
  *	md5	md5 hmac
  *	sha1	sha1 hmac
  *	sha256	256-bit sha2 hmac
@@ -132,6 +134,8 @@ struct alg {
 	{ "aes",	0,	16,	16,	16,	CRYPTO_AES_CBC},
 	{ "aes192",	0,	16,	24,	24,	CRYPTO_AES_CBC},
 	{ "aes256",	0,	16,	32,	32,	CRYPTO_AES_CBC},
+	{ "blake2b",	1,	128,	64,	64,	CRYPTO_BLAKE2B },
+	{ "blake2s",	1,	64,	32,	32,	CRYPTO_BLAKE2S },
 	{ "md5",	1,	8,	16,	16,	CRYPTO_MD5_HMAC },
 	{ "sha1",	1,	8,	20,	20,	CRYPTO_SHA1_HMAC },
 	{ "sha256",	1,	8,	32,	32,	CRYPTO_SHA2_256_HMAC },
@@ -147,6 +151,7 @@ usage(const char* cmd)
 	printf("where algorithm is one of:\n");
 	printf("    null des 3des (default) blowfish cast skipjack rij\n");
 	printf("    aes aes192 aes256 md5 sha1 sha256 sha384 sha512\n");
+	printf("    blake2b blake2s\n");
 	printf(" or an encryption algorithm concatented with authentication\n");
 	printf(" algorithm with '+' in the middle, e.g., aes+sha1.\n");
 	printf("count is the number of encrypt/decrypt ops to do\n");

From owner-svn-src-head@freebsd.org  Tue Mar 27 17:37:08 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5A2FF6E7CA;
 Tue, 27 Mar 2018 17:37:08 +0000 (UTC)
 (envelope-from eugen@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 8B46B744C0;
 Tue, 27 Mar 2018 17:37:08 +0000 (UTC)
 (envelope-from eugen@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 864ED1F3DE;
 Tue, 27 Mar 2018 17:37:08 +0000 (UTC)
 (envelope-from eugen@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RHb8b3064903;
 Tue, 27 Mar 2018 17:37:08 GMT (envelope-from eugen@FreeBSD.org)
Received: (from eugen@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RHb8gI064902;
 Tue, 27 Mar 2018 17:37:08 GMT (envelope-from eugen@FreeBSD.org)
Message-Id: <201803271737.w2RHb8gI064902@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: eugen set sender to
 eugen@FreeBSD.org using -f
From: Eugene Grosbein 
Date: Tue, 27 Mar 2018 17:37:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331630 - head/stand/i386/zfsboot
X-SVN-Group: head
X-SVN-Commit-Author: eugen
X-SVN-Commit-Paths: head/stand/i386/zfsboot
X-SVN-Commit-Revision: 331630
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 17:37:09 -0000

Author: eugen
Date: Tue Mar 27 17:37:08 2018
New Revision: 331630
URL: https://svnweb.freebsd.org/changeset/base/331630

Log:
  Fix instructions in the zfsboot manual page.
  
  zfsloader(8) fails to probe a slice containing ZFS pool if its second sector
  contains traces of BSD label (DISKMAGIC == 0x82564557).
  Fix manual page to show working example erasing such traces.
  
  PR:		226714
  Approved by:	avg (mentor)
  MFC after:	3 days

Modified:
  head/stand/i386/zfsboot/zfsboot.8

Modified: head/stand/i386/zfsboot/zfsboot.8
==============================================================================
--- head/stand/i386/zfsboot/zfsboot.8	Tue Mar 27 17:35:15 2018	(r331629)
+++ head/stand/i386/zfsboot/zfsboot.8	Tue Mar 27 17:37:08 2018	(r331630)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 15, 2014
+.Dd March 27, 2018
 .Dt ZFSBOOT 8
 .Os
 .Sh NAME
@@ -99,9 +99,9 @@ can also be installed in an MBR slice:
 .Bd -literal -offset indent
 gpart create -s mbr ada0
 gpart add -t freebsd ada0
-gpart create -s BSD ada0s1
 gpart bootcode -b /boot/boot0 ada0
 gpart set -a active -i 1 ada0
+dd if=/dev/zero of=/dev/ada0s1 count=2
 dd if=/boot/zfsboot of=/dev/ada0s1 count=1
 dd if=/boot/zfsboot of=/dev/ada0s1 iseek=1 oseek=1024
 .Ed

From owner-svn-src-head@freebsd.org  Tue Mar 27 17:40:32 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E5AEF6ECEA
 for ;
 Tue, 27 Mar 2018 17:40:32 +0000 (UTC) (envelope-from ian@freebsd.org)
Received: from pmta2.delivery6.ore.mailhop.org
 (pmta2.delivery6.ore.mailhop.org [54.200.129.228])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 150CB749E3
 for ; Tue, 27 Mar 2018 17:40:31 +0000 (UTC)
 (envelope-from ian@freebsd.org)
X-MHO-User: c46a4504-31e5-11e8-b951-f99fef315fd9
X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information
X-Originating-IP: 67.177.211.60
X-Mail-Handler: DuoCircle Outbound SMTP
Received: from ilsoft.org (unknown [67.177.211.60])
 by outbound2.ore.mailhop.org (Halon) with ESMTPSA
 id c46a4504-31e5-11e8-b951-f99fef315fd9;
 Tue, 27 Mar 2018 17:39:15 +0000 (UTC)
Received: from rev (rev [172.22.42.240])
 by ilsoft.org (8.15.2/8.15.2) with ESMTP id w2RHeMJd061225;
 Tue, 27 Mar 2018 11:40:22 -0600 (MDT) (envelope-from ian@freebsd.org)
Message-ID: <1522172422.49673.38.camel@freebsd.org>
Subject: Re: svn commit: r331209 - head
From: Ian Lepore 
To: John Baldwin , Alexey Dokuchaev 
Cc: Warner Losh , Kyle Evans ,
 svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers
 
Date: Tue, 27 Mar 2018 11:40:22 -0600
In-Reply-To: <11592636.Xep9SDNT9W@ralph.baldwin.cx>
References: <201803191527.w2JFRr7B058668@repo.freebsd.org>
 <3226647.aiAOVF4eaK@ralph.baldwin.cx> <20180327051912.GA5729@FreeBSD.org>
 <11592636.Xep9SDNT9W@ralph.baldwin.cx>
Content-Type: text/plain; charset="ISO-8859-1"
X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port 
Mime-Version: 1.0
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 17:40:32 -0000

On Tue, 2018-03-27 at 09:48 -0700, John Baldwin wrote:
> On Tuesday, March 27, 2018 05:19:12 AM Alexey Dokuchaev wrote:
> > 
> > On Thu, Mar 22, 2018 at 08:52:47AM -0700, John Baldwin wrote:
> > > 
> > > On Thursday, March 22, 2018 04:39:38 AM Alexey Dokuchaev wrote:
> > > > 
> > > > > 
> > > > > ...
> > > > Right, but John had mentioned extra reboot *between* installkernel and
> > > > installworld, which I've never heard of before.
> > > From the end up of src/UPDATING:
> > > 
> > > 
> > > make buildworld
> > > make kernel KERNCONF=YOUR_KERNEL_HERE
> > > 
> > If by "reboot" in your original message you meant "drop to single user"
> > then there's no confusion.It's just that in my understanding "reboot"
> > means, well, reboot.
> No, I meant reboot and it clearly says here "reboot".Note that
> 'make kernel' does 'make buildkernel' and 'make installkernel', so
> the reboot quoted above is after installkernel but before installworld.
> Perhaps 'make kernel' should be expanded into separate lines for
> 'buildkernel' and 'installkernel' if that is confusing.
> 

I've been working with freebsd since 1996, and had no idea there was a
kernel target that does build+install. I think even showing it as

 make buildkernel installkernel KERNCONF=YOUR_KERNEL_HERE

would be more clear.

-- Ian


From owner-svn-src-head@freebsd.org  Tue Mar 27 17:43:55 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5DACF6F2D7;
 Tue, 27 Mar 2018 17:43:55 +0000 (UTC)
 (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 269017510C;
 Tue, 27 Mar 2018 17:43:54 +0000 (UTC)
 (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1])
 by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w2RHhils053198;
 Tue, 27 Mar 2018 10:43:44 -0700 (PDT)
 (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
Received: (from freebsd@localhost)
 by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w2RHhi5D053197;
 Tue, 27 Mar 2018 10:43:44 -0700 (PDT) (envelope-from freebsd)
From: "Rodney W. Grimes" 
Message-Id: <201803271743.w2RHhi5D053197@pdx.rh.CN85.dnsmgr.net>
Subject: Re: svn commit: r331209 - head
In-Reply-To: <11592636.Xep9SDNT9W@ralph.baldwin.cx>
To: John Baldwin 
Date: Tue, 27 Mar 2018 10:43:44 -0700 (PDT)
CC: Alexey Dokuchaev , Warner Losh ,
 Kyle Evans , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers 
Reply-To: rgrimes@freebsd.org
X-Mailer: ELM [version 2.4ME+ PL121h (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 17:43:55 -0000

> On Tuesday, March 27, 2018 05:19:12 AM Alexey Dokuchaev wrote:
> > On Thu, Mar 22, 2018 at 08:52:47AM -0700, John Baldwin wrote:
> > > On Thursday, March 22, 2018 04:39:38 AM Alexey Dokuchaev wrote:
> > > > > ...
> > > > Right, but John had mentioned extra reboot *between* installkernel and
> > > > installworld, which I've never heard of before.
> > > 
> > > From the end up of src/UPDATING:
> > > 
> > >         
> > >         make buildworld
> > >         make kernel KERNCONF=YOUR_KERNEL_HERE
> > >         

"in" may not be the proper way to express this,
better wording, imho, would be "reboot to single user mode",
Or even more complete to make the reason for the reboot to
single user mode explictly clear:
	 *1

*1 This is to facilitate the next step, the single user mode
is required so that binaries are not in use while the installworld
process is done.

> > 
> > If by "reboot" in your original message you meant "drop to single user"
> > then there's no confusion.  It's just that in my understanding "reboot"
> > means, well, reboot.
> 
> No, I meant reboot and it clearly says here "reboot".  Note that
> 'make kernel' does 'make buildkernel' and 'make installkernel', so
> the reboot quoted above is after installkernel but before installworld.
> Perhaps 'make kernel' should be expanded into separate lines for
> 'buildkernel' and 'installkernel' if that is confusing.
> 
> -- 
> John Baldwin
> 
> 

-- 
Rod Grimes                                                 rgrimes@freebsd.org

From owner-svn-src-head@freebsd.org  Tue Mar 27 17:48:24 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A115AF6F9C7;
 Tue, 27 Mar 2018 17:48:24 +0000 (UTC)
 (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 04415756A7;
 Tue, 27 Mar 2018 17:48:23 +0000 (UTC)
 (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1])
 by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w2RHmMWg053239;
 Tue, 27 Mar 2018 10:48:22 -0700 (PDT)
 (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
Received: (from freebsd@localhost)
 by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w2RHmMW1053238;
 Tue, 27 Mar 2018 10:48:22 -0700 (PDT) (envelope-from freebsd)
From: "Rodney W. Grimes" 
Message-Id: <201803271748.w2RHmMW1053238@pdx.rh.CN85.dnsmgr.net>
Subject: Re: svn commit: r331209 - head
In-Reply-To: <1522172422.49673.38.camel@freebsd.org>
To: Ian Lepore 
Date: Tue, 27 Mar 2018 10:48:22 -0700 (PDT)
CC: John Baldwin , Alexey Dokuchaev ,
 Warner Losh , Kyle Evans ,
 svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers 
Reply-To: rgrimes@freebsd.org
X-Mailer: ELM [version 2.4ME+ PL121h (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 17:48:24 -0000

[ Charset ISO-8859-1 unsupported, converting... ]
> On Tue, 2018-03-27 at 09:48 -0700, John Baldwin wrote:
> > On Tuesday, March 27, 2018 05:19:12 AM Alexey Dokuchaev wrote:
> > > 
> > > On Thu, Mar 22, 2018 at 08:52:47AM -0700, John Baldwin wrote:
> > > > 
> > > > On Thursday, March 22, 2018 04:39:38 AM Alexey Dokuchaev wrote:
> > > > > 
> > > > > > 
> > > > > > ...
> > > > > Right, but John had mentioned extra reboot *between* installkernel and
> > > > > installworld, which I've never heard of before.
> > > > From the end up of src/UPDATING:
> > > > 
> > > > ????????
> > > > ????????make buildworld
> > > > ????????make kernel KERNCONF=YOUR_KERNEL_HERE
> > > > ????????
> > > If by "reboot" in your original message you meant "drop to single user"
> > > then there's no confusion.??It's just that in my understanding "reboot"
> > > means, well, reboot.
> > No, I meant reboot and it clearly says here "reboot".??Note that
> > 'make kernel' does 'make buildkernel' and 'make installkernel', so
> > the reboot quoted above is after installkernel but before installworld.
> > Perhaps 'make kernel' should be expanded into separate lines for
> > 'buildkernel' and 'installkernel' if that is confusing.
> > 
> 
> I've been working with freebsd since 1996, and had no idea there was a
> kernel target that does build+install. ?I think even showing it as

I was vegually aware of it, but since I do things between
buildkernel and installkernel I dont use it, more so cause
I build kernels on a central box and push them out to
systems.

> ? make buildkernel installkernel KERNCONF=YOUR_KERNEL_HERE

make {kernel|buildkernel installkernel} KERNCONF=YOUR_KERNEL_HERE

OR

    make kernel KERNCONF=YOUR_KERNEL_HERE
    or
    make buildkernel installkernel KERNCONF=YOUR_KERNEL_HERE

> would be more clear.

-- 
Rod Grimes                                                 rgrimes@freebsd.org

From owner-svn-src-head@freebsd.org  Tue Mar 27 17:58:01 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFAC0F70848;
 Tue, 27 Mar 2018 17:58:00 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 875FD763FC;
 Tue, 27 Mar 2018 17:58:00 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DD841F739;
 Tue, 27 Mar 2018 17:58:00 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RHw0wG075517;
 Tue, 27 Mar 2018 17:58:00 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RHw0qX075515;
 Tue, 27 Mar 2018 17:58:00 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201803271758.w2RHw0qX075515@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: Conrad Meyer 
Date: Tue, 27 Mar 2018 17:58:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331639 - head/sys/opencrypto
X-SVN-Group: head
X-SVN-Commit-Author: cem
X-SVN-Commit-Paths: head/sys/opencrypto
X-SVN-Commit-Revision: 331639
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 17:58:01 -0000

Author: cem
Date: Tue Mar 27 17:58:00 2018
New Revision: 331639
URL: https://svnweb.freebsd.org/changeset/base/331639

Log:
  opencrypto: Add mechanism to pass multiple crypto blocks to some ciphers
  
  xforms that support processing of multiple blocks at a time (to support more
  efficient modes, for example) can define the encrypt_ and decrypt_multi
  interfaces.  If these interfaces are not present, the generic cryptosoft
  code falls back on the block-at-a-time encrypt/decrypt interfaces.
  
  Stream ciphers may support arbitrarily sized inputs (equivalent to an input
  block size of 1 byte) but may be more efficient if a larger block is passed.
  
  Sponsored by:	Dell EMC Isilon

Modified:
  head/sys/opencrypto/cryptosoft.c
  head/sys/opencrypto/xform_enc.h

Modified: head/sys/opencrypto/cryptosoft.c
==============================================================================
--- head/sys/opencrypto/cryptosoft.c	Tue Mar 27 17:54:46 2018	(r331638)
+++ head/sys/opencrypto/cryptosoft.c	Tue Mar 27 17:58:00 2018	(r331639)
@@ -248,21 +248,29 @@ swcr_encdec(struct cryptodesc *crd, struct swcr_data *
 				break;
 		}
 
-		/*
-		 * Warning: idat may point to garbage here, but
-		 * we only use it in the while() loop, only if
-		 * there are indeed enough data.
-		 */
-		idat = (char *)uio->uio_iov[ind].iov_base + k;
-
 		while (uio->uio_iov[ind].iov_len >= k + blks && i > 0) {
+			size_t nb, rem;
+
+			nb = blks;
+			rem = uio->uio_iov[ind].iov_len - k;
+			idat = (char *)uio->uio_iov[ind].iov_base + k;
+
 			if (exf->reinit) {
-				if (crd->crd_flags & CRD_F_ENCRYPT) {
+				if ((crd->crd_flags & CRD_F_ENCRYPT) != 0 &&
+				    exf->encrypt_multi == NULL)
 					exf->encrypt(sw->sw_kschedule,
 					    idat);
-				} else {
+				else if ((crd->crd_flags & CRD_F_ENCRYPT) != 0) {
+					nb = rounddown(rem, blks);
+					exf->encrypt_multi(sw->sw_kschedule,
+					    idat, nb);
+				} else if (exf->decrypt_multi == NULL)
 					exf->decrypt(sw->sw_kschedule,
 					    idat);
+				else {
+					nb = rounddown(rem, blks);
+					exf->decrypt_multi(sw->sw_kschedule,
+					    idat, nb);
 				}
 			} else if (crd->crd_flags & CRD_F_ENCRYPT) {
 				/* XOR with previous block/IV */
@@ -288,10 +296,10 @@ swcr_encdec(struct cryptodesc *crd, struct swcr_data *
 				ivp = nivp;
 			}
 
-			idat += blks;
-			count += blks;
-			k += blks;
-			i -= blks;
+			idat += nb;
+			count += nb;
+			k += nb;
+			i -= nb;
 		}
 
 		/*
@@ -566,14 +574,26 @@ swcr_authenc(struct cryptop *crp)
 		exf->reinit(swe->sw_kschedule, iv);
 
 	/* Do encryption/decryption with MAC */
-	for (i = 0; i < crde->crd_len; i += blksz) {
-		len = MIN(crde->crd_len - i, blksz);
+	for (i = 0; i < crde->crd_len; i += len) {
+		if (exf->encrypt_multi != NULL) {
+			len = rounddown(crde->crd_len - i, blksz);
+			if (len == 0)
+				len = blksz;
+			else
+				len = MIN(len, sizeof(blkbuf));
+		} else
+			len = blksz;
+		len = MIN(crde->crd_len - i, len);
 		if (len < blksz)
 			bzero(blk, blksz);
 		crypto_copydata(crp->crp_flags, buf, crde->crd_skip + i, len,
 		    blk);
 		if (crde->crd_flags & CRD_F_ENCRYPT) {
-			exf->encrypt(swe->sw_kschedule, blk);
+			if (exf->encrypt_multi != NULL)
+				exf->encrypt_multi(swe->sw_kschedule, blk,
+				    len);
+			else
+				exf->encrypt(swe->sw_kschedule, blk);
 			axf->Update(&ctx, blk, len);
 			crypto_copyback(crp->crp_flags, buf,
 			    crde->crd_skip + i, len, blk);

Modified: head/sys/opencrypto/xform_enc.h
==============================================================================
--- head/sys/opencrypto/xform_enc.h	Tue Mar 27 17:54:46 2018	(r331638)
+++ head/sys/opencrypto/xform_enc.h	Tue Mar 27 17:58:00 2018	(r331639)
@@ -59,6 +59,14 @@ struct enc_xform {
 	int (*setkey) (u_int8_t **, u_int8_t *, int len);
 	void (*zerokey) (u_int8_t **);
 	void (*reinit) (caddr_t, u_int8_t *);
+	/*
+	 * Encrypt/decrypt 1+ blocks of input -- total size is 'len' bytes.
+	 * Len is guaranteed to be a multiple of the defined 'blocksize'.
+	 * Optional interface -- most useful for stream ciphers with a small
+	 * blocksize (1).
+	 */
+	void (*encrypt_multi) (void *, uint8_t *, size_t len);
+	void (*decrypt_multi) (void *, uint8_t *, size_t len);
 };
 
 

From owner-svn-src-head@freebsd.org  Tue Mar 27 18:05:36 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A0EA8F711E7;
 Tue, 27 Mar 2018 18:05:36 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 45E1276B90;
 Tue, 27 Mar 2018 18:05:36 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215])
 by mail.baldwin.cx (Postfix) with ESMTPSA id 648AF10AF2A;
 Tue, 27 Mar 2018 14:05:35 -0400 (EDT)
From: John Baldwin 
To: Ian Lepore 
Cc: Alexey Dokuchaev , Warner Losh ,
 Kyle Evans , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers 
Subject: Re: svn commit: r331209 - head
Date: Tue, 27 Mar 2018 11:03:42 -0700
Message-ID: <2339754.phgDcyqDh9@ralph.baldwin.cx>
User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; )
In-Reply-To: <1522172422.49673.38.camel@freebsd.org>
References: <201803191527.w2JFRr7B058668@repo.freebsd.org>
 <11592636.Xep9SDNT9W@ralph.baldwin.cx>
 <1522172422.49673.38.camel@freebsd.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3
 (mail.baldwin.cx); Tue, 27 Mar 2018 14:05:35 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx
X-Virus-Status: Clean
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 18:05:36 -0000

On Tuesday, March 27, 2018 11:40:22 AM Ian Lepore wrote:
> On Tue, 2018-03-27 at 09:48 -0700, John Baldwin wrote:
> > On Tuesday, March 27, 2018 05:19:12 AM Alexey Dokuchaev wrote:
> > > 
> > > On Thu, Mar 22, 2018 at 08:52:47AM -0700, John Baldwin wrote:
> > > > 
> > > > On Thursday, March 22, 2018 04:39:38 AM Alexey Dokuchaev wrote:
> > > > > 
> > > > > > 
> > > > > > ...
> > > > > Right, but John had mentioned extra reboot *between* installkernel and
> > > > > installworld, which I've never heard of before.
> > > > From the end up of src/UPDATING:
> > > > 
> > > >         
> > > >         make buildworld
> > > >         make kernel KERNCONF=YOUR_KERNEL_HERE
> > > >         
> > > If by "reboot" in your original message you meant "drop to single user"
> > > then there's no confusion.  It's just that in my understanding "reboot"
> > > means, well, reboot.
> > No, I meant reboot and it clearly says here "reboot".  Note that
> > 'make kernel' does 'make buildkernel' and 'make installkernel', so
> > the reboot quoted above is after installkernel but before installworld.
> > Perhaps 'make kernel' should be expanded into separate lines for
> > 'buildkernel' and 'installkernel' if that is confusing.
> > 
> 
> I've been working with freebsd since 1996, and had no idea there was a
> kernel target that does build+install.  I think even showing it as
> 
>   make buildkernel installkernel KERNCONF=YOUR_KERNEL_HERE
> 
> would be more clear.

Yeah, that's not bad.  I don't ever use 'kernel' either.

-- 
John Baldwin

From owner-svn-src-head@freebsd.org  Tue Mar 27 18:05:35 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C6E5F711E2;
 Tue, 27 Mar 2018 18:05:35 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id E5F0576B8A;
 Tue, 27 Mar 2018 18:05:34 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215])
 by mail.baldwin.cx (Postfix) with ESMTPSA id 1B0AE10AFAD;
 Tue, 27 Mar 2018 14:05:34 -0400 (EDT)
From: John Baldwin 
To: rgrimes@freebsd.org
Cc: Ian Lepore , Alexey Dokuchaev ,
 Warner Losh , Kyle Evans ,
 svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers 
Subject: Re: svn commit: r331209 - head
Date: Tue, 27 Mar 2018 11:05:31 -0700
Message-ID: <2500432.7ECo1HNKKn@ralph.baldwin.cx>
User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; )
In-Reply-To: <201803271748.w2RHmMW1053238@pdx.rh.CN85.dnsmgr.net>
References: <201803271748.w2RHmMW1053238@pdx.rh.CN85.dnsmgr.net>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3
 (mail.baldwin.cx); Tue, 27 Mar 2018 14:05:34 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx
X-Virus-Status: Clean
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 18:05:35 -0000

On Tuesday, March 27, 2018 10:48:22 AM Rodney W. Grimes wrote:
> [ Charset ISO-8859-1 unsupported, converting... ]
> > On Tue, 2018-03-27 at 09:48 -0700, John Baldwin wrote:
> > > On Tuesday, March 27, 2018 05:19:12 AM Alexey Dokuchaev wrote:
> > > > 
> > > > On Thu, Mar 22, 2018 at 08:52:47AM -0700, John Baldwin wrote:
> > > > > 
> > > > > On Thursday, March 22, 2018 04:39:38 AM Alexey Dokuchaev wrote:
> > > > > > 
> > > > > > > 
> > > > > > > ...
> > > > > > Right, but John had mentioned extra reboot *between* installkernel and
> > > > > > installworld, which I've never heard of before.
> > > > > From the end up of src/UPDATING:
> > > > > 
> > > > > ????????
> > > > > ????????make buildworld
> > > > > ????????make kernel KERNCONF=YOUR_KERNEL_HERE
> > > > > ????????
> > > > If by "reboot" in your original message you meant "drop to single user"
> > > > then there's no confusion.??It's just that in my understanding "reboot"
> > > > means, well, reboot.
> > > No, I meant reboot and it clearly says here "reboot".??Note that
> > > 'make kernel' does 'make buildkernel' and 'make installkernel', so
> > > the reboot quoted above is after installkernel but before installworld.
> > > Perhaps 'make kernel' should be expanded into separate lines for
> > > 'buildkernel' and 'installkernel' if that is confusing.
> > > 
> > 
> > I've been working with freebsd since 1996, and had no idea there was a
> > kernel target that does build+install. ?I think even showing it as
> 
> I was vegually aware of it, but since I do things between
> buildkernel and installkernel I dont use it, more so cause
> I build kernels on a central box and push them out to
> systems.
> 
> > ? make buildkernel installkernel KERNCONF=YOUR_KERNEL_HERE
> 
> make {kernel|buildkernel installkernel} KERNCONF=YOUR_KERNEL_HERE
> 
> OR
> 
>     make kernel KERNCONF=YOUR_KERNEL_HERE
>     or
>     make buildkernel installkernel KERNCONF=YOUR_KERNEL_HERE

I think just one example is probably fine and explicit buildkernel and
installkernel is probably the more common use.

-- 
John Baldwin

From owner-svn-src-head@freebsd.org  Tue Mar 27 18:05:52 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1958DF71283;
 Tue, 27 Mar 2018 18:05:52 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id BE9C176D6B;
 Tue, 27 Mar 2018 18:05:51 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B98501F8DD;
 Tue, 27 Mar 2018 18:05:51 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RI5paM080654;
 Tue, 27 Mar 2018 18:05:51 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RI5pi6080649;
 Tue, 27 Mar 2018 18:05:51 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201803271805.w2RI5pi6080649@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov 
Date: Tue, 27 Mar 2018 18:05:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331640 - in head/sys: compat/freebsd32 dev/pci kern
X-SVN-Group: head
X-SVN-Commit-Author: kib
X-SVN-Commit-Paths: in head/sys: compat/freebsd32 dev/pci kern
X-SVN-Commit-Revision: 331640
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 18:05:52 -0000

Author: kib
Date: Tue Mar 27 18:05:51 2018
New Revision: 331640
URL: https://svnweb.freebsd.org/changeset/base/331640

Log:
  Fix several leaks of kernel stack data through paddings.
  
  It is random collection of fixes for issues not yet corrected,
  reported at https://tsyrklevi.ch/clang_analyzer/freebsd_013017/. Many
  issues from that list were already corrected. Most of them are for
  compat32, old compat32 or affect both primary host ABI and compat32.
  
  The freebsd32_kldstat(), for instance, was already fixed by using
  malloc(M_ZERO).  Patch includes correction to report the supplied
  version back, which is just pedantic.
  
  Reviewed by:	brooks, emaste (previous version)
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week
  Differential revision:	https://reviews.freebsd.org/D14868

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c
  head/sys/dev/pci/pci_user.c
  head/sys/kern/kern_ntptime.c
  head/sys/kern/kern_sig.c
  head/sys/kern/sysv_shm.c

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_misc.c	Tue Mar 27 17:58:00 2018	(r331639)
+++ head/sys/compat/freebsd32/freebsd32_misc.c	Tue Mar 27 18:05:51 2018	(r331640)
@@ -3285,6 +3285,7 @@ freebsd32_kldstat(struct thread *td, struct freebsd32_
 		CP(*stat, *stat32, size);
 		bcopy(&stat->pathname[0], &stat32->pathname[0],
 		    sizeof(stat->pathname));
+		stat32->version  = version;
 		error = copyout(stat32, uap->stat, version);
 	}
 	free(stat, M_TEMP);

Modified: head/sys/dev/pci/pci_user.c
==============================================================================
--- head/sys/dev/pci/pci_user.c	Tue Mar 27 17:58:00 2018	(r331639)
+++ head/sys/dev/pci/pci_user.c	Tue Mar 27 18:05:51 2018	(r331640)
@@ -770,6 +770,8 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, 
 #ifdef PRE7_COMPAT
 #ifdef COMPAT_FREEBSD32
 				if (cmd == PCIOCGETCONF_OLD32) {
+					memset(&conf_old32, 0,
+					    sizeof(conf_old32));
 					conf_old32.pc_sel.pc_bus =
 					    dinfo->conf.pc_sel.pc_bus;
 					conf_old32.pc_sel.pc_dev =
@@ -803,6 +805,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, 
 				} else
 #endif /* COMPAT_FREEBSD32 */
 				if (cmd == PCIOCGETCONF_OLD) {
+					memset(&conf_old, 0, sizeof(conf_old));
 					conf_old.pc_sel.pc_bus =
 					    dinfo->conf.pc_sel.pc_bus;
 					conf_old.pc_sel.pc_dev =

Modified: head/sys/kern/kern_ntptime.c
==============================================================================
--- head/sys/kern/kern_ntptime.c	Tue Mar 27 17:58:00 2018	(r331639)
+++ head/sys/kern/kern_ntptime.c	Tue Mar 27 18:05:51 2018	(r331640)
@@ -285,6 +285,8 @@ sys_ntp_gettime(struct thread *td, struct ntp_gettime_
 {	
 	struct ntptimeval ntv;
 
+	memset(&ntv, 0, sizeof(ntv));
+
 	NTP_LOCK();
 	ntp_gettime1(&ntv);
 	NTP_UNLOCK();

Modified: head/sys/kern/kern_sig.c
==============================================================================
--- head/sys/kern/kern_sig.c	Tue Mar 27 17:58:00 2018	(r331639)
+++ head/sys/kern/kern_sig.c	Tue Mar 27 18:05:51 2018	(r331640)
@@ -694,8 +694,8 @@ kern_sigaction(struct thread *td, int sig, const struc
 	ps = p->p_sigacts;
 	mtx_lock(&ps->ps_mtx);
 	if (oact) {
+		memset(oact, 0, sizeof(*oact));
 		oact->sa_mask = ps->ps_catchmask[_SIG_IDX(sig)];
-		oact->sa_flags = 0;
 		if (SIGISMEMBER(ps->ps_sigonstack, sig))
 			oact->sa_flags |= SA_ONSTACK;
 		if (!SIGISMEMBER(ps->ps_sigintr, sig))

Modified: head/sys/kern/sysv_shm.c
==============================================================================
--- head/sys/kern/sysv_shm.c	Tue Mar 27 17:58:00 2018	(r331639)
+++ head/sys/kern/sysv_shm.c	Tue Mar 27 18:05:51 2018	(r331640)
@@ -1471,6 +1471,7 @@ freebsd7_freebsd32_shmctl(struct thread *td,
 		break;
 	case SHM_STAT:
 	case IPC_STAT:
+		memset(&u32.shmid_ds32, 0, sizeof(u32.shmid_ds32));
 		freebsd32_ipcperm_old_out(&u.shmid_ds.shm_perm,
 		    &u32.shmid_ds32.shm_perm);
 		if (u.shmid_ds.shm_segsz > INT32_MAX)
@@ -1634,6 +1635,7 @@ freebsd7_shmctl(struct thread *td, struct freebsd7_shm
 	/* Cases in which we need to copyout */
 	switch (uap->cmd) {
 	case IPC_STAT:
+		memset(&old, 0, sizeof(old));
 		ipcperm_new2old(&buf.shm_perm, &old.shm_perm);
 		if (buf.shm_segsz > INT_MAX)
 			old.shm_segsz = INT_MAX;

From owner-svn-src-head@freebsd.org  Tue Mar 27 18:26:51 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52F73F72EE0;
 Tue, 27 Mar 2018 18:26:51 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id EF82577FE7;
 Tue, 27 Mar 2018 18:26:50 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA41C1FC3C;
 Tue, 27 Mar 2018 18:26:50 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RIQovN091009;
 Tue, 27 Mar 2018 18:26:50 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RIQo1m091007;
 Tue, 27 Mar 2018 18:26:50 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803271826.w2RIQo1m091007@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Tue, 27 Mar 2018 18:26:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331641 - head/sys/net
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: head/sys/net
X-SVN-Commit-Revision: 331641
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 18:26:51 -0000

Author: brooks
Date: Tue Mar 27 18:26:50 2018
New Revision: 331641
URL: https://svnweb.freebsd.org/changeset/base/331641

Log:
  Fix access to ifru_buffer on freebsd32.
  
  Make all kernel accesses to ifru_buffer go via access functions
  which take the process ABI into account and use an appropriate union
  to access members in the correct place in struct ifreq.
  
  Reviewed by:	kib
  Obtained from:	CheriBSD
  MFC after:	1 week
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14846

Modified:
  head/sys/net/if.c
  head/sys/net/if.h

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Tue Mar 27 18:05:51 2018	(r331640)
+++ head/sys/net/if.c	Tue Mar 27 18:26:50 2018	(r331641)
@@ -57,6 +57,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -99,8 +100,50 @@
 #ifdef COMPAT_FREEBSD32
 #include 
 #include 
+
+struct ifreq_buffer32 {
+	uint32_t	length;		/* (size_t) */
+	uint32_t	buffer;		/* (void *) */
+};
+
+/*
+ * Interface request structure used for socket
+ * ioctl's.  All interface ioctl's must have parameter
+ * definitions which begin with ifr_name.  The
+ * remainder may be interface specific.
+ */
+struct ifreq32 {
+	char	ifr_name[IFNAMSIZ];		/* if name, e.g. "en0" */
+	union {
+		struct sockaddr	ifru_addr;
+		struct sockaddr	ifru_dstaddr;
+		struct sockaddr	ifru_broadaddr;
+		struct ifreq_buffer32 ifru_buffer;
+		short		ifru_flags[2];
+		short		ifru_index;
+		int		ifru_jid;
+		int		ifru_metric;
+		int		ifru_mtu;
+		int		ifru_phys;
+		int		ifru_media;
+		uint32_t	ifru_data;
+		int		ifru_cap[2];
+		u_int		ifru_fib;
+		u_char		ifru_vlan_pcp;
+	} ifr_ifru;
+};
+CTASSERT(sizeof(struct ifreq) == sizeof(struct ifreq32));
+CTASSERT(__offsetof(struct ifreq, ifr_ifru) ==
+    __offsetof(struct ifreq32, ifr_ifru));
 #endif
 
+union ifreq_union {
+		struct ifreq	ifr;
+#ifdef COMPAT_FREEBSD32
+		struct ifreq32	ifr32;
+#endif
+};
+
 SYSCTL_NODE(_net, PF_LINK, link, CTLFLAG_RW, 0, "Link layers");
 SYSCTL_NODE(_net_link, 0, generic, CTLFLAG_RW, 0, "Generic link-management");
 
@@ -2305,6 +2348,61 @@ ifunit(const char *name)
 	return (ifp);
 }
 
+static void *
+ifr_buffer_get_buffer(struct thread *td, void *data)
+{
+	union ifreq_union *ifrup;
+
+	ifrup = data;
+#ifdef COMPAT_FREEBSD32
+	if (SV_PROC_FLAG(td->td_proc, SV_ILP32))
+		return ((void *)(uintptr_t)
+		    ifrup->ifr32.ifr_ifru.ifru_buffer.buffer);
+#endif
+	return (ifrup->ifr.ifr_ifru.ifru_buffer.buffer);
+}
+
+static void
+ifr_buffer_set_buffer_null(struct thread *td, void *data)
+{
+	union ifreq_union *ifrup;
+
+	ifrup = data;
+#ifdef COMPAT_FREEBSD32
+	if (SV_PROC_FLAG(td->td_proc, SV_ILP32))
+		ifrup->ifr32.ifr_ifru.ifru_buffer.buffer = 0;
+	else
+#endif
+		ifrup->ifr.ifr_ifru.ifru_buffer.buffer = NULL;
+}
+
+static size_t
+ifr_buffer_get_length(struct thread *td, void *data)
+{
+	union ifreq_union *ifrup;
+
+	ifrup = data;
+#ifdef COMPAT_FREEBSD32
+	if (SV_PROC_FLAG(td->td_proc, SV_ILP32))
+		return (ifrup->ifr32.ifr_ifru.ifru_buffer.length);
+#endif
+	return (ifrup->ifr.ifr_ifru.ifru_buffer.length);
+}
+
+static void
+ifr_buffer_set_length(struct thread *td, void *data, size_t len)
+{
+	union ifreq_union *ifrup;
+
+	ifrup = data;
+#ifdef COMPAT_FREEBSD32
+	if (SV_PROC_FLAG(td->td_proc, SV_ILP32))
+		ifrup->ifr32.ifr_ifru.ifru_buffer.length = len;
+	else
+#endif
+		ifrup->ifr.ifr_ifru.ifru_buffer.length = len;
+}
+
 /*
  * Hardware specific interface ioctls.
  */
@@ -2365,12 +2463,12 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data,
 		else {
 			/* space for terminating nul */
 			descrlen = strlen(ifp->if_description) + 1;
-			if (ifr->ifr_buffer.length < descrlen)
-				ifr->ifr_buffer.buffer = NULL;
+			if (ifr_buffer_get_length(td, ifr) < descrlen)
+				ifr_buffer_set_buffer_null(td, ifr);
 			else
 				error = copyout(ifp->if_description,
-				    ifr->ifr_buffer.buffer, descrlen);
-			ifr->ifr_buffer.length = descrlen;
+				    ifr_buffer_get_buffer(td, ifr), descrlen);
+			ifr_buffer_set_length(td, ifr, descrlen);
 		}
 		sx_sunlock(&ifdescr_sx);
 		break;
@@ -2386,15 +2484,15 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data,
 		 * length parameter is supposed to count the
 		 * terminating nul in.
 		 */
-		if (ifr->ifr_buffer.length > ifdescr_maxlen)
+		if (ifr_buffer_get_length(td, ifr) > ifdescr_maxlen)
 			return (ENAMETOOLONG);
-		else if (ifr->ifr_buffer.length == 0)
+		else if (ifr_buffer_get_length(td, ifr) == 0)
 			descrbuf = NULL;
 		else {
-			descrbuf = malloc(ifr->ifr_buffer.length, M_IFDESCR,
-			    M_WAITOK | M_ZERO);
-			error = copyin(ifr->ifr_buffer.buffer, descrbuf,
-			    ifr->ifr_buffer.length - 1);
+			descrbuf = malloc(ifr_buffer_get_length(td, ifr),
+			    M_IFDESCR, M_WAITOK | M_ZERO);
+			error = copyin(ifr_buffer_get_buffer(td, ifr), descrbuf,
+			    ifr_buffer_get_length(td, ifr) - 1);
 			if (error) {
 				free(descrbuf, M_IFDESCR);
 				break;

Modified: head/sys/net/if.h
==============================================================================
--- head/sys/net/if.h	Tue Mar 27 18:05:51 2018	(r331640)
+++ head/sys/net/if.h	Tue Mar 27 18:26:50 2018	(r331641)
@@ -402,7 +402,9 @@ struct	ifreq {
 #define	ifr_addr	ifr_ifru.ifru_addr	/* address */
 #define	ifr_dstaddr	ifr_ifru.ifru_dstaddr	/* other end of p-to-p link */
 #define	ifr_broadaddr	ifr_ifru.ifru_broadaddr	/* broadcast address */
+#ifndef _KERNEL
 #define	ifr_buffer	ifr_ifru.ifru_buffer	/* user supplied buffer with its length */
+#endif
 #define	ifr_flags	ifr_ifru.ifru_flags[0]	/* flags (low 16 bits) */
 #define	ifr_flagshigh	ifr_ifru.ifru_flags[1]	/* flags (high 16 bits) */
 #define	ifr_jid		ifr_ifru.ifru_jid	/* jail/vnet */

From owner-svn-src-head@freebsd.org  Tue Mar 27 18:44:06 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2892AF4A6CD;
 Tue, 27 Mar 2018 18:44:06 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id CF903792F8;
 Tue, 27 Mar 2018 18:44:05 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA9311FF7B;
 Tue, 27 Mar 2018 18:44:05 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RIi5Da001586;
 Tue, 27 Mar 2018 18:44:05 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RIi5UC001585;
 Tue, 27 Mar 2018 18:44:05 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201803271844.w2RIi5UC001585@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
 hselasky@FreeBSD.org using -f
From: Hans Petter Selasky 
Date: Tue, 27 Mar 2018 18:44:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331642 - head/sys/dev/usb/input
X-SVN-Group: head
X-SVN-Commit-Author: hselasky
X-SVN-Commit-Paths: head/sys/dev/usb/input
X-SVN-Commit-Revision: 331642
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 18:44:06 -0000

Author: hselasky
Date: Tue Mar 27 18:44:05 2018
New Revision: 331642
URL: https://svnweb.freebsd.org/changeset/base/331642

Log:
  Add support for right and middle click with integrated button to WSP
  USB trackpad driver.
  
  Submitted by:	James Wright 
  PR:		226961
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/usb/input/wsp.c

Modified: head/sys/dev/usb/input/wsp.c
==============================================================================
--- head/sys/dev/usb/input/wsp.c	Tue Mar 27 18:26:50 2018	(r331641)
+++ head/sys/dev/usb/input/wsp.c	Tue Mar 27 18:44:05 2018	(r331642)
@@ -929,7 +929,12 @@ wsp_intr_callback(struct usb_xfer *xfer, usb_error_t e
 		sc->sc_status.button = 0;
 
 		if (ibt != 0) {
-			sc->sc_status.button |= MOUSE_BUTTON1DOWN;
+			if ((params->caps & HAS_INTEGRATED_BUTTON) && ntouch == 2)
+				sc->sc_status.button |= MOUSE_BUTTON3DOWN;
+			else if ((params->caps & HAS_INTEGRATED_BUTTON) && ntouch == 3)
+				sc->sc_status.button |= MOUSE_BUTTON2DOWN;
+			else 
+				sc->sc_status.button |= MOUSE_BUTTON1DOWN;
 			sc->ibtn = 1;
 		}
 		sc->intr_count++;

From owner-svn-src-head@freebsd.org  Tue Mar 27 18:55:40 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 148F1F4E947;
 Tue, 27 Mar 2018 18:55:40 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id A582579DD9;
 Tue, 27 Mar 2018 18:55:39 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 869A12013D;
 Tue, 27 Mar 2018 18:55:39 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RItdDd007341;
 Tue, 27 Mar 2018 18:55:39 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RItdvn007340;
 Tue, 27 Mar 2018 18:55:39 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803271855.w2RItdvn007340@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Tue, 27 Mar 2018 18:55:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331644 - head/sys/net
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: head/sys/net
X-SVN-Commit-Revision: 331644
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 18:55:40 -0000

Author: brooks
Date: Tue Mar 27 18:55:39 2018
New Revision: 331644
URL: https://svnweb.freebsd.org/changeset/base/331644

Log:
  Fix a whitespace bug missed in refactoring prior to r331641.
  
  MFC with:	r331641

Modified:
  head/sys/net/if.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Tue Mar 27 18:52:27 2018	(r331643)
+++ head/sys/net/if.c	Tue Mar 27 18:55:39 2018	(r331644)
@@ -138,9 +138,9 @@ CTASSERT(__offsetof(struct ifreq, ifr_ifru) ==
 #endif
 
 union ifreq_union {
-		struct ifreq	ifr;
+	struct ifreq	ifr;
 #ifdef COMPAT_FREEBSD32
-		struct ifreq32	ifr32;
+	struct ifreq32	ifr32;
 #endif
 };
 

From owner-svn-src-head@freebsd.org  Tue Mar 27 20:51:51 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D89A0F5A77E;
 Tue, 27 Mar 2018 20:51:50 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 8608B800B7;
 Tue, 27 Mar 2018 20:51:50 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 811AD21390;
 Tue, 27 Mar 2018 20:51:50 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RKporl064730;
 Tue, 27 Mar 2018 20:51:50 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RKpnYT064723;
 Tue, 27 Mar 2018 20:51:49 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803272051.w2RKpnYT064723@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Tue, 27 Mar 2018 20:51:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331648 - in head/sys: net
 ofed/drivers/infiniband/ulp/ipoib
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: in head/sys: net ofed/drivers/infiniband/ulp/ipoib
X-SVN-Commit-Revision: 331648
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 20:51:51 -0000

Author: brooks
Date: Tue Mar 27 20:51:49 2018
New Revision: 331648
URL: https://svnweb.freebsd.org/changeset/base/331648

Log:
  Improve copy-and-pasted versions of SIOCGIFADDR.
  
  The original implementation used a reference to ifr_data and a cast to
  do the equivalent of accessing ifr_addr. This was copied multiple
  times since 1996.
  
  Approved by:	kib
  MFC after:	1 week
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14873

Modified:
  head/sys/net/if_arcsubr.c
  head/sys/net/if_ethersubr.c
  head/sys/net/if_fddisubr.c
  head/sys/net/if_fwsubr.c
  head/sys/net/if_iso88025subr.c
  head/sys/net/if_vlan.c
  head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c

Modified: head/sys/net/if_arcsubr.c
==============================================================================
--- head/sys/net/if_arcsubr.c	Tue Mar 27 20:49:47 2018	(r331647)
+++ head/sys/net/if_arcsubr.c	Tue Mar 27 20:51:49 2018	(r331648)
@@ -681,12 +681,7 @@ arc_ioctl(struct ifnet *ifp, u_long command, caddr_t d
 		break;
 
 	case SIOCGIFADDR:
-		{
-			struct sockaddr *sa;
-
-			sa = (struct sockaddr *) &ifr->ifr_data;
-			*(u_int8_t *)sa->sa_data = ARC_LLADDR(ifp);
-		}
+		ifr->ifr_addr.sa_data[0] = ARC_LLADDR(ifp);
 		break;
 
 	case SIOCADDMULTI:

Modified: head/sys/net/if_ethersubr.c
==============================================================================
--- head/sys/net/if_ethersubr.c	Tue Mar 27 20:49:47 2018	(r331647)
+++ head/sys/net/if_ethersubr.c	Tue Mar 27 20:51:49 2018	(r331648)
@@ -1108,13 +1108,8 @@ ether_ioctl(struct ifnet *ifp, u_long command, caddr_t
 		break;
 
 	case SIOCGIFADDR:
-		{
-			struct sockaddr *sa;
-
-			sa = (struct sockaddr *) & ifr->ifr_data;
-			bcopy(IF_LLADDR(ifp),
-			      (caddr_t) sa->sa_data, ETHER_ADDR_LEN);
-		}
+		bcopy(IF_LLADDR(ifp), &ifr->ifr_addr.sa_data[0],
+		    ETHER_ADDR_LEN);
 		break;
 
 	case SIOCSIFMTU:

Modified: head/sys/net/if_fddisubr.c
==============================================================================
--- head/sys/net/if_fddisubr.c	Tue Mar 27 20:49:47 2018	(r331647)
+++ head/sys/net/if_fddisubr.c	Tue Mar 27 20:51:49 2018	(r331648)
@@ -558,14 +558,9 @@ fddi_ioctl (ifp, command, data)
 			break;
 		}
 		break;
-	case SIOCGIFADDR: {
-			struct sockaddr *sa;
-
-			sa = (struct sockaddr *) & ifr->ifr_data;
-			bcopy(IF_LLADDR(ifp),
-			      (caddr_t) sa->sa_data, FDDI_ADDR_LEN);
-
-		}
+	case SIOCGIFADDR:
+		bcopy(IF_LLADDR(ifp), &ifr->ifr_addr.sa_data[0],
+		    FDDI_ADDR_LEN);
 		break;
 	case SIOCSIFMTU:
 		/*

Modified: head/sys/net/if_fwsubr.c
==============================================================================
--- head/sys/net/if_fwsubr.c	Tue Mar 27 20:49:47 2018	(r331647)
+++ head/sys/net/if_fwsubr.c	Tue Mar 27 20:51:49 2018	(r331648)
@@ -662,13 +662,8 @@ firewire_ioctl(struct ifnet *ifp, u_long command, cadd
 		break;
 
 	case SIOCGIFADDR:
-		{
-			struct sockaddr *sa;
-
-			sa = (struct sockaddr *) & ifr->ifr_data;
-			bcopy(&IFP2FWC(ifp)->fc_hwaddr,
-			    (caddr_t) sa->sa_data, sizeof(struct fw_hwaddr));
-		}
+		bcopy(&IFP2FWC(ifp)->fc_hwaddr, &ifr->ifr_addr.sa_data[0],
+		    sizeof(struct fw_hwaddr));
 		break;
 
 	case SIOCSIFMTU:

Modified: head/sys/net/if_iso88025subr.c
==============================================================================
--- head/sys/net/if_iso88025subr.c	Tue Mar 27 20:49:47 2018	(r331647)
+++ head/sys/net/if_iso88025subr.c	Tue Mar 27 20:51:49 2018	(r331648)
@@ -173,13 +173,9 @@ iso88025_ioctl(struct ifnet *ifp, u_long command, cadd
                 }
                 break;
 
-        case SIOCGIFADDR: {
-                        struct sockaddr *sa;
-
-                        sa = (struct sockaddr *) & ifr->ifr_data;
-                        bcopy(IF_LLADDR(ifp),
-                              (caddr_t) sa->sa_data, ISO88025_ADDR_LEN);
-                }
+        case SIOCGIFADDR:
+		bcopy(IF_LLADDR(ifp), &ifr->ifr_addr.sa_data[0],
+		    ISO88025_ADDR_LEN);
                 break;
 
         case SIOCSIFMTU:

Modified: head/sys/net/if_vlan.c
==============================================================================
--- head/sys/net/if_vlan.c	Tue Mar 27 20:49:47 2018	(r331647)
+++ head/sys/net/if_vlan.c	Tue Mar 27 20:51:49 2018	(r331648)
@@ -1790,12 +1790,8 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data
 #endif
 		break;
 	case SIOCGIFADDR:
-                {
-			struct sockaddr *sa;
-
-			sa = (struct sockaddr *)&ifr->ifr_data;
-			bcopy(IF_LLADDR(ifp), sa->sa_data, ifp->if_addrlen);
-                }
+		bcopy(IF_LLADDR(ifp), &ifr->ifr_addr.sa_data[0],
+		    ifp->if_addrlen);
 		break;
 	case SIOCGIFMEDIA:
 		VLAN_SLOCK();

Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c	Tue Mar 27 20:49:47 2018	(r331647)
+++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c	Tue Mar 27 20:51:49 2018	(r331648)
@@ -320,13 +320,8 @@ ipoib_ioctl(struct ifnet *ifp, u_long command, caddr_t
 		break;
 
 	case SIOCGIFADDR:
-		{
-			struct sockaddr *sa;
-
-			sa = (struct sockaddr *) & ifr->ifr_data;
-			bcopy(IF_LLADDR(ifp),
-			      (caddr_t) sa->sa_data, INFINIBAND_ALEN);
-		}
+		bcopy(IF_LLADDR(ifp), &ifr->ifr_addr.sa_data[0],
+		    INFINIBAND_ALEN);
 		break;
 
 	case SIOCSIFMTU:

From owner-svn-src-head@freebsd.org  Tue Mar 27 20:54:59 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCA64F5AD5A;
 Tue, 27 Mar 2018 20:54:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 83B6D803CE;
 Tue, 27 Mar 2018 20:54:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EA4A214C2;
 Tue, 27 Mar 2018 20:54:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RKswd9068542;
 Tue, 27 Mar 2018 20:54:58 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RKsvam068536;
 Tue, 27 Mar 2018 20:54:57 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201803272054.w2RKsvam068536@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin 
Date: Tue, 27 Mar 2018 20:54:57 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331649 - in head/sys/dev/cxgbe: cxgbei tom
X-SVN-Group: head
X-SVN-Commit-Author: jhb
X-SVN-Commit-Paths: in head/sys/dev/cxgbe: cxgbei tom
X-SVN-Commit-Revision: 331649
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 20:54:59 -0000

Author: jhb
Date: Tue Mar 27 20:54:57 2018
New Revision: 331649
URL: https://svnweb.freebsd.org/changeset/base/331649

Log:
  Use the offload transmit queue to set flags on TLS connections.
  
  Requests to modify the state of TLS connections need to be sent on the
  same queue as TLS record transmit requests to ensure ordering.
  
  However, in order to use the offload transmit queue in t4_set_tcb_field(),
  the function needs to be updated to do proper flow control / credit
  management when queueing a request to an offload queue.  This required
  passing a pointer to the toepcb itself to this function, so while here
  remove the 'tid' and 'iqid' parameters and obtain those values from the
  toepcb in t4_set_tcb_field() itself.
  
  Submitted by:	Harsh Jain @ Chelsio (original version)
  Reviewed by:	np
  Sponsored by:	Chelsio Communications
  Differential Revision:	https://reviews.freebsd.org/D14871

Modified:
  head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
  head/sys/dev/cxgbe/tom/t4_cpl_io.c
  head/sys/dev/cxgbe/tom/t4_ddp.c
  head/sys/dev/cxgbe/tom/t4_tls.c
  head/sys/dev/cxgbe/tom/t4_tom.c
  head/sys/dev/cxgbe/tom/t4_tom.h

Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
==============================================================================
--- head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c	Tue Mar 27 20:51:49 2018	(r331648)
+++ head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c	Tue Mar 27 20:54:57 2018	(r331649)
@@ -589,9 +589,9 @@ set_ulp_mode_iscsi(struct adapter *sc, struct toepcb *
 	CTR4(KTR_CXGBE, "%s: tid %u, ULP_MODE_ISCSI, CRC hdr=%d data=%d",
 	    __func__, toep->tid, hcrc, dcrc);
 
-	t4_set_tcb_field(sc, toep->ctrlq, toep->tid, W_TCB_ULP_TYPE,
+	t4_set_tcb_field(sc, toep->ctrlq, toep, W_TCB_ULP_TYPE,
 	    V_TCB_ULP_TYPE(M_TCB_ULP_TYPE) | V_TCB_ULP_RAW(M_TCB_ULP_RAW), val,
-	    0, 0, toep->ofld_rxq->iq.abs_id);
+	    0, 0);
 }
 
 /*

Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_cpl_io.c	Tue Mar 27 20:51:49 2018	(r331648)
+++ head/sys/dev/cxgbe/tom/t4_cpl_io.c	Tue Mar 27 20:54:57 2018	(r331649)
@@ -1934,14 +1934,14 @@ do_set_tcb_rpl(struct sge_iq *iq, const struct rss_hea
 }
 
 void
-t4_set_tcb_field(struct adapter *sc, struct sge_wrq *wrq, int tid,
-    uint16_t word, uint64_t mask, uint64_t val, int reply, int cookie, int iqid)
+t4_set_tcb_field(struct adapter *sc, struct sge_wrq *wrq, struct toepcb *toep,
+    uint16_t word, uint64_t mask, uint64_t val, int reply, int cookie)
 {
 	struct wrqe *wr;
 	struct cpl_set_tcb_field *req;
+	struct ofld_tx_sdesc *txsd;
 
 	MPASS((cookie & ~M_COOKIE) == 0);
-	MPASS((iqid & ~M_QUEUENO) == 0);
 
 	wr = alloc_wrqe(sizeof(*req), wrq);
 	if (wr == NULL) {
@@ -1950,13 +1950,26 @@ t4_set_tcb_field(struct adapter *sc, struct sge_wrq *w
 	}
 	req = wrtod(wr);
 
-	INIT_TP_WR_MIT_CPL(req, CPL_SET_TCB_FIELD, tid);
-	req->reply_ctrl = htobe16(V_QUEUENO(iqid));
+	INIT_TP_WR_MIT_CPL(req, CPL_SET_TCB_FIELD, toep->tid);
+	req->reply_ctrl = htobe16(V_QUEUENO(toep->ofld_rxq->iq.abs_id));
 	if (reply == 0)
 		req->reply_ctrl |= htobe16(F_NO_REPLY);
 	req->word_cookie = htobe16(V_WORD(word) | V_COOKIE(cookie));
 	req->mask = htobe64(mask);
 	req->val = htobe64(val);
+	if ((wrq->eq.flags & EQ_TYPEMASK) == EQ_OFLD) {
+		txsd = &toep->txsd[toep->txsd_pidx];
+		txsd->tx_credits = howmany(sizeof(*req), 16);
+		txsd->plen = 0;
+		KASSERT(toep->tx_credits >= txsd->tx_credits &&
+		    toep->txsd_avail > 0,
+		    ("%s: not enough credits (%d)", __func__,
+		    toep->tx_credits));
+		toep->tx_credits -= txsd->tx_credits;
+		if (__predict_false(++toep->txsd_pidx == toep->txsd_total))
+			toep->txsd_pidx = 0;
+		toep->txsd_avail--;
+	}
 
 	t4_wrq_tx(sc, wr);
 }

Modified: head/sys/dev/cxgbe/tom/t4_ddp.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_ddp.c	Tue Mar 27 20:51:49 2018	(r331648)
+++ head/sys/dev/cxgbe/tom/t4_ddp.c	Tue Mar 27 20:54:57 2018	(r331649)
@@ -811,14 +811,13 @@ enable_ddp(struct adapter *sc, struct toepcb *toep)
 
 	DDP_ASSERT_LOCKED(toep);
 	toep->ddp.flags |= DDP_SC_REQ;
-	t4_set_tcb_field(sc, toep->ctrlq, toep->tid, W_TCB_RX_DDP_FLAGS,
+	t4_set_tcb_field(sc, toep->ctrlq, toep, W_TCB_RX_DDP_FLAGS,
 	    V_TF_DDP_OFF(1) | V_TF_DDP_INDICATE_OUT(1) |
 	    V_TF_DDP_BUF0_INDICATE(1) | V_TF_DDP_BUF1_INDICATE(1) |
 	    V_TF_DDP_BUF0_VALID(1) | V_TF_DDP_BUF1_VALID(1),
-	    V_TF_DDP_BUF0_INDICATE(1) | V_TF_DDP_BUF1_INDICATE(1), 0, 0,
-	    toep->ofld_rxq->iq.abs_id);
-	t4_set_tcb_field(sc, toep->ctrlq, toep->tid, W_TCB_T_FLAGS,
-	    V_TF_RCV_COALESCE_ENABLE(1), 0, 0, 0, toep->ofld_rxq->iq.abs_id);
+	    V_TF_DDP_BUF0_INDICATE(1) | V_TF_DDP_BUF1_INDICATE(1), 0, 0);
+	t4_set_tcb_field(sc, toep->ctrlq, toep, W_TCB_T_FLAGS,
+	    V_TF_RCV_COALESCE_ENABLE(1), 0, 0, 0);
 }
 
 static int
@@ -1868,10 +1867,9 @@ t4_aio_cancel_active(struct kaiocb *job)
 			 */
 			valid_flag = i == 0 ? V_TF_DDP_BUF0_VALID(1) :
 			    V_TF_DDP_BUF1_VALID(1);
-			t4_set_tcb_field(sc, toep->ctrlq, toep->tid,
+			t4_set_tcb_field(sc, toep->ctrlq, toep,
 			    W_TCB_RX_DDP_FLAGS, valid_flag, 0, 1,
-			    i + DDP_BUF0_INVALIDATED,
-			    toep->ofld_rxq->iq.abs_id);
+			    i + DDP_BUF0_INVALIDATED);
 			toep->ddp.db[i].cancel_pending = 1;
 			CTR2(KTR_CXGBE, "%s: request %p marked pending",
 			    __func__, job);

Modified: head/sys/dev/cxgbe/tom/t4_tls.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_tls.c	Tue Mar 27 20:51:49 2018	(r331648)
+++ head/sys/dev/cxgbe/tom/t4_tls.c	Tue Mar 27 20:54:57 2018	(r331649)
@@ -68,8 +68,7 @@ t4_set_tls_tcb_field(struct toepcb *toep, uint16_t wor
 {
 	struct adapter *sc = td_adapter(toep->td);
 
-	t4_set_tcb_field(sc, toep->ctrlq, toep->tid, word, mask, val, 0, 0,
-	    toep->ofld_rxq->iq.abs_id);
+	t4_set_tcb_field(sc, toep->ofld_txq, toep, word, mask, val, 0, 0);
 }
 
 /* TLS and DTLS common routines */

Modified: head/sys/dev/cxgbe/tom/t4_tom.c
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_tom.c	Tue Mar 27 20:51:49 2018	(r331648)
+++ head/sys/dev/cxgbe/tom/t4_tom.c	Tue Mar 27 20:54:57 2018	(r331649)
@@ -392,9 +392,9 @@ t4_ctloutput(struct toedev *tod, struct tcpcb *tp, int
 	case TCP_NODELAY:
 		if (tp->t_state != TCPS_ESTABLISHED)
 			break;
-		t4_set_tcb_field(sc, toep->ctrlq, toep->tid, W_TCB_T_FLAGS,
+		t4_set_tcb_field(sc, toep->ctrlq, toep, W_TCB_T_FLAGS,
 		    V_TF_NAGLE(1), V_TF_NAGLE(tp->t_flags & TF_NODELAY ? 0 : 1),
-		    0, 0, toep->ofld_rxq->iq.abs_id);
+		    0, 0);
 		break;
 	default:
 		break;

Modified: head/sys/dev/cxgbe/tom/t4_tom.h
==============================================================================
--- head/sys/dev/cxgbe/tom/t4_tom.h	Tue Mar 27 20:51:49 2018	(r331648)
+++ head/sys/dev/cxgbe/tom/t4_tom.h	Tue Mar 27 20:54:57 2018	(r331649)
@@ -384,8 +384,8 @@ void t4_rcvd_locked(struct toedev *, struct tcpcb *);
 int t4_tod_output(struct toedev *, struct tcpcb *);
 int t4_send_fin(struct toedev *, struct tcpcb *);
 int t4_send_rst(struct toedev *, struct tcpcb *);
-void t4_set_tcb_field(struct adapter *, struct sge_wrq *, int, uint16_t,
-    uint64_t, uint64_t, int, int, int);
+void t4_set_tcb_field(struct adapter *, struct sge_wrq *, struct toepcb *,
+    uint16_t, uint64_t, uint64_t, int, int);
 void t4_push_frames(struct adapter *sc, struct toepcb *toep, int drop);
 void t4_push_pdus(struct adapter *sc, struct toepcb *toep, int drop);
 int do_set_tcb_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *);

From owner-svn-src-head@freebsd.org  Tue Mar 27 20:57:09 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C1D9F5B1FA;
 Tue, 27 Mar 2018 20:57:09 +0000 (UTC)
 (envelope-from brooks@spindle.one-eyed-alien.net)
Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net
 [199.48.129.229])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 07A1A807B7;
 Tue, 27 Mar 2018 20:57:08 +0000 (UTC)
 (envelope-from brooks@spindle.one-eyed-alien.net)
Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001)
 id 323795A9F17; Tue, 27 Mar 2018 20:57:08 +0000 (UTC)
Date: Tue, 27 Mar 2018 20:57:08 +0000
From: Brooks Davis 
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r331648 - in head/sys: net
 ofed/drivers/infiniband/ulp/ipoib
Message-ID: <20180327205708.GA86145@spindle.one-eyed-alien.net>
References: <201803272051.w2RKpnYT064723@repo.freebsd.org>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="5vNYLRcllDrimb99"
Content-Disposition: inline
In-Reply-To: <201803272051.w2RKpnYT064723@repo.freebsd.org>
User-Agent: Mutt/1.9.4 (2018-02-28)
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 20:57:09 -0000


--5vNYLRcllDrimb99
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Mar 27, 2018 at 08:51:49PM +0000, Brooks Davis wrote:
> Author: brooks
> Date: Tue Mar 27 20:51:49 2018
> New Revision: 331648
> URL: https://svnweb.freebsd.org/changeset/base/331648
>=20
> Log:
>   Improve copy-and-pasted versions of SIOCGIFADDR.
>  =20
>   The original implementation used a reference to ifr_data and a cast to
>   do the equivalent of accessing ifr_addr. This was copied multiple
>   times since 1996.
>  =20
>   Approved by:	kib

Should have been "Reviewed by".

-- Brooks

--5vNYLRcllDrimb99
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJaurAjAAoJEKzQXbSebgfAxxUIAJ3HvLO4JbQl3JgGw0GSPQy4
kzQXOUJmcjpnXWcqAtRz9QXDn+vWqZqhPjyhWI/x4PmBS9oxbavITP02wTjaXEBv
O8GWJPsTkSx3ZlEgJbulLU7JGd2Yh+YULr/wivJXsthUVvPf9gM5uJ29Xowq/sFz
jlqvg1BrWvYpau9Ytv4ekFKLcOox7qHOI9bJRwhOjAHL4aWMPiShgS4gTnppWSLV
FWVL4yweqREO3GOH8PGeZd9b7i2QajdZZrqF0JBq2Srw425vQ7ou6BlPgpQXKsHs
pv40avAQUke+W2c22svzDCbLePKEDVq30O4iZEBKoaDmR1IQ8Le8kD/X/nme9Wg=
=5WRW
-----END PGP SIGNATURE-----

--5vNYLRcllDrimb99--

From owner-svn-src-head@freebsd.org  Tue Mar 27 20:57:53 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56383F5B3DF;
 Tue, 27 Mar 2018 20:57:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 0163880995;
 Tue, 27 Mar 2018 20:57:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0769214CC;
 Tue, 27 Mar 2018 20:57:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RKvqHc068839;
 Tue, 27 Mar 2018 20:57:52 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RKvpRO068828;
 Tue, 27 Mar 2018 20:57:51 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201803272057.w2RKvpRO068828@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin 
Date: Tue, 27 Mar 2018 20:57:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331650 - in head/sys: amd64/amd64 amd64/ia32 amd64/linux
 amd64/linux32 cddl/contrib/opensolaris/uts/intel/dtrace cddl/dev/dtrace/amd64
 cddl/dev/dtrace/i386 i386/i386 i386/linux x86/inc...
X-SVN-Group: head
X-SVN-Commit-Author: jhb
X-SVN-Commit-Paths: in head/sys: amd64/amd64 amd64/ia32 amd64/linux
 amd64/linux32 cddl/contrib/opensolaris/uts/intel/dtrace cddl/dev/dtrace/amd64
 cddl/dev/dtrace/i386 i386/i386 i386/linux x86/include
X-SVN-Commit-Revision: 331650
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 20:57:53 -0000

Author: jhb
Date: Tue Mar 27 20:57:51 2018
New Revision: 331650
URL: https://svnweb.freebsd.org/changeset/base/331650

Log:
  Remove very old and unused signal information codes.
  
  These have been supplanted by the MI signal information codes in
   since 7.0.  The FPE_*_TRAP ones were deprecated even
  earlier in 1999.
  
  PR:		226579 (exp-run)
  Reviewed by:	kib
  Differential Revision:	https://reviews.freebsd.org/D14637

Modified:
  head/sys/amd64/amd64/trap.c
  head/sys/amd64/ia32/ia32_signal.c
  head/sys/amd64/linux/linux_sysvec.c
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
  head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
  head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
  head/sys/i386/i386/trap.c
  head/sys/i386/linux/linux_sysvec.c
  head/sys/x86/include/signal.h
  head/sys/x86/include/trap.h

Modified: head/sys/amd64/amd64/trap.c
==============================================================================
--- head/sys/amd64/amd64/trap.c	Tue Mar 27 20:54:57 2018	(r331649)
+++ head/sys/amd64/amd64/trap.c	Tue Mar 27 20:57:51 2018	(r331650)
@@ -95,6 +95,7 @@ PMC_SOFT_DEFINE( , , page_fault, write);
 #include 
 #endif
 #include 
+#include 
 #include 
 
 #ifdef KDTRACE_HOOKS
@@ -338,14 +339,14 @@ trap(struct trapframe *frame)
 					ucode = SEGV_ACCERR;
 				} else {
 					signo = SIGBUS;
-					ucode = BUS_PAGE_FAULT;
+					ucode = T_PAGEFLT;
 				}
 			} else if (prot_fault_translation == 1) {
 				/*
 				 * Always compat mode.
 				 */
 				signo = SIGBUS;
-				ucode = BUS_PAGE_FAULT;
+				ucode = T_PAGEFLT;
 			} else {
 				/*
 				 * Always SIGSEGV mode.

Modified: head/sys/amd64/ia32/ia32_signal.c
==============================================================================
--- head/sys/amd64/ia32/ia32_signal.c	Tue Mar 27 20:54:57 2018	(r331649)
+++ head/sys/amd64/ia32/ia32_signal.c	Tue Mar 27 20:57:51 2018	(r331650)
@@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #ifdef COMPAT_FREEBSD4
 static void freebsd4_ia32_sendsig(sig_t, ksiginfo_t *, sigset_t *);

Modified: head/sys/amd64/linux/linux_sysvec.c
==============================================================================
--- head/sys/amd64/linux/linux_sysvec.c	Tue Mar 27 20:54:57 2018	(r331649)
+++ head/sys/amd64/linux/linux_sysvec.c	Tue Mar 27 20:57:51 2018	(r331650)
@@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- head/sys/amd64/linux32/linux32_sysvec.c	Tue Mar 27 20:54:57 2018	(r331649)
+++ head/sys/amd64/linux32/linux32_sysvec.c	Tue Mar 27 20:57:51 2018	(r331650)
@@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 

Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c	Tue Mar 27 20:54:57 2018	(r331649)
+++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c	Tue Mar 27 20:57:51 2018	(r331650)
@@ -52,6 +52,7 @@
 #include 
 #include 
 #include 
+#include 
 #endif
 #include 
 #ifdef illumos

Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
==============================================================================
--- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Tue Mar 27 20:54:57 2018	(r331649)
+++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Tue Mar 27 20:57:51 2018	(r331650)
@@ -44,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 extern void dtrace_getnanotime(struct timespec *tsp);

Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
==============================================================================
--- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Tue Mar 27 20:54:57 2018	(r331649)
+++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Tue Mar 27 20:57:51 2018	(r331650)
@@ -45,6 +45,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 extern uintptr_t 	kernelbase;

Modified: head/sys/i386/i386/trap.c
==============================================================================
--- head/sys/i386/i386/trap.c	Tue Mar 27 20:54:57 2018	(r331649)
+++ head/sys/i386/i386/trap.c	Tue Mar 27 20:57:51 2018	(r331650)
@@ -97,6 +97,7 @@ PMC_SOFT_DEFINE( , , page_fault, write);
 #include 
 #endif
 #include 
+#include 
 #include 
 #include 
 
@@ -416,14 +417,14 @@ user_trctrap_out:
 					ucode = SEGV_ACCERR;
 				} else {
 					signo = SIGBUS;
-					ucode = BUS_PAGE_FAULT;
+					ucode = T_PAGEFLT;
 				}
 			} else if (prot_fault_translation == 1) {
 				/*
 				 * Always compat mode.
 				 */
 				signo = SIGBUS;
-				ucode = BUS_PAGE_FAULT;
+				ucode = T_PAGEFLT;
 			} else {
 				/*
 				 * Always SIGSEGV mode.

Modified: head/sys/i386/linux/linux_sysvec.c
==============================================================================
--- head/sys/i386/linux/linux_sysvec.c	Tue Mar 27 20:54:57 2018	(r331649)
+++ head/sys/i386/linux/linux_sysvec.c	Tue Mar 27 20:57:51 2018	(r331650)
@@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 

Modified: head/sys/x86/include/signal.h
==============================================================================
--- head/sys/x86/include/signal.h	Tue Mar 27 20:54:57 2018	(r331649)
+++ head/sys/x86/include/signal.h	Tue Mar 27 20:57:51 2018	(r331650)
@@ -43,10 +43,6 @@
 #include 
 #include 
 
-#if __BSD_VISIBLE
-#include 	/* codes for SIGILL, SIGFPE */
-#endif
-
 #ifdef __i386__
 typedef int sig_atomic_t;
 

Modified: head/sys/x86/include/trap.h
==============================================================================
--- head/sys/x86/include/trap.h	Tue Mar 27 20:54:57 2018	(r331649)
+++ head/sys/x86/include/trap.h	Tue Mar 27 20:57:51 2018	(r331650)
@@ -66,30 +66,6 @@
 #define	T_RESERVED	30	/* reserved (unknown) */
 #define	T_DTRACE_RET	32	/* DTrace pid return */
 
-/* XXX most of the following codes aren't used, but could be. */
-
-/* definitions for  */
-#define	    ILL_RESAD_FAULT	T_RESADFLT
-#define	    ILL_PRIVIN_FAULT	T_PRIVINFLT
-#define	    ILL_RESOP_FAULT	T_RESOPFLT
-#define	    ILL_ALIGN_FAULT	T_ALIGNFLT
-#define	    ILL_FPOP_FAULT	T_FPOPFLT	/* coprocessor operand fault */
-
-/* old FreeBSD macros, deprecated */
-#define	FPE_INTOVF_TRAP	0x1	/* integer overflow */
-#define	FPE_INTDIV_TRAP	0x2	/* integer divide by zero */
-#define	FPE_FLTDIV_TRAP	0x3	/* floating/decimal divide by zero */
-#define	FPE_FLTOVF_TRAP	0x4	/* floating overflow */
-#define	FPE_FLTUND_TRAP	0x5	/* floating underflow */
-#define	FPE_FPU_NP_TRAP	0x6	/* floating point unit not present  */
-#define	FPE_SUBRNG_TRAP	0x7	/* subrange out of bounds */
-
-/* codes for SIGBUS */
-#define	    BUS_PAGE_FAULT	T_PAGEFLT	/* page fault protection base */
-#define	    BUS_SEGNP_FAULT	T_SEGNPFLT	/* segment not present */
-#define	    BUS_STK_FAULT	T_STKFLT	/* stack segment */
-#define	    BUS_SEGM_FAULT	T_RESERVED	/* segment protection base */
-
 /* Trap's coming from user mode */
 #define	T_USER	0x100
 

From owner-svn-src-head@freebsd.org  Tue Mar 27 21:03:30 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 954ECF5BD62;
 Tue, 27 Mar 2018 21:03:30 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 4858480F89;
 Tue, 27 Mar 2018 21:03:30 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 42FD421681;
 Tue, 27 Mar 2018 21:03:30 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RL3Uue073474;
 Tue, 27 Mar 2018 21:03:30 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RL3UEi073473;
 Tue, 27 Mar 2018 21:03:30 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803272103.w2RL3UEi073473@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Tue, 27 Mar 2018 21:03:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331651 - head/sys/dev/sbni
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: head/sys/dev/sbni
X-SVN-Commit-Revision: 331651
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 21:03:30 -0000

Author: brooks
Date: Tue Mar 27 21:03:29 2018
New Revision: 331651
URL: https://svnweb.freebsd.org/changeset/base/331651

Log:
  Copy flags over ifr_union directly rather than via casts through ifr_data.
  
  No functional change in practice.  If the sbni driver supported
  64-bit big-endian system, this would be an ABI changes, but it is
  i386-only.  The old version leaked a word of stack on 64-bit systems.
  
  This eliminates the only assignment to ifr_data.

Modified:
  head/sys/dev/sbni/if_sbni.c

Modified: head/sys/dev/sbni/if_sbni.c
==============================================================================
--- head/sys/dev/sbni/if_sbni.c	Tue Mar 27 20:57:51 2018	(r331650)
+++ head/sys/dev/sbni/if_sbni.c	Tue Mar 27 21:03:29 2018	(r331651)
@@ -1144,7 +1144,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t 
 		flags.fixed_rxl = (sc->delta_rxl == 0);
 		flags.fixed_rate = 1;
 		SBNI_UNLOCK(sc);
-		ifr->ifr_data = *(caddr_t*) &flags;
+		bcopy(&flags, &ifr->ifr_ifru, sizeof(flags));
 		break;
 
 	case SIOCGINSTATS:
@@ -1163,7 +1163,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t 
 		error = priv_check(td, PRIV_DRIVER);
 		if (error)
 			break;
-		flags = *(struct sbni_flags*)&ifr->ifr_data;
+		bcopy(&ifr->ifr_ifru, &flags, sizeof(flags));
 		SBNI_LOCK(sc);
 		if (flags.fixed_rxl) {
 			sc->delta_rxl = 0;

From owner-svn-src-head@freebsd.org  Tue Mar 27 21:04:55 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45DB8F5BF76;
 Tue, 27 Mar 2018 21:04:55 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id EF8C081156;
 Tue, 27 Mar 2018 21:04:54 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA79721684;
 Tue, 27 Mar 2018 21:04:54 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RL4sXU073572;
 Tue, 27 Mar 2018 21:04:54 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RL4si5073571;
 Tue, 27 Mar 2018 21:04:54 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803272104.w2RL4si5073571@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Tue, 27 Mar 2018 21:04:54 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331652 - head/sys/dev/sbni
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: head/sys/dev/sbni
X-SVN-Commit-Revision: 331652
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 21:04:55 -0000

Author: brooks
Date: Tue Mar 27 21:04:54 2018
New Revision: 331652
URL: https://svnweb.freebsd.org/changeset/base/331652

Log:
  Revert r331651 to recommit with proper commit metadata.

Modified:
  head/sys/dev/sbni/if_sbni.c

Modified: head/sys/dev/sbni/if_sbni.c
==============================================================================
--- head/sys/dev/sbni/if_sbni.c	Tue Mar 27 21:03:29 2018	(r331651)
+++ head/sys/dev/sbni/if_sbni.c	Tue Mar 27 21:04:54 2018	(r331652)
@@ -1144,7 +1144,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t 
 		flags.fixed_rxl = (sc->delta_rxl == 0);
 		flags.fixed_rate = 1;
 		SBNI_UNLOCK(sc);
-		bcopy(&flags, &ifr->ifr_ifru, sizeof(flags));
+		ifr->ifr_data = *(caddr_t*) &flags;
 		break;
 
 	case SIOCGINSTATS:
@@ -1163,7 +1163,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t 
 		error = priv_check(td, PRIV_DRIVER);
 		if (error)
 			break;
-		bcopy(&ifr->ifr_ifru, &flags, sizeof(flags));
+		flags = *(struct sbni_flags*)&ifr->ifr_data;
 		SBNI_LOCK(sc);
 		if (flags.fixed_rxl) {
 			sc->delta_rxl = 0;

From owner-svn-src-head@freebsd.org  Tue Mar 27 21:06:19 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F6A3F5C2F1;
 Tue, 27 Mar 2018 21:06:19 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 0B56A815BE;
 Tue, 27 Mar 2018 21:06:19 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0572F2168B;
 Tue, 27 Mar 2018 21:06:19 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RL6Igl074028;
 Tue, 27 Mar 2018 21:06:18 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RL6In2074027;
 Tue, 27 Mar 2018 21:06:18 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803272106.w2RL6In2074027@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Tue, 27 Mar 2018 21:06:18 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331653 - head/sys/dev/sbni
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: head/sys/dev/sbni
X-SVN-Commit-Revision: 331653
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 21:06:19 -0000

Author: brooks
Date: Tue Mar 27 21:06:18 2018
New Revision: 331653
URL: https://svnweb.freebsd.org/changeset/base/331653

Log:
  Copy flags over ifr_union directly rather than via casts through ifr_data.
  
  No functional change in practice.  If the sbni driver supported
  64-bit big-endian system, this would be an ABI changes, but it is
  i386-only.  The old version leaked a word of stack on 64-bit systems.
  
  This eliminates the only assignment to ifr_data.
  
  Reviewed by:	kib
  MFC after:	1 week
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14874

Modified:
  head/sys/dev/sbni/if_sbni.c

Modified: head/sys/dev/sbni/if_sbni.c
==============================================================================
--- head/sys/dev/sbni/if_sbni.c	Tue Mar 27 21:04:54 2018	(r331652)
+++ head/sys/dev/sbni/if_sbni.c	Tue Mar 27 21:06:18 2018	(r331653)
@@ -1144,7 +1144,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t 
 		flags.fixed_rxl = (sc->delta_rxl == 0);
 		flags.fixed_rate = 1;
 		SBNI_UNLOCK(sc);
-		ifr->ifr_data = *(caddr_t*) &flags;
+		bcopy(&flags, &ifr->ifr_ifru, sizeof(flags));
 		break;
 
 	case SIOCGINSTATS:
@@ -1163,7 +1163,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t 
 		error = priv_check(td, PRIV_DRIVER);
 		if (error)
 			break;
-		flags = *(struct sbni_flags*)&ifr->ifr_data;
+		bcopy(&ifr->ifr_ifru, &flags, sizeof(flags));
 		SBNI_LOCK(sc);
 		if (flags.fixed_rxl) {
 			sc->delta_rxl = 0;

From owner-svn-src-head@freebsd.org  Tue Mar 27 21:08:32 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A753F5C73D
 for ;
 Tue, 27 Mar 2018 21:08:32 +0000 (UTC)
 (envelope-from jroberson@jroberson.net)
Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com
 [IPv6:2607:f8b0:400e:c00::243])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 25265819F7
 for ; Tue, 27 Mar 2018 21:08:32 +0000 (UTC)
 (envelope-from jroberson@jroberson.net)
Received: by mail-pf0-x243.google.com with SMTP id l27so108125pfk.12
 for ; Tue, 27 Mar 2018 14:08:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=jroberson-net.20150623.gappssmtp.com; s=20150623;
 h=date:from:to:cc:subject:in-reply-to:message-id:references
 :user-agent:mime-version;
 bh=ZGTFRbtefuo6k7GJJOve95zH2Qhww/RgInb0LWS6Oug=;
 b=0MTM/4aY+M37cVWksjW1OfHiNNzUxjUa3N7zWEq+4KS8CjLlYP2bTaMeklVk7cjWHO
 lC+BuHC7tMbFeF1MjFuy5S265vLNrodgatSHyoH6K842xfgOPjJxGgiMpr2OuKL0vt7O
 gHAVuACqmNrH3fgj5u4vs+RgrJiXexPbXPIaQQkPteHbuk3csRRMulh5Qfey2rvzktZk
 ipNsERJOKLUkCHstKPZDjvs3fwVlcbQYj2wg8+/E2mZ53q2XIp0nLEgsWLazwuI2LjmD
 z4L3FhalhLxMo6mtt4BNEI6wQc9vjiWlC63CiuRVkoHDcV/Hzhh34HeVGp9dS/tctopo
 R8nA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id
 :references:user-agent:mime-version;
 bh=ZGTFRbtefuo6k7GJJOve95zH2Qhww/RgInb0LWS6Oug=;
 b=mpT9E07rNN5w7XsGghT5u/2tEG/7ADyrPxPEflR9upaPsAWm8UFIUY7gp/bjNDPZSX
 XJ2n/VXrvpX7sHTtu/GvEj8EHPcQlKVKHdvsYw+R0Y56WWKIGujghhZuMn4Y3F4zMomN
 /xaHkkb37ClXg2bub/CYYt4HrupXBEE/8rZfIuuG+E1ZdFPX57nhBCmS7dSXUM7fnSnF
 zWplB9mXoQINHefTOfFF3kqLZMrWcr1H51/HmKUdoRiFlTT/lzpaZa6qi0uZeJIwREct
 kEO/uvMNFUKjU6e/9XMbQHrhB0DOVOuzSggvoNKB3DQMQKk9TxrWJ5TazBUBBMbBf227
 YK3Q==
X-Gm-Message-State: AElRT7FDGdYMlizAWdHFrZwTMBZZtQnzvTUGCRxX0F/eZr5ctFEqdpCL
 OHdZK6cWP/5uljGKRK+IsG1sqQ==
X-Google-Smtp-Source: AIpwx49CPjVevWUWV0E6cIPCqm+RVZMSE+Ez4LFDpjneUOIoUXU11o5YVrMI4slgM2jDMrXrzzad3g==
X-Received: by 10.101.100.203 with SMTP id t11mr585912pgv.129.1522184911122;
 Tue, 27 Mar 2018 14:08:31 -0700 (PDT)
Received: from rrcs-66-91-135-210.west.biz.rr.com
 (rrcs-66-91-135-210.west.biz.rr.com. [66.91.135.210])
 by smtp.gmail.com with ESMTPSA id x80sm4585746pfi.88.2018.03.27.14.08.29
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 27 Mar 2018 14:08:30 -0700 (PDT)
Date: Tue, 27 Mar 2018 11:07:22 -1000 (HST)
From: Jeff Roberson 
X-X-Sender: jroberson@desktop
To: Li-Wen Hsu 
cc: "O. Hartmann" , Jeff Roberson , 
 pho@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org, 
 src-committers@freebsd.org
Subject: Re: svn commit: r331606 - in head/sys: amd64/include i386/include
 x86/x86 x86/xen
In-Reply-To: <20180327101309.GA75720@freefall.freebsd.org>
Message-ID: 
References: <201803270337.w2R3b4iv035285@repo.freebsd.org>
 <20180327081535.0dacffcb@freyja.zeit4.iv.bundesimmobilien.de>
 <20180327082651.28258a8c@freyja.zeit4.iv.bundesimmobilien.de>
 
 <20180327101309.GA75720@freefall.freebsd.org>
User-Agent: Alpine 2.21 (BSF 202 2017-01-01)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="2547152148-430465068-1522184844=:2307"
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 21:08:32 -0000

  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--2547152148-430465068-1522184844=:2307
Content-Type: text/plain; charset=US-ASCII; format=flowed

On Tue, 27 Mar 2018, Li-Wen Hsu wrote:

> On Mon, Mar 26, 2018 at 20:35:12 -1000, Jeff Roberson wrote:
>> The patch has been on my branch for weeks and has been tested by a half
>> dozen people.  I'm sorry it does not work for you.  If you reverted 331605
>> the change that followed should not have built properly.  Did you build
>> cleanly?  Can you share your kernel config?
>>
>> I tried with and without EARLY_AP_STARTUP and with and without NUMA.  I'm
>> not having any trouble booting.  Did you make cleandepend && make depend?
>
> It also hangs in our testing system:
>
> https://ci.freebsd.org/job/FreeBSD-head-amd64-test/6817/console
> https://ci.freebsd.org/job/FreeBSD-head-i386-test/1000/console
>
> It is built cleanly and uses unmodified GENERIC config.
>
> The artifacts used are available here:
>
> https://artifact.ci.freebsd.org/snapshot/head/r331606/amd64/amd64/
> https://artifact.ci.freebsd.org/snapshot/head/r331606/i386/i386/
>
> Hope these information help.

Could someone who was experiencing the hang try the enclosed patch?  I can 
only verify that it continues to boot for me but I believe this fixes the 
bug on other systems.

I believe the issue was that cpuset_domain[0] was initialized too late on 
some systems.  It depended on what kind of hardware was present and which 
sysinit with SI_ORDER_ANY ran first.

Thanks,
Jeff

>
> Li-Wen
>
> -- 
> Li-Wen Hsu 
> https://lwhsu.org
>
--2547152148-430465068-1522184844=:2307
Content-Type: text/plain; charset=US-ASCII; name=intr.diff
Content-Transfer-Encoding: BASE64
Content-ID: 
Content-Description: 
Content-Disposition: attachment; filename=intr.diff

SW5kZXg6IGFtZDY0L2luY2x1ZGUvaW50cl9tYWNoZGVwLmgNCj09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT0NCi0tLSBhbWQ2NC9pbmNsdWRlL2ludHJfbWFjaGRl
cC5oCShyZXZpc2lvbiAzMzE2MTApDQorKysgYW1kNjQvaW5jbHVkZS9pbnRy
X21hY2hkZXAuaAkod29ya2luZyBjb3B5KQ0KQEAgLTEzMiw2ICsxMzIsNyBA
QCBzdHJ1Y3QgaW50c3JjIHsNCiAJdV9sb25nICppc19zdHJheWNvdW50Ow0K
IAl1X2ludCBpc19pbmRleDsNCiAJdV9pbnQgaXNfaGFuZGxlcnM7DQorCXVf
aW50IGlzX2RvbWFpbjsNCiAJdV9pbnQgaXNfY3B1Ow0KIH07DQogDQpAQCAt
MTY4LDcgKzE2OSw3IEBAIHZvaWQJaW50cl9hZGRfY3B1KHVfaW50IGNwdSk7
DQogI2VuZGlmDQogaW50CWludHJfYWRkX2hhbmRsZXIoY29uc3QgY2hhciAq
bmFtZSwgaW50IHZlY3RvciwgZHJpdmVyX2ZpbHRlcl90IGZpbHRlciwgDQog
CQkJIGRyaXZlcl9pbnRyX3QgaGFuZGxlciwgdm9pZCAqYXJnLCBlbnVtIGlu
dHJfdHlwZSBmbGFncywgDQotCQkJIHZvaWQgKipjb29raWVwKTsgICAgDQor
CQkJIHZvaWQgKipjb29raWVwLCBpbnQgZG9tYWluKTsgICAgDQogI2lmZGVm
IFNNUA0KIGludAlpbnRyX2JpbmQodV9pbnQgdmVjdG9yLCB1X2NoYXIgY3B1
KTsNCiAjZW5kaWYNCkBAIC0xNzYsNyArMTc3LDcgQEAgaW50CWludHJfY29u
ZmlnX2ludHIoaW50IHZlY3RvciwgZW51bSBpbnRyX3RyaWdnZXINCiAgICAg
ZW51bSBpbnRyX3BvbGFyaXR5IHBvbCk7DQogaW50CWludHJfZGVzY3JpYmUo
dV9pbnQgdmVjdG9yLCB2b2lkICppaCwgY29uc3QgY2hhciAqZGVzY3IpOw0K
IHZvaWQJaW50cl9leGVjdXRlX2hhbmRsZXJzKHN0cnVjdCBpbnRzcmMgKmlz
cmMsIHN0cnVjdCB0cmFwZnJhbWUgKmZyYW1lKTsNCi11X2ludAlpbnRyX25l
eHRfY3B1KHZvaWQpOw0KK3VfaW50CWludHJfbmV4dF9jcHUoaW50IGRvbWFp
bik7DQogc3RydWN0IGludHNyYyAqaW50cl9sb29rdXBfc291cmNlKGludCB2
ZWN0b3IpOw0KIGludAlpbnRyX3JlZ2lzdGVyX3BpYyhzdHJ1Y3QgcGljICpw
aWMpOw0KIGludAlpbnRyX3JlZ2lzdGVyX3NvdXJjZShzdHJ1Y3QgaW50c3Jj
ICppc3JjKTsNCkluZGV4OiBpMzg2L2luY2x1ZGUvaW50cl9tYWNoZGVwLmgN
Cj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT0NCi0tLSBpMzg2L2luY2x1ZGUvaW50
cl9tYWNoZGVwLmgJKHJldmlzaW9uIDMzMTYxMCkNCisrKyBpMzg2L2luY2x1
ZGUvaW50cl9tYWNoZGVwLmgJKHdvcmtpbmcgY29weSkNCkBAIC0xMzIsNiAr
MTMyLDcgQEAgc3RydWN0IGludHNyYyB7DQogCXVfbG9uZyAqaXNfc3RyYXlj
b3VudDsNCiAJdV9pbnQgaXNfaW5kZXg7DQogCXVfaW50IGlzX2hhbmRsZXJz
Ow0KKwl1X2ludCBpc19kb21haW47DQogCXVfaW50IGlzX2NwdTsNCiB9Ow0K
IA0KQEAgLTE1OCw3ICsxNTksOCBAQCB2b2lkCWVsY3Jfd3JpdGVfdHJpZ2dl
cih1X2ludCBpcnEsIGVudW0gaW50cl90cmlnZw0KIHZvaWQJaW50cl9hZGRf
Y3B1KHVfaW50IGNwdSk7DQogI2VuZGlmDQogaW50CWludHJfYWRkX2hhbmRs
ZXIoY29uc3QgY2hhciAqbmFtZSwgaW50IHZlY3RvciwgZHJpdmVyX2ZpbHRl
cl90IGZpbHRlciwNCi0gICAgZHJpdmVyX2ludHJfdCBoYW5kbGVyLCB2b2lk
ICphcmcsIGVudW0gaW50cl90eXBlIGZsYWdzLCB2b2lkICoqY29va2llcCk7
DQorICAgIGRyaXZlcl9pbnRyX3QgaGFuZGxlciwgdm9pZCAqYXJnLCBlbnVt
IGludHJfdHlwZSBmbGFncywgdm9pZCAqKmNvb2tpZXAsDQorICAgIGludCBk
b21haW4pOw0KICNpZmRlZiBTTVANCiBpbnQJaW50cl9iaW5kKHVfaW50IHZl
Y3RvciwgdV9jaGFyIGNwdSk7DQogI2VuZGlmDQpAQCAtMTY2LDcgKzE2OCw3
IEBAIGludAlpbnRyX2NvbmZpZ19pbnRyKGludCB2ZWN0b3IsIGVudW0gaW50
cl90cmlnZ2VyDQogICAgIGVudW0gaW50cl9wb2xhcml0eSBwb2wpOw0KIGlu
dAlpbnRyX2Rlc2NyaWJlKHVfaW50IHZlY3Rvciwgdm9pZCAqaWgsIGNvbnN0
IGNoYXIgKmRlc2NyKTsNCiB2b2lkCWludHJfZXhlY3V0ZV9oYW5kbGVycyhz
dHJ1Y3QgaW50c3JjICppc3JjLCBzdHJ1Y3QgdHJhcGZyYW1lICpmcmFtZSk7
DQotdV9pbnQJaW50cl9uZXh0X2NwdSh2b2lkKTsNCit1X2ludAlpbnRyX25l
eHRfY3B1KGludCBkb21haW4pOw0KIHN0cnVjdCBpbnRzcmMgKmludHJfbG9v
a3VwX3NvdXJjZShpbnQgdmVjdG9yKTsNCiBpbnQJaW50cl9yZWdpc3Rlcl9w
aWMoc3RydWN0IHBpYyAqcGljKTsNCiBpbnQJaW50cl9yZWdpc3Rlcl9zb3Vy
Y2Uoc3RydWN0IGludHNyYyAqaXNyYyk7DQpJbmRleDoga2Vybi9rZXJuX2Nw
dXNldC5jDQo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQotLS0ga2Vybi9rZXJu
X2NwdXNldC5jCShyZXZpc2lvbiAzMzE2MDQpDQorKysga2Vybi9rZXJuX2Nw
dXNldC5jCSh3b3JraW5nIGNvcHkpDQpAQCAtMTM2Myw2ICsxMzYzLDcgQEAg
Y3B1c2V0X3RocmVhZDAodm9pZCkNCiB7DQogCXN0cnVjdCBjcHVzZXQgKnNl
dDsNCiAJaW50IGVycm9yOw0KKwlpbnQgaTsNCiANCiAJY3B1c2V0X3pvbmUg
PSB1bWFfemNyZWF0ZSgiY3B1c2V0Iiwgc2l6ZW9mKHN0cnVjdCBjcHVzZXQp
LCBOVUxMLCBOVUxMLA0KIAkgICAgTlVMTCwgTlVMTCwgVU1BX0FMSUdOX1BU
UiwgMCk7DQpAQCAtMTM3NCwxMSArMTM3NSwxMSBAQCBjcHVzZXRfdGhyZWFk
MCh2b2lkKQ0KIAkgKiBjcHVzZXRfY3JlYXRlKCkgZHVlIHRvIE5VTEwgcGFy
ZW50Lg0KIAkgKi8NCiAJc2V0ID0gdW1hX3phbGxvYyhjcHVzZXRfem9uZSwg
TV9XQUlUT0sgfCBNX1pFUk8pOw0KLQlDUFVfRklMTCgmc2V0LT5jc19tYXNr
KTsNCisJQ1BVX0NPUFkoJmFsbF9jcHVzLCAmc2V0LT5jc19tYXNrKTsNCiAJ
TElTVF9JTklUKCZzZXQtPmNzX2NoaWxkcmVuKTsNCiAJTElTVF9JTlNFUlRf
SEVBRCgmY3B1c2V0X2lkcywgc2V0LCBjc19saW5rKTsNCiAJc2V0LT5jc19y
ZWYgPSAxOw0KLQlzZXQtPmNzX2ZsYWdzID0gQ1BVX1NFVF9ST09UOw0KKwlz
ZXQtPmNzX2ZsYWdzID0gQ1BVX1NFVF9ST09UIHwgQ1BVX1NFVF9SRE9OTFk7
DQogCXNldC0+Y3NfZG9tYWluID0gJmRvbWFpbnNldDA7DQogCWNwdXNldF96
ZXJvID0gc2V0Ow0KIAljcHVzZXRfcm9vdCA9ICZzZXQtPmNzX21hc2s7DQpA
QCAtMTM5Niw2ICsxMzk3LDE2IEBAIGNwdXNldF90aHJlYWQwKHZvaWQpDQog
CSAqLw0KIAljcHVzZXRfdW5yID0gbmV3X3VucmhkcigyLCBJTlRfTUFYLCBO
VUxMKTsNCiANCisJLyoNCisJICogSWYgTUQgY29kZSBoYXMgbm90IGluaXRp
YWxpemVkIHBlci1kb21haW4gY3B1c2V0cywgcGxhY2UgYWxsDQorCSAqIENQ
VXMgaW4gZG9tYWluIDAuDQorCSAqLw0KKwlmb3IgKGkgPSAwOyBpIDwgTUFY
TUVNRE9NOyBpKyspDQorCQlpZiAoIUNQVV9FTVBUWSgmY3B1c2V0X2RvbWFp
bltpXSkpDQorCQkJZ290byBkb21haW5zX3NldDsNCisJQ1BVX0NPUFkoJmFs
bF9jcHVzLCAmY3B1c2V0X2RvbWFpblswXSk7DQorZG9tYWluc19zZXQ6DQor
DQogCXJldHVybiAoc2V0KTsNCiB9DQogDQpAQCAtMTQ0NywzNCArMTQ1OCw2
IEBAIGNwdXNldF9zZXRwcm9jX3VwZGF0ZV9zZXQoc3RydWN0IHByb2MgKnAs
IHN0cnVjdCBjDQogCXJldHVybiAoMCk7DQogfQ0KIA0KLS8qDQotICogVGhp
cyBpcyBjYWxsZWQgb25jZSB0aGUgZmluYWwgc2V0IG9mIHN5c3RlbSBjcHVz
IGlzIGtub3duLiAgTW9kaWZpZXMNCi0gKiB0aGUgcm9vdCBzZXQgYW5kIGFs
bCBjaGlsZHJlbiBhbmQgbWFyayB0aGUgcm9vdCByZWFkLW9ubHkuICANCi0g
Ki8NCi1zdGF0aWMgdm9pZA0KLWNwdXNldF9pbml0KHZvaWQgKmFyZykNCi17
DQotCWNwdXNldF90IG1hc2s7DQotCWludCBpOw0KLQ0KLQltYXNrID0gYWxs
X2NwdXM7DQotCWlmIChjcHVzZXRfbW9kaWZ5KGNwdXNldF96ZXJvLCAmbWFz
aykpDQotCQlwYW5pYygiQ2FuJ3Qgc2V0IGluaXRpYWwgY3B1c2V0IG1hc2su
XG4iKTsNCi0JY3B1c2V0X3plcm8tPmNzX2ZsYWdzIHw9IENQVV9TRVRfUkRP
TkxZOw0KLQ0KLQkvKg0KLQkgKiBJZiBNRCBjb2RlIGhhcyBub3QgaW5pdGlh
bGl6ZWQgcGVyLWRvbWFpbiBjcHVzZXRzLCBwbGFjZSBhbGwNCi0JICogQ1BV
cyBpbiBkb21haW4gMC4NCi0JICovDQotCWZvciAoaSA9IDA7IGkgPCBNQVhN
RU1ET007IGkrKykNCi0JCWlmICghQ1BVX0VNUFRZKCZjcHVzZXRfZG9tYWlu
W2ldKSkNCi0JCQlnb3RvIGRvbWFpbnNfc2V0Ow0KLQlDUFVfQ09QWSgmYWxs
X2NwdXMsICZjcHVzZXRfZG9tYWluWzBdKTsNCi1kb21haW5zX3NldDoNCi0J
cmV0dXJuOw0KLX0NCi1TWVNJTklUKGNwdXNldCwgU0lfU1VCX1NNUCwgU0lf
T1JERVJfQU5ZLCBjcHVzZXRfaW5pdCwgTlVMTCk7DQotDQogI2lmbmRlZiBf
U1lTX1NZU1BST1RPX0hfDQogc3RydWN0IGNwdXNldF9hcmdzIHsNCiAJY3B1
c2V0aWRfdAkqc2V0aWQ7DQpJbmRleDogeDg2L3g4Ni9pbnRyX21hY2hkZXAu
Yw0KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PQ0KLS0tIHg4Ni94ODYvaW50cl9t
YWNoZGVwLmMJKHJldmlzaW9uIDMzMTYxMCkNCisrKyB4ODYveDg2L2ludHJf
bWFjaGRlcC5jCSh3b3JraW5nIGNvcHkpDQpAQCAtNzEsNiArNzEsOCBAQA0K
ICNpbmNsdWRlIDxpc2EvaXNhcmVnLmg+DQogI2VuZGlmDQogDQorI2luY2x1
ZGUgPHZtL3ZtLmg+DQorDQogI2RlZmluZQlNQVhfU1RSQVlfTE9HCTUNCiAN
CiB0eXBlZGVmIHZvaWQgKCptYXNrX2ZuKSh2b2lkICopOw0KQEAgLTE4NSw3
ICsxODcsOCBAQCBpbnRyX2xvb2t1cF9zb3VyY2UoaW50IHZlY3RvcikNCiAN
CiBpbnQNCiBpbnRyX2FkZF9oYW5kbGVyKGNvbnN0IGNoYXIgKm5hbWUsIGlu
dCB2ZWN0b3IsIGRyaXZlcl9maWx0ZXJfdCBmaWx0ZXIsDQotICAgIGRyaXZl
cl9pbnRyX3QgaGFuZGxlciwgdm9pZCAqYXJnLCBlbnVtIGludHJfdHlwZSBm
bGFncywgdm9pZCAqKmNvb2tpZXApDQorICAgIGRyaXZlcl9pbnRyX3QgaGFu
ZGxlciwgdm9pZCAqYXJnLCBlbnVtIGludHJfdHlwZSBmbGFncywgdm9pZCAq
KmNvb2tpZXAsDQorICAgIGludCBkb21haW4pDQogew0KIAlzdHJ1Y3QgaW50
c3JjICppc3JjOw0KIAlpbnQgZXJyb3I7DQpAQCAtMjAwLDYgKzIwMyw3IEBA
IGludHJfYWRkX2hhbmRsZXIoY29uc3QgY2hhciAqbmFtZSwgaW50IHZlY3Rv
ciwgZHJpDQogCQlpbnRyY250X3VwZGF0ZW5hbWUoaXNyYyk7DQogCQlpc3Jj
LT5pc19oYW5kbGVycysrOw0KIAkJaWYgKGlzcmMtPmlzX2hhbmRsZXJzID09
IDEpIHsNCisJCQlpc3JjLT5pc19kb21haW4gPSBkb21haW47DQogCQkJaXNy
Yy0+aXNfcGljLT5waWNfZW5hYmxlX2ludHIoaXNyYyk7DQogCQkJaXNyYy0+
aXNfcGljLT5waWNfZW5hYmxlX3NvdXJjZShpc3JjKTsNCiAJCX0NCkBAIC01
MDcsMTQgKzUxMSwyNyBAQCBEQl9TSE9XX0NPTU1BTkQoaXJxcywgZGJfc2hv
d19pcnFzKQ0KICAqLw0KIA0KIGNwdXNldF90IGludHJfY3B1cyA9IENQVVNF
VF9UX0lOSVRJQUxJWkVSKDB4MSk7DQotc3RhdGljIGludCBjdXJyZW50X2Nw
dTsNCitzdGF0aWMgaW50IGN1cnJlbnRfY3B1W01BWE1FTURPTV07DQogDQor
c3RhdGljIHZvaWQNCitpbnRyX2luaXRfY3B1cyh2b2lkKQ0KK3sNCisJaW50
IGk7DQorDQorCWZvciAoaSA9IDA7IGkgPCB2bV9uZG9tYWluczsgaSsrKSB7
DQorCQljdXJyZW50X2NwdVtpXSA9IDA7DQorCQlpZiAoIUNQVV9JU1NFVChj
dXJyZW50X2NwdVtpXSwgJmludHJfY3B1cykgfHwNCisJCSAgICAhQ1BVX0lT
U0VUKGN1cnJlbnRfY3B1W2ldLCAmY3B1c2V0X2RvbWFpbltpXSkpDQorCQkJ
aW50cl9uZXh0X2NwdShpKTsNCisJfQ0KK30NCisNCiAvKg0KICAqIFJldHVy
biB0aGUgQ1BVIHRoYXQgdGhlIG5leHQgaW50ZXJydXB0IHNvdXJjZSBzaG91
bGQgdXNlLiAgRm9yIG5vdw0KICAqIHRoaXMganVzdCByZXR1cm5zIHRoZSBu
ZXh0IGxvY2FsIEFQSUMgYWNjb3JkaW5nIHRvIHJvdW5kLXJvYmluLg0KICAq
Lw0KIHVfaW50DQotaW50cl9uZXh0X2NwdSh2b2lkKQ0KK2ludHJfbmV4dF9j
cHUoaW50IGRvbWFpbikNCiB7DQogCXVfaW50IGFwaWNfaWQ7DQogDQpAQCAt
NTI5LDEyICs1NDYsMTMgQEAgdV9pbnQNCiAjZW5kaWYNCiANCiAJbXR4X2xv
Y2tfc3BpbigmaWN1X2xvY2spOw0KLQlhcGljX2lkID0gY3B1X2FwaWNfaWRz
W2N1cnJlbnRfY3B1XTsNCisJYXBpY19pZCA9IGNwdV9hcGljX2lkc1tjdXJy
ZW50X2NwdVtkb21haW5dXTsNCiAJZG8gew0KLQkJY3VycmVudF9jcHUrKzsN
Ci0JCWlmIChjdXJyZW50X2NwdSA+IG1wX21heGlkKQ0KLQkJCWN1cnJlbnRf
Y3B1ID0gMDsNCi0JfSB3aGlsZSAoIUNQVV9JU1NFVChjdXJyZW50X2NwdSwg
JmludHJfY3B1cykpOw0KKwkJY3VycmVudF9jcHVbZG9tYWluXSsrOw0KKwkJ
aWYgKGN1cnJlbnRfY3B1W2RvbWFpbl0gPiBtcF9tYXhpZCkNCisJCQljdXJy
ZW50X2NwdVtkb21haW5dID0gMDsNCisJfSB3aGlsZSAoIUNQVV9JU1NFVChj
dXJyZW50X2NwdVtkb21haW5dLCAmaW50cl9jcHVzKSB8fA0KKwkgICAgIUNQ
VV9JU1NFVChjdXJyZW50X2NwdVtkb21haW5dLCAmY3B1c2V0X2RvbWFpbltk
b21haW5dKSk7DQogCW10eF91bmxvY2tfc3BpbigmaWN1X2xvY2spOw0KIAly
ZXR1cm4gKGFwaWNfaWQpOw0KIH0NCkBAIC01NjgsNyArNTg2LDE4IEBAIGlu
dHJfYWRkX2NwdSh1X2ludCBjcHUpDQogCUNQVV9TRVQoY3B1LCAmaW50cl9j
cHVzKTsNCiB9DQogDQotI2lmbmRlZiBFQVJMWV9BUF9TVEFSVFVQDQorI2lm
ZGVmIEVBUkxZX0FQX1NUQVJUVVANCitzdGF0aWMgdm9pZA0KK2ludHJfc21w
X3N0YXJ0dXAodm9pZCAqYXJnIF9fdW51c2VkKQ0KK3sNCisNCisJaW50cl9p
bml0X2NwdXMoKTsNCisJcmV0dXJuOw0KK30NCitTWVNJTklUKGludHJfc21w
X3N0YXJ0dXAsIFNJX1NVQl9TTVAsIFNJX09SREVSX1NFQ09ORCwgaW50cl9z
bXBfc3RhcnR1cCwNCisgICAgTlVMTCk7DQorDQorI2Vsc2UNCiAvKg0KICAq
IERpc3RyaWJ1dGUgYWxsIHRoZSBpbnRlcnJ1cHQgc291cmNlcyBhbW9uZyB0
aGUgYXZhaWxhYmxlIENQVXMgb25jZSB0aGUNCiAgKiBBUCdzIGhhdmUgYmVl
biBsYXVuY2hlZC4NCkBAIC01ODAsNiArNjA5LDcgQEAgaW50cl9zaHVmZmxl
X2lycXModm9pZCAqYXJnIF9fdW51c2VkKQ0KIAl1X2ludCBjcHU7DQogCWlu
dCBpOw0KIA0KKwlpbnRyX2luaXRfY3B1cygpOw0KIAkvKiBEb24ndCBib3Ro
ZXIgb24gVVAuICovDQogCWlmIChtcF9uY3B1cyA9PSAxKQ0KIAkJcmV0dXJu
Ow0KQEAgLTU5OSwxMiArNjI5LDEyIEBAIGludHJfc2h1ZmZsZV9pcnFzKHZv
aWQgKmFyZyBfX3VudXNlZCkNCiAJCQkgKi8NCiAJCQljcHUgPSBpc3JjLT5p
c19ldmVudC0+aWVfY3B1Ow0KIAkJCWlmIChjcHUgPT0gTk9DUFUpDQotCQkJ
CWNwdSA9IGN1cnJlbnRfY3B1Ow0KKwkJCQljcHUgPSBjdXJyZW50X2NwdVtp
c3JjLT5pc19kb21haW5dOw0KIAkJCWlmIChpc3JjLT5pc19waWMtPnBpY19h
c3NpZ25fY3B1KGlzcmMsDQogCQkJICAgIGNwdV9hcGljX2lkc1tjcHVdKSA9
PSAwKSB7DQogCQkJCWlzcmMtPmlzX2NwdSA9IGNwdTsNCiAJCQkJaWYgKGlz
cmMtPmlzX2V2ZW50LT5pZV9jcHUgPT0gTk9DUFUpDQotCQkJCQlpbnRyX25l
eHRfY3B1KCk7DQorCQkJCQlpbnRyX25leHRfY3B1KGlzcmMtPmlzX2RvbWFp
bik7DQogCQkJfQ0KIAkJfQ0KIAl9DQpAQCAtNjM1LDEwICs2NjUsMTEgQEAg
c3lzY3RsX2h3X2ludHJzKFNZU0NUTF9IQU5ETEVSX0FSR1MpDQogCQlpc3Jj
ID0gaW50ZXJydXB0X3NvdXJjZXNbaV07DQogCQlpZiAoaXNyYyA9PSBOVUxM
KQ0KIAkJCWNvbnRpbnVlOw0KLQkJc2J1Zl9wcmludGYoJnNidWYsICIlczol
ZCBAJWQ6ICVsZFxuIiwNCisJCXNidWZfcHJpbnRmKCZzYnVmLCAiJXM6JWQg
QGNwdSVkKGRvbWFpbiVkKTogJWxkXG4iLA0KIAkJICAgIGlzcmMtPmlzX2V2
ZW50LT5pZV9mdWxsbmFtZSwNCiAJCSAgICBpc3JjLT5pc19pbmRleCwNCiAJ
CSAgICBpc3JjLT5pc19jcHUsDQorCQkgICAgaXNyYy0+aXNfZG9tYWluLA0K
IAkJICAgICppc3JjLT5pc19jb3VudCk7DQogCX0NCiANCkBAIC02OTcsNyAr
NzI4LDcgQEAgaW50cl9iYWxhbmNlKHZvaWQgKmR1bW15IF9fdW51c2VkLCBp
bnQgcGVuZGluZyBfX3UNCiAJICogUmVzdGFydCB0aGUgc2NhbiBmcm9tIHRo
ZSBzYW1lIGxvY2F0aW9uIHRvIGF2b2lkIG1vdmluZyBpbiB0aGUNCiAJICog
Y29tbW9uIGNhc2UuDQogCSAqLw0KLQljdXJyZW50X2NwdSA9IDA7DQorCWlu
dHJfaW5pdF9jcHVzKCk7DQogDQogCS8qDQogCSAqIEFzc2lnbiByb3VuZC1y
b2JpbiBmcm9tIG1vc3QgbG9hZGVkIHRvIGxlYXN0Lg0KQEAgLTcwNiw4ICs3
MzcsOCBAQCBpbnRyX2JhbGFuY2Uodm9pZCAqZHVtbXkgX191bnVzZWQsIGlu
dCBwZW5kaW5nIF9fdQ0KIAkJaXNyYyA9IGludGVycnVwdF9zb3J0ZWRbaV07
DQogCQlpZiAoaXNyYyA9PSBOVUxMICB8fCBpc3JjLT5pc19ldmVudC0+aWVf
Y3B1ICE9IE5PQ1BVKQ0KIAkJCWNvbnRpbnVlOw0KLQkJY3B1ID0gY3VycmVu
dF9jcHU7DQotCQlpbnRyX25leHRfY3B1KCk7DQorCQljcHUgPSBjdXJyZW50
X2NwdVtpc3JjLT5pc19kb21haW5dOw0KKwkJaW50cl9uZXh0X2NwdShpc3Jj
LT5pc19kb21haW4pOw0KIAkJaWYgKGlzcmMtPmlzX2NwdSAhPSBjcHUgJiYN
CiAJCSAgICBpc3JjLT5pc19waWMtPnBpY19hc3NpZ25fY3B1KGlzcmMsDQog
CQkgICAgY3B1X2FwaWNfaWRzW2NwdV0pID09IDApDQpAQCAtNzM1LDcgKzc2
Niw3IEBAIFNZU0lOSVQoaW50cl9iYWxhbmNlX2luaXQsIFNJX1NVQl9TTVAs
IFNJX09SREVSX0FODQogICogQWx3YXlzIHJvdXRlIGludGVycnVwdHMgdG8g
dGhlIGN1cnJlbnQgcHJvY2Vzc29yIGluIHRoZSBVUCBjYXNlLg0KICAqLw0K
IHVfaW50DQotaW50cl9uZXh0X2NwdSh2b2lkKQ0KK2ludHJfbmV4dF9jcHUo
aW50IGRvbWFpbikNCiB7DQogDQogCXJldHVybiAoUENQVV9HRVQoYXBpY19p
ZCkpOw0KSW5kZXg6IHg4Ni94ODYvaW9fYXBpYy5jDQo9PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09DQotLS0geDg2L3g4Ni9pb19hcGljLmMJKHJldmlzaW9uIDMz
MTYxMCkNCisrKyB4ODYveDg2L2lvX2FwaWMuYwkod29ya2luZyBjb3B5KQ0K
QEAgLTQ5OSw3ICs0OTksNyBAQCBpb2FwaWNfZW5hYmxlX2ludHIoc3RydWN0
IGludHNyYyAqaXNyYykNCiAJc3RydWN0IGlvYXBpY19pbnRzcmMgKmludHBp
biA9IChzdHJ1Y3QgaW9hcGljX2ludHNyYyAqKWlzcmM7DQogDQogCWlmIChp
bnRwaW4tPmlvX3ZlY3RvciA9PSAwKQ0KLQkJaWYgKGlvYXBpY19hc3NpZ25f
Y3B1KGlzcmMsIGludHJfbmV4dF9jcHUoKSkgIT0gMCkNCisJCWlmIChpb2Fw
aWNfYXNzaWduX2NwdShpc3JjLCBpbnRyX25leHRfY3B1KGlzcmMtPmlzX2Rv
bWFpbikpICE9IDApDQogCQkJcGFuaWMoIkNvdWxkbid0IGZpbmQgYW4gQVBJ
QyB2ZWN0b3IgZm9yIElSUSAlZCIsDQogCQkJICAgIGludHBpbi0+aW9faXJx
KTsNCiAJYXBpY19lbmFibGVfdmVjdG9yKGludHBpbi0+aW9fY3B1LCBpbnRw
aW4tPmlvX3ZlY3Rvcik7DQpJbmRleDogeDg2L3g4Ni9tc2kuYw0KPT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PQ0KLS0tIHg4Ni94ODYvbXNpLmMJKHJldmlzaW9u
IDMzMTYxMCkNCisrKyB4ODYveDg2L21zaS5jCSh3b3JraW5nIGNvcHkpDQpA
QCAtMzYzLDcgKzM2Myw3IEBAIGludA0KIG1zaV9hbGxvYyhkZXZpY2VfdCBk
ZXYsIGludCBjb3VudCwgaW50IG1heGNvdW50LCBpbnQgKmlycXMpDQogew0K
IAlzdHJ1Y3QgbXNpX2ludHNyYyAqbXNpLCAqZnNyYzsNCi0JdV9pbnQgY3B1
Ow0KKwl1X2ludCBjcHUsIGRvbWFpbjsNCiAJaW50IGNudCwgaSwgKm1pcnFz
LCB2ZWN0b3I7DQogI2lmZGVmIEFDUElfRE1BUg0KIAl1X2ludCBjb29raWVz
W2NvdW50XTsNCkBAIC0zNzMsNiArMzczLDkgQEAgbXNpX2FsbG9jKGRldmlj
ZV90IGRldiwgaW50IGNvdW50LCBpbnQgbWF4Y291bnQsIGkNCiAJaWYgKCFt
c2lfZW5hYmxlZCkNCiAJCXJldHVybiAoRU5YSU8pOw0KIA0KKwlpZiAoYnVz
X2dldF9kb21haW4oZGV2LCAmZG9tYWluKSAhPSAwKQ0KKwkJZG9tYWluID0g
MDsNCisNCiAJaWYgKGNvdW50ID4gMSkNCiAJCW1pcnFzID0gbWFsbG9jKGNv
dW50ICogc2l6ZW9mKCptaXJxcyksIE1fTVNJLCBNX1dBSVRPSyk7DQogCWVs
c2UNCkBAIC00MjAsNyArNDIzLDcgQEAgYWdhaW46DQogCUtBU1NFUlQoY250
ID09IGNvdW50LCAoImNvdW50IG1pc21hdGNoIikpOw0KIA0KIAkvKiBBbGxv
Y2F0ZSAnY291bnQnIElEVCB2ZWN0b3JzLiAqLw0KLQljcHUgPSBpbnRyX25l
eHRfY3B1KCk7DQorCWNwdSA9IGludHJfbmV4dF9jcHUoZG9tYWluKTsNCiAJ
dmVjdG9yID0gYXBpY19hbGxvY192ZWN0b3JzKGNwdSwgaXJxcywgY291bnQs
IG1heGNvdW50KTsNCiAJaWYgKHZlY3RvciA9PSAwKSB7DQogCQltdHhfdW5s
b2NrKCZtc2lfbG9jayk7DQpAQCAtNjEwLDcgKzYxMyw3IEBAIGludA0KIG1z
aXhfYWxsb2MoZGV2aWNlX3QgZGV2LCBpbnQgKmlycSkNCiB7DQogCXN0cnVj
dCBtc2lfaW50c3JjICptc2k7DQotCXVfaW50IGNwdTsNCisJdV9pbnQgY3B1
LCBkb21haW47DQogCWludCBpLCB2ZWN0b3I7DQogI2lmZGVmIEFDUElfRE1B
Ug0KIAl1X2ludCBjb29raWU7DQpAQCAtNjIwLDYgKzYyMyw5IEBAIG1zaXhf
YWxsb2MoZGV2aWNlX3QgZGV2LCBpbnQgKmlycSkNCiAJaWYgKCFtc2lfZW5h
YmxlZCkNCiAJCXJldHVybiAoRU5YSU8pOw0KIA0KKwlpZiAoYnVzX2dldF9k
b21haW4oZGV2LCAmZG9tYWluKSAhPSAwKQ0KKwkJZG9tYWluID0gMDsNCisN
CiBhZ2FpbjoNCiAJbXR4X2xvY2soJm1zaV9sb2NrKTsNCiANCkBAIC02NTEs
NyArNjU3LDcgQEAgYWdhaW46DQogCX0NCiANCiAJLyogQWxsb2NhdGUgYW4g
SURUIHZlY3Rvci4gKi8NCi0JY3B1ID0gaW50cl9uZXh0X2NwdSgpOw0KKwlj
cHUgPSBpbnRyX25leHRfY3B1KGRvbWFpbik7DQogCXZlY3RvciA9IGFwaWNf
YWxsb2NfdmVjdG9yKGNwdSwgaSk7DQogCWlmICh2ZWN0b3IgPT0gMCkgew0K
IAkJbXR4X3VubG9jaygmbXNpX2xvY2spOw0KSW5kZXg6IHg4Ni94ODYvbmV4
dXMuYw0KPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PQ0KLS0tIHg4Ni94ODYvbmV4
dXMuYwkocmV2aXNpb24gMzMxNjEwKQ0KKysrIHg4Ni94ODYvbmV4dXMuYwko
d29ya2luZyBjb3B5KQ0KQEAgLTU3Myw3ICs1NzMsNyBAQCBuZXh1c19zZXR1
cF9pbnRyKGRldmljZV90IGJ1cywgZGV2aWNlX3QgY2hpbGQsIHN0cg0KIAkJ
IGludCBmbGFncywgZHJpdmVyX2ZpbHRlcl90IGZpbHRlciwgdm9pZCAoKmlo
YW5kKSh2b2lkICopLA0KIAkJIHZvaWQgKmFyZywgdm9pZCAqKmNvb2tpZXAp
DQogew0KLQlpbnQJCWVycm9yOw0KKwlpbnQJCWVycm9yLCBkb21haW47DQog
DQogCS8qIHNvbWVib2R5IHRyaWVkIHRvIHNldHVwIGFuIGlycSB0aGF0IGZh
aWxlZCB0byBhbGxvY2F0ZSEgKi8NCiAJaWYgKGlycSA9PSBOVUxMKQ0KQEAg
LTU4OSw5ICs1ODksMTEgQEAgbmV4dXNfc2V0dXBfaW50cihkZXZpY2VfdCBi
dXMsIGRldmljZV90IGNoaWxkLCBzdHINCiAJZXJyb3IgPSBybWFuX2FjdGl2
YXRlX3Jlc291cmNlKGlycSk7DQogCWlmIChlcnJvcikNCiAJCXJldHVybiAo
ZXJyb3IpOw0KKwlpZiAoYnVzX2dldF9kb21haW4oY2hpbGQsICZkb21haW4p
ICE9IDApDQorCQlkb21haW4gPSAwOw0KIA0KIAllcnJvciA9IGludHJfYWRk
X2hhbmRsZXIoZGV2aWNlX2dldF9uYW1ldW5pdChjaGlsZCksDQotCSAgICBy
bWFuX2dldF9zdGFydChpcnEpLCBmaWx0ZXIsIGloYW5kLCBhcmcsIGZsYWdz
LCBjb29raWVwKTsNCisJICAgIHJtYW5fZ2V0X3N0YXJ0KGlycSksIGZpbHRl
ciwgaWhhbmQsIGFyZywgZmxhZ3MsIGNvb2tpZXAsIGRvbWFpbik7DQogDQog
CXJldHVybiAoZXJyb3IpOw0KIH0NCkluZGV4OiB4ODYveGVuL3hlbl9pbnRy
LmMNCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT0NCi0tLSB4ODYveGVuL3hlbl9p
bnRyLmMJKHJldmlzaW9uIDMzMTYxMCkNCisrKyB4ODYveGVuL3hlbl9pbnRy
LmMJKHdvcmtpbmcgY29weSkNCkBAIC00MzAsNyArNDMwLDcgQEAgeGVuX2lu
dHJfYmluZF9pc3JjKHN0cnVjdCB4ZW5pc3JjICoqaXNyY3AsIGV2dGNobl8N
CiAJCSAqIHVubGVzcyBzcGVjaWZpZWQgb3RoZXJ3aXNlLCBzbyBzaHVmZmxl
IHRoZW0gdG8gYmFsYW5jZQ0KIAkJICogdGhlIGludGVycnVwdCBsb2FkLg0K
IAkJICovDQotCQl4ZW5faW50cl9hc3NpZ25fY3B1KCZpc3JjLT54aV9pbnRz
cmMsIGludHJfbmV4dF9jcHUoKSk7DQorCQl4ZW5faW50cl9hc3NpZ25fY3B1
KCZpc3JjLT54aV9pbnRzcmMsIGludHJfbmV4dF9jcHUoMCkpOw0KIAl9DQog
I2VuZGlmDQogDQpAQCAtMTU2Miw3ICsxNTYyLDcgQEAgeGVuX2ludHJfYWRk
X2hhbmRsZXIoY29uc3QgY2hhciAqbmFtZSwgZHJpdmVyX2ZpbHQNCiAJCXJl
dHVybiAoRUlOVkFMKTsNCiANCiAJZXJyb3IgPSBpbnRyX2FkZF9oYW5kbGVy
KG5hbWUsIGlzcmMtPnhpX3ZlY3RvcixmaWx0ZXIsIGhhbmRsZXIsIGFyZywN
Ci0JICAgIGZsYWdzfElOVFJfRVhDTCwgJmlzcmMtPnhpX2Nvb2tpZSk7DQor
CSAgICBmbGFnc3xJTlRSX0VYQ0wsICZpc3JjLT54aV9jb29raWUsIDApOw0K
IAlpZiAoZXJyb3IgIT0gMCkgew0KIAkJcHJpbnRmKA0KIAkJICAgICIlczog
eGVuX2ludHJfYWRkX2hhbmRsZXI6IGludHJfYWRkX2hhbmRsZXIgZmFpbGVk
OiAlZFxuIiwNCg==

--2547152148-430465068-1522184844=:2307--

From owner-svn-src-head@freebsd.org  Tue Mar 27 21:14:40 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF81DF5D12F;
 Tue, 27 Mar 2018 21:14:39 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 6CDC082113;
 Tue, 27 Mar 2018 21:14:39 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67E9C21827;
 Tue, 27 Mar 2018 21:14:39 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RLEdTS079060;
 Tue, 27 Mar 2018 21:14:39 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RLEd5p079059;
 Tue, 27 Mar 2018 21:14:39 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803272114.w2RLEd5p079059@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Tue, 27 Mar 2018 21:14:39 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331654 - head/sys/dev/nxge
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: head/sys/dev/nxge
X-SVN-Commit-Revision: 331654
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 21:14:40 -0000

Author: brooks
Date: Tue Mar 27 21:14:39 2018
New Revision: 331654
URL: https://svnweb.freebsd.org/changeset/base/331654

Log:
  Don't access userspace directly from the kernel in nxge(4).
  
  Update to what the previous code seemed to be doing via the correct
  interfaces.  Further issues exist in xge_ioctl_registers(), but this is
  debugging code in a driver that has few users and they don't appear to
  be crashes or leaks.
  
  Reviewed by:	jhb (prior version)
  MFC after:	1 week
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14848

Modified:
  head/sys/dev/nxge/if_nxge.c

Modified: head/sys/dev/nxge/if_nxge.c
==============================================================================
--- head/sys/dev/nxge/if_nxge.c	Tue Mar 27 21:06:18 2018	(r331653)
+++ head/sys/dev/nxge/if_nxge.c	Tue Mar 27 21:14:39 2018	(r331654)
@@ -1364,11 +1364,15 @@ int
 xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifreqp)
 {
 	xge_hal_status_e status = XGE_HAL_OK;
-	char *data = (char *)ifreqp->ifr_data;
+	char cmd, mode;
 	void *info = NULL;
 	int retValue = EINVAL;
 
-	switch(*data) {
+	cmd = fubyte(ifreqp->ifr_data);
+	if (cmd == -1)
+		return (EFAULT);
+
+	switch(cmd) {
 	    case XGE_QUERY_STATS:
 	        mtx_lock(&lldev->mtx_drv);
 	        status = xge_hal_stats_hw(lldev->devh,
@@ -1496,8 +1500,8 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre
 	    case XGE_SET_BUFFER_MODE_1:
 	    case XGE_SET_BUFFER_MODE_2:
 	    case XGE_SET_BUFFER_MODE_5:
-	        *data = (*data == XGE_SET_BUFFER_MODE_1) ? 'Y':'N';
-	        if(copyout(data, ifreqp->ifr_data, sizeof(data)) == 0)
+	        mode = (cmd == XGE_SET_BUFFER_MODE_1) ? 'Y':'N';
+	        if(copyout(&mode, ifreqp->ifr_data, sizeof(mode)) == 0)
 	            retValue = 0;
 	        break;
 	    default:
@@ -1518,10 +1522,17 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre
 int
 xge_ioctl_registers(xge_lldev_t *lldev, struct ifreq *ifreqp)
 {
-	xge_register_t *data = (xge_register_t *)ifreqp->ifr_data;
+	xge_register_t tmpdata;
+	xge_register_t *data;
 	xge_hal_status_e status = XGE_HAL_OK;
 	int retValue = EINVAL, offset = 0, index = 0;
+	int error;
 	u64 val64 = 0;
+
+	error = copyin(ifreqp->ifr_data, &tmpdata, sizeof(tmpdata));
+	if (error != 0)
+		return (error);
+	data = &tmpdata;
 
 	/* Reading a register */
 	if(strcmp(data->option, "-r") == 0) {

From owner-svn-src-head@freebsd.org  Tue Mar 27 22:49:06 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE7F8F66D1D;
 Tue, 27 Mar 2018 22:49:06 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 8184D8743B;
 Tue, 27 Mar 2018 22:49:06 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7C1B8226CC;
 Tue, 27 Mar 2018 22:49:06 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2RMn66R025748;
 Tue, 27 Mar 2018 22:49:06 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2RMn6ET025747;
 Tue, 27 Mar 2018 22:49:06 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201803272249.w2RMn6ET025747@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: Conrad Meyer 
Date: Tue, 27 Mar 2018 22:49:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331656 - head/cddl/contrib/opensolaris/tools/ctf/cvt
X-SVN-Group: head
X-SVN-Commit-Author: cem
X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/tools/ctf/cvt
X-SVN-Commit-Revision: 331656
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Tue, 27 Mar 2018 22:49:07 -0000

Author: cem
Date: Tue Mar 27 22:49:06 2018
New Revision: 331656
URL: https://svnweb.freebsd.org/changeset/base/331656

Log:
  ctfconvert: Fix minor memory leaks in STABS parser
  
  In an error case, free leaked objects.  Does anything use STABS anymore?
  Probably not.
  
  Reported by:	Coverity
  Sponsored by:	Dell EMC Isilon

Modified:
  head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c

Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c
==============================================================================
--- head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c	Tue Mar 27 21:37:58 2018	(r331655)
+++ head/cddl/contrib/opensolaris/tools/ctf/cvt/st_parse.c	Tue Mar 27 22:49:06 2018	(r331656)
@@ -229,8 +229,12 @@ parse_fun(char *cp, iidesc_t *ii)
 		nargs++;
 		if (nargs > FUNCARG_DEF)
 			args = xrealloc(args, sizeof (tdesc_t *) * nargs);
-		if (!(cp = read_tid(cp, &args[nargs - 1])))
+		if (!(cp = read_tid(cp, &args[nargs - 1]))) {
+			if (tdp->t_type == TYPEDEF_UNRES)
+				free(tdp);
+			free(args);
 			return (-1);
+		}
 	}
 
 	ii->ii_type = iitype;

From owner-svn-src-head@freebsd.org  Wed Mar 28 03:07:03 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EE5FF52BD2;
 Wed, 28 Mar 2018 03:07:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 31E2471283;
 Wed, 28 Mar 2018 03:07:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C59B25181;
 Wed, 28 Mar 2018 03:07:03 +0000 (UTC) (envelope-from mjg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2S373Gk055056;
 Wed, 28 Mar 2018 03:07:03 GMT (envelope-from mjg@FreeBSD.org)
Received: (from mjg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2S373EP055055;
 Wed, 28 Mar 2018 03:07:03 GMT (envelope-from mjg@FreeBSD.org)
Message-Id: <201803280307.w2S373EP055055@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org
 using -f
From: Mateusz Guzik 
Date: Wed, 28 Mar 2018 03:07:03 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331657 - head/sys/kern
X-SVN-Group: head
X-SVN-Commit-Author: mjg
X-SVN-Commit-Paths: head/sys/kern
X-SVN-Commit-Revision: 331657
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 03:07:03 -0000

Author: mjg
Date: Wed Mar 28 03:07:02 2018
New Revision: 331657
URL: https://svnweb.freebsd.org/changeset/base/331657

Log:
  fd: tighten seq protected areas to not contain malloc/free

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Tue Mar 27 22:49:06 2018	(r331656)
+++ head/sys/kern/kern_descrip.c	Wed Mar 28 03:07:02 2018	(r331657)
@@ -111,6 +111,11 @@ static void	fdgrowtable_exp(struct filedesc *fdp, int 
 static void	fdunused(struct filedesc *fdp, int fd);
 static void	fdused(struct filedesc *fdp, int fd);
 static int	getmaxfd(struct thread *td);
+static u_long	*filecaps_copy_prep(const struct filecaps *src);
+static void	filecaps_copy_finish(const struct filecaps *src,
+		    struct filecaps *dst, u_long *ioctls);
+static u_long 	*filecaps_free_prep(struct filecaps *fcaps);
+static void	filecaps_free_finish(u_long *ioctls);
 
 /*
  * Each process has:
@@ -302,12 +307,12 @@ fdfree(struct filedesc *fdp, int fd)
 #ifdef CAPABILITIES
 	seq_write_begin(&fde->fde_seq);
 #endif
-	fdefree_last(fde);
 	fde->fde_file = NULL;
-	fdunused(fdp, fd);
 #ifdef CAPABILITIES
 	seq_write_end(&fde->fde_seq);
 #endif
+	fdefree_last(fde);
+	fdunused(fdp, fd);
 }
 
 void
@@ -813,6 +818,7 @@ kern_dup(struct thread *td, u_int mode, int flags, int
 	struct filedescent *oldfde, *newfde;
 	struct proc *p;
 	struct file *delfp;
+	u_long *oioctls, *nioctls;
 	int error, maxfd;
 
 	p = td->td_proc;
@@ -902,15 +908,18 @@ kern_dup(struct thread *td, u_int mode, int flags, int
 	newfde = &fdp->fd_ofiles[new];
 	delfp = newfde->fde_file;
 
+	oioctls = filecaps_free_prep(&newfde->fde_caps);
+	nioctls = filecaps_copy_prep(&oldfde->fde_caps);
+
 	/*
 	 * Duplicate the source descriptor.
 	 */
 #ifdef CAPABILITIES
 	seq_write_begin(&newfde->fde_seq);
 #endif
-	filecaps_free(&newfde->fde_caps);
 	memcpy(newfde, oldfde, fde_change_size);
-	filecaps_copy(&oldfde->fde_caps, &newfde->fde_caps, true);
+	filecaps_copy_finish(&oldfde->fde_caps, &newfde->fde_caps,
+	    nioctls);
 	if ((flags & FDDUP_FLAG_CLOEXEC) != 0)
 		newfde->fde_flags = oldfde->fde_flags | UF_EXCLOSE;
 	else
@@ -918,6 +927,7 @@ kern_dup(struct thread *td, u_int mode, int flags, int
 #ifdef CAPABILITIES
 	seq_write_end(&newfde->fde_seq);
 #endif
+	filecaps_free_finish(oioctls);
 	td->td_retval[0] = new;
 
 	error = 0;
@@ -1503,6 +1513,40 @@ filecaps_copy(const struct filecaps *src, struct filec
 	return (0);
 }
 
+static u_long *
+filecaps_copy_prep(const struct filecaps *src)
+{
+	u_long *ioctls;
+	size_t size;
+
+	if (src->fc_ioctls == NULL)
+		return (NULL);
+
+	KASSERT(src->fc_nioctls > 0,
+	    ("fc_ioctls != NULL, but fc_nioctls=%hd", src->fc_nioctls));
+
+	size = sizeof(src->fc_ioctls[0]) * src->fc_nioctls;
+	ioctls = malloc(size, M_FILECAPS, M_WAITOK);
+	return (ioctls);
+}
+
+static void
+filecaps_copy_finish(const struct filecaps *src, struct filecaps *dst,
+    u_long *ioctls)
+{
+	size_t size;
+
+	*dst = *src;
+	if (src->fc_ioctls == NULL) {
+		MPASS(ioctls == NULL);
+		return;
+	}
+
+	size = sizeof(src->fc_ioctls[0]) * src->fc_nioctls;
+	dst->fc_ioctls = ioctls;
+	bcopy(src->fc_ioctls, dst->fc_ioctls, size);
+}
+
 /*
  * Move filecaps structure to the new place and clear the old place.
  */
@@ -1538,6 +1582,23 @@ filecaps_free(struct filecaps *fcaps)
 	bzero(fcaps, sizeof(*fcaps));
 }
 
+static u_long *
+filecaps_free_prep(struct filecaps *fcaps)
+{
+	u_long *ioctls;
+
+	ioctls = fcaps->fc_ioctls;
+	bzero(fcaps, sizeof(*fcaps));
+	return (ioctls);
+}
+
+static void
+filecaps_free_finish(u_long *ioctls)
+{
+
+	free(ioctls, M_FILECAPS);
+}
+
 /*
  * Validate the given filecaps structure.
  */
@@ -2963,6 +3024,7 @@ dupfdopen(struct thread *td, struct filedesc *fdp, int
 {
 	struct filedescent *newfde, *oldfde;
 	struct file *fp;
+	u_long *ioctls;
 	int error, indx;
 
 	KASSERT(openerror == ENODEV || openerror == ENXIO,
@@ -3007,11 +3069,13 @@ dupfdopen(struct thread *td, struct filedesc *fdp, int
 		fhold(fp);
 		newfde = &fdp->fd_ofiles[indx];
 		oldfde = &fdp->fd_ofiles[dfd];
+		ioctls = filecaps_copy_prep(&oldfde->fde_caps);
 #ifdef CAPABILITIES
 		seq_write_begin(&newfde->fde_seq);
 #endif
 		memcpy(newfde, oldfde, fde_change_size);
-		filecaps_copy(&oldfde->fde_caps, &newfde->fde_caps, true);
+		filecaps_copy_finish(&oldfde->fde_caps, &newfde->fde_caps,
+		    ioctls);
 #ifdef CAPABILITIES
 		seq_write_end(&newfde->fde_seq);
 #endif

From owner-svn-src-head@freebsd.org  Wed Mar 28 03:11:51 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A555F5340E;
 Wed, 28 Mar 2018 03:11:51 +0000 (UTC)
 (envelope-from jhibbits@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id AD802717A3;
 Wed, 28 Mar 2018 03:11:50 +0000 (UTC)
 (envelope-from jhibbits@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A85D1252E0;
 Wed, 28 Mar 2018 03:11:50 +0000 (UTC)
 (envelope-from jhibbits@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2S3BoIg059364;
 Wed, 28 Mar 2018 03:11:50 GMT (envelope-from jhibbits@FreeBSD.org)
Received: (from jhibbits@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2S3Bohm059363;
 Wed, 28 Mar 2018 03:11:50 GMT (envelope-from jhibbits@FreeBSD.org)
Message-Id: <201803280311.w2S3Bohm059363@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to
 jhibbits@FreeBSD.org using -f
From: Justin Hibbits 
Date: Wed, 28 Mar 2018 03:11:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331658 - head/sys/conf
X-SVN-Group: head
X-SVN-Commit-Author: jhibbits
X-SVN-Commit-Paths: head/sys/conf
X-SVN-Commit-Revision: 331658
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 03:11:51 -0000

Author: jhibbits
Date: Wed Mar 28 03:11:50 2018
New Revision: 331658
URL: https://svnweb.freebsd.org/changeset/base/331658

Log:
  Fix another optional standard.  Build openpic_ofw again.

Modified:
  head/sys/conf/files.powerpc

Modified: head/sys/conf/files.powerpc
==============================================================================
--- head/sys/conf/files.powerpc	Wed Mar 28 03:07:02 2018	(r331657)
+++ head/sys/conf/files.powerpc	Wed Mar 28 03:11:50 2018	(r331658)
@@ -158,7 +158,7 @@ powerpc/ofw/ofw_real.c		optional	aim
 powerpc/ofw/ofw_syscons.c	optional	sc aim
 powerpc/ofw/ofwcall32.S		optional	aim powerpc
 powerpc/ofw/ofwcall64.S		optional	aim powerpc64
-powerpc/ofw/openpic_ofw.c	optional	standard
+powerpc/ofw/openpic_ofw.c	standard
 powerpc/ofw/rtas.c		optional	aim
 powerpc/powermac/ata_kauai.c	optional	powermac ata | powermac atamacio
 powerpc/powermac/ata_macio.c	optional	powermac ata | powermac atamacio

From owner-svn-src-head@freebsd.org  Wed Mar 28 03:15:43 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6C1DF537C3;
 Wed, 28 Mar 2018 03:15:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 5603071A3D;
 Wed, 28 Mar 2018 03:15:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50B8225317;
 Wed, 28 Mar 2018 03:15:43 +0000 (UTC) (envelope-from mjg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2S3Fhim060309;
 Wed, 28 Mar 2018 03:15:43 GMT (envelope-from mjg@FreeBSD.org)
Received: (from mjg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2S3FhNU060308;
 Wed, 28 Mar 2018 03:15:43 GMT (envelope-from mjg@FreeBSD.org)
Message-Id: <201803280315.w2S3FhNU060308@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org
 using -f
From: Mateusz Guzik 
Date: Wed, 28 Mar 2018 03:15:43 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331659 - head/sys/sys
X-SVN-Group: head
X-SVN-Commit-Author: mjg
X-SVN-Commit-Paths: head/sys/sys
X-SVN-Commit-Revision: 331659
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 03:15:43 -0000

Author: mjg
Date: Wed Mar 28 03:15:42 2018
New Revision: 331659
URL: https://svnweb.freebsd.org/changeset/base/331659

Log:
  seq: disable preemption around seq_write_*
  
  This is a long standing performance bug which happened to not cause trouble
  in practice due to rather limited use of these primitives.
  
  The read side expects the writer to finish soon(tm) hence it loops with one
  pause in-between. But it is possible the writer gets preempted in which case
  the waiting can take a long time, especially so if it got preempted by the
  reader. In principle this may never clean itself up.
  
  In the current kernel seq is only used to obtain stable fp + capabilities
  state. In order for looping at least once to occur there has to be a
  concurrent writer modifying the fd slot for the very fd we are trying to
  read. That is, for any looping to occur in the first place the program has
  to be multithreaded and be doing something fishy to begin with. As such,
  the indefinite looping is rather hard to run into unless you really try
  (and I did not).

Modified:
  head/sys/sys/seq.h

Modified: head/sys/sys/seq.h
==============================================================================
--- head/sys/sys/seq.h	Wed Mar 28 03:11:50 2018	(r331658)
+++ head/sys/sys/seq.h	Wed Mar 28 03:15:42 2018	(r331659)
@@ -79,6 +79,7 @@ static __inline void
 seq_write_begin(seq_t *seqp)
 {
 
+	critical_enter();
 	MPASS(!seq_in_modify(*seqp));
 	*seqp += 1;
 	atomic_thread_fence_rel();
@@ -90,6 +91,7 @@ seq_write_end(seq_t *seqp)
 
 	atomic_store_rel_int(seqp, *seqp + 1);
 	MPASS(!seq_in_modify(*seqp));
+	critical_exit();
 }
 
 static __inline seq_t

From owner-svn-src-head@freebsd.org  Wed Mar 28 04:38:46 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44D2AF5AA22;
 Wed, 28 Mar 2018 04:38:46 +0000 (UTC) (envelope-from mjg@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E5CB67472F;
 Wed, 28 Mar 2018 04:38:45 +0000 (UTC) (envelope-from mjg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB26626007;
 Wed, 28 Mar 2018 04:38:45 +0000 (UTC) (envelope-from mjg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2S4cjMU000656;
 Wed, 28 Mar 2018 04:38:45 GMT (envelope-from mjg@FreeBSD.org)
Received: (from mjg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2S4cjRE000655;
 Wed, 28 Mar 2018 04:38:45 GMT (envelope-from mjg@FreeBSD.org)
Message-Id: <201803280438.w2S4cjRE000655@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org
 using -f
From: Mateusz Guzik 
Date: Wed, 28 Mar 2018 04:38:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331660 - head/sys/sys
X-SVN-Group: head
X-SVN-Commit-Author: mjg
X-SVN-Commit-Paths: head/sys/sys
X-SVN-Commit-Revision: 331660
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 04:38:46 -0000

Author: mjg
Date: Wed Mar 28 04:38:45 2018
New Revision: 331660
URL: https://svnweb.freebsd.org/changeset/base/331660

Log:
  seq: provide a comment explaining what seq is for and note 2 caveats

Modified:
  head/sys/sys/seq.h

Modified: head/sys/sys/seq.h
==============================================================================
--- head/sys/sys/seq.h	Wed Mar 28 03:15:42 2018	(r331659)
+++ head/sys/sys/seq.h	Wed Mar 28 04:38:45 2018	(r331660)
@@ -41,26 +41,52 @@ typedef uint32_t seq_t;
 #ifdef _KERNEL
 
 /*
- * Typical usage:
+ * seq allows readers and writers to work with a consistent snapshot. Modifying
+ * operations must be enclosed within a transaction delineated by
+ * seq_write_beg/seq_write_end. The trick works by having the writer increment
+ * the sequence number twice, at the beginning and end of the transaction.
+ * The reader detects that the sequence number has not changed between its start
+ * and end, and that the sequence number is even, to validate consistency.
  *
+ * Some fencing (both hard fencing and compiler barriers) may be needed,
+ * depending on the cpu. Modern AMD cpus provide strong enough guarantees to not
+ * require any fencing by the reader or writer.
+ *
+ * Example usage:
+ *
  * writers:
- * 	lock_exclusive(&obj->lock);
- * 	seq_write_begin(&obj->seq);
- * 	.....
- * 	seq_write_end(&obj->seq);
- * 	unlock_exclusive(&obj->unlock);
+ *     lock_exclusive(&obj->lock);
+ *     seq_write_begin(&obj->seq);
+ *     obj->var1 = ...;
+ *     obj->var2 = ...;
+ *     seq_write_end(&obj->seq);
+ *     unlock_exclusive(&obj->lock);
  *
  * readers:
- * 	obj_t lobj;
- * 	seq_t seq;
+ *    int var1, var2;
+ *    seq_t seq;
  *
- * 	for (;;) {
- * 		seq = seq_read(&gobj->seq);
- * 		lobj = gobj;
- * 		if (seq_consistent(&gobj->seq, seq))
- * 			break;
- * 	}
- * 	foo(lobj);
+ *    for (;;) {
+ *    	      seq = seq_read(&obj->seq);
+ *            var1 = obj->var1;
+ *            var2 = obj->var2;
+ *            if (seq_consistent(&obj->seq, seq))
+ *                   break;
+ *    }
+ *    .....
+ *
+ * Writers may not block or sleep in any way.
+ *
+ * There are 2 minor caveats in this implementation:
+ *
+ * 1. There is no guarantee of progress. That is, a large number of writers can
+ * interfere with the execution of the readers and cause the code to live-lock
+ * in a loop trying to acquire a consistent snapshot.
+ *
+ * 2. If the reader loops long enough, the counter may overflow and eventually
+ * wrap back to its initial value, fooling the reader into accepting the
+ * snapshot.  Given that this needs 4 billion transactional writes across a
+ * single contended reader, it is unlikely to ever happen.
  */		
 
 /* A hack to get MPASS macro */

From owner-svn-src-head@freebsd.org  Wed Mar 28 04:44:53 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27BA4F5B125;
 Wed, 28 Mar 2018 04:44:53 +0000 (UTC)
 (envelope-from o.hartmann@walstatt.org)
Received: from mout.gmx.net (mout.gmx.net [212.227.17.21])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 8D90C74C38;
 Wed, 28 Mar 2018 04:44:52 +0000 (UTC)
 (envelope-from o.hartmann@walstatt.org)
Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by
 mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id
 0Meutp-1fBoRn0qdN-00OYBh; Wed, 28 Mar 2018 06:44:50 +0200
Date: Wed, 28 Mar 2018 06:44:43 +0200
From: "O. Hartmann" 
To: John Baldwin 
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r331650 - in head/sys: amd64/amd64 amd64/ia32
 amd64/linux amd64/linux32 cddl/contrib/opensolaris/uts/intel/dtrace
 cddl/dev/dtrace/amd64 cddl/dev/dtrace/i386 i386/i386 i386/linux x86/inc...
Message-ID: <20180328064443.6201fd35@freyja.zeit4.iv.bundesimmobilien.de>
In-Reply-To: <201803272057.w2RKvpRO068828@repo.freebsd.org>
References: <201803272057.w2RKvpRO068828@repo.freebsd.org>
Organization: Walstatt
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:RnYJw85xozy1amZgowHcfekgeAaX4xQK4Ud9iX8AORY0mTZq1yy
 ApiBrR8j0Esl+Khq7QYHKNXsF7zMNvn0/ZWhqeVw08cPshuP3LiSNpfmDyMclbddL3DahtV
 0qinCFekXjc4MmWWvOiykfdt4PRei4BHYw4qxyWkV+daOfBk0UhCSR0Ubgx5m/apdL5t0fk
 3e2BxSmGWTJnjaUAv0iBg==
X-UI-Out-Filterresults: notjunk:1;V01:K0:BlBF6sPbH54=:OXbB6lv1jgNpbfE9V5iIG1
 Hej1QMljeuouu1W1dpd41k41DWvfm8z0Bx4QV0ExAFP/l8335kijVNe3yxJ8TahWTTIqgbmRy
 0wv0/3S6pdhoTIt+0S642O53+f9lamE1EVyGD3jN3TJdr6AYcXaOE53KEmc/YBdHWk8eoJ/Wi
 Yp2Tj/il2cqk2co1O3MIFc4PrCm6I6yKiuvdYCMuFqABodkD4hDAqrK32L/dZDG6uNCxVRCka
 gWB3wdVPIS7IR/rK4FgNAV8m6Yb5WsAhpJjakHlwsGsLzrx7u4fqJJj83QsldHOkdFioeTvj9
 o4rsEW+hkbTkOos/vVSd4fcBp29l/Q6b+OTht91yLyN77AgE0S6nSmrdgx9bA4a7fFBK3X+DB
 b6Z0c7fOGf+4XE9MbqzuBJ8C0qYjVucSKK9oNMlL6b8+RsCl0ptNhw1U9i0I6zDSBIIEeKo2e
 Qabo7iK5pn9wtBdWq43ASqsSkW57sDV41DLPkFR0Bi08aRB7Lw5GKObKkXAlyzVs+H+ACrfUL
 gJgWUkAimeDxdzE+rf2JvEc2eFI+f0DbgX+QKZhuiNwWc5mKGnOTKl0IKErrOklJAsa+l4277
 l19w7zlqNO3kOFD1BYkO1X1vMYZboQFjnFmD7TV4ue4Zum9fF6bP49GfSduCbup+ST02DmJWO
 JoITFSL4n2UZsovvD6qTctJdVs9e01iPIQpX3JeaB6HKfwr6S1qPeDT9UuTIE+kxlGD/jlARo
 gXPalrAIbdUVz8g7VeGLbuU/6xnUfZyacYGBX3I/Nv1Boyd+tj/ikhIOfm6NcaioOBfVnnWmG
 RT16yGjkY9YNw9fB6tZvO5PogSon52ipXjdl19lc6QzvEWMvE4=
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 04:44:53 -0000

On Tue, 27 Mar 2018 20:57:51 +0000 (UTC)
John Baldwin  wrote:

> Author: jhb
> Date: Tue Mar 27 20:57:51 2018
> New Revision: 331650
> URL: https://svnweb.freebsd.org/changeset/base/331650
> 
> Log:
>   Remove very old and unused signal information codes.
>   
>   These have been supplanted by the MI signal information codes in
>    since 7.0.  The FPE_*_TRAP ones were deprecated even
>   earlier in 1999.
>   
>   PR:		226579 (exp-run)
>   Reviewed by:	kib
>   Differential Revision:	https://reviews.freebsd.org/D14637
> 
> Modified:
>   head/sys/amd64/amd64/trap.c
>   head/sys/amd64/ia32/ia32_signal.c
>   head/sys/amd64/linux/linux_sysvec.c
>   head/sys/amd64/linux32/linux32_sysvec.c
>   head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
>   head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
>   head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
>   head/sys/i386/i386/trap.c
>   head/sys/i386/linux/linux_sysvec.c
>   head/sys/x86/include/signal.h
>   head/sys/x86/include/trap.h
> 
> Modified: head/sys/amd64/amd64/trap.c
> ==============================================================================
> --- head/sys/amd64/amd64/trap.c	Tue Mar 27 20:54:57 2018
> (r331649) +++ head/sys/amd64/amd64/trap.c	Tue Mar 27 20:57:51
> 2018	(r331650) @@ -95,6 +95,7 @@ PMC_SOFT_DEFINE( , , page_fault,
> write); #include 
>  #endif
>  #include 
> +#include 
>  #include 
>  
>  #ifdef KDTRACE_HOOKS
> @@ -338,14 +339,14 @@ trap(struct trapframe *frame)
>  					ucode = SEGV_ACCERR;
>  				} else {
>  					signo = SIGBUS;
> -					ucode = BUS_PAGE_FAULT;
> +					ucode = T_PAGEFLT;
>  				}
>  			} else if (prot_fault_translation == 1) {
>  				/*
>  				 * Always compat mode.
>  				 */
>  				signo = SIGBUS;
> -				ucode = BUS_PAGE_FAULT;
> +				ucode = T_PAGEFLT;
>  			} else {
>  				/*
>  				 * Always SIGSEGV mode.
> 
> Modified: head/sys/amd64/ia32/ia32_signal.c
> ==============================================================================
> --- head/sys/amd64/ia32/ia32_signal.c	Tue Mar 27 20:54:57 2018
> (r331649) +++ head/sys/amd64/ia32/ia32_signal.c	Tue Mar 27 20:57:51
> 2018	(r331650) @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #ifdef COMPAT_FREEBSD4
>  static void freebsd4_ia32_sendsig(sig_t, ksiginfo_t *, sigset_t *);
> 
> Modified: head/sys/amd64/linux/linux_sysvec.c
> ==============================================================================
> --- head/sys/amd64/linux/linux_sysvec.c	Tue Mar 27 20:54:57
> 2018	(r331649) +++ head/sys/amd64/linux/linux_sysvec.c	Tue Mar
> 27 20:57:51 2018	(r331650) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include 
>  #include 
> 
> Modified: head/sys/amd64/linux32/linux32_sysvec.c
> ==============================================================================
> --- head/sys/amd64/linux32/linux32_sysvec.c	Tue Mar 27 20:54:57
> 2018	(r331649) +++ head/sys/amd64/linux32/linux32_sysvec.c	Tue
> Mar 27 20:57:51 2018	(r331650) @@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include 
>  #include 
> 
> Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
> ==============================================================================
> --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
> Tue Mar 27 20:54:57 2018	(r331649) +++
> head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c	Tue
> Mar 27 20:57:51 2018	(r331650) @@ -52,6 +52,7 @@ #include
>  #include 
>  #include 
> +#include 
>  #endif
>  #include 
>  #ifdef illumos
> 
> Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
> ==============================================================================
> --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Tue Mar 27 20:54:57
> 2018	(r331649) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
> Tue Mar 27 20:57:51 2018	(r331650) @@ -44,6 +44,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  
>  extern void dtrace_getnanotime(struct timespec *tsp);
> 
> Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
> ==============================================================================
> --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Tue Mar 27 20:54:57
> 2018	(r331649) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
> Tue Mar 27 20:57:51 2018	(r331650) @@ -45,6 +45,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
>  
>  extern uintptr_t 	kernelbase;
> 
> Modified: head/sys/i386/i386/trap.c
> ==============================================================================
> --- head/sys/i386/i386/trap.c	Tue Mar 27 20:54:57 2018	(r331649)
> +++ head/sys/i386/i386/trap.c	Tue Mar 27 20:57:51 2018	(r331650)
> @@ -97,6 +97,7 @@ PMC_SOFT_DEFINE( , , page_fault, write);
>  #include 
>  #endif
>  #include 
> +#include 
>  #include 
>  #include 
>  
> @@ -416,14 +417,14 @@ user_trctrap_out:
>  					ucode = SEGV_ACCERR;
>  				} else {
>  					signo = SIGBUS;
> -					ucode = BUS_PAGE_FAULT;
> +					ucode = T_PAGEFLT;
>  				}
>  			} else if (prot_fault_translation == 1) {
>  				/*
>  				 * Always compat mode.
>  				 */
>  				signo = SIGBUS;
> -				ucode = BUS_PAGE_FAULT;
> +				ucode = T_PAGEFLT;
>  			} else {
>  				/*
>  				 * Always SIGSEGV mode.
> 
> Modified: head/sys/i386/linux/linux_sysvec.c
> ==============================================================================
> --- head/sys/i386/linux/linux_sysvec.c	Tue Mar 27 20:54:57 2018
> (r331649) +++ head/sys/i386/linux/linux_sysvec.c	Tue Mar 27 20:57:51
> 2018	(r331650) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
>  
>  #include 
>  #include 
> 
> Modified: head/sys/x86/include/signal.h
> ==============================================================================
> --- head/sys/x86/include/signal.h	Tue Mar 27 20:54:57 2018
> (r331649) +++ head/sys/x86/include/signal.h	Tue Mar 27 20:57:51
> 2018	(r331650) @@ -43,10 +43,6 @@
>  #include 
>  #include 
>  
> -#if __BSD_VISIBLE
> -#include 	/* codes for SIGILL, SIGFPE */
> -#endif
> -
>  #ifdef __i386__
>  typedef int sig_atomic_t;
>  
> 
> Modified: head/sys/x86/include/trap.h
> ==============================================================================
> --- head/sys/x86/include/trap.h	Tue Mar 27 20:54:57 2018
> (r331649) +++ head/sys/x86/include/trap.h	Tue Mar 27 20:57:51
> 2018	(r331650) @@ -66,30 +66,6 @@
>  #define	T_RESERVED	30	/* reserved (unknown) */
>  #define	T_DTRACE_RET	32	/* DTrace pid return */
>  
> -/* XXX most of the following codes aren't used, but could be. */
> -
> -/* definitions for  */
> -#define	    ILL_RESAD_FAULT	T_RESADFLT
> -#define	    ILL_PRIVIN_FAULT	T_PRIVINFLT
> -#define	    ILL_RESOP_FAULT	T_RESOPFLT
> -#define	    ILL_ALIGN_FAULT	T_ALIGNFLT
> -#define	    ILL_FPOP_FAULT	T_FPOPFLT	/* coprocessor
> operand fault */ -
> -/* old FreeBSD macros, deprecated */
> -#define	FPE_INTOVF_TRAP	0x1	/* integer overflow */
> -#define	FPE_INTDIV_TRAP	0x2	/* integer divide by zero */
> -#define	FPE_FLTDIV_TRAP	0x3	/* floating/decimal divide
> by zero */ -#define	FPE_FLTOVF_TRAP	0x4	/* floating
> overflow */ -#define	FPE_FLTUND_TRAP	0x5	/* floating
> underflow */ -#define	FPE_FPU_NP_TRAP	0x6	/* floating
> point unit not present  */ -#define	FPE_SUBRNG_TRAP
> 0x7	/* subrange out of bounds */ -
> -/* codes for SIGBUS */
> -#define	    BUS_PAGE_FAULT	T_PAGEFLT	/* page fault
> protection base */ -#define	    BUS_SEGNP_FAULT
> T_SEGNPFLT	/* segment not present */ -#define
> BUS_STK_FAULT	T_STKFLT	/* stack segment */ -#define
> BUS_SEGM_FAULT	T_RESERVED	/* segment protection base */ -
>  /* Trap's coming from user mode */
>  #define	T_USER	0x100
>  
> _______________________________________________
> svn-src-head@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"


make buildkernel fails now with the error:

[...]
--- machdep.o ---
/usr/src/sys/amd64/amd64/machdep.c:520:20: error: use of undeclared identifier
'T_PROTFLT' ksi.ksi_trapno = T_PROTFLT;
                                 ^
--- modules-all ---
[...]

From owner-svn-src-head@freebsd.org  Wed Mar 28 05:21:03 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E486F5D5A0;
 Wed, 28 Mar 2018 05:21:03 +0000 (UTC)
 (envelope-from cy.schubert@cschubert.com)
Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "Client", Issuer "CA" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id 9320275D72;
 Wed, 28 Mar 2018 05:21:02 +0000 (UTC)
 (envelope-from cy.schubert@cschubert.com)
Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA
 id 13VzfoGwIYxCT13W1fKIfN; Tue, 27 Mar 2018 23:20:54 -0600
X-Authority-Analysis: v=2.3 cv=cav8UELM c=1 sm=1 tr=0
 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17
 a=v2DPQv5-lfwA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=_RjAawW3LSUfK_qug2oA:9
 a=iEftzS5lTzf907dh:21 a=Xk4QBb-rx3vUO4Uu:21 a=UM1k_8dLX-k8ut9f:21
 a=CjuIK1q_8ugA:10 a=ObycXa6Y4eVlmf85thwA:9 a=lq-CBCgAEkoObFiM:21
 a=Rs5RPl2N3c-OZ47p:21 a=WQy7hhfgomKDNVS9:21 a=_W_S_7VecoQA:10
 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22
Received: from [10.196.232.159] (unknown [24.244.29.166])
 by spqr.komquats.com (Postfix) with ESMTPSA id 8B3CD143;
 Tue, 27 Mar 2018 22:20:50 -0700 (PDT)
MIME-Version: 1.0
From: Cy Schubert 
Subject: RE: svn commit: r331650 - in head/sys: amd64/amd64
 amd64/ia32amd64/linux amd64/linux32
 cddl/contrib/opensolaris/uts/intel/dtracecddl/dev/dtrace/amd64
 cddl/dev/dtrace/i386 i386/i386 i386/linux x86/inc...
Date: Tue, 27 Mar 2018 23:20:53 -0600
To: "O. Hartmann" , John Baldwin 
CC: "src-committers@freebsd.org" , 
 "svn-src-all@freebsd.org" , 
 "svn-src-head@freebsd.org" 
Message-Id: <20180328052050.8B3CD143@spqr.komquats.com>
X-CMAE-Envelope: MS4wfMbSnLmornqtuovjUO06nbr8dgLl9hxJANwsSj/AkWO40PNBo4XRpYeMggo6zigOYWy8FqUILq7MGCK6qo3/oldTvPDLT+BaiPKgcnEksw4fDrQC+VdL
 d2Q3bOM9voxC60vvarm/VXTJ64aZVoXLhXRW33IJbnhBAPbIIW+kHl6lrkx9K2R7qTzgMJLCPlI+4EJfm66BT2vc4rZrgBArfqpoR65gG0GAQttPpjahKEc+
 R6xjtMFg0SmHAvDBv6apulYAzSXULpeJETTUIs8J/YWIHMBRK9TivGjuU20u6/vgglY6NniV4uqgvKicFsbkCUOCiwHH7pbVPI+9IQBZClY=
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
X-Content-Filtered-By: Mailman/MimeDel 2.1.25
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 05:21:03 -0000

Have you disabled DDB in your kernel config?

---
Sent using a tiny phone keyboard.
Apologies for any typos and autocorrect.
Also, this old phone only supports top post. Apologies.

Cy Schubert
 or 
The need of the many outweighs the greed of the few.
---

-----Original Message-----
From: O. Hartmann
Sent: 27/03/2018 22:45
To: John Baldwin
Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb=
sd.org
Subject: Re: svn commit: r331650 - in head/sys: amd64/amd64 amd64/ia32amd64=
/linux amd64/linux32 cddl/contrib/opensolaris/uts/intel/dtracecddl/dev/dtra=
ce/amd64 cddl/dev/dtrace/i386 i386/i386 i386/linux x86/inc...

On Tue, 27 Mar 2018 20:57:51 +0000 (UTC)
John Baldwin  wrote:

> Author: jhb
> Date: Tue Mar 27 20:57:51 2018
> New Revision: 331650
> URL: https://svnweb.freebsd.org/changeset/base/331650
>=20
> Log:
>   Remove very old and unused signal information codes.
>  =20
>   These have been supplanted by the MI signal information codes in
>    since 7.0.  The FPE_*_TRAP ones were deprecated even
>   earlier in 1999.
>  =20
>   PR:		226579 (exp-run)
>   Reviewed by:	kib
>   Differential Revision:	https://reviews.freebsd.org/D14637
>=20
> Modified:
>   head/sys/amd64/amd64/trap.c
>   head/sys/amd64/ia32/ia32_signal.c
>   head/sys/amd64/linux/linux_sysvec.c
>   head/sys/amd64/linux32/linux32_sysvec.c
>   head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
>   head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
>   head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
>   head/sys/i386/i386/trap.c
>   head/sys/i386/linux/linux_sysvec.c
>   head/sys/x86/include/signal.h
>   head/sys/x86/include/trap.h
>=20
> Modified: head/sys/amd64/amd64/trap.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/amd64/amd64/trap.c	Tue Mar 27 20:54:57 2018
> (r331649) +++ head/sys/amd64/amd64/trap.c	Tue Mar 27 20:57:51
> 2018	(r331650) @@ -95,6 +95,7 @@ PMC_SOFT_DEFINE( , , page_fault,
> write); #include 
>  #endif
>  #include 
> +#include 
>  #include 
> =20
>  #ifdef KDTRACE_HOOKS
> @@ -338,14 +339,14 @@ trap(struct trapframe *frame)
>  					ucode =3D SEGV_ACCERR;
>  				} else {
>  					signo =3D SIGBUS;
> -					ucode =3D BUS_PAGE_FAULT;
> +					ucode =3D T_PAGEFLT;
>  				}
>  			} else if (prot_fault_translation =3D=3D 1) {
>  				/*
>  				 * Always compat mode.
>  				 */
>  				signo =3D SIGBUS;
> -				ucode =3D BUS_PAGE_FAULT;
> +				ucode =3D T_PAGEFLT;
>  			} else {
>  				/*
>  				 * Always SIGSEGV mode.
>=20
> Modified: head/sys/amd64/ia32/ia32_signal.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/amd64/ia32/ia32_signal.c	Tue Mar 27 20:54:57 2018
> (r331649) +++ head/sys/amd64/ia32/ia32_signal.c	Tue Mar 27 20:57:51
> 2018	(r331650) @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
> =20
>  #ifdef COMPAT_FREEBSD4
>  static void freebsd4_ia32_sendsig(sig_t, ksiginfo_t *, sigset_t *);
>=20
> Modified: head/sys/amd64/linux/linux_sysvec.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/amd64/linux/linux_sysvec.c	Tue Mar 27 20:54:57
> 2018	(r331649) +++ head/sys/amd64/linux/linux_sysvec.c	Tue Mar
> 27 20:57:51 2018	(r331650) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
> =20
>  #include 
>  #include 
>=20
> Modified: head/sys/amd64/linux32/linux32_sysvec.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/amd64/linux32/linux32_sysvec.c	Tue Mar 27 20:54:57
> 2018	(r331649) +++ head/sys/amd64/linux32/linux32_sysvec.c	Tue
> Mar 27 20:57:51 2018	(r331650) @@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
> =20
>  #include 
>  #include 
>=20
> Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa=
.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
> Tue Mar 27 20:54:57 2018	(r331649) +++
> head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c	Tue
> Mar 27 20:57:51 2018	(r331650) @@ -52,6 +52,7 @@ #include
>  #include 
>  #include 
> +#include 
>  #endif
>  #include 
>  #ifdef illumos
>=20
> Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Tue Mar 27 20:54:57
> 2018	(r331649) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
> Tue Mar 27 20:57:51 2018	(r331650) @@ -44,6 +44,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
> =20
>  extern void dtrace_getnanotime(struct timespec *tsp);
>=20
> Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Tue Mar 27 20:54:57
> 2018	(r331649) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
> Tue Mar 27 20:57:51 2018	(r331650) @@ -45,6 +45,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>  #include 
> =20
>  extern uintptr_t 	kernelbase;
>=20
> Modified: head/sys/i386/i386/trap.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/i386/i386/trap.c	Tue Mar 27 20:54:57 2018	(r331649)
> +++ head/sys/i386/i386/trap.c	Tue Mar 27 20:57:51 2018	(r331650)
> @@ -97,6 +97,7 @@ PMC_SOFT_DEFINE( , , page_fault, write);
>  #include 
>  #endif
>  #include 
> +#include 
>  #include 
>  #include 
> =20
> @@ -416,14 +417,14 @@ user_trctrap_out:
>  					ucode =3D SEGV_ACCERR;
>  				} else {
>  					signo =3D SIGBUS;
> -					ucode =3D BUS_PAGE_FAULT;
> +					ucode =3D T_PAGEFLT;
>  				}
>  			} else if (prot_fault_translation =3D=3D 1) {
>  				/*
>  				 * Always compat mode.
>  				 */
>  				signo =3D SIGBUS;
> -				ucode =3D BUS_PAGE_FAULT;
> +				ucode =3D T_PAGEFLT;
>  			} else {
>  				/*
>  				 * Always SIGSEGV mode.
>=20
> Modified: head/sys/i386/linux/linux_sysvec.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/i386/linux/linux_sysvec.c	Tue Mar 27 20:54:57 2018
> (r331649) +++ head/sys/i386/linux/linux_sysvec.c	Tue Mar 27 20:57:51
> 2018	(r331650) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$");
>  #include 
>  #include 
>  #include 
> +#include 
> =20
>  #include 
>  #include 
>=20
> Modified: head/sys/x86/include/signal.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/x86/include/signal.h	Tue Mar 27 20:54:57 2018
> (r331649) +++ head/sys/x86/include/signal.h	Tue Mar 27 20:57:51
> 2018	(r331650) @@ -43,10 +43,6 @@
>  #include 
>  #include 
> =20
> -#if __BSD_VISIBLE
> -#include 	/* codes for SIGILL, SIGFPE */
> -#endif
> -
>  #ifdef __i386__
>  typedef int sig_atomic_t;
> =20
>=20
> Modified: head/sys/x86/include/trap.h
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/x86/include/trap.h	Tue Mar 27 20:54:57 2018
> (r331649) +++ head/sys/x86/include/trap.h	Tue Mar 27 20:57:51
> 2018	(r331650) @@ -66,30 +66,6 @@
>  #define	T_RESERVED	30	/* reserved (unknown) */
>  #define	T_DTRACE_RET	32	/* DTrace pid return */
> =20
> -/* XXX most of the following codes aren't used, but could be. */
> -
> -/* definitions for  */
> -#define	    ILL_RESAD_FAULT	T_RESADFLT
> -#define	    ILL_PRIVIN_FAULT	T_PRIVINFLT
> -#define	    ILL_RESOP_FAULT	T_RESOPFLT
> -#define	    ILL_ALIGN_FAULT	T_ALIGNFLT
> -#define	    ILL_FPOP_FAULT	T_FPOPFLT	/* coprocessor
> operand fault */ -
> -/* old FreeBSD macros, deprecated */
> -#define	FPE_INTOVF_TRAP	0x1	/* integer overflow */
> -#define	FPE_INTDIV_TRAP	0x2	/* integer divide by zero */
> -#define	FPE_FLTDIV_TRAP	0x3	/* floating/decimal divide
> by zero */ -#define	FPE_FLTOVF_TRAP	0x4	/* floating
> overflow */ -#define	FPE_FLTUND_TRAP	0x5	/* floating
> underflow */ -#define	FPE_FPU_NP_TRAP	0x6	/* floating
> point unit not present  */ -#define	FPE_SUBRNG_TRAP
> 0x7	/* subrange out of bounds */ -
> -/* codes for SIGBUS */
> -#define	    BUS_PAGE_FAULT	T_PAGEFLT	/* page fault
> protection base */ -#define	    BUS_SEGNP_FAULT
> T_SEGNPFLT	/* segment not present */ -#define
> BUS_STK_FAULT	T_STKFLT	/* stack segment */ -#define
> BUS_SEGM_FAULT	T_RESERVED	/* segment protection base */ -
>  /* Trap's coming from user mode */
>  #define	T_USER	0x100
> =20
> _______________________________________________
> svn-src-head@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-head
> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"


make buildkernel fails now with the error:

[...]
--- machdep.o ---
/usr/src/sys/amd64/amd64/machdep.c:520:20: error: use of undeclared identif=
ier
'T_PROTFLT' ksi.ksi_trapno =3D T_PROTFLT;
                                 ^
--- modules-all ---
[...]


From owner-svn-src-head@freebsd.org  Wed Mar 28 05:23:35 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04AE7F5D97E;
 Wed, 28 Mar 2018 05:23:35 +0000 (UTC)
 (envelope-from o.hartmann@walstatt.org)
Received: from mout.gmx.net (mout.gmx.net [212.227.15.15])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 621AA76049;
 Wed, 28 Mar 2018 05:23:34 +0000 (UTC)
 (envelope-from o.hartmann@walstatt.org)
Received: from freyja.zeit4.iv.bundesimmobilien.de ([87.138.105.249]) by
 mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id
 0LfkUs-1eC2I63lnu-00pOqV; Wed, 28 Mar 2018 07:23:29 +0200
Date: Wed, 28 Mar 2018 07:23:27 +0200
From: "O. Hartmann" 
To: Cy Schubert 
Cc: John Baldwin , "src-committers@freebsd.org"
 , "svn-src-all@freebsd.org"
 , "svn-src-head@freebsd.org"
 
Subject: Re: svn commit: r331650 - in head/sys: amd64/amd64
 amd64/ia32amd64/linux amd64/linux32
 cddl/contrib/opensolaris/uts/intel/dtracecddl/dev/dtrace/amd64
 cddl/dev/dtrace/i386 i386/i386 i386/linux x86/inc...
Message-ID: <20180328072327.4f45e3f0@freyja.zeit4.iv.bundesimmobilien.de>
In-Reply-To: <20180328052050.8B3CD143@spqr.komquats.com>
References: <20180328052050.8B3CD143@spqr.komquats.com>
Organization: Walstatt
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:v+hIgretdB14uCv9QqZNSe+cf+Ul/VyXi5UAfApKHKaSw2oYwg3
 gJGyfKoSCqnd6AxO+Qe+9WFdHdg08mYyF4VXAXRy17sxLfVZQkBCpMW/sFhNdvOdggDU/Hj
 Of+zsb1Ta2PVLbik2wY9JmRjkeHrK1Jmfz8NdTkw2EfZhgAcmfV/npHzA3FNm2Ueq+yORab
 u9zHnG0VIHz6efmlnSnRg==
X-UI-Out-Filterresults: notjunk:1;V01:K0:b6bOu4X9rJA=:gCebtTkujwoDKdzm5+VJUT
 11DMbBxwSJJtAjZYGbx6zbMdAH9RXntCPV83Rzqv/RjwPC0mu8sV4ZqCDPJxxPMmK8uWZKTov
 Y10ZzrFA1Sa3u6CI0gOpxA5IpsLatwMVH9DgZlSBtZFy+qLGMVCbw/qx8w8SwUlZOcHUDnS00
 S/OG0dlGRUUHedXwaqeCzMo2YPu8HryO5LjVc3pNnIeuTNxD6Nf4SuB0STxri6bFfwjIXXZns
 OpSQQj2lORkN3Ntv7ai8BUVi2yRGF/zwYUK3jHYsFvYyP4W4QI+YhE4v1cNcpM2bVPw5nYIgB
 nKKOGGBUAg8xWEELTrTGnyfl6WAlSafmJW5H+uumXlfHZi3DliznZS2gWqAUUUcxlf0Dakdxa
 rDeADOG2oagUD7Z4t8H0uXkcwNjWXfX7IFXiAHU0/XwF8obVFyecOO+KRBEOJGCk//0BNQYEN
 R8EdaMOvQKjQNi9sWz7FqKehIAfvTiPoRndRXHPXZhIuGZmR78AAGuSfk5Odmfwyz/tb3ty5e
 JspchLzqdIiE6Cmni52rteMaLO+44vpbSZ0qxylL0PDY2zxHUmJtQKfAA9rij6Ac8I8ova3og
 LtospVM9g/M4FmPOM72PAt60npXUJzYiOAVetCSiPxEHRiDrZ2hL3t7rrJ/5ESfiBCmhbKfrS
 G8vpWV93ezPpvE8am/u3zQZIbij38gXcK/rRUZaWUT08LlCKVuCfJ7XK1kw2fI4h4gK5rJbmx
 9Fl3vaPI0cFbkqydNrs9rT8OwNTuxcDIX9At/OjRqs4u35jiqEdEd2gKcmzlSoGBJy/S/p1WL
 h1PSlmudzGvgyxWVfZ8G3FeAq9SYPFmsuOgDCRRITG+YVuXclA=
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 05:23:35 -0000

On Tue, 27 Mar 2018 23:20:53 -0600
Cy Schubert  wrote:

> Have you disabled DDB in your kernel config?

I have. No debugger.

> 
> ---
> Sent using a tiny phone keyboard.
> Apologies for any typos and autocorrect.
> Also, this old phone only supports top post. Apologies.
> 
> Cy Schubert
>  or 
> The need of the many outweighs the greed of the few.
> ---
> 
> -----Original Message-----
> From: O. Hartmann
> Sent: 27/03/2018 22:45
> To: John Baldwin
> Cc: src-committers@freebsd.org; svn-src-all@freebsd.org;
> svn-src-head@freebsd.org Subject: Re: svn commit: r331650 - in head/sys:
> amd64/amd64 amd64/ia32amd64/linux amd64/linux32
> cddl/contrib/opensolaris/uts/intel/dtracecddl/dev/dtrace/amd64
> cddl/dev/dtrace/i386 i386/i386 i386/linux x86/inc...
> 
> On Tue, 27 Mar 2018 20:57:51 +0000 (UTC)
> John Baldwin  wrote:
> 
> > Author: jhb
> > Date: Tue Mar 27 20:57:51 2018
> > New Revision: 331650
> > URL: https://svnweb.freebsd.org/changeset/base/331650
> > 
> > Log:
> >   Remove very old and unused signal information codes.
> >   
> >   These have been supplanted by the MI signal information codes in
> >    since 7.0.  The FPE_*_TRAP ones were deprecated even
> >   earlier in 1999.
> >   
> >   PR:		226579 (exp-run)
> >   Reviewed by:	kib
> >   Differential Revision:	https://reviews.freebsd.org/D14637
> > 
> > Modified:
> >   head/sys/amd64/amd64/trap.c
> >   head/sys/amd64/ia32/ia32_signal.c
> >   head/sys/amd64/linux/linux_sysvec.c
> >   head/sys/amd64/linux32/linux32_sysvec.c
> >   head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
> >   head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
> >   head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
> >   head/sys/i386/i386/trap.c
> >   head/sys/i386/linux/linux_sysvec.c
> >   head/sys/x86/include/signal.h
> >   head/sys/x86/include/trap.h
> > 
> > Modified: head/sys/amd64/amd64/trap.c
> > ==============================================================================
> > --- head/sys/amd64/amd64/trap.c	Tue Mar 27 20:54:57 2018
> > (r331649) +++ head/sys/amd64/amd64/trap.c	Tue Mar 27 20:57:51
> > 2018	(r331650) @@ -95,6 +95,7 @@ PMC_SOFT_DEFINE( , , page_fault,
> > write); #include 
> >  #endif
> >  #include 
> > +#include 
> >  #include 
> >  
> >  #ifdef KDTRACE_HOOKS
> > @@ -338,14 +339,14 @@ trap(struct trapframe *frame)
> >  					ucode = SEGV_ACCERR;
> >  				} else {
> >  					signo = SIGBUS;
> > -					ucode = BUS_PAGE_FAULT;
> > +					ucode = T_PAGEFLT;
> >  				}
> >  			} else if (prot_fault_translation == 1) {
> >  				/*
> >  				 * Always compat mode.
> >  				 */
> >  				signo = SIGBUS;
> > -				ucode = BUS_PAGE_FAULT;
> > +				ucode = T_PAGEFLT;
> >  			} else {
> >  				/*
> >  				 * Always SIGSEGV mode.
> > 
> > Modified: head/sys/amd64/ia32/ia32_signal.c
> > ==============================================================================
> > --- head/sys/amd64/ia32/ia32_signal.c	Tue Mar 27 20:54:57 2018
> > (r331649) +++ head/sys/amd64/ia32/ia32_signal.c	Tue Mar 27 20:57:51
> > 2018	(r331650) @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$");
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  
> >  #ifdef COMPAT_FREEBSD4
> >  static void freebsd4_ia32_sendsig(sig_t, ksiginfo_t *, sigset_t *);
> > 
> > Modified: head/sys/amd64/linux/linux_sysvec.c
> > ==============================================================================
> > --- head/sys/amd64/linux/linux_sysvec.c	Tue Mar 27 20:54:57
> > 2018	(r331649) +++ head/sys/amd64/linux/linux_sysvec.c	Tue Mar
> > 27 20:57:51 2018	(r331650) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  
> >  #include 
> >  #include 
> > 
> > Modified: head/sys/amd64/linux32/linux32_sysvec.c
> > ==============================================================================
> > --- head/sys/amd64/linux32/linux32_sysvec.c	Tue Mar 27 20:54:57
> > 2018	(r331649) +++ head/sys/amd64/linux32/linux32_sysvec.c	Tue
> > Mar 27 20:57:51 2018	(r331650) @@ -75,6 +75,7 @@
> > __FBSDID("$FreeBSD$"); #include 
> >  #include 
> >  #include 
> > +#include 
> >  
> >  #include 
> >  #include 
> > 
> > Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
> > ==============================================================================
> > --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c
> > Tue Mar 27 20:54:57 2018	(r331649) +++
> > head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c	Tue
> > Mar 27 20:57:51 2018	(r331650) @@ -52,6 +52,7 @@ #include
> >  #include 
> >  #include 
> > +#include 
> >  #endif
> >  #include 
> >  #ifdef illumos
> > 
> > Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
> > ==============================================================================
> > --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c	Tue Mar 27 20:54:57
> > 2018	(r331649) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c
> > Tue Mar 27 20:57:51 2018	(r331650) @@ -44,6 +44,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> >  
> >  extern void dtrace_getnanotime(struct timespec *tsp);
> > 
> > Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
> > ==============================================================================
> > --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c	Tue Mar 27 20:54:57
> > 2018	(r331649) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c
> > Tue Mar 27 20:57:51 2018	(r331650) @@ -45,6 +45,7 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  #include 
> >  
> >  extern uintptr_t 	kernelbase;
> > 
> > Modified: head/sys/i386/i386/trap.c
> > ==============================================================================
> > --- head/sys/i386/i386/trap.c	Tue Mar 27 20:54:57 2018
> > (r331649) +++ head/sys/i386/i386/trap.c	Tue Mar 27 20:57:51
> > 2018	(r331650) @@ -97,6 +97,7 @@ PMC_SOFT_DEFINE( , , page_fault,
> > write); #include 
> >  #endif
> >  #include 
> > +#include 
> >  #include 
> >  #include 
> >  
> > @@ -416,14 +417,14 @@ user_trctrap_out:
> >  					ucode = SEGV_ACCERR;
> >  				} else {
> >  					signo = SIGBUS;
> > -					ucode = BUS_PAGE_FAULT;
> > +					ucode = T_PAGEFLT;
> >  				}
> >  			} else if (prot_fault_translation == 1) {
> >  				/*
> >  				 * Always compat mode.
> >  				 */
> >  				signo = SIGBUS;
> > -				ucode = BUS_PAGE_FAULT;
> > +				ucode = T_PAGEFLT;
> >  			} else {
> >  				/*
> >  				 * Always SIGSEGV mode.
> > 
> > Modified: head/sys/i386/linux/linux_sysvec.c
> > ==============================================================================
> > --- head/sys/i386/linux/linux_sysvec.c	Tue Mar 27 20:54:57 2018
> > (r331649) +++ head/sys/i386/linux/linux_sysvec.c	Tue Mar 27 20:57:51
> > 2018	(r331650) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$");
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> >  
> >  #include 
> >  #include 
> > 
> > Modified: head/sys/x86/include/signal.h
> > ==============================================================================
> > --- head/sys/x86/include/signal.h	Tue Mar 27 20:54:57 2018
> > (r331649) +++ head/sys/x86/include/signal.h	Tue Mar 27 20:57:51
> > 2018	(r331650) @@ -43,10 +43,6 @@
> >  #include 
> >  #include 
> >  
> > -#if __BSD_VISIBLE
> > -#include 	/* codes for SIGILL, SIGFPE */
> > -#endif
> > -
> >  #ifdef __i386__
> >  typedef int sig_atomic_t;
> >  
> > 
> > Modified: head/sys/x86/include/trap.h
> > ==============================================================================
> > --- head/sys/x86/include/trap.h	Tue Mar 27 20:54:57 2018
> > (r331649) +++ head/sys/x86/include/trap.h	Tue Mar 27 20:57:51
> > 2018	(r331650) @@ -66,30 +66,6 @@
> >  #define	T_RESERVED	30	/* reserved (unknown) */
> >  #define	T_DTRACE_RET	32	/* DTrace pid return */
> >  
> > -/* XXX most of the following codes aren't used, but could be. */
> > -
> > -/* definitions for  */
> > -#define	    ILL_RESAD_FAULT	T_RESADFLT
> > -#define	    ILL_PRIVIN_FAULT	T_PRIVINFLT
> > -#define	    ILL_RESOP_FAULT	T_RESOPFLT
> > -#define	    ILL_ALIGN_FAULT	T_ALIGNFLT
> > -#define	    ILL_FPOP_FAULT	T_FPOPFLT	/* coprocessor
> > operand fault */ -
> > -/* old FreeBSD macros, deprecated */
> > -#define	FPE_INTOVF_TRAP	0x1	/* integer overflow */
> > -#define	FPE_INTDIV_TRAP	0x2	/* integer divide by zero
> > */ -#define	FPE_FLTDIV_TRAP	0x3	/* floating/decimal
> > divide by zero */ -#define	FPE_FLTOVF_TRAP	0x4	/*
> > floating overflow */ -#define	FPE_FLTUND_TRAP	0x5	/*
> > floating underflow */ -#define	FPE_FPU_NP_TRAP	0x6	/*
> > floating point unit not present  */ -#define	FPE_SUBRNG_TRAP
> > 0x7	/* subrange out of bounds */ -
> > -/* codes for SIGBUS */
> > -#define	    BUS_PAGE_FAULT	T_PAGEFLT	/* page fault
> > protection base */ -#define	    BUS_SEGNP_FAULT
> > T_SEGNPFLT	/* segment not present */ -#define
> > BUS_STK_FAULT	T_STKFLT	/* stack segment */ -#define
> > BUS_SEGM_FAULT	T_RESERVED	/* segment protection base */ -
> >  /* Trap's coming from user mode */
> >  #define	T_USER	0x100
> >  
> > _______________________________________________
> > svn-src-head@freebsd.org mailing list
> > https://lists.freebsd.org/mailman/listinfo/svn-src-head
> > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"  
> 
> 
> make buildkernel fails now with the error:
> 
> [...]
> --- machdep.o ---
> /usr/src/sys/amd64/amd64/machdep.c:520:20: error: use of undeclared identifier
> 'T_PROTFLT' ksi.ksi_trapno = T_PROTFLT;
>                                  ^
> --- modules-all ---
> [...]
> 


From owner-svn-src-head@freebsd.org  Wed Mar 28 05:29:48 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDA87F5DDD4;
 Wed, 28 Mar 2018 05:29:48 +0000 (UTC)
 (envelope-from danfe@freebsd.org)
Received: from freefall.freebsd.org (freefall.freebsd.org
 [IPv6:2610:1c1:1:6074::16:84])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "freefall.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 872837638B;
 Wed, 28 Mar 2018 05:29:48 +0000 (UTC)
 (envelope-from danfe@freebsd.org)
Received: by freefall.freebsd.org (Postfix, from userid 1033)
 id 6FB3F1DADA; Wed, 28 Mar 2018 05:29:48 +0000 (UTC)
Date: Wed, 28 Mar 2018 05:29:48 +0000
From: Alexey Dokuchaev 
To: John Baldwin 
Cc: Warner Losh , Kyle Evans ,
 svn-src-head@freebsd.org, svn-src-all@freebsd.org,
 src-committers 
Subject: Re: svn commit: r331209 - head
Message-ID: <20180328052948.GA21068@FreeBSD.org>
References: <201803191527.w2JFRr7B058668@repo.freebsd.org>
 <3226647.aiAOVF4eaK@ralph.baldwin.cx>
 <20180327051912.GA5729@FreeBSD.org>
 <11592636.Xep9SDNT9W@ralph.baldwin.cx>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <11592636.Xep9SDNT9W@ralph.baldwin.cx>
User-Agent: Mutt/1.9.2 (2017-12-15)
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 05:29:49 -0000

On Tue, Mar 27, 2018 at 09:48:43AM -0700, John Baldwin wrote:
> On Tuesday, March 27, 2018 05:19:12 AM Alexey Dokuchaev wrote:
> > On Thu, Mar 22, 2018 at 08:52:47AM -0700, John Baldwin wrote:
> > > On Thursday, March 22, 2018 04:39:38 AM Alexey Dokuchaev wrote:
> > > > > ...
> > > > Right, but John had mentioned extra reboot *between* installkernel and
> > > > installworld, which I've never heard of before.
> > > 
> > > From the end up of src/UPDATING:
> > > 
> > >         
> > >         make buildworld
> > >         make kernel KERNCONF=YOUR_KERNEL_HERE
> > >         
> > 
> > If by "reboot" in your original message you meant "drop to single user"
> > then there's no confusion.  It's just that in my understanding "reboot"
> > means, well, reboot.
> 
> No, I meant reboot and it clearly says here "reboot".  Note that
> 'make kernel' does 'make buildkernel' and 'make installkernel', so
> the reboot quoted above is after installkernel but before installworld.

Ah, OK, so "reboot in single user" above means "reboot, then boot -s".
I see now, sorry for the noise. :-(

./danfe

From owner-svn-src-head@freebsd.org  Wed Mar 28 05:55:02 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18B69F5F0B3
 for ;
 Wed, 28 Mar 2018 05:55:02 +0000 (UTC)
 (envelope-from lists@eitanadler.com)
Received: from mail-yb0-x241.google.com (mail-yb0-x241.google.com
 [IPv6:2607:f8b0:4002:c09::241])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id ADB387726C
 for ; Wed, 28 Mar 2018 05:55:01 +0000 (UTC)
 (envelope-from lists@eitanadler.com)
Received: by mail-yb0-x241.google.com with SMTP id k199-v6so406935ybk.12
 for ; Tue, 27 Mar 2018 22:55:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=eitanadler.com; s=0xdeadbeef;
 h=mime-version:in-reply-to:references:from:date:message-id:subject:to
 :cc; bh=EYtVbeL6TsObW9u86kRzjVLkBSI/QY1EeK5YN2r3/kI=;
 b=Ixvajdq0WKRlgfoeUWyP3FBRLZycRL7cExq+/NfTw3+zkoYE9fRKvKOBpJ2PklVFDH
 Cerh5y7R9BKzoc3y3de4T2cTdmgBvLTYm9zGvAaX0If8+YmjhLxRemTiPmisMAJQHydg
 C6QjKebfap+jETqmoN3UxaP4YWYG4VSQ9ZtqA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:in-reply-to:references:from:date
 :message-id:subject:to:cc;
 bh=EYtVbeL6TsObW9u86kRzjVLkBSI/QY1EeK5YN2r3/kI=;
 b=cJxTt86g9yA9qoS8OZkdzKZyZdevqfE6Br0M/RMcVtAcAzAOrCkr6xFmTpDqkMpTra
 N8HVijIDQ5zFnhm6yjGT2O9tR6rPcsn1Xh3WHVy1nBM4S5FW9XWO+3/6CYgMaumPEVCW
 OitU9i6qYHhQn2T+uofaVQjPXBfB/6PW+1kpCr+nbz4ZjkEH3DNb+VtF9xk2EY6XI2eh
 IVMgNxCSdNrtf3aHnhV8T32HBH9f5xB5r3z8oQvT3oAchYeTkfE0l08VW5HCKCCi1pB0
 hChH/gjS4vtHDhMkpXA4kosl1RrT/FcxjJ9i7HmqoFOUaMtekjGKPPQ83XB02VlLhTI8
 d1mw==
X-Gm-Message-State: AElRT7E0mVstqwpBU0+SnHkd7hUk+xIaIEh77asxlUNL6HmOpyXDVXyD
 YPxiWxdI800q47gaif/RP/+wZtxxJfirVG7htTVd7g==
X-Google-Smtp-Source: AIpwx4/gx8C6r5dOYXDLY9KeCnXRFHK23rSLPhMYfEil08sEcHWdjPoypKkZhn7v/YY00D6cuSt1nq9k1p4nWw4PFeM=
X-Received: by 2002:a25:268f:: with SMTP id
 m137-v6mr1285531ybm.460.1522216500968; 
 Tue, 27 Mar 2018 22:55:00 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a5b:990:0:0:0:0:0 with HTTP;
 Tue, 27 Mar 2018 22:54:30 -0700 (PDT)
In-Reply-To: 
References: <201803270337.w2R3b4iv035285@repo.freebsd.org>
 <20180327081535.0dacffcb@freyja.zeit4.iv.bundesimmobilien.de>
 <20180327082651.28258a8c@freyja.zeit4.iv.bundesimmobilien.de>
 
 <20180327101309.GA75720@freefall.freebsd.org>
 
From: Eitan Adler 
Date: Tue, 27 Mar 2018 22:54:30 -0700
Message-ID: 
Subject: Re: svn commit: r331606 - in head/sys: amd64/include i386/include
 x86/x86 x86/xen
To: Jeff Roberson 
Cc: Li-Wen Hsu , "O. Hartmann" , 
 Jeff Roberson , Peter Holm ,
 svn-src-head@freebsd.org, 
 svn-src-all@freebsd.org, src-committers 
Content-Type: text/plain; charset="UTF-8"
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 05:55:02 -0000

On 27 March 2018 at 14:07, Jeff Roberson  wrote:
> On Tue, 27 Mar 2018, Li-Wen Hsu wrote:
>
>> On Mon, Mar 26, 2018 at 20:35:12 -1000, Jeff Roberson wrote:
>>>
>>> The patch has been on my branch for weeks and has been tested by a half
>>> dozen people.  I'm sorry it does not work for you.  If you reverted
>>> 331605
>>> the change that followed should not have built properly.  Did you build
>>> cleanly?  Can you share your kernel config?
>>>
>>> I tried with and without EARLY_AP_STARTUP and with and without NUMA.  I'm
>>> not having any trouble booting.  Did you make cleandepend && make depend?
>>
>>
>> It also hangs in our testing system:
>>
>> https://ci.freebsd.org/job/FreeBSD-head-amd64-test/6817/console
>> https://ci.freebsd.org/job/FreeBSD-head-i386-test/1000/console
>>
>> It is built cleanly and uses unmodified GENERIC config.
>>
>> The artifacts used are available here:
>>
>> https://artifact.ci.freebsd.org/snapshot/head/r331606/amd64/amd64/
>> https://artifact.ci.freebsd.org/snapshot/head/r331606/i386/i386/
>>
>> Hope these information help.
>
>
> Could someone who was experiencing the hang try the enclosed patch?  I can
> only verify that it continues to boot for me but I believe this fixes the
> bug on other systems.

This patch works for me on r331656M.




-- 
Eitan Adler

From owner-svn-src-head@freebsd.org  Wed Mar 28 07:49:37 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0DD4F6694A;
 Wed, 28 Mar 2018 07:49:37 +0000 (UTC)
 (envelope-from rgrimes@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 7A88C7AF29;
 Wed, 28 Mar 2018 07:49:37 +0000 (UTC)
 (envelope-from rgrimes@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CAE827E47;
 Wed, 28 Mar 2018 07:49:37 +0000 (UTC)
 (envelope-from rgrimes@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2S7nbJU094417;
 Wed, 28 Mar 2018 07:49:37 GMT (envelope-from rgrimes@FreeBSD.org)
Received: (from rgrimes@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2S7nbKn094416;
 Wed, 28 Mar 2018 07:49:37 GMT (envelope-from rgrimes@FreeBSD.org)
Message-Id: <201803280749.w2S7nbKn094416@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: rgrimes set sender to
 rgrimes@FreeBSD.org using -f
From: "Rodney W. Grimes" 
Date: Wed, 28 Mar 2018 07:49:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331664 - head/share/misc
X-SVN-Group: head
X-SVN-Commit-Author: rgrimes
X-SVN-Commit-Paths: head/share/misc
X-SVN-Commit-Revision: 331664
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 07:49:38 -0000

Author: rgrimes
Date: Wed Mar 28 07:49:36 2018
New Revision: 331664
URL: https://svnweb.freebsd.org/changeset/base/331664

Log:
  Add Bruce Evans
  Update my mentors to bde and phk
  
  Approved by:	core, bde (mentor), phk (mentor)
  MFC after:	3 days

Modified:
  head/share/misc/committers-src.dot

Modified: head/share/misc/committers-src.dot
==============================================================================
--- head/share/misc/committers-src.dot	Wed Mar 28 07:45:57 2018	(r331663)
+++ head/share/misc/committers-src.dot	Wed Mar 28 07:49:36 2018	(r331664)
@@ -122,6 +122,7 @@ avg [label="Andriy Gapon\navg@FreeBSD.org\n2009/02/18"
 avos [label="Andriy Voskoboinyk\navos@FreeBSD.org\n2015/09/24"]
 badger [label="Eric Badger\nbadger@FreeBSD.org\n2016/07/01"]
 bapt [label="Baptiste Daroussin\nbapt@FreeBSD.org\n2011/12/23"]
+bde [label="Bruce Evans\nbde@FreeBSD.org\n1994/08/20"]
 bdrewery [label="Bryan Drewery\nbdrewery@FreeBSD.org\n2013/12/14"]
 benl [label="Ben Laurie\nbenl@FreeBSD.org\n2011/05/18"]
 benno [label="Benno Rice\nbenno@FreeBSD.org\n2000/11/02"]
@@ -402,6 +403,8 @@ bapt -> araujo
 bapt -> bdrewery
 bapt -> wulf
 
+bde -> rgrimes
+
 benno -> grehan
 
 billf -> dougb
@@ -720,6 +723,7 @@ philip -> kp
 
 phk -> jkoshy
 phk -> mux
+phk -> rgrimes
 
 pjd -> def
 pjd -> kib

From owner-svn-src-head@freebsd.org  Wed Mar 28 07:59:17 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F5E5F67805;
 Wed, 28 Mar 2018 07:59:17 +0000 (UTC)
 (envelope-from eadler@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id D79F57B5FC;
 Wed, 28 Mar 2018 07:59:16 +0000 (UTC)
 (envelope-from eadler@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CDE3E27FD5;
 Wed, 28 Mar 2018 07:59:16 +0000 (UTC)
 (envelope-from eadler@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2S7xGxc099493;
 Wed, 28 Mar 2018 07:59:16 GMT (envelope-from eadler@FreeBSD.org)
Received: (from eadler@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2S7xGXp099488;
 Wed, 28 Mar 2018 07:59:16 GMT (envelope-from eadler@FreeBSD.org)
Message-Id: <201803280759.w2S7xGXp099488@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: eadler set sender to
 eadler@FreeBSD.org using -f
From: Eitan Adler 
Date: Wed, 28 Mar 2018 07:59:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331665 - in head: share/man/man4 sys/conf
 sys/contrib/dev/iwm sys/dev/iwm sys/modules/iwmfw sys/modules/iwmfw/iwm3168fw
X-SVN-Group: head
X-SVN-Commit-Author: eadler
X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/contrib/dev/iwm
 sys/dev/iwm sys/modules/iwmfw sys/modules/iwmfw/iwm3168fw
X-SVN-Commit-Revision: 331665
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 07:59:17 -0000

Author: eadler
Date: Wed Mar 28 07:59:16 2018
New Revision: 331665
URL: https://svnweb.freebsd.org/changeset/base/331665

Log:
  [iwm] Add support for iwm 3168 cards
  
  ```
  iwm0@pci0:5:0:0:        class=0x028000 card=0x21108086 chip=0x24fb8086
  rev=0x10 hdr=0x00
  vendor     = 'Intel Corporation'
  device     = 'Dual Band Wireless-AC 3168NGW [Stone Peak]'
  class      = network
  [94829] iwm0:  mem
  0xef700000-0xef701fff at device 0.0 on pci5
  [94829] iwm0: hw rev 0x220, fw ver 22.361476.0, address
  28:c6:3f:15:43:c5
  ```
  
  MFC After:	2 weeks
  Reviewed by:	ivadasz (over IRC)
  PR:		224886
  Differential Revision:	https://reviews.freebsd.org/D14865

Added:
  head/sys/contrib/dev/iwm/iwm-3168-22.fw.uu
  head/sys/modules/iwmfw/iwm3168fw/
  head/sys/modules/iwmfw/iwm3168fw/Makefile   (contents, props changed)
Modified:
  head/share/man/man4/iwm.4
  head/share/man/man4/iwmfw.4
  head/sys/conf/files
  head/sys/dev/iwm/if_iwm.c
  head/sys/dev/iwm/if_iwm_7000.c
  head/sys/dev/iwm/if_iwm_config.h
  head/sys/modules/iwmfw/Makefile

Modified: head/share/man/man4/iwm.4
==============================================================================
--- head/share/man/man4/iwm.4	Wed Mar 28 07:49:36 2018	(r331664)
+++ head/share/man/man4/iwm.4	Wed Mar 28 07:59:16 2018	(r331665)
@@ -46,6 +46,7 @@ You also need to select a firmware for your device.
 Choose one from:
 .Bd -ragged -offset indent
 .Cd "device iwm3160fw"
+.Cd "device iwm3168fw"
 .Cd "device iwm7260fw"
 .Cd "device iwm7265fw"
 .Cd "device iwm8000Cfw"
@@ -65,6 +66,7 @@ module at boot time, place the following lines in
 .Bd -literal -offset indent
 if_iwm_load="YES"
 iwm3160fw_load="YES"
+iwm3168fw_load="YES"
 iwm7260fw_load="YES"
 iwm7265fw_load="YES"
 iwm8000Cfw_load="YES"
@@ -78,6 +80,7 @@ driver provides support for:
 .Bl -tag -width Ds -offset indent -compact
 .It Intel Dual Band Wireless AC 3160
 .It Intel Dual Band Wireless AC 3165
+.It Intel Dual Band Wireless AC 3168
 .It Intel Dual Band Wireless AC 7260
 .It Intel Dual Band Wireless AC 7265
 .It Intel Dual Band Wireless AC 8260

Modified: head/share/man/man4/iwmfw.4
==============================================================================
--- head/share/man/man4/iwmfw.4	Wed Mar 28 07:49:36 2018	(r331664)
+++ head/share/man/man4/iwmfw.4	Wed Mar 28 07:59:16 2018	(r331665)
@@ -43,6 +43,7 @@ If you want to pick only the firmware image for your n
 of the following:
 .Bd -ragged -offset indent
 .Cd "device iwm3160fw"
+.Cd "device iwm3168fw"
 .Cd "device iwm7260fw"
 .Cd "device iwm7265fw"
 .Cd "device iwm8000Cfw"
@@ -54,6 +55,7 @@ module at boot time, place the following line in
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 iwm3160fw_load="YES"
+iwm3168fw_load="YES"
 iwm7260fw_load="YES"
 iwm7265fw_load="YES"
 iwm7265Dfw_load="YES"
@@ -62,7 +64,7 @@ iwm8265fw_load="YES"
 .Ed
 .Sh DESCRIPTION
 This module provides access to firmware sets for the
-Intel Dual Band Wireless WiFi 3160, 3165, 7260, 7265, 8000, and 8260 series of
+Intel Dual Band Wireless WiFi 3160, 3165, 3168, 7260, 7265, 8000, and 8260 series of
 IEEE 802.11n/11ac adapters.
 It may be
 statically linked into the kernel, or loaded as a module.

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Mar 28 07:49:36 2018	(r331664)
+++ head/sys/conf/files	Wed Mar 28 07:59:16 2018	(r331665)
@@ -1988,6 +1988,20 @@ iwm3160.fw			optional iwm3160fw | iwmfw		\
 	compile-with	"${NORMAL_FW}"					\
 	no-obj no-implicit-rule						\
 	clean		"iwm3160.fw"
+iwm3168fw.c			optional iwm3168fw | iwmfw		\
+	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwm3168.fw:iwm3168fw -miwm3168fw -c${.TARGET}" \
+	no-implicit-rule before-depend local				\
+	clean		"iwm3168fw.c"
+iwm3168fw.fwo			optional iwm3168fw | iwmfw		\
+	dependency	"iwm3168.fw"					\
+	compile-with	"${NORMAL_FWO}"					\
+	no-implicit-rule						\
+	clean		"iwm3168fw.fwo"
+iwm3168.fw			optional iwm3168fw | iwmfw		\
+	dependency	"$S/contrib/dev/iwm/iwm-3168-22.fw.uu"		\
+	compile-with	"${NORMAL_FW}"					\
+	no-obj no-implicit-rule						\
+	clean		"iwm3168.fw"
 iwm7260fw.c			optional iwm7260fw | iwmfw		\
 	compile-with	"${AWK} -f $S/tools/fw_stub.awk iwm7260.fw:iwm7260fw -miwm7260fw -c${.TARGET}" \
 	no-implicit-rule before-depend local				\

Added: head/sys/contrib/dev/iwm/iwm-3168-22.fw.uu
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/contrib/dev/iwm/iwm-3168-22.fw.uu	Wed Mar 28 07:59:16 2018	(r331665)
@@ -0,0 +1,22849 @@
+begin 644 iwm-3168-22.fw
+M`````$E73`IS=')E86TZ0V]R94-Y8VQE,3E?````"`````(```"*8@$`'````!``````````
+M````````````````&P````0````!````,P````P```````````"````````3
+M````!(`!````@```````%@````2$!0```0```````+2F@`!0,(``]-R``(S-
+M@``H&H``@,^``````````````````````````````````&P@P!`/&PDBW!W`
+M$`H`&T`@`!MN"@``88``&VX\``!A``$;;CT``&$``AMN/@``81``&VX!``!A
+M7```85<``&$``!LD(``;)>0=P!&(!^$8'P`(8@``&R4!`!LD```%)0$`!20`
+M"`4Y`0`%8H@@P!$"``4D``@%.0$`!6*,(,`1!``%)``(!3D!``5BD"#`$0@`
+M!20`"`4Y`0`%8I0@P!$0``4D``@%.0$`!6*8(,`1(``%)``(!3D!``5BG"#`
+M$4``!20`"`4Y`0`%8J`@P!$```@E```()(@'X1F$!^$90`?`$@$`&W`(``!A
+M#QP=(@0`'2;H'<`0`0`;,.@=P!&"!!LD"``;)00HP!&^#P!A```;)(``&R7D
+M'<`1```;)``!&R7D'<`1```;)``"&R7D'<`1"`!?<`P``&'8'<`0__X;,M@=
+MP!'.[@TE@ID-)`\--R)L(,`0#QLW(O__#24._PTD#PTW(J__`#(<``!D`(`3)`$`$R4X',`1#W<3(N`Q,B`0`3,`0HP!$/%!4B`@`5)@]-$R($$,41`@`3)/`<
+MP!$!`!,D[!S`$0``$R1P`!,E$!S`$0``$R4``!,DX!S`$12K@($``,`6`@$3
+M8@\4%2(0`!4F```3)0$`$R0D$,`1```3)```P!<``!4D````(0``&R4``!LD
+M`0!D;@$`&R0"`&1N`@`;)`0`9&X$`!LD#``;8@\;"R(/"V,B`0`;0`(`&T$`
+M``!A```;);P*@($`&QHH``#`%@``&R4"`!M````;<0]D8R(``!TD````(>^^
+MK=[OOJW>[[ZMWN^^K=[OOJW>[[ZMW@``````````"```````````````````
+M```````````````````````````````````````````````````````!````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````!$`(`````````````D````*````"P````P````-```
+M`#@````\````0````&0```!H````;````'````!T````>````'P```"`````
+MA````(@```",````D````)4```"9````G0```*$```"9````G0```*$```"E
+M````*@```#H```!J````>@```(H```";````GP````(````$````!@````0`
+M```,````$P```!L````C````*P```"T````!``````````0````%````````
+M````_P````#_``$!`P`!!00``@(#```#_P``_@8!`/\!`0``_P$!`?\!`@+_
+M`0`$!0$!!?\!`0,'`@#_`@(``/\"`0'_`@("_P("!?\"`@,'```$`(P%`0`.
+M`+@(!0#$``@&!@!``,P&!P#8`"0'"`!H`/P'"0!``&0("@`\`)`%"P`\`,P%
+M#P`4`*0($0`8``P'$@"D`0``$P`,`,@(%``$`-0(%0`$`-@(````````````
+M````````````````````````````````````````````'@```!Z('HA:````
+M5@```%:(5H@"`0``J@```*J(JHC^`0``C`H``%2,5(RD'P``````````````
+M`/X```$`_P`"`?\!`/\!`0#^`@$#`O\!`0#_`0$!_P(`_P,"`/X$`@,"_P("
+M`/\"`@'_`P#_!0,`_@8#``/_`P,`_P,#`?\```````````````#`,```"@``
+M``0```"HJ(``````````````````(#$```4````$````J*B`````````````
+M```````````````````````````!````A'4$`(1W!`#P=@0`8'<$`"AR!``@
+M<@0`7G)BO@(HLL
+M,BS@<\YI*RW@'GOL,2C@BXN)B2G@B8D```Q@@R4``#@04@```$&``0````)'
+M`8```!1@`````!(@E`,``!40^0@=`>ET.@WIM)$(PF`0"$#@[P>^7H\'/-YN
+M!SN=+@_W^\'/Y_/!SZ?SP<^
+MG\\'/I^O![U>KP>]GL\'/I^O![U>KP>]GL\'/I_/!SZ?SP<^G\\'O]_O![_?
+M[P>_WP\(0&`P",%@,`C!8%`(0N%P",,AD0A$(I$(Q:+1",;C\0C'(Q()R&12
+M"[W8X'/%ZO![[?#PA`8#`(
+M0J(Q#>ET.@W-9K,)S69S"_W^\'OQ\0"$!@,`C!
+M8#`(P6`0"$`@\`<_G\\'O1Z/![S=;@>[G4X'.IUN![O=;@<\'J\'/9_/![\?
+M$`A`8#`(P6`P",%@$`A`(/`'O]_O!S^?[P>_WP\(P&!0"$.B\0C)9;,)S6:S
+M"40BD0A$81`(OY_/!SZ?SP<^G^\'OQ\0",&@4`C"X7`(P^%P"$*A,`A!(/`'
+MOY_/!SZ?SP<^G^\'/V!0"$0BD0B[W6X'N]U.![B;K0:TF4P&L5@,!C0<#PA$
+M(K$(Q6+1"$:C\0C'X_$(Q^/1"$9CL0A%(G$(PZ%0",%@,`A`(!`(0"`0",!@
+M,`A!H7`(PR&1",5BT0A&X_$(Q^/Q",>CT0A&8[$(Q2*1"$`>C@8P6"P&,9EL
+M!K2:[08XW6X'N]UN![5:K08UVFP&,EDL!C$:C@?`HM$(QN,1"C@:Q6$P&LMF,!K5:K08!````(B(B(!\>'!L;
+M&R(`(B(B(!\='!H:&B(`(B(B(!\='!H:&B(`(B(B(B`?'1P7%R(`(B(B(!\=
+M'!L7%"(`(B(B(!\=&QD6$R(`(B(B(!\>'!L8&"(`(B(B(!\='!H8%"(`(B(B
+M(!X<&Q@5$B(`(B(B(!\='!H7%R(`(B(@'QX='!D7%"(`(B(@'QX<&Q<5$B(`
+M````````````````^($!``4```($````J*B```````#_````-`R@`$`,H`!4
+M#*``4`R@`$P,H``<'*``0""@`"@DH`!L$*``&"2@`'@DH`!\)*``@"2@`(0D
+MH`!0$*``2":@`&`0H`!,)J``9!"@`&@0H`!8$*``,!"@`#P0H``T$*``+`R@
+M``"!I``!@:0``X&D`(@DH`",)*``D"2@`)0DH`"8)*``G"2@`*`DH`"D)*``
+M`````````````````````'(;#0#A@0$`%Y\"`````````````````#0!`#8!
+M`#X!5S\!9D`!=T$!F$(!!_$`"F:$`6Z(`
+M&Z,`,*0`$J4`(*8`!Z<`&Z@`$JD`!ZH``*P`":T`!JX`#*\`";``!K$`#+(`
+M![,`!+0`"K4`!K@`7KX`&<@`!LD`!LH``H!!/X`$_\`!FX`"GD`#74``7\`
+M#X<`#ID`P7P!#8`!#7T!_W\!_R<`'"@`&+D!![H!$,X!`[T!"<``,P7@``@&(``R!>```,!`@$%``0`$``*``8`?`&``7,!=P&7
+M`9D!E@&8`=P!)0":`9P!````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````8`````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````!`````@`````````N$2\7,!`Q*#(1,_(V(D$!2#A*
+M+E0<5AQ:.%PX8%AX.(@@0`&0```"1L`0`:`````+X$`!L```#0)P``'```
+M`````````````````````````/\```$#_P``"0$```K_``,$`@```/\``/X#
+M`0#_!`$!"04!`0H%`0`!_P$#!`(!`0+_`0$(_P$``/\!`/X&`@#_!P(""0@"
+M`@H(`@('"0(``?\"`0/_`@,$"@("`O\"```+`P,)#`,#"@P#!`4-`P,"#@,`
+M``\$`/\0!`0)$00$"A$$`@;_!`("$@0$"/\$``#_!`#^$P``````````````
+M`,0Z!``*````!````*BH@`````````````````#X`@0`"@````0```"HJ(``
+M3",$`,@C!``D``0`P",$`/@Y!`!<.@0`1#H$`'@`!`"0`00`"`$$`%@`!`",
+M`00`4``$`$0`!`!(``0`3``$`-PU!``X-@0`##8$``0V!`#_____________
+M________!````/_______________P,```#_____``````````#_____````
+M``````#_____```````````#````$`````,```#_````_P```/\```#_````
+M`P````````````````````````#_``````````````#_````````````````
+M```````````!``````'_```"_P```P$```7_```&_P``"/\```?_```)_P``
+M"O\```O_```,_P$`_P,!`0```0$""@$"!00!`0;_`0$'_P$#"@@"6`+X`4````"!.```````````````````$````
+M`0`````````!`````0```!X```````````````$!#@X````````R"`(/`P`!
+M``````````$!#@X````````C!`(*`````````````/0!````````````````
+M````````/&^`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`/[*K:L`````````````````````````````````````````````````````
+M`````!``````D`$```"@`!`G``#H`P``Z`,``&PJ@`!L*H``?+6``%RU@`!D
+MM8``/+6``'RU@`!+6``'RU@``PM8``@+6``$BU
+M@```````__\!`@4#```````!``,+!0`````4BP0`%(L$`!2+!`"0AP0`%(L$
+M`!2+!`"4B`0`%(L$`-#$```4R0``%(L$`!2+!``4BP0`%(L$`!2+!``4BP0`
+M%(L$`!2+!``4BP0`%(L$`!2+!``4BP0`%(L$`"3F``#TX@``@.8``!2+!``4
+MBP0`%(L$`!C;```4\0``4-X``"C?``#\W0``E-(``-C1``#4UP``,.(``&"+
+M!`!$Z```;'P$`-A^!``4BP0`$(,$`$2!!``XB00`#,\``!2+!``4BP0`%(L$
+M`!2+!``4BP0`%(L$`!2+!``4BP0`%(L$`!2+!``4BP0`%(L$`!2+!``4BP0`
+M%(L$`!2+!``4BP0`#,L```#+``#TR@``%(L$`!2+!``4BP0`%(L$`!2+!`"<
+MS@``%(L$`!2+!``4BP0`%(L$`!2+!`!,[```%(L$`!2+!``8B@0`I(D$`+#,
+M```4BP0`%(L$`.2)!``4BP0`%(L$`!2+!``4BP0`%(L$`"#'```8Q@``O,@`
+M`(S(```4BP0`*-4``!2+!``4BP0`%(L$`!2+!``4BP0`%(L$`!2+!``4BP0`
+MB.$``!2+!`#0U0``%(L$`,R)!``4BP0`8,L``!2+!``4BP0`%(L$`!2+!``4
+MBP0`%(L$`)3)```4BP0`%(L$`!2+!``4BP0`%(L$`!2+!`""AT*X`FE"6T)-PD$"=,(I`AW"$L((@CZ!],'K@>*!P``````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````&0T```"````!````*BH@`````````````````#`
+M-```!0````0```"HJ(``````````````!0``<@$``*@"```$"00)`08)#!$!
+M```````````````````'````'@````,```#_____`````/[*K:L`````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````_P``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!,"*``2`B@`&P(@```````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````/L5C``SD0``````
+M````$0``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````!X>'AX>'AX>'AX>'AX`&1P>'AX>
+M'AX>'AX>'@`>'AX>'AX>'AX`'AX>'AX>'AX>``$&`@0"`@``!`0&!`@#````
+M`!D>'AX>'AX8&1X>'AX>'A@8'AX>'AX>'AX`%1X>&!4>'A@8'AX>`P@`````
+M!@```````````/\%````````&!@8&!@=`08&!@8`!@``'@`>`!X`&``&!@8!
+M`0$!_08&````````!@$!```>```````````````!`````````````````!48
+M&!@8&!@8&!@5&!@```````````````````#^_O[^_@`4%A@8%!(0&!@`````
+M```````````````````````````````5&!@8&!@8%!48&!@8&!@4$A@8&!@8
+M&!@8```````!`````0```!$8&!01&!@4%!@8&```````^Q04%!04&!@8&!@8
+M&!@8&!@8&!@`&!@8&!@8&!@8&!@8&``8&!@8&!@8&!@`&!@8&!@8&!@8`!@8
+M&!@8&!@8&!@8&!@8&!@8&!@8&!@8&!@`&!@8&!@8&!@8&!@8&!@8&!@8`0$!
+M`0$!````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````%94```X`````````%ID
+M```^`````````&JD```^`````````%JD```^`````````%JD```^````````
+M`%ID```^`````````%I4```^`````````%JD```^`````````%ID```^````
+M``````H@```^`````````%ID```^`````````%ID```^`````````%I4```^
+M`````````%ID```#`````````%JD```#``````````H````Q````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````,#```````````````0`````````!````/P``````````````````
+M````````````!0`%````````````````!`@``0``!00!``$$``0%``````$`
+M`0``!P$``````````P@```````0%```+```!```!````````!`0`````!```
+M````!`````$`````````````#````0`$``X```````````````0`````````
+M```````````$```````````$```````````````!````!0````````````0`
+M```````````````````````!```!````!``!!```````````"00`````````
+M``4`````!`0````````````````````````!``P&```````````````````,
+M```!````````````"@`````,``````4````````$``````````````0$!```
+M```,```,!```````!```````````!`4`!0$%``````````4``0``!```!`$`
+M```````````%````````````````!``````````````````!`````0`!!0``
+M#00`````````!``````!``4`````````````````````````````````````
+M````````````````!```!``.``4````%``````0!``0`!```````````````
+M```````````$```%```````/````!``!```"```!!```````````````````
+M`````@```````0```````0``````````!0``````````````````````````
+M```````````````````````````````````````````````````,#0X/````
+M``````````````````````````````````0`````````````````````````
+M```,```````I*?____\`````````````````````````````````````````
+M```````````````````````>`0``+`L`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````0(#!`4&!P@)
+M"@L,#0X/$"HJ*RPM+B]*2TQ-3D]0:VQM;G!QBXR-CH^1K*VNK["QS,S,S<[/
+MT-'2T]/3T]/3T]/3T]/3T]/3T],`00```````````0(#!`4&!P@)"@L,#0X/
+M$"HJ*RPM+B]*2TQ-3D]0:FMM;F]PBHN,C8Z/JJNLK:ZORLO,S<[/T-#0T-#0
+MT-#0T-#0T-#0T-#0T-``/@,$!08&!P@)"@L,#2HK+"TN+TI+3$U.3U!0:FML
+M;6YOBHN,C8Z/D*JKK*VNK\K+S,W.S]#1TM/4U=;7V-G:V]S=W=W=W=W=W=W=
+MW=W=W=W=W=T`0``!`@,#!`4&!P@)"@L,#0XJ*RPM+B]*2TQ-3D]0:FIK;&YO
+M<(J+C(V.CY"JJZRMKJ_*R\S-SL_0T=+3U-76U]C9VMK:VMK:VMK:VMK:VMK:
+MVMH`00,$!04&!P@)"@L,#0XJ*RPM+B]*2TQ-3D]0:FIK;6YO<(J+C(V.CY"J
+MJZRMKLK+S,W.S]#1TM/4U=;7U]?7U]?7U]?7U]?7U]?7U]?7U]?7U]<`.@``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````#_
+M?_]__W__?_]_`````````````````````/]__W__?_]__W\`````````````
+M``````````"JJ@``_P``````````````````````````````````````````
+M```````````````````````````````````````!`````0````$````!````
+M`0````$````!`````0````$````!`````0````$````!`````0````$`````
+M````````````````````````````````````````````?W]_?W]_?W]_?W]_
+M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_
+M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_
+M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_
+M?W]_?W]_?W]_?W]_?P```````````````+X````!``````````$```!?````
+M`@`````````"````+P````,``````````P```!@`````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````H```````````````````#_`/\``````#0`````````````
+M``````#_`/\``````'````````````````````#_`/\``````)D`````````
+M``````````#_`/\```````````````````````$``````````0`````````!
+M`````````````````````0`````````!``````````$`````````````````
+M`````````````(P*```````````````````````````````````,`P@`````
+M``````#_``````````````````````````````#_````````````````````
+M``````````#_``````````````````````````````#_````````````````
+M``````````````#_``````````````````````````````#_````````````
+M``````````````````#_````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````!````````
+M`.S[@`````````````````````````````````#44P``"@````0```"HJ(``
+M```````````````````````````````````````````!#!ZV#C("$1ZY#C(#
+M%AZ[#C($&QZ^#C(%(![`#C(&)1[##C('*A[%#C((+Q[(#C()-![*#C(*.1[-
+M#C(+/A[/#C(,0Q[2#C(-2![4#C(.31[7#C(B4$`9(``D8$`>(#8F<$`C(#(H
+M`$$H(#8J$$$M(#4L($$R(#8N,$$W(#$P0$$\(#8R4$%!(``T8$%&(#8V<$%+
+M(#$X`$)0(#8Z$$)5(#4\($):(#4^,$)?(#%`0$)D(#5D8$2^(C1F<$3#(C!H
+M`$7((C1J$$7-(C1L($72(C1N,$77(C!P0$7<(C1R4$7A(@!T8$7F(C1V<$7K
+M(C!X`$;P(C1Z$$;U(C1\($;Z(C1^,$;_(C"`0$8$(C2"4$8)(@"$8$8.(C2&
+M<$83(C"(`$<8(C.*$$<=(C.,($$<^(B^9"$A#)#.;&$A()#*=*$A-)#.?.$A2)"^A2$A7)#*E:$AA)#(`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````/``\`#P`/``\`#P`/``\`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````0`!``````#``)``T```````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````+0T!``*````!````*BH
+M@```````````````````````````````````````````````````````````
+M`/____^L_8````````````````````````````!<5```"@````0```"HJ(``
+M0$(/`$!"#P!`0@\`0$(/`$!"#P!`0@\`0$(/`$!"#P!`0@\`0$(/`.`'``!`
+M`0``X`<``$`!```@)P``X`<``.`'``!``0``X`<``$`!```"``````````(`
+M````````````````````````````````````````````````````````/).`
+M`'0<@0`8`````````````````````````/[*K:L`````````````````````
+M```````````````````````````````````````````````````````````!
+M````-@$``*H````$`0``@@````````!PV`$`E-@!`*38`0!\V`$`;-@!`*C8
+M`0!4V`$```````#@````@`````````````````````````````"`]```@$L`
+M``!```````````````````````````````#D````7````$``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+MK.8$`+3A!`"
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7134F6C0DE;
 Wed, 28 Mar 2018 08:55:32 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 6A4267DB87;
 Wed, 28 Mar 2018 08:55:32 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 60EAC9D1;
 Wed, 28 Mar 2018 08:55:32 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2S8tWOr029244;
 Wed, 28 Mar 2018 08:55:32 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2S8tVxE029241;
 Wed, 28 Mar 2018 08:55:31 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201803280855.w2S8tVxE029241@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon 
Date: Wed, 28 Mar 2018 08:55:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331666 - in head/sys:
 cddl/contrib/opensolaris/uts/common/fs kern sys
X-SVN-Group: head
X-SVN-Commit-Author: avg
X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs kern
 sys
X-SVN-Commit-Revision: 331666
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 08:55:33 -0000

Author: avg
Date: Wed Mar 28 08:55:31 2018
New Revision: 331666
URL: https://svnweb.freebsd.org/changeset/base/331666

Log:
  ZFS vn_rele_async: catch up with the use of refcount(9) for the vnode use count
  
  It's not sufficient nor required to use the vnode interlock when
  checking if we are going to drop the last use count as the code in
  vputx() uses refcount (atomic) operations for both checking and
  decrementing the use code.  Apply the same method to vn_rele_async().
  While here, remove vn_rele_inactive(), a wrapper around vrele() that
  didn't add any value.
  
  Also, the change required making vfs_refcount_release_if_not_last()
  public.  I've made vfs_refcount_acquire_if_not_zero() public as well.
  They are in sys/refcount.h now.  While making the move I've dropped the
  vfs_ prefix.
  
  Reviewed by:	mjg
  MFC after:	2 weeks
  Sponsored by:	Panzura
  Differential Revision: https://reviews.freebsd.org/D14869

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c
  head/sys/kern/vfs_subr.c
  head/sys/sys/refcount.h

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c	Wed Mar 28 07:59:16 2018	(r331665)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c	Wed Mar 28 08:55:31 2018	(r331666)
@@ -72,12 +72,6 @@ xva_getxoptattr(xvattr_t *xvap)
 	return (xoap);
 }
 
-static void
-vn_rele_inactive(vnode_t *vp)
-{
-	vrele(vp);
-}
-
 /*
  * Like vn_rele() except if we are going to call VOP_INACTIVE() then do it
  * asynchronously using a taskq. This can avoid deadlocks caused by re-entering
@@ -92,13 +86,10 @@ void
 vn_rele_async(vnode_t *vp, taskq_t *taskq)
 {
 	VERIFY(vp->v_count > 0);
-	VI_LOCK(vp);
-	if (vp->v_count == 1 && !(vp->v_iflag & VI_DOINGINACT)) {
-		VI_UNLOCK(vp);
-		VERIFY(taskq_dispatch((taskq_t *)taskq,
-		    (task_func_t *)vn_rele_inactive, vp, TQ_SLEEP) != 0);
+	if (refcount_release_if_not_last(&vp->v_usecount)) {
+		vdrop(vp);
 		return;
 	}
-	refcount_release(&vp->v_usecount);
-	vdropl(vp);
+	VERIFY(taskq_dispatch((taskq_t *)taskq,
+	    (task_func_t *)vrele, vp, TQ_SLEEP) != 0);
 }

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Wed Mar 28 07:59:16 2018	(r331665)
+++ head/sys/kern/vfs_subr.c	Wed Mar 28 08:55:31 2018	(r331666)
@@ -2455,37 +2455,6 @@ reassignbuf(struct buf *bp)
 	BO_UNLOCK(bo);
 }
 
-/*
- * A temporary hack until refcount_* APIs are sorted out.
- */
-static __inline int
-vfs_refcount_acquire_if_not_zero(volatile u_int *count)
-{
-	u_int old;
-
-	old = *count;
-	for (;;) {
-		if (old == 0)
-			return (0);
-		if (atomic_fcmpset_int(count, &old, old + 1))
-			return (1);
-	}
-}
-
-static __inline int
-vfs_refcount_release_if_not_last(volatile u_int *count)
-{
-	u_int old;
-
-	old = *count;
-	for (;;) {
-		if (old == 1)
-			return (0);
-		if (atomic_fcmpset_int(count, &old, old - 1))
-			return (1);
-	}
-}
-
 static void
 v_init_counters(struct vnode *vp)
 {
@@ -2524,7 +2493,7 @@ v_incr_usecount(struct vnode *vp)
 	CTR2(KTR_VFS, "%s: vp %p", __func__, vp);
 
 	if (vp->v_type != VCHR &&
-	    vfs_refcount_acquire_if_not_zero(&vp->v_usecount)) {
+	    refcount_acquire_if_not_zero(&vp->v_usecount)) {
 		VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp,
 		    ("vnode with usecount and VI_OWEINACT set"));
 	} else {
@@ -2616,7 +2585,7 @@ vget(struct vnode *vp, int flags, struct thread *td)
 	 * Upgrade our holdcnt to a usecount.
 	 */
 	if (vp->v_type == VCHR ||
-	    !vfs_refcount_acquire_if_not_zero(&vp->v_usecount)) {
+	    !refcount_acquire_if_not_zero(&vp->v_usecount)) {
 		VI_LOCK(vp);
 		if ((vp->v_iflag & VI_OWEINACT) == 0) {
 			oweinact = 0;
@@ -2720,7 +2689,7 @@ vputx(struct vnode *vp, int func)
 	CTR2(KTR_VFS, "%s: vp %p", __func__, vp);
 
 	if (vp->v_type != VCHR &&
-	    vfs_refcount_release_if_not_last(&vp->v_usecount)) {
+	    refcount_release_if_not_last(&vp->v_usecount)) {
 		if (func == VPUTX_VPUT)
 			VOP_UNLOCK(vp, 0);
 		vdrop(vp);
@@ -2836,7 +2805,7 @@ _vhold(struct vnode *vp, bool locked)
 		ASSERT_VI_UNLOCKED(vp, __func__);
 	CTR2(KTR_VFS, "%s: vp %p", __func__, vp);
 	if (!locked) {
-		if (vfs_refcount_acquire_if_not_zero(&vp->v_holdcnt)) {
+		if (refcount_acquire_if_not_zero(&vp->v_holdcnt)) {
 			VNASSERT((vp->v_iflag & VI_FREE) == 0, vp,
 			    ("_vhold: vnode with holdcnt is free"));
 			return;
@@ -2907,7 +2876,7 @@ _vdrop(struct vnode *vp, bool locked)
 	if ((int)vp->v_holdcnt <= 0)
 		panic("vdrop: holdcnt %d", vp->v_holdcnt);
 	if (!locked) {
-		if (vfs_refcount_release_if_not_last(&vp->v_holdcnt))
+		if (refcount_release_if_not_last(&vp->v_holdcnt))
 			return;
 		VI_LOCK(vp);
 	}
@@ -5438,12 +5407,12 @@ mnt_vnode_next_active_relock(struct vnode *mvp, struct
 	 * acquired with vhold(), but that might try to acquire the vnode
 	 * interlock, which would be a LOR with the mount vnode list lock.
 	 */
-	held = vfs_refcount_acquire_if_not_zero(&vp->v_holdcnt);
+	held = refcount_acquire_if_not_zero(&vp->v_holdcnt);
 	mtx_unlock(&mp->mnt_listmtx);
 	if (!held)
 		goto abort;
 	VI_LOCK(vp);
-	if (!vfs_refcount_release_if_not_last(&vp->v_holdcnt)) {
+	if (!refcount_release_if_not_last(&vp->v_holdcnt)) {
 		vdropl(vp);
 		goto abort;
 	}

Modified: head/sys/sys/refcount.h
==============================================================================
--- head/sys/sys/refcount.h	Wed Mar 28 07:59:16 2018	(r331665)
+++ head/sys/sys/refcount.h	Wed Mar 28 08:55:31 2018	(r331666)
@@ -76,4 +76,35 @@ refcount_release(volatile u_int *count)
 	return (1);
 }
 
+/*
+ * A temporary hack until refcount_* APIs are sorted out.
+ */
+static __inline int
+refcount_acquire_if_not_zero(volatile u_int *count)
+{
+	u_int old;
+
+	old = *count;
+	for (;;) {
+		if (old == 0)
+			return (0);
+		if (atomic_fcmpset_int(count, &old, old + 1))
+			return (1);
+	}
+}
+
+static __inline int
+refcount_release_if_not_last(volatile u_int *count)
+{
+	u_int old;
+
+	old = *count;
+	for (;;) {
+		if (old == 1)
+			return (0);
+		if (atomic_fcmpset_int(count, &old, old - 1))
+			return (1);
+	}
+}
+
 #endif	/* ! __SYS_REFCOUNT_H__ */

From owner-svn-src-head@freebsd.org  Wed Mar 28 10:08:18 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE351F71466;
 Wed, 28 Mar 2018 10:08:18 +0000 (UTC)
 (envelope-from kostikbel@gmail.com)
Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 5510880CC4;
 Wed, 28 Mar 2018 10:08:18 +0000 (UTC)
 (envelope-from kostikbel@gmail.com)
Received: from tom.home (kib@localhost [127.0.0.1])
 by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id w2SA87Im078974
 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO);
 Wed, 28 Mar 2018 13:08:10 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w2SA87Im078974
Received: (from kostik@localhost)
 by tom.home (8.15.2/8.15.2/Submit) id w2SA87v0078973;
 Wed, 28 Mar 2018 13:08:07 +0300 (EEST)
 (envelope-from kostikbel@gmail.com)
X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com
 using -f
Date: Wed, 28 Mar 2018 13:08:07 +0300
From: Konstantin Belousov 
To: Andriy Gapon , jhb@freebsd.org
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r331666 - in head/sys:
 cddl/contrib/opensolaris/uts/common/fs kern sys
Message-ID: <20180328100807.GC76926@kib.kiev.ua>
References: <201803280855.w2S8tVxE029241@repo.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <201803280855.w2S8tVxE029241@repo.freebsd.org>
User-Agent: Mutt/1.9.4 (2018-02-28)
X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no
 autolearn_force=no version=3.4.1
X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 10:08:18 -0000

On Wed, Mar 28, 2018 at 08:55:31AM +0000, Andriy Gapon wrote:
> +static __inline int
> +refcount_acquire_if_not_zero(volatile u_int *count)
What about refcount_acquire_nz()

> +static __inline int
> +refcount_release_if_not_last(volatile u_int *count)
refcount_release_nz()

From owner-svn-src-head@freebsd.org  Wed Mar 28 12:44:29 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FA20F59084;
 Wed, 28 Mar 2018 12:44:29 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 407FB87763;
 Wed, 28 Mar 2018 12:44:29 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CFB22EBF;
 Wed, 28 Mar 2018 12:44:29 +0000 (UTC) (envelope-from ae@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SCiTqk045268;
 Wed, 28 Mar 2018 12:44:29 GMT (envelope-from ae@FreeBSD.org)
Received: (from ae@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SCiTEL045266;
 Wed, 28 Mar 2018 12:44:29 GMT (envelope-from ae@FreeBSD.org)
Message-Id: <201803281244.w2SCiTEL045266@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org
 using -f
From: "Andrey V. Elsukov" 
Date: Wed, 28 Mar 2018 12:44:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331668 - head/sbin/ipfw
X-SVN-Group: head
X-SVN-Commit-Author: ae
X-SVN-Commit-Paths: head/sbin/ipfw
X-SVN-Commit-Revision: 331668
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 12:44:29 -0000

Author: ae
Date: Wed Mar 28 12:44:28 2018
New Revision: 331668
URL: https://svnweb.freebsd.org/changeset/base/331668

Log:
  Rework ipfw rules parsing and printing code.
  
  Introduce show_state structure to keep information about printed opcodes.
  Split show_static_rule() function into several smaller functions. Make
  parsing and printing opcodes into several passes. Each printed opcode
  is marked in show_state structure and will be skipped in next passes.
  Now show_static_rule() function is simple, it just prints each part
  of rule separately: action, modifiers, proto, src and dst addresses,
  options. The main goal of this change is avoiding occurrence of wrong
  result of `ifpw show` command, that can not be parsed by ipfw(8).
  Also now it is possible to make some simple static optimizations
  by reordering of opcodes in the rule.
  
  PR:		222705
  Discussed with:	melifaro
  MFC after:	2 weeks
  Sponsored by:	Yandex LLC

Modified:
  head/sbin/ipfw/ipfw2.c
  head/sbin/ipfw/ipfw2.h
  head/sbin/ipfw/main.c

Modified: head/sbin/ipfw/ipfw2.c
==============================================================================
--- head/sbin/ipfw/ipfw2.c	Wed Mar 28 08:58:32 2018	(r331667)
+++ head/sbin/ipfw/ipfw2.c	Wed Mar 28 12:44:28 2018	(r331668)
@@ -1176,7 +1176,7 @@ print_flags(struct buf_pr *bp, char const *name, ipfw_
  * Print the ip address contained in a command.
  */
 static void
-print_ip(struct buf_pr *bp, struct format_opts *fo, ipfw_insn_ip *cmd,
+print_ip(struct buf_pr *bp, const struct format_opts *fo, ipfw_insn_ip *cmd,
     char const *s)
 {
 	struct hostent *he = NULL;
@@ -1277,7 +1277,7 @@ print_ip(struct buf_pr *bp, struct format_opts *fo, ip
  * prints a MAC address/mask pair
  */
 static void
-print_mac(struct buf_pr *bp, uint8_t *addr, uint8_t *mask)
+format_mac(struct buf_pr *bp, uint8_t *addr, uint8_t *mask)
 {
 	int l = contigmask(mask, 48);
 
@@ -1296,6 +1296,15 @@ print_mac(struct buf_pr *bp, uint8_t *addr, uint8_t *m
 }
 
 static void
+print_mac(struct buf_pr *bp, ipfw_insn_mac *mac)
+{
+
+	bprintf(bp, " MAC");
+	format_mac(bp, mac->addr, mac->mask);
+	format_mac(bp, mac->addr + 6, mac->mask + 6);
+}
+
+static void
 fill_icmptypes(ipfw_insn_u32 *cmd, char *av)
 {
 	uint8_t type;
@@ -1358,817 +1367,843 @@ print_dscp(struct buf_pr *bp, ipfw_insn_u32 *cmd)
 	}
 }
 
-/*
- * show_ipfw() prints the body of an ipfw rule.
- * Because the standard rule has at least proto src_ip dst_ip, we use
- * a helper function to produce these entries if not provided explicitly.
- * The first argument is the list of fields we have, the second is
- * the list of fields we want to be printed.
- *
- * Special cases if we have provided a MAC header:
- *   + if the rule does not contain IP addresses/ports, do not print them;
- *   + if the rule does not contain an IP proto, print "all" instead of "ip";
- *
- * Once we have 'have_options', IP header fields are printed as options.
- */
+#define	insntod(cmd, type)	((ipfw_insn_ ## type *)(cmd))
+struct show_state {
+	struct ip_fw_rule	*rule;
+	const ipfw_insn		*eaction;
+	uint8_t			*printed;
+	int			flags;
 #define	HAVE_PROTO	0x0001
 #define	HAVE_SRCIP	0x0002
 #define	HAVE_DSTIP	0x0004
-#define	HAVE_PROTO4	0x0008
-#define	HAVE_PROTO6	0x0010
-#define	HAVE_IP		0x0100
-#define	HAVE_OPTIONS	0x8000
+	int			proto;
+	int			or_block;
+};
 
-static void
-show_prerequisites(struct buf_pr *bp, int *flags, int want, int cmd)
+static int
+init_show_state(struct show_state *state, struct ip_fw_rule *rule)
 {
-	(void)cmd;	/* UNUSED */
-	if (co.comment_only)
-		return;
-	if ( (*flags & HAVE_IP) == HAVE_IP)
-		*flags |= HAVE_OPTIONS;
 
-	if ( !(*flags & HAVE_OPTIONS)) {
-		if ( !(*flags & HAVE_PROTO) && (want & HAVE_PROTO)) {
-			if ( (*flags & HAVE_PROTO4))
-				bprintf(bp, " ip4");
-			else if ( (*flags & HAVE_PROTO6))
-				bprintf(bp, " ip6");
-			else
-				bprintf(bp, " ip");
-		}
-		if ( !(*flags & HAVE_SRCIP) && (want & HAVE_SRCIP))
-			bprintf(bp, " from any");
-		if ( !(*flags & HAVE_DSTIP) && (want & HAVE_DSTIP))
-			bprintf(bp, " to any");
-	}
-	*flags |= want;
+	state->printed = calloc(rule->cmd_len, sizeof(uint8_t));
+	if (state->printed == NULL)
+		return (ENOMEM);
+	state->rule = rule;
+	state->eaction = NULL;
+	state->flags = 0;
+	state->proto = 0;
+	state->or_block = 0;
+	return (0);
 }
 
 static void
-show_static_rule(struct cmdline_opts *co, struct format_opts *fo,
-    struct buf_pr *bp, struct ip_fw_rule *rule, struct ip_fw_bcounter *cntr)
+free_show_state(struct show_state *state)
 {
-	static int twidth = 0;
-	int l;
-	ipfw_insn *cmd, *has_eaction = NULL, *tagptr = NULL;
-	const char *comment = NULL;	/* ptr to comment if we have one */
-	const char *ename;
-	int proto = 0;		/* default */
-	int flags = 0;	/* prerequisites */
-	ipfw_insn_log *logptr = NULL; /* set if we find an O_LOG */
-	ipfw_insn_altq *altqptr = NULL; /* set if we find an O_ALTQ */
-	int or_block = 0;	/* we are in an or block */
-	uint32_t uval;
 
-	if ((fo->set_mask & (1 << rule->set)) == 0) {
-		/* disabled mask */
-		if (!co->show_sets)
-			return;
-		else
-			bprintf(bp, "# DISABLED ");
-	}
-	bprintf(bp, "%05u ", rule->rulenum);
+	free(state->printed);
+}
 
-	/* Print counters if enabled */
-	if (fo->pcwidth > 0 || fo->bcwidth > 0) {
-		pr_u64(bp, &cntr->pcnt, fo->pcwidth);
-		pr_u64(bp, &cntr->bcnt, fo->bcwidth);
-	}
+static uint8_t
+is_printed_opcode(struct show_state *state, const ipfw_insn *cmd)
+{
 
-	if (co->do_time == 2)
-		bprintf(bp, "%10u ", cntr->timestamp);
-	else if (co->do_time == 1) {
-		char timestr[30];
-		time_t t = (time_t)0;
+	return (state->printed[cmd - state->rule->cmd]);
+}
 
-		if (twidth == 0) {
-			strcpy(timestr, ctime(&t));
-			*strchr(timestr, '\n') = '\0';
-			twidth = strlen(timestr);
-		}
-		if (cntr->timestamp > 0) {
-			t = _long_to_time(cntr->timestamp);
+static void
+mark_printed(struct show_state *state, const ipfw_insn *cmd)
+{
 
-			strcpy(timestr, ctime(&t));
-			*strchr(timestr, '\n') = '\0';
-			bprintf(bp, "%s ", timestr);
-		} else {
-			bprintf(bp, "%*s", twidth, " ");
-		}
-	}
+	state->printed[cmd - state->rule->cmd] = 1;
+}
 
-	if (co->show_sets)
-		bprintf(bp, "set %d ", rule->set);
+static void
+print_limit(struct buf_pr *bp, const ipfw_insn_limit *limit)
+{
+	struct _s_x *p = limit_masks;
+	char const *comma = " ";
+	uint8_t x;
 
-	/*
-	 * print the optional "match probability"
-	 */
-	if (rule->cmd_len > 0) {
-		cmd = rule->cmd ;
-		if (cmd->opcode == O_PROB) {
-			ipfw_insn_u32 *p = (ipfw_insn_u32 *)cmd;
-			double d = 1.0 * p->d[0];
-
-			d = (d / 0x7fffffff);
-			bprintf(bp, "prob %f ", d);
+	bprintf(bp, " limit");
+	for (x = limit->limit_mask; p->x != 0; p++) {
+		if ((x & p->x) == p->x) {
+			x &= ~p->x;
+			bprintf(bp, "%s%s", comma, p->s);
+			comma = ",";
 		}
 	}
+	bprint_uint_arg(bp, " ", limit->conn_limit);
+}
 
-	/*
-	 * first print actions
-	 */
-	for (l = rule->cmd_len - rule->act_ofs, cmd = ACTION_PTR(rule);
-			l > 0 ; l -= F_LEN(cmd), cmd += F_LEN(cmd)) {
-		switch(cmd->opcode) {
-		case O_CHECK_STATE:
-			bprintf(bp, "check-state");
-			if (cmd->arg1 != 0)
-				ename = object_search_ctlv(fo->tstate,
-				    cmd->arg1, IPFW_TLV_STATE_NAME);
-			else
-				ename = NULL;
-			bprintf(bp, " :%s", ename ? ename: "any");
-			/* avoid printing anything else */
-			flags = HAVE_PROTO | HAVE_SRCIP |
-				HAVE_DSTIP | HAVE_IP;
-			break;
+static int
+print_instruction(struct buf_pr *bp, const struct format_opts *fo,
+    struct show_state *state, ipfw_insn *cmd)
+{
+	struct protoent *pe;
+	struct passwd *pwd;
+	struct group *grp;
+	const char *s;
+	double d;
 
-		case O_ACCEPT:
-			bprintf(bp, "allow");
-			break;
+	if (is_printed_opcode(state, cmd))
+		return (0);
+	if ((cmd->len & F_OR) != 0 && state->or_block == 0)
+		bprintf(bp, " {");
+	if (cmd->opcode != O_IN && (cmd->len & F_NOT) != 0)
+		bprintf(bp, " not");
 
-		case O_COUNT:
-			bprintf(bp, "count");
+	switch (cmd->opcode) {
+	case O_PROB:
+		d = 1.0 * insntod(cmd, u32)->d[0] / 0x7fffffff;
+		bprintf(bp, "prob %f ", d);
+		break;
+	case O_PROBE_STATE: /* no need to print anything here */
+		break;
+	case O_IP_SRC:
+	case O_IP_SRC_LOOKUP:
+	case O_IP_SRC_MASK:
+	case O_IP_SRC_ME:
+	case O_IP_SRC_SET:
+	case O_IP_DST:
+	case O_IP_DST_LOOKUP:
+	case O_IP_DST_MASK:
+	case O_IP_DST_ME:
+	case O_IP_DST_SET:
+		print_ip(bp, fo, insntod(cmd, ip), "");
+		break;
+	case O_IP6_SRC:
+	case O_IP6_SRC_MASK:
+	case O_IP6_SRC_ME:
+	case O_IP6_DST:
+	case O_IP6_DST_MASK:
+	case O_IP6_DST_ME:
+		print_ip6(bp, insntod(cmd, ip6), "");
+		break;
+	case O_FLOW6ID:
+		print_flow6id(bp, insntod(cmd, u32));
+		break;
+	case O_IP_DSTPORT:
+	case O_IP_SRCPORT:
+		print_newports(bp, insntod(cmd, u16), state->proto,
+		    (state->flags & (HAVE_SRCIP | HAVE_DSTIP)) ==
+		    (HAVE_SRCIP | HAVE_DSTIP) ?  cmd->opcode: 0);
+		break;
+	case O_PROTO:
+		pe = getprotobynumber(cmd->arg1);
+		if (state->flags & HAVE_PROTO)
+			bprintf(bp, " proto");
+		if (pe != NULL)
+			bprintf(bp, " %s", pe->p_name);
+		else
+			bprintf(bp, " %u", cmd->arg1);
+		break;
+	case O_MACADDR2:
+		print_mac(bp, insntod(cmd, mac));
+		break;
+	case O_MAC_TYPE:
+		print_newports(bp, insntod(cmd, u16),
+		    IPPROTO_ETHERTYPE, cmd->opcode);
+		break;
+	case O_FRAG:
+		bprintf(bp, " frag");
+		break;
+	case O_FIB:
+		bprintf(bp, " fib %u", cmd->arg1);
+		break;
+	case O_SOCKARG:
+		bprintf(bp, " sockarg");
+		break;
+	case O_IN:
+		bprintf(bp, cmd->len & F_NOT ? " out" : " in");
+		break;
+	case O_DIVERTED:
+		switch (cmd->arg1) {
+		case 3:
+			bprintf(bp, " diverted");
 			break;
-
-		case O_DENY:
-			bprintf(bp, "deny");
+		case 2:
+			bprintf(bp, " diverted-output");
 			break;
-
-		case O_REJECT:
-			if (cmd->arg1 == ICMP_REJECT_RST)
-				bprintf(bp, "reset");
-			else if (cmd->arg1 == ICMP_REJECT_ABORT)
-				bprintf(bp, "abort");
-			else if (cmd->arg1 == ICMP_UNREACH_HOST)
-				bprintf(bp, "reject");
-			else
-				print_reject_code(bp, cmd->arg1);
+		case 1:
+			bprintf(bp, " diverted-loopback");
 			break;
-
-		case O_UNREACH6:
-			if (cmd->arg1 == ICMP6_UNREACH_RST)
-				bprintf(bp, "reset6");
-			else if (cmd->arg1 == ICMP6_UNREACH_ABORT)
-				bprintf(bp, "abort6");
-			else
-				print_unreach6_code(bp, cmd->arg1);
+		default:
+			bprintf(bp, " diverted-?<%u>", cmd->arg1);
 			break;
-
-		case O_SKIPTO:
-			bprint_uint_arg(bp, "skipto ", cmd->arg1);
+		}
+		break;
+	case O_LAYER2:
+		bprintf(bp, " layer2");
+		break;
+	case O_XMIT:
+	case O_RECV:
+	case O_VIA:
+		if (cmd->opcode == O_XMIT)
+			s = "xmit";
+		else if (cmd->opcode == O_RECV)
+			s = "recv";
+		else /* if (cmd->opcode == O_VIA) */
+			s = "via";
+		switch (insntod(cmd, if)->name[0]) {
+		case '\0':
+			bprintf(bp, " %s %s", s,
+			    inet_ntoa(insntod(cmd, if)->p.ip));
 			break;
-
-		case O_PIPE:
-			bprint_uint_arg(bp, "pipe ", cmd->arg1);
+		case '\1':
+			bprintf(bp, " %s table(%s)", s,
+			    table_search_ctlv(fo->tstate,
+			    insntod(cmd, if)->p.kidx));
 			break;
-
-		case O_QUEUE:
-			bprint_uint_arg(bp, "queue ", cmd->arg1);
-			break;
-
-		case O_DIVERT:
-			bprint_uint_arg(bp, "divert ", cmd->arg1);
-			break;
-
-		case O_TEE:
-			bprint_uint_arg(bp, "tee ", cmd->arg1);
-			break;
-
-		case O_NETGRAPH:
-			bprint_uint_arg(bp, "netgraph ", cmd->arg1);
-			break;
-
-		case O_NGTEE:
-			bprint_uint_arg(bp, "ngtee ", cmd->arg1);
-			break;
-
-		case O_FORWARD_IP:
-		    {
-			ipfw_insn_sa *s = (ipfw_insn_sa *)cmd;
-
-			if (s->sa.sin_addr.s_addr == INADDR_ANY) {
-				bprintf(bp, "fwd tablearg");
-			} else {
-				bprintf(bp, "fwd %s",inet_ntoa(s->sa.sin_addr));
-			}
-			if (s->sa.sin_port)
-				bprintf(bp, ",%d", s->sa.sin_port);
-		    }
-			break;
-
-		case O_FORWARD_IP6:
-		    {
-			char buf[INET6_ADDRSTRLEN + IF_NAMESIZE + 2];
-			ipfw_insn_sa6 *s = (ipfw_insn_sa6 *)cmd;
-
-			bprintf(bp, "fwd ");
-			if (getnameinfo((const struct sockaddr *)&s->sa,
-			    sizeof(struct sockaddr_in6), buf, sizeof(buf),
-			    NULL, 0, NI_NUMERICHOST) == 0)
-				bprintf(bp, "%s", buf);
-			if (s->sa.sin6_port)
-				bprintf(bp, ",%d", s->sa.sin6_port);
-		    }
-			break;
-
-		case O_LOG: /* O_LOG is printed last */
-			logptr = (ipfw_insn_log *)cmd;
-			break;
-
-		case O_ALTQ: /* O_ALTQ is printed after O_LOG */
-			altqptr = (ipfw_insn_altq *)cmd;
-			break;
-
-		case O_TAG:
-			tagptr = cmd;
-			break;
-
-		case O_NAT:
-			if (cmd->arg1 != IP_FW_NAT44_GLOBAL)
-				bprint_uint_arg(bp, "nat ", cmd->arg1);
-			else
-				bprintf(bp, "nat global");
-			break;
-
-		case O_SETFIB:
-			if (cmd->arg1 == IP_FW_TARG)
-				bprint_uint_arg(bp, "setfib ", cmd->arg1);
-			else
-				bprintf(bp, "setfib %u", cmd->arg1 & 0x7FFF);
-			break;
-
-		case O_EXTERNAL_ACTION: {
-			/*
-			 * The external action can consists of two following
-			 * each other opcodes - O_EXTERNAL_ACTION and
-			 * O_EXTERNAL_INSTANCE. The first contains the ID of
-			 * name of external action. The second contains the ID
-			 * of name of external action instance.
-			 * NOTE: in case when external action has no named
-			 * instances support, the second opcode isn't needed.
-			 */
-			has_eaction = cmd;
-			ename = object_search_ctlv(fo->tstate, cmd->arg1,
-			    IPFW_TLV_EACTION);
-			if (match_token(rule_eactions, ename) != -1)
-				bprintf(bp, "%s", ename);
-			else
-				bprintf(bp, "eaction %s", ename);
-			break;
+		default:
+			bprintf(bp, " %s %s", s,
+			    insntod(cmd, if)->name);
 		}
-
-		case O_EXTERNAL_INSTANCE: {
-			if (has_eaction == NULL)
+		break;
+	case O_IP_FLOW_LOOKUP:
+		s = table_search_ctlv(fo->tstate, cmd->arg1);
+		bprintf(bp, " flow table(%s", s);
+		if (F_LEN(cmd) == F_INSN_SIZE(ipfw_insn_u32))
+			bprintf(bp, ",%u", insntod(cmd, u32)->d[0]);
+		bprintf(bp, ")");
+		break;
+	case O_IPID:
+	case O_IPTTL:
+	case O_IPLEN:
+	case O_TCPDATALEN:
+	case O_TCPWIN:
+		if (F_LEN(cmd) == 1) {
+			switch (cmd->opcode) {
+			case O_IPID:
+				s = "ipid";
 				break;
-			/*
-			 * XXX: we need to teach ipfw(9) to rewrite opcodes
-			 * in the user buffer on rule addition. When we add
-			 * the rule, we specify zero TLV type for
-			 * O_EXTERNAL_INSTANCE object. To show correct
-			 * rule after `ipfw add` we need to search instance
-			 * name with zero type. But when we do `ipfw show`
-			 * we calculate TLV type using IPFW_TLV_EACTION_NAME()
-			 * macro.
-			 */
-			ename = object_search_ctlv(fo->tstate, cmd->arg1, 0);
-			if (ename == NULL)
-				ename = object_search_ctlv(fo->tstate,
-				    cmd->arg1,
-				    IPFW_TLV_EACTION_NAME(has_eaction->arg1));
-			bprintf(bp, " %s", ename);
-			break;
-		}
-
-		case O_EXTERNAL_DATA: {
-			if (has_eaction == NULL)
+			case O_IPTTL:
+				s = "ipttl";
 				break;
-			/*
-			 * Currently we support data formatting only for
-			 * external data with datalen u16. For unknown data
-			 * print its size in bytes.
-			 */
-			if (cmd->len == F_INSN_SIZE(ipfw_insn))
-				bprintf(bp, " %u", cmd->arg1);
-			else
-				bprintf(bp, " %ubytes",
-				    cmd->len * sizeof(uint32_t));
-			break;
-		}
-
-		case O_SETDSCP:
-		    {
-			const char *code;
-
-			if (cmd->arg1 == IP_FW_TARG) {
-				bprint_uint_arg(bp, "setdscp ", cmd->arg1);
+			case O_IPLEN:
+				s = "iplen";
 				break;
+			case O_TCPDATALEN:
+				s = "tcpdatalen";
+				break;
+			case O_TCPWIN:
+				s = "tcpwin";
+				break;
 			}
-			uval = cmd->arg1 & 0x3F;
-			if ((code = match_value(f_ipdscp, uval)) != NULL)
-				bprintf(bp, "setdscp %s", code);
-			else
-				bprint_uint_arg(bp, "setdscp ", uval);
-		    }
- 			break;
+			bprintf(bp, " %s %u", s, cmd->arg1);
+		} else
+			print_newports(bp, insntod(cmd, u16), 0,
+			    cmd->opcode);
+		break;
+	case O_IPVER:
+		bprintf(bp, " ipver %u", cmd->arg1);
+		break;
+	case O_IPPRECEDENCE:
+		bprintf(bp, " ipprecedence %u", cmd->arg1 >> 5);
+		break;
+	case O_DSCP:
+		print_dscp(bp, insntod(cmd, u32));
+		break;
+	case O_IPOPT:
+		print_flags(bp, "ipoptions", cmd, f_ipopts);
+		break;
+	case O_IPTOS:
+		print_flags(bp, "iptos", cmd, f_iptos);
+		break;
+	case O_ICMPTYPE:
+		print_icmptypes(bp, insntod(cmd, u32));
+		break;
+	case O_ESTAB:
+		bprintf(bp, " established");
+		break;
+	case O_TCPFLAGS:
+		print_flags(bp, "tcpflags", cmd, f_tcpflags);
+		break;
+	case O_TCPOPTS:
+		print_flags(bp, "tcpoptions", cmd, f_tcpopts);
+		break;
+	case O_TCPACK:
+		bprintf(bp, " tcpack %d",
+		    ntohl(insntod(cmd, u32)->d[0]));
+		break;
+	case O_TCPSEQ:
+		bprintf(bp, " tcpseq %d",
+		    ntohl(insntod(cmd, u32)->d[0]));
+		break;
+	case O_UID:
+		pwd = getpwuid(insntod(cmd, u32)->d[0]);
+		if (pwd != NULL)
+			bprintf(bp, " uid %s", pwd->pw_name);
+		else
+			bprintf(bp, " uid %u",
+			    insntod(cmd, u32)->d[0]);
+		break;
+	case O_GID:
+		grp = getgrgid(insntod(cmd, u32)->d[0]);
+		if (grp != NULL)
+			bprintf(bp, " gid %s", grp->gr_name);
+		else
+			bprintf(bp, " gid %u",
+			    insntod(cmd, u32)->d[0]);
+		break;
+	case O_JAIL:
+		bprintf(bp, " jail %d", insntod(cmd, u32)->d[0]);
+		break;
+	case O_VERREVPATH:
+		bprintf(bp, " verrevpath");
+		break;
+	case O_VERSRCREACH:
+		bprintf(bp, " versrcreach");
+		break;
+	case O_ANTISPOOF:
+		bprintf(bp, " antispoof");
+		break;
+	case O_IPSEC:
+		bprintf(bp, " ipsec");
+		break;
+	case O_NOP:
+		bprintf(bp, " // %s", (char *)(cmd + 1));
+		break;
+	case O_KEEP_STATE:
+		bprintf(bp, " keep-state");
+		bprintf(bp, " :%s",
+		    object_search_ctlv(fo->tstate, cmd->arg1,
+		    IPFW_TLV_STATE_NAME));
+		break;
+	case O_LIMIT:
+		print_limit(bp, insntod(cmd, limit));
+		bprintf(bp, " :%s",
+		    object_search_ctlv(fo->tstate, cmd->arg1,
+		    IPFW_TLV_STATE_NAME));
+		break;
+	case O_IP6:
+		bprintf(bp, " ip6");
+		break;
+	case O_IP4:
+		bprintf(bp, " ip4");
+		break;
+	case O_ICMP6TYPE:
+		print_icmp6types(bp, insntod(cmd, u32));
+		break;
+	case O_EXT_HDR:
+		print_ext6hdr(bp, cmd);
+		break;
+	case O_TAGGED:
+		if (F_LEN(cmd) == 1)
+			bprint_uint_arg(bp, " tagged ", cmd->arg1);
+		else
+			print_newports(bp, insntod(cmd, u16),
+				    0, O_TAGGED);
+		break;
+	default:
+		bprintf(bp, " [opcode %d len %d]", cmd->opcode,
+		    cmd->len);
+	}
+	if (cmd->len & F_OR) {
+		bprintf(bp, " or");
+		state->or_block = 1;
+	} else if (state->or_block != 0) {
+		bprintf(bp, " }");
+		state->or_block = 0;
+	}
+	mark_printed(state, cmd);
 
-		case O_REASS:
-			bprintf(bp, "reass");
-			break;
+	return (1);
+}
 
-		case O_CALLRETURN:
-			if (cmd->len & F_NOT)
-				bprintf(bp, "return");
-			else
-				bprint_uint_arg(bp, "call ", cmd->arg1);
-			break;
+static ipfw_insn *
+print_opcode(struct buf_pr *bp, struct format_opts *fo,
+    struct show_state *state, uint8_t opcode)
+{
+	ipfw_insn *cmd;
+	int l;
 
-		default:
-			bprintf(bp, "** unrecognized action %d len %d ",
-				cmd->opcode, cmd->len);
-		}
+	for (l = state->rule->act_ofs, cmd = state->rule->cmd;
+	    l > 0; l -= F_LEN(cmd), cmd += F_LEN(cmd)) {
+		/* We use zero opcode to print the rest of options */
+		if (opcode != 0 && cmd->opcode != opcode)
+			continue;
+		/*
+		 * Skip O_NOP, when we printing the rest
+		 * of options, it will be handled separately.
+		 */
+		if (cmd->opcode == O_NOP && opcode != O_NOP)
+			continue;
+		if (!print_instruction(bp, fo, state, cmd))
+			continue;
+		return (cmd);
 	}
-	if (logptr) {
-		if (logptr->max_log > 0)
-			bprintf(bp, " log logamount %d", logptr->max_log);
+	return (NULL);
+}
+
+static void
+print_fwd(struct buf_pr *bp, const ipfw_insn *cmd)
+{
+	char buf[INET6_ADDRSTRLEN + IF_NAMESIZE + 2];
+	ipfw_insn_sa6 *sa6;
+	ipfw_insn_sa *sa;
+	uint16_t port;
+
+	if (cmd->opcode == O_FORWARD_IP) {
+		sa = insntod(cmd, sa);
+		port = sa->sa.sin_port;
+		if (sa->sa.sin_addr.s_addr == INADDR_ANY)
+			bprintf(bp, "fwd tablearg");
 		else
-			bprintf(bp, " log");
+			bprintf(bp, "fwd %s", inet_ntoa(sa->sa.sin_addr));
+	} else {
+		sa6 = insntod(cmd, sa6);
+		port = sa6->sa.sin6_port;
+		bprintf(bp, "fwd ");
+		if (getnameinfo((const struct sockaddr *)&sa6->sa,
+		    sizeof(struct sockaddr_in6), buf, sizeof(buf), NULL, 0,
+		    NI_NUMERICHOST) == 0)
+			bprintf(bp, "%s", buf);
 	}
+	if (port != 0)
+		bprintf(bp, ",%u", port);
+}
+
+static int
+print_action_instruction(struct buf_pr *bp, const struct format_opts *fo,
+    struct show_state *state, const ipfw_insn *cmd)
+{
+	const char *s;
+
+	if (is_printed_opcode(state, cmd))
+		return (0);
+	switch (cmd->opcode) {
+	case O_CHECK_STATE:
+		bprintf(bp, "check-state");
+		if (cmd->arg1 != 0)
+			s = object_search_ctlv(fo->tstate, cmd->arg1,
+			    IPFW_TLV_STATE_NAME);
+		else
+			s = NULL;
+		bprintf(bp, " :%s", s ? s: "any");
+		break;
+	case O_ACCEPT:
+		bprintf(bp, "allow");
+		break;
+	case O_COUNT:
+		bprintf(bp, "count");
+		break;
+	case O_DENY:
+		bprintf(bp, "deny");
+		break;
+	case O_REJECT:
+		if (cmd->arg1 == ICMP_REJECT_RST)
+			bprintf(bp, "reset");
+		else if (cmd->arg1 == ICMP_REJECT_ABORT)
+			bprintf(bp, "abort");
+		else if (cmd->arg1 == ICMP_UNREACH_HOST)
+			bprintf(bp, "reject");
+		else
+			print_reject_code(bp, cmd->arg1);
+		break;
+	case O_UNREACH6:
+		if (cmd->arg1 == ICMP6_UNREACH_RST)
+			bprintf(bp, "reset6");
+		else if (cmd->arg1 == ICMP6_UNREACH_ABORT)
+			bprintf(bp, "abort6");
+		else
+			print_unreach6_code(bp, cmd->arg1);
+		break;
+	case O_SKIPTO:
+		bprint_uint_arg(bp, "skipto ", cmd->arg1);
+		break;
+	case O_PIPE:
+		bprint_uint_arg(bp, "pipe ", cmd->arg1);
+		break;
+	case O_QUEUE:
+		bprint_uint_arg(bp, "queue ", cmd->arg1);
+		break;
+	case O_DIVERT:
+		bprint_uint_arg(bp, "divert ", cmd->arg1);
+		break;
+	case O_TEE:
+		bprint_uint_arg(bp, "tee ", cmd->arg1);
+		break;
+	case O_NETGRAPH:
+		bprint_uint_arg(bp, "netgraph ", cmd->arg1);
+		break;
+	case O_NGTEE:
+		bprint_uint_arg(bp, "ngtee ", cmd->arg1);
+		break;
+	case O_FORWARD_IP:
+	case O_FORWARD_IP6:
+		print_fwd(bp, cmd);
+		break;
+	case O_LOG:
+		if (insntod(cmd, log)->max_log > 0)
+			bprintf(bp, " log logamount %d",
+			    insntod(cmd, log)->max_log);
+		else
+			bprintf(bp, " log");
+		break;
+	case O_ALTQ:
 #ifndef NO_ALTQ
-	if (altqptr) {
-		print_altq_cmd(bp, altqptr);
-	}
+		print_altq_cmd(bp, insntod(cmd, altq));
 #endif
-	if (tagptr) {
-		if (tagptr->len & F_NOT)
-			bprint_uint_arg(bp, " untag ", tagptr->arg1);
+		break;
+	case O_TAG:
+		bprint_uint_arg(bp, cmd->len & F_NOT ? " untag ":
+		    " tag ", cmd->arg1);
+		break;
+	case O_NAT:
+		if (cmd->arg1 != IP_FW_NAT44_GLOBAL)
+			bprint_uint_arg(bp, "nat ", cmd->arg1);
 		else
-			bprint_uint_arg(bp, " tag ", tagptr->arg1);
-	}
-
-	/*
-	 * then print the body.
-	 */
-	for (l = rule->act_ofs, cmd = rule->cmd;
-			l > 0 ; l -= F_LEN(cmd) , cmd += F_LEN(cmd)) {
-		if ((cmd->len & F_OR) || (cmd->len & F_NOT))
-			continue;
-		if (cmd->opcode == O_IP4) {
-			flags |= HAVE_PROTO4;
+			bprintf(bp, "nat global");
+		break;
+	case O_SETFIB:
+		if (cmd->arg1 == IP_FW_TARG)
+			bprint_uint_arg(bp, "setfib ", cmd->arg1);
+		else
+			bprintf(bp, "setfib %u", cmd->arg1 & 0x7FFF);
+		break;
+	case O_EXTERNAL_ACTION:
+		/*
+		 * The external action can consists of two following
+		 * each other opcodes - O_EXTERNAL_ACTION and
+		 * O_EXTERNAL_INSTANCE. The first contains the ID of
+		 * name of external action. The second contains the ID
+		 * of name of external action instance.
+		 * NOTE: in case when external action has no named
+		 * instances support, the second opcode isn't needed.
+		 */
+		state->eaction = cmd;
+		s = object_search_ctlv(fo->tstate, cmd->arg1,
+		    IPFW_TLV_EACTION);
+		if (match_token(rule_eactions, s) != -1)
+			bprintf(bp, "%s", s);
+		else
+			bprintf(bp, "eaction %s", s);
+		break;
+	case O_EXTERNAL_INSTANCE:
+		if (state->eaction == NULL)
 			break;
-		} else if (cmd->opcode == O_IP6) {
-			flags |= HAVE_PROTO6;
+		/*
+		 * XXX: we need to teach ipfw(9) to rewrite opcodes
+		 * in the user buffer on rule addition. When we add
+		 * the rule, we specify zero TLV type for
+		 * O_EXTERNAL_INSTANCE object. To show correct
+		 * rule after `ipfw add` we need to search instance
+		 * name with zero type. But when we do `ipfw show`
+		 * we calculate TLV type using IPFW_TLV_EACTION_NAME()
+		 * macro.
+		 */
+		s = object_search_ctlv(fo->tstate, cmd->arg1, 0);
+		if (s == NULL)
+			s = object_search_ctlv(fo->tstate,
+			    cmd->arg1, IPFW_TLV_EACTION_NAME(
+			    state->eaction->arg1));
+		bprintf(bp, " %s", s);
+		break;
+	case O_EXTERNAL_DATA:
+		if (state->eaction == NULL)
 			break;
+		/*
+		 * Currently we support data formatting only for
+		 * external data with datalen u16. For unknown data
+		 * print its size in bytes.
+		 */
+		if (cmd->len == F_INSN_SIZE(ipfw_insn))
+			bprintf(bp, " %u", cmd->arg1);
+		else
+			bprintf(bp, " %ubytes",
+			    cmd->len * sizeof(uint32_t));
+		break;
+	case O_SETDSCP:
+		if (cmd->arg1 == IP_FW_TARG) {
+			bprintf(bp, "setdscp tablearg");
+			break;
 		}
+		s = match_value(f_ipdscp, cmd->arg1 & 0x3F);
+		if (s != NULL)
+			bprintf(bp, "setdscp %s", s);
+		else
+			bprintf(bp, "setdscp %s", cmd->arg1 & 0x3F);
+		break;
+	case O_REASS:
+		bprintf(bp, "reass");
+		break;
+	case O_CALLRETURN:
+		if (cmd->len & F_NOT)
+			bprintf(bp, "return");
+		else
+			bprint_uint_arg(bp, "call ", cmd->arg1);
+		break;
+	default:
+		bprintf(bp, "** unrecognized action %d len %d ",
+			cmd->opcode, cmd->len);
 	}
-	if (rule->flags & IPFW_RULE_NOOPT) {	/* empty rules before options */
-		if (!co->do_compact) {
-			show_prerequisites(bp, &flags, HAVE_PROTO, 0);
-			bprintf(bp, " from any to any");
-		}
-		flags |= HAVE_IP | HAVE_OPTIONS | HAVE_PROTO |
-			 HAVE_SRCIP | HAVE_DSTIP;
-	}
+	mark_printed(state, cmd);
 
-	if (co->comment_only)
-		comment = "...";
+	return (1);
+}
 
-	for (l = rule->act_ofs, cmd = rule->cmd;
-			l > 0 ; l -= F_LEN(cmd) , cmd += F_LEN(cmd)) {
-		/* useful alias */
-		ipfw_insn_u32 *cmd32 = (ipfw_insn_u32 *)cmd;
 
-		if (co->comment_only) {
-			if (cmd->opcode != O_NOP)
-				continue;
-			bprintf(bp, " // %s\n", (char *)(cmd + 1));
-			return;
-		}
+static ipfw_insn *
+print_action(struct buf_pr *bp, struct format_opts *fo,
+    struct show_state *state, uint8_t opcode)
+{
+	ipfw_insn *cmd;
+	int l;
 
-		show_prerequisites(bp, &flags, 0, cmd->opcode);
+	for (l = state->rule->cmd_len - state->rule->act_ofs,
+	    cmd = ACTION_PTR(state->rule); l > 0;
+	    l -= F_LEN(cmd), cmd += F_LEN(cmd)) {
+		if (cmd->opcode != opcode)
+			continue;
+		if (!print_action_instruction(bp, fo, state, cmd))
+			continue;
+		return (cmd);
+	}
+	return (NULL);
+}
 
-		switch(cmd->opcode) {
-		case O_PROB:
-			break;	/* done already */
+static void
+print_proto(struct buf_pr *bp, struct format_opts *fo,
+    struct show_state *state)
+{
+	ipfw_insn *cmd;
+	int l, proto, ip4, ip6, tmp;
 
-		case O_PROBE_STATE:
-			break; /* no need to print anything here */
-
-		case O_IP_SRC:
-		case O_IP_SRC_LOOKUP:
-		case O_IP_SRC_MASK:
-		case O_IP_SRC_ME:

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@freebsd.org  Wed Mar 28 12:58:21 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9491EF5A37A;
 Wed, 28 Mar 2018 12:58:21 +0000 (UTC)
 (envelope-from herbert@gojira.at)
Received: from mail.bsd4all.net (mail.bsd4all.net [IPv6:2a01:4f8:191:217b::25])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mail.bsd4all.net",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3212F68164;
 Wed, 28 Mar 2018 12:58:20 +0000 (UTC)
 (envelope-from herbert@gojira.at)
Date: Wed, 28 Mar 2018 14:58:18 +0200
From: "Herbert J. Skuhra" 
To: "O. Hartmann" 
Cc: Cy Schubert ,
 "svn-src-head@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "src-committers@freebsd.org" ,
 John Baldwin 
Subject: Re: svn commit: r331650 - in head/sys: amd64/amd64
 amd64/ia32amd64/linux amd64/linux32
 cddl/contrib/opensolaris/uts/intel/dtracecddl/dev/dtrace/amd64
 cddl/dev/dtrace/i386 i386/i386 i386/linux x86/inc...
Message-ID: <20180328125818.GA35772@mail.bsd4all.net>
References: <20180328052050.8B3CD143@spqr.komquats.com>
 <20180328072327.4f45e3f0@freyja.zeit4.iv.bundesimmobilien.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20180328072327.4f45e3f0@freyja.zeit4.iv.bundesimmobilien.de>
User-Agent: Mutt/1.9.4 (2018-02-28)
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 12:58:21 -0000

On Wed, Mar 28, 2018 at 07:23:27AM +0200, O. Hartmann wrote:
> On Tue, 27 Mar 2018 23:20:53 -0600
> Cy Schubert  wrote:
> 
> > Have you disabled DDB in your kernel config?

At the moment I am building non-GENERIC kernel with the below patch:

Index: sys/amd64/amd64/machdep.c
===================================================================
--- sys/amd64/amd64/machdep.c   (revision 331667)
+++ sys/amd64/amd64/machdep.c   (working copy)
@@ -108,6 +108,8 @@
 #endif
 #include 
 #include 
+#else
+#include 
 #endif

 #include 

-- 
Herbert

From owner-svn-src-head@freebsd.org  Wed Mar 28 16:14:28 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE21FF6A976;
 Wed, 28 Mar 2018 16:14:28 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 786D173DB0;
 Wed, 28 Mar 2018 16:14:28 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215])
 by mail.baldwin.cx (Postfix) with ESMTPSA id E8C8510AC13;
 Wed, 28 Mar 2018 12:14:19 -0400 (EDT)
From: John Baldwin 
To: Jeff Roberson 
Cc: Li-Wen Hsu , "O. Hartmann" ,
 Jeff Roberson , pho@freebsd.org, svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r331606 - in head/sys: amd64/include i386/include
 x86/x86 x86/xen
Date: Wed, 28 Mar 2018 09:08:19 -0700
Message-ID: <2531747.pQxc7AOloZ@ralph.baldwin.cx>
User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; )
In-Reply-To: 
References: <201803270337.w2R3b4iv035285@repo.freebsd.org>
 <20180327101309.GA75720@freefall.freebsd.org>
 
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3
 (mail.baldwin.cx); Wed, 28 Mar 2018 12:14:20 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx
X-Virus-Status: Clean
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 16:14:29 -0000

On Tuesday, March 27, 2018 11:07:22 AM Jeff Roberson wrote:
> On Tue, 27 Mar 2018, Li-Wen Hsu wrote:
> 
> > On Mon, Mar 26, 2018 at 20:35:12 -1000, Jeff Roberson wrote:
> >> The patch has been on my branch for weeks and has been tested by a half
> >> dozen people.  I'm sorry it does not work for you.  If you reverted 331605
> >> the change that followed should not have built properly.  Did you build
> >> cleanly?  Can you share your kernel config?
> >>
> >> I tried with and without EARLY_AP_STARTUP and with and without NUMA.  I'm
> >> not having any trouble booting.  Did you make cleandepend && make depend?
> >
> > It also hangs in our testing system:
> >
> > https://ci.freebsd.org/job/FreeBSD-head-amd64-test/6817/console
> > https://ci.freebsd.org/job/FreeBSD-head-i386-test/1000/console
> >
> > It is built cleanly and uses unmodified GENERIC config.
> >
> > The artifacts used are available here:
> >
> > https://artifact.ci.freebsd.org/snapshot/head/r331606/amd64/amd64/
> > https://artifact.ci.freebsd.org/snapshot/head/r331606/i386/i386/
> >
> > Hope these information help.
> 
> Could someone who was experiencing the hang try the enclosed patch?  I can 
> only verify that it continues to boot for me but I believe this fixes the 
> bug on other systems.
> 
> I believe the issue was that cpuset_domain[0] was initialized too late on 
> some systems.  It depended on what kind of hardware was present and which 
> sysinit with SI_ORDER_ANY ran first.

Hmm, does this work if you don't use EARLY_AP_STARTUP?  I think all_cpus
isn't set yet (or only contains the BSP) when cpuset_thread0 is run if you
don't have EARLY_AP_STARTUP (and EARLY_AP_STARTUP is only supported on
x86 currently)

-- 
John Baldwin

From owner-svn-src-head@freebsd.org  Wed Mar 28 16:24:57 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1898EF6B240;
 Wed, 28 Mar 2018 16:24:57 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id BEA05748B4;
 Wed, 28 Mar 2018 16:24:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B55B856B8;
 Wed, 28 Mar 2018 16:24:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SGOuN9056376;
 Wed, 28 Mar 2018 16:24:56 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SGOuqu056373;
 Wed, 28 Mar 2018 16:24:56 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201803281624.w2SGOuqu056373@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin 
Date: Wed, 28 Mar 2018 16:24:56 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331681 - in head/sys: amd64/amd64 i386/i386
X-SVN-Group: head
X-SVN-Commit-Author: jhb
X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386
X-SVN-Commit-Revision: 331681
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 16:24:57 -0000

Author: jhb
Date: Wed Mar 28 16:24:56 2018
New Revision: 331681
URL: https://svnweb.freebsd.org/changeset/base/331681

Log:
  Fix kernel builds without options DDB after r331650.
  
  Reported by:	cy

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/i386/i386/machdep.c

Modified: head/sys/amd64/amd64/machdep.c
==============================================================================
--- head/sys/amd64/amd64/machdep.c	Wed Mar 28 14:44:45 2018	(r331680)
+++ head/sys/amd64/amd64/machdep.c	Wed Mar 28 16:24:56 2018	(r331681)
@@ -127,6 +127,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #ifdef SMP
 #include 

Modified: head/sys/i386/i386/machdep.c
==============================================================================
--- head/sys/i386/i386/machdep.c	Wed Mar 28 14:44:45 2018	(r331680)
+++ head/sys/i386/i386/machdep.c	Wed Mar 28 16:24:56 2018	(r331681)
@@ -129,6 +129,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #ifdef PERFMON

From owner-svn-src-head@freebsd.org  Wed Mar 28 16:28:23 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00A76F6B477;
 Wed, 28 Mar 2018 16:28:23 +0000 (UTC)
 (envelope-from bdrewery@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 1E7DC74C6B;
 Wed, 28 Mar 2018 16:28:22 +0000 (UTC)
 (envelope-from bdrewery@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13E8056BF;
 Wed, 28 Mar 2018 16:28:20 +0000 (UTC)
 (envelope-from bdrewery@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SGSKE6056661;
 Wed, 28 Mar 2018 16:28:20 GMT (envelope-from bdrewery@FreeBSD.org)
Received: (from bdrewery@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SGSKPa056658;
 Wed, 28 Mar 2018 16:28:20 GMT (envelope-from bdrewery@FreeBSD.org)
Message-Id: <201803281628.w2SGSKPa056658@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to
 bdrewery@FreeBSD.org using -f
From: Bryan Drewery 
Date: Wed, 28 Mar 2018 16:28:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331682 - in head: share/mk sys/conf
X-SVN-Group: head
X-SVN-Commit-Author: bdrewery
X-SVN-Commit-Paths: in head: share/mk sys/conf
X-SVN-Commit-Revision: 331682
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 16:28:23 -0000

Author: bdrewery
Date: Wed Mar 28 16:28:20 2018
New Revision: 331682
URL: https://svnweb.freebsd.org/changeset/base/331682

Log:
  Avoid upwards directory walk in kernel build for finding known SYSDIR.
  
  Sponsored by:	Dell EMC

Modified:
  head/share/mk/bsd.dtb.mk
  head/share/mk/bsd.kmod.mk
  head/sys/conf/kmod.mk

Modified: head/share/mk/bsd.dtb.mk
==============================================================================
--- head/share/mk/bsd.dtb.mk	Wed Mar 28 16:24:56 2018	(r331681)
+++ head/share/mk/bsd.dtb.mk	Wed Mar 28 16:28:20 2018	(r331682)
@@ -1,6 +1,7 @@
 # $FreeBSD$
 
 # Search for kernel source tree in standard places.
+.if empty(KERNBUILDDIR)
 .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
     ${.CURDIR}/../../../../.. /sys /usr/src/sys
 .if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
@@ -10,6 +11,7 @@ SYSDIR=	${_dir}
 .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \
     !exists(${SYSDIR}/conf/kmod.mk)
 .error Unable to locate the kernel source tree. Set SYSDIR to override.
+.endif
 .endif
 
 .include "${SYSDIR}/conf/dtb.mk"

Modified: head/share/mk/bsd.kmod.mk
==============================================================================
--- head/share/mk/bsd.kmod.mk	Wed Mar 28 16:24:56 2018	(r331681)
+++ head/share/mk/bsd.kmod.mk	Wed Mar 28 16:28:20 2018	(r331682)
@@ -1,6 +1,7 @@
 # $FreeBSD$
 
 # Search for kernel source tree in standard places.
+.if empty(KERNBUILDDIR)
 .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
     ${.CURDIR}/../../../../.. /sys /usr/src/sys
 .if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
@@ -10,6 +11,7 @@ SYSDIR=	${_dir:tA}
 .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \
     !exists(${SYSDIR}/conf/kmod.mk)
 .error Unable to locate the kernel source tree. Set SYSDIR to override.
+.endif
 .endif
 
 .include "${SYSDIR}/conf/kmod.mk"

Modified: head/sys/conf/kmod.mk
==============================================================================
--- head/sys/conf/kmod.mk	Wed Mar 28 16:24:56 2018	(r331681)
+++ head/sys/conf/kmod.mk	Wed Mar 28 16:28:20 2018	(r331682)
@@ -81,6 +81,7 @@ OBJCOPY?=	objcopy
 .include "config.mk"
 
 # Search for kernel source tree in standard places.
+.if empty(KERNBUILDDIR)
 .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
 .if !defined(SYSDIR) && exists(${_dir}/kern/)
 SYSDIR=	${_dir:tA}
@@ -88,6 +89,7 @@ SYSDIR=	${_dir:tA}
 .endfor
 .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/)
 .error "can't find kernel source tree"
+.endif
 .endif
 
 .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S .m

From owner-svn-src-head@freebsd.org  Wed Mar 28 16:28:25 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E805EF6B484;
 Wed, 28 Mar 2018 16:28:24 +0000 (UTC)
 (envelope-from bdrewery@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 9DA0074CA4;
 Wed, 28 Mar 2018 16:28:24 +0000 (UTC)
 (envelope-from bdrewery@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F08E56C0;
 Wed, 28 Mar 2018 16:28:24 +0000 (UTC)
 (envelope-from bdrewery@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SGSOGS056709;
 Wed, 28 Mar 2018 16:28:24 GMT (envelope-from bdrewery@FreeBSD.org)
Received: (from bdrewery@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SGSOqN056705;
 Wed, 28 Mar 2018 16:28:24 GMT (envelope-from bdrewery@FreeBSD.org)
Message-Id: <201803281628.w2SGSOqN056705@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to
 bdrewery@FreeBSD.org using -f
From: Bryan Drewery 
Date: Wed, 28 Mar 2018 16:28:24 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331683 - in head: share/mk sys/conf
X-SVN-Group: head
X-SVN-Commit-Author: bdrewery
X-SVN-Commit-Paths: in head: share/mk sys/conf
X-SVN-Commit-Revision: 331683
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 16:28:25 -0000

Author: bdrewery
Date: Wed Mar 28 16:28:24 2018
New Revision: 331683
URL: https://svnweb.freebsd.org/changeset/base/331683

Log:
  Avoid looping if SYSDIR already known.
  
  Sponsored by:	Dell EMC

Modified:
  head/share/mk/bsd.dtb.mk
  head/share/mk/bsd.kmod.mk
  head/sys/conf/kmod.mk

Modified: head/share/mk/bsd.dtb.mk
==============================================================================
--- head/share/mk/bsd.dtb.mk	Wed Mar 28 16:28:20 2018	(r331682)
+++ head/share/mk/bsd.dtb.mk	Wed Mar 28 16:28:24 2018	(r331683)
@@ -2,12 +2,14 @@
 
 # Search for kernel source tree in standard places.
 .if empty(KERNBUILDDIR)
+.if !defined(SYSDIR)
 .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
     ${.CURDIR}/../../../../.. /sys /usr/src/sys
-.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
+.if exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
 SYSDIR=	${_dir}
 .endif
 .endfor
+.endif
 .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \
     !exists(${SYSDIR}/conf/kmod.mk)
 .error Unable to locate the kernel source tree. Set SYSDIR to override.

Modified: head/share/mk/bsd.kmod.mk
==============================================================================
--- head/share/mk/bsd.kmod.mk	Wed Mar 28 16:28:20 2018	(r331682)
+++ head/share/mk/bsd.kmod.mk	Wed Mar 28 16:28:24 2018	(r331683)
@@ -2,12 +2,14 @@
 
 # Search for kernel source tree in standard places.
 .if empty(KERNBUILDDIR)
+.if !defined(SYSDIR)
 .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \
     ${.CURDIR}/../../../../.. /sys /usr/src/sys
-.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
+.if exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk)
 SYSDIR=	${_dir:tA}
 .endif
 .endfor
+.endif
 .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \
     !exists(${SYSDIR}/conf/kmod.mk)
 .error Unable to locate the kernel source tree. Set SYSDIR to override.

Modified: head/sys/conf/kmod.mk
==============================================================================
--- head/sys/conf/kmod.mk	Wed Mar 28 16:28:20 2018	(r331682)
+++ head/sys/conf/kmod.mk	Wed Mar 28 16:28:24 2018	(r331683)
@@ -82,11 +82,13 @@ OBJCOPY?=	objcopy
 
 # Search for kernel source tree in standard places.
 .if empty(KERNBUILDDIR)
+.if !defined(SYSDIR)
 .for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys
-.if !defined(SYSDIR) && exists(${_dir}/kern/)
+.if exists(${_dir}/kern/)
 SYSDIR=	${_dir:tA}
 .endif
 .endfor
+.endif
 .if !defined(SYSDIR) || !exists(${SYSDIR}/kern/)
 .error "can't find kernel source tree"
 .endif

From owner-svn-src-head@freebsd.org  Wed Mar 28 16:51:06 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38D31F6C07C;
 Wed, 28 Mar 2018 16:51:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E097F7657F;
 Wed, 28 Mar 2018 16:51:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB9665A2D;
 Wed, 28 Mar 2018 16:51:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SGp5ct069534;
 Wed, 28 Mar 2018 16:51:05 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SGp59K069533;
 Wed, 28 Mar 2018 16:51:05 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201803281651.w2SGp59K069533@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin 
Date: Wed, 28 Mar 2018 16:51:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331686 - head
X-SVN-Group: head
X-SVN-Commit-Author: jhb
X-SVN-Commit-Paths: head
X-SVN-Commit-Revision: 331686
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 16:51:06 -0000

Author: jhb
Date: Wed Mar 28 16:51:05 2018
New Revision: 331686
URL: https://svnweb.freebsd.org/changeset/base/331686

Log:
  Expand remaining instances of 'make kernel' to buildkernel + installkernel.
  
  The 'kernel' target is a bit more obscure compared to buildkernel and
  installkernel.  One instance was already expanded previously in r325097.

Modified:
  head/UPDATING

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Wed Mar 28 16:48:26 2018	(r331685)
+++ head/UPDATING	Wed Mar 28 16:51:05 2018	(r331686)
@@ -624,7 +624,8 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
 	rebooting, e.g.:
 
 	make buildworld
-	make kernel KERNCONF=YOUR_KERNEL_HERE
+	make buildkernel KERNCONF=YOUR_KERNEL_HERE
+	make installkernel KERNCONF=YOUR_KERNEL_HERE
 	make -C sys/boot install
 	
 
@@ -1995,7 +1996,8 @@ COMMON ITEMS:
 	----------------------------------------------
 	
 	make buildworld					[9]
-	make kernel KERNCONF=YOUR_KERNEL_HERE		[8]
+	make buildkernel KERNCONF=YOUR_KERNEL_HERE	[8]
+	make installkernel KERNCONF=YOUR_KERNEL_HERE
 							[1]
 					[3]
 	mergemaster -Fp					[5]

From owner-svn-src-head@freebsd.org  Wed Mar 28 17:39:24 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id A04E2F6DD82;
 Wed, 28 Mar 2018 17:39:24 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 273AB79B48;
 Wed, 28 Mar 2018 17:39:24 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D4CA96219;
 Wed, 28 Mar 2018 17:39:23 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SHdNvL094041;
 Wed, 28 Mar 2018 17:39:23 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SHdNtK094040;
 Wed, 28 Mar 2018 17:39:23 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201803281739.w2SHdNtK094040@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
 hselasky@FreeBSD.org using -f
From: Hans Petter Selasky 
Date: Wed, 28 Mar 2018 17:39:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331692 - head/sys/dev/usb/input
X-SVN-Group: head
X-SVN-Commit-Author: hselasky
X-SVN-Commit-Paths: head/sys/dev/usb/input
X-SVN-Commit-Revision: 331692
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 17:39:24 -0000

Author: hselasky
Date: Wed Mar 28 17:39:23 2018
New Revision: 331692
URL: https://svnweb.freebsd.org/changeset/base/331692

Log:
  Fix for regression issue in USB keyboard driver after r304735.
  
  A series of zero delay callouts can happen causing high CPU usage of the
  timer subsystem when trying to repeat keys, because the time of the
  absolute timeout is not moving forward. The condition clears when all
  keys are released.
  
  Reported by:	Johannes Lundberg 
  Discussed with:	bde@
  PR:		226968
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/usb/input/ukbd.c

Modified: head/sys/dev/usb/input/ukbd.c
==============================================================================
--- head/sys/dev/usb/input/ukbd.c	Wed Mar 28 17:19:04 2018	(r331691)
+++ head/sys/dev/usb/input/ukbd.c	Wed Mar 28 17:39:23 2018	(r331692)
@@ -386,10 +386,22 @@ ukbd_any_key_pressed(struct ukbd_softc *sc)
 static void
 ukbd_start_timer(struct ukbd_softc *sc)
 {
-	sbintime_t delay, prec;
+	sbintime_t delay, now, prec;
 
+	now = sbinuptime();
+
+	/* check if initial delay passed and fallback to key repeat delay */
+	if (sc->sc_delay == 0)
+		sc->sc_delay = sc->sc_kbd.kb_delay2;
+
+	/* compute timeout */
 	delay = SBT_1MS * sc->sc_delay;
 	sc->sc_co_basetime += delay;
+
+	/* check if we are running behind */
+	if (sc->sc_co_basetime < now)
+		sc->sc_co_basetime = now;
+
 	/* This is rarely called, so prefer precision to efficiency. */
 	prec = qmin(delay >> 7, SBT_1MS * 10);
 	usb_callout_reset_sbt(&sc->sc_callout, sc->sc_co_basetime, prec,
@@ -510,7 +522,6 @@ ukbd_get_key(struct ukbd_softc *sc, uint8_t wait)
 static void
 ukbd_interrupt(struct ukbd_softc *sc)
 {
-	struct timeval ctv;
 	uint32_t n_mod;
 	uint32_t o_mod;
 	uint32_t now = sc->sc_time_ms;
@@ -580,14 +591,11 @@ rfound:	;
 				break;
 			}
 		}
-		if (j < UKBD_NKEYCODE) {
-			/* Old key repeating. */
-			sc->sc_delay = sc->sc_kbd.kb_delay2;
-		} else {
-			/* New key. */
-			microuptime(&ctv);
-			sc->sc_co_basetime = tvtosbt(ctv);
+		if (j == UKBD_NKEYCODE) {
+			/* New key - set initial delay and [re]start timer */
+			sc->sc_co_basetime = sbinuptime();
 			sc->sc_delay = sc->sc_kbd.kb_delay1;
+			ukbd_start_timer(sc);
 		}
 		ukbd_put_key(sc, key | KEY_PRESS);
 
@@ -837,10 +845,6 @@ ukbd_intr_callback(struct usb_xfer *xfer, usb_error_t 
 		}
 
 		ukbd_interrupt(sc);
-
-		if (ukbd_any_key_pressed(sc) != 0) {
-			ukbd_start_timer(sc);
-		}
 
 	case USB_ST_SETUP:
 tr_setup:

From owner-svn-src-head@freebsd.org  Wed Mar 28 17:54:34 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF21AF6E2FD;
 Wed, 28 Mar 2018 17:54:34 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 796AD7A53F;
 Wed, 28 Mar 2018 17:54:34 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 701346574;
 Wed, 28 Mar 2018 17:54:34 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SHsYk6004014;
 Wed, 28 Mar 2018 17:54:34 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SHsYnW004013;
 Wed, 28 Mar 2018 17:54:34 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201803281754.w2SHsYnW004013@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
 hselasky@FreeBSD.org using -f
From: Hans Petter Selasky 
Date: Wed, 28 Mar 2018 17:54:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331694 - head/sys/compat/linuxkpi/common/include/linux
X-SVN-Group: head
X-SVN-Commit-Author: hselasky
X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux
X-SVN-Commit-Revision: 331694
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 17:54:35 -0000

Author: hselasky
Date: Wed Mar 28 17:54:34 2018
New Revision: 331694
URL: https://svnweb.freebsd.org/changeset/base/331694

Log:
  Swap two instances of regular macros with function macros in the LinuxKPI,
  to narrow down the substitution scope.
  
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/pci.h

Modified: head/sys/compat/linuxkpi/common/include/linux/pci.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/pci.h	Wed Mar 28 17:49:31 2018	(r331693)
+++ head/sys/compat/linuxkpi/common/include/linux/pci.h	Wed Mar 28 17:54:34 2018	(r331694)
@@ -538,7 +538,9 @@ struct msix_entry {
  * NB: define added to prevent this definition of pci_enable_msix from
  * clashing with the native FreeBSD version.
  */
-#define	pci_enable_msix		linux_pci_enable_msix
+#define	pci_enable_msix(...) \
+  linux_pci_enable_msix(__VA_ARGS__)
+
 static inline int
 pci_enable_msix(struct pci_dev *pdev, struct msix_entry *entries, int nreq)
 {
@@ -572,7 +574,9 @@ pci_enable_msix(struct pci_dev *pdev, struct msix_entr
 	return (0);
 }
 
-#define	pci_enable_msix_range	linux_pci_enable_msix_range
+#define	pci_enable_msix_range(...) \
+  linux_pci_enable_msix_range(__VA_ARGS__)
+
 static inline int
 pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries,
     int minvec, int maxvec)

From owner-svn-src-head@freebsd.org  Wed Mar 28 18:28:28 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39E7FF6F1B8;
 Wed, 28 Mar 2018 18:28:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E39717BD77;
 Wed, 28 Mar 2018 18:28:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8B436A46;
 Wed, 28 Mar 2018 18:28:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SISRa9019436;
 Wed, 28 Mar 2018 18:28:27 GMT (envelope-from gjb@FreeBSD.org)
Received: (from gjb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SISRvN019435;
 Wed, 28 Mar 2018 18:28:27 GMT (envelope-from gjb@FreeBSD.org)
Message-Id: <201803281828.w2SISRvN019435@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
 using -f
From: Glen Barber 
Date: Wed, 28 Mar 2018 18:28:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331696 - head/share/man/man7
X-SVN-Group: head
X-SVN-Commit-Author: gjb
X-SVN-Commit-Paths: head/share/man/man7
X-SVN-Commit-Revision: 331696
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 18:28:28 -0000

Author: gjb
Date: Wed Mar 28 18:28:27 2018
New Revision: 331696
URL: https://svnweb.freebsd.org/changeset/base/331696

Log:
  Update the Release Engineering article URL to the modern version.
  
  MFC after:	3 days
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/share/man/man7/release.7

Modified: head/share/man/man7/release.7
==============================================================================
--- head/share/man/man7/release.7	Wed Mar 28 18:12:06 2018	(r331695)
+++ head/share/man/man7/release.7	Wed Mar 28 18:28:27 2018	(r331696)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 28, 2017
+.Dd March 28, 2018
 .Dt RELEASE 7
 .Os
 .Sh NAME
@@ -709,7 +709,7 @@ variable in
 .Xr sysctl 8
 .Rs
 .%T "FreeBSD Release Engineering"
-.%U https://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/releng/
+.%U https://www.FreeBSD.org/doc/en_US.ISO8859-1/articles/freebsd-releng/
 .Re
 .Rs
 .%T "FreeBSD Developers' Handbook"

From owner-svn-src-head@freebsd.org  Wed Mar 28 18:43:06 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD95DF6FB57;
 Wed, 28 Mar 2018 18:43:06 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 60E2C7CDAD;
 Wed, 28 Mar 2018 18:43:06 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BDEE6D70;
 Wed, 28 Mar 2018 18:43:06 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SIh6l4029592;
 Wed, 28 Mar 2018 18:43:06 GMT (envelope-from gjb@FreeBSD.org)
Received: (from gjb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SIh6u6029591;
 Wed, 28 Mar 2018 18:43:06 GMT (envelope-from gjb@FreeBSD.org)
Message-Id: <201803281843.w2SIh6u6029591@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
 using -f
From: Glen Barber 
Date: Wed, 28 Mar 2018 18:43:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331697 - head/share/man/man7
X-SVN-Group: head
X-SVN-Commit-Author: gjb
X-SVN-Commit-Paths: head/share/man/man7
X-SVN-Commit-Revision: 331697
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 18:43:06 -0000

Author: gjb
Date: Wed Mar 28 18:43:06 2018
New Revision: 331697
URL: https://svnweb.freebsd.org/changeset/base/331697

Log:
  Add an example for building SD card images for the RPI-B and
  RPI3.
  
  MFC after:	3 days
  Suggested by:	Arshan Khanifar
  Reviewed by:	Arshan Khanifar 
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/share/man/man7/release.7

Modified: head/share/man/man7/release.7
==============================================================================
--- head/share/man/man7/release.7	Wed Mar 28 18:28:27 2018	(r331696)
+++ head/share/man/man7/release.7	Wed Mar 28 18:43:06 2018	(r331697)
@@ -687,6 +687,23 @@ cd /usr/src/release
 sh release.sh -c $HOME/release.conf
 .Ed
 .Pp
+Configuration files specific to various supported embedded systems, such as
+the Raspberry Pi, exist in the directory corresponding to the
+.Va TARGET
+.Xr make 1
+variable.
+For example, to build an image for the Raspberry Pi:
+.Bd -literal -offset indent
+cd /usr/src/release
+sh release.sh -c arm/RPI-B.conf
+.Ed
+.Pp
+To build an image for the Raspberry Pi 3:
+.Bd -literal -offset indent
+cd /usr/src/release
+sh release.sh -c arm64/RPI3.conf
+.Ed
+.Pp
 After running these commands, all prepared release files are available in the
 .Pa /scratch
 directory.

From owner-svn-src-head@freebsd.org  Wed Mar 28 18:47:37 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CADE5F6FCFE;
 Wed, 28 Mar 2018 18:47:36 +0000 (UTC)
 (envelope-from jeff@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 7C3487D01B;
 Wed, 28 Mar 2018 18:47:36 +0000 (UTC)
 (envelope-from jeff@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 578E86D71;
 Wed, 28 Mar 2018 18:47:36 +0000 (UTC)
 (envelope-from jeff@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SIlakb029832;
 Wed, 28 Mar 2018 18:47:36 GMT (envelope-from jeff@FreeBSD.org)
Received: (from jeff@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SIlZh9029824;
 Wed, 28 Mar 2018 18:47:35 GMT (envelope-from jeff@FreeBSD.org)
Message-Id: <201803281847.w2SIlZh9029824@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jeff set sender to
 jeff@FreeBSD.org using -f
From: Jeff Roberson 
Date: Wed, 28 Mar 2018 18:47:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331698 - in head/sys: amd64/include i386/include kern
 x86/x86 x86/xen
X-SVN-Group: head
X-SVN-Commit-Author: jeff
X-SVN-Commit-Paths: in head/sys: amd64/include i386/include kern x86/x86
 x86/xen
X-SVN-Commit-Revision: 331698
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 18:47:37 -0000

Author: jeff
Date: Wed Mar 28 18:47:35 2018
New Revision: 331698
URL: https://svnweb.freebsd.org/changeset/base/331698

Log:
  Restore r331606 with a bugfix to setup cpuset_domain[] earlier on all
  platforms.  Original commit message as follows:
  
  Only use CPUs in the domain the device is attached to for default
  assignment.  Device drivers are able to override the default assignment
  if they bind directly.  There are severe performance penalties for
  handling interrupts on remote CPUs and this should only be done in
  very controlled circumstances.
  
  Reviewed by:    jhb, kib
  Tested by:      pho
  Sponsored by:   Netflix, Dell/EMC Isilon
  Differential Revision:  https://reviews.freebsd.org/D14838

Modified:
  head/sys/amd64/include/intr_machdep.h
  head/sys/i386/include/intr_machdep.h
  head/sys/kern/kern_cpuset.c
  head/sys/x86/x86/intr_machdep.c
  head/sys/x86/x86/io_apic.c
  head/sys/x86/x86/msi.c
  head/sys/x86/x86/nexus.c
  head/sys/x86/xen/xen_intr.c

Modified: head/sys/amd64/include/intr_machdep.h
==============================================================================
--- head/sys/amd64/include/intr_machdep.h	Wed Mar 28 18:43:06 2018	(r331697)
+++ head/sys/amd64/include/intr_machdep.h	Wed Mar 28 18:47:35 2018	(r331698)
@@ -132,6 +132,7 @@ struct intsrc {
 	u_long *is_straycount;
 	u_int is_index;
 	u_int is_handlers;
+	u_int is_domain;
 	u_int is_cpu;
 };
 
@@ -168,7 +169,7 @@ void	intr_add_cpu(u_int cpu);
 #endif
 int	intr_add_handler(const char *name, int vector, driver_filter_t filter, 
 			 driver_intr_t handler, void *arg, enum intr_type flags, 
-			 void **cookiep);    
+			 void **cookiep, int domain);    
 #ifdef SMP
 int	intr_bind(u_int vector, u_char cpu);
 #endif
@@ -176,7 +177,7 @@ int	intr_config_intr(int vector, enum intr_trigger tri
     enum intr_polarity pol);
 int	intr_describe(u_int vector, void *ih, const char *descr);
 void	intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame);
-u_int	intr_next_cpu(void);
+u_int	intr_next_cpu(int domain);
 struct intsrc *intr_lookup_source(int vector);
 int	intr_register_pic(struct pic *pic);
 int	intr_register_source(struct intsrc *isrc);

Modified: head/sys/i386/include/intr_machdep.h
==============================================================================
--- head/sys/i386/include/intr_machdep.h	Wed Mar 28 18:43:06 2018	(r331697)
+++ head/sys/i386/include/intr_machdep.h	Wed Mar 28 18:47:35 2018	(r331698)
@@ -132,6 +132,7 @@ struct intsrc {
 	u_long *is_straycount;
 	u_int is_index;
 	u_int is_handlers;
+	u_int is_domain;
 	u_int is_cpu;
 };
 
@@ -158,7 +159,8 @@ void	elcr_write_trigger(u_int irq, enum intr_trigger t
 void	intr_add_cpu(u_int cpu);
 #endif
 int	intr_add_handler(const char *name, int vector, driver_filter_t filter,
-    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep);
+    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep,
+    int domain);
 #ifdef SMP
 int	intr_bind(u_int vector, u_char cpu);
 #endif
@@ -166,7 +168,7 @@ int	intr_config_intr(int vector, enum intr_trigger tri
     enum intr_polarity pol);
 int	intr_describe(u_int vector, void *ih, const char *descr);
 void	intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame);
-u_int	intr_next_cpu(void);
+u_int	intr_next_cpu(int domain);
 struct intsrc *intr_lookup_source(int vector);
 int	intr_register_pic(struct pic *pic);
 int	intr_register_source(struct intsrc *isrc);

Modified: head/sys/kern/kern_cpuset.c
==============================================================================
--- head/sys/kern/kern_cpuset.c	Wed Mar 28 18:43:06 2018	(r331697)
+++ head/sys/kern/kern_cpuset.c	Wed Mar 28 18:47:35 2018	(r331698)
@@ -1363,6 +1363,7 @@ cpuset_thread0(void)
 {
 	struct cpuset *set;
 	int error;
+	int i;
 
 	cpuset_zone = uma_zcreate("cpuset", sizeof(struct cpuset), NULL, NULL,
 	    NULL, NULL, UMA_ALIGN_PTR, 0);
@@ -1374,11 +1375,11 @@ cpuset_thread0(void)
 	 * cpuset_create() due to NULL parent.
 	 */
 	set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO);
-	CPU_FILL(&set->cs_mask);
+	CPU_COPY(&all_cpus, &set->cs_mask);
 	LIST_INIT(&set->cs_children);
 	LIST_INSERT_HEAD(&cpuset_ids, set, cs_link);
 	set->cs_ref = 1;
-	set->cs_flags = CPU_SET_ROOT;
+	set->cs_flags = CPU_SET_ROOT | CPU_SET_RDONLY;
 	set->cs_domain = &domainset0;
 	cpuset_zero = set;
 	cpuset_root = &set->cs_mask;
@@ -1396,6 +1397,16 @@ cpuset_thread0(void)
 	 */
 	cpuset_unr = new_unrhdr(2, INT_MAX, NULL);
 
+	/*
+	 * If MD code has not initialized per-domain cpusets, place all
+	 * CPUs in domain 0.
+	 */
+	for (i = 0; i < MAXMEMDOM; i++)
+		if (!CPU_EMPTY(&cpuset_domain[i]))
+			goto domains_set;
+	CPU_COPY(&all_cpus, &cpuset_domain[0]);
+domains_set:
+
 	return (set);
 }
 
@@ -1446,34 +1457,6 @@ cpuset_setproc_update_set(struct proc *p, struct cpuse
 	cpuset_rel(set);
 	return (0);
 }
-
-/*
- * This is called once the final set of system cpus is known.  Modifies
- * the root set and all children and mark the root read-only.  
- */
-static void
-cpuset_init(void *arg)
-{
-	cpuset_t mask;
-	int i;
-
-	mask = all_cpus;
-	if (cpuset_modify(cpuset_zero, &mask))
-		panic("Can't set initial cpuset mask.\n");
-	cpuset_zero->cs_flags |= CPU_SET_RDONLY;
-
-	/*
-	 * If MD code has not initialized per-domain cpusets, place all
-	 * CPUs in domain 0.
-	 */
-	for (i = 0; i < MAXMEMDOM; i++)
-		if (!CPU_EMPTY(&cpuset_domain[i]))
-			goto domains_set;
-	CPU_COPY(&all_cpus, &cpuset_domain[0]);
-domains_set:
-	return;
-}
-SYSINIT(cpuset, SI_SUB_SMP, SI_ORDER_ANY, cpuset_init, NULL);
 
 #ifndef _SYS_SYSPROTO_H_
 struct cpuset_args {

Modified: head/sys/x86/x86/intr_machdep.c
==============================================================================
--- head/sys/x86/x86/intr_machdep.c	Wed Mar 28 18:43:06 2018	(r331697)
+++ head/sys/x86/x86/intr_machdep.c	Wed Mar 28 18:47:35 2018	(r331698)
@@ -71,6 +71,8 @@
 #include 
 #endif
 
+#include 
+
 #define	MAX_STRAY_LOG	5
 
 typedef void (*mask_fn)(void *);
@@ -185,7 +187,8 @@ intr_lookup_source(int vector)
 
 int
 intr_add_handler(const char *name, int vector, driver_filter_t filter,
-    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep)
+    driver_intr_t handler, void *arg, enum intr_type flags, void **cookiep,
+    int domain)
 {
 	struct intsrc *isrc;
 	int error;
@@ -200,6 +203,7 @@ intr_add_handler(const char *name, int vector, driver_
 		intrcnt_updatename(isrc);
 		isrc->is_handlers++;
 		if (isrc->is_handlers == 1) {
+			isrc->is_domain = domain;
 			isrc->is_pic->pic_enable_intr(isrc);
 			isrc->is_pic->pic_enable_source(isrc);
 		}
@@ -507,14 +511,27 @@ DB_SHOW_COMMAND(irqs, db_show_irqs)
  */
 
 cpuset_t intr_cpus = CPUSET_T_INITIALIZER(0x1);
-static int current_cpu;
+static int current_cpu[MAXMEMDOM];
 
+static void
+intr_init_cpus(void)
+{
+	int i;
+
+	for (i = 0; i < vm_ndomains; i++) {
+		current_cpu[i] = 0;
+		if (!CPU_ISSET(current_cpu[i], &intr_cpus) ||
+		    !CPU_ISSET(current_cpu[i], &cpuset_domain[i]))
+			intr_next_cpu(i);
+	}
+}
+
 /*
  * Return the CPU that the next interrupt source should use.  For now
  * this just returns the next local APIC according to round-robin.
  */
 u_int
-intr_next_cpu(void)
+intr_next_cpu(int domain)
 {
 	u_int apic_id;
 
@@ -529,12 +546,13 @@ intr_next_cpu(void)
 #endif
 
 	mtx_lock_spin(&icu_lock);
-	apic_id = cpu_apic_ids[current_cpu];
+	apic_id = cpu_apic_ids[current_cpu[domain]];
 	do {
-		current_cpu++;
-		if (current_cpu > mp_maxid)
-			current_cpu = 0;
-	} while (!CPU_ISSET(current_cpu, &intr_cpus));
+		current_cpu[domain]++;
+		if (current_cpu[domain] > mp_maxid)
+			current_cpu[domain] = 0;
+	} while (!CPU_ISSET(current_cpu[domain], &intr_cpus) ||
+	    !CPU_ISSET(current_cpu[domain], &cpuset_domain[domain]));
 	mtx_unlock_spin(&icu_lock);
 	return (apic_id);
 }
@@ -568,7 +586,18 @@ intr_add_cpu(u_int cpu)
 	CPU_SET(cpu, &intr_cpus);
 }
 
-#ifndef EARLY_AP_STARTUP
+#ifdef EARLY_AP_STARTUP
+static void
+intr_smp_startup(void *arg __unused)
+{
+
+	intr_init_cpus();
+	return;
+}
+SYSINIT(intr_smp_startup, SI_SUB_SMP, SI_ORDER_SECOND, intr_smp_startup,
+    NULL);
+
+#else
 /*
  * Distribute all the interrupt sources among the available CPUs once the
  * AP's have been launched.
@@ -580,6 +609,7 @@ intr_shuffle_irqs(void *arg __unused)
 	u_int cpu;
 	int i;
 
+	intr_init_cpus();
 	/* Don't bother on UP. */
 	if (mp_ncpus == 1)
 		return;
@@ -599,12 +629,12 @@ intr_shuffle_irqs(void *arg __unused)
 			 */
 			cpu = isrc->is_event->ie_cpu;
 			if (cpu == NOCPU)
-				cpu = current_cpu;
+				cpu = current_cpu[isrc->is_domain];
 			if (isrc->is_pic->pic_assign_cpu(isrc,
 			    cpu_apic_ids[cpu]) == 0) {
 				isrc->is_cpu = cpu;
 				if (isrc->is_event->ie_cpu == NOCPU)
-					intr_next_cpu();
+					intr_next_cpu(isrc->is_domain);
 			}
 		}
 	}
@@ -635,10 +665,11 @@ sysctl_hw_intrs(SYSCTL_HANDLER_ARGS)
 		isrc = interrupt_sources[i];
 		if (isrc == NULL)
 			continue;
-		sbuf_printf(&sbuf, "%s:%d @%d: %ld\n",
+		sbuf_printf(&sbuf, "%s:%d @cpu%d(domain%d): %ld\n",
 		    isrc->is_event->ie_fullname,
 		    isrc->is_index,
 		    isrc->is_cpu,
+		    isrc->is_domain,
 		    *isrc->is_count);
 	}
 
@@ -697,7 +728,7 @@ intr_balance(void *dummy __unused, int pending __unuse
 	 * Restart the scan from the same location to avoid moving in the
 	 * common case.
 	 */
-	current_cpu = 0;
+	intr_init_cpus();
 
 	/*
 	 * Assign round-robin from most loaded to least.
@@ -706,8 +737,8 @@ intr_balance(void *dummy __unused, int pending __unuse
 		isrc = interrupt_sorted[i];
 		if (isrc == NULL  || isrc->is_event->ie_cpu != NOCPU)
 			continue;
-		cpu = current_cpu;
-		intr_next_cpu();
+		cpu = current_cpu[isrc->is_domain];
+		intr_next_cpu(isrc->is_domain);
 		if (isrc->is_cpu != cpu &&
 		    isrc->is_pic->pic_assign_cpu(isrc,
 		    cpu_apic_ids[cpu]) == 0)
@@ -735,7 +766,7 @@ SYSINIT(intr_balance_init, SI_SUB_SMP, SI_ORDER_ANY, i
  * Always route interrupts to the current processor in the UP case.
  */
 u_int
-intr_next_cpu(void)
+intr_next_cpu(int domain)
 {
 
 	return (PCPU_GET(apic_id));

Modified: head/sys/x86/x86/io_apic.c
==============================================================================
--- head/sys/x86/x86/io_apic.c	Wed Mar 28 18:43:06 2018	(r331697)
+++ head/sys/x86/x86/io_apic.c	Wed Mar 28 18:47:35 2018	(r331698)
@@ -499,7 +499,7 @@ ioapic_enable_intr(struct intsrc *isrc)
 	struct ioapic_intsrc *intpin = (struct ioapic_intsrc *)isrc;
 
 	if (intpin->io_vector == 0)
-		if (ioapic_assign_cpu(isrc, intr_next_cpu()) != 0)
+		if (ioapic_assign_cpu(isrc, intr_next_cpu(isrc->is_domain)) != 0)
 			panic("Couldn't find an APIC vector for IRQ %d",
 			    intpin->io_irq);
 	apic_enable_vector(intpin->io_cpu, intpin->io_vector);

Modified: head/sys/x86/x86/msi.c
==============================================================================
--- head/sys/x86/x86/msi.c	Wed Mar 28 18:43:06 2018	(r331697)
+++ head/sys/x86/x86/msi.c	Wed Mar 28 18:47:35 2018	(r331698)
@@ -363,7 +363,7 @@ int
 msi_alloc(device_t dev, int count, int maxcount, int *irqs)
 {
 	struct msi_intsrc *msi, *fsrc;
-	u_int cpu;
+	u_int cpu, domain;
 	int cnt, i, *mirqs, vector;
 #ifdef ACPI_DMAR
 	u_int cookies[count];
@@ -373,6 +373,9 @@ msi_alloc(device_t dev, int count, int maxcount, int *
 	if (!msi_enabled)
 		return (ENXIO);
 
+	if (bus_get_domain(dev, &domain) != 0)
+		domain = 0;
+
 	if (count > 1)
 		mirqs = malloc(count * sizeof(*mirqs), M_MSI, M_WAITOK);
 	else
@@ -420,7 +423,7 @@ again:
 	KASSERT(cnt == count, ("count mismatch"));
 
 	/* Allocate 'count' IDT vectors. */
-	cpu = intr_next_cpu();
+	cpu = intr_next_cpu(domain);
 	vector = apic_alloc_vectors(cpu, irqs, count, maxcount);
 	if (vector == 0) {
 		mtx_unlock(&msi_lock);
@@ -610,7 +613,7 @@ int
 msix_alloc(device_t dev, int *irq)
 {
 	struct msi_intsrc *msi;
-	u_int cpu;
+	u_int cpu, domain;
 	int i, vector;
 #ifdef ACPI_DMAR
 	u_int cookie;
@@ -620,6 +623,9 @@ msix_alloc(device_t dev, int *irq)
 	if (!msi_enabled)
 		return (ENXIO);
 
+	if (bus_get_domain(dev, &domain) != 0)
+		domain = 0;
+
 again:
 	mtx_lock(&msi_lock);
 
@@ -651,7 +657,7 @@ again:
 	}
 
 	/* Allocate an IDT vector. */
-	cpu = intr_next_cpu();
+	cpu = intr_next_cpu(domain);
 	vector = apic_alloc_vector(cpu, i);
 	if (vector == 0) {
 		mtx_unlock(&msi_lock);

Modified: head/sys/x86/x86/nexus.c
==============================================================================
--- head/sys/x86/x86/nexus.c	Wed Mar 28 18:43:06 2018	(r331697)
+++ head/sys/x86/x86/nexus.c	Wed Mar 28 18:47:35 2018	(r331698)
@@ -573,7 +573,7 @@ nexus_setup_intr(device_t bus, device_t child, struct 
 		 int flags, driver_filter_t filter, void (*ihand)(void *),
 		 void *arg, void **cookiep)
 {
-	int		error;
+	int		error, domain;
 
 	/* somebody tried to setup an irq that failed to allocate! */
 	if (irq == NULL)
@@ -589,9 +589,11 @@ nexus_setup_intr(device_t bus, device_t child, struct 
 	error = rman_activate_resource(irq);
 	if (error)
 		return (error);
+	if (bus_get_domain(child, &domain) != 0)
+		domain = 0;
 
 	error = intr_add_handler(device_get_nameunit(child),
-	    rman_get_start(irq), filter, ihand, arg, flags, cookiep);
+	    rman_get_start(irq), filter, ihand, arg, flags, cookiep, domain);
 
 	return (error);
 }

Modified: head/sys/x86/xen/xen_intr.c
==============================================================================
--- head/sys/x86/xen/xen_intr.c	Wed Mar 28 18:43:06 2018	(r331697)
+++ head/sys/x86/xen/xen_intr.c	Wed Mar 28 18:47:35 2018	(r331698)
@@ -430,7 +430,7 @@ xen_intr_bind_isrc(struct xenisrc **isrcp, evtchn_port
 		 * unless specified otherwise, so shuffle them to balance
 		 * the interrupt load.
 		 */
-		xen_intr_assign_cpu(&isrc->xi_intsrc, intr_next_cpu());
+		xen_intr_assign_cpu(&isrc->xi_intsrc, intr_next_cpu(0));
 	}
 #endif
 
@@ -1562,7 +1562,7 @@ xen_intr_add_handler(const char *name, driver_filter_t
 		return (EINVAL);
 
 	error = intr_add_handler(name, isrc->xi_vector,filter, handler, arg,
-	    flags|INTR_EXCL, &isrc->xi_cookie);
+	    flags|INTR_EXCL, &isrc->xi_cookie, 0);
 	if (error != 0) {
 		printf(
 		    "%s: xen_intr_add_handler: intr_add_handler failed: %d\n",

From owner-svn-src-head@freebsd.org  Wed Mar 28 19:54:50 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F034F71985;
 Wed, 28 Mar 2018 19:54:50 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from tensor.andric.com (tensor.andric.com [87.251.56.140])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "tensor.andric.com",
 Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id BE3C77FE75;
 Wed, 28 Mar 2018 19:54:49 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from coleburn.home.andric.com (coleburn.home.andric.com
 [192.168.0.15])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (No client certificate requested)
 by tensor.andric.com (Postfix) with ESMTPSA id C8D593680B;
 Wed, 28 Mar 2018 21:54:41 +0200 (CEST)
From: Dimitry Andric 
Message-Id: <3653AD2C-F427-4BE7-874C-FF3AF3BDA85D@FreeBSD.org>
Content-Type: multipart/signed;
 boundary="Apple-Mail=_D2238B82-5359-4904-BC5F-4728A6A0C306";
 protocol="application/pgp-signature"; micalg=pgp-sha1
Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\))
Subject: Re: svn commit: r331686 - head
Date: Wed, 28 Mar 2018 21:54:41 +0200
In-Reply-To: <201803281651.w2SGp59K069533@repo.freebsd.org>
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
To: John Baldwin 
References: <201803281651.w2SGp59K069533@repo.freebsd.org>
X-Mailer: Apple Mail (2.3273)
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 19:54:50 -0000


--Apple-Mail=_D2238B82-5359-4904-BC5F-4728A6A0C306
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

On 28 Mar 2018, at 18:51, John Baldwin  wrote:
>=20
> Author: jhb
> Date: Wed Mar 28 16:51:05 2018
> New Revision: 331686
> URL: https://svnweb.freebsd.org/changeset/base/331686
>=20
> Log:
>  Expand remaining instances of 'make kernel' to buildkernel + =
installkernel.
>=20
>  The 'kernel' target is a bit more obscure compared to buildkernel and
>  installkernel.

The 'kernel' target doesn't seem that obscure to me, it is clearly
documented in build(7), right?  In my opinion, the main advantage of
separate build and install steps is that you can run the former as a
non-privileged user, while only having to run the latter as super-user.

-Dimitry


--Apple-Mail=_D2238B82-5359-4904-BC5F-4728A6A0C306
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.2

iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCWrvzAQAKCRCwXqMKLiCW
oyJsAKC67EzcDGx3uWKUAUaSZi8pT+Rd9wCg+cgvLbmXVNBQenx7jMyAFirfqFM=
=O2e+
-----END PGP SIGNATURE-----

--Apple-Mail=_D2238B82-5359-4904-BC5F-4728A6A0C306--

From owner-svn-src-head@freebsd.org  Wed Mar 28 20:41:16 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1295F72C6A;
 Wed, 28 Mar 2018 20:41:15 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 715E081DBC;
 Wed, 28 Mar 2018 20:41:15 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C33010030;
 Wed, 28 Mar 2018 20:41:15 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SKfFXi089767;
 Wed, 28 Mar 2018 20:41:15 GMT (envelope-from mav@FreeBSD.org)
Received: (from mav@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SKfFba089765;
 Wed, 28 Mar 2018 20:41:15 GMT (envelope-from mav@FreeBSD.org)
Message-Id: <201803282041.w2SKfFba089765@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
 using -f
From: Alexander Motin 
Date: Wed, 28 Mar 2018 20:41:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331699 - in head/cddl/contrib/opensolaris/cmd: zdb ztest
X-SVN-Group: head
X-SVN-Commit-Author: mav
X-SVN-Commit-Paths: in head/cddl/contrib/opensolaris/cmd: zdb ztest
X-SVN-Commit-Revision: 331699
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 20:41:16 -0000

Author: mav
Date: Wed Mar 28 20:41:15 2018
New Revision: 331699
URL: https://svnweb.freebsd.org/changeset/base/331699

Log:
  Partial MFV r329753:
  8809 libzpool should leverage work done in libfakekernel
  
  illumos/illumos-gate@f06dce2c1f0f3af78581e7574f65bfba843ddb6e
  
  Reviewed by: Sebastien Roy 
  Reviewed by: Prakash Surya 
  Reviewed by: Gordon Ross 
  Approved by: Richard Lowe 
  Author: Andrew Stormont 
  
  We do not have libfakekernel, but need to reduce code divergence.

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/cmd/zdb/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Wed Mar 28 18:47:35 2018	(r331698)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Wed Mar 28 20:41:15 2018	(r331699)
@@ -24,6 +24,7 @@
  * Copyright (c) 2011, 2017 by Delphix. All rights reserved.
  * Copyright (c) 2014 Integros [integros.com]
  * Copyright 2017 Nexenta Systems, Inc.
+ * Copyright 2017 RackTop Systems.
  */
 
 #include 
@@ -88,12 +89,14 @@ extern boolean_t zfs_recover;
 extern uint64_t zfs_arc_max, zfs_arc_meta_limit;
 extern int zfs_vdev_async_read_max_active;
 extern boolean_t spa_load_verify_dryrun;
+extern int aok;
 #else
 int reference_tracking_enable;
 boolean_t zfs_recover;
 uint64_t zfs_arc_max, zfs_arc_meta_limit;
 int zfs_vdev_async_read_max_active;
 boolean_t spa_load_verify_dryrun;
+int aok;
 #endif
 
 static const char cmdname[] = "zdb";

Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Wed Mar 28 18:47:35 2018	(r331698)
+++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Wed Mar 28 20:41:15 2018	(r331699)
@@ -26,6 +26,7 @@
  * Copyright (c) 2013 Steven Hartland. All rights reserved.
  * Copyright (c) 2014 Integros [integros.com]
  * Copyright 2017 Joyent, Inc.
+ * Copyright 2017 RackTop Systems.
  */
 
 /*
@@ -247,8 +248,8 @@ typedef enum {
 typedef struct rll {
 	void		*rll_writer;
 	int		rll_readers;
-	mutex_t		rll_lock;
-	cond_t		rll_cv;
+	kmutex_t	rll_lock;
+	kcondvar_t	rll_cv;
 } rll_t;
 
 typedef struct rl {
@@ -282,11 +283,11 @@ typedef struct ztest_od {
 typedef struct ztest_ds {
 	ztest_shared_ds_t *zd_shared;
 	objset_t	*zd_os;
-	rwlock_t	zd_zilog_lock;
+	krwlock_t	zd_zilog_lock;
 	zilog_t		*zd_zilog;
 	ztest_od_t	*zd_od;		/* debugging aid */
 	char		zd_name[ZFS_MAX_DATASET_NAME_LEN];
-	mutex_t		zd_dirobj_lock;
+	kmutex_t	zd_dirobj_lock;
 	rll_t		zd_object_lock[ZTEST_OBJECT_LOCKS];
 	rll_t		zd_range_lock[ZTEST_RANGE_LOCKS];
 } ztest_ds_t;
@@ -397,7 +398,7 @@ ztest_info_t ztest_info[] = {
  * The callbacks are ordered by txg number.
  */
 typedef struct ztest_cb_list {
-	mutex_t	zcl_callbacks_lock;
+	kmutex_t zcl_callbacks_lock;
 	list_t	zcl_callbacks;
 } ztest_cb_list_t;
 
@@ -432,7 +433,7 @@ ztest_shared_t *ztest_shared;
 static spa_t *ztest_spa = NULL;
 static ztest_ds_t *ztest_ds;
 
-static mutex_t ztest_vdev_lock;
+static kmutex_t ztest_vdev_lock;
 
 /*
  * The ztest_name_lock protects the pool and dataset namespace used by
@@ -440,7 +441,7 @@ static mutex_t ztest_vdev_lock;
  * this lock as writer. Grabbing the lock as reader will ensure that the
  * namespace does not change while the lock is held.
  */
-static rwlock_t ztest_name_lock;
+static krwlock_t ztest_name_lock;
 
 static boolean_t ztest_dump_core = B_TRUE;
 static boolean_t ztest_exiting;
@@ -1096,8 +1097,8 @@ ztest_rll_init(rll_t *rll)
 {
 	rll->rll_writer = NULL;
 	rll->rll_readers = 0;
-	VERIFY(_mutex_init(&rll->rll_lock, USYNC_THREAD, NULL) == 0);
-	VERIFY(cond_init(&rll->rll_cv, USYNC_THREAD, NULL) == 0);
+	mutex_init(&rll->rll_lock, NULL, USYNC_THREAD, NULL);
+	cv_init(&rll->rll_cv, NULL, USYNC_THREAD, NULL);
 }
 
 static void
@@ -1105,32 +1106,32 @@ ztest_rll_destroy(rll_t *rll)
 {
 	ASSERT(rll->rll_writer == NULL);
 	ASSERT(rll->rll_readers == 0);
-	VERIFY(_mutex_destroy(&rll->rll_lock) == 0);
-	VERIFY(cond_destroy(&rll->rll_cv) == 0);
+	mutex_destroy(&rll->rll_lock);
+	cv_destroy(&rll->rll_cv);
 }
 
 static void
 ztest_rll_lock(rll_t *rll, rl_type_t type)
 {
-	VERIFY(mutex_lock(&rll->rll_lock) == 0);
+	mutex_enter(&rll->rll_lock);
 
 	if (type == RL_READER) {
 		while (rll->rll_writer != NULL)
-			(void) cond_wait(&rll->rll_cv, &rll->rll_lock);
+			cv_wait(&rll->rll_cv, &rll->rll_lock);
 		rll->rll_readers++;
 	} else {
 		while (rll->rll_writer != NULL || rll->rll_readers)
-			(void) cond_wait(&rll->rll_cv, &rll->rll_lock);
+			cv_wait(&rll->rll_cv, &rll->rll_lock);
 		rll->rll_writer = curthread;
 	}
 
-	VERIFY(mutex_unlock(&rll->rll_lock) == 0);
+	mutex_exit(&rll->rll_lock);
 }
 
 static void
 ztest_rll_unlock(rll_t *rll)
 {
-	VERIFY(mutex_lock(&rll->rll_lock) == 0);
+	mutex_enter(&rll->rll_lock);
 
 	if (rll->rll_writer) {
 		ASSERT(rll->rll_readers == 0);
@@ -1142,9 +1143,9 @@ ztest_rll_unlock(rll_t *rll)
 	}
 
 	if (rll->rll_writer == NULL && rll->rll_readers == 0)
-		VERIFY(cond_broadcast(&rll->rll_cv) == 0);
+		cv_broadcast(&rll->rll_cv);
 
-	VERIFY(mutex_unlock(&rll->rll_lock) == 0);
+	mutex_exit(&rll->rll_lock);
 }
 
 static void
@@ -1203,8 +1204,8 @@ ztest_zd_init(ztest_ds_t *zd, ztest_shared_ds_t *szd, 
 	if (zd->zd_shared != NULL)
 		zd->zd_shared->zd_seq = 0;
 
-	VERIFY(rwlock_init(&zd->zd_zilog_lock, USYNC_THREAD, NULL) == 0);
-	VERIFY(_mutex_init(&zd->zd_dirobj_lock, USYNC_THREAD, NULL) == 0);
+	rw_init(&zd->zd_zilog_lock, NULL, USYNC_THREAD, NULL);
+	mutex_init(&zd->zd_dirobj_lock, NULL, USYNC_THREAD, NULL);
 
 	for (int l = 0; l < ZTEST_OBJECT_LOCKS; l++)
 		ztest_rll_init(&zd->zd_object_lock[l]);
@@ -1216,7 +1217,7 @@ ztest_zd_init(ztest_ds_t *zd, ztest_shared_ds_t *szd, 
 static void
 ztest_zd_fini(ztest_ds_t *zd)
 {
-	VERIFY(_mutex_destroy(&zd->zd_dirobj_lock) == 0);
+	mutex_destroy(&zd->zd_dirobj_lock);
 
 	for (int l = 0; l < ZTEST_OBJECT_LOCKS; l++)
 		ztest_rll_destroy(&zd->zd_object_lock[l]);
@@ -1971,7 +1972,7 @@ ztest_lookup(ztest_ds_t *zd, ztest_od_t *od, int count
 	int missing = 0;
 	int error;
 
-	ASSERT(_mutex_held(&zd->zd_dirobj_lock));
+	ASSERT(MUTEX_HELD(&zd->zd_dirobj_lock));
 
 	for (int i = 0; i < count; i++, od++) {
 		od->od_object = 0;
@@ -2011,7 +2012,7 @@ ztest_create(ztest_ds_t *zd, ztest_od_t *od, int count
 {
 	int missing = 0;
 
-	ASSERT(_mutex_held(&zd->zd_dirobj_lock));
+	ASSERT(MUTEX_HELD(&zd->zd_dirobj_lock));
 
 	for (int i = 0; i < count; i++, od++) {
 		if (missing) {
@@ -2056,7 +2057,7 @@ ztest_remove(ztest_ds_t *zd, ztest_od_t *od, int count
 	int missing = 0;
 	int error;
 
-	ASSERT(_mutex_held(&zd->zd_dirobj_lock));
+	ASSERT(MUTEX_HELD(&zd->zd_dirobj_lock));
 
 	od += count - 1;
 
@@ -2202,7 +2203,7 @@ ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t off
 	if (ztest_random(2) == 0)
 		io_type = ZTEST_IO_WRITE_TAG;
 
-	(void) rw_rdlock(&zd->zd_zilog_lock);
+	rw_enter(&zd->zd_zilog_lock, RW_READER);
 
 	switch (io_type) {
 
@@ -2239,7 +2240,7 @@ ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t off
 		break;
 
 	case ZTEST_IO_REWRITE:
-		(void) rw_rdlock(&ztest_name_lock);
+		rw_enter(&ztest_name_lock, RW_READER);
 		err = ztest_dsl_prop_set_uint64(zd->zd_name,
 		    ZFS_PROP_CHECKSUM, spa_dedup_checksum(ztest_spa),
 		    B_FALSE);
@@ -2249,7 +2250,7 @@ ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t off
 		    ztest_random_dsl_prop(ZFS_PROP_COMPRESSION),
 		    B_FALSE);
 		VERIFY(err == 0 || err == ENOSPC);
-		(void) rw_unlock(&ztest_name_lock);
+		rw_exit(&ztest_name_lock);
 
 		VERIFY0(dmu_read(zd->zd_os, object, offset, blocksize, data,
 		    DMU_READ_NO_PREFETCH));
@@ -2258,7 +2259,7 @@ ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t off
 		break;
 	}
 
-	(void) rw_unlock(&zd->zd_zilog_lock);
+	rw_exit(&zd->zd_zilog_lock);
 
 	umem_free(data, blocksize);
 }
@@ -2297,13 +2298,13 @@ ztest_object_init(ztest_ds_t *zd, ztest_od_t *od, size
 	int count = size / sizeof (*od);
 	int rv = 0;
 
-	VERIFY(mutex_lock(&zd->zd_dirobj_lock) == 0);
+	mutex_enter(&zd->zd_dirobj_lock);
 	if ((ztest_lookup(zd, od, count) != 0 || remove) &&
 	    (ztest_remove(zd, od, count) != 0 ||
 	    ztest_create(zd, od, count) != 0))
 		rv = -1;
 	zd->zd_od = od;
-	VERIFY(mutex_unlock(&zd->zd_dirobj_lock) == 0);
+	mutex_exit(&zd->zd_dirobj_lock);
 
 	return (rv);
 }
@@ -2314,7 +2315,7 @@ ztest_zil_commit(ztest_ds_t *zd, uint64_t id)
 {
 	zilog_t *zilog = zd->zd_zilog;
 
-	(void) rw_rdlock(&zd->zd_zilog_lock);
+	rw_enter(&zd->zd_zilog_lock, RW_READER);
 
 	zil_commit(zilog, ztest_random(ZTEST_OBJECTS));
 
@@ -2329,7 +2330,7 @@ ztest_zil_commit(ztest_ds_t *zd, uint64_t id)
 	zd->zd_shared->zd_seq = zilog->zl_commit_lr_seq;
 	mutex_exit(&zilog->zl_lock);
 
-	(void) rw_unlock(&zd->zd_zilog_lock);
+	rw_exit(&zd->zd_zilog_lock);
 }
 
 /*
@@ -2348,8 +2349,8 @@ ztest_zil_remount(ztest_ds_t *zd, uint64_t id)
 	 * updating the zil (i.e. adding in-memory log records) and the
 	 * zd_zilog_lock to block any I/O.
 	 */
-	VERIFY0(mutex_lock(&zd->zd_dirobj_lock));
-	(void) rw_wrlock(&zd->zd_zilog_lock);
+	mutex_enter(&zd->zd_dirobj_lock);
+	rw_enter(&zd->zd_zilog_lock, RW_WRITER);
 
 	/* zfsvfs_teardown() */
 	zil_close(zd->zd_zilog);
@@ -2358,8 +2359,8 @@ ztest_zil_remount(ztest_ds_t *zd, uint64_t id)
 	VERIFY(zil_open(os, ztest_get_data) == zd->zd_zilog);
 	zil_replay(os, zd, ztest_replay_vector);
 
-	(void) rw_unlock(&zd->zd_zilog_lock);
-	VERIFY(mutex_unlock(&zd->zd_dirobj_lock) == 0);
+	rw_exit(&zd->zd_zilog_lock);
+	mutex_exit(&zd->zd_dirobj_lock);
 }
 
 /*
@@ -2394,7 +2395,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, uint64_t id)
 	 * Attempt to create an existing pool.  It shouldn't matter
 	 * what's in the nvroot; we should fail with EEXIST.
 	 */
-	(void) rw_rdlock(&ztest_name_lock);
+	rw_enter(&ztest_name_lock, RW_READER);
 	nvroot = make_vdev_root("/dev/bogus", NULL, NULL, 0, 0, 0, 0, 0, 1);
 	VERIFY3U(EEXIST, ==, spa_create(zo->zo_pool, nvroot, NULL, NULL));
 	nvlist_free(nvroot);
@@ -2402,7 +2403,7 @@ ztest_spa_create_destroy(ztest_ds_t *zd, uint64_t id)
 	VERIFY3U(EBUSY, ==, spa_destroy(zo->zo_pool));
 	spa_close(spa, FTAG);
 
-	(void) rw_unlock(&ztest_name_lock);
+	rw_exit(&ztest_name_lock);
 }
 
 /* ARGSUSED */
@@ -2415,7 +2416,7 @@ ztest_spa_upgrade(ztest_ds_t *zd, uint64_t id)
 	nvlist_t *nvroot, *props;
 	char *name;
 
-	VERIFY0(mutex_lock(&ztest_vdev_lock));
+	mutex_enter(&ztest_vdev_lock);
 	name = kmem_asprintf("%s_upgrade", ztest_opts.zo_pool);
 
 	/*
@@ -2474,7 +2475,7 @@ ztest_spa_upgrade(ztest_ds_t *zd, uint64_t id)
 	spa_close(spa, FTAG);
 
 	strfree(name);
-	VERIFY0(mutex_unlock(&ztest_vdev_lock));
+	mutex_exit(&ztest_vdev_lock);
 }
 
 static vdev_t *
@@ -2527,7 +2528,7 @@ ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id)
 	nvlist_t *nvroot;
 	int error;
 
-	VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
+	mutex_enter(&ztest_vdev_lock);
 	leaves = MAX(zs->zs_mirrors + zs->zs_splits, 1) * ztest_opts.zo_raidz;
 
 	spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER);
@@ -2553,9 +2554,9 @@ ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id)
 		 * dmu_objset_destroy() to fail with EBUSY thus
 		 * leaving the dataset in an inconsistent state.
 		 */
-		VERIFY(rw_wrlock(&ztest_name_lock) == 0);
+		rw_enter(&ztest_name_lock, RW_WRITER);
 		error = spa_vdev_remove(spa, guid, B_FALSE);
-		VERIFY(rw_unlock(&ztest_name_lock) == 0);
+		rw_exit(&ztest_name_lock);
 
 		if (error && error != EEXIST)
 			fatal(0, "spa_vdev_remove() = %d", error);
@@ -2579,7 +2580,7 @@ ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id)
 			fatal(0, "spa_vdev_add() = %d", error);
 	}
 
-	VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+	mutex_exit(&ztest_vdev_lock);
 }
 
 /*
@@ -2605,7 +2606,7 @@ ztest_vdev_aux_add_remove(ztest_ds_t *zd, uint64_t id)
 		aux = ZPOOL_CONFIG_L2CACHE;
 	}
 
-	VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
+	mutex_enter(&ztest_vdev_lock);
 
 	spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER);
 
@@ -2662,7 +2663,7 @@ ztest_vdev_aux_add_remove(ztest_ds_t *zd, uint64_t id)
 			fatal(0, "spa_vdev_remove(%llu) = %d", guid, error);
 	}
 
-	VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+	mutex_exit(&ztest_vdev_lock);
 }
 
 /*
@@ -2679,11 +2680,11 @@ ztest_split_pool(ztest_ds_t *zd, uint64_t id)
 	uint_t c, children, schildren = 0, lastlogid = 0;
 	int error = 0;
 
-	VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
+	mutex_enter(&ztest_vdev_lock);
 
 	/* ensure we have a useable config; mirrors of raidz aren't supported */
 	if (zs->zs_mirrors < 3 || ztest_opts.zo_raidz > 1) {
-		VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+		mutex_exit(&ztest_vdev_lock);
 		return;
 	}
 
@@ -2742,9 +2743,9 @@ ztest_split_pool(ztest_ds_t *zd, uint64_t id)
 
 	spa_config_exit(spa, SCL_VDEV, FTAG);
 
-	(void) rw_wrlock(&ztest_name_lock);
+	rw_enter(&ztest_name_lock, RW_WRITER);
 	error = spa_vdev_split_mirror(spa, "splitp", config, NULL, B_FALSE);
-	(void) rw_unlock(&ztest_name_lock);
+	rw_exit(&ztest_name_lock);
 
 	nvlist_free(config);
 
@@ -2757,7 +2758,7 @@ ztest_split_pool(ztest_ds_t *zd, uint64_t id)
 		++zs->zs_splits;
 		--zs->zs_mirrors;
 	}
-	VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+	mutex_exit(&ztest_vdev_lock);
 
 }
 
@@ -2786,7 +2787,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
 	int oldvd_is_log;
 	int error, expected_error;
 
-	VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
+	mutex_enter(&ztest_vdev_lock);
 	leaves = MAX(zs->zs_mirrors, 1) * ztest_opts.zo_raidz;
 
 	spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER);
@@ -2799,7 +2800,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
 	 */
 	if (spa->spa_vdev_removal != NULL) {
 		spa_config_exit(spa, SCL_ALL, FTAG);
-		VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+		mutex_exit(&ztest_vdev_lock);
 		return;
 	}
 
@@ -2859,7 +2860,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
 		if (error != 0 && error != ENODEV && error != EBUSY &&
 		    error != ENOTSUP)
 			fatal(0, "detach (%s) returned %d", oldpath, error);
-		VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+		mutex_exit(&ztest_vdev_lock);
 		return;
 	}
 
@@ -2957,7 +2958,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
 		    newsize, replacing, error, expected_error);
 	}
 
-	VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+	mutex_exit(&ztest_vdev_lock);
 }
 
 /* ARGSUSED */
@@ -2968,7 +2969,7 @@ ztest_device_removal(ztest_ds_t *zd, uint64_t id)
 	vdev_t *vd;
 	uint64_t guid;
 
-	VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
+	mutex_enter(&ztest_vdev_lock);
 
 	spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER);
 	vd = vdev_lookup_top(spa, ztest_random_vdev_top(spa, B_FALSE));
@@ -2977,7 +2978,7 @@ ztest_device_removal(ztest_ds_t *zd, uint64_t id)
 
 	(void) spa_vdev_remove(spa, guid, B_FALSE);
 
-	VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+	mutex_exit(&ztest_vdev_lock);
 }
 
 /*
@@ -3105,7 +3106,7 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
 	uint64_t top;
 	uint64_t old_class_space, new_class_space, old_ms_count, new_ms_count;
 
-	VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
+	mutex_enter(&ztest_vdev_lock);
 	spa_config_enter(spa, SCL_STATE, spa, RW_READER);
 
 	/*
@@ -3116,7 +3117,7 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
 	 */
 	if (spa->spa_vdev_removal != NULL) {
 		spa_config_exit(spa, SCL_STATE, FTAG);
-		VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+		mutex_exit(&ztest_vdev_lock);
 		return;
 	}
 
@@ -3145,7 +3146,7 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
 	if (tvd->vdev_state != VDEV_STATE_HEALTHY ||
 	    psize == 0 || psize >= 4 * ztest_opts.zo_vdev_size) {
 		spa_config_exit(spa, SCL_STATE, spa);
-		VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+		mutex_exit(&ztest_vdev_lock);
 		return;
 	}
 	ASSERT(psize > 0);
@@ -3170,7 +3171,7 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
 			    "the vdev configuration changed.\n");
 		}
 		spa_config_exit(spa, SCL_STATE, spa);
-		VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+		mutex_exit(&ztest_vdev_lock);
 		return;
 	}
 
@@ -3204,7 +3205,7 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
 			    "intervening vdev offline or remove.\n");
 		}
 		spa_config_exit(spa, SCL_STATE, spa);
-		VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+		mutex_exit(&ztest_vdev_lock);
 		return;
 	}
 
@@ -3234,7 +3235,7 @@ ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
 	}
 
 	spa_config_exit(spa, SCL_STATE, spa);
-	VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+	mutex_exit(&ztest_vdev_lock);
 }
 
 /*
@@ -3345,7 +3346,7 @@ ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64
 	char name[ZFS_MAX_DATASET_NAME_LEN];
 	zilog_t *zilog;
 
-	(void) rw_rdlock(&ztest_name_lock);
+	rw_enter(&ztest_name_lock, RW_READER);
 
 	(void) snprintf(name, sizeof (name), "%s/temp_%llu",
 	    ztest_opts.zo_pool, (u_longlong_t)id);
@@ -3384,7 +3385,7 @@ ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64
 	if (error) {
 		if (error == ENOSPC) {
 			ztest_record_enospc(FTAG);
-			(void) rw_unlock(&ztest_name_lock);
+			rw_exit(&ztest_name_lock);
 			return;
 		}
 		fatal(0, "dmu_objset_create(%s) = %d", name, error);
@@ -3432,7 +3433,7 @@ ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64
 	dmu_objset_disown(os, FTAG);
 	ztest_zd_fini(&zdtmp);
 
-	(void) rw_unlock(&ztest_name_lock);
+	rw_exit(&ztest_name_lock);
 }
 
 /*
@@ -3441,10 +3442,10 @@ ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64
 void
 ztest_dmu_snapshot_create_destroy(ztest_ds_t *zd, uint64_t id)
 {
-	(void) rw_rdlock(&ztest_name_lock);
+	rw_enter(&ztest_name_lock, RW_READER);
 	(void) ztest_snapshot_destroy(zd->zd_name, id);
 	(void) ztest_snapshot_create(zd->zd_name, id);
-	(void) rw_unlock(&ztest_name_lock);
+	rw_exit(&ztest_name_lock);
 }
 
 /*
@@ -3503,7 +3504,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_
 	char *osname = zd->zd_name;
 	int error;
 
-	(void) rw_rdlock(&ztest_name_lock);
+	rw_enter(&ztest_name_lock, RW_READER);
 
 	ztest_dsl_dataset_cleanup(osname, id);
 
@@ -3580,7 +3581,7 @@ ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_
 out:
 	ztest_dsl_dataset_cleanup(osname, id);
 
-	(void) rw_unlock(&ztest_name_lock);
+	rw_exit(&ztest_name_lock);
 }
 
 /*
@@ -4513,9 +4514,9 @@ ztest_commit_callback(void *arg, int error)
 	ASSERT3U(data->zcd_txg, !=, 0);
 
 	/* Remove our callback from the list */
-	(void) mutex_lock(&zcl.zcl_callbacks_lock);
+	mutex_enter(&zcl.zcl_callbacks_lock);
 	list_remove(&zcl.zcl_callbacks, data);
-	(void) mutex_unlock(&zcl.zcl_callbacks_lock);
+	mutex_exit(&zcl.zcl_callbacks_lock);
 
 out:
 	umem_free(data, sizeof (ztest_cb_data_t));
@@ -4617,7 +4618,7 @@ ztest_dmu_commit_callbacks(ztest_ds_t *zd, uint64_t id
 
 	dmu_write(os, od[0].od_object, 0, sizeof (uint64_t), &txg, tx);
 
-	(void) mutex_lock(&zcl.zcl_callbacks_lock);
+	mutex_enter(&zcl.zcl_callbacks_lock);
 
 	/*
 	 * Since commit callbacks don't have any ordering requirement and since
@@ -4664,7 +4665,7 @@ ztest_dmu_commit_callbacks(ztest_ds_t *zd, uint64_t id
 		tmp_cb = cb_data[i];
 	}
 
-	(void) mutex_unlock(&zcl.zcl_callbacks_lock);
+	mutex_exit(&zcl.zcl_callbacks_lock);
 
 	dmu_tx_commit(tx);
 }
@@ -4680,27 +4681,27 @@ ztest_dsl_prop_get_set(ztest_ds_t *zd, uint64_t id)
 		ZFS_PROP_DEDUP
 	};
 
-	(void) rw_rdlock(&ztest_name_lock);
+	rw_enter(&ztest_name_lock, RW_READER);
 
 	for (int p = 0; p < sizeof (proplist) / sizeof (proplist[0]); p++)
 		(void) ztest_dsl_prop_set_uint64(zd->zd_name, proplist[p],
 		    ztest_random_dsl_prop(proplist[p]), (int)ztest_random(2));
 
-	(void) rw_unlock(&ztest_name_lock);
+	rw_exit(&ztest_name_lock);
 }
 
 /* ARGSUSED */
 void
 ztest_remap_blocks(ztest_ds_t *zd, uint64_t id)
 {
-	(void) rw_rdlock(&ztest_name_lock);
+	rw_enter(&ztest_name_lock, RW_READER);
 
 	int error = dmu_objset_remap_indirects(zd->zd_name);
 	if (error == ENOSPC)
 		error = 0;
 	ASSERT0(error);
 
-	(void) rw_unlock(&ztest_name_lock);
+	rw_exit(&ztest_name_lock);
 }
 
 /* ARGSUSED */
@@ -4709,7 +4710,7 @@ ztest_spa_prop_get_set(ztest_ds_t *zd, uint64_t id)
 {
 	nvlist_t *props = NULL;
 
-	(void) rw_rdlock(&ztest_name_lock);
+	rw_enter(&ztest_name_lock, RW_READER);
 
 	(void) ztest_spa_prop_set_uint64(ZPOOL_PROP_DEDUPDITTO,
 	    ZIO_DEDUPDITTO_MIN + ztest_random(ZIO_DEDUPDITTO_MIN));
@@ -4721,7 +4722,7 @@ ztest_spa_prop_get_set(ztest_ds_t *zd, uint64_t id)
 
 	nvlist_free(props);
 
-	(void) rw_unlock(&ztest_name_lock);
+	rw_exit(&ztest_name_lock);
 }
 
 static int
@@ -4756,7 +4757,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
 	char osname[ZFS_MAX_DATASET_NAME_LEN];
 	nvlist_t *holds;
 
-	(void) rw_rdlock(&ztest_name_lock);
+	rw_enter(&ztest_name_lock, RW_READER);
 
 	dmu_objset_name(os, osname);
 
@@ -4861,7 +4862,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
 	VERIFY3U(dmu_objset_hold(fullname, FTAG, &origin), ==, ENOENT);
 
 out:
-	(void) rw_unlock(&ztest_name_lock);
+	rw_exit(&ztest_name_lock);
 }
 
 /*
@@ -4889,11 +4890,11 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
 	uint64_t guid0 = 0;
 	boolean_t islog = B_FALSE;
 
-	VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
+	mutex_enter(&ztest_vdev_lock);
 	maxfaults = MAXFAULTS();
 	leaves = MAX(zs->zs_mirrors, 1) * ztest_opts.zo_raidz;
 	mirror_save = zs->zs_mirrors;
-	VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+	mutex_exit(&ztest_vdev_lock);
 
 	ASSERT(leaves >= 1);
 
@@ -4903,7 +4904,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
 	 * they are in progress (i.e. spa_change_guid). Those
 	 * operations will have grabbed the name lock as writer.
 	 */
-	(void) rw_rdlock(&ztest_name_lock);
+	rw_enter(&ztest_name_lock, RW_READER);
 
 	/*
 	 * We need SCL_STATE here because we're going to look at vd0->vdev_tsd.
@@ -4975,7 +4976,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
 
 		if (sav->sav_count == 0) {
 			spa_config_exit(spa, SCL_STATE, FTAG);
-			(void) rw_unlock(&ztest_name_lock);
+			rw_exit(&ztest_name_lock);
 			return;
 		}
 		vd0 = sav->sav_vdevs[ztest_random(sav->sav_count)];
@@ -4989,7 +4990,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
 	}
 
 	spa_config_exit(spa, SCL_STATE, FTAG);
-	(void) rw_unlock(&ztest_name_lock);
+	rw_exit(&ztest_name_lock);
 
 	/*
 	 * If we can tolerate two or more faults, or we're dealing
@@ -5009,12 +5010,12 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
 			 * leaving the dataset in an inconsistent state.
 			 */
 			if (islog)
-				(void) rw_wrlock(&ztest_name_lock);
+				rw_enter(&ztest_name_lock, RW_WRITER);
 
 			VERIFY(vdev_offline(spa, guid0, flags) != EBUSY);
 
 			if (islog)
-				(void) rw_unlock(&ztest_name_lock);
+				rw_exit(&ztest_name_lock);
 		} else {
 			/*
 			 * Ideally we would like to be able to randomly
@@ -5025,9 +5026,9 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
 			 * prevent a race between injection testing and
 			 * aux_vdev removal.
 			 */
-			VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
+			mutex_enter(&ztest_vdev_lock);
 			(void) vdev_online(spa, guid0, 0, NULL);
-			VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+			mutex_exit(&ztest_vdev_lock);
 		}
 	}
 
@@ -5099,9 +5100,9 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
 		    offset + sizeof (bad) > psize - VDEV_LABEL_END_SIZE)
 			continue;
 
-		VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
+		mutex_enter(&ztest_vdev_lock);
 		if (mirror_save != zs->zs_mirrors) {
-			VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+			mutex_exit(&ztest_vdev_lock);
 			(void) close(fd);
 			return;
 		}
@@ -5110,7 +5111,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
 			fatal(1, "can't inject bad word at 0x%llx in %s",
 			    offset, pathrand);
 
-		VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
+		mutex_exit(&ztest_vdev_lock);
 
 		if (ztest_opts.zo_verbose >= 7)
 			(void) printf("injected bad word into %s,"
@@ -5150,13 +5151,13 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
 	 * Take the name lock as writer to prevent anyone else from changing
 	 * the pool and dataset properies we need to maintain during this test.
 	 */
-	(void) rw_wrlock(&ztest_name_lock);
+	rw_enter(&ztest_name_lock, RW_WRITER);
 
 	if (ztest_dsl_prop_set_uint64(zd->zd_name, ZFS_PROP_DEDUP, checksum,
 	    B_FALSE) != 0 ||
 	    ztest_dsl_prop_set_uint64(zd->zd_name, ZFS_PROP_COPIES, 1,
 	    B_FALSE) != 0) {
-		(void) rw_unlock(&ztest_name_lock);
+		rw_exit(&ztest_name_lock);
 		return;
 	}
 
@@ -5175,7 +5176,7 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
 	dmu_tx_hold_write(tx, object, 0, copies * blocksize);
 	txg = ztest_tx_assign(tx, TXG_WAIT, FTAG);
 	if (txg == 0) {
-		(void) rw_unlock(&ztest_name_lock);
+		rw_exit(&ztest_name_lock);
 		return;
 	}
 
@@ -5223,7 +5224,7 @@ ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
 
 	abd_free(abd);
 
-	(void) rw_unlock(&ztest_name_lock);
+	rw_exit(&ztest_name_lock);
 }
 
 /*
@@ -5254,9 +5255,9 @@ ztest_reguid(ztest_ds_t *zd, uint64_t id)
 	orig = spa_guid(spa);
 	load = spa_load_guid(spa);
 
-	(void) rw_wrlock(&ztest_name_lock);
+	rw_enter(&ztest_name_lock, RW_WRITER);
 	error = spa_change_guid(spa);
-	(void) rw_unlock(&ztest_name_lock);
+	rw_exit(&ztest_name_lock);
 
 	if (error != 0)
 		return;
@@ -5280,7 +5281,7 @@ ztest_spa_rename(ztest_ds_t *zd, uint64_t id)
 	char *oldname, *newname;
 	spa_t *spa;
 
-	(void) rw_wrlock(&ztest_name_lock);
+	rw_enter(&ztest_name_lock, RW_WRITER);
 
 	oldname = ztest_opts.zo_pool;
 	newname = umem_alloc(strlen(oldname) + 5, UMEM_NOFAIL);
@@ -5320,7 +5321,7 @@ ztest_spa_rename(ztest_ds_t *zd, uint64_t id)
 
 	umem_free(newname, strlen(newname) + 1);
 
-	(void) rw_unlock(&ztest_name_lock);
+	rw_exit(&ztest_name_lock);
 }
 
 /*
@@ -5676,18 +5677,18 @@ ztest_dataset_open(int d)
 
 	ztest_dataset_name(name, ztest_opts.zo_pool, d);
 
-	(void) rw_rdlock(&ztest_name_lock);
+	rw_enter(&ztest_name_lock, RW_READER);
 
 	error = ztest_dataset_create(name);
 	if (error == ENOSPC) {
-		(void) rw_unlock(&ztest_name_lock);
+		rw_exit(&ztest_name_lock);
 		ztest_record_enospc(FTAG);
 		return (error);
 	}
 	ASSERT(error == 0 || error == EEXIST);
 
 	VERIFY0(dmu_objset_own(name, DMU_OST_OTHER, B_FALSE, zd, &os));
-	(void) rw_unlock(&ztest_name_lock);
+	rw_exit(&ztest_name_lock);
 
 	ztest_zd_init(zd, ZTEST_GET_SHARED_DS(d), os);
 
@@ -5749,8 +5750,8 @@ ztest_run(ztest_shared_t *zs)
 	/*
 	 * Initialize parent/child shared state.
 	 */
-	VERIFY(_mutex_init(&ztest_vdev_lock, USYNC_THREAD, NULL) == 0);
-	VERIFY(rwlock_init(&ztest_name_lock, USYNC_THREAD, NULL) == 0);
+	mutex_init(&ztest_vdev_lock, NULL, USYNC_THREAD, NULL);
+	rw_init(&ztest_name_lock, NULL, USYNC_THREAD, NULL);
 
 	zs->zs_thread_start = gethrtime();
 	zs->zs_thread_stop =
@@ -5762,7 +5763,7 @@ ztest_run(ztest_shared_t *zs)
 		    ztest_random(ztest_opts.zo_passtime * NANOSEC);
 	}
 
-	(void) _mutex_init(&zcl.zcl_callbacks_lock, USYNC_THREAD, NULL);
+	mutex_init(&zcl.zcl_callbacks_lock, NULL, USYNC_THREAD, NULL);
 
 	list_create(&zcl.zcl_callbacks, sizeof (ztest_cb_data_t),
 	    offsetof(ztest_cb_data_t, zcd_node));
@@ -5909,10 +5910,10 @@ ztest_run(ztest_shared_t *zs)
 
 	list_destroy(&zcl.zcl_callbacks);
 
-	(void) _mutex_destroy(&zcl.zcl_callbacks_lock);
+	mutex_destroy(&zcl.zcl_callbacks_lock);
 
-	(void) rwlock_destroy(&ztest_name_lock);
-	(void) _mutex_destroy(&ztest_vdev_lock);
+	rw_destroy(&ztest_name_lock);
+	mutex_destroy(&ztest_vdev_lock);
 }
 
 static void
@@ -6056,8 +6057,8 @@ ztest_init(ztest_shared_t *zs)
 	spa_t *spa;
 	nvlist_t *nvroot, *props;
 
-	VERIFY(_mutex_init(&ztest_vdev_lock, USYNC_THREAD, NULL) == 0);
-	VERIFY(rwlock_init(&ztest_name_lock, USYNC_THREAD, NULL) == 0);
+	mutex_init(&ztest_vdev_lock, NULL, USYNC_THREAD, NULL);
+	rw_init(&ztest_name_lock, NULL, USYNC_THREAD, NULL);
 
 	kernel_init(FREAD | FWRITE);
 
@@ -6095,8 +6096,8 @@ ztest_init(ztest_shared_t *zs)
 
 	ztest_run_zdb(ztest_opts.zo_pool);
 
-	(void) rwlock_destroy(&ztest_name_lock);
-	(void) _mutex_destroy(&ztest_vdev_lock);
+	rw_destroy(&ztest_name_lock);
+	mutex_destroy(&ztest_vdev_lock);
 }
 
 static void

From owner-svn-src-head@freebsd.org  Wed Mar 28 22:01:28 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E203BF75C92;
 Wed, 28 Mar 2018 22:01:27 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 94322848FF;
 Wed, 28 Mar 2018 22:01:27 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8EE6610C04;
 Wed, 28 Mar 2018 22:01:27 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SM1RKD029677;
 Wed, 28 Mar 2018 22:01:27 GMT (envelope-from mav@FreeBSD.org)
Received: (from mav@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SM1RTe029674;
 Wed, 28 Mar 2018 22:01:27 GMT (envelope-from mav@FreeBSD.org)
Message-Id: <201803282201.w2SM1RTe029674@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
 using -f
From: Alexander Motin 
Date: Wed, 28 Mar 2018 22:01:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331701 - in head: cddl/contrib/opensolaris/cmd/zdb
 cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest
 cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/opensol...
X-SVN-Group: head
X-SVN-Commit-Author: mav
X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zdb
 cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest
 cddl/contrib/opensolaris/lib/libzfs/common
 cddl/contrib/opensolaris/lib/libzfs_core/comm...
X-SVN-Commit-Revision: 331701
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 22:01:28 -0000

Author: mav
Date: Wed Mar 28 22:01:27 2018
New Revision: 331701
URL: https://svnweb.freebsd.org/changeset/base/331701

Log:
  MFV r331695, 331700: 9166 zfs storage pool checkpoint
  
  illumos/illumos-gate@8671400134a11c848244896ca51a7db4d0f69da4
  
  The idea of Storage Pool Checkpoint (aka zpool checkpoint) deals with
  exactly that.  It can be thought of as a “pool-wide snapshot” (or a
  variation of extreme rewind that doesn’t corrupt your data).  It remembers
  the entire state of the pool at the point that it was taken and the user
  can revert back to it later or discard it.  Its generic use case is an
  administrator that is about to perform a set of destructive actions to ZFS
  as part of a critical procedure.  She takes a checkpoint of the pool before
  performing the actions, then rewinds back to it if one of them fails or puts
  the pool into an unexpected state.  Otherwise, she discards it.  With the
  assumption that no one else is making modifications to ZFS, she basically
  wraps all these actions into a “high-level transaction”.
  
  Reviewed by: Matthew Ahrens 
  Reviewed by: John Kennedy 
  Reviewed by: Dan Kimmel 
  Approved by: Richard Lowe 
  Author: Serapheim Dimitropoulos 

Added:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_checkpoint.c
     - copied unchanged from r331700, vendor-sys/illumos/dist/uts/common/fs/zfs/spa_checkpoint.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_checkpoint.h
     - copied unchanged from r331700, vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa_checkpoint.h
Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.8
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  head/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c
  head/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7
  head/cddl/contrib/opensolaris/cmd/zpool/zpool.8
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c
  head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c
  head/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.h
  head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c
  head/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h
  head/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c
  head/sys/cddl/contrib/opensolaris/uts/common/Makefile.files
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_synctask.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/uberblock_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_removal.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zthr.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_indirect.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_removal.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zcp_synctask.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zthr.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
  head/sys/conf/files
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/cmd/zdb/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.8
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.8	Wed Mar 28 21:00:34 2018	(r331700)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.8	Wed Mar 28 22:01:27 2018	(r331701)
@@ -21,7 +21,7 @@
 .Nd display zpool debugging and consistency information
 .Sh SYNOPSIS
 .Nm
-.Op Fl AbcdDFGhiLMPsvX
+.Op Fl AbcdDFGhikLMPsvX
 .Op Fl e Oo Fl V Oc Op Fl p Ar path ...
 .Op Fl I Ar inflight I/Os
 .Oo Fl o Ar var Ns = Ns Ar value Oc Ns ...
@@ -170,6 +170,9 @@ Display information about intent log
 .Pq ZIL
 entries relating to each dataset.
 If specified multiple times, display counts of each intent log transaction type.
+.It Fl k
+Examine the checkpointed state of the pool.
+Note, the on disk format of the pool is not reverted to the checkpointed state.
 .It Fl l Ar device
 Read the vdev labels from the specified device.
 .Nm Fl l

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Wed Mar 28 21:00:34 2018	(r331700)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Wed Mar 28 22:01:27 2018	(r331701)
@@ -131,7 +131,7 @@ static void
 usage(void)
 {
 	(void) fprintf(stderr,
-	    "Usage:\t%s [-AbcdDFGhiLMPsvX] [-e [-V] [-p  ...]] "
+	    "Usage:\t%s [-AbcdDFGhikLMPsvX] [-e [-V] [-p  ...]] "
 	    "[-I ]\n"
 	    "\t\t[-o =]... [-t ] [-U ] [-x ]\n"
 	    "\t\t[ [ ...]]\n"
@@ -168,6 +168,8 @@ usage(void)
 	(void) fprintf(stderr, "        -h pool history\n");
 	(void) fprintf(stderr, "        -i intent logs\n");
 	(void) fprintf(stderr, "        -l read label contents\n");
+	(void) fprintf(stderr, "        -k examine the checkpointed state "
+	    "of the pool\n");
 	(void) fprintf(stderr, "        -L disable leak tracking (do not "
 	    "load spacemaps)\n");
 	(void) fprintf(stderr, "        -m metaslabs\n");
@@ -729,6 +731,22 @@ get_prev_obsolete_spacemap_refcount(spa_t *spa)
 }
 
 static int
+get_checkpoint_refcount(vdev_t *vd)
+{
+	int refcount = 0;
+
+	if (vd->vdev_top == vd && vd->vdev_top_zap != 0 &&
+	    zap_contains(spa_meta_objset(vd->vdev_spa),
+	    vd->vdev_top_zap, VDEV_TOP_ZAP_POOL_CHECKPOINT_SM) == 0)
+		refcount++;
+
+	for (uint64_t c = 0; c < vd->vdev_children; c++)
+		refcount += get_checkpoint_refcount(vd->vdev_child[c]);
+
+	return (refcount);
+}
+
+static int
 verify_spacemap_refcounts(spa_t *spa)
 {
 	uint64_t expected_refcount = 0;
@@ -741,6 +759,7 @@ verify_spacemap_refcounts(spa_t *spa)
 	actual_refcount += get_metaslab_refcount(spa->spa_root_vdev);
 	actual_refcount += get_obsolete_refcount(spa->spa_root_vdev);
 	actual_refcount += get_prev_obsolete_spacemap_refcount(spa);
+	actual_refcount += get_checkpoint_refcount(spa->spa_root_vdev);
 
 	if (expected_refcount != actual_refcount) {
 		(void) printf("space map refcount mismatch: expected %lld != "
@@ -814,8 +833,8 @@ static void
 dump_metaslab_stats(metaslab_t *msp)
 {
 	char maxbuf[32];
-	range_tree_t *rt = msp->ms_tree;
-	avl_tree_t *t = &msp->ms_size_tree;
+	range_tree_t *rt = msp->ms_allocatable;
+	avl_tree_t *t = &msp->ms_allocatable_by_size;
 	int free_pct = range_tree_space(rt) * 100 / msp->ms_size;
 
 	/* max sure nicenum has enough space */
@@ -851,7 +870,7 @@ dump_metaslab(metaslab_t *msp)
 		metaslab_load_wait(msp);
 		if (!msp->ms_loaded) {
 			VERIFY0(metaslab_load(msp));
-			range_tree_stat_verify(msp->ms_tree);
+			range_tree_stat_verify(msp->ms_allocatable);
 		}
 		dump_metaslab_stats(msp);
 		metaslab_unload(msp);
@@ -2289,6 +2308,8 @@ dump_uberblock(uberblock_t *ub, const char *header, co
 		snprintf_blkptr(blkbuf, sizeof (blkbuf), &ub->ub_rootbp);
 		(void) printf("\trootbp = %s\n", blkbuf);
 	}
+	(void) printf("\tcheckpoint_txg = %llu\n",
+	    (u_longlong_t)ub->ub_checkpoint_txg);
 	(void) printf("%s", footer ? footer : "");
 }
 
@@ -2649,6 +2670,7 @@ static const char *zdb_ot_extname[] = {
 typedef struct zdb_cb {
 	zdb_blkstats_t	zcb_type[ZB_TOTAL + 1][ZDB_OT_TOTAL + 1];
 	uint64_t	zcb_removing_size;
+	uint64_t	zcb_checkpoint_size;
 	uint64_t	zcb_dedup_asize;
 	uint64_t	zcb_dedup_blocks;
 	uint64_t	zcb_embedded_blocks[NUM_BP_EMBEDDED_TYPES];
@@ -2748,7 +2770,7 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *zilog, const b
 	}
 
 	VERIFY3U(zio_wait(zio_claim(NULL, zcb->zcb_spa,
-	    refcnt ? 0 : spa_first_txg(zcb->zcb_spa),
+	    refcnt ? 0 : spa_min_claim_txg(zcb->zcb_spa),
 	    bp, NULL, NULL, ZIO_FLAG_CANFAIL)), ==, 0);
 }
 
@@ -2950,7 +2972,7 @@ claim_segment_impl_cb(uint64_t inner_offset, vdev_t *v
 	ASSERT(vdev_is_concrete(vd));
 
 	VERIFY0(metaslab_claim_impl(vd, offset, size,
-	    spa_first_txg(vd->vdev_spa)));
+	    spa_min_claim_txg(vd->vdev_spa)));
 }
 
 static void
@@ -3011,70 +3033,6 @@ zdb_claim_removing(spa_t *spa, zdb_cb_t *zcb)
 	spa_config_exit(spa, SCL_CONFIG, FTAG);
 }
 
-/*
- * vm_idxp is an in-out parameter which (for indirect vdevs) is the
- * index in vim_entries that has the first entry in this metaslab.  On
- * return, it will be set to the first entry after this metaslab.
- */
-static void
-zdb_leak_init_ms(metaslab_t *msp, uint64_t *vim_idxp)
-{
-	metaslab_group_t *mg = msp->ms_group;
-	vdev_t *vd = mg->mg_vd;
-	vdev_t *rvd = vd->vdev_spa->spa_root_vdev;
-
-	mutex_enter(&msp->ms_lock);
-	metaslab_unload(msp);
-
-	/*
-	 * We don't want to spend the CPU manipulating the size-ordered
-	 * tree, so clear the range_tree ops.
-	 */
-	msp->ms_tree->rt_ops = NULL;
-
-	(void) fprintf(stderr,
-	    "\rloading vdev %llu of %llu, metaslab %llu of %llu ...",
-	    (longlong_t)vd->vdev_id,
-	    (longlong_t)rvd->vdev_children,
-	    (longlong_t)msp->ms_id,
-	    (longlong_t)vd->vdev_ms_count);
-
-	/*
-	 * For leak detection, we overload the metaslab ms_tree to
-	 * contain allocated segments instead of free segments. As a
-	 * result, we can't use the normal metaslab_load/unload
-	 * interfaces.
-	 */
-	if (vd->vdev_ops == &vdev_indirect_ops) {
-		vdev_indirect_mapping_t *vim = vd->vdev_indirect_mapping;
-		for (; *vim_idxp < vdev_indirect_mapping_num_entries(vim);
-		    (*vim_idxp)++) {
-			vdev_indirect_mapping_entry_phys_t *vimep =
-			    &vim->vim_entries[*vim_idxp];
-			uint64_t ent_offset = DVA_MAPPING_GET_SRC_OFFSET(vimep);
-			uint64_t ent_len = DVA_GET_ASIZE(&vimep->vimep_dst);
-			ASSERT3U(ent_offset, >=, msp->ms_start);
-			if (ent_offset >= msp->ms_start + msp->ms_size)
-				break;
-
-			/*
-			 * Mappings do not cross metaslab boundaries,
-			 * because we create them by walking the metaslabs.
-			 */
-			ASSERT3U(ent_offset + ent_len, <=,
-			    msp->ms_start + msp->ms_size);
-			range_tree_add(msp->ms_tree, ent_offset, ent_len);
-		}
-	} else if (msp->ms_sm != NULL) {
-		VERIFY0(space_map_load(msp->ms_sm, msp->ms_tree, SM_ALLOC));
-	}
-
-	if (!msp->ms_loaded) {
-		msp->ms_loaded = B_TRUE;
-	}
-	mutex_exit(&msp->ms_lock);
-}
-
 /* ARGSUSED */
 static int
 increment_indirect_mapping_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx)
@@ -3131,7 +3089,243 @@ zdb_load_obsolete_counts(vdev_t *vd)
 	return (counts);
 }
 
+typedef struct checkpoint_sm_exclude_entry_arg {
+	vdev_t *cseea_vd;
+	uint64_t cseea_checkpoint_size;
+} checkpoint_sm_exclude_entry_arg_t;
+
+static int
+checkpoint_sm_exclude_entry_cb(maptype_t type, uint64_t offset, uint64_t size,
+    void *arg)
+{
+	checkpoint_sm_exclude_entry_arg_t *cseea = arg;
+	vdev_t *vd = cseea->cseea_vd;
+	metaslab_t *ms = vd->vdev_ms[offset >> vd->vdev_ms_shift];
+	uint64_t end = offset + size;
+
+	ASSERT(type == SM_FREE);
+
+	/*
+	 * Since the vdev_checkpoint_sm exists in the vdev level
+	 * and the ms_sm space maps exist in the metaslab level,
+	 * an entry in the checkpoint space map could theoretically
+	 * cross the boundaries of the metaslab that it belongs.
+	 *
+	 * In reality, because of the way that we populate and
+	 * manipulate the checkpoint's space maps currently,
+	 * there shouldn't be any entries that cross metaslabs.
+	 * Hence the assertion below.
+	 *
+	 * That said, there is no fundamental requirement that
+	 * the checkpoint's space map entries should not cross
+	 * metaslab boundaries. So if needed we could add code
+	 * that handles metaslab-crossing segments in the future.
+	 */
+	VERIFY3U(offset, >=, ms->ms_start);
+	VERIFY3U(end, <=, ms->ms_start + ms->ms_size);
+
+	/*
+	 * By removing the entry from the allocated segments we
+	 * also verify that the entry is there to begin with.
+	 */
+	mutex_enter(&ms->ms_lock);
+	range_tree_remove(ms->ms_allocatable, offset, size);
+	mutex_exit(&ms->ms_lock);
+
+	cseea->cseea_checkpoint_size += size;
+	return (0);
+}
+
 static void
+zdb_leak_init_vdev_exclude_checkpoint(vdev_t *vd, zdb_cb_t *zcb)
+{
+	spa_t *spa = vd->vdev_spa;
+	space_map_t *checkpoint_sm = NULL;
+	uint64_t checkpoint_sm_obj;
+
+	/*
+	 * If there is no vdev_top_zap, we are in a pool whose
+	 * version predates the pool checkpoint feature.
+	 */
+	if (vd->vdev_top_zap == 0)
+		return;
+
+	/*
+	 * If there is no reference of the vdev_checkpoint_sm in
+	 * the vdev_top_zap, then one of the following scenarios
+	 * is true:
+	 *
+	 * 1] There is no checkpoint
+	 * 2] There is a checkpoint, but no checkpointed blocks
+	 *    have been freed yet
+	 * 3] The current vdev is indirect
+	 *
+	 * In these cases we return immediately.
+	 */
+	if (zap_contains(spa_meta_objset(spa), vd->vdev_top_zap,
+	    VDEV_TOP_ZAP_POOL_CHECKPOINT_SM) != 0)
+		return;
+
+	VERIFY0(zap_lookup(spa_meta_objset(spa), vd->vdev_top_zap,
+	    VDEV_TOP_ZAP_POOL_CHECKPOINT_SM, sizeof (uint64_t), 1,
+	    &checkpoint_sm_obj));
+
+	checkpoint_sm_exclude_entry_arg_t cseea;
+	cseea.cseea_vd = vd;
+	cseea.cseea_checkpoint_size = 0;
+
+	VERIFY0(space_map_open(&checkpoint_sm, spa_meta_objset(spa),
+	    checkpoint_sm_obj, 0, vd->vdev_asize, vd->vdev_ashift));
+	space_map_update(checkpoint_sm);
+
+	VERIFY0(space_map_iterate(checkpoint_sm,
+	    checkpoint_sm_exclude_entry_cb, &cseea));
+	space_map_close(checkpoint_sm);
+
+	zcb->zcb_checkpoint_size += cseea.cseea_checkpoint_size;
+}
+
+static void
+zdb_leak_init_exclude_checkpoint(spa_t *spa, zdb_cb_t *zcb)
+{
+	vdev_t *rvd = spa->spa_root_vdev;
+	for (uint64_t c = 0; c < rvd->vdev_children; c++) {
+		ASSERT3U(c, ==, rvd->vdev_child[c]->vdev_id);
+		zdb_leak_init_vdev_exclude_checkpoint(rvd->vdev_child[c], zcb);
+	}
+}
+
+static void
+load_concrete_ms_allocatable_trees(spa_t *spa, maptype_t maptype)
+{
+	vdev_t *rvd = spa->spa_root_vdev;
+	for (uint64_t i = 0; i < rvd->vdev_children; i++) {
+		vdev_t *vd = rvd->vdev_child[i];
+
+		ASSERT3U(i, ==, vd->vdev_id);
+
+		if (vd->vdev_ops == &vdev_indirect_ops)
+			continue;
+
+		for (uint64_t m = 0; m < vd->vdev_ms_count; m++) {
+			metaslab_t *msp = vd->vdev_ms[m];
+
+			(void) fprintf(stderr,
+			    "\rloading concrete vdev %llu, "
+			    "metaslab %llu of %llu ...",
+			    (longlong_t)vd->vdev_id,
+			    (longlong_t)msp->ms_id,
+			    (longlong_t)vd->vdev_ms_count);
+
+			mutex_enter(&msp->ms_lock);
+			metaslab_unload(msp);
+
+			/*
+			 * We don't want to spend the CPU manipulating the
+			 * size-ordered tree, so clear the range_tree ops.
+			 */
+			msp->ms_allocatable->rt_ops = NULL;
+
+			if (msp->ms_sm != NULL) {
+				VERIFY0(space_map_load(msp->ms_sm,
+				    msp->ms_allocatable, maptype));
+			}
+			if (!msp->ms_loaded)
+				msp->ms_loaded = B_TRUE;
+			mutex_exit(&msp->ms_lock);
+		}
+	}
+}
+
+/*
+ * vm_idxp is an in-out parameter which (for indirect vdevs) is the
+ * index in vim_entries that has the first entry in this metaslab.
+ * On return, it will be set to the first entry after this metaslab.
+ */
+static void
+load_indirect_ms_allocatable_tree(vdev_t *vd, metaslab_t *msp,
+    uint64_t *vim_idxp)
+{
+	vdev_indirect_mapping_t *vim = vd->vdev_indirect_mapping;
+
+	mutex_enter(&msp->ms_lock);
+	metaslab_unload(msp);
+
+	/*
+	 * We don't want to spend the CPU manipulating the
+	 * size-ordered tree, so clear the range_tree ops.
+	 */
+	msp->ms_allocatable->rt_ops = NULL;
+
+	for (; *vim_idxp < vdev_indirect_mapping_num_entries(vim);
+	    (*vim_idxp)++) {
+		vdev_indirect_mapping_entry_phys_t *vimep =
+		    &vim->vim_entries[*vim_idxp];
+		uint64_t ent_offset = DVA_MAPPING_GET_SRC_OFFSET(vimep);
+		uint64_t ent_len = DVA_GET_ASIZE(&vimep->vimep_dst);
+		ASSERT3U(ent_offset, >=, msp->ms_start);
+		if (ent_offset >= msp->ms_start + msp->ms_size)
+			break;
+
+		/*
+		 * Mappings do not cross metaslab boundaries,
+		 * because we create them by walking the metaslabs.
+		 */
+		ASSERT3U(ent_offset + ent_len, <=,
+		    msp->ms_start + msp->ms_size);
+		range_tree_add(msp->ms_allocatable, ent_offset, ent_len);
+	}
+
+	if (!msp->ms_loaded)
+		msp->ms_loaded = B_TRUE;
+	mutex_exit(&msp->ms_lock);
+}
+
+static void
+zdb_leak_init_prepare_indirect_vdevs(spa_t *spa, zdb_cb_t *zcb)
+{
+	vdev_t *rvd = spa->spa_root_vdev;
+	for (uint64_t c = 0; c < rvd->vdev_children; c++) {
+		vdev_t *vd = rvd->vdev_child[c];
+
+		ASSERT3U(c, ==, vd->vdev_id);
+
+		if (vd->vdev_ops != &vdev_indirect_ops)
+			continue;
+
+		/*
+		 * Note: we don't check for mapping leaks on
+		 * removing vdevs because their ms_allocatable's
+		 * are used to look for leaks in allocated space.
+		 */
+		zcb->zcb_vd_obsolete_counts[c] = zdb_load_obsolete_counts(vd);
+
+		/*
+		 * Normally, indirect vdevs don't have any
+		 * metaslabs.  We want to set them up for
+		 * zio_claim().
+		 */
+		VERIFY0(vdev_metaslab_init(vd, 0));
+
+		vdev_indirect_mapping_t *vim = vd->vdev_indirect_mapping;
+		uint64_t vim_idx = 0;
+		for (uint64_t m = 0; m < vd->vdev_ms_count; m++) {
+
+			(void) fprintf(stderr,
+			    "\rloading indirect vdev %llu, "
+			    "metaslab %llu of %llu ...",
+			    (longlong_t)vd->vdev_id,
+			    (longlong_t)vd->vdev_ms[m]->ms_id,
+			    (longlong_t)vd->vdev_ms_count);
+
+			load_indirect_ms_allocatable_tree(vd, vd->vdev_ms[m],
+			    &vim_idx);
+		}
+		ASSERT3U(vim_idx, ==, vdev_indirect_mapping_num_entries(vim));
+	}
+}
+
+static void
 zdb_leak_init(spa_t *spa, zdb_cb_t *zcb)
 {
 	zcb->zcb_spa = spa;
@@ -3142,7 +3336,7 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb)
 
 		/*
 		 * We are going to be changing the meaning of the metaslab's
-		 * ms_tree.  Ensure that the allocator doesn't try to
+		 * ms_allocatable.  Ensure that the allocator doesn't try to
 		 * use the tree.
 		 */
 		spa->spa_normal_class->mc_ops = &zdb_metaslab_ops;
@@ -3152,39 +3346,37 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb)
 		    umem_zalloc(rvd->vdev_children * sizeof (uint32_t *),
 		    UMEM_NOFAIL);
 
+		/*
+		 * For leak detection, we overload the ms_allocatable trees
+		 * to contain allocated segments instead of free segments.
+		 * As a result, we can't use the normal metaslab_load/unload
+		 * interfaces.
+		 */
+		zdb_leak_init_prepare_indirect_vdevs(spa, zcb);
+		load_concrete_ms_allocatable_trees(spa, SM_ALLOC);
 
-		for (uint64_t c = 0; c < rvd->vdev_children; c++) {
-			vdev_t *vd = rvd->vdev_child[c];
-			uint64_t vim_idx = 0;
+		/*
+		 * On load_concrete_ms_allocatable_trees() we loaded all the
+		 * allocated entries from the ms_sm to the ms_allocatable for
+		 * each metaslab. If the pool has a checkpoint or is in the
+		 * middle of discarding a checkpoint, some of these blocks
+		 * may have been freed but their ms_sm may not have been
+		 * updated because they are referenced by the checkpoint. In
+		 * order to avoid false-positives during leak-detection, we
+		 * go through the vdev's checkpoint space map and exclude all
+		 * its entries from their relevant ms_allocatable.
+		 *
+		 * We also aggregate the space held by the checkpoint and add
+		 * it to zcb_checkpoint_size.
+		 *
+		 * Note that at this point we are also verifying that all the
+		 * entries on the checkpoint_sm are marked as allocated in
+		 * the ms_sm of their relevant metaslab.
+		 * [see comment in checkpoint_sm_exclude_entry_cb()]
+		 */
+		zdb_leak_init_exclude_checkpoint(spa, zcb);
 
-			ASSERT3U(c, ==, vd->vdev_id);
-
-			/*
-			 * Note: we don't check for mapping leaks on
-			 * removing vdevs because their ms_tree's are
-			 * used to look for leaks in allocated space.
-			 */
-			if (vd->vdev_ops == &vdev_indirect_ops) {
-				zcb->zcb_vd_obsolete_counts[c] =
-				    zdb_load_obsolete_counts(vd);
-
-				/*
-				 * Normally, indirect vdevs don't have any
-				 * metaslabs.  We want to set them up for
-				 * zio_claim().
-				 */
-				VERIFY0(vdev_metaslab_init(vd, 0));
-			}
-
-			for (uint64_t m = 0; m < vd->vdev_ms_count; m++) {
-				zdb_leak_init_ms(vd->vdev_ms[m], &vim_idx);
-			}
-			if (vd->vdev_ops == &vdev_indirect_ops) {
-				ASSERT3U(vim_idx, ==,
-				    vdev_indirect_mapping_num_entries(
-				    vd->vdev_indirect_mapping));
-			}
-		}
+		/* for cleaner progress output */
 		(void) fprintf(stderr, "\n");
 
 		if (bpobj_is_open(&dp->dp_obsolete_bpobj)) {
@@ -3193,12 +3385,16 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb)
 			(void) bpobj_iterate_nofree(&dp->dp_obsolete_bpobj,
 			    increment_indirect_mapping_cb, zcb, NULL);
 		}
+	} else {
+		/*
+		 * If leak tracing is disabled, we still need to consider
+		 * any checkpointed space in our space verification.
+		 */
+		zcb->zcb_checkpoint_size += spa_get_checkpoint_space(spa);
 	}
 
 	spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER);
-
 	zdb_ddt_leak_init(spa, zcb);
-
 	spa_config_exit(spa, SCL_CONFIG, FTAG);
 }
 
@@ -3225,7 +3421,7 @@ zdb_check_for_obsolete_leaks(vdev_t *vd, zdb_cb_t *zcb
 		for (uint64_t inner_offset = 0;
 		    inner_offset < DVA_GET_ASIZE(&vimep->vimep_dst);
 		    inner_offset += 1 << vd->vdev_ashift) {
-			if (range_tree_contains(msp->ms_tree,
+			if (range_tree_contains(msp->ms_allocatable,
 			    offset + inner_offset, 1 << vd->vdev_ashift)) {
 				obsolete_bytes += 1 << vd->vdev_ashift;
 			}
@@ -3291,23 +3487,23 @@ zdb_leak_fini(spa_t *spa, zdb_cb_t *zcb)
 				ASSERT3P(mg, ==, msp->ms_group);
 
 				/*
-				 * The ms_tree has been overloaded to
-				 * contain allocated segments. Now that we
-				 * finished traversing all blocks, any
-				 * block that remains in the ms_tree
+				 * ms_allocatable has been overloaded
+				 * to contain allocated segments. Now that
+				 * we finished traversing all blocks, any
+				 * block that remains in the ms_allocatable
 				 * represents an allocated block that we
 				 * did not claim during the traversal.
 				 * Claimed blocks would have been removed
-				 * from the ms_tree.  For indirect vdevs,
-				 * space remaining in the tree represents
-				 * parts of the mapping that are not
-				 * referenced, which is not a bug.
+				 * from the ms_allocatable.  For indirect
+				 * vdevs, space remaining in the tree
+				 * represents parts of the mapping that are
+				 * not referenced, which is not a bug.
 				 */
 				if (vd->vdev_ops == &vdev_indirect_ops) {
-					range_tree_vacate(msp->ms_tree,
+					range_tree_vacate(msp->ms_allocatable,
 					    NULL, NULL);
 				} else {
-					range_tree_vacate(msp->ms_tree,
+					range_tree_vacate(msp->ms_allocatable,
 					    zdb_leak, vd);
 				}
 
@@ -3430,7 +3626,7 @@ dump_block_stats(spa_t *spa)
 
 	total_alloc = norm_alloc + metaslab_class_get_alloc(spa_log_class(spa));
 	total_found = tzb->zb_asize - zcb.zcb_dedup_asize +
-	    zcb.zcb_removing_size;
+	    zcb.zcb_removing_size + zcb.zcb_checkpoint_size;
 
 	if (total_found == total_alloc) {
 		if (!dump_opt['L'])
@@ -3839,7 +4035,385 @@ verify_device_removal_feature_counts(spa_t *spa)
 	return (ret);
 }
 
+#define	BOGUS_SUFFIX "_CHECKPOINTED_UNIVERSE"
+/*
+ * Import the checkpointed state of the pool specified by the target
+ * parameter as readonly. The function also accepts a pool config
+ * as an optional parameter, else it attempts to infer the config by
+ * the name of the target pool.
+ *
+ * Note that the checkpointed state's pool name will be the name of
+ * the original pool with the above suffix appened to it. In addition,
+ * if the target is not a pool name (e.g. a path to a dataset) then
+ * the new_path parameter is populated with the updated path to
+ * reflect the fact that we are looking into the checkpointed state.
+ *
+ * The function returns a newly-allocated copy of the name of the
+ * pool containing the checkpointed state. When this copy is no
+ * longer needed it should be freed with free(3C). Same thing
+ * applies to the new_path parameter if allocated.
+ */
+static char *
+import_checkpointed_state(char *target, nvlist_t *cfg, char **new_path)
+{
+	int error = 0;
+	char *poolname, *bogus_name;
+
+	/* If the target is not a pool, the extract the pool name */
+	char *path_start = strchr(target, '/');
+	if (path_start != NULL) {
+		size_t poolname_len = path_start - target;
+		poolname = strndup(target, poolname_len);
+	} else {
+		poolname = target;
+	}
+
+	if (cfg == NULL) {
+		error = spa_get_stats(poolname, &cfg, NULL, 0);
+		if (error != 0) {
+			fatal("Tried to read config of pool \"%s\" but "
+			    "spa_get_stats() failed with error %d\n",
+			    poolname, error);
+		}
+	}
+
+	(void) asprintf(&bogus_name, "%s%s", poolname, BOGUS_SUFFIX);
+	fnvlist_add_string(cfg, ZPOOL_CONFIG_POOL_NAME, bogus_name);
+
+	error = spa_import(bogus_name, cfg, NULL,
+	    ZFS_IMPORT_MISSING_LOG | ZFS_IMPORT_CHECKPOINT);
+	if (error != 0) {
+		fatal("Tried to import pool \"%s\" but spa_import() failed "
+		    "with error %d\n", bogus_name, error);
+	}
+
+	if (new_path != NULL && path_start != NULL)
+		(void) asprintf(new_path, "%s%s", bogus_name, path_start);
+
+	if (target != poolname)
+		free(poolname);
+
+	return (bogus_name);
+}
+
+typedef struct verify_checkpoint_sm_entry_cb_arg {
+	vdev_t *vcsec_vd;
+
+	/* the following fields are only used for printing progress */
+	uint64_t vcsec_entryid;
+	uint64_t vcsec_num_entries;
+} verify_checkpoint_sm_entry_cb_arg_t;
+
+#define	ENTRIES_PER_PROGRESS_UPDATE 10000
+
+static int
+verify_checkpoint_sm_entry_cb(maptype_t type, uint64_t offset, uint64_t size,
+    void *arg)
+{
+	verify_checkpoint_sm_entry_cb_arg_t *vcsec = arg;
+	vdev_t *vd = vcsec->vcsec_vd;
+	metaslab_t *ms = vd->vdev_ms[offset >> vd->vdev_ms_shift];
+	uint64_t end = offset + size;
+
+	ASSERT(type == SM_FREE);
+
+	if ((vcsec->vcsec_entryid % ENTRIES_PER_PROGRESS_UPDATE) == 0) {
+		(void) fprintf(stderr,
+		    "\rverifying vdev %llu, space map entry %llu of %llu ...",
+		    (longlong_t)vd->vdev_id,
+		    (longlong_t)vcsec->vcsec_entryid,
+		    (longlong_t)vcsec->vcsec_num_entries);
+	}
+	vcsec->vcsec_entryid++;
+
+	/*
+	 * See comment in checkpoint_sm_exclude_entry_cb()
+	 */
+	VERIFY3U(offset, >=, ms->ms_start);
+	VERIFY3U(end, <=, ms->ms_start + ms->ms_size);
+
+	/*
+	 * The entries in the vdev_checkpoint_sm should be marked as
+	 * allocated in the checkpointed state of the pool, therefore
+	 * their respective ms_allocateable trees should not contain them.
+	 */
+	mutex_enter(&ms->ms_lock);
+	range_tree_verify(ms->ms_allocatable, offset, size);
+	mutex_exit(&ms->ms_lock);
+
+	return (0);
+}
+
+/*
+ * Verify that all segments in the vdev_checkpoint_sm are allocated
+ * according to the checkpoint's ms_sm (i.e. are not in the checkpoint's
+ * ms_allocatable).
+ *
+ * Do so by comparing the checkpoint space maps (vdev_checkpoint_sm) of
+ * each vdev in the current state of the pool to the metaslab space maps
+ * (ms_sm) of the checkpointed state of the pool.
+ *
+ * Note that the function changes the state of the ms_allocatable
+ * trees of the current spa_t. The entries of these ms_allocatable
+ * trees are cleared out and then repopulated from with the free
+ * entries of their respective ms_sm space maps.
+ */
 static void
+verify_checkpoint_vdev_spacemaps(spa_t *checkpoint, spa_t *current)
+{
+	vdev_t *ckpoint_rvd = checkpoint->spa_root_vdev;
+	vdev_t *current_rvd = current->spa_root_vdev;
+
+	load_concrete_ms_allocatable_trees(checkpoint, SM_FREE);
+
+	for (uint64_t c = 0; c < ckpoint_rvd->vdev_children; c++) {
+		vdev_t *ckpoint_vd = ckpoint_rvd->vdev_child[c];
+		vdev_t *current_vd = current_rvd->vdev_child[c];
+
+		space_map_t *checkpoint_sm = NULL;
+		uint64_t checkpoint_sm_obj;
+
+		if (ckpoint_vd->vdev_ops == &vdev_indirect_ops) {
+			/*
+			 * Since we don't allow device removal in a pool
+			 * that has a checkpoint, we expect that all removed
+			 * vdevs were removed from the pool before the
+			 * checkpoint.
+			 */
+			ASSERT3P(current_vd->vdev_ops, ==, &vdev_indirect_ops);
+			continue;
+		}
+
+		/*
+		 * If the checkpoint space map doesn't exist, then nothing
+		 * here is checkpointed so there's nothing to verify.
+		 */
+		if (current_vd->vdev_top_zap == 0 ||
+		    zap_contains(spa_meta_objset(current),
+		    current_vd->vdev_top_zap,
+		    VDEV_TOP_ZAP_POOL_CHECKPOINT_SM) != 0)
+			continue;
+
+		VERIFY0(zap_lookup(spa_meta_objset(current),
+		    current_vd->vdev_top_zap, VDEV_TOP_ZAP_POOL_CHECKPOINT_SM,
+		    sizeof (uint64_t), 1, &checkpoint_sm_obj));
+
+		VERIFY0(space_map_open(&checkpoint_sm, spa_meta_objset(current),
+		    checkpoint_sm_obj, 0, current_vd->vdev_asize,
+		    current_vd->vdev_ashift));
+		space_map_update(checkpoint_sm);
+
+		verify_checkpoint_sm_entry_cb_arg_t vcsec;
+		vcsec.vcsec_vd = ckpoint_vd;
+		vcsec.vcsec_entryid = 0;
+		vcsec.vcsec_num_entries =
+		    space_map_length(checkpoint_sm) / sizeof (uint64_t);
+		VERIFY0(space_map_iterate(checkpoint_sm,
+		    verify_checkpoint_sm_entry_cb, &vcsec));
+		dump_spacemap(current->spa_meta_objset, checkpoint_sm);
+		space_map_close(checkpoint_sm);
+	}
+
+	/*
+	 * If we've added vdevs since we took the checkpoint, ensure
+	 * that their checkpoint space maps are empty.
+	 */
+	if (ckpoint_rvd->vdev_children < current_rvd->vdev_children) {
+		for (uint64_t c = ckpoint_rvd->vdev_children;
+		    c < current_rvd->vdev_children; c++) {
+			vdev_t *current_vd = current_rvd->vdev_child[c];
+			ASSERT3P(current_vd->vdev_checkpoint_sm, ==, NULL);
+		}
+	}
+
+	/* for cleaner progress output */
+	(void) fprintf(stderr, "\n");
+}
+
+/*
+ * Verifies that all space that's allocated in the checkpoint is
+ * still allocated in the current version, by checking that everything
+ * in checkpoint's ms_allocatable (which is actually allocated, not
+ * allocatable/free) is not present in current's ms_allocatable.
+ *
+ * Note that the function changes the state of the ms_allocatable
+ * trees of both spas when called. The entries of all ms_allocatable
+ * trees are cleared out and then repopulated from their respective
+ * ms_sm space maps. In the checkpointed state we load the allocated
+ * entries, and in the current state we load the free entries.
+ */
+static void
+verify_checkpoint_ms_spacemaps(spa_t *checkpoint, spa_t *current)
+{
+	vdev_t *ckpoint_rvd = checkpoint->spa_root_vdev;
+	vdev_t *current_rvd = current->spa_root_vdev;
+
+	load_concrete_ms_allocatable_trees(checkpoint, SM_ALLOC);
+	load_concrete_ms_allocatable_trees(current, SM_FREE);
+
+	for (uint64_t i = 0; i < ckpoint_rvd->vdev_children; i++) {
+		vdev_t *ckpoint_vd = ckpoint_rvd->vdev_child[i];
+		vdev_t *current_vd = current_rvd->vdev_child[i];
+
+		if (ckpoint_vd->vdev_ops == &vdev_indirect_ops) {
+			/*
+			 * See comment in verify_checkpoint_vdev_spacemaps()
+			 */
+			ASSERT3P(current_vd->vdev_ops, ==, &vdev_indirect_ops);
+			continue;
+		}
+
+		for (uint64_t m = 0; m < ckpoint_vd->vdev_ms_count; m++) {
+			metaslab_t *ckpoint_msp = ckpoint_vd->vdev_ms[m];
+			metaslab_t *current_msp = current_vd->vdev_ms[m];
+
+			(void) fprintf(stderr,
+			    "\rverifying vdev %llu of %llu, "
+			    "metaslab %llu of %llu ...",
+			    (longlong_t)current_vd->vdev_id,
+			    (longlong_t)current_rvd->vdev_children,
+			    (longlong_t)current_vd->vdev_ms[m]->ms_id,
+			    (longlong_t)current_vd->vdev_ms_count);
+
+			/*
+			 * We walk through the ms_allocatable trees that
+			 * are loaded with the allocated blocks from the
+			 * ms_sm spacemaps of the checkpoint. For each
+			 * one of these ranges we ensure that none of them
+			 * exists in the ms_allocatable trees of the
+			 * current state which are loaded with the ranges
+			 * that are currently free.
+			 *
+			 * This way we ensure that none of the blocks that
+			 * are part of the checkpoint were freed by mistake.
+			 */
+			range_tree_walk(ckpoint_msp->ms_allocatable,
+			    (range_tree_func_t *)range_tree_verify,
+			    current_msp->ms_allocatable);
+		}
+	}
+
+	/* for cleaner progress output */
+	(void) fprintf(stderr, "\n");
+}
+
+static void
+verify_checkpoint_blocks(spa_t *spa)
+{
+	spa_t *checkpoint_spa;
+	char *checkpoint_pool;
+	nvlist_t *config = NULL;
+	int error = 0;
+
+	/*
+	 * We import the checkpointed state of the pool (under a different
+	 * name) so we can do verification on it against the current state
+	 * of the pool.
+	 */
+	checkpoint_pool = import_checkpointed_state(spa->spa_name, config,
+	    NULL);
+	ASSERT(strcmp(spa->spa_name, checkpoint_pool) != 0);
+
+	error = spa_open(checkpoint_pool, &checkpoint_spa, FTAG);
+	if (error != 0) {
+		fatal("Tried to open pool \"%s\" but spa_open() failed with "
+		    "error %d\n", checkpoint_pool, error);
+	}
+
+	/*
+	 * Ensure that ranges in the checkpoint space maps of each vdev
+	 * are allocated according to the checkpointed state's metaslab
+	 * space maps.
+	 */
+	verify_checkpoint_vdev_spacemaps(checkpoint_spa, spa);
+
+	/*
+	 * Ensure that allocated ranges in the checkpoint's metaslab
+	 * space maps remain allocated in the metaslab space maps of
+	 * the current state.
+	 */
+	verify_checkpoint_ms_spacemaps(checkpoint_spa, spa);
+
+	/*
+	 * Once we are done, we get rid of the checkpointed state.
+	 */
+	spa_close(checkpoint_spa, FTAG);
+	free(checkpoint_pool);
+}
+
+static void
+dump_leftover_checkpoint_blocks(spa_t *spa)
+{
+	vdev_t *rvd = spa->spa_root_vdev;
+
+	for (uint64_t i = 0; i < rvd->vdev_children; i++) {
+		vdev_t *vd = rvd->vdev_child[i];
+
+		space_map_t *checkpoint_sm = NULL;
+		uint64_t checkpoint_sm_obj;
+
+		if (vd->vdev_top_zap == 0)
+			continue;
+
+		if (zap_contains(spa_meta_objset(spa), vd->vdev_top_zap,
+		    VDEV_TOP_ZAP_POOL_CHECKPOINT_SM) != 0)
+			continue;
+
+		VERIFY0(zap_lookup(spa_meta_objset(spa), vd->vdev_top_zap,
+		    VDEV_TOP_ZAP_POOL_CHECKPOINT_SM,
+		    sizeof (uint64_t), 1, &checkpoint_sm_obj));
+
+		VERIFY0(space_map_open(&checkpoint_sm, spa_meta_objset(spa),
+		    checkpoint_sm_obj, 0, vd->vdev_asize, vd->vdev_ashift));
+		space_map_update(checkpoint_sm);
+		dump_spacemap(spa->spa_meta_objset, checkpoint_sm);
+		space_map_close(checkpoint_sm);
+	}
+}
+
+static int
+verify_checkpoint(spa_t *spa)
+{
+	uberblock_t checkpoint;
+	int error;
+
+	if (!spa_feature_is_active(spa, SPA_FEATURE_POOL_CHECKPOINT))
+		return (0);
+
+	error = zap_lookup(spa->spa_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
+	    DMU_POOL_ZPOOL_CHECKPOINT, sizeof (uint64_t),
+	    sizeof (uberblock_t) / sizeof (uint64_t), &checkpoint);
+
+	if (error == ENOENT) {
+		/*
+		 * If the feature is active but the uberblock is missing
+		 * then we must be in the middle of discarding the
+		 * checkpoint.
+		 */
+		(void) printf("\nPartially discarded checkpoint "
+		    "state found:\n");
+		dump_leftover_checkpoint_blocks(spa);
+		return (0);
+	} else if (error != 0) {
+		(void) printf("lookup error %d when looking for "
+		    "checkpointed uberblock in MOS\n", error);
+		return (error);
+	}
+	dump_uberblock(&checkpoint, "\nCheckpointed uberblock found:\n", "\n");
+
+	if (checkpoint.ub_checkpoint_txg == 0) {
+		(void) printf("\nub_checkpoint_txg not set in checkpointed "
+		    "uberblock\n");
+		error = 3;
+	}
+
+	if (error == 0)
+		verify_checkpoint_blocks(spa);
+
+	return (error);
+}
+
+static void
 dump_zpool(spa_t *spa)
 {
 	dsl_pool_t *dp = spa_get_dsl(spa);
@@ -3938,6 +4512,9 @@ dump_zpool(spa_t *spa)
 	if (dump_opt['h'])
 		dump_history(spa);
 
+	if (rc == 0 && !dump_opt['L'])
+		rc = verify_checkpoint(spa);
+
 	if (rc != 0) {
 		dump_debug_buffer();
 		exit(rc);
@@ -4451,6 +5028,7 @@ main(int argc, char **argv)
 	int rewind = ZPOOL_NEVER_REWIND;
 	char *spa_config_path_env;
 	boolean_t target_is_spa = B_TRUE;
+	nvlist_t *cfg = NULL;
 
 	(void) setrlimit(RLIMIT_NOFILE, &rl);
 	(void) enable_extended_FILE_stdio(-1, -1);
@@ -4467,7 +5045,7 @@ main(int argc, char **argv)
 		spa_config_path = spa_config_path_env;
 
 	while ((c = getopt(argc, argv,
-	    "AbcCdDeEFGhiI:lLmMo:Op:PqRsSt:uU:vVx:X")) != -1) {

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@freebsd.org  Wed Mar 28 22:07:31 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1B20F764BF;
 Wed, 28 Mar 2018 22:07:31 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 835AE84EDE;
 Wed, 28 Mar 2018 22:07:31 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E3F110D57;
 Wed, 28 Mar 2018 22:07:31 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SM7Vg1030876;
 Wed, 28 Mar 2018 22:07:31 GMT (envelope-from mav@FreeBSD.org)
Received: (from mav@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SM7V5j030875;
 Wed, 28 Mar 2018 22:07:31 GMT (envelope-from mav@FreeBSD.org)
Message-Id: <201803282207.w2SM7V5j030875@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
 using -f
From: Alexander Motin 
Date: Wed, 28 Mar 2018 22:07:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331703 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: head
X-SVN-Commit-Author: mav
X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Commit-Revision: 331703
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 22:07:32 -0000

Author: mav
Date: Wed Mar 28 22:07:31 2018
New Revision: 331703
URL: https://svnweb.freebsd.org/changeset/base/331703

Log:
  MFV 331702:
  9187 racing condition between vdev label and spa_last_synced_txg in vdev_validate
  
  illumos/illumos-gate@d1de72cfa29ab77ff80e2bb0e668a6afa5bccaf0
  
  ztest failed with uncorrectable IO error despite having the fix for #7163.
  Both sides of the mirror have CANT_OPEN_BAD_LABEL, which also distinguishes
  it from that issue.
  
  Definitely seems like a racing condition between the vdev_validate and spa_sync:
  1. Thread A (spa_sync): vdev label is updated to latest txg
  2. Thread B (vdev_validate): vdev label's txg is compared to spa_last_synced_txg and is ahead.
  3. Thread A (spa_sync): spa_last_synced_txg is updated to latest txg.
  
  Solution: do not check txg in vdev_validate unless config lock is held.
  
  Reviewed by: George Wilson 
  Reviewed by: Matt Ahrens 
  Approved by: Robert Mustacchi 
  Author: Pavel Zakharov 

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Wed Mar 28 22:06:12 2018	(r331702)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c	Wed Mar 28 22:07:31 2018	(r331703)
@@ -1696,8 +1696,11 @@ vdev_validate(vdev_t *vd)
 	/*
 	 * If we are performing an extreme rewind, we allow for a label that
 	 * was modified at a point after the current txg.
+	 * If config lock is not held do not check for the txg. spa_sync could
+	 * be updating the vdev's label before updating spa_last_synced_txg.
 	 */
-	if (spa->spa_extreme_rewind || spa_last_synced_txg(spa) == 0)
+	if (spa->spa_extreme_rewind || spa_last_synced_txg(spa) == 0 ||
+	    spa_config_held(spa, SCL_CONFIG, RW_WRITER) != SCL_CONFIG)
 		txg = UINT64_MAX;
 	else
 		txg = spa_last_synced_txg(spa);

From owner-svn-src-head@freebsd.org  Wed Mar 28 22:10:07 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F7BEF76752;
 Wed, 28 Mar 2018 22:10:07 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 1EEA385255;
 Wed, 28 Mar 2018 22:10:07 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 196A810D5C;
 Wed, 28 Mar 2018 22:10:07 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SMA6rn031097;
 Wed, 28 Mar 2018 22:10:06 GMT (envelope-from mav@FreeBSD.org)
Received: (from mav@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SMA6PO031096;
 Wed, 28 Mar 2018 22:10:06 GMT (envelope-from mav@FreeBSD.org)
Message-Id: <201803282210.w2SMA6PO031096@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
 using -f
From: Alexander Motin 
Date: Wed, 28 Mar 2018 22:10:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331705 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: head
X-SVN-Commit-Author: mav
X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Commit-Revision: 331705
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 22:10:07 -0000

Author: mav
Date: Wed Mar 28 22:10:06 2018
New Revision: 331705
URL: https://svnweb.freebsd.org/changeset/base/331705

Log:
  MFV 331704:
  9191 dump vdev tree to zfs_dbgmsg when spa load fails due to missing log devices
  
  illumos/illumos-gate@ccef24b493bcbd146fcd6d8946666cae081470b6
  
  Reviewed by: George Wilson 
  Reviewed by: Prakash Surya 
  Reviewed by: Matt Ahrens 
  Approved by: Robert Mustacchi 
  Author: Pavel Zakharov 

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Wed Mar 28 22:08:57 2018	(r331704)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Wed Mar 28 22:10:06 2018	(r331705)
@@ -1887,6 +1887,7 @@ spa_check_for_missing_logs(spa_t *spa)
 
 		if (idx > 0) {
 			spa_load_failed(spa, "some log devices are missing");
+			vdev_dbgmsg_print_tree(rvd, 2);
 			return (SET_ERROR(ENXIO));
 		}
 	} else {
@@ -1898,6 +1899,7 @@ spa_check_for_missing_logs(spa_t *spa)
 				spa_set_log_state(spa, SPA_LOG_CLEAR);
 				spa_load_note(spa, "some log devices are "
 				    "missing, ZIL is dropped.");
+				vdev_dbgmsg_print_tree(rvd, 2);
 				break;
 			}
 		}

From owner-svn-src-head@freebsd.org  Wed Mar 28 22:29:08 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25AB9F4F15D;
 Wed, 28 Mar 2018 22:29:08 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id C9394864A3;
 Wed, 28 Mar 2018 22:29:07 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD687110B8;
 Wed, 28 Mar 2018 22:29:07 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SMT7a0040921;
 Wed, 28 Mar 2018 22:29:07 GMT (envelope-from mav@FreeBSD.org)
Received: (from mav@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SMT6bd040912;
 Wed, 28 Mar 2018 22:29:06 GMT (envelope-from mav@FreeBSD.org)
Message-Id: <201803282229.w2SMT6bd040912@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
 using -f
From: Alexander Motin 
Date: Wed, 28 Mar 2018 22:29:06 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331707 - in head: cddl/contrib/opensolaris/cmd/zdb
 cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common
 sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contri...
X-SVN-Group: head
X-SVN-Commit-Author: mav
X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/zdb
 cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common
 sys/cddl/contrib/opensolaris/common/zfs
 sys/cddl/contrib/opensolaris/uts/common/...
X-SVN-Commit-Revision: 331707
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 22:29:08 -0000

Author: mav
Date: Wed Mar 28 22:29:06 2018
New Revision: 331707
URL: https://svnweb.freebsd.org/changeset/base/331707

Log:
  MFV r331706:
  9235 rename zpool_rewind_policy_t to zpool_load_policy_t
  
  illumos/illumos-gate@5dafeea3ebd2dd77affc802bcb90f63faf01589f
  
  We want to be able to pass various settings during import/open of a pool,
  which are not only related to rewind. Instead of adding a new policy and
  duplicate a bunch of code, we should just rename rewind_policy to a more
  generic term like load_policy.
  
  For instance, we'd like to set spa->spa_import_flags from the nvlist,
  rather from a flags parameter passed to spa_import as in some cases we want
  those flags not only for the import case, but also for the open case. One
  such flag could be ZFS_IMPORT_MISSING_LOG (as used in zdb) which would
  allow zfs to open a pool when logs are missing.
  
  Reviewed by: Matt Ahrens 
  Reviewed by: George Wilson 
  Approved by: Robert Mustacchi 
  Author: Pavel Zakharov 

Modified:
  head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
  head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
  head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
  head/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.c
  head/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
  head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/cddl/contrib/opensolaris/cmd/zdb/   (props changed)
  head/cddl/contrib/opensolaris/lib/libzfs/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Wed Mar 28 22:16:51 2018	(r331706)
+++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c	Wed Mar 28 22:29:06 2018	(r331707)
@@ -5222,8 +5222,8 @@ main(int argc, char **argv)
 		    (dump_opt['X'] ? ZPOOL_EXTREME_REWIND : 0);
 
 	if (nvlist_alloc(&policy, NV_UNIQUE_NAME_TYPE, 0) != 0 ||
-	    nvlist_add_uint64(policy, ZPOOL_REWIND_REQUEST_TXG, max_txg) != 0 ||
-	    nvlist_add_uint32(policy, ZPOOL_REWIND_REQUEST, rewind) != 0)
+	    nvlist_add_uint64(policy, ZPOOL_LOAD_REQUEST_TXG, max_txg) != 0 ||
+	    nvlist_add_uint32(policy, ZPOOL_LOAD_REWIND_POLICY, rewind) != 0)
 		fatal("internal error: %s", strerror(ENOMEM));
 
 	error = 0;
@@ -5240,7 +5240,7 @@ main(int argc, char **argv)
 			}
 
 			if (nvlist_add_nvlist(cfg,
-			    ZPOOL_REWIND_POLICY, policy) != 0) {
+			    ZPOOL_LOAD_POLICY, policy) != 0) {
 				fatal("can't open '%s': %s",
 				    target, strerror(ENOMEM));
 			}

Modified: head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c	Wed Mar 28 22:16:51 2018	(r331706)
+++ head/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c	Wed Mar 28 22:29:06 2018	(r331707)
@@ -2357,8 +2357,9 @@ zpool_do_import(int argc, char **argv)
 
 	/* In the future, we can capture further policy and include it here */
 	if (nvlist_alloc(&policy, NV_UNIQUE_NAME, 0) != 0 ||
-	    nvlist_add_uint64(policy, ZPOOL_REWIND_REQUEST_TXG, txg) != 0 ||
-	    nvlist_add_uint32(policy, ZPOOL_REWIND_REQUEST, rewind_policy) != 0)
+	    nvlist_add_uint64(policy, ZPOOL_LOAD_REQUEST_TXG, txg) != 0 ||
+	    nvlist_add_uint32(policy, ZPOOL_LOAD_REWIND_POLICY,
+	    rewind_policy) != 0)
 		goto error;
 
 	if (searchdirs == NULL) {
@@ -2483,7 +2484,7 @@ zpool_do_import(int argc, char **argv)
 		if (do_destroyed && pool_state != POOL_STATE_DESTROYED)
 			continue;
 
-		verify(nvlist_add_nvlist(config, ZPOOL_REWIND_POLICY,
+		verify(nvlist_add_nvlist(config, ZPOOL_LOAD_POLICY,
 		    policy) == 0);
 
 		if (argc == 0) {
@@ -3971,8 +3972,10 @@ zpool_do_clear(int argc, char **argv)
 
 	/* In future, further rewind policy choices can be passed along here */
 	if (nvlist_alloc(&policy, NV_UNIQUE_NAME, 0) != 0 ||
-	    nvlist_add_uint32(policy, ZPOOL_REWIND_REQUEST, rewind_policy) != 0)
+	    nvlist_add_uint32(policy, ZPOOL_LOAD_REWIND_POLICY,
+	    rewind_policy) != 0) {
 		return (1);
+	}
 
 	pool = argv[0];
 	device = argc == 2 ? argv[1] : NULL;

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h	Wed Mar 28 22:16:51 2018	(r331706)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h	Wed Mar 28 22:29:06 2018	(r331707)
@@ -396,7 +396,7 @@ typedef struct importargs {
 	int can_be_active : 1;	/* can the pool be active?		*/
 	int unique : 1;		/* does 'poolname' already exist?	*/
 	int exists : 1;		/* set on return if pool already exists	*/
-	nvlist_t *policy;	/* rewind policy (rewind txg, etc.)	*/
+	nvlist_t *policy;	/* load policy (max txg, rewind, etc.)	*/
 } importargs_t;
 
 extern nvlist_t *zpool_search_import(libzfs_handle_t *, importargs_t *);

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Wed Mar 28 22:16:51 2018	(r331706)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c	Wed Mar 28 22:29:06 2018	(r331707)
@@ -21,7 +21,7 @@
 
 /*
  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012, 2016 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2017 by Delphix. All rights reserved.
  * Copyright 2015 RackTop Systems.
  * Copyright 2016 Nexenta Systems, Inc.
  */
@@ -776,7 +776,7 @@ get_configs(libzfs_handle_t *hdl, pool_list_t *pl, boo
 		}
 
 		if (policy != NULL) {
-			if (nvlist_add_nvlist(config, ZPOOL_REWIND_POLICY,
+			if (nvlist_add_nvlist(config, ZPOOL_LOAD_POLICY,
 			    policy) != 0)
 				goto nomem;
 		}

Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c
==============================================================================
--- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Wed Mar 28 22:16:51 2018	(r331706)
+++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c	Wed Mar 28 22:29:06 2018	(r331707)
@@ -1715,7 +1715,7 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *con
     nvlist_t *props, int flags)
 {
 	zfs_cmd_t zc = { 0 };
-	zpool_rewind_policy_t policy;
+	zpool_load_policy_t policy;
 	nvlist_t *nv = NULL;
 	nvlist_t *nvinfo = NULL;
 	nvlist_t *missing = NULL;
@@ -1787,7 +1787,7 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *con
 
 	zcmd_free_nvlists(&zc);
 
-	zpool_get_rewind_policy(config, &policy);
+	zpool_get_load_policy(config, &policy);
 
 	if (error) {
 		char desc[1024];
@@ -1796,7 +1796,7 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *con
 		 * Dry-run failed, but we print out what success
 		 * looks like if we found a best txg
 		 */
-		if (policy.zrp_request & ZPOOL_TRY_REWIND) {
+		if (policy.zlp_rewind & ZPOOL_TRY_REWIND) {
 			zpool_rewind_exclaim(hdl, newname ? origname : thename,
 			    B_TRUE, nv);
 			nvlist_free(nv);
@@ -1889,10 +1889,10 @@ zpool_import_props(libzfs_handle_t *hdl, nvlist_t *con
 			ret = -1;
 		else if (zhp != NULL)
 			zpool_close(zhp);
-		if (policy.zrp_request &
+		if (policy.zlp_rewind &
 		    (ZPOOL_DO_REWIND | ZPOOL_TRY_REWIND)) {
 			zpool_rewind_exclaim(hdl, newname ? origname : thename,
-			    ((policy.zrp_request & ZPOOL_TRY_REWIND) != 0), nv);
+			    ((policy.zlp_rewind & ZPOOL_TRY_REWIND) != 0), nv);
 		}
 		nvlist_free(nv);
 		return (0);
@@ -3286,7 +3286,7 @@ zpool_clear(zpool_handle_t *zhp, const char *path, nvl
 	zfs_cmd_t zc = { 0 };
 	char msg[1024];
 	nvlist_t *tgt;
-	zpool_rewind_policy_t policy;
+	zpool_load_policy_t policy;
 	boolean_t avail_spare, l2cache;
 	libzfs_handle_t *hdl = zhp->zpool_hdl;
 	nvlist_t *nvi = NULL;
@@ -3318,8 +3318,8 @@ zpool_clear(zpool_handle_t *zhp, const char *path, nvl
 		    &zc.zc_guid) == 0);
 	}
 
-	zpool_get_rewind_policy(rewindnvl, &policy);
-	zc.zc_cookie = policy.zrp_request;
+	zpool_get_load_policy(rewindnvl, &policy);
+	zc.zc_cookie = policy.zlp_rewind;
 
 	if (zcmd_alloc_dst_nvlist(hdl, &zc, zhp->zpool_config_size * 2) != 0)
 		return (-1);
@@ -3335,13 +3335,13 @@ zpool_clear(zpool_handle_t *zhp, const char *path, nvl
 		}
 	}
 
-	if (!error || ((policy.zrp_request & ZPOOL_TRY_REWIND) &&
+	if (!error || ((policy.zlp_rewind & ZPOOL_TRY_REWIND) &&
 	    errno != EPERM && errno != EACCES)) {
-		if (policy.zrp_request &
+		if (policy.zlp_rewind &
 		    (ZPOOL_DO_REWIND | ZPOOL_TRY_REWIND)) {
 			(void) zcmd_read_dst_nvlist(hdl, &zc, &nvi);
 			zpool_rewind_exclaim(hdl, zc.zc_name,
-			    ((policy.zrp_request & ZPOOL_TRY_REWIND) != 0),
+			    ((policy.zlp_rewind & ZPOOL_TRY_REWIND) != 0),
 			    nvi);
 			nvlist_free(nvi);
 		}

Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.c	Wed Mar 28 22:16:51 2018	(r331706)
+++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.c	Wed Mar 28 22:29:06 2018	(r331707)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2017 by Delphix. All rights reserved.
  */
 
 /*
@@ -66,17 +66,17 @@ zfs_allocatable_devs(nvlist_t *nv)
 }
 
 void
-zpool_get_rewind_policy(nvlist_t *nvl, zpool_rewind_policy_t *zrpp)
+zpool_get_load_policy(nvlist_t *nvl, zpool_load_policy_t *zlpp)
 {
 	nvlist_t *policy;
 	nvpair_t *elem;
 	char *nm;
 
 	/* Defaults */
-	zrpp->zrp_request = ZPOOL_NO_REWIND;
-	zrpp->zrp_maxmeta = 0;
-	zrpp->zrp_maxdata = UINT64_MAX;
-	zrpp->zrp_txg = UINT64_MAX;
+	zlpp->zlp_rewind = ZPOOL_NO_REWIND;
+	zlpp->zlp_maxmeta = 0;
+	zlpp->zlp_maxdata = UINT64_MAX;
+	zlpp->zlp_txg = UINT64_MAX;
 
 	if (nvl == NULL)
 		return;
@@ -84,24 +84,24 @@ zpool_get_rewind_policy(nvlist_t *nvl, zpool_rewind_po
 	elem = NULL;
 	while ((elem = nvlist_next_nvpair(nvl, elem)) != NULL) {
 		nm = nvpair_name(elem);
-		if (strcmp(nm, ZPOOL_REWIND_POLICY) == 0) {
+		if (strcmp(nm, ZPOOL_LOAD_POLICY) == 0) {
 			if (nvpair_value_nvlist(elem, &policy) == 0)
-				zpool_get_rewind_policy(policy, zrpp);
+				zpool_get_load_policy(policy, zlpp);
 			return;
-		} else if (strcmp(nm, ZPOOL_REWIND_REQUEST) == 0) {
-			if (nvpair_value_uint32(elem, &zrpp->zrp_request) == 0)
-				if (zrpp->zrp_request & ~ZPOOL_REWIND_POLICIES)
-					zrpp->zrp_request = ZPOOL_NO_REWIND;
-		} else if (strcmp(nm, ZPOOL_REWIND_REQUEST_TXG) == 0) {
-			(void) nvpair_value_uint64(elem, &zrpp->zrp_txg);
-		} else if (strcmp(nm, ZPOOL_REWIND_META_THRESH) == 0) {
-			(void) nvpair_value_uint64(elem, &zrpp->zrp_maxmeta);
-		} else if (strcmp(nm, ZPOOL_REWIND_DATA_THRESH) == 0) {
-			(void) nvpair_value_uint64(elem, &zrpp->zrp_maxdata);
+		} else if (strcmp(nm, ZPOOL_LOAD_REWIND_POLICY) == 0) {
+			if (nvpair_value_uint32(elem, &zlpp->zlp_rewind) == 0)
+				if (zlpp->zlp_rewind & ~ZPOOL_REWIND_POLICIES)
+					zlpp->zlp_rewind = ZPOOL_NO_REWIND;
+		} else if (strcmp(nm, ZPOOL_LOAD_REQUEST_TXG) == 0) {
+			(void) nvpair_value_uint64(elem, &zlpp->zlp_txg);
+		} else if (strcmp(nm, ZPOOL_LOAD_META_THRESH) == 0) {
+			(void) nvpair_value_uint64(elem, &zlpp->zlp_maxmeta);
+		} else if (strcmp(nm, ZPOOL_LOAD_DATA_THRESH) == 0) {
+			(void) nvpair_value_uint64(elem, &zlpp->zlp_maxdata);
 		}
 	}
-	if (zrpp->zrp_request == 0)
-		zrpp->zrp_request = ZPOOL_NO_REWIND;
+	if (zlpp->zlp_rewind == 0)
+		zlpp->zlp_rewind = ZPOOL_NO_REWIND;
 }
 
 typedef struct zfs_version_spa_map {

Modified: head/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h	Wed Mar 28 22:16:51 2018	(r331706)
+++ head/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h	Wed Mar 28 22:29:06 2018	(r331707)
@@ -20,7 +20,7 @@
  */
 /*
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2012, 2017 by Delphix. All rights reserved.
  */
 
 #ifndef	_ZFS_COMUTIL_H
@@ -34,7 +34,7 @@ extern "C" {
 #endif
 
 extern boolean_t zfs_allocatable_devs(nvlist_t *);
-extern void zpool_get_rewind_policy(nvlist_t *, zpool_rewind_policy_t *);
+extern void zpool_get_load_policy(nvlist_t *, zpool_load_policy_t *);
 
 extern int zfs_zpl_version_map(int spa_version);
 extern int zfs_spa_version_map(int zpl_version);

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Wed Mar 28 22:16:51 2018	(r331706)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c	Wed Mar 28 22:29:06 2018	(r331707)
@@ -2109,13 +2109,13 @@ spa_load_verify(spa_t *spa)
 {
 	zio_t *rio;
 	spa_load_error_t sle = { 0 };
-	zpool_rewind_policy_t policy;
+	zpool_load_policy_t policy;
 	boolean_t verify_ok = B_FALSE;
 	int error = 0;
 
-	zpool_get_rewind_policy(spa->spa_config, &policy);
+	zpool_get_load_policy(spa->spa_config, &policy);
 
-	if (policy.zrp_request & ZPOOL_NEVER_REWIND)
+	if (policy.zlp_rewind & ZPOOL_NEVER_REWIND)
 		return (0);
 
 	dsl_pool_config_enter(spa->spa_dsl_pool, FTAG);
@@ -2154,8 +2154,8 @@ spa_load_verify(spa_t *spa)
 	}
 
 	if (spa_load_verify_dryrun ||
-	    (!error && sle.sle_meta_count <= policy.zrp_maxmeta &&
-	    sle.sle_data_count <= policy.zrp_maxdata)) {
+	    (!error && sle.sle_meta_count <= policy.zlp_maxmeta &&
+	    sle.sle_data_count <= policy.zlp_maxdata)) {
 		int64_t loss = 0;
 
 		verify_ok = B_TRUE;
@@ -2855,17 +2855,17 @@ spa_ld_trusted_config(spa_t *spa, spa_import_type_t ty
 	/*
 	 * We will use spa_config if we decide to reload the spa or if spa_load
 	 * fails and we rewind. We must thus regenerate the config using the
-	 * MOS information with the updated paths. Rewind policy is an import
-	 * setting and is not in the MOS. We copy it over to our new, trusted
-	 * config.
+	 * MOS information with the updated paths. ZPOOL_LOAD_POLICY is used to
+	 * pass settings on how to load the pool and is not stored in the MOS.
+	 * We copy it over to our new, trusted config.
 	 */
 	mos_config_txg = fnvlist_lookup_uint64(mos_config,
 	    ZPOOL_CONFIG_POOL_TXG);
 	nvlist_free(mos_config);
 	mos_config = spa_config_generate(spa, NULL, mos_config_txg, B_FALSE);
-	if (nvlist_lookup_nvlist(spa->spa_config, ZPOOL_REWIND_POLICY,
+	if (nvlist_lookup_nvlist(spa->spa_config, ZPOOL_LOAD_POLICY,
 	    &policy) == 0)
-		fnvlist_add_nvlist(mos_config, ZPOOL_REWIND_POLICY, policy);
+		fnvlist_add_nvlist(mos_config, ZPOOL_LOAD_POLICY, policy);
 	spa_config_set(spa, mos_config);
 	spa->spa_config_source = SPA_CONFIG_SRC_MOS;
 
@@ -4125,13 +4125,13 @@ spa_open_common(const char *pool, spa_t **spapp, void 
 	}
 
 	if (spa->spa_state == POOL_STATE_UNINITIALIZED) {
-		zpool_rewind_policy_t policy;
+		zpool_load_policy_t policy;
 
 		firstopen = B_TRUE;
 
-		zpool_get_rewind_policy(nvpolicy ? nvpolicy : spa->spa_config,
+		zpool_get_load_policy(nvpolicy ? nvpolicy : spa->spa_config,
 		    &policy);
-		if (policy.zrp_request & ZPOOL_DO_REWIND)
+		if (policy.zlp_rewind & ZPOOL_DO_REWIND)
 			state = SPA_LOAD_RECOVER;
 
 		spa_activate(spa, spa_mode_global);
@@ -4141,8 +4141,8 @@ spa_open_common(const char *pool, spa_t **spapp, void 
 		spa->spa_config_source = SPA_CONFIG_SRC_CACHEFILE;
 
 		zfs_dbgmsg("spa_open_common: opening %s", pool);
-		error = spa_load_best(spa, state, policy.zrp_txg,
-		    policy.zrp_request);
+		error = spa_load_best(spa, state, policy.zlp_txg,
+		    policy.zlp_rewind);
 
 		if (error == EBADF) {
 			/*
@@ -5326,7 +5326,7 @@ spa_import(const char *pool, nvlist_t *config, nvlist_
 	spa_t *spa;
 	char *altroot = NULL;
 	spa_load_state_t state = SPA_LOAD_IMPORT;
-	zpool_rewind_policy_t policy;
+	zpool_load_policy_t policy;
 	uint64_t mode = spa_mode_global;
 	uint64_t readonly = B_FALSE;
 	int error;
@@ -5377,8 +5377,8 @@ spa_import(const char *pool, nvlist_t *config, nvlist_
 	 */
 	spa_async_suspend(spa);
 
-	zpool_get_rewind_policy(config, &policy);
-	if (policy.zrp_request & ZPOOL_DO_REWIND)
+	zpool_get_load_policy(config, &policy);
+	if (policy.zlp_rewind & ZPOOL_DO_REWIND)
 		state = SPA_LOAD_RECOVER;
 
 	spa->spa_config_source = SPA_CONFIG_SRC_TRYIMPORT;
@@ -5388,9 +5388,9 @@ spa_import(const char *pool, nvlist_t *config, nvlist_
 		zfs_dbgmsg("spa_import: importing %s", pool);
 	} else {
 		zfs_dbgmsg("spa_import: importing %s, max_txg=%lld "
-		    "(RECOVERY MODE)", pool, (longlong_t)policy.zrp_txg);
+		    "(RECOVERY MODE)", pool, (longlong_t)policy.zlp_txg);
 	}
-	error = spa_load_best(spa, state, policy.zrp_txg, policy.zrp_request);
+	error = spa_load_best(spa, state, policy.zlp_txg, policy.zlp_rewind);
 
 	/*
 	 * Propagate anything learned while loading the pool and pass it
@@ -5517,7 +5517,7 @@ spa_tryimport(nvlist_t *tryconfig)
 	spa_t *spa;
 	uint64_t state;
 	int error;
-	zpool_rewind_policy_t policy;
+	zpool_load_policy_t policy;
 
 	if (nvlist_lookup_string(tryconfig, ZPOOL_CONFIG_POOL_NAME, &poolname))
 		return (NULL);
@@ -5533,16 +5533,14 @@ spa_tryimport(nvlist_t *tryconfig)
 	spa_activate(spa, FREAD);
 
 	/*
-	 * Rewind pool if a max txg was provided. Note that even though we
-	 * retrieve the complete rewind policy, only the rewind txg is relevant
-	 * for tryimport.
+	 * Rewind pool if a max txg was provided.
 	 */
-	zpool_get_rewind_policy(spa->spa_config, &policy);
-	if (policy.zrp_txg != UINT64_MAX) {
-		spa->spa_load_max_txg = policy.zrp_txg;
+	zpool_get_load_policy(spa->spa_config, &policy);
+	if (policy.zlp_txg != UINT64_MAX) {
+		spa->spa_load_max_txg = policy.zlp_txg;
 		spa->spa_extreme_rewind = B_TRUE;
 		zfs_dbgmsg("spa_tryimport: importing %s, max_txg=%lld",
-		    poolname, (longlong_t)policy.zrp_txg);
+		    poolname, (longlong_t)policy.zlp_txg);
 	} else {
 		zfs_dbgmsg("spa_tryimport: importing %s", poolname);
 	}

Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h	Wed Mar 28 22:16:51 2018	(r331706)
+++ head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h	Wed Mar 28 22:29:06 2018	(r331707)
@@ -501,7 +501,7 @@ typedef enum {
 #define	ZPL_VERSION_USERSPACE		ZPL_VERSION_4
 #define	ZPL_VERSION_SA			ZPL_VERSION_5
 
-/* Rewind request information */
+/* Rewind policy information */
 #define	ZPOOL_NO_REWIND		1  /* No policy - default behavior */
 #define	ZPOOL_NEVER_REWIND	2  /* Do not search for best txg or rewind */
 #define	ZPOOL_TRY_REWIND	4  /* Search for best txg, but do not rewind */
@@ -510,12 +510,12 @@ typedef enum {
 #define	ZPOOL_REWIND_MASK	28 /* All the possible rewind bits */
 #define	ZPOOL_REWIND_POLICIES	31 /* All the possible policy bits */
 
-typedef struct zpool_rewind_policy {
-	uint32_t	zrp_request;	/* rewind behavior requested */
-	uint64_t	zrp_maxmeta;	/* max acceptable meta-data errors */
-	uint64_t	zrp_maxdata;	/* max acceptable data errors */
-	uint64_t	zrp_txg;	/* specific txg to load */
-} zpool_rewind_policy_t;
+typedef struct zpool_load_policy {
+	uint32_t	zlp_rewind;	/* rewind policy requested */
+	uint64_t	zlp_maxmeta;	/* max acceptable meta-data errors */
+	uint64_t	zlp_maxdata;	/* max acceptable data errors */
+	uint64_t	zlp_txg;	/* specific txg to load */
+} zpool_load_policy_t;
 
 /*
  * The following are configuration names used in the nvlist describing a pool's
@@ -603,12 +603,12 @@ typedef struct zpool_rewind_policy {
 #define	ZPOOL_CONFIG_FRU		"fru"
 #define	ZPOOL_CONFIG_AUX_STATE		"aux_state"
 
-/* Rewind policy parameters */
-#define	ZPOOL_REWIND_POLICY		"rewind-policy"
-#define	ZPOOL_REWIND_REQUEST		"rewind-request"
-#define	ZPOOL_REWIND_REQUEST_TXG	"rewind-request-txg"
-#define	ZPOOL_REWIND_META_THRESH	"rewind-meta-thresh"
-#define	ZPOOL_REWIND_DATA_THRESH	"rewind-data-thresh"
+/* Pool load policy parameters */
+#define	ZPOOL_LOAD_POLICY		"load-policy"
+#define	ZPOOL_LOAD_REWIND_POLICY	"load-rewind-policy"
+#define	ZPOOL_LOAD_REQUEST_TXG		"load-request-txg"
+#define	ZPOOL_LOAD_META_THRESH		"load-meta-thresh"
+#define	ZPOOL_LOAD_DATA_THRESH		"load-data-thresh"
 
 /* Rewind data discovered */
 #define	ZPOOL_CONFIG_LOAD_TIME		"rewind_txg_ts"

From owner-svn-src-head@freebsd.org  Wed Mar 28 22:50:06 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0648BF50CA2;
 Wed, 28 Mar 2018 22:50:06 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id AD2CA87490;
 Wed, 28 Mar 2018 22:50:05 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3C0B1140F;
 Wed, 28 Mar 2018 22:50:05 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SMo5pH051350;
 Wed, 28 Mar 2018 22:50:05 GMT (envelope-from mav@FreeBSD.org)
Received: (from mav@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SMo5qL051349;
 Wed, 28 Mar 2018 22:50:05 GMT (envelope-from mav@FreeBSD.org)
Message-Id: <201803282250.w2SMo5qL051349@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
 using -f
From: Alexander Motin 
Date: Wed, 28 Mar 2018 22:50:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331709 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: head
X-SVN-Commit-Author: mav
X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Commit-Revision: 331709
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 22:50:06 -0000

Author: mav
Date: Wed Mar 28 22:50:05 2018
New Revision: 331709
URL: https://svnweb.freebsd.org/changeset/base/331709

Log:
  MFV r331708:
  9321 arc_loan_compressed_buf() can increment arc_loaned_bytes by the wrong value
  
  illumos/illumos-gate@9be12bd737714550277bd02b0c693db560976990
  
  arc_loan_compressed_buf() increments arc_loaned_bytes by psize unconditionally
  In the case of zfs_compressed_arc_enabled=0, when the buf is returned via
  arc_return_buf(), if ARC_BUF_COMPRESSED(buf) is false, then arc_loaned_bytes
  is decremented by lsize, not psize.
  
  Switch to using arc_buf_size(buf), instead of psize, which will return
  psize or lsize, depending on the result of ARC_BUF_COMPRESSED(buf).
  
  Reviewed by: Matt Ahrens 
  Reviewed by: George Wilson 
  Approved by: Garrett D'Amore 
  Author: Allan Jude 

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Wed Mar 28 22:43:55 2018	(r331708)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c	Wed Mar 28 22:50:05 2018	(r331709)
@@ -2877,7 +2877,7 @@ arc_loan_buf(spa_t *spa, boolean_t is_metadata, int si
 	arc_buf_t *buf = arc_alloc_buf(spa, arc_onloan_tag,
 	    is_metadata ? ARC_BUFC_METADATA : ARC_BUFC_DATA, size);
 
-	arc_loaned_bytes_update(size);
+	arc_loaned_bytes_update(arc_buf_size(buf));
 
 	return (buf);
 }
@@ -2889,7 +2889,7 @@ arc_loan_compressed_buf(spa_t *spa, uint64_t psize, ui
 	arc_buf_t *buf = arc_alloc_compressed_buf(spa, arc_onloan_tag,
 	    psize, lsize, compression_type);
 
-	arc_loaned_bytes_update(psize);
+	arc_loaned_bytes_update(arc_buf_size(buf));
 
 	return (buf);
 }

From owner-svn-src-head@freebsd.org  Wed Mar 28 23:05:49 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B13AF523B9;
 Wed, 28 Mar 2018 23:05:49 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id EE18E68184;
 Wed, 28 Mar 2018 23:05:48 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E25151174F;
 Wed, 28 Mar 2018 23:05:48 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SN5mPO061276;
 Wed, 28 Mar 2018 23:05:48 GMT (envelope-from mav@FreeBSD.org)
Received: (from mav@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SN5mKn061275;
 Wed, 28 Mar 2018 23:05:48 GMT (envelope-from mav@FreeBSD.org)
Message-Id: <201803282305.w2SN5mKn061275@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
 using -f
From: Alexander Motin 
Date: Wed, 28 Mar 2018 23:05:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331711 -
 head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: head
X-SVN-Commit-Author: mav
X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Commit-Revision: 331711
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 23:05:49 -0000

Author: mav
Date: Wed Mar 28 23:05:48 2018
New Revision: 331711
URL: https://svnweb.freebsd.org/changeset/base/331711

Log:
  MFV 331710:
  9188 increase size of dbuf cache to reduce indirect block decompression
  
  illumos/illumos-gate@268bbb2a2fa79c36d4695d13a595ba50a7754b76
  
  With compressed ARC (6950) we use up to 25% of our CPU to decompress indirect
  blocks, under a workload of random cached reads. To reduce this decompression
  cost, we would like to increase the size of the dbuf cache so that more
  indirect blocks can be stored uncompressed.
  
  If we are caching entire large files of recordsize=8K, the indirect blocks
  use 1/64th as much memory as the data blocks (assuming they have the same
  compression ratio). We suggest making the dbuf cache be 1/32nd of all memory,
  so that in this scenario we should be able to keep all the indirect blocks
  decompressed in the dbuf cache. (We want it to be more than the 1/64th that
  the indirect blocks would use because we need to cache other stuff in the
  dbuf cache as well.)
  
  In real world workloads, this won't help as dramatically as the example
  above, but we think it's still worth it because the risk of decreasing
  performance is low. The potential negative performance impact is that we
  will be slightly reducing the size of the ARC (by ~3%).
  
  Reviewed by: Dan Kimmel 
  Reviewed by: Prashanth Sreenivasa 
  Reviewed by: Paul Dagnelie 
  Reviewed by: Sanjay Nadkarni 
  Reviewed by: Allan Jude 
  Reviewed by: Igor Kozhukhov 
  Approved by: Garrett D'Amore 
  Author: George Wilson 

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
Directory Properties:
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Wed Mar 28 22:57:02 2018	(r331710)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c	Wed Mar 28 23:05:48 2018	(r331711)
@@ -85,10 +85,10 @@ static boolean_t dbuf_evict_thread_exit;
  */
 static multilist_t *dbuf_cache;
 static refcount_t dbuf_cache_size;
-uint64_t dbuf_cache_max_bytes = 100 * 1024 * 1024;
+uint64_t dbuf_cache_max_bytes = 0;
 
-/* Cap the size of the dbuf cache to log2 fraction of arc size. */
-int dbuf_cache_max_shift = 5;
+/* Set the default size of the dbuf cache to log2 fraction of arc size. */
+int dbuf_cache_shift = 5;
 
 /*
  * The dbuf cache uses a three-stage eviction policy:
@@ -138,8 +138,8 @@ uint_t dbuf_cache_lowater_pct = 10;
 SYSCTL_DECL(_vfs_zfs);
 SYSCTL_QUAD(_vfs_zfs, OID_AUTO, dbuf_cache_max_bytes, CTLFLAG_RWTUN,
     &dbuf_cache_max_bytes, 0, "dbuf cache size in bytes");
-SYSCTL_INT(_vfs_zfs, OID_AUTO, dbuf_cache_max_shift, CTLFLAG_RDTUN,
-    &dbuf_cache_max_shift, 0, "dbuf size as log2 fraction of ARC");
+SYSCTL_INT(_vfs_zfs, OID_AUTO, dbuf_cache_shift, CTLFLAG_RDTUN,
+    &dbuf_cache_shift, 0, "dbuf cache size as log2 fraction of ARC");
 SYSCTL_UINT(_vfs_zfs, OID_AUTO, dbuf_cache_hiwater_pct, CTLFLAG_RWTUN,
     &dbuf_cache_hiwater_pct, 0, "max percents above the dbuf cache size");
 SYSCTL_UINT(_vfs_zfs, OID_AUTO, dbuf_cache_lowater_pct, CTLFLAG_RWTUN,
@@ -610,11 +610,15 @@ retry:
 		mutex_init(&h->hash_mutexes[i], NULL, MUTEX_DEFAULT, NULL);
 
 	/*
-	 * Setup the parameters for the dbuf cache. We cap the size of the
-	 * dbuf cache to 1/32nd (default) of the size of the ARC.
+	 * Setup the parameters for the dbuf cache. We set the size of the
+	 * dbuf cache to 1/32nd (default) of the size of the ARC. If the value
+	 * has been set in /etc/system and it's not greater than the size of
+	 * the ARC, then we honor that value.
 	 */
-	dbuf_cache_max_bytes = MIN(dbuf_cache_max_bytes,
-	    arc_max_bytes() >> dbuf_cache_max_shift);
+	if (dbuf_cache_max_bytes == 0 ||
+	    dbuf_cache_max_bytes >= arc_max_bytes())  {
+		dbuf_cache_max_bytes = arc_max_bytes() >> dbuf_cache_shift;
+	}
 
 	/*
 	 * All entries are queued via taskq_dispatch_ent(), so min/maxalloc

From owner-svn-src-head@freebsd.org  Wed Mar 28 23:17:30 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A032F53250;
 Wed, 28 Mar 2018 23:17:30 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3796368A6B;
 Wed, 28 Mar 2018 23:17:30 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E4B7118DF;
 Wed, 28 Mar 2018 23:17:30 +0000 (UTC) (envelope-from mav@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SNHU8a066323;
 Wed, 28 Mar 2018 23:17:30 GMT (envelope-from mav@FreeBSD.org)
Received: (from mav@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SNHT8k066321;
 Wed, 28 Mar 2018 23:17:29 GMT (envelope-from mav@FreeBSD.org)
Message-Id: <201803282317.w2SNHT8k066321@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org
 using -f
From: Alexander Motin 
Date: Wed, 28 Mar 2018 23:17:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331713 - in head: cddl/contrib/opensolaris/cmd/ztest
 sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Group: head
X-SVN-Commit-Author: mav
X-SVN-Commit-Paths: in head: cddl/contrib/opensolaris/cmd/ztest
 sys/cddl/contrib/opensolaris/uts/common/fs/zfs
X-SVN-Commit-Revision: 331713
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 23:17:30 -0000

Author: mav
Date: Wed Mar 28 23:17:29 2018
New Revision: 331713
URL: https://svnweb.freebsd.org/changeset/base/331713

Log:
  MFV r331712:
  9280 Assertion failure while running removal_with_ganging test with 4K devices
  
  illumos/illumos-gate@243952c7eeef020886e3e2e3df99a513df40584a
  
  Reviewed by: George Wilson 
  Reviewed by: John Kennedy 
  Approved by: Garrett D'Amore 
  Author: Matt Ahrens 

Modified:
  head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
Directory Properties:
  head/cddl/contrib/opensolaris/   (props changed)
  head/sys/cddl/contrib/opensolaris/   (props changed)

Modified: head/cddl/contrib/opensolaris/cmd/ztest/ztest.c
==============================================================================
--- head/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Wed Mar 28 23:12:03 2018	(r331712)
+++ head/cddl/contrib/opensolaris/cmd/ztest/ztest.c	Wed Mar 28 23:17:29 2018	(r331713)
@@ -164,7 +164,7 @@ typedef struct ztest_shared_opts {
 	int zo_init;
 	uint64_t zo_time;
 	uint64_t zo_maxloops;
-	uint64_t zo_metaslab_gang_bang;
+	uint64_t zo_metaslab_force_ganging;
 } ztest_shared_opts_t;
 
 static const ztest_shared_opts_t ztest_opts_defaults = {
@@ -186,10 +186,10 @@ static const ztest_shared_opts_t ztest_opts_defaults =
 	.zo_init = 1,
 	.zo_time = 300,			/* 5 minutes */
 	.zo_maxloops = 50,		/* max loops during spa_freeze() */
-	.zo_metaslab_gang_bang = 32 << 10
+	.zo_metaslab_force_ganging = 32 << 10
 };
 
-extern uint64_t metaslab_gang_bang;
+extern uint64_t metaslab_force_ganging;
 extern uint64_t metaslab_df_alloc_threshold;
 extern uint64_t zfs_deadman_synctime_ms;
 extern int metaslab_preload_limit;
@@ -567,12 +567,12 @@ usage(boolean_t requested)
 	const ztest_shared_opts_t *zo = &ztest_opts_defaults;
 
 	char nice_vdev_size[NN_NUMBUF_SZ];
-	char nice_gang_bang[NN_NUMBUF_SZ];
+	char nice_force_ganging[NN_NUMBUF_SZ];
 	FILE *fp = requested ? stdout : stderr;
 
 	nicenum(zo->zo_vdev_size, nice_vdev_size, sizeof (nice_vdev_size));
-	nicenum(zo->zo_metaslab_gang_bang, nice_gang_bang,
-	    sizeof (nice_gang_bang));
+	nicenum(zo->zo_metaslab_force_ganging, nice_force_ganging,
+	    sizeof (nice_force_ganging));
 
 	(void) fprintf(fp, "Usage: %s\n"
 	    "\t[-v vdevs (default: %llu)]\n"
@@ -607,7 +607,7 @@ usage(boolean_t requested)
 	    zo->zo_raidz_parity,			/* -R */
 	    zo->zo_datasets,				/* -d */
 	    zo->zo_threads,				/* -t */
-	    nice_gang_bang,				/* -g */
+	    nice_force_ganging,				/* -g */
 	    zo->zo_init,				/* -i */
 	    (u_longlong_t)zo->zo_killrate,		/* -k */
 	    zo->zo_pool,				/* -p */
@@ -676,8 +676,8 @@ process_options(int argc, char **argv)
 			zo->zo_threads = MAX(1, value);
 			break;
 		case 'g':
-			zo->zo_metaslab_gang_bang = MAX(SPA_MINBLOCKSIZE << 1,
-			    value);
+			zo->zo_metaslab_force_ganging =
+			    MAX(SPA_MINBLOCKSIZE << 1, value);
 			break;
 		case 'i':
 			zo->zo_init = value;
@@ -6425,7 +6425,7 @@ main(int argc, char **argv)
 	zs = ztest_shared;
 
 	if (fd_data_str) {
-		metaslab_gang_bang = ztest_opts.zo_metaslab_gang_bang;
+		metaslab_force_ganging = ztest_opts.zo_metaslab_force_ganging;
 		metaslab_df_alloc_threshold =
 		    zs->zs_metaslab_df_alloc_threshold;
 

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Wed Mar 28 23:12:03 2018	(r331712)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c	Wed Mar 28 23:17:29 2018	(r331713)
@@ -44,9 +44,9 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 
 	((flags) & (METASLAB_GANG_CHILD | METASLAB_GANG_HEADER))
 
 uint64_t metaslab_aliquot = 512ULL << 10;
-uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1;	/* force gang blocks */
-SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, gang_bang, CTLFLAG_RWTUN,
-    &metaslab_gang_bang, 0,
+uint64_t metaslab_force_ganging = SPA_MAXBLOCKSIZE + 1;	/* force gang blocks */
+SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, force_ganging, CTLFLAG_RWTUN,
+    &metaslab_force_ganging, 0,
     "Force gang block allocation for blocks larger than or equal to this value");
 
 /*
@@ -3172,7 +3172,7 @@ metaslab_alloc_dva(spa_t *spa, metaslab_class_t *mc, u
 	/*
 	 * For testing, make some blocks above a certain size be gang blocks.
 	 */
-	if (psize >= metaslab_gang_bang && (ddi_get_lbolt() & 3) == 0) {
+	if (psize >= metaslab_force_ganging && (ddi_get_lbolt() & 3) == 0) {
 		metaslab_trace_add(zal, NULL, NULL, psize, d, TRACE_FORCE_GANG);
 		return (SET_ERROR(ENOSPC));
 	}

From owner-svn-src-head@freebsd.org  Wed Mar 28 23:33:28 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EF03F5469E;
 Wed, 28 Mar 2018 23:33:28 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E758E69612;
 Wed, 28 Mar 2018 23:33:27 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DDE6011C16;
 Wed, 28 Mar 2018 23:33:27 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2SNXRxp076404;
 Wed, 28 Mar 2018 23:33:27 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2SNXQH8076392;
 Wed, 28 Mar 2018 23:33:26 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803282333.w2SNXQH8076392@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Wed, 28 Mar 2018 23:33:26 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331714 - in head: . sys/conf sys/net sys/netinet
 sys/netinet6 sys/nfs usr.sbin/arp
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: in head: . sys/conf sys/net sys/netinet sys/netinet6
 sys/nfs usr.sbin/arp
X-SVN-Commit-Revision: 331714
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Wed, 28 Mar 2018 23:33:28 -0000

Author: brooks
Date: Wed Mar 28 23:33:26 2018
New Revision: 331714
URL: https://svnweb.freebsd.org/changeset/base/331714

Log:
  Remove infrastructure for token-ring networks.
  
  Reviewed by:	cem, imp, jhb, jmallett
  Relnotes:	yes
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14875

Deleted:
  head/sys/net/if_iso88025subr.c
  head/sys/net/iso88025.h
Modified:
  head/UPDATING
  head/sys/conf/NOTES
  head/sys/conf/files
  head/sys/net/if.c
  head/sys/netinet/ip_carp.c
  head/sys/netinet6/in6.c
  head/sys/netinet6/in6_ifattach.c
  head/sys/netinet6/nd6.c
  head/sys/netinet6/nd6_nbr.c
  head/sys/nfs/bootp_subr.c
  head/usr.sbin/arp/arp.c

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Wed Mar 28 23:17:29 2018	(r331713)
+++ head/UPDATING	Wed Mar 28 23:33:26 2018	(r331714)
@@ -51,6 +51,11 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
 
 ****************************** SPECIAL WARNING: ******************************
 
+20180528:
+	Support for token ring networks has been removed. If you
+	have "device token" in your kernel config you should remove
+	it. No device drivers supported token ring.
+
 20180323:
 	makefs was modified to be able to tag ISO9660 El Torito boot catalog
 	entries as EFI instead of overloading the i386 tag as done previously.

Modified: head/sys/conf/NOTES
==============================================================================
--- head/sys/conf/NOTES	Wed Mar 28 23:17:29 2018	(r331713)
+++ head/sys/conf/NOTES	Wed Mar 28 23:33:26 2018	(r331714)
@@ -807,7 +807,7 @@ device		loop
 
 #  The `ether' device provides generic code to handle
 #  Ethernets; it is MANDATORY when an Ethernet device driver is
-#  configured or token-ring is enabled.
+#  configured.
 device		ether
 
 #  The `vlan' device implements the VLAN tagging of Ethernet frames
@@ -845,9 +845,6 @@ device		wlan_xauth
 #  The 'wlan_amrr' device provides AMRR transmit rate control algorithm
 device		wlan_acl
 device		wlan_amrr
-
-# Generic TokenRing
-device		token
 
 #  The `fddi' device provides generic code to support FDDI.
 device		fddi

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Wed Mar 28 23:17:29 2018	(r331713)
+++ head/sys/conf/files	Wed Mar 28 23:33:26 2018	(r331714)
@@ -4114,7 +4114,6 @@ net/if_gif.c			optional gif inet | gif inet6 | \
 					 netgraph_gif inet | netgraph_gif inet6
 net/if_gre.c			optional gre inet | gre inet6
 net/if_ipsec.c			optional inet ipsec | inet6 ipsec
-net/if_iso88025subr.c		optional token
 net/if_lagg.c			optional lagg
 net/if_loop.c			optional loop
 net/if_llatbl.c			standard

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Wed Mar 28 23:17:29 2018	(r331713)
+++ head/sys/net/if.c	Wed Mar 28 23:33:26 2018	(r331714)
@@ -3626,7 +3626,6 @@ if_setlladdr(struct ifnet *ifp, const u_char *lladdr, 
 	case IFT_ETHER:
 	case IFT_FDDI:
 	case IFT_XETHER:
-	case IFT_ISO88025:
 	case IFT_L2VLAN:
 	case IFT_BRIDGE:
 	case IFT_ARCNET:

Modified: head/sys/netinet/ip_carp.c
==============================================================================
--- head/sys/netinet/ip_carp.c	Wed Mar 28 23:17:29 2018	(r331713)
+++ head/sys/netinet/ip_carp.c	Wed Mar 28 23:33:26 2018	(r331714)
@@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
@@ -1539,17 +1538,6 @@ carp_output(struct ifnet *ifp, struct mbuf *m, const s
 			fh->fddi_shost[5] = sc->sc_vhid;
 		}
 		break;
-	case IFT_ISO88025: {
- 			struct iso88025_header *th;
- 			th = mtod(m, struct iso88025_header *);
-			th->iso88025_shost[0] = 3;
-			th->iso88025_shost[1] = 0;
-			th->iso88025_shost[2] = 0x40 >> (sc->sc_vhid - 1);
-			th->iso88025_shost[3] = 0x40000 >> (sc->sc_vhid - 1);
-			th->iso88025_shost[4] = 0;
-			th->iso88025_shost[5] = 0;
-		}
-		break;
 	default:
 		printf("%s: carp is not supported for the %d interface type\n",
 		    ifp->if_xname, ifp->if_type);
@@ -1732,7 +1720,6 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa
 	case IFT_L2VLAN:
 	case IFT_BRIDGE:
 	case IFT_FDDI:
-	case IFT_ISO88025:
 		break;
 	default:
 		error = EOPNOTSUPP;

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c	Wed Mar 28 23:17:29 2018	(r331713)
+++ head/sys/netinet6/in6.c	Wed Mar 28 23:33:26 2018	(r331714)
@@ -1971,8 +1971,6 @@ in6_if2idlen(struct ifnet *ifp)
 		return (64);
 	case IFT_FDDI:		/* RFC2467 */
 		return (64);
-	case IFT_ISO88025:	/* RFC2470 (IPv6 over Token Ring) */
-		return (64);
 	case IFT_PPP:		/* RFC2472 */
 		return (64);
 	case IFT_ARCNET:	/* RFC2497 */

Modified: head/sys/netinet6/in6_ifattach.c
==============================================================================
--- head/sys/netinet6/in6_ifattach.c	Wed Mar 28 23:17:29 2018	(r331713)
+++ head/sys/netinet6/in6_ifattach.c	Wed Mar 28 23:33:26 2018	(r331714)
@@ -275,7 +275,6 @@ found:
 	case IFT_ETHER:
 	case IFT_L2VLAN:
 	case IFT_FDDI:
-	case IFT_ISO88025:
 	case IFT_ATM:
 	case IFT_IEEE1394:
 		/* IEEE802/EUI64 cases - what others? */

Modified: head/sys/netinet6/nd6.c
==============================================================================
--- head/sys/netinet6/nd6.c	Wed Mar 28 23:17:29 2018	(r331713)
+++ head/sys/netinet6/nd6.c	Wed Mar 28 23:33:26 2018	(r331714)
@@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -344,9 +343,6 @@ nd6_setmtu0(struct ifnet *ifp, struct nd_ifinfo *ndi)
 	case IFT_FDDI:
 		ndi->maxmtu = MIN(FDDIIPMTU, ifp->if_mtu); /* RFC2467 */
 		break;
-	case IFT_ISO88025:
-		 ndi->maxmtu = MIN(ISO88025_MAX_MTU, ifp->if_mtu);
-		 break;
 	default:
 		ndi->maxmtu = ifp->if_mtu;
 		break;
@@ -2279,7 +2275,6 @@ nd6_resolve(struct ifnet *ifp, int is_gw, struct mbuf 
 		case IFT_FDDI:
 		case IFT_L2VLAN:
 		case IFT_BRIDGE:
-		case IFT_ISO88025:
 			ETHER_MAP_IPV6_MULTICAST(&dst6->sin6_addr,
 						 desten);
 			return (0);

Modified: head/sys/netinet6/nd6_nbr.c
==============================================================================
--- head/sys/netinet6/nd6_nbr.c	Wed Mar 28 23:17:29 2018	(r331713)
+++ head/sys/netinet6/nd6_nbr.c	Wed Mar 28 23:33:26 2018	(r331714)
@@ -1097,7 +1097,6 @@ nd6_ifptomac(struct ifnet *ifp)
 	case IFT_L2VLAN:
 	case IFT_INFINIBAND:
 	case IFT_BRIDGE:
-	case IFT_ISO88025:
 		return IF_LLADDR(ifp);
 	default:
 		return NULL;

Modified: head/sys/nfs/bootp_subr.c
==============================================================================
--- head/sys/nfs/bootp_subr.c	Wed Mar 28 23:17:29 2018	(r331713)
+++ head/sys/nfs/bootp_subr.c	Wed Mar 28 23:33:26 2018	(r331714)
@@ -1646,7 +1646,6 @@ bootpc_init(void)
 		switch (ifp->if_alloctype) {
 			case IFT_ETHER:
 			case IFT_FDDI:
-			case IFT_ISO88025:
 				break;
 			default:
 				continue;
@@ -1677,7 +1676,6 @@ retry:
 		switch (ifp->if_alloctype) {
 			case IFT_ETHER:
 			case IFT_FDDI:
-			case IFT_ISO88025:
 				break;
 			default:
 				continue;

Modified: head/usr.sbin/arp/arp.c
==============================================================================
--- head/usr.sbin/arp/arp.c	Wed Mar 28 23:17:29 2018	(r331713)
+++ head/usr.sbin/arp/arp.c	Wed Mar 28 23:33:26 2018	(r331714)
@@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -303,7 +302,6 @@ valid_type(int type)
 	case IFT_INFINIBAND:
 	case IFT_ISO88023:
 	case IFT_ISO88024:
-	case IFT_ISO88025:
 	case IFT_L2VLAN:
 	case IFT_BRIDGE:
 		return (1);
@@ -592,9 +590,7 @@ print_entry(struct sockaddr_dl *sdl,
 {
 	const char *host;
 	struct hostent *hp;
-	struct iso88025_sockaddr_dl_data *trld;
 	struct if_nameindex *p;
-	int seg;
 
 	if (ifnameindex == NULL)
 		if ((ifnameindex = if_nameindex()) == NULL)
@@ -659,17 +655,6 @@ print_entry(struct sockaddr_dl *sdl,
 	case IFT_ETHER:
 		xo_emit(" [{:type/ethernet}]");
 		break;
-	case IFT_ISO88025:
-		xo_emit(" [{:type/token-ring}]");
-		trld = SDL_ISO88025(sdl);
-		if (trld->trld_rcf != 0) {
-			xo_emit(" rt=%x", ntohs(trld->trld_rcf));
-			for (seg = 0;
-			     seg < ((TR_RCF_RIFLEN(trld->trld_rcf) - 2 ) / 2);
-			     seg++)
-				xo_emit(":%x", ntohs(*(trld->trld_route[seg])));
-		}
-                break;
 	case IFT_FDDI:
 		xo_emit(" [{:type/fddi}]");
 		break;

From owner-svn-src-head@freebsd.org  Thu Mar 29 00:04:08 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8ABDDF57187;
 Thu, 29 Mar 2018 00:04:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3C7F66ABAD;
 Thu, 29 Mar 2018 00:04:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3763612123;
 Thu, 29 Mar 2018 00:04:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2T048mg091684;
 Thu, 29 Mar 2018 00:04:08 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2T047UZ091682;
 Thu, 29 Mar 2018 00:04:07 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201803290004.w2T047UZ091682@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin 
Date: Thu, 29 Mar 2018 00:04:07 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331715 - head/usr.bin/truss
X-SVN-Group: head
X-SVN-Commit-Author: jhb
X-SVN-Commit-Paths: head/usr.bin/truss
X-SVN-Commit-Revision: 331715
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 00:04:08 -0000

Author: jhb
Date: Thu Mar 29 00:04:07 2018
New Revision: 331715
URL: https://svnweb.freebsd.org/changeset/base/331715

Log:
  Rename ClouduABIFDSFlags to CloudABIFDSFlags.

Modified:
  head/usr.bin/truss/syscall.h
  head/usr.bin/truss/syscalls.c

Modified: head/usr.bin/truss/syscall.h
==============================================================================
--- head/usr.bin/truss/syscall.h	Wed Mar 28 23:33:26 2018	(r331714)
+++ head/usr.bin/truss/syscall.h	Thu Mar 29 00:04:07 2018	(r331715)
@@ -84,7 +84,7 @@ enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHe
 	Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, Schedpolicy, Schedparam,
 	PSig, Siginfo, Kevent11, Iovec, Sctpsndrcvinfo, Msghdr,
 
-	CloudABIAdvice, CloudABIClockID, ClouduABIFDSFlags,
+	CloudABIAdvice, CloudABIClockID, CloudABIFDSFlags,
 	CloudABIFDStat, CloudABIFileStat, CloudABIFileType,
 	CloudABIFSFlags, CloudABILookup, CloudABIMFlags, CloudABIMProt,
 	CloudABIMSFlags, CloudABIOFlags, CloudABISDFlags,

Modified: head/usr.bin/truss/syscalls.c
==============================================================================
--- head/usr.bin/truss/syscalls.c	Wed Mar 28 23:33:26 2018	(r331714)
+++ head/usr.bin/truss/syscalls.c	Thu Mar 29 00:04:07 2018	(r331715)
@@ -580,7 +580,7 @@ static struct syscall decoded_syscalls[] = {
 	  .args = { { Int, 0 }, { CloudABIFDStat | OUT, 1 } } },
 	{ .name = "cloudabi_sys_fd_stat_put", .ret_type = 1, .nargs = 3,
 	  .args = { { Int, 0 }, { CloudABIFDStat | IN, 1 },
-	            { ClouduABIFDSFlags, 2 } } },
+	            { CloudABIFDSFlags, 2 } } },
 	{ .name = "cloudabi_sys_fd_sync", .ret_type = 1, .nargs = 1,
 	  .args = { { Int, 0 } } },
 	{ .name = "cloudabi_sys_file_advise", .ret_type = 1, .nargs = 4,
@@ -2519,7 +2519,7 @@ print_arg(struct syscall_args *sc, unsigned long *args
 	case CloudABIClockID:
 		fputs(xlookup(cloudabi_clockid, args[sc->offset]), fp);
 		break;
-	case ClouduABIFDSFlags:
+	case CloudABIFDSFlags:
 		fputs(xlookup_bits(cloudabi_fdsflags, args[sc->offset]), fp);
 		break;
 	case CloudABIFDStat: {

From owner-svn-src-head@freebsd.org  Thu Mar 29 00:12:51 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83466F57D27;
 Thu, 29 Mar 2018 00:12:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3564B6B196;
 Thu, 29 Mar 2018 00:12:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30262122BC;
 Thu, 29 Mar 2018 00:12:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2T0CpsK096433;
 Thu, 29 Mar 2018 00:12:51 GMT (envelope-from jhb@FreeBSD.org)
Received: (from jhb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2T0CpA4096432;
 Thu, 29 Mar 2018 00:12:51 GMT (envelope-from jhb@FreeBSD.org)
Message-Id: <201803290012.w2T0CpA4096432@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org
 using -f
From: John Baldwin 
Date: Thu, 29 Mar 2018 00:12:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331716 - head/usr.bin/truss
X-SVN-Group: head
X-SVN-Commit-Author: jhb
X-SVN-Commit-Paths: head/usr.bin/truss
X-SVN-Commit-Revision: 331716
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 00:12:51 -0000

Author: jhb
Date: Thu Mar 29 00:12:50 2018
New Revision: 331716
URL: https://svnweb.freebsd.org/changeset/base/331716

Log:
  Reformat the enum of syscall argument types.
  
  List enum values on separate lines to minimize diffs as new types are
  added.  Split the enum values up into groups and use some simple sorting
  within groups (scalar enums are sorted by size, then base, all other
  groups are generally sorted alphabetically).
  
  No functional change.

Modified:
  head/usr.bin/truss/syscall.h

Modified: head/usr.bin/truss/syscall.h
==============================================================================
--- head/usr.bin/truss/syscall.h	Thu Mar 29 00:04:07 2018	(r331715)
+++ head/usr.bin/truss/syscall.h	Thu Mar 29 00:12:50 2018	(r331716)
@@ -69,31 +69,143 @@
  * IN (meaning that the data is passed *into* the system call).
  */
 
-enum Argtype { None = 1, Hex, Octal, Int, UInt, LongHex, Name, Ptr, Stat, Stat11, Ioctl,
-	Quad, Signal, Sockaddr, StringArray, Timespec, Timeval, Itimerval,
-	Pollfd, Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres,
-	Sigset, Sigprocmask, StatFs, Kevent, Sockdomain, Socktype, Open,
-	Fcntlflag, Rusage, RusageWho, BinString, Shutdown, Resource, Rlimit,
-	Timeval2, Pathconf, Rforkflags, ExitStatus, Waitoptions, Idtype, Procctl,
-	LinuxSockArgs, Umtxop, Atfd, Atflags, Timespec2, Accessmode, Long,
-	Sysarch, ExecArgs, ExecEnv, PipeFds, QuadHex, Utrace, IntArray, Pipe2,
-	CapFcntlRights, Fadvice, FileFlags, Flockop, Getfsstatmode, Kldsymcmd,
-	Kldunloadflags, Sizet, Madvice, Socklent, Sockprotocol, Sockoptlevel,
-	Sockoptname, Msgflags, CapRights, PUInt, PQuadHex, Acltype,
-	Extattrnamespace, Minherit, Mlockall, Mountflags, Msync, Priowhich,
-	Ptraceop, Quotactlcmd, Reboothowto, Rtpriofunc, Schedpolicy, Schedparam,
-	PSig, Siginfo, Kevent11, Iovec, Sctpsndrcvinfo, Msghdr,
+enum Argtype {
+	None = 1,
 
-	CloudABIAdvice, CloudABIClockID, CloudABIFDSFlags,
-	CloudABIFDStat, CloudABIFileStat, CloudABIFileType,
-	CloudABIFSFlags, CloudABILookup, CloudABIMFlags, CloudABIMProt,
-	CloudABIMSFlags, CloudABIOFlags, CloudABISDFlags,
-	CloudABISignal, CloudABISockStat, CloudABISSFlags,
-	CloudABITimestamp, CloudABIULFlags, CloudABIWhence };
+	/* Scalar integers. */
+	Socklent,
+	Octal,
+	Int,
+	UInt,
+	Hex,
+	Long,
+	LongHex,
+	Sizet,
+	Quad,
+	QuadHex,
 
+	/* Encoded scalar values. */
+	Accessmode,
+	Acltype,
+	Atfd,
+	Atflags,
+	CapFcntlRights,
+	Extattrnamespace,
+	Fadvice,
+	Fcntl,
+	Fcntlflag,
+	FileFlags,
+	Flockop,
+	Getfsstatmode,
+	Idtype,
+	Ioctl,
+	Kldsymcmd,
+	Kldunloadflags,
+	Madvice,
+	Minherit,
+	Msgflags,
+	Mlockall,
+	Mmapflags,
+	Mountflags,
+	Mprot,
+	Msync,
+	Open,
+	Pathconf,
+	Pipe2,
+	Procctl,
+	Priowhich,
+	Ptraceop,
+	Quotactlcmd,
+	Reboothowto,
+	Resource,
+	Rforkflags,
+	Rtpriofunc,
+	RusageWho,
+	Schedpolicy,
+	Shutdown,
+	Signal,
+	Sigprocmask,
+	Sockdomain,
+	Sockoptlevel,
+	Sockoptname,
+	Sockprotocol,
+	Socktype,
+	Sysarch,
+	Umtxop,
+	Waitoptions,
+	Whence,
+
+	/* Pointers to non-structures. */
+	Ptr,
+	BinString,
+	CapRights,
+	ExecArgs,
+	ExecEnv,
+	ExitStatus,
+	Fd_set,
+	IntArray,
+	Iovec,
+	Name,
+	PipeFds,
+	PSig,
+	PQuadHex,
+	PUInt,
+	Readlinkres,
+	StringArray,
+
+	/* Pointers to structures. */
+	Itimerval,
+	Kevent,
+	Kevent11,
+	LinuxSockArgs,
+	Msghdr,
+	Pollfd,
+	Rlimit,
+	Rusage,
+	Schedparam,
+	Sctpsndrcvinfo,
+	Sigaction,
+	Siginfo,
+	Sigset,
+	Sockaddr,
+	Stat,
+	Stat11,
+	StatFs,
+	Timespec,
+	Timespec2,
+	Timeval,
+	Timeval2,
+	Utrace,
+
+	CloudABIAdvice,
+	CloudABIClockID,
+	CloudABIFDSFlags,
+	CloudABIFDStat,
+	CloudABIFileStat,
+	CloudABIFileType,
+	CloudABIFSFlags,
+	CloudABILookup,
+	CloudABIMFlags,
+	CloudABIMProt,
+	CloudABIMSFlags,
+	CloudABIOFlags,
+	CloudABISDFlags,
+	CloudABISignal,
+	CloudABISockStat,
+	CloudABISSFlags,
+	CloudABITimestamp,
+	CloudABIULFlags,
+	CloudABIWhence,
+
+	MAX_ARG_TYPE,
+};
+
 #define	ARG_MASK	0xff
 #define	OUT	0x100
 #define	IN	/*0x20*/0
+
+_Static_assert(ARG_MASK > MAX_ARG_TYPE,
+    "ARG_MASK overlaps with Argtype values");
 
 struct syscall_args {
 	enum Argtype type;

From owner-svn-src-head@freebsd.org  Thu Mar 29 00:55:12 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A9AEF5C37F;
 Thu, 29 Mar 2018 00:55:12 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3DF036CFE2;
 Thu, 29 Mar 2018 00:55:12 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3842B1291A;
 Thu, 29 Mar 2018 00:55:12 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2T0tBFV017468;
 Thu, 29 Mar 2018 00:55:11 GMT (envelope-from kevans@FreeBSD.org)
Received: (from kevans@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2T0tBhU017467;
 Thu, 29 Mar 2018 00:55:11 GMT (envelope-from kevans@FreeBSD.org)
Message-Id: <201803290055.w2T0tBhU017467@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kevans set sender to
 kevans@FreeBSD.org using -f
From: Kyle Evans 
Date: Thu, 29 Mar 2018 00:55:11 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331718 - head/stand/i386/libi386
X-SVN-Group: head
X-SVN-Commit-Author: kevans
X-SVN-Commit-Paths: head/stand/i386/libi386
X-SVN-Commit-Revision: 331718
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 00:55:12 -0000

Author: kevans
Date: Thu Mar 29 00:55:11 2018
New Revision: 331718
URL: https://svnweb.freebsd.org/changeset/base/331718

Log:
  stand: Add workaround for HP BIOS issues
  
  hrs@ and kuriyama@ have found that on some HP BIOS, a system will fail to
  boot immediately after installation with the claim that it can't work out
  which disk they are booting from.
  
  They tracked it down to a buffer overrun, and found that it could be
  alleviated by doing a dummy read before-hand.
  
  Submitted by:	kuriyama
  MFC after:	1 week
  Differential Revision:	https://reviews.freebsd.org/D14341

Modified:
  head/stand/i386/libi386/biosdisk.c

Modified: head/stand/i386/libi386/biosdisk.c
==============================================================================
--- head/stand/i386/libi386/biosdisk.c	Thu Mar 29 00:42:44 2018	(r331717)
+++ head/stand/i386/libi386/biosdisk.c	Thu Mar 29 00:55:11 2018	(r331718)
@@ -122,6 +122,8 @@ static int nbdinfo = 0;
 
 #define	BD(dev)		(bdinfo[(dev)->dd.d_unit])
 
+static void bd_io_workaround(struct disk_devdesc *dev);
+
 static int bd_read(struct disk_devdesc *dev, daddr_t dblk, int blks,
     caddr_t dest);
 static int bd_write(struct disk_devdesc *dev, daddr_t dblk, int blks,
@@ -724,6 +726,15 @@ bd_chs_io(struct disk_devdesc *dev, daddr_t dblk, int 
     return (0);
 }
 
+static void
+bd_io_workaround(struct disk_devdesc *dev)
+{
+	uint8_t buf[8 * 1024];
+
+	bd_edd_io(dev, 0xffffffff, 1, (caddr_t)buf, 0);
+}
+
+
 static int
 bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, int write)
 {
@@ -736,6 +747,17 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks
 
     resid = blks;
     p = dest;
+
+    /*
+     * Workaround for a problem with some HP ProLiant BIOS failing to work out
+     * the boot disk after installation. hrs and kuriyama discovered this
+     * problem with an HP ProLiant DL320e Gen 8 with a 3TB HDD, and discovered
+     * that an int13h call seems to cause a buffer overrun in the bios. The
+     * problem is alleviated by doing an extra read before the buggy read. It
+     * is not immediately known whether other models are similarly affected.
+     */
+    if (dblk >= 0x100000000)
+	bd_io_workaround(dev);
 
     /* Decide whether we have to bounce */
     if (VTOP(dest) >> 20 != 0 || (BD(dev).bd_unit < 0x80 &&

From owner-svn-src-head@freebsd.org  Thu Mar 29 02:13:59 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15EAAF65BF9;
 Thu, 29 Mar 2018 02:13:59 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id BFB43713A5;
 Thu, 29 Mar 2018 02:13:58 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAA8113786;
 Thu, 29 Mar 2018 02:13:58 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2T2DwGS057806;
 Thu, 29 Mar 2018 02:13:58 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2T2DwPl057805;
 Thu, 29 Mar 2018 02:13:58 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201803290213.w2T2DwPl057805@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: Conrad Meyer 
Date: Thu, 29 Mar 2018 02:13:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331720 - head/usr.bin/timeout
X-SVN-Group: head
X-SVN-Commit-Author: cem
X-SVN-Commit-Paths: head/usr.bin/timeout
X-SVN-Commit-Revision: 331720
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 02:13:59 -0000

Author: cem
Date: Thu Mar 29 02:13:58 2018
New Revision: 331720
URL: https://svnweb.freebsd.org/changeset/base/331720

Log:
  timeout.1: Try to improve clarity
  
  Minor rewordings, markup fixes or enhancements, and some typo fixes.  Add a few
  sentences clarifying the special zero duration.
  
  PR:		227012
  Submitted by:	Mateusz Piotrowski (0mp@) (earlier version)

Modified:
  head/usr.bin/timeout/timeout.1

Modified: head/usr.bin/timeout/timeout.1
==============================================================================
--- head/usr.bin/timeout/timeout.1	Thu Mar 29 01:20:58 2018	(r331719)
+++ head/usr.bin/timeout/timeout.1	Thu Mar 29 02:13:58 2018	(r331720)
@@ -1,3 +1,5 @@
+.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+.\"
 .\" Copyright (c) 2014 Baptiste Daroussin 
 .\" All rights reserved.
 .\"
@@ -24,7 +26,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 20, 2017
+.Dd March 28, 2018
 .Dt TIMEOUT 1
 .Os
 .Sh NAME
@@ -36,40 +38,47 @@
 .Op Fl -preserve-status
 .Op Fl -kill-after Ar time | Fl k Ar time
 .Op Fl -foreground
-.Ao Ar duration Ac
-.Ao Ar command Ac
-.Ao Ar args ... Ac
+.Ar duration
+.Ar command
+.Op Ar args ...
 .Sh DESCRIPTION
 .Nm
 starts the
 .Ar command
 with its
-.Ar args.
-If
+.Ar args .
+If the
 .Ar command
 is still running after
 .Ar duration ,
 it is killed.
 By default,
-.Ar SIGTERM.
+.Dv SIGTERM
 is sent.
-.Bl -tag -width "-k time, --kill-after time"
+The special
+.Ar duration ,
+zero, signifies no limit.
+Therefore a signal is never sent if
+.Ar duration
+is 0.
+.Pp
+The options are as follows:
+.Bl -tag -width indent
 .It Fl -preserve-status
-Always exits with the same status as
-.Ar command
-even if it times out.
+Exit with the same status as
+.Ar command ,
+even if it times out and is killed.
 .It Fl -foreground
-Do not propagate timeout to the
-.Ar command
-children.
+Do not propagate timeout to the children of
+.Ar command .
 .It Fl s Ar sig , Fl -signal Ar sig
 Specify the signal to send on timeout.
 By default,
-.Ar SIGTERM .
+.Dv SIGTERM
 is sent.
 .It Fl k Ar time , Fl -kill-after Ar time
 Send a
-.Ar SIGKILL
+.Dv SIGKILL
 signal if
 .Ar command
 is still running after
@@ -80,18 +89,19 @@ after the first signal was sent.
 .Ar duration
 and
 .Ar time
-can be integer or decimal numbers.
-Values without unit symbols are interpreted as seconds.
+are non-negative integer or real (decimal) numbers, with an optional
+unit-specifying suffix.
+Values without an explicit unit are interpreted as seconds.
 .Pp
 Supported unit symbols are:
 .Bl -tag -width indent -compact
-.It s
+.It Cm s
 seconds
-.It m
+.It Cm m
 minutes
-.It h
+.It Cm h
 hours
-.It d
+.It Cm d
 days
 .El
 .Sh EXIT STATUS
@@ -115,17 +125,17 @@ plus 128.
 .Pp
 If
 .Ar command
-is an invalid command, the exit status returned is 126.
+refers to a non-existing program, the exit status returned is 127.
 .Pp
 If
 .Ar command
-is a non existing command, the exit status returned is 127.
+is an otherwise invalid program, the exit status returned is 126.
 .Pp
 If an invalid parameter is passed to
 .Fl s
 or
 .Fl k ,
-the exit status return is 125.
+the exit status returned is 125.
 .Sh SEE ALSO
 .Xr kill 1 ,
 .Xr signal 3

From owner-svn-src-head@freebsd.org  Thu Mar 29 02:54:53 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B980AF6A9C6;
 Thu, 29 Mar 2018 02:54:52 +0000 (UTC)
 (envelope-from jeff@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 6772873DE8;
 Thu, 29 Mar 2018 02:54:52 +0000 (UTC)
 (envelope-from jeff@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 48F8813EA7;
 Thu, 29 Mar 2018 02:54:52 +0000 (UTC)
 (envelope-from jeff@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2T2sqsR077734;
 Thu, 29 Mar 2018 02:54:52 GMT (envelope-from jeff@FreeBSD.org)
Received: (from jeff@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2T2spJB077720;
 Thu, 29 Mar 2018 02:54:51 GMT (envelope-from jeff@FreeBSD.org)
Message-Id: <201803290254.w2T2spJB077720@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jeff set sender to
 jeff@FreeBSD.org using -f
From: Jeff Roberson 
Date: Thu, 29 Mar 2018 02:54:51 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331723 - in head: share/man/man9 sys/kern sys/sys sys/vm
 usr.bin/cpuset
X-SVN-Group: head
X-SVN-Commit-Author: jeff
X-SVN-Commit-Paths: in head: share/man/man9 sys/kern sys/sys sys/vm
 usr.bin/cpuset
X-SVN-Commit-Revision: 331723
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 02:54:53 -0000

Author: jeff
Date: Thu Mar 29 02:54:50 2018
New Revision: 331723
URL: https://svnweb.freebsd.org/changeset/base/331723

Log:
  Implement several enhancements to NUMA policies.
  
  Add a new "interleave" allocation policy which stripes pages across
  domains with a stride or width keeping contiguity within a multi-page
  region.
  
  Move the kernel to the dedicated numbered cpuset #2 making it possible
  to assign kernel threads and memory policy separately from user.  This
  also eliminates the need for the complicated interrupt binding code.
  
  Add a sysctl API for viewing and manipulating domainsets.  Refactor some
  of the cpuset_t manipulation code using the generic bitset type so that
  it can be used for both.  This probably belongs in a dedicated subr file.
  
  Attempt to improve the include situation.
  
  Reviewed by:	kib
  Discussed with:	jhb (cpuset parts)
  Tested by:	pho (before review feedback)
  Sponsored by:	Netflix, Dell/EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D14839

Added:
  head/share/man/man9/domainset.9   (contents, props changed)
Modified:
  head/share/man/man9/Makefile
  head/sys/kern/kern_cpuset.c
  head/sys/kern/kern_kthread.c
  head/sys/sys/_bitset.h
  head/sys/sys/cpuset.h
  head/sys/sys/domainset.h
  head/sys/sys/proc.h
  head/sys/vm/vm_domainset.c
  head/sys/vm/vm_domainset.h
  head/sys/vm/vm_page.c
  head/sys/vm/vnode_pager.c
  head/usr.bin/cpuset/cpuset.1
  head/usr.bin/cpuset/cpuset.c

Modified: head/share/man/man9/Makefile
==============================================================================
--- head/share/man/man9/Makefile	Thu Mar 29 02:50:57 2018	(r331722)
+++ head/share/man/man9/Makefile	Thu Mar 29 02:54:50 2018	(r331723)
@@ -118,6 +118,7 @@ MAN=	accept_filter.9 \
 	disk.9 \
 	dnv.9 \
 	domain.9 \
+	domainset.9 \
 	dpcpu.9 \
 	drbr.9 \
 	driver.9 \

Added: head/share/man/man9/domainset.9
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man9/domainset.9	Thu Mar 29 02:54:50 2018	(r331723)
@@ -0,0 +1,128 @@
+.\" Copyright (c) 2018 Jeffrey Roberson 
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in the
+.\"    documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
+.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE
+.\" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd March 24, 2018
+.Dt DOMAINSET 9
+.Os
+.Sh NAME
+.Nm domainset(9)
+\(em
+.Nm domainset_create ,
+.Nm sysctl_handle_domainset .
+.Nd domainset functions and operation
+.Sh SYNOPSIS
+.In sys/_domainset.h
+.In sys/domainset.h
+.\"
+.Bd -literal -offset indent
+struct domainset {
+        domainset_t     ds_mask;
+        uint16_t        ds_policy;
+        domainid_t      ds_prefer;
+	...
+};
+.Ed
+.Pp
+.Ft struct domainset *
+.Fn domainset_create "const struct domainset *key"
+.Ft int
+.Fn sysctl_handle_domainset "SYSCTL_HANDLER_ARGS"
+.Sh DESCRIPTION
+The
+.Nm
+API provides memory domain allocation policy for NUMA machines.
+Each
+.Vt domainset
+contains a bitmask of allowed domains, an integer policy, and an optional
+preferred domain.
+Together, these specify a search order for memory allocations as well as
+the ability to restrict threads and objects to a subset of available
+memory domains for system partitioning and resource management.
+.Pp
+Every thread in the system and optionally every
+.Vt vm_object_t ,
+which is used to represent files and other memory sources, has
+a reference to a
+.Vt struct domainset .
+The domainset associated with the object is consulted first and the system
+falls back to the thread policy if none exists.
+.Pp
+The allocation policy has the following possible values:
+.Bl -tag -width "foo"
+.It Dv DOMAINSET_POLICY_ROUNDROBIN
+Memory is allocated from each domain in the mask in a round-robin fashion.
+This distributes bandwidth evenly among available domains.
+This policy can specify a single domain for a fixed allocation.
+.It Dv DOMAINSET_POLICY_FIRSTTOUCH
+Memory is allocated from the node that it is first accessed on.
+Allocation falls back to round-robin if the current domain is not in the
+allowed set or is out of memory.
+This policy optimizes for locality but may give pessimal results if the
+memory is accessed from many CPUs that are not in the local domain.
+.It Dv DOMAINSET_POLICY_PREFER
+Memory is allocated from the node in the
+.Vt prefer
+member.  The preferred node must be set in the allowed mask.
+If the preferred node is out of memory the allocation falls back to 
+round-robin among allowed sets.
+.It Dv DOMAINSET_POLICY_INTERLEAVE
+Memory is allocated in a striped fashion with multiple pages
+allocated to each domain in the set according to the offset within
+the object.
+The strip width is object dependent and may be as large as a
+super-page (2MB on amd64).
+This gives good distribution among memory domains while keeping system
+efficiency higher and is preferential to round-robin for general use.
+.El
+.Pp
+The
+.Fn domainset_create
+function takes a partially filled in domainset as a key and returns a
+valid domainset or NULL.
+It is critical that consumers not use domainsets that have not been
+returned by this function.
+.Vt
+domainset
+is an immutable type that is shared among all matching keys and must
+not be modified after return.
+.Pp
+The
+.Fn sysctl_handle_domainset
+function is provided as a convenience for modifying or viewing domainsets
+that are not accessible via
+.Xr cpuset 2 .
+It is intended for use with 
+.Xr sysctl 9 .
+.Pp
+.Sh SEE ALSO
+.Xr cpuset 1 ,
+.Xr cpuset 2 ,
+.Xr cpuset_setdomain 2 ,
+.Xr bitset 9
+.Sh HISTORY
+.In sys/domainset.h
+first appeared in
+.Fx 12.0 .

Modified: head/sys/kern/kern_cpuset.c
==============================================================================
--- head/sys/kern/kern_cpuset.c	Thu Mar 29 02:50:57 2018	(r331722)
+++ head/sys/kern/kern_cpuset.c	Thu Mar 29 02:54:50 2018	(r331723)
@@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -63,9 +65,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
-#include 
-#include 
-#include 
+#include 
 
 #ifdef DDB
 #include 
@@ -112,13 +112,17 @@ __FBSDID("$FreeBSD$");
  * meaning 'curthread'.  It may query available cpus for that tid with a
  * getaffinity call using (CPU_LEVEL_CPUSET, CPU_WHICH_PID, -1, ...).
  */
+
+LIST_HEAD(domainlist, domainset);
+
 static uma_zone_t cpuset_zone;
 static uma_zone_t domainset_zone;
 static struct mtx cpuset_lock;
 static struct setlist cpuset_ids;
 static struct domainlist cpuset_domains;
 static struct unrhdr *cpuset_unr;
-static struct cpuset *cpuset_zero, *cpuset_default;
+static struct cpuset *cpuset_zero, *cpuset_default, *cpuset_kernel;
+static struct domainset domainset0, domainset2;
 
 /* Return the size of cpuset_t at the kernel level */
 SYSCTL_INT(_kern_sched, OID_AUTO, cpusetsize, CTLFLAG_RD | CTLFLAG_CAPRD,
@@ -445,6 +449,7 @@ static struct domainset *
 _domainset_create(struct domainset *domain, struct domainlist *freelist)
 {
 	struct domainset *ndomain;
+	int i, j, max;
 
 	mtx_lock_spin(&cpuset_lock);
 	LIST_FOREACH(ndomain, &cpuset_domains, ds_link)
@@ -457,7 +462,10 @@ _domainset_create(struct domainset *domain, struct dom
 	if (ndomain == NULL) {
 		LIST_INSERT_HEAD(&cpuset_domains, domain, ds_link);
 		domain->ds_cnt = DOMAINSET_COUNT(&domain->ds_mask);
-		domain->ds_max = DOMAINSET_FLS(&domain->ds_mask) + 1;
+		max = DOMAINSET_FLS(&domain->ds_mask) + 1;
+		for (i = 0, j = 0; i < max; i++)
+			if (DOMAINSET_ISSET(i, &domain->ds_mask))
+				domain->ds_order[j++] = i;
 	}
 	mtx_unlock_spin(&cpuset_lock);
 	if (ndomain == NULL)
@@ -473,11 +481,24 @@ _domainset_create(struct domainset *domain, struct dom
 /*
  * Create or lookup a domainset based on the key held in 'domain'.
  */
-static struct domainset *
+struct domainset *
 domainset_create(const struct domainset *domain)
 {
 	struct domainset *ndomain;
 
+	/*
+	 * Validate the policy.  It must specify a useable policy number with
+	 * only valid domains.  Preferred must include the preferred domain
+	 * in the mask.
+	 */
+	if (domain->ds_policy <= DOMAINSET_POLICY_INVALID ||
+	    domain->ds_policy > DOMAINSET_POLICY_MAX)
+		return (NULL);
+	if (domain->ds_policy == DOMAINSET_POLICY_PREFER &&
+	    !DOMAINSET_ISSET(domain->ds_prefer, &domain->ds_mask))
+		return (NULL);
+	if (!DOMAINSET_SUBSET(&domainset0.ds_mask, &domain->ds_mask))
+		return (NULL);
 	ndomain = uma_zalloc(domainset_zone, M_WAITOK | M_ZERO);
 	domainset_copy(domain, ndomain);
 	return _domainset_create(ndomain, NULL);
@@ -507,7 +528,7 @@ domainset_notify(void)
 		PROC_UNLOCK(p);
 	}
 	sx_sunlock(&allproc_lock);
-	kernel_object->domain.dr_policy = cpuset_default->cs_domain;
+	kernel_object->domain.dr_policy = cpuset_kernel->cs_domain;
 }
 
 /*
@@ -1128,6 +1149,55 @@ out:
 	return (error);
 }
 
+static int
+bitset_strprint(char *buf, size_t bufsiz, const struct bitset *set, int setlen)
+{
+	size_t bytes;
+	int i, once;
+	char *p;
+
+	once = 0;
+	p = buf;
+	for (i = 0; i < __bitset_words(setlen); i++) {
+		if (once != 0) {
+			if (bufsiz < 1)
+				return (0);
+			*p = ',';
+			p++;
+			bufsiz--;
+		} else
+			once = 1;
+		if (bufsiz < sizeof(__STRING(ULONG_MAX)))
+			return (0);
+		bytes = snprintf(p, bufsiz, "%lx", set->__bits[i]);
+		p += bytes;
+		bufsiz -= bytes;
+	}
+	return (p - buf);
+}
+
+static int
+bitset_strscan(struct bitset *set, int setlen, const char *buf)
+{
+	int i, ret;
+	const char *p;
+
+	BIT_ZERO(setlen, set);
+	p = buf;
+	for (i = 0; i < __bitset_words(setlen); i++) {
+		if (*p == ',') {
+			p++;
+			continue;
+		}
+		ret = sscanf(p, "%lx", &set->__bits[i]);
+		if (ret == 0 || ret == -1)
+			break;
+		while (isxdigit(*p))
+			p++;
+	}
+	return (p - buf);
+}
+
 /*
  * Return a string representing a valid layout for a cpuset_t object.
  * It expects an incoming buffer at least sized as CPUSETBUFSIZ.
@@ -1135,19 +1205,9 @@ out:
 char *
 cpusetobj_strprint(char *buf, const cpuset_t *set)
 {
-	char *tbuf;
-	size_t i, bytesp, bufsiz;
 
-	tbuf = buf;
-	bytesp = 0;
-	bufsiz = CPUSETBUFSIZ;
-
-	for (i = 0; i < (_NCPUWORDS - 1); i++) {
-		bytesp = snprintf(tbuf, bufsiz, "%lx,", set->__bits[i]);
-		bufsiz -= bytesp;
-		tbuf += bytesp;
-	}
-	snprintf(tbuf, bufsiz, "%lx", set->__bits[_NCPUWORDS - 1]);
+	bitset_strprint(buf, CPUSETBUFSIZ, (const struct bitset *)set,
+	    CPU_SETSIZE);
 	return (buf);
 }
 
@@ -1158,37 +1218,71 @@ cpusetobj_strprint(char *buf, const cpuset_t *set)
 int
 cpusetobj_strscan(cpuset_t *set, const char *buf)
 {
-	u_int nwords;
-	int i, ret;
+	char p;
 
 	if (strlen(buf) > CPUSETBUFSIZ - 1)
 		return (-1);
 
-	/* Allow to pass a shorter version of the mask when necessary. */
-	nwords = 1;
-	for (i = 0; buf[i] != '\0'; i++)
-		if (buf[i] == ',')
-			nwords++;
-	if (nwords > _NCPUWORDS)
+	p = buf[bitset_strscan((struct bitset *)set, CPU_SETSIZE, buf)];
+	if (p != '\0')
 		return (-1);
 
-	CPU_ZERO(set);
-	for (i = 0; i < (nwords - 1); i++) {
-		ret = sscanf(buf, "%lx,", &set->__bits[i]);
-		if (ret == 0 || ret == -1)
-			return (-1);
-		buf = strstr(buf, ",");
-		if (buf == NULL)
-			return (-1);
-		buf++;
-	}
-	ret = sscanf(buf, "%lx", &set->__bits[nwords - 1]);
-	if (ret == 0 || ret == -1)
-		return (-1);
 	return (0);
 }
 
 /*
+ * Handle a domainset specifier in the sysctl tree.  A poiner to a pointer to
+ * a domainset is in arg1.  If the user specifies a valid domainset the
+ * pointer is updated.
+ *
+ * Format is:
+ * hex mask word 0,hex mask word 1,...:decimal policy:decimal preferred
+ */
+int
+sysctl_handle_domainset(SYSCTL_HANDLER_ARGS)
+{
+	char buf[DOMAINSETBUFSIZ];
+	struct domainset *dset;
+	struct domainset key;
+	int policy, prefer, error;
+	char *p;
+
+	dset = *(struct domainset **)arg1;
+	error = 0;
+
+	if (dset != NULL) {
+		p = buf + bitset_strprint(buf, DOMAINSETBUFSIZ,
+		    (const struct bitset *)&dset->ds_mask, DOMAINSET_SETSIZE);
+		sprintf(p, ":%d:%d", dset->ds_policy, dset->ds_prefer);
+	} else
+		sprintf(buf, "");
+	error = sysctl_handle_string(oidp, buf, sizeof(buf), req);
+	if (error != 0 || req->newptr == NULL)
+		return (error);
+
+	/*
+	 * Read in and validate the string.
+	 */
+	memset(&key, 0, sizeof(key));
+	p = &buf[bitset_strscan((struct bitset *)&key.ds_mask,
+	    DOMAINSET_SETSIZE, buf)];
+	if (p == buf)
+		return (EINVAL);
+	if (sscanf(p, ":%d:%d", &policy, &prefer) != 2)
+		return (EINVAL);
+	key.ds_policy = policy;
+	key.ds_prefer = prefer;
+
+	/* Domainset_create() validates the policy.*/
+	dset = domainset_create(&key);
+	if (dset == NULL)
+		return (EINVAL);
+	*(struct domainset **)arg1 = dset;
+
+	return (error);
+}
+
+/*
  * Apply an anonymous mask or a domain to a single thread.
  */
 static int
@@ -1239,95 +1333,19 @@ cpuset_setthread(lwpid_t id, cpuset_t *mask)
 int
 cpuset_setithread(lwpid_t id, int cpu)
 {
-	struct setlist cpusets;
-	struct cpuset *nset, *rset;
-	struct cpuset *parent, *old_set;
-	struct thread *td;
-	struct proc *p;
-	cpusetid_t cs_id;
 	cpuset_t mask;
-	int error;
 
-	cpuset_freelist_init(&cpusets, 1);
-	rset = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO);
-	cs_id = CPUSET_INVALID;
-
 	CPU_ZERO(&mask);
 	if (cpu == NOCPU)
 		CPU_COPY(cpuset_root, &mask);
 	else
 		CPU_SET(cpu, &mask);
-
-	error = cpuset_which(CPU_WHICH_TID, id, &p, &td, &old_set);
-	if (error != 0 || ((cs_id = alloc_unr(cpuset_unr)) == CPUSET_INVALID))
-		goto out;
-
-	/* cpuset_which() returns with PROC_LOCK held. */
-	old_set = td->td_cpuset;
-
-	if (cpu == NOCPU) {
-		nset = LIST_FIRST(&cpusets);
-		LIST_REMOVE(nset, cs_link);
-
-		/*
-		 * roll back to default set. We're not using cpuset_shadow()
-		 * here because we can fail CPU_SUBSET() check. This can happen
-		 * if default set does not contain all CPUs.
-		 */
-		error = _cpuset_create(nset, cpuset_default, &mask, NULL,
-		    CPUSET_INVALID);
-
-		goto applyset;
-	}
-
-	if (old_set->cs_id == 1 || (old_set->cs_id == CPUSET_INVALID &&
-	    old_set->cs_parent->cs_id == 1)) {
-
-		/*
-		 * Current set is either default (1) or
-		 * shadowed version of default set.
-		 *
-		 * Allocate new root set to be able to shadow it
-		 * with any mask.
-		 */
-		error = _cpuset_create(rset, cpuset_zero,
-		    &cpuset_zero->cs_mask, NULL, cs_id);
-		if (error != 0) {
-			PROC_UNLOCK(p);
-			goto out;
-		}
-		rset->cs_flags |= CPU_SET_ROOT;
-		parent = rset;
-		rset = NULL;
-		cs_id = CPUSET_INVALID;
-	} else {
-		/* Assume existing set was already allocated by previous call */
-		parent = old_set;
-		old_set = NULL;
-	}
-
-	error = cpuset_shadow(parent, &nset, &mask, NULL, &cpusets, NULL);
-applyset:
-	if (error == 0) {
-		thread_lock(td);
-		old_set = cpuset_update_thread(td, nset);
-		thread_unlock(td);
-	} else
-		old_set = NULL;
-	PROC_UNLOCK(p);
-	if (old_set != NULL)
-		cpuset_rel(old_set);
-out:
-	cpuset_freelist_free(&cpusets);
-	if (rset != NULL)
-		uma_zfree(cpuset_zone, rset);
-	if (cs_id != CPUSET_INVALID)
-		free_unr(cpuset_unr, cs_id);
-	return (error);
+	return _cpuset_setthread(id, &mask, NULL);
 }
 
-static struct domainset domainset0;
-
+/*
+ * Create the domainset for cpuset 0, 1 and cpuset 2.
+ */
 void
 domainset_zero(void)
 {
@@ -1340,14 +1358,17 @@ domainset_zero(void)
 	DOMAINSET_ZERO(&dset->ds_mask);
 	for (i = 0; i < vm_ndomains; i++)
 		DOMAINSET_SET(i, &dset->ds_mask);
-	dset->ds_policy = DOMAINSET_POLICY_ROUNDROBIN;
+	dset->ds_policy = DOMAINSET_POLICY_FIRSTTOUCH;
 	dset->ds_prefer = -1;
 	curthread->td_domain.dr_policy = _domainset_create(dset, NULL);
-	kernel_object->domain.dr_policy = curthread->td_domain.dr_policy;
+
+	domainset_copy(dset, &domainset2);
+	domainset2.ds_policy = DOMAINSET_POLICY_INTERLEAVE;
+	kernel_object->domain.dr_policy = _domainset_create(&domainset2, NULL);
 }
 
 /*
- * Creates system-wide cpusets and the cpuset for thread0 including two
+ * Creates system-wide cpusets and the cpuset for thread0 including three
  * sets:
  * 
  * 0 - The root set which should represent all valid processors in the
@@ -1357,6 +1378,8 @@ domainset_zero(void)
  * 1 - The default set which all processes are a member of until changed.
  *     This allows an administrator to move all threads off of given cpus to
  *     dedicate them to high priority tasks or save power etc.
+ * 2 - The kernel set which allows restriction and policy to be applied only
+ *     to kernel threads and the kernel_object.
  */
 struct cpuset *
 cpuset_thread0(void)
@@ -1366,12 +1389,12 @@ cpuset_thread0(void)
 	int i;
 
 	cpuset_zone = uma_zcreate("cpuset", sizeof(struct cpuset), NULL, NULL,
-	    NULL, NULL, UMA_ALIGN_PTR, 0);
+	    NULL, NULL, UMA_ALIGN_CACHE, 0);
 	domainset_zone = uma_zcreate("domainset", sizeof(struct domainset),
-	    NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);
+	    NULL, NULL, NULL, NULL, UMA_ALIGN_CACHE, 0);
 
 	/*
-	 * Create the root system set for the whole machine.  Doesn't use
+	 * Create the root system set (0) for the whole machine.  Doesn't use
 	 * cpuset_create() due to NULL parent.
 	 */
 	set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO);
@@ -1385,12 +1408,20 @@ cpuset_thread0(void)
 	cpuset_root = &set->cs_mask;
 
 	/*
-	 * Now derive a default, modifiable set from that to give out.
+	 * Now derive a default (1), modifiable set from that to give out.
 	 */
 	set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO);
 	error = _cpuset_create(set, cpuset_zero, NULL, NULL, 1);
 	KASSERT(error == 0, ("Error creating default set: %d\n", error));
 	cpuset_default = set;
+	/*
+	 * Create the kernel set (2).
+	 */
+	set = uma_zalloc(cpuset_zone, M_WAITOK | M_ZERO);
+	error = _cpuset_create(set, cpuset_zero, NULL, NULL, 2);
+	KASSERT(error == 0, ("Error creating kernel set: %d\n", error));
+	set->cs_domain = &domainset2;
+	cpuset_kernel = set;
 
 	/*
 	 * Initialize the unit allocator. 0 and 1 are allocated above.
@@ -1407,9 +1438,21 @@ cpuset_thread0(void)
 	CPU_COPY(&all_cpus, &cpuset_domain[0]);
 domains_set:
 
-	return (set);
+	return (cpuset_default);
 }
 
+void
+cpuset_kernthread(struct thread *td)
+{
+	struct cpuset *set;
+
+	thread_lock(td);
+	set = td->td_cpuset;
+	td->td_cpuset = cpuset_ref(cpuset_kernel);
+	thread_unlock(td);
+	cpuset_rel(set);
+}
+
 /*
  * Create a cpuset, which would be cpuset_create() but
  * mark the new 'set' as root.
@@ -2108,7 +2151,7 @@ out:
 }
 
 #ifdef DDB
-BITSET_DEFINE(bitset, 1);
+
 static void
 ddb_display_bitset(const struct bitset *set, int size)
 {
@@ -2164,9 +2207,8 @@ DB_SHOW_COMMAND(domainsets, db_show_domainsets)
 	struct domainset *set;
 
 	LIST_FOREACH(set, &cpuset_domains, ds_link) {
-		db_printf("set=%p policy %d prefer %d cnt %d max %d\n",
-		    set, set->ds_policy, set->ds_prefer, set->ds_cnt,
-		    set->ds_max);
+		db_printf("set=%p policy %d prefer %d cnt %d\n",
+		    set, set->ds_policy, set->ds_prefer, set->ds_cnt);
 		db_printf("  mask =");
 		ddb_display_domainset(&set->ds_mask);
 		db_printf("\n");

Modified: head/sys/kern/kern_kthread.c
==============================================================================
--- head/sys/kern/kern_kthread.c	Thu Mar 29 02:50:57 2018	(r331722)
+++ head/sys/kern/kern_kthread.c	Thu Mar 29 02:54:50 2018	(r331723)
@@ -131,7 +131,7 @@ kproc_create(void (*func)(void *), void *arg,
 	cpu_fork_kthread_handler(td, func, arg);
 
 	/* Avoid inheriting affinity from a random parent. */
-	cpuset_setthread(td->td_tid, cpuset_root);
+	cpuset_kernthread(td);
 	thread_lock(td);
 	TD_SET_CAN_RUN(td);
 	sched_prio(td, PVM);
@@ -309,7 +309,7 @@ kthread_add(void (*func)(void *), void *arg, struct pr
 	tidhash_add(newtd);
 
 	/* Avoid inheriting affinity from a random parent. */
-	cpuset_setthread(newtd->td_tid, cpuset_root);
+	cpuset_kernthread(newtd);
 
 	/* Delay putting it on the run queue until now. */
 	if (!(flags & RFSTOPPED)) {

Modified: head/sys/sys/_bitset.h
==============================================================================
--- head/sys/sys/_bitset.h	Thu Mar 29 02:50:57 2018	(r331722)
+++ head/sys/sys/_bitset.h	Thu Mar 29 02:54:50 2018	(r331723)
@@ -57,4 +57,10 @@ struct t {								\
  */
 #define BITSET_DEFINE_VAR(t)	BITSET_DEFINE(t, 1)
 
+/*
+ * Define a default type that can be used while manually specifying size
+ * to every call.
+ */
+BITSET_DEFINE(bitset, 1);
+
 #endif /* !_SYS__BITSET_H_ */

Modified: head/sys/sys/cpuset.h
==============================================================================
--- head/sys/sys/cpuset.h	Thu Mar 29 02:50:57 2018	(r331722)
+++ head/sys/sys/cpuset.h	Thu Mar 29 02:54:50 2018	(r331723)
@@ -139,6 +139,7 @@ int	cpuset_create_root(struct prison *, struct cpuset 
 int	cpuset_setproc_update_set(struct proc *, struct cpuset *);
 int	cpuset_which(cpuwhich_t, id_t, struct proc **,
 	    struct thread **, struct cpuset **);
+void	cpuset_kernthread(struct thread *);
 
 char	*cpusetobj_strprint(char *, const cpuset_t *);
 int	cpusetobj_strscan(cpuset_t *, const char *);

Modified: head/sys/sys/domainset.h
==============================================================================
--- head/sys/sys/domainset.h	Thu Mar 29 02:50:57 2018	(r331722)
+++ head/sys/sys/domainset.h	Thu Mar 29 02:54:50 2018	(r331723)
@@ -28,8 +28,8 @@
  * $FreeBSD$
  */
 
-#ifndef _SYS_DOMAINSETSET_H_
-#define	_SYS_DOMAINSETSET_H_
+#ifndef _SYS_DOMAINSET_H_
+#define	_SYS_DOMAINSET_H_
 
 #include 
 
@@ -38,8 +38,12 @@
 #define	_NDOMAINSETBITS			_BITSET_BITS
 #define	_NDOMAINSETWORDS		__bitset_words(DOMAINSET_SETSIZE)
 
-#define	DOMAINSETSETBUFSIZ	((2 + sizeof(long) * 2) * _NDOMAINSETWORDS)
+#define	DOMAINSETBUFSIZ							\
+	    (((2 + sizeof(long) * 2) * _NDOMAINSETWORDS) +		\
+	    sizeof("::") + sizeof(__XSTRING(DOMAINSET_POLICY_MAX)) +	\
+	    sizeof(__XSTRING(MAXMEMDOM)))
 
+
 #define	DOMAINSET_CLR(n, p)		BIT_CLR(DOMAINSET_SETSIZE, n, p)
 #define	DOMAINSET_COPY(f, t)		BIT_COPY(DOMAINSET_SETSIZE, f, t)
 #define	DOMAINSET_ISSET(n, p)		BIT_ISSET(DOMAINSET_SETSIZE, n, p)
@@ -73,23 +77,37 @@
 #define	DOMAINSET_POLICY_ROUNDROBIN	1
 #define	DOMAINSET_POLICY_FIRSTTOUCH	2
 #define	DOMAINSET_POLICY_PREFER		3
-#define	DOMAINSET_POLICY_MAX		DOMAINSET_POLICY_PREFER
+#define	DOMAINSET_POLICY_INTERLEAVE	4
+#define	DOMAINSET_POLICY_MAX		DOMAINSET_POLICY_INTERLEAVE
 
 #ifdef _KERNEL
-#include 
-LIST_HEAD(domainlist, domainset);
+#if MAXMEMDOM < 256
+typedef	uint8_t		domainid_t;
+#else
+typedef uint16_t	domainid_t;
+#endif
 
 struct domainset {
 	LIST_ENTRY(domainset)	ds_link;
 	domainset_t	ds_mask;	/* allowed domains. */
 	uint16_t	ds_policy;	/* Policy type. */
-	int16_t		ds_prefer;	/* Preferred domain or -1. */
-	uint16_t	ds_cnt;		/* popcnt from above. */
-	uint16_t	ds_max;		/* Maximum domain in set. */
+	domainid_t	ds_prefer;	/* Preferred domain or -1. */
+	domainid_t	ds_cnt;		/* popcnt from above. */
+	domainid_t	ds_order[MAXMEMDOM];  /* nth domain table. */
 };
 
 void domainset_zero(void);
 
+/*
+ * Add a domainset to the system based on a key initializing policy, prefer,
+ * and mask.  Do not create and directly use domainset structures.  The
+ * returned value will not match the key pointer.
+ */
+struct domainset *domainset_create(const struct domainset *);
+#ifdef _SYS_SYSCTL_H_
+int sysctl_handle_domainset(SYSCTL_HANDLER_ARGS);
+#endif
+
 #else
 __BEGIN_DECLS
 int	cpuset_getdomain(cpulevel_t, cpuwhich_t, id_t, size_t, domainset_t *,
@@ -99,4 +117,4 @@ int	cpuset_setdomain(cpulevel_t, cpuwhich_t, id_t, siz
 
 __END_DECLS
 #endif
-#endif /* !_SYS_DOMAINSETSET_H_ */
+#endif /* !_SYS_DOMAINSET_H_ */

Modified: head/sys/sys/proc.h
==============================================================================
--- head/sys/sys/proc.h	Thu Mar 29 02:50:57 2018	(r331722)
+++ head/sys/sys/proc.h	Thu Mar 29 02:54:50 2018	(r331723)
@@ -67,7 +67,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 		/* Machine-dependent proc substruct. */
 #ifdef _KERNEL

Modified: head/sys/vm/vm_domainset.c
==============================================================================
--- head/sys/vm/vm_domainset.c	Thu Mar 29 02:50:57 2018	(r331722)
+++ head/sys/vm/vm_domainset.c	Thu Mar 29 02:54:50 2018	(r331723)
@@ -56,11 +56,14 @@ __FBSDID("$FreeBSD$");
  * assumed that most allocations are successful.
  */
 
+static int vm_domainset_default_stride = 64;
+
 /*
  * Determine which policy is to be used for this allocation.
  */
 static void
-vm_domainset_iter_domain(struct vm_domainset_iter *di, struct vm_object *obj)
+vm_domainset_iter_init(struct vm_domainset_iter *di, struct vm_object *obj,
+    vm_pindex_t pindex)
 {
 	struct domainset *domain;
 
@@ -76,18 +79,33 @@ vm_domainset_iter_domain(struct vm_domainset_iter *di,
 		di->di_domain = curthread->td_domain.dr_policy;
 		di->di_iter = &curthread->td_domain.dr_iterator;
 	}
+	di->di_policy = di->di_domain->ds_policy;
+	if (di->di_policy == DOMAINSET_POLICY_INTERLEAVE) {
+		if (vm_object_reserv(obj)) {
+			/*
+			 * Color the pindex so we end up on the correct
+			 * reservation boundary.
+			 */
+			pindex += obj->pg_color;
+			pindex >>= VM_LEVEL_0_ORDER;
+		} else
+			pindex /= vm_domainset_default_stride;
+		/*
+		 * Offset pindex so the first page of each object does
+		 * not end up in domain 0.
+		 */
+		if (obj != NULL)
+			pindex += (((uintptr_t)obj) / sizeof(*obj));
+		di->di_offset = pindex;
+	}
 }
 
 static void
 vm_domainset_iter_rr(struct vm_domainset_iter *di, int *domain)
 {
-	int d;
 
-	d = *di->di_iter;
-	do {
-		d = (d + 1) % di->di_domain->ds_max;
-	} while (!DOMAINSET_ISSET(d, &di->di_domain->ds_mask));
-	*di->di_iter = *domain = d;
+	*domain = di->di_domain->ds_order[
+	    ++(*di->di_iter) % di->di_domain->ds_cnt];
 }
 
 static void
@@ -95,27 +113,38 @@ vm_domainset_iter_prefer(struct vm_domainset_iter *di,
 {
 	int d;
 
-	d = *di->di_iter;
 	do {
-		d = (d + 1) % di->di_domain->ds_max;
-	} while (!DOMAINSET_ISSET(d, &di->di_domain->ds_mask) || 
-	    d == di->di_domain->ds_prefer);
-	*di->di_iter = *domain = d;
+		d = di->di_domain->ds_order[
+		    ++(*di->di_iter) % di->di_domain->ds_cnt];
+	} while (d == di->di_domain->ds_prefer);
+	*domain = d;
 }
 
 static void
+vm_domainset_iter_interleave(struct vm_domainset_iter *di, int *domain)
+{
+	int d;
+
+	d = di->di_offset % di->di_domain->ds_cnt;
+	*di->di_iter = d;
+	*domain = di->di_domain->ds_order[d];
+}
+
+static void
 vm_domainset_iter_next(struct vm_domainset_iter *di, int *domain)
 {
 
 	KASSERT(di->di_n > 0,
 	    ("vm_domainset_iter_first: Invalid n %d", di->di_n));
-	switch (di->di_domain->ds_policy) {
+	switch (di->di_policy) {
 	case DOMAINSET_POLICY_FIRSTTOUCH:
 		/*
 		 * To prevent impossible allocations we convert an invalid
 		 * first-touch to round-robin.
 		 */
 		/* FALLTHROUGH */
+	case DOMAINSET_POLICY_INTERLEAVE:
+		/* FALLTHROUGH */
 	case DOMAINSET_POLICY_ROUNDROBIN:
 		vm_domainset_iter_rr(di, domain);
 		break;
@@ -124,7 +153,7 @@ vm_domainset_iter_next(struct vm_domainset_iter *di, i
 		break;
 	default:
 		panic("vm_domainset_iter_first: Unknown policy %d",
-		    di->di_domain->ds_policy);
+		    di->di_policy);
 	}
 	KASSERT(*domain < vm_ndomains,
 	    ("vm_domainset_iter_next: Invalid domain %d", *domain));
@@ -134,11 +163,15 @@ static void
 vm_domainset_iter_first(struct vm_domainset_iter *di, int *domain)
 {
 
-	switch (di->di_domain->ds_policy) {
+	switch (di->di_policy) {
 	case DOMAINSET_POLICY_FIRSTTOUCH:
 		*domain = PCPU_GET(domain);
 		if (DOMAINSET_ISSET(*domain, &di->di_domain->ds_mask)) {
-			di->di_n = 1;
+			/*
+			 * Add an extra iteration because we will visit the
+			 * current domain a second time in the rr iterator.
+			 */
+			di->di_n = di->di_domain->ds_cnt + 1;
 			break;
 		}
 		/*
@@ -154,9 +187,13 @@ vm_domainset_iter_first(struct vm_domainset_iter *di, 
 		*domain = di->di_domain->ds_prefer;
 		di->di_n = di->di_domain->ds_cnt;
 		break;
+	case DOMAINSET_POLICY_INTERLEAVE:
+		vm_domainset_iter_interleave(di, domain);
+		di->di_n = di->di_domain->ds_cnt;
+		break;
 	default:
 		panic("vm_domainset_iter_first: Unknown policy %d",
-		    di->di_domain->ds_policy);
+		    di->di_policy);
 	}
 	KASSERT(di->di_n > 0,
 	    ("vm_domainset_iter_first: Invalid n %d", di->di_n));
@@ -166,10 +203,10 @@ vm_domainset_iter_first(struct vm_domainset_iter *di, 
 
 void
 vm_domainset_iter_page_init(struct vm_domainset_iter *di, struct vm_object *obj,
-    int *domain, int *req)
+    vm_pindex_t pindex, int *domain, int *req)
 {
 
-	vm_domainset_iter_domain(di, obj);
+	vm_domainset_iter_init(di, obj, pindex);
 	di->di_flags = *req;
 	*req = (di->di_flags & ~(VM_ALLOC_WAITOK | VM_ALLOC_WAITFAIL)) |
 	    VM_ALLOC_NOWAIT;
@@ -213,7 +250,9 @@ vm_domainset_iter_malloc_init(struct vm_domainset_iter
     struct vm_object *obj, int *domain, int *flags)
 {
 
-	vm_domainset_iter_domain(di, obj);
+	vm_domainset_iter_init(di, obj, 0);
+	if (di->di_policy == DOMAINSET_POLICY_INTERLEAVE)
+		di->di_policy = DOMAINSET_POLICY_ROUNDROBIN;
 	di->di_flags = *flags;
 	*flags = (di->di_flags & ~M_WAITOK) | M_NOWAIT;
 	vm_domainset_iter_first(di, domain);
@@ -253,7 +292,7 @@ vm_domainset_iter_page(struct vm_domainset_iter *di, i
 
 void
 vm_domainset_iter_page_init(struct vm_domainset_iter *di,
-            struct vm_object *obj, int *domain, int *flags)
+            struct vm_object *obj, vm_pindex_t pindex, int *domain, int *flags)
 {
 
 	*domain = 0;

Modified: head/sys/vm/vm_domainset.h
==============================================================================
--- head/sys/vm/vm_domainset.h	Thu Mar 29 02:50:57 2018	(r331722)
+++ head/sys/vm/vm_domainset.h	Thu Mar 29 02:54:50 2018	(r331723)
@@ -33,13 +33,15 @@
 struct vm_domainset_iter {
 	struct domainset	*di_domain;
 	int			*di_iter;
+	vm_pindex_t		di_offset;
+	int			di_policy;
 	int			di_flags;
 	int			di_n;
 };
 
 int	vm_domainset_iter_page(struct vm_domainset_iter *, int *, int *);
 void	vm_domainset_iter_page_init(struct vm_domainset_iter *,
-	    struct vm_object *, int *, int *);
+	    struct vm_object *, vm_pindex_t, int *, int *);
 int	vm_domainset_iter_malloc(struct vm_domainset_iter *, int *, int *);
 void	vm_domainset_iter_malloc_init(struct vm_domainset_iter *,
 	    struct vm_object *, int *, int *);

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Thu Mar 29 02:50:57 2018	(r331722)
+++ head/sys/vm/vm_page.c	Thu Mar 29 02:54:50 2018	(r331723)
@@ -1660,7 +1660,7 @@ vm_page_alloc_after(vm_object_t object, vm_pindex_t pi
 	vm_page_t m;
 	int domain;
 
-	vm_domainset_iter_page_init(&di, object, &domain, &req);
+	vm_domainset_iter_page_init(&di, object, pindex, &domain, &req);
 	do {
 		m = vm_page_alloc_domain_after(object, pindex, domain, req,
 		    mpred);
@@ -1893,7 +1893,7 @@ vm_page_alloc_contig(vm_object_t object, vm_pindex_t p
 	vm_page_t m;
 	int domain;
 
-	vm_domainset_iter_page_init(&di, object, &domain, &req);
+	vm_domainset_iter_page_init(&di, object, pindex, &domain, &req);
 	do {
 		m = vm_page_alloc_contig_domain(object, pindex, domain, req,
 		    npages, low, high, alignment, boundary, memattr);
@@ -2092,7 +2092,7 @@ vm_page_alloc_freelist(int freelist, int req)
 	vm_page_t m;
 	int domain;
 
-	vm_domainset_iter_page_init(&di, kernel_object, &domain, &req);
+	vm_domainset_iter_page_init(&di, NULL, 0, &domain, &req);
 	do {
 		m = vm_page_alloc_freelist_domain(domain, freelist, req);
 		if (m != NULL)
@@ -2691,7 +2691,7 @@ vm_page_reclaim_contig(int req, u_long npages, vm_padd
 	int domain;
 	bool ret;
 
-	vm_domainset_iter_page_init(&di, kernel_object, &domain, &req);
+	vm_domainset_iter_page_init(&di, NULL, 0, &domain, &req);
 	do {
 		ret = vm_page_reclaim_contig_domain(domain, req, npages, low,
 		    high, alignment, boundary);

Modified: head/sys/vm/vnode_pager.c
==============================================================================
--- head/sys/vm/vnode_pager.c	Thu Mar 29 02:50:57 2018	(r331722)
+++ head/sys/vm/vnode_pager.c	Thu Mar 29 02:54:50 2018	(r331723)
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -69,6 +70,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@freebsd.org  Thu Mar 29 04:02:51 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98DBDF71EED;
 Thu, 29 Mar 2018 04:02:51 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 46CBE77EB7;
 Thu, 29 Mar 2018 04:02:51 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4171D14B98;
 Thu, 29 Mar 2018 04:02:51 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2T42ptf013686;
 Thu, 29 Mar 2018 04:02:51 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2T42ofL013679;
 Thu, 29 Mar 2018 04:02:50 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201803290402.w2T42ofL013679@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: Conrad Meyer 
Date: Thu, 29 Mar 2018 04:02:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331724 - in head/sys: conf crypto/chacha20
 modules/crypto opencrypto
X-SVN-Group: head
X-SVN-Commit-Author: cem
X-SVN-Commit-Paths: in head/sys: conf crypto/chacha20 modules/crypto opencrypto
X-SVN-Commit-Revision: 331724
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 04:02:52 -0000

Author: cem
Date: Thu Mar 29 04:02:50 2018
New Revision: 331724
URL: https://svnweb.freebsd.org/changeset/base/331724

Log:
  opencrypto: Integrate Chacha20 algorithm into OCF
  
  Mostly this is a thin shim around existing code to integrate with enc_xform
  and cryptosoft (+ cryptodev).
  
  Expand the cryptodev buffer used to match that of Chacha20's native block
  size as a performance enhancement for chacha20_xform_crypt_multi.

Added:
  head/sys/crypto/chacha20/chacha-sw.c   (contents, props changed)
Modified:
  head/sys/conf/files
  head/sys/modules/crypto/Makefile
  head/sys/opencrypto/cryptodev.c
  head/sys/opencrypto/cryptodev.h
  head/sys/opencrypto/cryptosoft.c
  head/sys/opencrypto/xform_enc.h

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Thu Mar 29 02:54:50 2018	(r331723)
+++ head/sys/conf/files	Thu Mar 29 04:02:50 2018	(r331724)
@@ -662,6 +662,8 @@ crypto/blowfish/bf_ecb.c	optional ipsec | ipsec_suppor
 crypto/blowfish/bf_skey.c	optional crypto | ipsec | ipsec_support
 crypto/camellia/camellia.c	optional crypto | ipsec | ipsec_support
 crypto/camellia/camellia-api.c	optional crypto | ipsec | ipsec_support
+crypto/chacha20/chacha.c	optional crypto | ipsec | ipsec_support
+crypto/chacha20/chacha-sw.c	optional crypto | ipsec | ipsec_support
 crypto/des/des_ecb.c		optional crypto | ipsec | ipsec_support | netsmb
 crypto/des/des_setkey.c		optional crypto | ipsec | ipsec_support | netsmb
 crypto/rc4/rc4.c		optional netgraph_mppc_encryption | kgssapi

Added: head/sys/crypto/chacha20/chacha-sw.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/crypto/chacha20/chacha-sw.c	Thu Mar 29 04:02:50 2018	(r331724)
@@ -0,0 +1,78 @@
+/* This file is in the public domain. */
+
+#include 
+__FBSDID("$FreeBSD$");
+
+#include 
+#include 
+
+static int
+chacha20_xform_setkey(u_int8_t **sched, u_int8_t *key, int len)
+{
+	struct chacha_ctx *ctx;
+
+	if (len != CHACHA_MINKEYLEN && len != 32)
+		return (EINVAL);
+
+	ctx = malloc(sizeof(*ctx), M_CRYPTO_DATA, M_NOWAIT | M_ZERO);
+	*sched = (void *)ctx;
+	if (ctx == NULL)
+		return (ENOMEM);
+
+	chacha_keysetup(ctx, key, len * 8);
+	return (0);
+}
+
+static void
+chacha20_xform_reinit(caddr_t key, u_int8_t *iv)
+{
+	struct chacha_ctx *ctx;
+
+	ctx = (void *)key;
+	chacha_ivsetup(ctx, iv + 8, iv);
+}
+
+static void
+chacha20_xform_zerokey(u_int8_t **sched)
+{
+	struct chacha_ctx *ctx;
+
+	ctx = (void *)*sched;
+	explicit_bzero(ctx, sizeof(*ctx));
+	free(ctx, M_CRYPTO_DATA);
+	*sched = NULL;
+}
+
+static void
+chacha20_xform_crypt(caddr_t cctx, u_int8_t *bytes)
+{
+	struct chacha_ctx *ctx;
+
+	ctx = (void *)cctx;
+	chacha_encrypt_bytes(ctx, bytes, bytes, 1);
+}
+
+static void
+chacha20_xform_crypt_multi(void *vctx, uint8_t *bytes, size_t len)
+{
+	struct chacha_ctx *ctx;
+
+	ctx = vctx;
+	chacha_encrypt_bytes(ctx, bytes, bytes, len);
+}
+
+struct enc_xform enc_xform_chacha20 = {
+	.type = CRYPTO_CHACHA20,
+	.name = "chacha20",
+	.blocksize = 1,
+	.ivsize = CHACHA_NONCELEN + CHACHA_CTRLEN,
+	.minkey = CHACHA_MINKEYLEN,
+	.maxkey = 32,
+	.encrypt = chacha20_xform_crypt,
+	.decrypt = chacha20_xform_crypt,
+	.setkey = chacha20_xform_setkey,
+	.zerokey = chacha20_xform_zerokey,
+	.reinit = chacha20_xform_reinit,
+	.encrypt_multi = chacha20_xform_crypt_multi,
+	.decrypt_multi = chacha20_xform_crypt_multi,
+};

Modified: head/sys/modules/crypto/Makefile
==============================================================================
--- head/sys/modules/crypto/Makefile	Thu Mar 29 02:54:50 2018	(r331723)
+++ head/sys/modules/crypto/Makefile	Thu Mar 29 04:02:50 2018	(r331724)
@@ -10,6 +10,7 @@
 .PATH:	${SRCTOP}/sys/crypto/siphash
 .PATH:	${SRCTOP}/sys/crypto/skein
 .PATH:	${SRCTOP}/sys/crypto/blake2
+.PATH:	${SRCTOP}/sys/crypto/chacha20
 .PATH:	${SRCTOP}/sys/contrib/libb2
 
 KMOD	= crypto
@@ -41,6 +42,8 @@ CFLAGS.blake2s-ref.c	+= -I${SRCTOP}/sys/crypto/blake2 
 CFLAGS.blake2-sw.c	+= -I${SRCTOP}/sys/crypto/blake2
 CWARNFLAGS.blake2b-ref.c	+= ${NO_WCAST_QUAL}
 CWARNFLAGS.blake2s-ref.c	+= ${NO_WCAST_QUAL}
+SRCS	+= chacha.c
+SRCS	+= chacha-sw.c
 SRCS	+= opt_param.h cryptodev_if.h bus_if.h device_if.h
 SRCS	+= opt_ddb.h
 

Modified: head/sys/opencrypto/cryptodev.c
==============================================================================
--- head/sys/opencrypto/cryptodev.c	Thu Mar 29 02:54:50 2018	(r331723)
+++ head/sys/opencrypto/cryptodev.c	Thu Mar 29 04:02:50 2018	(r331724)
@@ -443,6 +443,9 @@ cryptof_ioctl(
 		case CRYPTO_AES_NIST_GCM_16:
 			txform = &enc_xform_aes_nist_gcm;
  			break;
+		case CRYPTO_CHACHA20:
+			txform = &enc_xform_chacha20;
+			break;
 
 		default:
 			CRYPTDEB("invalid cipher");

Modified: head/sys/opencrypto/cryptodev.h
==============================================================================
--- head/sys/opencrypto/cryptodev.h	Thu Mar 29 02:54:50 2018	(r331723)
+++ head/sys/opencrypto/cryptodev.h	Thu Mar 29 04:02:50 2018	(r331724)
@@ -112,7 +112,8 @@
 #define	AES_ICM_BLOCK_LEN	1
 #define	ARC4_BLOCK_LEN		1
 #define	CAMELLIA_BLOCK_LEN	16
-#define	EALG_MAX_BLOCK_LEN	AES_BLOCK_LEN /* Keep this updated */
+#define	CHACHA20_NATIVE_BLOCK_LEN	64
+#define	EALG_MAX_BLOCK_LEN	CHACHA20_NATIVE_BLOCK_LEN /* Keep this updated */
 
 /* IV Lengths */
 
@@ -180,7 +181,8 @@
 #define	CRYPTO_AES_256_NIST_GMAC 28 /* auth side */
 #define	CRYPTO_BLAKE2B		29 /* Blake2b hash */
 #define	CRYPTO_BLAKE2S		30 /* Blake2s hash */
-#define	CRYPTO_ALGORITHM_MAX	30 /* Keep updated - see below */
+#define	CRYPTO_CHACHA20		31 /* Chacha20 stream cipher */
+#define	CRYPTO_ALGORITHM_MAX	31 /* Keep updated - see below */
 
 #define	CRYPTO_ALGO_VALID(x)	((x) >= CRYPTO_ALGORITHM_MIN && \
 				 (x) <= CRYPTO_ALGORITHM_MAX)

Modified: head/sys/opencrypto/cryptosoft.c
==============================================================================
--- head/sys/opencrypto/cryptosoft.c	Thu Mar 29 02:54:50 2018	(r331723)
+++ head/sys/opencrypto/cryptosoft.c	Thu Mar 29 04:02:50 2018	(r331724)
@@ -830,6 +830,9 @@ swcr_newsession(device_t dev, u_int32_t *sid, struct c
 		case CRYPTO_NULL_CBC:
 			txf = &enc_xform_null;
 			goto enccommon;
+		case CRYPTO_CHACHA20:
+			txf = &enc_xform_chacha20;
+			goto enccommon;
 		enccommon:
 			if (cri->cri_key != NULL) {
 				error = txf->setkey(&((*swd)->sw_kschedule),
@@ -1056,6 +1059,7 @@ swcr_freesession_locked(device_t dev, u_int64_t tid)
 		case CRYPTO_AES_NIST_GMAC:
 		case CRYPTO_CAMELLIA_CBC:
 		case CRYPTO_NULL_CBC:
+		case CRYPTO_CHACHA20:
 			txf = swd->sw_exf;
 
 			if (swd->sw_kschedule)
@@ -1185,6 +1189,7 @@ swcr_process(device_t dev, struct cryptop *crp, int hi
 		case CRYPTO_AES_XTS:
 		case CRYPTO_AES_ICM:
 		case CRYPTO_CAMELLIA_CBC:
+		case CRYPTO_CHACHA20:
 			if ((crp->crp_etype = swcr_encdec(crd, sw,
 			    crp->crp_buf, crp->crp_flags)) != 0)
 				goto done;
@@ -1298,6 +1303,7 @@ swcr_attach(device_t dev)
 	REGISTER(CRYPTO_DEFLATE_COMP);
 	REGISTER(CRYPTO_BLAKE2B);
 	REGISTER(CRYPTO_BLAKE2S);
+	REGISTER(CRYPTO_CHACHA20);
 #undef REGISTER
 
 	return 0;

Modified: head/sys/opencrypto/xform_enc.h
==============================================================================
--- head/sys/opencrypto/xform_enc.h	Thu Mar 29 02:54:50 2018	(r331723)
+++ head/sys/opencrypto/xform_enc.h	Thu Mar 29 04:02:50 2018	(r331724)
@@ -51,7 +51,7 @@
 struct enc_xform {
 	int type;
 	char *name;
-	u_int16_t blocksize;
+	u_int16_t blocksize;	/* Required input block size -- 1 for stream ciphers. */
 	u_int16_t ivsize;
 	u_int16_t minkey, maxkey;
 	void (*encrypt) (caddr_t, u_int8_t *);
@@ -83,6 +83,7 @@ extern struct enc_xform enc_xform_aes_nist_gmac;
 extern struct enc_xform enc_xform_aes_xts;
 extern struct enc_xform enc_xform_arc4;
 extern struct enc_xform enc_xform_camellia;
+extern struct enc_xform enc_xform_chacha20;
 
 struct aes_icm_ctx {
 	u_int32_t	ac_ek[4*(RIJNDAEL_MAXNR + 1)];

From owner-svn-src-head@freebsd.org  Thu Mar 29 04:07:54 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2706BF72589;
 Thu, 29 Mar 2018 04:07:54 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id C90DF78330;
 Thu, 29 Mar 2018 04:07:53 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C2D2814BAD;
 Thu, 29 Mar 2018 04:07:53 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2T47rF2014037;
 Thu, 29 Mar 2018 04:07:53 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2T47rOr014036;
 Thu, 29 Mar 2018 04:07:53 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201803290407.w2T47rOr014036@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: Conrad Meyer 
Date: Thu, 29 Mar 2018 04:07:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331725 - head/tools/tools/crypto
X-SVN-Group: head
X-SVN-Commit-Author: cem
X-SVN-Commit-Paths: head/tools/tools/crypto
X-SVN-Commit-Revision: 331725
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 04:07:54 -0000

Author: cem
Date: Thu Mar 29 04:07:53 2018
New Revision: 331725
URL: https://svnweb.freebsd.org/changeset/base/331725

Log:
  cryptotest: Add chacha20 cipher

Modified:
  head/tools/tools/crypto/cryptotest.c

Modified: head/tools/tools/crypto/cryptotest.c
==============================================================================
--- head/tools/tools/crypto/cryptotest.c	Thu Mar 29 04:02:50 2018	(r331724)
+++ head/tools/tools/crypto/cryptotest.c	Thu Mar 29 04:07:53 2018	(r331725)
@@ -56,6 +56,7 @@
  *	aes	rijndael/aes 128-bit cbc
  *	aes192	rijndael/aes 192-bit cbc
  *	aes256	rijndael/aes 256-bit cbc
+ *	chacha20 Chacha20 stream cipher
  *	blake2b	Blake2b
  *	blake2s	Blake2s
  *	md5	md5 hmac
@@ -134,6 +135,7 @@ struct alg {
 	{ "aes",	0,	16,	16,	16,	CRYPTO_AES_CBC},
 	{ "aes192",	0,	16,	24,	24,	CRYPTO_AES_CBC},
 	{ "aes256",	0,	16,	32,	32,	CRYPTO_AES_CBC},
+	{ "chacha20",	0,	1,	32,	32,	CRYPTO_CHACHA20},
 	{ "blake2b",	1,	128,	64,	64,	CRYPTO_BLAKE2B },
 	{ "blake2s",	1,	64,	32,	32,	CRYPTO_BLAKE2S },
 	{ "md5",	1,	8,	16,	16,	CRYPTO_MD5_HMAC },
@@ -150,7 +152,7 @@ usage(const char* cmd)
 		cmd);
 	printf("where algorithm is one of:\n");
 	printf("    null des 3des (default) blowfish cast skipjack rij\n");
-	printf("    aes aes192 aes256 md5 sha1 sha256 sha384 sha512\n");
+	printf("    aes aes192 aes256 chacha20 md5 sha1 sha256 sha384 sha512\n");
 	printf("    blake2b blake2s\n");
 	printf(" or an encryption algorithm concatented with authentication\n");
 	printf(" algorithm with '+' in the middle, e.g., aes+sha1.\n");

From owner-svn-src-head@freebsd.org  Thu Mar 29 04:14:38 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40B25F72E1F;
 Thu, 29 Mar 2018 04:14:38 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id DFFF17894B;
 Thu, 29 Mar 2018 04:14:37 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7BB614D5D;
 Thu, 29 Mar 2018 04:14:37 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2T4Ebcs018943;
 Thu, 29 Mar 2018 04:14:37 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2T4EbSe018942;
 Thu, 29 Mar 2018 04:14:37 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201803290414.w2T4EbSe018942@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: Conrad Meyer 
Date: Thu, 29 Mar 2018 04:14:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331726 - head/tools/tools/crypto
X-SVN-Group: head
X-SVN-Commit-Author: cem
X-SVN-Commit-Paths: head/tools/tools/crypto
X-SVN-Commit-Revision: 331726
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 04:14:38 -0000

Author: cem
Date: Thu Mar 29 04:14:37 2018
New Revision: 331726
URL: https://svnweb.freebsd.org/changeset/base/331726

Log:
  cryptocheck: Add Chacha20 cipher to tool

Modified:
  head/tools/tools/crypto/cryptocheck.c

Modified: head/tools/tools/crypto/cryptocheck.c
==============================================================================
--- head/tools/tools/crypto/cryptocheck.c	Thu Mar 29 04:07:53 2018	(r331725)
+++ head/tools/tools/crypto/cryptocheck.c	Thu Mar 29 04:14:37 2018	(r331726)
@@ -96,6 +96,7 @@
  *	aes-ctr256	256-bit aes ctr
  *	aes-xts		128-bit aes xts
  *	aes-xts256	256-bit aes xts
+ *	chacha20
  *
  * Authenticated Encryption:
  *	+
@@ -162,6 +163,8 @@ struct alg {
 	  .evp_cipher = EVP_aes_128_xts },
 	{ .name = "aes-xts256", .cipher = CRYPTO_AES_XTS, .type = T_BLKCIPHER,
 	  .evp_cipher = EVP_aes_256_xts },
+	{ .name = "chacha20", .cipher = CRYPTO_CHACHA20, .type = T_BLKCIPHER,
+	  .evp_cipher = EVP_chacha20 },
 	{ .name = "aes-gcm", .cipher = CRYPTO_AES_NIST_GCM_16,
 	  .mac = CRYPTO_AES_128_NIST_GMAC, .type = T_GCM,
 	  .evp_cipher = EVP_aes_128_gcm },

From owner-svn-src-head@freebsd.org  Thu Mar 29 13:55:24 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CA5EF78472;
 Thu, 29 Mar 2018 13:55:24 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3F9616F48B;
 Thu, 29 Mar 2018 13:55:24 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 202781ABD4;
 Thu, 29 Mar 2018 13:55:24 +0000 (UTC) (envelope-from dim@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2TDtNh2009593;
 Thu, 29 Mar 2018 13:55:23 GMT (envelope-from dim@FreeBSD.org)
Received: (from dim@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2TDtNLh009590;
 Thu, 29 Mar 2018 13:55:23 GMT (envelope-from dim@FreeBSD.org)
Message-Id: <201803291355.w2TDtNLh009590@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org
 using -f
From: Dimitry Andric 
Date: Thu, 29 Mar 2018 13:55:23 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331731 - head/contrib/llvm/tools/lld/ELF
X-SVN-Group: head
X-SVN-Commit-Author: dim
X-SVN-Commit-Paths: head/contrib/llvm/tools/lld/ELF
X-SVN-Commit-Revision: 331731
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 13:55:24 -0000

Author: dim
Date: Thu Mar 29 13:55:23 2018
New Revision: 331731
URL: https://svnweb.freebsd.org/changeset/base/331731

Log:
  Pull in r328738 from upstream lld trunk (by Rafael Espindola):
  
    Strip @VER suffices from the LTO output.
  
    This fixes pr36623.
  
    The problem is that we have to parse versions out of names before LTO
    so that LTO can use that information.
  
    When we get the LTO produced .o files, we replace the previous symbols
    with the LTO produced ones, but they still have @ in their names.
  
    We could just trim the name directly, but calling parseSymbolVersion
    to do it is simpler.
  
  This is a follow-up to r331366, since we discovered that lld could
  append version strings to symbols twice, when using Link Time
  Optimization.
  
  MFC after:	3 months
  X-MFC-With:	r327952

Modified:
  head/contrib/llvm/tools/lld/ELF/InputFiles.cpp
  head/contrib/llvm/tools/lld/ELF/InputFiles.h
  head/contrib/llvm/tools/lld/ELF/SymbolTable.cpp

Modified: head/contrib/llvm/tools/lld/ELF/InputFiles.cpp
==============================================================================
--- head/contrib/llvm/tools/lld/ELF/InputFiles.cpp	Thu Mar 29 12:52:58 2018	(r331730)
+++ head/contrib/llvm/tools/lld/ELF/InputFiles.cpp	Thu Mar 29 13:55:23 2018	(r331731)
@@ -281,6 +281,10 @@ template  ArrayRef ObjFile
   return makeArrayRef(this->Symbols).slice(1, this->FirstNonLocal - 1);
 }
 
+template  ArrayRef ObjFile::getGlobalSymbols() {
+  return makeArrayRef(this->Symbols).slice(this->FirstNonLocal);
+}
+
 template 
 void ObjFile::parse(DenseSet &ComdatGroups) {
   // Read section and symbol tables.

Modified: head/contrib/llvm/tools/lld/ELF/InputFiles.h
==============================================================================
--- head/contrib/llvm/tools/lld/ELF/InputFiles.h	Thu Mar 29 12:52:58 2018	(r331730)
+++ head/contrib/llvm/tools/lld/ELF/InputFiles.h	Thu Mar 29 13:55:23 2018	(r331731)
@@ -167,6 +167,7 @@ template  class ObjFile : public ELFFileBa
   static bool classof(const InputFile *F) { return F->kind() == Base::ObjKind; }
 
   ArrayRef getLocalSymbols();
+  ArrayRef getGlobalSymbols();
 
   ObjFile(MemoryBufferRef M, StringRef ArchiveName);
   void parse(llvm::DenseSet &ComdatGroups);

Modified: head/contrib/llvm/tools/lld/ELF/SymbolTable.cpp
==============================================================================
--- head/contrib/llvm/tools/lld/ELF/SymbolTable.cpp	Thu Mar 29 12:52:58 2018	(r331730)
+++ head/contrib/llvm/tools/lld/ELF/SymbolTable.cpp	Thu Mar 29 13:55:23 2018	(r331731)
@@ -130,7 +130,10 @@ template  void SymbolTable::addCombinedLTO
 
   for (InputFile *File : LTO->compile()) {
     DenseSet DummyGroups;
-    cast>(File)->parse(DummyGroups);
+    auto *Obj = cast>(File);
+    Obj->parse(DummyGroups);
+    for (Symbol *Sym : Obj->getGlobalSymbols())
+      Sym->parseSymbolVersion();
     ObjectFiles.push_back(File);
   }
 }

From owner-svn-src-head@freebsd.org  Thu Mar 29 14:27:41 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8471EF4EDF9;
 Thu, 29 Mar 2018 14:27:41 +0000 (UTC)
 (envelope-from markj@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3A36270D5A;
 Thu, 29 Mar 2018 14:27:41 +0000 (UTC)
 (envelope-from markj@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30A3F1B0CD;
 Thu, 29 Mar 2018 14:27:41 +0000 (UTC)
 (envelope-from markj@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2TEReln024931;
 Thu, 29 Mar 2018 14:27:40 GMT (envelope-from markj@FreeBSD.org)
Received: (from markj@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2TEReA3024929;
 Thu, 29 Mar 2018 14:27:40 GMT (envelope-from markj@FreeBSD.org)
Message-Id: <201803291427.w2TEReA3024929@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: markj set sender to
 markj@FreeBSD.org using -f
From: Mark Johnston 
Date: Thu, 29 Mar 2018 14:27:40 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331732 - head/sys/vm
X-SVN-Group: head
X-SVN-Commit-Author: markj
X-SVN-Commit-Paths: head/sys/vm
X-SVN-Commit-Revision: 331732
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 14:27:41 -0000

Author: markj
Date: Thu Mar 29 14:27:40 2018
New Revision: 331732
URL: https://svnweb.freebsd.org/changeset/base/331732

Log:
  Fix the background laundering mechanism after r329882.
  
  Rather than using the number of inactive queue scans as a metric for
  how many clean pages are being freed by the page daemon, have the
  page daemon keep a running counter of the number of pages it has freed,
  and have the laundry thread use that when computing the background
  laundering threshold.
  
  Reviewed by:	kib
  Differential Revision:	https://reviews.freebsd.org/D14884

Modified:
  head/sys/vm/vm_pageout.c
  head/sys/vm/vm_pagequeue.h

Modified: head/sys/vm/vm_pageout.c
==============================================================================
--- head/sys/vm/vm_pageout.c	Thu Mar 29 13:55:23 2018	(r331731)
+++ head/sys/vm/vm_pageout.c	Thu Mar 29 14:27:40 2018	(r331732)
@@ -943,8 +943,7 @@ vm_pageout_laundry_worker(void *arg)
 {
 	struct vm_domain *vmd;
 	struct vm_pagequeue *pq;
-	uint64_t nclean, ndirty;
-	u_int inactq_scans, last_launder;
+	uint64_t nclean, ndirty, nfreed;
 	int domain, last_target, launder, shortfall, shortfall_cycle, target;
 	bool in_shortfall;
 
@@ -958,8 +957,7 @@ vm_pageout_laundry_worker(void *arg)
 	in_shortfall = false;
 	shortfall_cycle = 0;
 	target = 0;
-	inactq_scans = 0;
-	last_launder = 0;
+	nfreed = 0;
 
 	/*
 	 * Calls to these handlers are serialized by the swap syscall lock.
@@ -1000,7 +998,6 @@ vm_pageout_laundry_worker(void *arg)
 			target = 0;
 			goto trybackground;
 		}
-		last_launder = inactq_scans;
 		launder = target / shortfall_cycle--;
 		goto dolaundry;
 
@@ -1009,24 +1006,23 @@ vm_pageout_laundry_worker(void *arg)
 		 * meet the conditions to perform background laundering:
 		 *
 		 * 1. The ratio of dirty to clean inactive pages exceeds the
-		 *    background laundering threshold and the pagedaemon has
-		 *    been woken up to reclaim pages since our last
-		 *    laundering, or
+		 *    background laundering threshold, or
 		 * 2. we haven't yet reached the target of the current
 		 *    background laundering run.
 		 *
 		 * The background laundering threshold is not a constant.
 		 * Instead, it is a slowly growing function of the number of
-		 * page daemon scans since the last laundering.  Thus, as the
-		 * ratio of dirty to clean inactive pages grows, the amount of
-		 * memory pressure required to trigger laundering decreases.
+		 * clean pages freed by the page daemon since the last
+		 * background laundering.  Thus, as the ratio of dirty to
+		 * clean inactive pages grows, the amount of memory pressure
+		 * required to trigger laundering decreases.
 		 */
 trybackground:
 		nclean = vmd->vmd_free_count +
 		    vmd->vmd_pagequeues[PQ_INACTIVE].pq_cnt;
 		ndirty = vmd->vmd_pagequeues[PQ_LAUNDRY].pq_cnt;
-		if (target == 0 && inactq_scans != last_launder &&
-		    ndirty * isqrt(inactq_scans - last_launder) >= nclean) {
+		if (target == 0 && ndirty * isqrt(nfreed /
+		    (vmd->vmd_free_target - vmd->vmd_free_min)) >= nclean) {
 			target = vmd->vmd_background_launder_target;
 		}
 
@@ -1039,8 +1035,8 @@ trybackground:
 		 * proceed at the background laundering rate.
 		 */
 		if (target > 0) {
-			if (inactq_scans != last_launder) {
-				last_launder = inactq_scans;
+			if (nfreed > 0) {
+				nfreed = 0;
 				last_target = target;
 			} else if (last_target - target >=
 			    vm_background_launder_max * PAGE_SIZE / 1024) {
@@ -1089,7 +1085,8 @@ dolaundry:
 
 		if (target == 0)
 			vmd->vmd_laundry_request = VM_LAUNDRY_IDLE;
-		inactq_scans = vmd->vmd_inactq_scans;
+		nfreed += vmd->vmd_clean_pages_freed;
+		vmd->vmd_clean_pages_freed = 0;
 		vm_pagequeue_unlock(pq);
 	}
 }
@@ -1367,7 +1364,8 @@ drop_page:
 				    VM_LAUNDRY_BACKGROUND;
 			wakeup(&vmd->vmd_laundry_request);
 		}
-		vmd->vmd_inactq_scans++;
+		vmd->vmd_clean_pages_freed +=
+		    starting_page_shortage - page_shortage;
 		vm_pagequeue_unlock(pq);
 	}
 

Modified: head/sys/vm/vm_pagequeue.h
==============================================================================
--- head/sys/vm/vm_pagequeue.h	Thu Mar 29 13:55:23 2018	(r331731)
+++ head/sys/vm/vm_pagequeue.h	Thu Mar 29 14:27:40 2018	(r331732)
@@ -86,6 +86,7 @@ struct sysctl_oid;
  * d   vm_domainset_lock
  * a   atomic
  * c   const after boot
+ * q   page queue lock
 */
 struct vm_domain {
 	struct vm_pagequeue vmd_pagequeues[PQ_COUNT];
@@ -112,15 +113,15 @@ struct vm_domain {
 	int vmd_pageout_pages_needed;	/* (d) page daemon waiting for pages? */
 	bool vmd_minset;		/* (d) Are we in vm_min_domains? */
 	bool vmd_severeset;		/* (d) Are we in vm_severe_domains? */
-	int vmd_inactq_scans;
 	enum {
 		VM_LAUNDRY_IDLE = 0,
 		VM_LAUNDRY_BACKGROUND,
 		VM_LAUNDRY_SHORTFALL
 	} vmd_laundry_request;
 
-	/* Paging thresholds. */
-	u_int vmd_background_launder_target;
+	/* Paging thresholds and targets. */
+	u_int vmd_clean_pages_freed;	/* (q) accumulator for laundry thread */
+	u_int vmd_background_launder_target; /* (c) */
 	u_int vmd_free_reserved;	/* (c) pages reserved for deadlock */
 	u_int vmd_free_target;		/* (c) pages desired free */
 	u_int vmd_free_min;		/* (c) pages desired free */

From owner-svn-src-head@freebsd.org  Thu Mar 29 15:58:50 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF8F9F571F6;
 Thu, 29 Mar 2018 15:58:49 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id A1DD175627;
 Thu, 29 Mar 2018 15:58:49 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C9E11C000;
 Thu, 29 Mar 2018 15:58:49 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2TFwnoX071024;
 Thu, 29 Mar 2018 15:58:49 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2TFwnRk071022;
 Thu, 29 Mar 2018 15:58:49 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803291558.w2TFwnRk071022@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Thu, 29 Mar 2018 15:58:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331737 - head/sys/dev/de
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: head/sys/dev/de
X-SVN-Commit-Revision: 331737
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 15:58:50 -0000

Author: brooks
Date: Thu Mar 29 15:58:49 2018
New Revision: 331737
URL: https://svnweb.freebsd.org/changeset/base/331737

Log:
  GC never enabled support for SIOCGADDRROM and SIOCGCHIPID.
  
  When de(4) was imported in 1997 the world was not ready for these ioctls.
  In over 20 years that hasn't changed so it seems safe to assume their
  time will never come.
  
  Reviewed by:	imp, jhb
  Approved by:	CheriBSD
  MFC after:	1 week
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14889

Modified:
  head/sys/dev/de/if_de.c
  head/sys/dev/de/if_devar.h

Modified: head/sys/dev/de/if_de.c
==============================================================================
--- head/sys/dev/de/if_de.c	Thu Mar 29 15:12:03 2018	(r331736)
+++ head/sys/dev/de/if_de.c	Thu Mar 29 15:58:49 2018	(r331737)
@@ -4266,18 +4266,6 @@ tulip_ifioctl(struct ifnet * ifp, u_long cmd, caddr_t 
 	    break;
 	}
 
-#ifdef SIOCGADDRROM
-	case SIOCGADDRROM: {
-	    error = copyout(sc->tulip_rombuf, ifr->ifr_data, sizeof(sc->tulip_rombuf));
-	    break;
-	}
-#endif
-#ifdef SIOCGCHIPID
-	case SIOCGCHIPID: {
-	    ifr->ifr_metric = (int) sc->tulip_chipid;
-	    break;
-	}
-#endif
 	default: {
 	    error = ether_ioctl(ifp, cmd, data);
 	    break;

Modified: head/sys/dev/de/if_devar.h
==============================================================================
--- head/sys/dev/de/if_devar.h	Thu Mar 29 15:12:03 2018	(r331736)
+++ head/sys/dev/de/if_devar.h	Thu Mar 29 15:58:49 2018	(r331737)
@@ -876,11 +876,6 @@ static const struct {
 #define	TULIP_TXMAP_POSTSYNC(ri, di)					\
 	_TULIP_MAP_SYNC(ri, di, BUS_DMASYNC_POSTWRITE)
 
-#ifdef notyet
-#define	SIOCGADDRROM		_IOW('i', 240, struct ifreq)	/* get 128 bytes of ROM */
-#define	SIOCGCHIPID		_IOWR('i', 241, struct ifreq)	/* get chipid */
-#endif
-
 #if defined(TULIP_HDR_DATA)
 static tulip_softc_t	*tulips[TULIP_MAX_DEVICES];
 #endif

From owner-svn-src-head@freebsd.org  Thu Mar 29 17:20:00 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EB5FF64980;
 Thu, 29 Mar 2018 17:20:00 +0000 (UTC)
 (envelope-from markj@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id ED88079551;
 Thu, 29 Mar 2018 17:19:59 +0000 (UTC)
 (envelope-from markj@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E20571CDAC;
 Thu, 29 Mar 2018 17:19:59 +0000 (UTC)
 (envelope-from markj@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2THJxJd011041;
 Thu, 29 Mar 2018 17:19:59 GMT (envelope-from markj@FreeBSD.org)
Received: (from markj@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2THJxpi011040;
 Thu, 29 Mar 2018 17:19:59 GMT (envelope-from markj@FreeBSD.org)
Message-Id: <201803291719.w2THJxpi011040@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: markj set sender to
 markj@FreeBSD.org using -f
From: Mark Johnston 
Date: Thu, 29 Mar 2018 17:19:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331738 - head/sys/sys
X-SVN-Group: head
X-SVN-Commit-Author: markj
X-SVN-Commit-Paths: head/sys/sys
X-SVN-Commit-Revision: 331738
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 17:20:00 -0000

Author: markj
Date: Thu Mar 29 17:19:59 2018
New Revision: 331738
URL: https://svnweb.freebsd.org/changeset/base/331738

Log:
  Have TD_LOCKS_DEC() assert that td_locks is positive.
  
  This makes it easier to catch lock accounting bugs, since the problem
  is otherwise only detected upon a return to user mode (or never, for
  kernel threads).
  
  Reviewed by:	cem
  MFC after:	1 week
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D14896

Modified:
  head/sys/sys/proc.h

Modified: head/sys/sys/proc.h
==============================================================================
--- head/sys/sys/proc.h	Thu Mar 29 15:58:49 2018	(r331737)
+++ head/sys/sys/proc.h	Thu Mar 29 17:19:59 2018	(r331738)
@@ -381,7 +381,10 @@ do {									\
 } while (0)
 
 #define	TD_LOCKS_INC(td)	((td)->td_locks++)
-#define	TD_LOCKS_DEC(td)	((td)->td_locks--)
+#define	TD_LOCKS_DEC(td) do {						\
+	KASSERT((td)->td_locks > 0, ("thread %p owns no locks", (td)));	\
+	(td)->td_locks--;						\
+} while (0)
 #else
 #define	THREAD_LOCKPTR_ASSERT(td, lock)
 

From owner-svn-src-head@freebsd.org  Thu Mar 29 17:36:35 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84CE7F661E9;
 Thu, 29 Mar 2018 17:36:35 +0000 (UTC)
 (envelope-from davidcs@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3839F7A276;
 Thu, 29 Mar 2018 17:36:35 +0000 (UTC)
 (envelope-from davidcs@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 327821D167;
 Thu, 29 Mar 2018 17:36:35 +0000 (UTC)
 (envelope-from davidcs@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2THaZ2q020535;
 Thu, 29 Mar 2018 17:36:35 GMT (envelope-from davidcs@FreeBSD.org)
Received: (from davidcs@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2THaY0C020529;
 Thu, 29 Mar 2018 17:36:34 GMT (envelope-from davidcs@FreeBSD.org)
Message-Id: <201803291736.w2THaY0C020529@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: davidcs set sender to
 davidcs@FreeBSD.org using -f
From: David C Somayajulu 
Date: Thu, 29 Mar 2018 17:36:34 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331739 - head/sys/dev/qlxgbe
X-SVN-Group: head
X-SVN-Commit-Author: davidcs
X-SVN-Commit-Paths: head/sys/dev/qlxgbe
X-SVN-Commit-Revision: 331739
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 17:36:35 -0000

Author: davidcs
Date: Thu Mar 29 17:36:34 2018
New Revision: 331739
URL: https://svnweb.freebsd.org/changeset/base/331739

Log:
  1. Add additional debug prints.
  2. Break transmit when IFF_DRV_RUNNING is OFF.
  3. set desc_count=0 for default case in switch in ql_rcv_isr()
  MFC after:5 days

Modified:
  head/sys/dev/qlxgbe/ql_dbg.h
  head/sys/dev/qlxgbe/ql_hw.c
  head/sys/dev/qlxgbe/ql_ioctl.c
  head/sys/dev/qlxgbe/ql_isr.c
  head/sys/dev/qlxgbe/ql_os.c
  head/sys/dev/qlxgbe/ql_ver.h

Modified: head/sys/dev/qlxgbe/ql_dbg.h
==============================================================================
--- head/sys/dev/qlxgbe/ql_dbg.h	Thu Mar 29 17:19:59 2018	(r331738)
+++ head/sys/dev/qlxgbe/ql_dbg.h	Thu Mar 29 17:36:34 2018	(r331739)
@@ -59,6 +59,7 @@ extern void ql_dump_buf32(qla_host_t *ha, const char *
 #define INJCT_SGL_RCV_INV_DESC_COUNT			0x0000D
 #define INJCT_SGL_LRO_INV_DESC_COUNT			0x0000E
 #define INJCT_PEER_PORT_FAILURE_ERR_RECOVERY		0x0000F
+#define INJCT_TXBUF_MBUF_NON_NULL			0x00010
 
 #ifdef QL_DBG
 

Modified: head/sys/dev/qlxgbe/ql_hw.c
==============================================================================
--- head/sys/dev/qlxgbe/ql_hw.c	Thu Mar 29 17:19:59 2018	(r331738)
+++ head/sys/dev/qlxgbe/ql_hw.c	Thu Mar 29 17:36:34 2018	(r331739)
@@ -1090,7 +1090,11 @@ ql_hw_add_sysctls(qla_host_t *ha)
                 "\t\t\t 8: mbx: mailbox command failure\n"
                 "\t\t\t 9: heartbeat failure\n"
                 "\t\t\t A: temperature failure\n"
-		"\t\t\t 11: m_getcl or m_getjcl failure\n" );
+		"\t\t\t 11: m_getcl or m_getjcl failure\n"
+		"\t\t\t 13: Invalid Descriptor Count in SGL Receive\n"
+		"\t\t\t 14: Invalid Descriptor Count in LRO Receive\n"
+		"\t\t\t 15: peer port error recovery failure\n"
+		"\t\t\t 16: tx_buf[next_prod_index].mbuf != NULL\n" );
 
 	SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
                 SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
@@ -2906,7 +2910,7 @@ ql_del_hw_if_exit:
 void
 qla_confirm_9kb_enable(qla_host_t *ha)
 {
-	uint32_t supports_9kb = 0;
+//	uint32_t supports_9kb = 0;
 
 	ha->hw.mbx_intr_mask_offset = READ_REG32(ha, Q8_MBOX_INT_MASK_MSIX);
 
@@ -2914,10 +2918,12 @@ qla_confirm_9kb_enable(qla_host_t *ha)
 	WRITE_REG32(ha, Q8_MBOX_INT_ENABLE, BIT_2);
 	WRITE_REG32(ha, ha->hw.mbx_intr_mask_offset, 0x0);
 
+#if 0
 	qla_get_nic_partition(ha, &supports_9kb, NULL);
 
 	if (!supports_9kb)
-		ha->hw.enable_9kb = 0;
+#endif
+	ha->hw.enable_9kb = 0;
 
 	return;
 }
@@ -3589,6 +3595,13 @@ qla_hw_all_mcast(qla_host_t *ha, uint32_t add_mcast)
 			bcopy(ha->hw.mcast[i].addr, mcast, ETHER_ADDR_LEN);
 			mcast = mcast + ETHER_ADDR_LEN;
 			count++;
+
+			device_printf(ha->pci_dev,
+				"%s: %x:%x:%x:%x:%x:%x \n",
+				__func__, ha->hw.mcast[i].addr[0],
+				ha->hw.mcast[i].addr[1], ha->hw.mcast[i].addr[2],
+				ha->hw.mcast[i].addr[3], ha->hw.mcast[i].addr[4],
+				ha->hw.mcast[i].addr[5]);
 			
 			if (count == Q8_MAX_MAC_ADDRS) {
 				if (qla_config_mac_addr(ha, ha->hw.mac_addr_arr,
@@ -3825,6 +3838,18 @@ ql_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx)
 	}
 
 	hw_tx_cntxt->txr_free += comp_count;
+
+	if (hw_tx_cntxt->txr_free > NUM_TX_DESCRIPTORS)
+		device_printf(ha->pci_dev, "%s [%d]: txr_idx = %d txr_free = %d"
+			"txr_next = %d txr_comp = %d\n", __func__, __LINE__,
+			txr_idx, hw_tx_cntxt->txr_free,
+			hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp);
+
+	QL_ASSERT(ha, (hw_tx_cntxt->txr_free <= NUM_TX_DESCRIPTORS), \
+		("%s [%d]: txr_idx = %d txr_free = %d txr_next = %d txr_comp = %d\n",\
+		__func__, __LINE__, txr_idx, hw_tx_cntxt->txr_free, \
+		hw_tx_cntxt->txr_next, hw_tx_cntxt->txr_comp));
+	
 	return;
 }
 
@@ -3961,7 +3986,9 @@ qla_init_nic_func(qla_host_t *ha)
 
         if (err) {
                 device_printf(dev, "%s: failed [0x%08x]\n", __func__, err);
-        }
+        } else {
+                device_printf(dev, "%s: successful\n", __func__);
+	}
 
         return 0;
 }

Modified: head/sys/dev/qlxgbe/ql_ioctl.c
==============================================================================
--- head/sys/dev/qlxgbe/ql_ioctl.c	Thu Mar 29 17:19:59 2018	(r331738)
+++ head/sys/dev/qlxgbe/ql_ioctl.c	Thu Mar 29 17:36:34 2018	(r331739)
@@ -269,7 +269,8 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, 
 			}
 		} else {
 
-			if (QLA_LOCK(ha, __func__, QLA_LOCK_DEFAULT_MS_TIMEOUT, 0) == 0) {
+#define QLA_LOCK_MDUMP_MS_TIMEOUT (QLA_LOCK_DEFAULT_MS_TIMEOUT * 5)
+			if (QLA_LOCK(ha, __func__, QLA_LOCK_MDUMP_MS_TIMEOUT, 0) == 0) {
 				if (!ha->hw.mdump_done) {
 					fw_dump->saved = 0;
 					QL_INITIATE_RECOVERY(ha);
@@ -303,7 +304,7 @@ ql_eioctl(struct cdev *dev, u_long cmd, caddr_t data, 
 			}
 			fw_dump->usec_ts = ha->hw.mdump_usec_ts;
 			
-			if (QLA_LOCK(ha, __func__, QLA_LOCK_DEFAULT_MS_TIMEOUT, 0) == 0) {
+			if (QLA_LOCK(ha, __func__, QLA_LOCK_MDUMP_MS_TIMEOUT, 0) == 0) {
 				ha->hw.mdump_done = 0;
 				QLA_UNLOCK(ha, __func__);
 			} else {

Modified: head/sys/dev/qlxgbe/ql_isr.c
==============================================================================
--- head/sys/dev/qlxgbe/ql_isr.c	Thu Mar 29 17:19:59 2018	(r331738)
+++ head/sys/dev/qlxgbe/ql_isr.c	Thu Mar 29 17:36:34 2018	(r331739)
@@ -703,6 +703,7 @@ ql_rcv_isr(qla_host_t *ha, uint32_t sds_idx, uint32_t 
 			break;
 
 		default:
+			desc_count = 0;
 			device_printf(dev, "%s: default 0x%llx!\n", __func__,
 					(long long unsigned int)sdesc->data[0]);
 			break;

Modified: head/sys/dev/qlxgbe/ql_os.c
==============================================================================
--- head/sys/dev/qlxgbe/ql_os.c	Thu Mar 29 17:19:59 2018	(r331738)
+++ head/sys/dev/qlxgbe/ql_os.c	Thu Mar 29 17:36:34 2018	(r331739)
@@ -1289,13 +1289,20 @@ qla_send(qla_host_t *ha, struct mbuf **m_headp, uint32
 
 	tx_idx = ha->hw.tx_cntxt[txr_idx].txr_next;
 
-	if (NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) {
+	if ((NULL != ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head) ||
+		(QL_ERR_INJECT(ha, INJCT_TXBUF_MBUF_NON_NULL))){
 		QL_ASSERT(ha, 0, ("%s [%d]: txr_idx = %d tx_idx = %d "\
 			"mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx,\
 			ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head));
+
+		device_printf(ha->pci_dev, "%s [%d]: txr_idx = %d tx_idx = %d "
+			"mbuf = %p\n", __func__, __LINE__, txr_idx, tx_idx,
+			ha->tx_ring[txr_idx].tx_buf[tx_idx].m_head);
+
 		if (m_head)
 			m_freem(m_head);
 		*m_headp = NULL;
+		QL_INITIATE_RECOVERY(ha);
 		return (ret);
 	}
 
@@ -1428,8 +1435,8 @@ qla_fp_taskqueue(void *context, int pending)
         qla_tx_fp_t *fp;
         qla_host_t *ha;
         struct ifnet *ifp;
-        struct mbuf  *mp;
-        int ret;
+        struct mbuf  *mp = NULL;
+        int ret = 0;
 	uint32_t txr_idx;
 	uint32_t iscsi_pdu = 0;
 	uint32_t rx_pkts_left = -1;
@@ -1453,7 +1460,7 @@ qla_fp_taskqueue(void *context, int pending)
         }
 
 	while (rx_pkts_left && !ha->stop_rcv &&
-		(ifp->if_drv_flags & IFF_DRV_RUNNING)) {
+		(ifp->if_drv_flags & IFF_DRV_RUNNING) && ha->hw.link_up) {
 		rx_pkts_left = ql_rcv_isr(ha, fp->txr_idx, 64);
 
 #ifdef QL_ENABLE_ISCSI_TLV
@@ -1498,13 +1505,18 @@ qla_fp_taskqueue(void *context, int pending)
 
 			/* Send a copy of the frame to the BPF listener */
 			ETHER_BPF_MTAP(ifp, mp);
-			if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+
+			if (((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) ||
+				(!ha->hw.link_up))
 				break;
 
 			mp = drbr_peek(ifp, fp->tx_br);
 		}
 	}
         mtx_unlock(&fp->tx_mtx);
+
+	if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0)
+		goto qla_fp_taskqueue_exit;
 
 qla_fp_taskqueue_exit0:
 

Modified: head/sys/dev/qlxgbe/ql_ver.h
==============================================================================
--- head/sys/dev/qlxgbe/ql_ver.h	Thu Mar 29 17:19:59 2018	(r331738)
+++ head/sys/dev/qlxgbe/ql_ver.h	Thu Mar 29 17:36:34 2018	(r331739)
@@ -38,6 +38,6 @@
 
 #define QLA_VERSION_MAJOR 	3
 #define QLA_VERSION_MINOR	10
-#define QLA_VERSION_BUILD       36
+#define QLA_VERSION_BUILD       37
 
 #endif /* #ifndef _QL_VER_H_ */

From owner-svn-src-head@freebsd.org  Thu Mar 29 17:44:56 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70AB1F66D30;
 Thu, 29 Mar 2018 17:44:56 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 244337AA08;
 Thu, 29 Mar 2018 17:44:56 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F0D91D330;
 Thu, 29 Mar 2018 17:44:56 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2THiug9025865;
 Thu, 29 Mar 2018 17:44:56 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2THitKa025864;
 Thu, 29 Mar 2018 17:44:55 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803291744.w2THitKa025864@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Thu, 29 Mar 2018 17:44:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331740 - head
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: head
X-SVN-Commit-Revision: 331740
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 17:44:56 -0000

Author: brooks
Date: Thu Mar 29 17:44:55 2018
New Revision: 331740
URL: https://svnweb.freebsd.org/changeset/base/331740

Log:
  It is March not May.
  
  Reported by:	jkim

Modified:
  head/UPDATING

Modified: head/UPDATING
==============================================================================
--- head/UPDATING	Thu Mar 29 17:36:34 2018	(r331739)
+++ head/UPDATING	Thu Mar 29 17:44:55 2018	(r331740)
@@ -51,7 +51,7 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12.x IS SLOW:
 
 ****************************** SPECIAL WARNING: ******************************
 
-20180528:
+20180328:
 	Support for token ring networks has been removed. If you
 	have "device token" in your kernel config you should remove
 	it. No device drivers supported token ring.

From owner-svn-src-head@freebsd.org  Thu Mar 29 17:51:21 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 647CBF67857;
 Thu, 29 Mar 2018 17:51:21 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 107CD7AEBC;
 Thu, 29 Mar 2018 17:51:21 +0000 (UTC) (envelope-from jhb@freebsd.org)
Received: from ralph.baldwin.cx (ralph.baldwin.cx [66.234.199.215])
 by mail.baldwin.cx (Postfix) with ESMTPSA id 1395E10AFAD;
 Thu, 29 Mar 2018 13:51:20 -0400 (EDT)
From: John Baldwin 
To: Dimitry Andric 
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r331686 - head
Date: Thu, 29 Mar 2018 10:28:32 -0700
Message-ID: <2963143.tibTdn2gMF@ralph.baldwin.cx>
User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; )
In-Reply-To: <3653AD2C-F427-4BE7-874C-FF3AF3BDA85D@FreeBSD.org>
References: <201803281651.w2SGp59K069533@repo.freebsd.org>
 <3653AD2C-F427-4BE7-874C-FF3AF3BDA85D@FreeBSD.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3
 (mail.baldwin.cx); Thu, 29 Mar 2018 13:51:20 -0400 (EDT)
X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx
X-Virus-Status: Clean
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 17:51:21 -0000

On Wednesday, March 28, 2018 09:54:41 PM Dimitry Andric wrote:
> On 28 Mar 2018, at 18:51, John Baldwin  wrote:
> > 
> > Author: jhb
> > Date: Wed Mar 28 16:51:05 2018
> > New Revision: 331686
> > URL: https://svnweb.freebsd.org/changeset/base/331686
> > 
> > Log:
> >  Expand remaining instances of 'make kernel' to buildkernel + installkernel.
> > 
> >  The 'kernel' target is a bit more obscure compared to buildkernel and
> >  installkernel.
> 
> The 'kernel' target doesn't seem that obscure to me, it is clearly
> documented in build(7), right?  In my opinion, the main advantage of
> separate build and install steps is that you can run the former as a
> non-privileged user, while only having to run the latter as super-user.

I think it is still obscure even if in build(7).  That said, after I had
done the commit I had a similar thought that splitting up the build and
install steps is useful in its own right, whether that is due to doing
builds as unprivileged, or doing builds on one machine or installs on
another.

-- 
John Baldwin

From owner-svn-src-head@freebsd.org  Thu Mar 29 18:02:01 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41A3FF6897A
 for ;
 Thu, 29 Mar 2018 18:02:01 +0000 (UTC)
 (envelope-from wlosh@bsdimp.com)
Received: from mail-it0-x22d.google.com (mail-it0-x22d.google.com
 [IPv6:2607:f8b0:4001:c0b::22d])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id BDC617BB32
 for ; Thu, 29 Mar 2018 18:02:00 +0000 (UTC)
 (envelope-from wlosh@bsdimp.com)
Received: by mail-it0-x22d.google.com with SMTP id 19-v6so8882113itw.3
 for ; Thu, 29 Mar 2018 11:02:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=bsdimp-com.20150623.gappssmtp.com; s=20150623;
 h=mime-version:sender:in-reply-to:references:from:date:message-id
 :subject:to:cc;
 bh=tdlOqYEseDRDIIX+dfHOvfnLgy7FvAqzKilhnPCGeps=;
 b=smxNLzTT7vk8aAz9UUBSVIfFQxrLEOuQ++EBaA12S7QE23UcNAA+VGxf9fHP/5Utkn
 kBc8QJkWWP/RyNk3X4DrKtOvKPnueKrB2rlj5/kc66Q/i5m4JHlS9T6mDTwr2S6ub8BJ
 axFa/DDOncfcwd+9vhuYnkmfnex0yNgIdnASNlPIHI1N/8k7OQ4yrfjDYX8O6sS/5mGU
 KEY3Ebxj5utuvOngV6QvNQU30U2RmeULkPYCII6nJiPcD+WMNK8IJ59P49w2NEttxORA
 aj3qupgwZdOK8H5RO2VJEMEABcoS0sn3NK8XHo0UYruwWs47iqN0Nqk5Lht9WtCDj/WY
 /fQA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
 :date:message-id:subject:to:cc;
 bh=tdlOqYEseDRDIIX+dfHOvfnLgy7FvAqzKilhnPCGeps=;
 b=lDhu2kPtJJYg0hXNkpdWBiN7gtZFKSvh3SxQXs27gM8jvMLxbUz/Yb5UB4IPrBX79z
 1IlwPGSsrbgDKZbbesccDpqTXD1vGOAfGpNyp/tzQdHK7KZTr80igxZPkChvdMCSJmbp
 yCJg/TnW+R5fERL/hZ8I0TOpAcxqoIWiEdAPjPrOn5pbMFbWhsM/jNSEdDbWIe5WejHR
 V57ggvLv8bVsRkRzrXvMCtPabltD70yP/mIB78XdiG1PRha9cQ3uCHzpwyz9W8ylrK/L
 CxZAdm58a3xgzOBGctkcWq6S0+Cocazgnzgyx2aoyZciGhNmYdjAS1zEmm3JMtKamHEG
 pP5A==
X-Gm-Message-State: AElRT7ELK1preHb1NvoDEWpNHvKju+BzLbFGehY0qnkQztLtrWDs4byZ
 Hj0UJF9ExuA233XfB8YrjajqIW5VndOQXKJH1h05tg==
X-Google-Smtp-Source: AIpwx4/ksvoVKbjB1aoXG0bDGPQHs3PWH4ZGtOja8gSlgHUKBb0GomMVEtkgKSmQzZyszFAnnTIHensuI2mTaCRTQpw=
X-Received: by 2002:a24:4286:: with SMTP id
 i128-v6mr3676366itb.73.1522346520071; 
 Thu, 29 Mar 2018 11:02:00 -0700 (PDT)
MIME-Version: 1.0
Sender: wlosh@bsdimp.com
Received: by 10.79.203.196 with HTTP; Thu, 29 Mar 2018 11:01:59 -0700 (PDT)
X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d]
In-Reply-To: <2963143.tibTdn2gMF@ralph.baldwin.cx>
References: <201803281651.w2SGp59K069533@repo.freebsd.org>
 <3653AD2C-F427-4BE7-874C-FF3AF3BDA85D@FreeBSD.org>
 <2963143.tibTdn2gMF@ralph.baldwin.cx>
From: Warner Losh 
Date: Thu, 29 Mar 2018 12:01:59 -0600
X-Google-Sender-Auth: QbrIFjTqyrWm1F-TQ4vLc60J5fg
Message-ID: 
Subject: Re: svn commit: r331686 - head
To: John Baldwin 
Cc: Dimitry Andric ,
 src-committers , svn-src-all@freebsd.org, 
 svn-src-head@freebsd.org
Content-Type: text/plain; charset="UTF-8"
X-Content-Filtered-By: Mailman/MimeDel 2.1.25
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 18:02:01 -0000

On Thu, Mar 29, 2018 at 11:28 AM, John Baldwin  wrote:

> On Wednesday, March 28, 2018 09:54:41 PM Dimitry Andric wrote:
> > On 28 Mar 2018, at 18:51, John Baldwin  wrote:
> > >
> > > Author: jhb
> > > Date: Wed Mar 28 16:51:05 2018
> > > New Revision: 331686
> > > URL: https://svnweb.freebsd.org/changeset/base/331686
> > >
> > > Log:
> > >  Expand remaining instances of 'make kernel' to buildkernel +
> installkernel.
> > >
> > >  The 'kernel' target is a bit more obscure compared to buildkernel and
> > >  installkernel.
> >
> > The 'kernel' target doesn't seem that obscure to me, it is clearly
> > documented in build(7), right?  In my opinion, the main advantage of
> > separate build and install steps is that you can run the former as a
> > non-privileged user, while only having to run the latter as super-user.
>
> I think it is still obscure even if in build(7).  That said, after I had
> done the commit I had a similar thought that splitting up the build and
> install steps is useful in its own right, whether that is due to doing
> builds as unprivileged, or doing builds on one machine or installs on
> another.
>

Yea, I documented make kernel because it was fewer steps. I've used it 5
times in the last ~20 years or so since I did that. At the time, I think
there was material talking about 'make world' still, so this was there for
symmetry. Just like almost nobody uses make world today, almost nobody
users make kernel. It is correct, and it works, but times and fashion has
changed. We have a completely unpriv'd build now that needn't be in
/usr/src, something that wasn't the case when the 'world' and 'kernel'
targets were invented, IIRC.

I didn't make a fuss when UPDATING changed because of the un-priv'd build,
priv'd install separation that is so widely practiced, we barely need to
call it out in UPDATING. And that 'barely' is covered completely by the
commit to make this two steps.

I'd only add I'd keep it documented in build(7), just like we keep world
documented.

Warner

From owner-svn-src-head@freebsd.org  Thu Mar 29 19:43:30 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75DD7F70CB9;
 Thu, 29 Mar 2018 19:43:30 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 259C98032A;
 Thu, 29 Mar 2018 19:43:30 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 209011E764;
 Thu, 29 Mar 2018 19:43:30 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2TJhU0T087210;
 Thu, 29 Mar 2018 19:43:30 GMT (envelope-from kevans@FreeBSD.org)
Received: (from kevans@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2TJhUYp087209;
 Thu, 29 Mar 2018 19:43:30 GMT (envelope-from kevans@FreeBSD.org)
Message-Id: <201803291943.w2TJhUYp087209@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kevans set sender to
 kevans@FreeBSD.org using -f
From: Kyle Evans 
Date: Thu, 29 Mar 2018 19:43:30 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331743 - head/lib/libdl
X-SVN-Group: head
X-SVN-Commit-Author: kevans
X-SVN-Commit-Paths: head/lib/libdl
X-SVN-Commit-Revision: 331743
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 19:43:30 -0000

Author: kevans
Date: Thu Mar 29 19:43:29 2018
New Revision: 331743
URL: https://svnweb.freebsd.org/changeset/base/331743

Log:
  Add libdl to clibs package
  
  libdl is a filter on libc, and pretty lightweight. Add it to the 'clibs'
  package with libc, effectively tying them together in a pkgbase world.
  
  Reviewed by:	gjb
  MFC after:	3 days
  Differential Revision:	https://reviews.freebsd.org/D13997

Modified:
  head/lib/libdl/Makefile

Modified: head/lib/libdl/Makefile
==============================================================================
--- head/lib/libdl/Makefile	Thu Mar 29 19:32:25 2018	(r331742)
+++ head/lib/libdl/Makefile	Thu Mar 29 19:43:29 2018	(r331743)
@@ -1,5 +1,6 @@
 # $FreeBSD$
 
+PACKAGE=clibs
 LIB=dl
 SHLIB_MAJOR=1
 

From owner-svn-src-head@freebsd.org  Thu Mar 29 19:44:17 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B3DCF70D78;
 Thu, 29 Mar 2018 19:44:17 +0000 (UTC)
 (envelope-from landonf@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id EF9A6804C5;
 Thu, 29 Mar 2018 19:44:16 +0000 (UTC)
 (envelope-from landonf@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA5271E770;
 Thu, 29 Mar 2018 19:44:16 +0000 (UTC)
 (envelope-from landonf@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2TJiGOO087309;
 Thu, 29 Mar 2018 19:44:16 GMT (envelope-from landonf@FreeBSD.org)
Received: (from landonf@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2TJiGi0087300;
 Thu, 29 Mar 2018 19:44:16 GMT (envelope-from landonf@FreeBSD.org)
Message-Id: <201803291944.w2TJiGi0087300@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: landonf set sender to
 landonf@FreeBSD.org using -f
From: "Landon J. Fuller" 
Date: Thu, 29 Mar 2018 19:44:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331744 - in head: share/man/man9 sys/dev/bhnd
 sys/dev/bhnd/bcma sys/dev/bhnd/bhndb sys/dev/bhnd/siba
X-SVN-Group: head
X-SVN-Commit-Author: landonf
X-SVN-Commit-Paths: in head: share/man/man9 sys/dev/bhnd sys/dev/bhnd/bcma
 sys/dev/bhnd/bhndb sys/dev/bhnd/siba
X-SVN-Commit-Revision: 331744
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 19:44:17 -0000

Author: landonf
Date: Thu Mar 29 19:44:15 2018
New Revision: 331744
URL: https://svnweb.freebsd.org/changeset/base/331744

Log:
  bhnd(4): include a subset of the ChipCommon capability flags in bhnd_chipid;
  this provides early access to device capability flags required by bhnd(4)
  bus and bhndb(4) bridge drivers.

Modified:
  head/share/man/man9/bhnd.9
  head/sys/dev/bhnd/bcma/bcma_erom.c
  head/sys/dev/bhnd/bhnd.h
  head/sys/dev/bhnd/bhnd_erom.c
  head/sys/dev/bhnd/bhnd_erom.h
  head/sys/dev/bhnd/bhnd_eromvar.h
  head/sys/dev/bhnd/bhnd_subr.c
  head/sys/dev/bhnd/bhndb/bhndb_pci.c
  head/sys/dev/bhnd/siba/siba_erom.c

Modified: head/share/man/man9/bhnd.9
==============================================================================
--- head/share/man/man9/bhnd.9	Thu Mar 29 19:43:29 2018	(r331743)
+++ head/share/man/man9/bhnd.9	Thu Mar 29 19:44:15 2018	(r331744)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 19, 2018
+.Dd March 26, 2018
 .Dt BHND 9
 .Os
 .Sh NAME
@@ -1130,6 +1130,10 @@ chip, each of which may require driver workarounds for
 unpopulated components, etc.
 .It Fa chip_type
 The interconnect architecture used by this chip.
+.It Fa chip_caps
+The
+.Nm
+capability flags supported by this chip.
 .It Fa enum_addr
 The backplane enumeration address.
 On SSB devices, this will be the base address of the first SSB core.
@@ -1154,6 +1158,16 @@ This BCMA-derived interconnect is found in Broadcom BC
 BCM63xx xDSL SoCs.
 UBUS is not currently supported by
 .Xr bhnd 4 .
+.El
+.Pp
+The following
+.Fa chip_caps
+flags are supported:
+.Bl -tag -width ".Dv BHND_CAP_BP64" -offset indent -compact
+.It Dv BHND_CAP_BP64
+The backplane supports 64-bit addressing.
+.It Dv BHND_CAP_PMU
+PMU is present.
 .El
 .Pp
 Additional symbolic constants for known

Modified: head/sys/dev/bhnd/bcma/bcma_erom.c
==============================================================================
--- head/sys/dev/bhnd/bcma/bcma_erom.c	Thu Mar 29 19:43:29 2018	(r331743)
+++ head/sys/dev/bhnd/bcma/bcma_erom.c	Thu Mar 29 19:44:15 2018	(r331744)
@@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
-#include 
+#include 
 
 #include "bcma_eromreg.h"
 #include "bcma_eromvar.h"
@@ -168,23 +168,16 @@ static int
 bcma_erom_probe(bhnd_erom_class_t *cls, struct bhnd_erom_io *eio,
     const struct bhnd_chipid *hint, struct bhnd_chipid *cid)
 {
-	uint32_t idreg, eromptr;
+	int error;
 
 	/* Hints aren't supported; all BCMA devices have a ChipCommon
 	 * core */
 	if (hint != NULL)
 		return (EINVAL);
 
-	/* Confirm CHIPC_EROMPTR availability */	
-	idreg = bhnd_erom_io_read(eio, CHIPC_ID, 4);
-	if (!BHND_CHIPTYPE_HAS_EROM(CHIPC_GET_BITS(idreg, CHIPC_ID_BUS)))
-		return (ENXIO);
-
-	/* Fetch EROM address */
-	eromptr = bhnd_erom_io_read(eio, CHIPC_EROMPTR, 4);
-
-	/* Parse chip identifier */
-	*cid = bhnd_parse_chipid(idreg, eromptr);
+	/* Read and parse chip identification */
+	if ((error = bhnd_erom_read_chipid(eio, cid)))
+		return (error);
 
 	/* Verify chip type */
 	switch (cid->chip_type) {

Modified: head/sys/dev/bhnd/bhnd.h
==============================================================================
--- head/sys/dev/bhnd/bhnd.h	Thu Mar 29 19:43:29 2018	(r331743)
+++ head/sys/dev/bhnd/bhnd.h	Thu Mar 29 19:44:15 2018	(r331744)
@@ -219,6 +219,7 @@ struct bhnd_chipid {
 	uint8_t		chip_rev;	/**< chip revision */
 	uint8_t		chip_pkg;	/**< chip package (BHND_PKGID_*) */
 	uint8_t		chip_type;	/**< chip type (BHND_CHIPTYPE_*) */
+	uint32_t	chip_caps;	/**< chip capabilities (BHND_CAP_*) */
 
 	bhnd_addr_t	enum_addr;	/**< chip_type-specific enumeration
 					  *  address; either the siba(4) base
@@ -230,6 +231,15 @@ struct bhnd_chipid {
 };
 
 /**
+ * Chip capabilities
+ */
+enum bhnd_cap {
+	BHND_CAP_BP64	= (1<<0),	/**< Backplane supports 64-bit
+					  *  addressing */
+	BHND_CAP_PMU	= (1<<1),	/**< PMU is present */
+};
+
+/**
  * A bhnd(4) core descriptor.
  */
 struct bhnd_core_info {
@@ -519,18 +529,6 @@ int				 bhnd_alloc_resources(device_t dev,
 void				 bhnd_release_resources(device_t dev,
 				     const struct resource_spec *rs,
 				     struct bhnd_resource **res);
-
-struct bhnd_chipid		 bhnd_parse_chipid(uint32_t idreg,
-				     bhnd_addr_t enum_addr);
-
-int				 bhnd_chipid_fixed_ncores(
-				     const struct bhnd_chipid *cid,
-				     uint16_t chipc_hwrev, uint8_t *ncores);
-
-int				 bhnd_read_chipid(device_t dev,
-				     struct resource_spec *rs,
-				     bus_size_t chipc_offset,
-				     struct bhnd_chipid *result);
 
 void				 bhnd_set_custom_core_desc(device_t dev,
 				     const char *name);

Modified: head/sys/dev/bhnd/bhnd_erom.c
==============================================================================
--- head/sys/dev/bhnd/bhnd_erom.c	Thu Mar 29 19:43:29 2018	(r331743)
+++ head/sys/dev/bhnd/bhnd_erom.c	Thu Mar 29 19:44:15 2018	(r331744)
@@ -44,18 +44,26 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
 #include 
+
 #include 
 #include 
 
+#include 
+
 static int	bhnd_erom_iores_map(struct bhnd_erom_io *eio, bhnd_addr_t addr,
 		    bhnd_size_t size);
+static int	bhnd_erom_iores_tell(struct bhnd_erom_io *eio,
+		    bhnd_addr_t *addr, bhnd_size_t *size);
 static uint32_t	bhnd_erom_iores_read(struct bhnd_erom_io *eio,
 		    bhnd_size_t offset, u_int width);
 static void	bhnd_erom_iores_fini(struct bhnd_erom_io *eio);
 
 static int	bhnd_erom_iobus_map(struct bhnd_erom_io *eio, bhnd_addr_t addr,
 		    bhnd_size_t size);
+static int	bhnd_erom_iobus_tell(struct bhnd_erom_io *eio,
+		    bhnd_addr_t *addr, bhnd_size_t *size);
 static uint32_t	bhnd_erom_iobus_read(struct bhnd_erom_io *eio,
 		    bhnd_size_t offset, u_int width);
 
@@ -248,7 +256,63 @@ bhnd_erom_free(bhnd_erom_t *erom)
 	kobj_delete((kobj_t)erom, M_BHND);
 }
 
+/**
+ * Read the chip identification registers mapped by @p eio, popuating @p cid
+ * with the parsed result
+ * 
+ * @param	eio		A bus I/O instance, configured with a mapping
+ *				of the ChipCommon core.
+ * @param[out]	cid		On success, the parsed chip identification.
+ *
+ * @warning
+ * On early siba(4) devices, the ChipCommon core does not provide
+ * a valid CHIPC_ID_NUMCORE field. On these ChipCommon revisions
+ * (see CHIPC_NCORES_MIN_HWREV()), this function will parse and return
+ * an invalid `ncores` value.
+ */
+int
+bhnd_erom_read_chipid(struct bhnd_erom_io *eio, struct bhnd_chipid *cid)
+{
+	bhnd_addr_t	cc_addr;
+	bhnd_size_t	cc_size;
+	uint32_t	idreg, cc_caps;
+	int		error;
 
+	/* Fetch ChipCommon address */
+	if ((error = bhnd_erom_io_tell(eio, &cc_addr, &cc_size)))
+		return (error);
+
+	/* Read chip identifier */
+	idreg = bhnd_erom_io_read(eio, CHIPC_ID, 4);
+
+	/* Extract the basic chip info */
+	cid->chip_id = CHIPC_GET_BITS(idreg, CHIPC_ID_CHIP);
+	cid->chip_pkg = CHIPC_GET_BITS(idreg, CHIPC_ID_PKG);
+	cid->chip_rev = CHIPC_GET_BITS(idreg, CHIPC_ID_REV);
+	cid->chip_type = CHIPC_GET_BITS(idreg, CHIPC_ID_BUS);
+	cid->ncores = CHIPC_GET_BITS(idreg, CHIPC_ID_NUMCORE);
+
+	/* Populate EROM address */
+	if (BHND_CHIPTYPE_HAS_EROM(cid->chip_type)) {
+		cid->enum_addr = bhnd_erom_io_read(eio, CHIPC_EROMPTR, 4);
+	} else {
+		cid->enum_addr = cc_addr;
+	}
+
+	/* Populate capability flags */
+	cc_caps = bhnd_erom_io_read(eio, CHIPC_CAPABILITIES, 4);
+	cid->chip_caps = 0x0;
+
+	if (cc_caps & CHIPC_CAP_BKPLN64)
+		cid->chip_caps |= BHND_CAP_BP64;
+
+	if (cc_caps & CHIPC_CAP_PMU)
+		cid->chip_caps |= BHND_CAP_PMU;
+
+	return (0);
+}
+
+
 /**
  * Attempt to map @p size bytes at @p addr, replacing any existing
  * @p eio mapping.
@@ -268,6 +332,23 @@ bhnd_erom_io_map(struct bhnd_erom_io *eio, bhnd_addr_t
 }
 
 /**
+ * Return the address range mapped by @p eio, if any.
+ * 
+ * @param	eio	I/O instance state.
+ * @param[out]	addr	The address mapped by @p eio.
+ * @param[out]	size	The number of bytes mapped at @p addr.
+ * 
+ * @retval	0	success
+ * @retval	ENXIO	if @p eio has no mapping.
+ */
+int
+bhnd_erom_io_tell(struct bhnd_erom_io *eio, bhnd_addr_t *addr,
+    bhnd_size_t *size)
+{
+	return (eio->tell(eio, addr, size));
+}
+
+/**
  * Read a 1, 2, or 4 byte data item from @p eio, at the given @p offset
  * relative to @p eio's current mapping.
  * 
@@ -306,6 +387,7 @@ bhnd_erom_iores_new(device_t dev, int rid)
 
 	iores = malloc(sizeof(*iores), M_BHND, M_WAITOK | M_ZERO);
 	iores->eio.map = bhnd_erom_iores_map;
+	iores->eio.tell = bhnd_erom_iores_tell;
 	iores->eio.read = bhnd_erom_iores_read;
 	iores->eio.fini = bhnd_erom_iores_fini;
 
@@ -361,6 +443,21 @@ bhnd_erom_iores_map(struct bhnd_erom_io *eio, bhnd_add
 	return (0);
 }
 
+static int
+bhnd_erom_iores_tell(struct bhnd_erom_io *eio, bhnd_addr_t *addr,
+    bhnd_size_t *size)
+{
+	struct bhnd_erom_iores *iores = (struct bhnd_erom_iores *)eio;
+
+	if (iores->mapped == NULL)
+		return (ENXIO);
+
+	*addr = rman_get_start(iores->mapped->res);
+	*size = rman_get_size(iores->mapped->res);
+
+	return (0);
+}
+
 static uint32_t
 bhnd_erom_iores_read(struct bhnd_erom_io *eio, bhnd_size_t offset, u_int width)
 {
@@ -416,6 +513,7 @@ bhnd_erom_iobus_init(struct bhnd_erom_iobus *iobus, bh
     bhnd_size_t size, bus_space_tag_t bst, bus_space_handle_t bsh)
 {
 	iobus->eio.map = bhnd_erom_iobus_map;
+	iobus->eio.tell = bhnd_erom_iobus_tell;
 	iobus->eio.read = bhnd_erom_iobus_read;
 	iobus->eio.fini = NULL;
 
@@ -459,6 +557,21 @@ bhnd_erom_iobus_map(struct bhnd_erom_io *eio, bhnd_add
 	iobus->offset = addr - iobus->addr;
 	iobus->limit = size;
 	iobus->mapped = true;
+
+	return (0);
+}
+
+static int
+bhnd_erom_iobus_tell(struct bhnd_erom_io *eio, bhnd_addr_t *addr,
+    bhnd_size_t *size)
+{
+	struct bhnd_erom_iobus *iobus = (struct bhnd_erom_iobus *)eio;
+
+	if (!iobus->mapped)
+		return (ENXIO);
+
+	*addr = iobus->addr + iobus->offset;
+	*size = iobus->limit;
 
 	return (0);
 }

Modified: head/sys/dev/bhnd/bhnd_erom.h
==============================================================================
--- head/sys/dev/bhnd/bhnd_erom.h	Thu Mar 29 19:43:29 2018	(r331743)
+++ head/sys/dev/bhnd/bhnd_erom.h	Thu Mar 29 19:44:15 2018	(r331744)
@@ -76,6 +76,8 @@ int			 bhnd_erom_iobus_init(struct bhnd_erom_iobus *io
 
 int			 bhnd_erom_io_map(struct bhnd_erom_io *eio,
 			     bhnd_addr_t addr, bhnd_size_t size);
+int			 bhnd_erom_io_tell(struct bhnd_erom_io *eio,
+			     bhnd_addr_t *addr, bhnd_size_t *size);
 uint32_t		 bhnd_erom_io_read(struct bhnd_erom_io *eio,
 			     bhnd_size_t offset, u_int width);
 void			 bhnd_erom_io_fini(struct bhnd_erom_io *eio);

Modified: head/sys/dev/bhnd/bhnd_eromvar.h
==============================================================================
--- head/sys/dev/bhnd/bhnd_eromvar.h	Thu Mar 29 19:43:29 2018	(r331743)
+++ head/sys/dev/bhnd/bhnd_eromvar.h	Thu Mar 29 19:44:15 2018	(r331744)
@@ -48,6 +48,10 @@ struct bhnd_erom_iobus;
 typedef int		(bhnd_erom_io_map_t)(struct bhnd_erom_io *eio,
 			     bhnd_addr_t addr, bhnd_size_t size);
 
+/** @see bhnd_erom_io_tell() */
+typedef int		(bhnd_erom_io_tell_t)(struct bhnd_erom_io *eio,
+			     bhnd_addr_t *addr, bhnd_size_t *size);
+
 /** @see bhnd_erom_io_read() */
 typedef uint32_t	(bhnd_erom_io_read_t)(struct bhnd_erom_io *eio,
 			     bhnd_size_t offset, u_int width);
@@ -55,11 +59,17 @@ typedef uint32_t	(bhnd_erom_io_read_t)(struct bhnd_ero
 /** @see bhnd_erom_io_fini() */
 typedef void		(bhnd_erom_io_fini_t)(struct bhnd_erom_io *eio);
 
+
+int			 bhnd_erom_read_chipid(struct bhnd_erom_io *eio,
+			     struct bhnd_chipid *cid);
+
+
 /**
  * Abstract EROM bus I/O support.
  */
 struct bhnd_erom_io {
 	bhnd_erom_io_map_t	*map;	/**< @see bhnd_erom_io_map() */
+	bhnd_erom_io_tell_t	*tell;	/**< @see bhnd_erom_io_tell() */
 	bhnd_erom_io_read_t	*read;	/**< @see bhnd_erom_io_read() */
 	bhnd_erom_io_fini_t	*fini;	/**< @see bhnd_erom_io_fini(). May be NULL */
 };

Modified: head/sys/dev/bhnd/bhnd_subr.c
==============================================================================
--- head/sys/dev/bhnd/bhnd_subr.c	Thu Mar 29 19:43:29 2018	(r331743)
+++ head/sys/dev/bhnd/bhnd_subr.c	Thu Mar 29 19:44:15 2018	(r331744)
@@ -1057,174 +1057,6 @@ bhnd_release_resources(device_t dev, const struct reso
 }
 
 /**
- * Parse the CHIPC_ID_* fields from the ChipCommon CHIPC_ID
- * register, returning its bhnd_chipid representation.
- * 
- * @param idreg The CHIPC_ID register value.
- * @param enum_addr The enumeration address to include in the result.
- *
- * @warning
- * On early siba(4) devices, the ChipCommon core does not provide
- * a valid CHIPC_ID_NUMCORE field. On these ChipCommon revisions
- * (see CHIPC_NCORES_MIN_HWREV()), this function will parse and return
- * an invalid `ncores` value.
- */
-struct bhnd_chipid
-bhnd_parse_chipid(uint32_t idreg, bhnd_addr_t enum_addr)
-{
-	struct bhnd_chipid result;
-
-	/* Fetch the basic chip info */
-	result.chip_id = CHIPC_GET_BITS(idreg, CHIPC_ID_CHIP);
-	result.chip_pkg = CHIPC_GET_BITS(idreg, CHIPC_ID_PKG);
-	result.chip_rev = CHIPC_GET_BITS(idreg, CHIPC_ID_REV);
-	result.chip_type = CHIPC_GET_BITS(idreg, CHIPC_ID_BUS);
-	result.ncores = CHIPC_GET_BITS(idreg, CHIPC_ID_NUMCORE);
-
-	result.enum_addr = enum_addr;
-
-	return (result);
-}
-
-
-/**
- * Determine the correct core count for a chip identification value that
- * may contain an invalid core count.
- * 
- * On some early siba(4) devices (see CHIPC_NCORES_MIN_HWREV()), the ChipCommon
- * core does not provide a valid CHIPC_ID_NUMCORE field.
- * 
- * @param cid The chip identification to be queried.
- * @param chipc_hwrev The hardware revision of the ChipCommon core from which
- * @p cid was parsed.
- * @param[out] ncores On success, will be set to the correct core count.
- * 
- * @retval 0 If the core count is already correct, or was mapped to a
- * a correct value.
- * @retval EINVAL If the core count is incorrect, but the chip was not
- * recognized.
- */
-int
-bhnd_chipid_fixed_ncores(const struct bhnd_chipid *cid, uint16_t chipc_hwrev,
-    uint8_t *ncores)
-{
-	/* bcma(4), and most siba(4) devices */
-	if (CHIPC_NCORES_MIN_HWREV(chipc_hwrev)) {
-		*ncores = cid->ncores;
-		return (0);
-	}
-
-	/* broken siba(4) chipsets */
-	switch (cid->chip_id) {
-	case BHND_CHIPID_BCM4306:
-		*ncores = 6;
-		break;
-	case BHND_CHIPID_BCM4704:
-		*ncores = 9;
-		break;
-	case BHND_CHIPID_BCM5365:
-		/*
-		* BCM5365 does support ID_NUMCORE in at least
-		* some of its revisions, but for unknown
-		* reasons, Broadcom's drivers always exclude
-		* the ChipCommon revision (0x5) used by BCM5365
-		* from the set of revisions supporting
-		* ID_NUMCORE, and instead supply a fixed value.
-		* 
-		* Presumably, at least some of these devices
-		* shipped with a broken ID_NUMCORE value.
-		*/
-		*ncores = 7;
-		break;
-	default:
-		return (EINVAL);
-	}
-
-	return (0);
-}
-
-/**
- * Allocate the resource defined by @p rs via @p dev, use it
- * to read the ChipCommon ID register relative to @p chipc_offset,
- * then release the resource.
- * 
- * @param dev The device owning @p rs.
- * @param rs A resource spec that encompasses the ChipCommon register block.
- * @param chipc_offset The offset of the ChipCommon registers within @p rs.
- * @param[out] result The chip identification data.
- * 
- * @retval 0 success
- * @retval non-zero if the ChipCommon identification data could not be read.
- */
-int
-bhnd_read_chipid(device_t dev, struct resource_spec *rs,
-    bus_size_t chipc_offset, struct bhnd_chipid *result)
-{
-	struct resource			*res;
-	bhnd_addr_t			 enum_addr;
-	uint32_t			 reg;
-	uint8_t				 chip_type;
-	int				 error, rid, rtype;
-
-	rid = rs->rid;
-	rtype = rs->type;
-	error = 0;
-
-	/* Allocate the ChipCommon window resource and fetch the chipid data */
-	res = bus_alloc_resource_any(dev, rtype, &rid, RF_ACTIVE);
-	if (res == NULL) {
-		device_printf(dev,
-		    "failed to allocate bhnd chipc resource\n");
-		return (ENXIO);
-	}
-
-	/* Fetch the basic chip info */
-	reg = bus_read_4(res, chipc_offset + CHIPC_ID);
-	chip_type = CHIPC_GET_BITS(reg, CHIPC_ID_BUS);
-
-	/* Fetch the EROMPTR */
-	if (BHND_CHIPTYPE_HAS_EROM(chip_type)) {
-		enum_addr = bus_read_4(res, chipc_offset + CHIPC_EROMPTR);
-	} else if (chip_type == BHND_CHIPTYPE_SIBA) {
-		/* siba(4) uses the ChipCommon base address as the enumeration
-		 * address */
-		enum_addr = BHND_DEFAULT_CHIPC_ADDR;
-	} else {
-		device_printf(dev, "unknown chip type %hhu\n", chip_type);
-		error = ENODEV;
-		goto cleanup;
-	}
-
-	*result = bhnd_parse_chipid(reg, enum_addr);
-
-	/* Fix the core count on early siba(4) devices */
-	if (chip_type == BHND_CHIPTYPE_SIBA) {
-		uint32_t	idh;
-		uint16_t	chipc_hwrev;
-
-		/* 
-		 * We need the ChipCommon revision to determine whether
-		 * the ncore field is valid.
-		 * 
-		 * We can safely assume the siba IDHIGH register is mapped
-		 * within the chipc register block.
-		 */
-		idh = bus_read_4(res, SB0_REG_ABS(SIBA_CFG0_IDHIGH));
-		chipc_hwrev = SIBA_IDH_CORE_REV(idh);
-
-		error = bhnd_chipid_fixed_ncores(result, chipc_hwrev,
-		    &result->ncores);
-		if (error)
-			goto cleanup;
-	}
-
-cleanup:
-	/* Clean up */
-	bus_release_resource(dev, rtype, rid, res);
-	return (error);
-}
-
-/**
  * Allocate and return a new per-core PMU clock control/status (clkctl)
  * instance for @p dev.
  * 

Modified: head/sys/dev/bhnd/bhndb/bhndb_pci.c
==============================================================================
--- head/sys/dev/bhnd/bhndb/bhndb_pci.c	Thu Mar 29 19:43:29 2018	(r331743)
+++ head/sys/dev/bhnd/bhndb/bhndb_pci.c	Thu Mar 29 19:44:15 2018	(r331744)
@@ -125,6 +125,8 @@ static void		bhndb_pci_eio_init(struct bhndb_pci_eio *
 			    struct bhndb_pci_probe *probe);
 static int		bhndb_pci_eio_map(struct bhnd_erom_io *eio,
 			    bhnd_addr_t addr, bhnd_size_t size);
+static int		bhndb_pci_eio_tell(struct bhnd_erom_io *eio,
+			    bhnd_addr_t *addr, bhnd_size_t *size);
 static uint32_t		bhndb_pci_eio_read(struct bhnd_erom_io *eio,
 			    bhnd_size_t offset, u_int width);
 
@@ -144,6 +146,7 @@ static struct bhndb_pci_core bhndb_pci_cores[] = {
 /* bhndb_pci erom I/O instance state */
 struct bhndb_pci_eio {
 	struct bhnd_erom_io		 eio;
+	bool				 mapped;	/**< true if a valid mapping exists */
 	bhnd_addr_t			 addr;		/**< mapped address */
 	bhnd_size_t			 size;		/**< mapped size */
 	struct bhndb_pci_probe		*probe;		/**< borrowed probe reference */
@@ -1667,9 +1670,11 @@ bhndb_pci_eio_init(struct bhndb_pci_eio *pio, struct b
 	memset(pio, 0, sizeof(*pio));
 
 	pio->eio.map = bhndb_pci_eio_map;
+	pio->eio.tell = bhndb_pci_eio_tell;
 	pio->eio.read = bhndb_pci_eio_read;
 	pio->eio.fini = NULL;
 
+	pio->mapped = false;
 	pio->addr = 0;
 	pio->size = 0;
 	pio->probe = probe;
@@ -1687,22 +1692,43 @@ bhndb_pci_eio_map(struct bhnd_erom_io *eio, bhnd_addr_
 
 	pio->addr = addr;
 	pio->size = size;
+	pio->mapped = true;
 
 	return (0);
 }
 
+/* bhnd_erom_io_tell() implementation */
+static int
+bhndb_pci_eio_tell(struct bhnd_erom_io *eio, bhnd_addr_t *addr,
+    bhnd_size_t *size)
+{
+	struct bhndb_pci_eio *pio = (struct bhndb_pci_eio *)eio;
+
+	if (!pio->mapped)
+		return (ENXIO);
+
+	*addr = pio->addr;
+	*size = pio->size;
+
+	return (0);
+}
+
 /* bhnd_erom_io_read() implementation */
 static uint32_t
 bhndb_pci_eio_read(struct bhnd_erom_io *eio, bhnd_size_t offset, u_int width)
 {
 	struct bhndb_pci_eio *pio = (struct bhndb_pci_eio *)eio;
 
+	/* Must have a valid mapping */
+	if (!pio->mapped) 
+		panic("no active mapping");
+
 	/* The requested subrange must fall within the existing mapped range */
 	if (offset > pio->size ||
 	    width > pio->size ||
 	    pio->size - offset < width)
 	{
-		return (ENXIO);
+		panic("invalid offset %#jx", offset);
 	}
 
 	return (bhndb_pci_probe_read(pio->probe, pio->addr, offset, width));

Modified: head/sys/dev/bhnd/siba/siba_erom.c
==============================================================================
--- head/sys/dev/bhnd/siba/siba_erom.c	Thu Mar 29 19:43:29 2018	(r331743)
+++ head/sys/dev/bhnd/siba/siba_erom.c	Thu Mar 29 19:44:15 2018	(r331744)
@@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
+#include 
 
 #include 
 
@@ -390,7 +390,6 @@ siba_eio_read_chipid(struct siba_erom_io *io, bus_addr
     struct bhnd_chipid *cid)
 {
 	struct siba_core_id	ccid;
-	uint32_t		idreg;
 	int			error;
 
 	/* Identify the chipcommon core */
@@ -409,12 +408,39 @@ siba_eio_read_chipid(struct siba_erom_io *io, bus_addr
 	}
 
 	/* Identify the chipset */
-	idreg = siba_eio_read_4(io, 0, CHIPC_ID);
-	*cid = bhnd_parse_chipid(idreg, enum_addr);
+	if ((error = bhnd_erom_read_chipid(io->eio, cid)))
+		return (error);
 
-	/* Fix up the core count in-place */
-	return (bhnd_chipid_fixed_ncores(cid, ccid.core_info.hwrev,
-	    &cid->ncores));
+	/* Do we need to fix up the core count? */
+	if (CHIPC_NCORES_MIN_HWREV(ccid.core_info.hwrev))
+		return (0);
+
+	switch (cid->chip_id) {
+	case BHND_CHIPID_BCM4306:
+		cid->ncores = 6;
+		break;
+	case BHND_CHIPID_BCM4704:
+		cid->ncores = 9;
+		break;
+	case BHND_CHIPID_BCM5365:
+		/*
+		* BCM5365 does support ID_NUMCORE in at least
+		* some of its revisions, but for unknown
+		* reasons, Broadcom's drivers always exclude
+		* the ChipCommon revision (0x5) used by BCM5365
+		* from the set of revisions supporting
+		* ID_NUMCORE, and instead supply a fixed value.
+		* 
+		* Presumably, at least some of these devices
+		* shipped with a broken ID_NUMCORE value.
+		*/
+		cid->ncores = 7;
+		break;
+	default:
+		return (EINVAL);
+	}
+
+	return (0);
 }
 
 static int

From owner-svn-src-head@freebsd.org  Thu Mar 29 19:48:18 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87882F71213;
 Thu, 29 Mar 2018 19:48:18 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3B72D80823;
 Thu, 29 Mar 2018 19:48:18 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 363551E778;
 Thu, 29 Mar 2018 19:48:18 +0000 (UTC) (envelope-from np@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2TJmHbA087614;
 Thu, 29 Mar 2018 19:48:17 GMT (envelope-from np@FreeBSD.org)
Received: (from np@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2TJmHQb087613;
 Thu, 29 Mar 2018 19:48:17 GMT (envelope-from np@FreeBSD.org)
Message-Id: <201803291948.w2TJmHQb087613@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org
 using -f
From: Navdeep Parhar 
Date: Thu, 29 Mar 2018 19:48:17 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331745 - head/sys/netinet
X-SVN-Group: head
X-SVN-Commit-Author: np
X-SVN-Commit-Paths: head/sys/netinet
X-SVN-Commit-Revision: 331745
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 19:48:18 -0000

Author: np
Date: Thu Mar 29 19:48:17 2018
New Revision: 331745
URL: https://svnweb.freebsd.org/changeset/base/331745

Log:
  Fix RSS build (broken in r331309).
  
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/netinet/in_pcb.c

Modified: head/sys/netinet/in_pcb.c
==============================================================================
--- head/sys/netinet/in_pcb.c	Thu Mar 29 19:44:15 2018	(r331744)
+++ head/sys/netinet/in_pcb.c	Thu Mar 29 19:48:17 2018	(r331745)
@@ -1820,9 +1820,9 @@ in_pcblookup_group(struct inpcbinfo *pcbinfo, struct i
 
 found:
 	if (lookupflags & INPLOOKUP_WLOCKPCB)
-		locked = TRY_INP_WLOCK(inp);
+		locked = INP_TRY_WLOCK(inp);
 	else if (lookupflags & INPLOOKUP_RLOCKPCB)
-		locked = TRY_INP_RLOCK(inp);
+		locked = INP_TRY_RLOCK(inp);
 	else
 		panic("%s: locking bug", __func__);
 	if (!locked)

From owner-svn-src-head@freebsd.org  Thu Mar 29 19:48:51 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 701CBF712F6;
 Thu, 29 Mar 2018 19:48:51 +0000 (UTC)
 (envelope-from landonf@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 2129680998;
 Thu, 29 Mar 2018 19:48:51 +0000 (UTC)
 (envelope-from landonf@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C0361E77C;
 Thu, 29 Mar 2018 19:48:51 +0000 (UTC)
 (envelope-from landonf@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2TJmoTu087680;
 Thu, 29 Mar 2018 19:48:50 GMT (envelope-from landonf@FreeBSD.org)
Received: (from landonf@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2TJmogQ087678;
 Thu, 29 Mar 2018 19:48:50 GMT (envelope-from landonf@FreeBSD.org)
Message-Id: <201803291948.w2TJmogQ087678@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: landonf set sender to
 landonf@FreeBSD.org using -f
From: "Landon J. Fuller" 
Date: Thu, 29 Mar 2018 19:48:50 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331746 - in head/sys: dev/bhnd/bhndb mips/broadcom
X-SVN-Group: head
X-SVN-Commit-Author: landonf
X-SVN-Commit-Paths: in head/sys: dev/bhnd/bhndb mips/broadcom
X-SVN-Commit-Revision: 331746
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 19:48:51 -0000

Author: landonf
Date: Thu Mar 29 19:48:50 2018
New Revision: 331746
URL: https://svnweb.freebsd.org/changeset/base/331746

Log:
  bhnd(4): Use the new BHND_CAP_BP64 capability flag to exclude DMA
  translations unsupported by the backplane.

Modified:
  head/sys/dev/bhnd/bhndb/bhndb.c
  head/sys/mips/broadcom/bhnd_nexus.c

Modified: head/sys/dev/bhnd/bhndb/bhndb.c
==============================================================================
--- head/sys/dev/bhnd/bhndb/bhndb.c	Thu Mar 29 19:48:17 2018	(r331745)
+++ head/sys/dev/bhnd/bhndb/bhndb.c	Thu Mar 29 19:48:50 2018	(r331746)
@@ -2128,7 +2128,14 @@ bhndb_get_dma_translation(device_t dev, device_t child
 	if (sc->bus_res->res->dma_tags == NULL)
 		return (ENODEV);
 
-	/* Find the best matching descriptor for the requested type */
+	/* Is the requested width supported? */
+	if (width > BHND_DMA_ADDR_32BIT) {
+		/* Backplane must support 64-bit addressing */
+		if (!(sc->chipid.chip_caps & BHND_CAP_BP64))
+			width = BHND_DMA_ADDR_32BIT;
+	}
+
+	/* Find the best matching descriptor for the requested width */
 	addr_mask = BHND_DMA_ADDR_BITMASK(width);
 
 	match = NULL;

Modified: head/sys/mips/broadcom/bhnd_nexus.c
==============================================================================
--- head/sys/mips/broadcom/bhnd_nexus.c	Thu Mar 29 19:48:17 2018	(r331745)
+++ head/sys/mips/broadcom/bhnd_nexus.c	Thu Mar 29 19:48:50 2018	(r331746)
@@ -234,10 +234,11 @@ bhnd_nexus_get_dma_translation(device_t dev, device_t 
 	KASSERT(width > 0 && width <= BHND_DMA_ADDR_64BIT,
 	    ("invalid width %u", width));
 
+	/* Is the requested width supported? */
 	if (width > BHND_DMA_ADDR_32BIT) {
 		/* Backplane must support 64-bit addressing */
-		if (!(bp->cc_caps & CHIPC_CAP_BKPLN64))
-			return (ENOENT);
+		if (!(bp->cid.chip_caps & BHND_CAP_BP64))
+			width = BHND_DMA_ADDR_32BIT;
 	}
 
 	/* No DMA address translation required */

From owner-svn-src-head@freebsd.org  Thu Mar 29 23:10:26 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02516F52C4F;
 Thu, 29 Mar 2018 23:10:26 +0000 (UTC)
 (envelope-from bzeeb-lists@lists.zabbadoz.net)
Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90])
 (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
 (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified))
 by mx1.freebsd.org (Postfix) with ESMTPS id B468A69CC5;
 Thu, 29 Mar 2018 23:10:25 +0000 (UTC)
 (envelope-from bzeeb-lists@lists.zabbadoz.net)
Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587])
 (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
 (No client certificate requested)
 by mx1.sbone.de (Postfix) with ESMTPS id 0147025D3A6D;
 Thu, 29 Mar 2018 23:10:22 +0000 (UTC)
Received: from content-filter.sbone.de (content-filter.sbone.de
 [IPv6:fde9:577b:c1a9:31::2013:2742])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mail.sbone.de (Postfix) with ESMTPS id 31093D1F83D;
 Thu, 29 Mar 2018 23:10:22 +0000 (UTC)
X-Virus-Scanned: amavisd-new at sbone.de
Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587])
 by content-filter.sbone.de (content-filter.sbone.de
 [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024)
 with ESMTP id Zieb_EPFvpTS; Thu, 29 Mar 2018 23:10:20 +0000 (UTC)
Received: from [192.168.1.88] (fresh-ayiya.sbone.de
 [IPv6:fde9:577b:c1a9:f001::2])
 (using TLSv1 with cipher AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mail.sbone.de (Postfix) with ESMTPSA id 81230D1F822;
 Thu, 29 Mar 2018 23:10:20 +0000 (UTC)
From: "Bjoern A. Zeeb" 
To: "Alexander V. Chernikov" 
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r331098 - in head/sys: net netinet netinet6
Date: Thu, 29 Mar 2018 23:10:19 +0000
X-Mailer: MailMate (2.0BETAr6106)
Message-ID: <99B864A7-2541-4EBF-BDF3-F24E1ABF11D0@lists.zabbadoz.net>
In-Reply-To: <201803171705.w2HH5mk1054256@repo.freebsd.org>
References: <201803171705.w2HH5mk1054256@repo.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 23:10:26 -0000

On 17 Mar 2018, at 17:05, Alexander V. Chernikov wrote:

> Author: melifaro
> Date: Sat Mar 17 17:05:48 2018
> New Revision: 331098
> URL: https://svnweb.freebsd.org/changeset/base/331098
>
> Log:
>   Fix outgoing TCP/UDP packet drop on arp/ndp entry expiration.
>
>   Current arp/nd code relies on the feedback from the datapath 
> indicating
>    that the entry is still used. This mechanism is incorporated into 
> the
>    arpresolve()/nd6_resolve() routines. After the inpcb route cache
>    introduction, the packet path for the locally-originated packets 
> changed,
>    passing cached lle pointer to the ether_output() directly. This 
> resulted
>    in the arp/ndp entry expire each time exactly after the configured 
> max_age
>    interval. During the small window between the ARP/NDP request and 
> reply
>    from the router, most of the packets got lost.
>
>   Fix this behaviour by plugging datapath notification code to the 
> packet
>    path used by route cache. Unify the notification code by using 
> single
>    inlined function with the per-AF callbacks.
>
>   Reported by:	sthaug at nethelp.no
>   Reviewed by:	ae
>   MFC after:	2 weeks

Does this mean that we now take an extra lock per-packet again?

/bz

From owner-svn-src-head@freebsd.org  Thu Mar 29 23:25:09 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C59FF53F84;
 Thu, 29 Mar 2018 23:25:09 +0000 (UTC)
 (envelope-from melifaro@ipfw.ru)
Received: from forward104o.mail.yandex.net (forward104o.mail.yandex.net
 [IPv6:2a02:6b8:0:1a2d::607])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id B05436A8D6;
 Thu, 29 Mar 2018 23:25:08 +0000 (UTC)
 (envelope-from melifaro@ipfw.ru)
Received: from mxback9j.mail.yandex.net (mxback9j.mail.yandex.net
 [IPv6:2a02:6b8:0:1619::112])
 by forward104o.mail.yandex.net (Yandex) with ESMTP id 49C56700DDF;
 Fri, 30 Mar 2018 02:24:57 +0300 (MSK)
Received: from localhost (localhost [::1])
 by mxback9j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id 01b6uf5HIP-OtXaPV6f; 
 Fri, 30 Mar 2018 02:24:56 +0300
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfw.ru; s=mail;
 t=1522365896; bh=YHGJbXniAvCvKmzHH2Ou2HqObPYZdIbSoG+BaqrEAl8=;
 h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date;
 b=tttPc31O9UEE843bCL9qyIPEpkUqkoI2u4SRDZlEBoRTeKvEy+wC9CWETb89IwrpG
 gxYA2chvG1DbD+cWK1QHo3a506AzikGIQZTDPbNBDBwvqKc1ycsLfyStfD3E+2QAAw
 gq6Gh4i3ZEnQ9y1ddgci8iBrkKegz9Sc5X663ua8=
Authentication-Results: mxback9j.mail.yandex.net; dkim=pass header.i=@ipfw.ru
Received: by web41j.yandex.ru with HTTP;
	Fri, 30 Mar 2018 02:24:55 +0300
From: Alexander V. Chernikov 
Envelope-From: melifaro@ipfw.ru
To: Bjoern A. Zeeb 
Cc: "src-committers@freebsd.org" ,
 "svn-src-all@freebsd.org" ,
 "svn-src-head@freebsd.org" 
In-Reply-To: <99B864A7-2541-4EBF-BDF3-F24E1ABF11D0@lists.zabbadoz.net>
References: <201803171705.w2HH5mk1054256@repo.freebsd.org>
 <99B864A7-2541-4EBF-BDF3-F24E1ABF11D0@lists.zabbadoz.net>
Subject: Re: svn commit: r331098 - in head/sys: net netinet netinet6
MIME-Version: 1.0
Message-Id: <10903971522365895@web41j.yandex.ru>
X-Mailer: Yamail [ http://yandex.ru ] 5.0
Date: Fri, 30 Mar 2018 02:24:55 +0300
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=utf-8
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Thu, 29 Mar 2018 23:25:09 -0000

30.03.2018, 02:10, "Bjoern A. Zeeb" :
> On 17 Mar 2018, at 17:05, Alexander V. Chernikov wrote:
>
>>  Author: melifaro
>>  Date: Sat Mar 17 17:05:48 2018
>>  New Revision: 331098
>>  URL: https://svnweb.freebsd.org/changeset/base/331098
>>
>>  Log:
>>    Fix outgoing TCP/UDP packet drop on arp/ndp entry expiration.
>>
>>    Current arp/nd code relies on the feedback from the datapath
>>  indicating
>>     that the entry is still used. This mechanism is incorporated into
>>  the
>>     arpresolve()/nd6_resolve() routines. After the inpcb route cache
>>     introduction, the packet path for the locally-originated packets
>>  changed,
>>     passing cached lle pointer to the ether_output() directly. This
>>  resulted
>>     in the arp/ndp entry expire each time exactly after the configured
>>  max_age
>>     interval. During the small window between the ARP/NDP request and
>>  reply
>>     from the router, most of the packets got lost.
>>
>>    Fix this behaviour by plugging datapath notification code to the
>>  packet
>>     path used by route cache. Unify the notification code by using
>>  single
>>     inlined function with the per-AF callbacks.
>>
>>    Reported by: sthaug at nethelp.no
>>    Reviewed by: ae
>>    MFC after: 2 weeks
>
> Does this mean that we now take an extra lock per-packet again?
No. This codepath is triggered only when ARP/NDP state machine requires datapath feedback, e.g. at most once per second per LLE. 
>
> /bz

From owner-svn-src-head@freebsd.org  Fri Mar 30 02:25:13 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id E98F0F6743B;
 Fri, 30 Mar 2018 02:25:12 +0000 (UTC)
 (envelope-from emaste@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 9FB4C71111;
 Fri, 30 Mar 2018 02:25:12 +0000 (UTC)
 (envelope-from emaste@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9647622934;
 Fri, 30 Mar 2018 02:25:12 +0000 (UTC)
 (envelope-from emaste@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2U2PCY1089915;
 Fri, 30 Mar 2018 02:25:12 GMT (envelope-from emaste@FreeBSD.org)
Received: (from emaste@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2U2PC0o089914;
 Fri, 30 Mar 2018 02:25:12 GMT (envelope-from emaste@FreeBSD.org)
Message-Id: <201803300225.w2U2PC0o089914@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: emaste set sender to
 emaste@FreeBSD.org using -f
From: Ed Maste 
Date: Fri, 30 Mar 2018 02:25:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331757 - head/sys/dev/hyperv/vmbus
X-SVN-Group: head
X-SVN-Commit-Author: emaste
X-SVN-Commit-Paths: head/sys/dev/hyperv/vmbus
X-SVN-Commit-Revision: 331757
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 02:25:13 -0000

Author: emaste
Date: Fri Mar 30 02:25:12 2018
New Revision: 331757
URL: https://svnweb.freebsd.org/changeset/base/331757

Log:
  Correct comment typo in Hyper-V
  
  PR:		226665
  Submitted by:	Ryo ONODERA
  MFC after:	3 days

Modified:
  head/sys/dev/hyperv/vmbus/hyperv.c

Modified: head/sys/dev/hyperv/vmbus/hyperv.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/hyperv.c	Fri Mar 30 02:04:46 2018	(r331756)
+++ head/sys/dev/hyperv/vmbus/hyperv.c	Fri Mar 30 02:25:12 2018	(r331757)
@@ -27,7 +27,7 @@
  */
 
 /**
- * Implements low-level interactions with Hypver-V/Azure
+ * Implements low-level interactions with Hyper-V/Azure
  */
 #include 
 __FBSDID("$FreeBSD$");

From owner-svn-src-head@freebsd.org  Fri Mar 30 03:38:09 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68799F6C2BC;
 Fri, 30 Mar 2018 03:38:09 +0000 (UTC)
 (envelope-from emaste@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 1AE3673B90;
 Fri, 30 Mar 2018 03:38:09 +0000 (UTC)
 (envelope-from emaste@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 157CF234FC;
 Fri, 30 Mar 2018 03:38:09 +0000 (UTC)
 (envelope-from emaste@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2U3c8VR026112;
 Fri, 30 Mar 2018 03:38:08 GMT (envelope-from emaste@FreeBSD.org)
Received: (from emaste@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2U3c8aK026111;
 Fri, 30 Mar 2018 03:38:08 GMT (envelope-from emaste@FreeBSD.org)
Message-Id: <201803300338.w2U3c8aK026111@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: emaste set sender to
 emaste@FreeBSD.org using -f
From: Ed Maste 
Date: Fri, 30 Mar 2018 03:38:08 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331758 - head/usr.sbin/makefs
X-SVN-Group: head
X-SVN-Commit-Author: emaste
X-SVN-Commit-Paths: head/usr.sbin/makefs
X-SVN-Commit-Revision: 331758
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 03:38:09 -0000

Author: emaste
Date: Fri Mar 30 03:38:08 2018
New Revision: 331758
URL: https://svnweb.freebsd.org/changeset/base/331758

Log:
  makefs: sync fragment and block size with newfs
  
  r222319 in newfs raised the default blocksize for UFS/FFS filesystems
  from 16K to 32K and the default fragment size from 2K to 4K, with a
  rationale that most disks were now running with 4K sectors.
  
  MFC after:	2 weeks
  Relnotes:	Yes
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/usr.sbin/makefs/ffs.c

Modified: head/usr.sbin/makefs/ffs.c
==============================================================================
--- head/usr.sbin/makefs/ffs.c	Fri Mar 30 02:25:12 2018	(r331757)
+++ head/usr.sbin/makefs/ffs.c	Fri Mar 30 03:38:08 2018	(r331758)
@@ -115,8 +115,8 @@ __FBSDID("$FreeBSD$");
 /*
  * Various file system defaults (cribbed from newfs(8)).
  */
-#define	DFL_FRAGSIZE		1024		/* fragment size */
-#define	DFL_BLKSIZE		8192		/* block size */
+#define	DFL_FRAGSIZE		4096		/* fragment size */
+#define	DFL_BLKSIZE		32768		/* block size */
 #define	DFL_SECSIZE		512		/* sector size */
 #define	DFL_CYLSPERGROUP	65536		/* cylinders per group */
 #define	DFL_FRAGSPERINODE	4		/* fragments per inode */

From owner-svn-src-head@freebsd.org  Fri Mar 30 10:55:31 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC1C3F5BBF6;
 Fri, 30 Mar 2018 10:55:31 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 7E29B82575;
 Fri, 30 Mar 2018 10:55:31 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 750B527BD7;
 Fri, 30 Mar 2018 10:55:31 +0000 (UTC) (envelope-from kib@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UAtVmP044659;
 Fri, 30 Mar 2018 10:55:31 GMT (envelope-from kib@FreeBSD.org)
Received: (from kib@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UAtVtK044657;
 Fri, 30 Mar 2018 10:55:31 GMT (envelope-from kib@FreeBSD.org)
Message-Id: <201803301055.w2UAtVtK044657@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org
 using -f
From: Konstantin Belousov 
Date: Fri, 30 Mar 2018 10:55:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331760 - head/sys/vm
X-SVN-Group: head
X-SVN-Commit-Author: kib
X-SVN-Commit-Paths: head/sys/vm
X-SVN-Commit-Revision: 331760
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 10:55:32 -0000

Author: kib
Date: Fri Mar 30 10:55:31 2018
New Revision: 331760
URL: https://svnweb.freebsd.org/changeset/base/331760

Log:
  Make vm_map_max/min/pmap KBI stable.
  
  There are out of tree consumers of vm_map_min() and vm_map_max(), and
  I believe there are consumers of vm_map_pmap(), although the later is
  arguably less in the need of KBI-stable interface. For the consumers
  benefit, make modules using this KPI not depended on the struct vm_map
  layout.
  
  Reviewed by:	alc, markj
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week
  Differential revision:	https://reviews.freebsd.org/D14902

Modified:
  head/sys/vm/vm_map.c
  head/sys/vm/vm_map.h

Modified: head/sys/vm/vm_map.c
==============================================================================
--- head/sys/vm/vm_map.c	Fri Mar 30 10:36:54 2018	(r331759)
+++ head/sys/vm/vm_map.c	Fri Mar 30 10:55:31 2018	(r331760)
@@ -4315,6 +4315,27 @@ vm_map_lookup_done(vm_map_t map, vm_map_entry_t entry)
 	vm_map_unlock_read(map);
 }
 
+vm_offset_t
+vm_map_max_KBI(const struct vm_map *map)
+{
+
+	return (map->max_offset);
+}
+
+vm_offset_t
+vm_map_min_KBI(const struct vm_map *map)
+{
+
+	return (map->min_offset);
+}
+
+pmap_t
+vm_map_pmap_KBI(vm_map_t map)
+{
+
+	return (map->pmap);
+}
+
 #include "opt_ddb.h"
 #ifdef DDB
 #include 

Modified: head/sys/vm/vm_map.h
==============================================================================
--- head/sys/vm/vm_map.h	Fri Mar 30 10:36:54 2018	(r331759)
+++ head/sys/vm/vm_map.h	Fri Mar 30 10:55:31 2018	(r331760)
@@ -206,6 +206,11 @@ struct vm_map {
 #define	MAP_BUSY_WAKEUP		0x02
 
 #ifdef	_KERNEL
+#ifdef KLD_MODULE
+#define	vm_map_max(map)		vm_map_max_KBI((map))
+#define	vm_map_min(map)		vm_map_min_KBI((map))
+#define	vm_map_pmap(map)	vm_map_pmap_KBI((map))
+#else
 static __inline vm_offset_t
 vm_map_max(const struct vm_map *map)
 {
@@ -229,6 +234,7 @@ vm_map_modflags(vm_map_t map, vm_flags_t set, vm_flags
 {
 	map->flags = (map->flags | set) & ~clear;
 }
+#endif	/* KLD_MODULE */
 #endif	/* _KERNEL */
 
 /*
@@ -289,6 +295,9 @@ void vm_map_wakeup(vm_map_t map);
 void vm_map_busy(vm_map_t map);
 void vm_map_unbusy(vm_map_t map);
 void vm_map_wait_busy(vm_map_t map);
+vm_offset_t vm_map_max_KBI(const struct vm_map *map);
+vm_offset_t vm_map_min_KBI(const struct vm_map *map);
+pmap_t vm_map_pmap_KBI(vm_map_t map);
 
 #define	vm_map_lock(map)	_vm_map_lock(map, LOCK_FILE, LOCK_LINE)
 #define	vm_map_unlock(map)	_vm_map_unlock(map, LOCK_FILE, LOCK_LINE)

From owner-svn-src-head@freebsd.org  Fri Mar 30 11:25:31 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B4E3F60FF5;
 Fri, 30 Mar 2018 11:25:31 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 381D283842;
 Fri, 30 Mar 2018 11:25:31 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2ED77BB;
 Fri, 30 Mar 2018 11:25:31 +0000 (UTC) (envelope-from avg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UBPVmS060155;
 Fri, 30 Mar 2018 11:25:31 GMT (envelope-from avg@FreeBSD.org)
Received: (from avg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UBPVig060154;
 Fri, 30 Mar 2018 11:25:31 GMT (envelope-from avg@FreeBSD.org)
Message-Id: <201803301125.w2UBPVig060154@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org
 using -f
From: Andriy Gapon 
Date: Fri, 30 Mar 2018 11:25:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331761 - head/sys/i386/i386
X-SVN-Group: head
X-SVN-Commit-Author: avg
X-SVN-Commit-Paths: head/sys/i386/i386
X-SVN-Commit-Revision: 331761
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 11:25:31 -0000

Author: avg
Date: Fri Mar 30 11:25:30 2018
New Revision: 331761
URL: https://svnweb.freebsd.org/changeset/base/331761

Log:
  align i386 cpu_reset() with amd64 version
  
  Maybe this code could be moved to x86.
  
  MFC after:	1 week

Modified:
  head/sys/i386/i386/vm_machdep.c

Modified: head/sys/i386/i386/vm_machdep.c
==============================================================================
--- head/sys/i386/i386/vm_machdep.c	Fri Mar 30 10:55:31 2018	(r331760)
+++ head/sys/i386/i386/vm_machdep.c	Fri Mar 30 11:25:30 2018	(r331761)
@@ -585,7 +585,8 @@ cpu_reset_proxy()
 
 	cpu_reset_proxy_active = 1;
 	while (cpu_reset_proxy_active == 1)
-		;	/* Wait for other cpu to see that we've started */
+		ia32_pause(); /* Wait for other cpu to see that we've started */
+
 	CPU_SETOF(cpu_reset_proxyid, &tcrp);
 	stop_cpus(tcrp);
 	printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid);
@@ -617,19 +618,21 @@ cpu_reset()
 			printf("cpu_reset: Restarting BSP\n");
 
 			/* Restart CPU #0. */
-			/* XXX: restart_cpus(1 << 0); */
 			CPU_SETOF(0, &started_cpus);
 			wmb();
 
 			cnt = 0;
-			while (cpu_reset_proxy_active == 0 && cnt < 10000000)
+			while (cpu_reset_proxy_active == 0 && cnt < 10000000) {
+				ia32_pause();
 				cnt++;	/* Wait for BSP to announce restart */
+			}
 			if (cpu_reset_proxy_active == 0)
 				printf("cpu_reset: Failed to restart BSP\n");
 			enable_intr();
 			cpu_reset_proxy_active = 2;
 
-			while (1);
+			while (1)
+				ia32_pause();
 			/* NOTREACHED */
 		}
 

From owner-svn-src-head@freebsd.org  Fri Mar 30 11:30:49 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F9CCF6362E;
 Fri, 30 Mar 2018 11:30:49 +0000 (UTC)
 (envelope-from ericbsd@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 8AAA883ACD;
 Fri, 30 Mar 2018 11:30:48 +0000 (UTC)
 (envelope-from ericbsd@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85844D4;
 Fri, 30 Mar 2018 11:30:48 +0000 (UTC)
 (envelope-from ericbsd@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UBUmH8060407;
 Fri, 30 Mar 2018 11:30:48 GMT (envelope-from ericbsd@FreeBSD.org)
Received: (from ericbsd@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UBUmrt060406;
 Fri, 30 Mar 2018 11:30:48 GMT (envelope-from ericbsd@FreeBSD.org)
Message-Id: <201803301130.w2UBUmrt060406@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ericbsd set sender to
 ericbsd@FreeBSD.org using -f
From: Eric Turgeon 
Date: Fri, 30 Mar 2018 11:30:48 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331762 - head/share/misc
X-SVN-Group: head
X-SVN-Commit-Author: ericbsd
X-SVN-Commit-Paths: head/share/misc
X-SVN-Commit-Revision: 331762
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 11:30:49 -0000

Author: ericbsd (ports committer)
Date: Fri Mar 30 11:30:48 2018
New Revision: 331762
URL: https://svnweb.freebsd.org/changeset/base/331762

Log:
  Add Eric Turgeon (ericbsd) in committers-ports.dot with mentor/mentee.
  
  Approved by:	bapt (mentor)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==============================================================================
--- head/share/misc/committers-ports.dot	Fri Mar 30 11:25:30 2018	(r331761)
+++ head/share/misc/committers-ports.dot	Fri Mar 30 11:30:48 2018	(r331762)
@@ -100,6 +100,7 @@ eadler [label="Eitan Adler\neadler@FreeBSD.org\n2011/0
 edwin [label="Edwin Groothuis\nedwin@FreeBSD.org\n2002/10/22"]
 ehaupt [label="Emanuel Haupt\nehaupt@FreeBSD.org\n2005/10/03"]
 eik [label="Oliver Eikemeier\neik@FreeBSD.org\n2003/11/12"]
+ericbsd [label="Eric Turgeon\ericbsd@FreeBSD.org\n2018/03/17"]
 erwin [label="Erwin Lansing\nerwin@FreeBSD.org\n2003/06/04"]
 eugen [label="Eugene Grosbein\neugen@FreeBSD.org\n2017/03/04"]
 farrokhi [label="Babak Farrokhi\nfarrokhi@FreeBSD.org\n2006/11/07"]
@@ -307,6 +308,7 @@ bapt -> bdrewery
 bapt -> bofh
 bapt -> dumbbell
 bapt -> eadler
+bapt -> ericbsd
 bapt -> grembo
 bapt -> jbeich
 bapt -> jlaffaye
@@ -691,6 +693,7 @@ wen -> pawel
 wg -> alexey
 wg -> danilo
 wg -> dvl
+wg -> ericbsd
 wg -> misha
 wg -> nemysis
 

From owner-svn-src-head@freebsd.org  Fri Mar 30 13:37:34 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A30DF6E1C5;
 Fri, 30 Mar 2018 13:37:34 +0000 (UTC)
 (envelope-from ericbsd@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E3870689A1;
 Fri, 30 Mar 2018 13:37:33 +0000 (UTC)
 (envelope-from ericbsd@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DE4B81617;
 Fri, 30 Mar 2018 13:37:33 +0000 (UTC)
 (envelope-from ericbsd@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UDbXm0025307;
 Fri, 30 Mar 2018 13:37:33 GMT (envelope-from ericbsd@FreeBSD.org)
Received: (from ericbsd@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UDbXLP025306;
 Fri, 30 Mar 2018 13:37:33 GMT (envelope-from ericbsd@FreeBSD.org)
Message-Id: <201803301337.w2UDbXLP025306@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ericbsd set sender to
 ericbsd@FreeBSD.org using -f
From: Eric Turgeon 
Date: Fri, 30 Mar 2018 13:37:33 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331764 - head/usr.bin/calendar/calendars
X-SVN-Group: head
X-SVN-Commit-Author: ericbsd
X-SVN-Commit-Paths: head/usr.bin/calendar/calendars
X-SVN-Commit-Revision: 331764
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 13:37:34 -0000

Author: ericbsd (ports committer)
Date: Fri Mar 30 13:37:33 2018
New Revision: 331764
URL: https://svnweb.freebsd.org/changeset/base/331764

Log:
  Adding Eric Turgeon (ericbsd) to calendar.freebsd
  
  Approved by: bapt (mentor)

Modified:
  head/usr.bin/calendar/calendars/calendar.freebsd

Modified: head/usr.bin/calendar/calendars/calendar.freebsd
==============================================================================
--- head/usr.bin/calendar/calendars/calendar.freebsd	Fri Mar 30 11:57:58 2018	(r331763)
+++ head/usr.bin/calendar/calendars/calendar.freebsd	Fri Mar 30 13:37:33 2018	(r331764)
@@ -108,6 +108,7 @@
 03/13	Alexander Leidinger  born in Neunkirchen, Saarland, Germany, 1976
 03/13	Will Andrews  born in Pontiac, Michigan, United States, 1982
 03/14	Bernhard Froehlich  born in Graz, Styria, Austria, 1985
+03/14	Eric Turgeon  born in Edmundston, New Brunswick, Canada, 1982
 03/15	Paolo Pisati  born in Lodi, Italy, 1977
 03/15	Brian Fundakowski Feldman  born in Alexandria, Virginia, United States, 1983
 03/17	Michael Smith  born in Bankstown, New South Wales, Australia, 1971

From owner-svn-src-head@freebsd.org  Fri Mar 30 14:41:16 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBDC6F723BB;
 Fri, 30 Mar 2018 14:41:16 +0000 (UTC)
 (envelope-from ericbsd@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 6EBB46B497;
 Fri, 30 Mar 2018 14:41:16 +0000 (UTC)
 (envelope-from ericbsd@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 697F62001;
 Fri, 30 Mar 2018 14:41:16 +0000 (UTC)
 (envelope-from ericbsd@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UEfGog056293;
 Fri, 30 Mar 2018 14:41:16 GMT (envelope-from ericbsd@FreeBSD.org)
Received: (from ericbsd@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UEfG6t056292;
 Fri, 30 Mar 2018 14:41:16 GMT (envelope-from ericbsd@FreeBSD.org)
Message-Id: <201803301441.w2UEfG6t056292@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ericbsd set sender to
 ericbsd@FreeBSD.org using -f
From: Eric Turgeon 
Date: Fri, 30 Mar 2018 14:41:16 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331765 - head/share/misc
X-SVN-Group: head
X-SVN-Commit-Author: ericbsd
X-SVN-Commit-Paths: head/share/misc
X-SVN-Commit-Revision: 331765
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 14:41:16 -0000

Author: ericbsd (ports committer)
Date: Fri Mar 30 14:41:16 2018
New Revision: 331765
URL: https://svnweb.freebsd.org/changeset/base/331765

Log:
  Fix missing n after \ of Eric Turgeon entry
  
  Approved by:	bapt (mentor)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==============================================================================
--- head/share/misc/committers-ports.dot	Fri Mar 30 13:37:33 2018	(r331764)
+++ head/share/misc/committers-ports.dot	Fri Mar 30 14:41:16 2018	(r331765)
@@ -100,7 +100,7 @@ eadler [label="Eitan Adler\neadler@FreeBSD.org\n2011/0
 edwin [label="Edwin Groothuis\nedwin@FreeBSD.org\n2002/10/22"]
 ehaupt [label="Emanuel Haupt\nehaupt@FreeBSD.org\n2005/10/03"]
 eik [label="Oliver Eikemeier\neik@FreeBSD.org\n2003/11/12"]
-ericbsd [label="Eric Turgeon\ericbsd@FreeBSD.org\n2018/03/17"]
+ericbsd [label="Eric Turgeon\nericbsd@FreeBSD.org\n2018/03/17"]
 erwin [label="Erwin Lansing\nerwin@FreeBSD.org\n2003/06/04"]
 eugen [label="Eugene Grosbein\neugen@FreeBSD.org\n2017/03/04"]
 farrokhi [label="Babak Farrokhi\nfarrokhi@FreeBSD.org\n2006/11/07"]

From owner-svn-src-head@freebsd.org  Fri Mar 30 15:28:26 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51A99F754A4;
 Fri, 30 Mar 2018 15:28:26 +0000 (UTC) (envelope-from ken@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id F3A266D26C;
 Fri, 30 Mar 2018 15:28:25 +0000 (UTC) (envelope-from ken@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E65E427E0;
 Fri, 30 Mar 2018 15:28:25 +0000 (UTC) (envelope-from ken@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UFSPl7080932;
 Fri, 30 Mar 2018 15:28:25 GMT (envelope-from ken@FreeBSD.org)
Received: (from ken@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UFSPpm080924;
 Fri, 30 Mar 2018 15:28:25 GMT (envelope-from ken@FreeBSD.org)
Message-Id: <201803301528.w2UFSPpm080924@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org
 using -f
From: "Kenneth D. Merry" 
Date: Fri, 30 Mar 2018 15:28:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331766 - in head: share/man/man4 sys/amd64/conf sys/conf
 sys/dev/ocs_fc sys/modules sys/modules/ocs_fc
X-SVN-Group: head
X-SVN-Commit-Author: ken
X-SVN-Commit-Paths: in head: share/man/man4 sys/amd64/conf sys/conf
 sys/dev/ocs_fc sys/modules sys/modules/ocs_fc
X-SVN-Commit-Revision: 331766
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 15:28:26 -0000

Author: ken
Date: Fri Mar 30 15:28:25 2018
New Revision: 331766
URL: https://svnweb.freebsd.org/changeset/base/331766

Log:
  Bring in the Broadcom/Emulex Fibre Channel driver, ocs_fc(4).
  
  The ocs_fc(4) driver supports the following hardware:
  
  Emulex 16/8G FC GEN 5 HBAS
  	LPe15004 FC Host Bus Adapters
  	LPe160XX FC Host Bus Adapters
  
  Emulex 32/16G FC GEN 6 HBAS
  	LPe3100X FC Host Bus Adapters
  	LPe3200X FC Host Bus Adapters
  
  The driver supports target and initiator mode, and also supports FC-Tape.
  
  Note that the driver only currently works on little endian platforms.  It
  is only included in the module build for amd64 and i386, and in GENERIC
  on amd64 only.
  
  Submitted by:	Ram Kishore Vegesna 
  Reviewed by:	mav
  MFC after:	5 days
  Relnotes:	yes
  Sponsored by:	Broadcom
  Differential Revision:	https://reviews.freebsd.org/D11423

Added:
  head/share/man/man4/ocs_fc.4   (contents, props changed)
  head/sys/dev/ocs_fc/
  head/sys/dev/ocs_fc/ocs.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_cam.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_cam.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_common.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_ddump.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_ddump.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_device.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_device.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_domain.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_domain.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_drv_fc.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_els.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_els.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_fabric.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_fabric.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_fcp.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_hw.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_hw.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_hw_queues.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_hw_queues.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_io.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_io.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_ioctl.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_ioctl.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_list.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_mgmt.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_mgmt.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_node.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_node.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_os.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_os.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_pci.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_scsi.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_scsi.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_sm.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_sm.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_sport.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_sport.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_stats.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_unsol.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_unsol.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_utils.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_utils.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_vpd.h   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_xport.c   (contents, props changed)
  head/sys/dev/ocs_fc/ocs_xport.h   (contents, props changed)
  head/sys/dev/ocs_fc/sli4.c   (contents, props changed)
  head/sys/dev/ocs_fc/sli4.h   (contents, props changed)
  head/sys/dev/ocs_fc/version.h   (contents, props changed)
  head/sys/modules/ocs_fc/
  head/sys/modules/ocs_fc/Makefile   (contents, props changed)
Modified:
  head/share/man/man4/Makefile
  head/sys/amd64/conf/GENERIC
  head/sys/conf/files
  head/sys/modules/Makefile

Modified: head/share/man/man4/Makefile
==============================================================================
--- head/share/man/man4/Makefile	Fri Mar 30 14:41:16 2018	(r331765)
+++ head/share/man/man4/Makefile	Fri Mar 30 15:28:25 2018	(r331766)
@@ -402,6 +402,7 @@ MAN=	aac.4 \
 	${_nvram2env.4} \
 	${_nxge.4} \
 	oce.4 \
+	ocs_fc.4\
 	ohci.4 \
 	orm.4 \
 	ow.4 \

Added: head/share/man/man4/ocs_fc.4
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/share/man/man4/ocs_fc.4	Fri Mar 30 15:28:25 2018	(r331766)
@@ -0,0 +1,194 @@
+.\" Copyright (c) 2017 Broadcom. All rights reserved.
+.\" The term "Broadcom" refers to Broadcom Limited and/or its subsidiaries.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright notice,
+.\"    this list of conditions and the following disclaimer.
+.\"
+.\" 2. Redistributions in binary form must reproduce the above copyright notice,
+.\"    this list of conditions and the following disclaimer in the documentation
+.\"    and/or other materials provided with the distribution.
+.\"
+.\" 3. Neither the name of the copyright holder nor the names of its contributors
+.\"    may be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 March 30, 2018
+.Dt OCS_FC 4
+.Os
+.Sh NAME
+.Nm ocs_fc
+.Nd "Device driver for Emulex Fibre Channel Host Adapters"
+.Sh SYNOPSIS
+To compile this driver into the kernel, add this line to the
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device ocs_fc"
+.Ed
+.Pp
+To load the driver as a module at boot, add this line to
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+ocs_fc_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides access to Fibre Channel SCSI devices.
+.Pp
+The
+.Nm
+driver supports initiator and target modes.
+Support is available for Arbitrated loops, Point-to-Point,
+and Fabric connections.
+FC-Tape is highly recommended for connections to tape drives that support
+it.
+FC-Tape includes four elements from the T-10 FCP-4 specification:
+.Bl -bullet -offset indent
+.It
+Precise Delivery of Commands
+.It
+Confirmed Completion of FCP I/O Operations
+.It
+Retransmission of Unsuccessfully Transmitted IUs
+.It
+Task Retry Identification
+.El
+.Pp
+Together these features allow for link level error recovery with tape
+devices.
+Without link level error recovery, an initiator cannot, for instance, tell whether a tape write
+command that has timed out resulted in all, part, or none of the data going to
+the tape drive.
+FC-Tape is automatically enabled when both the controller and target support it.
+
+.Sh HARDWARE
+The
+.Nm
+driver supports these Fibre Channel adapters:
+.Bl -tag -width xxxxxx -offset indent
+.It Emulex 16/8G FC GEN 5 HBAS
+.Bd -literal -offset indent
+LPe15004 FC Host Bus Adapters
+LPe160XX FC Host Bus Adapters
+.Ed
+.It Emulex 32/16G FC GEN 6 HBAS
+.Bd -literal -offset indent
+LPe3100X FC Host Bus Adapters
+LPe3200X FC Host Bus Adapters
+.Ed
+.El
+.Sh UPDATING FIRMWARE
+Adapter firmware updates are persistent.
+.Pp
+Firmware can be updated by following these steps:
+.Bl -enum
+.It
+Copy this code to a
+.Pa Makefile :
+.Bd -literal -offset indent
+KMOD=ocsflash
+FIRMWS=imagename.grp:ocsflash
+\&.include 
+.Ed
+.It
+Replace
+.Pa imagename
+with the name of the GRP file.
+.It
+Copy the
+.Pa Makefile
+and GRP file to a local directory
+.It
+Execute
+.Cm make
+and copy the generated
+.Pa ocsflash.ko
+file to
+.Pa /lib/modules
+.It
+.Cm sysctl dev.ocs_fc..fw_upgrade=ocsflash
+.It
+Check kernel messages regarding status of the operation
+.It
+Reboot the machine
+.El
+.Pp
+.Sh BOOT OPTIONS
+Options are controlled by setting values in
+.Pa /boot/device.hints .
+.Pp
+They are:
+.Bl -tag -width indent
+.It Va hint.ocs_fc.N.initiator
+Enable initiator functionality.
+Default 1 (enabled), 0 to disable.
+.It Va hint.ocs_fc.N.target
+Enable target functionality.
+Default 1 (enabled), 0 to disable.
+.It Va hint.ocs_fc.N.topology
+Topology: 0 for Auto, 1 for NPort only, 2 for Loop only.
+.It Va hint.ocs_fc.N.speed
+Link speed in megabits per second.
+Possible values include:
+0 Auto-speed negotiation (default), 4000 (4GFC), 8000 (8GFC), 16000 (16GFC).
+.El
+.Sh SYSCTL OPTIONS
+.Bl -tag -width indent
+.It Va dev.ocs_fc.N.port_state
+Port state (read/write).
+Valid values are
+.Li online
+and
+.Li offline .
+.It Va dev.ocs_fc.N.wwpn
+World Wide Port Name (read/write).
+.It Va dev.ocs_fc.N.wwnn
+World Wide Node Name (read/write).
+.It Va dev.ocs_fc.N.fwrev
+Firmware revision (read-only).
+.It Va dev.ocs_fc.N.sn
+Adapter serial number (read-only).
+.It Va dev.ocs_fc.N.configured_speed
+Configured Port Speed (read/write).
+Valid values are:
+0 Auto-speed negotiation (default), 4000 (4GFC), 8000 (8GFC), 16000 (16GFC).
+.It Va dev.ocs_fc.N.configured_topology
+Configured Port Topology (read/write).
+Valid values are:
+0-Auto; 1-NPort; 2-Loop.
+.It Va dev.ocs_fc.N.current_speed
+Current Port Speed (read-only).
+.It Va dev.ocs_fc.N.current_topology
+Current Port Topology (read-only).
+.El
+.Sh SUPPORT
+For general information and support,
+go to the Broadcom website at:
+.Pa http://www.broadcom.com/
+or E-Mail at
+.Pa ocs-driver-team.pdl@broadcom.com.
+.Sh SEE ALSO
+.Xr ifconfig 8
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+driver was written by
+.An Broadcom.

Modified: head/sys/amd64/conf/GENERIC
==============================================================================
--- head/sys/amd64/conf/GENERIC	Fri Mar 30 14:41:16 2018	(r331765)
+++ head/sys/amd64/conf/GENERIC	Fri Mar 30 15:28:25 2018	(r331766)
@@ -141,6 +141,7 @@ device		adw			# Advansys wide SCSI adapters
 device		aic			# Adaptec 15[012]x SCSI adapters, AIC-6[23]60.
 device		bt			# Buslogic/Mylex MultiMaster SCSI adapters
 device		isci			# Intel C600 SAS controller
+device		ocs_fc			# Emulex FC adapters
 
 # ATA/SCSI peripherals
 device		scbus			# SCSI bus (required for ATA/SCSI)

Modified: head/sys/conf/files
==============================================================================
--- head/sys/conf/files	Fri Mar 30 14:41:16 2018	(r331765)
+++ head/sys/conf/files	Fri Mar 30 15:28:25 2018	(r331766)
@@ -2578,6 +2578,27 @@ dev/oce/oce_mbox.c		optional oce pci
 dev/oce/oce_queue.c		optional oce pci
 dev/oce/oce_sysctl.c		optional oce pci
 dev/oce/oce_util.c		optional oce pci
+dev/ocs_fc/ocs_pci.c		optional ocs_fc pci
+dev/ocs_fc/ocs_ioctl.c		optional ocs_fc pci
+dev/ocs_fc/ocs_os.c		optional ocs_fc pci
+dev/ocs_fc/ocs_utils.c		optional ocs_fc pci
+dev/ocs_fc/ocs_hw.c		optional ocs_fc pci
+dev/ocs_fc/ocs_hw_queues.c	optional ocs_fc pci
+dev/ocs_fc/sli4.c		optional ocs_fc pci
+dev/ocs_fc/ocs_sm.c		optional ocs_fc pci
+dev/ocs_fc/ocs_device.c		optional ocs_fc pci
+dev/ocs_fc/ocs_xport.c		optional ocs_fc pci
+dev/ocs_fc/ocs_domain.c		optional ocs_fc pci
+dev/ocs_fc/ocs_sport.c		optional ocs_fc pci
+dev/ocs_fc/ocs_els.c		optional ocs_fc pci
+dev/ocs_fc/ocs_fabric.c		optional ocs_fc pci
+dev/ocs_fc/ocs_io.c		optional ocs_fc pci
+dev/ocs_fc/ocs_node.c		optional ocs_fc pci
+dev/ocs_fc/ocs_scsi.c		optional ocs_fc pci
+dev/ocs_fc/ocs_unsol.c		optional ocs_fc pci
+dev/ocs_fc/ocs_ddump.c		optional ocs_fc pci
+dev/ocs_fc/ocs_mgmt.c		optional ocs_fc pci
+dev/ocs_fc/ocs_cam.c		optional ocs_fc pci
 dev/ofw/ofw_bus_if.m		optional fdt
 dev/ofw/ofw_bus_subr.c		optional fdt
 dev/ofw/ofw_cpu.c		optional fdt

Added: head/sys/dev/ocs_fc/ocs.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/ocs_fc/ocs.h	Fri Mar 30 15:28:25 2018	(r331766)
@@ -0,0 +1,261 @@
+/*-
+ * Copyright (c) 2017 Broadcom. All rights reserved.
+ * The term "Broadcom" refers to Broadcom Limited and/or its subsidiaries.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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$
+ */
+
+/**
+ * @file
+ * OCS bsd driver common include file
+ */
+
+
+#if !defined(__OCS_H__)
+#define __OCS_H__
+
+#include "ocs_os.h"
+#include "ocs_utils.h"
+
+#include "ocs_hw.h"
+#include "ocs_scsi.h"
+#include "ocs_io.h"
+
+#include "version.h"
+
+#define DRV_NAME			"ocs_fc"
+#define DRV_VERSION 							\
+	STR_BE_MAJOR "." STR_BE_MINOR "." STR_BE_BUILD "." STR_BE_BRANCH
+
+/**
+ * @brief Interrupt context
+ */
+typedef struct ocs_intr_ctx_s {
+	uint32_t	vec;		/** Zero based interrupt vector */
+	void		*softc;		/** software context for interrupt */
+	char		name[64];	/** label for this context */
+} ocs_intr_ctx_t;
+
+typedef struct ocs_fcport_s {
+	struct cam_sim          *sim;
+	struct cam_path         *path;
+	uint32_t                role;
+
+	ocs_tgt_resource_t      targ_rsrc_wildcard;
+	ocs_tgt_resource_t      targ_rsrc[OCS_MAX_LUN];
+	ocs_vport_spec_t	*vport;
+} ocs_fcport;
+
+#define FCPORT(ocs, chan)	(&((ocs_fcport *)(ocs)->fcports)[(chan)])
+
+/**
+ * @brief Driver's context
+ */
+
+struct ocs_softc {
+
+	device_t		dev;
+	struct cdev		*cdev;
+
+	ocs_pci_reg_t		reg[PCI_MAX_BAR];
+
+	uint32_t		instance_index;
+	const char		*desc;
+
+	uint32_t		irqid;
+	struct resource		*irq;
+	void			*tag;
+
+	ocs_intr_ctx_t		intr_ctx;
+	uint32_t		n_vec;
+
+	bus_dma_tag_t		dmat;	/** Parent DMA tag */
+	bus_dma_tag_t		buf_dmat;/** IO buffer DMA tag */
+	char display_name[OCS_DISPLAY_NAME_LENGTH];
+	uint16_t		pci_vendor;
+	uint16_t		pci_device;
+	uint16_t		pci_subsystem_vendor;
+	uint16_t		pci_subsystem_device;
+	char			businfo[16];
+	const char		*driver_version;
+	const char		*fw_version;
+	const char		*model;
+
+	ocs_hw_t hw;
+
+	ocs_rlock_t lock;	/**< device wide lock */
+
+	ocs_xport_e		ocs_xport;
+	ocs_xport_t *xport;	/**< pointer to transport object */
+	ocs_domain_t *domain;
+	ocs_list_t domain_list;
+	uint32_t domain_instance_count;
+	void (*domain_list_empty_cb)(ocs_t *ocs, void *arg);		
+	void *domain_list_empty_cb_arg;
+
+	uint8_t enable_ini;
+	uint8_t enable_tgt;
+	uint8_t fc_type;
+	int ctrlmask;
+	uint8_t explicit_buffer_list;
+	uint8_t external_loopback;
+	uint8_t skip_hw_teardown;
+	int speed;
+	int topology;
+	int ethernet_license;
+	int num_scsi_ios;
+	uint8_t enable_hlm;
+	uint32_t hlm_group_size;
+	uint32_t max_isr_time_msec;	/*>> Maximum ISR time */
+	uint32_t auto_xfer_rdy_size; /*>> Max sized write to use auto xfer rdy*/
+	uint8_t esoc;
+	int logmask;
+	char *hw_war_version;
+	uint32_t num_vports;
+	uint32_t target_io_timer_sec;
+	uint32_t hw_bounce;
+	uint8_t rq_threads;
+	uint8_t rq_selection_policy;
+	uint8_t rr_quanta;
+	char *filter_def;
+	uint32_t max_remote_nodes;
+
+	/*
+	 * tgt_rscn_delay - delay in kicking off RSCN processing 
+	 * (nameserver queries) after receiving an RSCN on the target. 
+	 * This prevents thrashing of nameserver requests due to a huge burst of
+	 * RSCNs received in a short period of time.
+	 * Note: this is only valid when target RSCN handling is enabled -- see 
+	 * ctrlmask.
+	 */
+	time_t tgt_rscn_delay_msec;	/*>> minimum target RSCN delay */
+
+	/*
+	 * tgt_rscn_period - determines maximum frequency when processing 
+	 * back-to-back RSCNs; e.g. if this value is 30, there will never be 
+	 * any more than 1 RSCN handling per 30s window. This prevents 
+	 * initiators on a faulty link generating many RSCN from causing the 
+	 * target to continually query the nameserver. 
+	 * Note: This is only valid when target RSCN handling is enabled
+	 */
+	time_t tgt_rscn_period_msec;	/*>> minimum target RSCN period */
+
+	uint32_t		enable_task_set_full;		
+	uint32_t		io_in_use;		
+	uint32_t		io_high_watermark; /**< used to send task set full */
+	struct mtx              sim_lock;
+	uint32_t		config_tgt:1,	/**< Configured to support target mode */
+				config_ini:1;	/**< Configured to support initiator mode */
+
+
+	uint32_t nodedb_mask;			/**< Node debugging mask */
+
+	char			modeldesc[64];
+	char			serialnum[64];
+	char			fwrev[64];
+	char			sli_intf[9];
+
+	ocs_ramlog_t		*ramlog;
+	ocs_textbuf_t		ddump_saved;
+
+	ocs_mgmt_functions_t	*mgmt_functions;
+	ocs_mgmt_functions_t	*tgt_mgmt_functions;
+	ocs_mgmt_functions_t	*ini_mgmt_functions;
+
+	ocs_err_injection_e err_injection;
+	uint32_t cmd_err_inject;
+	time_t delay_value_msec;
+
+	bool			attached;
+	struct mtx		dbg_lock;
+	
+	struct cam_devq		*devq;
+	ocs_fcport		*fcports;
+
+	void*			tgt_ocs;
+};
+
+static inline void
+ocs_device_lock_init(ocs_t *ocs)
+{
+	ocs_rlock_init(ocs, &ocs->lock, "ocsdevicelock");
+}
+
+static inline int32_t
+ocs_device_lock_try(ocs_t *ocs)
+{
+	return ocs_rlock_try(&ocs->lock);
+}
+
+static inline void
+ocs_device_lock(ocs_t *ocs)
+{
+	ocs_rlock_acquire(&ocs->lock);
+}
+
+static inline void
+ocs_device_unlock(ocs_t *ocs)
+{
+	ocs_rlock_release(&ocs->lock);
+}
+
+static inline void
+ocs_device_lock_free(ocs_t *ocs)
+{
+	ocs_rlock_free(&ocs->lock);
+}
+
+extern int32_t ocs_device_detach(ocs_t *ocs);
+
+extern int32_t ocs_device_attach(ocs_t *ocs);
+
+#define ocs_is_initiator_enabled()	(ocs->enable_ini)
+#define ocs_is_target_enabled()	(ocs->enable_tgt)
+
+#include "ocs_xport.h"
+#include "ocs_domain.h"
+#include "ocs_sport.h"
+#include "ocs_node.h"
+#include "ocs_unsol.h"
+#include "ocs_scsi.h"
+#include "ocs_ioctl.h"
+
+static inline ocs_io_t *
+ocs_io_alloc(ocs_t *ocs)
+{
+	return ocs_io_pool_io_alloc(ocs->xport->io_pool);
+}
+
+static inline void
+ocs_io_free(ocs_t *ocs, ocs_io_t *io)
+{
+	ocs_io_pool_io_free(ocs->xport->io_pool, io);
+}
+
+#endif /* __OCS_H__ */

Added: head/sys/dev/ocs_fc/ocs_cam.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sys/dev/ocs_fc/ocs_cam.c	Fri Mar 30 15:28:25 2018	(r331766)
@@ -0,0 +1,2640 @@
+/*-
+ * Copyright (c) 2017 Broadcom. All rights reserved.
+ * The term "Broadcom" refers to Broadcom Limited and/or its subsidiaries.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ *    this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ *    this list of conditions and the following disclaimer in the documentation
+ *    and/or other materials provided with the distribution.
+ *
+ * 3. Neither the name of the copyright holder nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER 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$
+ */
+
+/**
+ * @defgroup scsi_api_target SCSI Target API
+ * @defgroup scsi_api_initiator SCSI Initiator API
+ * @defgroup cam_api Common Access Method (CAM) API
+ * @defgroup cam_io CAM IO
+ */
+
+/**
+ * @file
+ * Provides CAM functionality.
+ */
+
+#include "ocs.h"
+#include "ocs_scsi.h"
+#include "ocs_device.h"
+
+/* Default IO timeout value for initiators is 30 seconds */
+#define OCS_CAM_IO_TIMEOUT	30
+
+typedef struct {
+	ocs_scsi_sgl_t *sgl;
+	uint32_t sgl_max;
+	uint32_t sgl_count;
+	int32_t rc;
+} ocs_dmamap_load_arg_t;
+
+static void ocs_action(struct cam_sim *, union ccb *);
+static void ocs_poll(struct cam_sim *);
+
+static ocs_tgt_resource_t *ocs_tgt_resource_get(ocs_fcport *,
+					struct ccb_hdr *, uint32_t *);
+static int32_t ocs_tgt_resource_abort(struct ocs_softc *, ocs_tgt_resource_t *);
+static uint32_t ocs_abort_initiator_io(struct ocs_softc *ocs, union ccb *accb);
+static void ocs_abort_inot(struct ocs_softc *ocs, union ccb *ccb);
+static void ocs_abort_atio(struct ocs_softc *ocs, union ccb *ccb);
+static int32_t ocs_target_tmf_cb(ocs_io_t *, ocs_scsi_io_status_e, uint32_t, void *);
+static int32_t ocs_io_abort_cb(ocs_io_t *, ocs_scsi_io_status_e, uint32_t, void *);
+static int32_t ocs_task_set_full_or_busy(ocs_io_t *io);
+static int32_t ocs_initiator_tmf_cb(ocs_io_t *, ocs_scsi_io_status_e,
+		ocs_scsi_cmd_resp_t *, uint32_t, void *);
+static uint32_t
+ocs_fcp_change_role(struct ocs_softc *ocs, ocs_fcport *fcp, uint32_t new_role);
+
+static inline ocs_io_t *ocs_scsi_find_io(struct ocs_softc *ocs, uint32_t tag)
+{
+
+	return ocs_io_get_instance(ocs, tag);
+}
+
+static inline void ocs_target_io_free(ocs_io_t *io)
+{
+	io->tgt_io.state = OCS_CAM_IO_FREE;
+	io->tgt_io.flags = 0;
+	io->tgt_io.app = NULL;
+	ocs_scsi_io_complete(io);
+	if(io->ocs->io_in_use != 0)
+		atomic_subtract_acq_32(&io->ocs->io_in_use, 1);
+}
+
+static int32_t
+ocs_attach_port(ocs_t *ocs, int chan)
+{
+
+	struct cam_sim	*sim = NULL;
+	struct cam_path	*path = NULL;
+	uint32_t	max_io = ocs_scsi_get_property(ocs, OCS_SCSI_MAX_IOS);
+	ocs_fcport *fcp = FCPORT(ocs, chan);
+
+	if (NULL == (sim = cam_sim_alloc(ocs_action, ocs_poll, 
+				device_get_name(ocs->dev), ocs, 
+				device_get_unit(ocs->dev), &ocs->sim_lock,
+				max_io, max_io, ocs->devq))) {
+		device_printf(ocs->dev, "Can't allocate SIM\n");
+		return 1;
+	}
+
+	mtx_lock(&ocs->sim_lock);
+	if (CAM_SUCCESS != xpt_bus_register(sim, ocs->dev, chan)) {
+		device_printf(ocs->dev, "Can't register bus %d\n", 0);
+		mtx_unlock(&ocs->sim_lock);
+		cam_sim_free(sim, FALSE);
+		return 1;
+	}
+	mtx_unlock(&ocs->sim_lock);
+
+	if (CAM_REQ_CMP != xpt_create_path(&path, NULL, cam_sim_path(sim),
+				CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD)) {
+		device_printf(ocs->dev, "Can't create path\n");
+		xpt_bus_deregister(cam_sim_path(sim));
+		mtx_unlock(&ocs->sim_lock);
+		cam_sim_free(sim, FALSE);
+		return 1;
+	}
+
+	fcp->sim  = sim;
+	fcp->path = path;
+
+	return 0;
+
+}
+
+static int32_t
+ocs_detach_port(ocs_t *ocs, int32_t chan)
+{
+	ocs_fcport *fcp = NULL;
+	struct cam_sim	*sim = NULL;
+	struct cam_path	*path = NULL;
+	fcp = FCPORT(ocs, chan);
+
+	sim = fcp->sim;
+	path = fcp->path;
+
+	if (fcp->sim) {
+		mtx_lock(&ocs->sim_lock);
+			ocs_tgt_resource_abort(ocs, &fcp->targ_rsrc_wildcard);
+			if (path) {
+				xpt_async(AC_LOST_DEVICE, path, NULL);
+				xpt_free_path(path);
+				fcp->path = NULL;
+			}
+			xpt_bus_deregister(cam_sim_path(sim));
+
+			cam_sim_free(sim, FALSE);
+			fcp->sim = NULL;
+		mtx_unlock(&ocs->sim_lock);
+	}
+	
+	return 0;
+}
+
+int32_t
+ocs_cam_attach(ocs_t *ocs)
+{
+	struct cam_devq	*devq = NULL;
+	int	i = 0;
+	uint32_t	max_io = ocs_scsi_get_property(ocs, OCS_SCSI_MAX_IOS);
+
+	if (NULL == (devq = cam_simq_alloc(max_io))) {
+		device_printf(ocs->dev, "Can't allocate SIMQ\n");
+		return -1;
+	}
+
+	ocs->devq = devq;
+
+	if (mtx_initialized(&ocs->sim_lock) == 0) {
+		mtx_init(&ocs->sim_lock, "ocs_sim_lock", NULL, MTX_DEF);
+	}
+
+	for (i = 0; i < (ocs->num_vports + 1); i++) {
+		if (ocs_attach_port(ocs, i)) {
+			ocs_log_err(ocs, "Attach port failed for chan: %d\n", i);
+			goto detach_port;
+		}
+	}
+	
+	ocs->io_high_watermark = max_io;
+	ocs->io_in_use = 0;
+	return 0;
+
+detach_port:
+	while (--i >= 0) {
+		ocs_detach_port(ocs, i);
+	}
+
+	cam_simq_free(ocs->devq);
+
+	if (mtx_initialized(&ocs->sim_lock))
+		mtx_destroy(&ocs->sim_lock);
+
+	return 1;	
+}
+
+int32_t
+ocs_cam_detach(ocs_t *ocs)
+{
+	int i = 0;
+
+	for (i = (ocs->num_vports); i >= 0; i--) {
+		ocs_detach_port(ocs, i);
+	}
+
+	cam_simq_free(ocs->devq);
+
+	if (mtx_initialized(&ocs->sim_lock))
+		mtx_destroy(&ocs->sim_lock);
+
+	return 0;
+}
+
+/***************************************************************************
+ * Functions required by SCSI base driver API
+ */
+
+/**
+ * @ingroup scsi_api_target
+ * @brief Attach driver to the BSD SCSI layer (a.k.a CAM)
+ *
+ * Allocates + initializes CAM related resources and attaches to the CAM
+ *
+ * @param ocs the driver instance's software context
+ *
+ * @return 0 on success, non-zero otherwise
+ */
+int32_t
+ocs_scsi_tgt_new_device(ocs_t *ocs)
+{
+	ocs->enable_task_set_full = ocs_scsi_get_property(ocs, 
+					OCS_SCSI_ENABLE_TASK_SET_FULL);
+	ocs_log_debug(ocs, "task set full processing is %s\n",
+		ocs->enable_task_set_full ? "enabled" : "disabled");
+
+	return 0;
+}
+
+/**
+ * @ingroup scsi_api_target
+ * @brief Tears down target members of ocs structure.
+ *
+ * Called by OS code when device is removed.
+ *
+ * @param ocs pointer to ocs
+ *
+ * @return returns 0 for success, a negative error code value for failure.
+ */
+int32_t
+ocs_scsi_tgt_del_device(ocs_t *ocs)
+{
+
+	return 0;
+}
+
+/**
+ * @ingroup scsi_api_target
+ * @brief accept new domain notification
+ *
+ * Called by base drive when new domain is discovered.  A target-server
+ * will use this call to prepare for new remote node notifications
+ * arising from ocs_scsi_new_initiator().
+ *
+ * The domain context has an element ocs_scsi_tgt_domain_t tgt_domain 
+ * which is declared by the target-server code and is used for target-server 
+ * private data.
+ *
+ * This function will only be called if the base-driver has been enabled for 
+ * target capability.
+ *
+ * Note that this call is made to target-server backends, 
+ * the ocs_scsi_ini_new_domain() function is called to initiator-client backends.
+ *
+ * @param domain pointer to domain
+ *
+ * @return returns 0 for success, a negative error code value for failure.
+ */
+int32_t
+ocs_scsi_tgt_new_domain(ocs_domain_t *domain)
+{
+	return 0;
+}
+
+/**
+ * @ingroup scsi_api_target
+ * @brief accept domain lost notification
+ *
+ * Called by base-driver when a domain goes away.  A target-server will
+ * use this call to clean up all domain scoped resources.
+ *
+ * Note that this call is made to target-server backends,
+ * the ocs_scsi_ini_del_domain() function is called to initiator-client backends.
+ *
+ * @param domain pointer to domain
+ *
+ * @return returns 0 for success, a negative error code value for failure.
+ */
+void
+ocs_scsi_tgt_del_domain(ocs_domain_t *domain)
+{
+}
+
+
+/**
+ * @ingroup scsi_api_target
+ * @brief accept new sli port (sport) notification
+ *
+ * Called by base drive when new sport is discovered.  A target-server
+ * will use this call to prepare for new remote node notifications
+ * arising from ocs_scsi_new_initiator().
+ *
+ * The domain context has an element ocs_scsi_tgt_sport_t tgt_sport 
+ * which is declared by the target-server code and is used for
+ * target-server private data.
+ *
+ * This function will only be called if the base-driver has been enabled for 
+ * target capability.
+ *
+ * Note that this call is made to target-server backends,
+ * the ocs_scsi_tgt_new_domain() is called to initiator-client backends.
+ *
+ * @param sport pointer to SLI port
+ *
+ * @return returns 0 for success, a negative error code value for failure.
+ */
+int32_t
+ocs_scsi_tgt_new_sport(ocs_sport_t *sport)
+{
+	ocs_t *ocs = sport->ocs;
+
+	if(!sport->is_vport) {
+		sport->tgt_data = FCPORT(ocs, 0);
+	}
+
+	return 0;
+}
+
+/**
+ * @ingroup scsi_api_target
+ * @brief accept SLI port gone notification
+ *
+ * Called by base-driver when a sport goes away.  A target-server will
+ * use this call to clean up all sport scoped resources.
+ *
+ * Note that this call is made to target-server backends,
+ * the ocs_scsi_ini_del_sport() is called to initiator-client backends.
+ *
+ * @param sport pointer to SLI port
+ *
+ * @return returns 0 for success, a negative error code value for failure.
+ */
+void
+ocs_scsi_tgt_del_sport(ocs_sport_t *sport)
+{
+	return;
+}
+
+/**
+ * @ingroup scsi_api_target
+ * @brief receive notification of a new SCSI initiator node
+ *
+ * Sent by base driver to notify a target-server of the presense of a new
+ * remote initiator.   The target-server may use this call to prepare for
+ * inbound IO from this node.
+ *
+ * The ocs_node_t structure has and elment of type ocs_scsi_tgt_node_t named
+ * tgt_node that is declared and used by a target-server for private
+ * information.
+ *
+ * This function is only called if the target capability is enabled in driver.
+ *
+ * @param node pointer to new remote initiator node
+ *
+ * @return returns 0 for success, a negative error code value for failure.
+ *
+ * @note
+ */
+int32_t
+ocs_scsi_new_initiator(ocs_node_t *node)
+{
+	ocs_t	*ocs = node->ocs;
+	struct ac_contract ac;
+	struct ac_device_changed *adc;
+
+	ocs_fcport	*fcp = NULL;
+
+	fcp = node->sport->tgt_data;
+	if (fcp == NULL) {
+		ocs_log_err(ocs, "FCP is NULL \n");
+		return 1;
+	}	
+
+	/*
+	 * Update the IO watermark by decrementing it by the
+	 * number of IOs reserved for each initiator.
+	 */
+	atomic_subtract_acq_32(&ocs->io_high_watermark, OCS_RSVD_INI_IO);
+
+	ac.contract_number = AC_CONTRACT_DEV_CHG;
+	adc = (struct ac_device_changed *) ac.contract_data;
+	adc->wwpn = ocs_node_get_wwpn(node);
+	adc->port = node->rnode.fc_id;
+	adc->target = node->instance_index;
+	adc->arrived = 1;
+	xpt_async(AC_CONTRACT, fcp->path, &ac);
+
+	return 0;
+}
+
+/**
+ * @ingroup scsi_api_target
+ * @brief validate new initiator
+ *
+ * Sent by base driver to validate a remote initiatiator.   The target-server
+ * returns TRUE if this initiator should be accepted.
+ *
+ * This function is only called if the target capability is enabled in driver.
+ *
+ * @param node pointer to remote initiator node to validate
+ *
+ * @return TRUE if initiator should be accepted, FALSE if it should be rejected
+ *
+ * @note
+ */
+
+int32_t
+ocs_scsi_validate_initiator(ocs_node_t *node)
+{
+	return 1;
+}
+
+/**
+ * @ingroup scsi_api_target
+ * @brief Delete a SCSI initiator node
+ *
+ * Sent by base driver to notify a target-server that a remote initiator
+ * is now gone. The base driver will have terminated all outstanding IOs 
+ * and the target-server will receive appropriate completions.
+ *
+ * This function is only called if the base driver is enabled for
+ * target capability.
+ *
+ * @param node pointer node being deleted
+ * @param reason Reason why initiator is gone.
+ *
+ * @return OCS_SCSI_CALL_COMPLETE to indicate that all work was completed
+ *
+ * @note
+ */
+int32_t
+ocs_scsi_del_initiator(ocs_node_t *node, ocs_scsi_del_initiator_reason_e reason)
+{
+	ocs_t	*ocs = node->ocs;
+
+	struct ac_contract ac;
+	struct ac_device_changed *adc;
+	ocs_fcport	*fcp = NULL;
+
+	fcp = node->sport->tgt_data;
+	if (fcp == NULL) {
+		ocs_log_err(ocs, "FCP is NULL \n");
+		return 1;
+	}
+
+	ac.contract_number = AC_CONTRACT_DEV_CHG;
+	adc = (struct ac_device_changed *) ac.contract_data;
+	adc->wwpn = ocs_node_get_wwpn(node);
+	adc->port = node->rnode.fc_id;
+	adc->target = node->instance_index;
+	adc->arrived = 0;
+	xpt_async(AC_CONTRACT, fcp->path, &ac);
+
+
+	if (reason == OCS_SCSI_INITIATOR_MISSING) {
+		return OCS_SCSI_CALL_COMPLETE;
+	}
+

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***

From owner-svn-src-head@freebsd.org  Fri Mar 30 16:37:09 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF348F7962F;
 Fri, 30 Mar 2018 16:37:09 +0000 (UTC)
 (envelope-from manu@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 5AB2E6FB4B;
 Fri, 30 Mar 2018 16:37:09 +0000 (UTC)
 (envelope-from manu@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CBB73303;
 Fri, 30 Mar 2018 16:37:09 +0000 (UTC)
 (envelope-from manu@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UGb9Ru015922;
 Fri, 30 Mar 2018 16:37:09 GMT (envelope-from manu@FreeBSD.org)
Received: (from manu@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UGb9Jr015921;
 Fri, 30 Mar 2018 16:37:09 GMT (envelope-from manu@FreeBSD.org)
Message-Id: <201803301637.w2UGb9Jr015921@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: manu set sender to
 manu@FreeBSD.org using -f
From: Emmanuel Vadot 
Date: Fri, 30 Mar 2018 16:37:09 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331767 - head/stand/efi/libefi
X-SVN-Group: head
X-SVN-Commit-Author: manu
X-SVN-Commit-Paths: head/stand/efi/libefi
X-SVN-Commit-Revision: 331767
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 16:37:09 -0000

Author: manu
Date: Fri Mar 30 16:37:08 2018
New Revision: 331767
URL: https://svnweb.freebsd.org/changeset/base/331767

Log:
  efinet: Do not return only if ReceiveFilter fails
  
  If the network interface or the uefi implementation do not support the
  ReceiveFilter interface do not return only and just print a message.
  U-Boot doesn't support is and likely never will. Also even if this fails
  it doesn't mean that network in EFI isn't supported.

Modified:
  head/stand/efi/libefi/efinet.c

Modified: head/stand/efi/libefi/efinet.c
==============================================================================
--- head/stand/efi/libefi/efinet.c	Fri Mar 30 15:28:25 2018	(r331766)
+++ head/stand/efi/libefi/efinet.c	Fri Mar 30 16:37:08 2018	(r331767)
@@ -225,11 +225,9 @@ efinet_init(struct iodesc *desc, void *machdep_hint)
 	    EFI_SIMPLE_NETWORK_RECEIVE_BROADCAST;
 
 	status = net->ReceiveFilters(net, mask, 0, FALSE, 0, NULL);
-	if (status != EFI_SUCCESS) {
+	if (status != EFI_SUCCESS)
 		printf("net%d: cannot set rx. filters (status=%lu)\n",
 		    nif->nif_unit, EFI_ERROR_CODE(status));
-		return;
-	}
 
 #ifdef EFINET_DEBUG
 	dump_mode(net->Mode);

From owner-svn-src-head@freebsd.org  Fri Mar 30 16:44:55 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98424F79DF2;
 Fri, 30 Mar 2018 16:44:55 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 485757031B;
 Fri, 30 Mar 2018 16:44:55 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 400EA34A0;
 Fri, 30 Mar 2018 16:44:55 +0000 (UTC) (envelope-from cem@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UGitmN021156;
 Fri, 30 Mar 2018 16:44:55 GMT (envelope-from cem@FreeBSD.org)
Received: (from cem@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UGitit021155;
 Fri, 30 Mar 2018 16:44:55 GMT (envelope-from cem@FreeBSD.org)
Message-Id: <201803301644.w2UGitit021155@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org
 using -f
From: Conrad Meyer 
Date: Fri, 30 Mar 2018 16:44:55 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331768 - head/sys/dev/ocs_fc
X-SVN-Group: head
X-SVN-Commit-Author: cem
X-SVN-Commit-Paths: head/sys/dev/ocs_fc
X-SVN-Commit-Revision: 331768
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 16:44:55 -0000

Author: cem
Date: Fri Mar 30 16:44:54 2018
New Revision: 331768
URL: https://svnweb.freebsd.org/changeset/base/331768

Log:
  ocs_fc(4): Fix GCC build (-Wredundant-decls)
  
  These objects are defined earlier in the same file; an extern declaration
  after definition is redundant.
  
  Broken in r331766 (introduction of ocs_fc(4)).
  
  Sponsored by:	Dell EMC Isilon

Modified:
  head/sys/dev/ocs_fc/sli4.c

Modified: head/sys/dev/ocs_fc/sli4.c
==============================================================================
--- head/sys/dev/ocs_fc/sli4.c	Fri Mar 30 16:37:08 2018	(r331767)
+++ head/sys/dev/ocs_fc/sli4.c	Fri Mar 30 16:44:54 2018	(r331768)
@@ -5758,9 +5758,6 @@ int32_t sli_link_is_configurable(sli4_t *sli)
 
 /* vim: set noexpandtab textwidth=120: */
 
-extern const char *SLI_QNAME[];
-extern const sli4_reg_t regmap[SLI4_REG_MAX][SLI4_MAX_IF_TYPES];
-
 /**
  * @ingroup sli_fc
  * @brief Write an FCOE_WQ_CREATE command.

From owner-svn-src-head@freebsd.org  Fri Mar 30 18:26:30 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E1F7F5445D;
 Fri, 30 Mar 2018 18:26:30 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 0D0B874DE8;
 Fri, 30 Mar 2018 18:26:30 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 080394970;
 Fri, 30 Mar 2018 18:26:30 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UIQTHl072281;
 Fri, 30 Mar 2018 18:26:29 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UIQTlB072280;
 Fri, 30 Mar 2018 18:26:29 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803301826.w2UIQTlB072280@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Fri, 30 Mar 2018 18:26:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331776 - head/sys/netinet6
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: head/sys/netinet6
X-SVN-Commit-Revision: 331776
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 18:26:30 -0000

Author: brooks
Date: Fri Mar 30 18:26:29 2018
New Revision: 331776
URL: https://svnweb.freebsd.org/changeset/base/331776

Log:
  Remove a comment that suggests checking that a non-pointer is non-NULL.
  
  Reviewed by:	melifaro, markj, hrs, ume
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14904

Modified:
  head/sys/netinet6/in6.c

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c	Fri Mar 30 18:26:26 2018	(r331775)
+++ head/sys/netinet6/in6.c	Fri Mar 30 18:26:29 2018	(r331776)
@@ -476,10 +476,6 @@ in6_control(struct socket *so, u_long cmd, caddr_t dat
 			error = EINVAL;
 			goto out;
 		}
-		/*
-		 * XXX: should we check if ifa_dstaddr is NULL and return
-		 * an error?
-		 */
 		ifr->ifr_dstaddr = ia->ia_dstaddr;
 		if ((error = sa6_recoverscope(&ifr->ifr_dstaddr)) != 0)
 			goto out;

From owner-svn-src-head@freebsd.org  Fri Mar 30 18:50:17 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id C541AF56A87;
 Fri, 30 Mar 2018 18:50:16 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 2900377771;
 Fri, 30 Mar 2018 18:50:16 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23C904CCF;
 Fri, 30 Mar 2018 18:50:16 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UIoG6Q083787;
 Fri, 30 Mar 2018 18:50:16 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UIoDdi083754;
 Fri, 30 Mar 2018 18:50:13 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803301850.w2UIoDdi083754@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Fri, 30 Mar 2018 18:50:13 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331797 - in head/sys: dev/an dev/ath dev/cxgbe
 dev/if_ndis dev/iwi dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl
 dev/nxge dev/oce dev/qlnx/qlnxe dev/sbni dev/sfxge dev/vxge net net...
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: in head/sys: dev/an dev/ath dev/cxgbe dev/if_ndis dev/iwi
 dev/ixl dev/mlx4/mlx4_en dev/mlx5/mlx5_en dev/mwl dev/nxge dev/oce
 dev/qlnx/qlnxe dev/sbni dev/sfxge dev/vxge net net80211 netinet netpfil/pf
 ...
X-SVN-Commit-Revision: 331797
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 18:50:17 -0000

Author: brooks
Date: Fri Mar 30 18:50:13 2018
New Revision: 331797
URL: https://svnweb.freebsd.org/changeset/base/331797

Log:
  Use an accessor function to access ifr_data.
  
  This fixes 32-bit compat (no ioctl command defintions are required
  as struct ifreq is the same size).  This is believed to be sufficent to
  fully support ifconfig on 32-bit systems.
  
  Reviewed by:	kib
  Obtained from:	CheriBSD
  MFC after:	1 week
  Relnotes:	yes
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14900

Modified:
  head/sys/dev/an/if_an.c
  head/sys/dev/ath/if_ath_ioctl.c
  head/sys/dev/cxgbe/t4_main.c
  head/sys/dev/if_ndis/if_ndis.c
  head/sys/dev/iwi/if_iwi.c
  head/sys/dev/ixl/ixl_pf_main.c
  head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
  head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
  head/sys/dev/mwl/if_mwl.c
  head/sys/dev/nxge/if_nxge.c
  head/sys/dev/oce/oce_if.c
  head/sys/dev/qlnx/qlnxe/qlnx_os.c
  head/sys/dev/sbni/if_sbni.c
  head/sys/dev/sfxge/sfxge.c
  head/sys/dev/vxge/vxge.c
  head/sys/net/if.c
  head/sys/net/if.h
  head/sys/net/if_gif.c
  head/sys/net/if_gre.c
  head/sys/net/if_ipsec.c
  head/sys/net/if_spppsubr.c
  head/sys/net/if_var.h
  head/sys/net/if_vlan.c
  head/sys/net/iflib.c
  head/sys/net80211/ieee80211_ioctl.c
  head/sys/netinet/ip_carp.c
  head/sys/netpfil/pf/if_pfsync.c
  head/sys/security/mac/mac_net.c

Modified: head/sys/dev/an/if_an.c
==============================================================================
--- head/sys/dev/an/if_an.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/dev/an/if_an.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -1934,7 +1934,8 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da
 		error = 0;
 		break;
 	case SIOCGAIRONET:
-		error = copyin(ifr->ifr_data, &sc->areq, sizeof(sc->areq));
+		error = copyin(ifr_data_get_ptr(ifr), &sc->areq,
+		    sizeof(sc->areq));
 		if (error != 0)
 			break;
 		AN_LOCK(sc);
@@ -1963,13 +1964,15 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da
 			break;
 		}
 		AN_UNLOCK(sc);
-		error = copyout(&sc->areq, ifr->ifr_data, sizeof(sc->areq));
+		error = copyout(&sc->areq, ifr_data_get_ptr(ifr),
+		    sizeof(sc->areq));
 		break;
 	case SIOCSAIRONET:
 		if ((error = priv_check(td, PRIV_DRIVER)))
 			goto out;
 		AN_LOCK(sc);
-		error = copyin(ifr->ifr_data, &sc->areq, sizeof(sc->areq));
+		error = copyin(ifr_data_get_ptr(ifr), &sc->areq,
+		    sizeof(sc->areq));
 		if (error != 0)
 			break;
 		an_setdef(sc, &sc->areq);
@@ -1978,7 +1981,8 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da
 	case SIOCGPRIVATE_0:		/* used by Cisco client utility */
 		if ((error = priv_check(td, PRIV_DRIVER)))
 			goto out;
-		error = copyin(ifr->ifr_data, &l_ioctl, sizeof(l_ioctl));
+		error = copyin(ifr_data_get_ptr(ifr), &l_ioctl,
+		    sizeof(l_ioctl));
 		if (error)
 			goto out;
 		mode = l_ioctl.command;
@@ -1996,13 +2000,15 @@ an_ioctl(struct ifnet *ifp, u_long command, caddr_t da
 		AN_UNLOCK(sc);
 		if (!error) {
 			/* copy out the updated command info */
-			error = copyout(&l_ioctl, ifr->ifr_data, sizeof(l_ioctl));
+			error = copyout(&l_ioctl, ifr_data_get_ptr(ifr),
+			    sizeof(l_ioctl));
 		}
 		break;
 	case SIOCGPRIVATE_1:		/* used by Cisco client utility */
 		if ((error = priv_check(td, PRIV_DRIVER)))
 			goto out;
-		error = copyin(ifr->ifr_data, &l_ioctl, sizeof(l_ioctl));
+		error = copyin(ifr_data_get_ptr(ifr), &l_ioctl,
+		    sizeof(l_ioctl));
 		if (error)
 			goto out;
 		l_ioctl.command = 0;

Modified: head/sys/dev/ath/if_ath_ioctl.c
==============================================================================
--- head/sys/dev/ath/if_ath_ioctl.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/dev/ath/if_ath_ioctl.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -267,12 +267,12 @@ ath_ioctl(struct ieee80211com *ic, u_long cmd, void *d
 		    rt->info[sc->sc_txrix].dot11Rate &~ IEEE80211_RATE_BASIC;
 		if (rt->info[sc->sc_txrix].phy & IEEE80211_T_HT)
 			sc->sc_stats.ast_tx_rate |= IEEE80211_RATE_MCS;
-		return copyout(&sc->sc_stats,
-		    ifr->ifr_data, sizeof (sc->sc_stats));
+		return copyout(&sc->sc_stats, ifr_data_get_ptr(ifr),
+		    sizeof (sc->sc_stats));
 	}
 	case SIOCGATHAGSTATS:
-		return copyout(&sc->sc_aggr_stats,
-		    ifr->ifr_data, sizeof (sc->sc_aggr_stats));
+		return copyout(&sc->sc_aggr_stats, ifr_data_get_ptr(ifr),
+		    sizeof (sc->sc_aggr_stats));
 	case SIOCZATHSTATS: {
 		int error;
 

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/dev/cxgbe/t4_main.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -1800,7 +1800,7 @@ fail:
 	case SIOCGI2C: {
 		struct ifi2creq i2c;
 
-		rc = copyin(ifr->ifr_data, &i2c, sizeof(i2c));
+		rc = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c));
 		if (rc != 0)
 			break;
 		if (i2c.dev_addr != 0xA0 && i2c.dev_addr != 0xA2) {
@@ -1818,7 +1818,7 @@ fail:
 		    i2c.offset, i2c.len, &i2c.data[0]);
 		end_synchronized_op(sc, 0);
 		if (rc == 0)
-			rc = copyout(&i2c, ifr->ifr_data, sizeof(i2c));
+			rc = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c));
 		break;
 	}
 

Modified: head/sys/dev/if_ndis/if_ndis.c
==============================================================================
--- head/sys/dev/if_ndis/if_ndis.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/dev/if_ndis/if_ndis.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -2975,11 +2975,12 @@ ndis_80211ioctl(struct ieee80211com *ic, u_long cmd, v
 	switch (cmd) {
 	case SIOCGDRVSPEC:
 	case SIOCSDRVSPEC:
-		error = copyin(ifr->ifr_data, &oid, sizeof(oid));
+		error = copyin(ifr_data_get_ptr(ifr), &oid, sizeof(oid));
 		if (error)
 			break;
 		oidbuf = malloc(oid.len, M_TEMP, M_WAITOK | M_ZERO);
-		error = copyin(ifr->ifr_data + sizeof(oid), oidbuf, oid.len);
+		error = copyin((caddr_t)ifr_data_get_ptr(ifr) + sizeof(oid),
+		    oidbuf, oid.len);
 	}
 
 	if (error) {
@@ -3001,7 +3002,7 @@ ndis_80211ioctl(struct ieee80211com *ic, u_long cmd, v
 			NDIS_UNLOCK(sc);
 			break;
 		}
-		error = copyin(ifr->ifr_data, &evt, sizeof(evt));
+		error = copyin(ifr_data_get_ptr(ifr), &evt, sizeof(evt));
 		if (error) {
 			NDIS_UNLOCK(sc);
 			break;
@@ -3012,14 +3013,15 @@ ndis_80211ioctl(struct ieee80211com *ic, u_long cmd, v
 			break;
 		}
 		error = copyout(&sc->ndis_evt[sc->ndis_evtcidx],
-		    ifr->ifr_data, sizeof(uint32_t) * 2);
+		    ifr_data_get_ptr(ifr), sizeof(uint32_t) * 2);
 		if (error) {
 			NDIS_UNLOCK(sc);
 			break;
 		}
 		if (sc->ndis_evt[sc->ndis_evtcidx].ne_len) {
 			error = copyout(sc->ndis_evt[sc->ndis_evtcidx].ne_buf,
-			    ifr->ifr_data + (sizeof(uint32_t) * 2),
+			    (caddr_t)ifr_data_get_ptr(ifr) +
+			    (sizeof(uint32_t) * 2),
 			    sc->ndis_evt[sc->ndis_evtcidx].ne_len);
 			if (error) {
 				NDIS_UNLOCK(sc);
@@ -3041,10 +3043,11 @@ ndis_80211ioctl(struct ieee80211com *ic, u_long cmd, v
 	switch (cmd) {
 	case SIOCGDRVSPEC:
 	case SIOCSDRVSPEC:
-		error = copyout(&oid, ifr->ifr_data, sizeof(oid));
+		error = copyout(&oid, ifr_data_get_ptr(ifr), sizeof(oid));
 		if (error)
 			break;
-		error = copyout(oidbuf, ifr->ifr_data + sizeof(oid), oid.len);
+		error = copyout(oidbuf,
+		    (caddr_t)ifr_data_get_ptr(ifr) + sizeof(oid), oid.len);
 	}
 
 	free(oidbuf, M_TEMP);

Modified: head/sys/dev/iwi/if_iwi.c
==============================================================================
--- head/sys/dev/iwi/if_iwi.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/dev/iwi/if_iwi.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -2059,7 +2059,7 @@ iwi_ioctl(struct ieee80211com *ic, u_long cmd, void *d
 	switch (cmd) {
 	case SIOCGIWISTATS:
 		/* XXX validate permissions/memory/etc? */
-		error = copyout(&sc->sc_linkqual, ifr->ifr_data,
+		error = copyout(&sc->sc_linkqual, ifr_data_get_ptr(ifr),
 		    sizeof(struct iwi_notif_link_quality));
 		break;
 	case SIOCZIWISTATS:

Modified: head/sys/dev/ixl/ixl_pf_main.c
==============================================================================
--- head/sys/dev/ixl/ixl_pf_main.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/dev/ixl/ixl_pf_main.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -5174,7 +5174,7 @@ ixl_ioctl(struct ifnet * ifp, u_long command, caddr_t 
 		if (!pf->has_i2c)
 			return (ENOTTY);
 
-		error = copyin(ifr->ifr_data, &i2c, sizeof(i2c));
+		error = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c));
 		if (error != 0)
 			break;
 		if (i2c.dev_addr != 0xA0 && i2c.dev_addr != 0xA2) {
@@ -5191,7 +5191,7 @@ ixl_ioctl(struct ifnet * ifp, u_long command, caddr_t 
 			    i2c.dev_addr, &i2c.data[i]))
 				return (EIO);
 
-		error = copyout(&i2c, ifr->ifr_data, sizeof(i2c));
+		error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c));
 		break;
 	}
 #endif

Modified: head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
==============================================================================
--- head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -2058,7 +2058,7 @@ out:
 	case SIOCGI2C: {
 		struct ifi2creq i2c;
 
-		error = copyin(ifr->ifr_data, &i2c, sizeof(i2c));
+		error = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c));
 		if (error)
 			break;
 		if (i2c.len > sizeof(i2c.data)) {
@@ -2075,7 +2075,7 @@ out:
 			error = -error;
 			break;
 		}
-		error = copyout(&i2c, ifr->ifr_data, sizeof(i2c));
+		error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c));
 		break;
 	}
 #endif

Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -2884,7 +2884,7 @@ out:
 		 * Copy from the user-space address ifr_data to the
 		 * kernel-space address i2c
 		 */
-		error = copyin(ifr->ifr_data, &i2c, sizeof(i2c));
+		error = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c));
 		if (error)
 			break;
 
@@ -2948,7 +2948,7 @@ out:
 			goto err_i2c;
 		}
 
-		error = copyout(&i2c, ifr->ifr_data, sizeof(i2c));
+		error = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c));
 err_i2c:
 		PRIV_UNLOCK(priv);
 		break;

Modified: head/sys/dev/mwl/if_mwl.c
==============================================================================
--- head/sys/dev/mwl/if_mwl.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/dev/mwl/if_mwl.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -4750,8 +4750,8 @@ mwl_ioctl(struct ieee80211com *ic, u_long cmd, void *d
 		 * statistics.  The alternative is to copy the data
 		 * to a local structure.
 		 */
-		return (copyout(&sc->sc_stats,
-				ifr->ifr_data, sizeof (sc->sc_stats)));
+		return (copyout(&sc->sc_stats, ifr_data_get_ptr(ifr),
+		    sizeof (sc->sc_stats)));
 #ifdef MWL_DIAGAPI
 	case SIOCGMVDIAG:
 		/* XXX check privs */

Modified: head/sys/dev/nxge/if_nxge.c
==============================================================================
--- head/sys/dev/nxge/if_nxge.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/dev/nxge/if_nxge.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -1368,7 +1368,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre
 	void *info = NULL;
 	int retValue = EINVAL;
 
-	cmd = fubyte(ifreqp->ifr_data);
+	cmd = fubyte(ifr_data_get_ptr(ifreqp));
 	if (cmd == -1)
 		return (EFAULT);
 
@@ -1379,7 +1379,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre
 	            (xge_hal_stats_hw_info_t **)&info);
 	        mtx_unlock(&lldev->mtx_drv);
 	        if(status == XGE_HAL_OK) {
-	            if(copyout(info, ifreqp->ifr_data,
+	            if(copyout(info, ifr_data_get_ptr(ifreqp),
 	                sizeof(xge_hal_stats_hw_info_t)) == 0)
 	                retValue = 0;
 	        }
@@ -1397,7 +1397,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre
 	                sizeof(xge_hal_pci_config_t));
 	            mtx_unlock(&lldev->mtx_drv);
 	            if(status == XGE_HAL_OK) {
-	                if(copyout(info, ifreqp->ifr_data,
+	                if(copyout(info, ifr_data_get_ptr(ifreqp),
 	                    sizeof(xge_hal_pci_config_t)) == 0)
 	                    retValue = 0;
 	            }
@@ -1417,7 +1417,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre
 	                sizeof(xge_hal_stats_device_info_t));
 	            mtx_unlock(&lldev->mtx_drv);
 	            if(status == XGE_HAL_OK) {
-	                if(copyout(info, ifreqp->ifr_data,
+	                if(copyout(info, ifr_data_get_ptr(ifreqp),
 	                    sizeof(xge_hal_stats_device_info_t)) == 0)
 	                    retValue = 0;
 	            }
@@ -1438,7 +1438,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre
 	                sizeof(xge_hal_stats_sw_err_t));
 	            mtx_unlock(&lldev->mtx_drv);
 	            if(status == XGE_HAL_OK) {
-	                if(copyout(info, ifreqp->ifr_data,
+	                if(copyout(info, ifr_data_get_ptr(ifreqp),
 	                    sizeof(xge_hal_stats_sw_err_t)) == 0)
 	                    retValue = 0;
 	            }
@@ -1451,7 +1451,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre
 	        break;
 
 	    case XGE_QUERY_DRIVERSTATS:
-		if(copyout(&lldev->driver_stats, ifreqp->ifr_data,
+		if(copyout(&lldev->driver_stats, ifr_data_get_ptr(ifreqp),
 	            sizeof(xge_driver_stats_t)) == 0) {
 	            retValue = 0;
 	        }
@@ -1465,7 +1465,8 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre
 	        info = xge_os_malloc(NULL, XGE_BUFFER_SIZE);
 	        if(info != NULL) {
 	            strcpy(info, XGE_DRIVER_VERSION);
-	            if(copyout(info, ifreqp->ifr_data, XGE_BUFFER_SIZE) == 0)
+	            if(copyout(info, ifr_data_get_ptr(ifreqp),
+			XGE_BUFFER_SIZE) == 0)
 	                retValue = 0;
 	            xge_os_free(NULL, info, XGE_BUFFER_SIZE);
 	        }
@@ -1479,7 +1480,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre
 	                sizeof(xge_hal_device_config_t));
 	            mtx_unlock(&lldev->mtx_drv);
 	            if(status == XGE_HAL_OK) {
-	                if(copyout(info, ifreqp->ifr_data,
+	                if(copyout(info, ifr_data_get_ptr(ifreqp),
 	                    sizeof(xge_hal_device_config_t)) == 0)
 	                    retValue = 0;
 	            }
@@ -1492,7 +1493,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre
 	        break;
 
 	    case XGE_QUERY_BUFFER_MODE:
-	        if(copyout(&lldev->buffer_mode, ifreqp->ifr_data,
+	        if(copyout(&lldev->buffer_mode, ifr_data_get_ptr(ifreqp),
 	            sizeof(int)) == 0)
 	            retValue = 0;
 	        break;
@@ -1501,7 +1502,7 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre
 	    case XGE_SET_BUFFER_MODE_2:
 	    case XGE_SET_BUFFER_MODE_5:
 	        mode = (cmd == XGE_SET_BUFFER_MODE_1) ? 'Y':'N';
-	        if(copyout(&mode, ifreqp->ifr_data, sizeof(mode)) == 0)
+	        if(copyout(&mode, ifr_data_get_ptr(ifreqp), sizeof(mode)) == 0)
 	            retValue = 0;
 	        break;
 	    default:
@@ -1529,7 +1530,7 @@ xge_ioctl_registers(xge_lldev_t *lldev, struct ifreq *
 	int error;
 	u64 val64 = 0;
 
-	error = copyin(ifreqp->ifr_data, &tmpdata, sizeof(tmpdata));
+	error = copyin(ifr_data_get_ptr(ifreqp), &tmpdata, sizeof(tmpdata));
 	if (error != 0)
 		return (error);
 	data = &tmpdata;
@@ -1542,7 +1543,8 @@ xge_ioctl_registers(xge_lldev_t *lldev, struct ifreq *
 	        &data->value);
 	    mtx_unlock(&lldev->mtx_drv);
 	    if(status == XGE_HAL_OK) {
-	        if(copyout(data, ifreqp->ifr_data, sizeof(xge_register_t)) == 0)
+	        if(copyout(data, ifr_data_get_ptr(ifreqp),
+		    sizeof(xge_register_t)) == 0)
 	            retValue = 0;
 	    }
 	}
@@ -1587,7 +1589,7 @@ xge_ioctl_registers(xge_lldev_t *lldev, struct ifreq *
 	    mtx_unlock(&lldev->mtx_drv);
 
 	    if(retValue == 0) {
-	        if(copyout(data, ifreqp->ifr_data,
+	        if(copyout(data, ifr_data_get_ptr(ifreqp),
 	            sizeof(xge_hal_pci_bar0_t)) != 0) {
 	            xge_trace(XGE_ERR, "Copyout of register values failed");
 	            retValue = EINVAL;

Modified: head/sys/dev/oce/oce_if.c
==============================================================================
--- head/sys/dev/oce/oce_if.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/dev/oce/oce_if.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -2276,7 +2276,7 @@ oce_handle_passthrough(struct ifnet *ifp, caddr_t data
 	struct ifreq *ifr = (struct ifreq *)data;
 	int rc = ENXIO;
 	char cookie[32] = {0};
-	void *priv_data = (void *)ifr->ifr_data;
+	void *priv_data = ifr_data_get_ptr(ifr);
 	void *ioctl_ptr;
 	uint32_t req_size;
 	struct mbx_hdr req;

Modified: head/sys/dev/qlnx/qlnxe/qlnx_os.c
==============================================================================
--- head/sys/dev/qlnx/qlnxe/qlnx_os.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/dev/qlnx/qlnxe/qlnx_os.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -2464,7 +2464,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data
 		struct ecore_hwfn *p_hwfn = &ha->cdev.hwfns[0];
 		struct ecore_ptt *p_ptt;
 
-		ret = copyin(ifr->ifr_data, &i2c, sizeof(i2c));
+		ret = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c));
 
 		if (ret)
 			break;
@@ -2494,7 +2494,7 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data
 			break;
 		}
 
-		ret = copyout(&i2c, ifr->ifr_data, sizeof(i2c));
+		ret = copyout(&i2c, ifr_data_get_ptr(ifr), sizeof(i2c));
 
 		QL_DPRINT8(ha, "SIOCGI2C copyout ret = %d \
 			 len = %d addr = 0x%02x offset = 0x%04x \

Modified: head/sys/dev/sbni/if_sbni.c
==============================================================================
--- head/sys/dev/sbni/if_sbni.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/dev/sbni/if_sbni.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -1153,7 +1153,7 @@ sbni_ioctl(struct ifnet *ifp, u_long command, caddr_t 
 		SBNI_LOCK(sc);
 		bcopy(&sc->in_stats, in_stats, sizeof(struct sbni_in_stats));
 		SBNI_UNLOCK(sc);
-		error = copyout(ifr->ifr_data, in_stats,
+		error = copyout(ifr_data_get_ptr(ifr), in_stats,
 		    sizeof(struct sbni_in_stats));
 		free(in_stats, M_DEVBUF);
 		break;

Modified: head/sys/dev/sfxge/sfxge.c
==============================================================================
--- head/sys/dev/sfxge/sfxge.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/dev/sfxge/sfxge.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -529,7 +529,7 @@ sfxge_if_ioctl(struct ifnet *ifp, unsigned long comman
 	{
 		struct ifi2creq i2c;
 
-		error = copyin(ifr->ifr_data, &i2c, sizeof(i2c));
+		error = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c));
 		if (error != 0)
 			break;
 
@@ -544,7 +544,8 @@ sfxge_if_ioctl(struct ifnet *ifp, unsigned long comman
 						&i2c.data[0]);
 		SFXGE_ADAPTER_UNLOCK(sc);
 		if (error == 0)
-			error = copyout(&i2c, ifr->ifr_data, sizeof(i2c));
+			error = copyout(&i2c, ifr_data_get_ptr(ifr),
+			    sizeof(i2c));
 		break;
 	}
 #endif
@@ -552,12 +553,13 @@ sfxge_if_ioctl(struct ifnet *ifp, unsigned long comman
 		error = priv_check(curthread, PRIV_DRIVER);
 		if (error != 0)
 			break;
-		error = copyin(ifr->ifr_data, &ioc, sizeof(ioc));
+		error = copyin(ifr_data_get_ptr(ifr), &ioc, sizeof(ioc));
 		if (error != 0)
 			return (error);
 		error = sfxge_private_ioctl(sc, &ioc);
 		if (error == 0) {
-			error = copyout(&ioc, ifr->ifr_data, sizeof(ioc));
+			error = copyout(&ioc, ifr_data_get_ptr(ifr),
+			    sizeof(ioc));
 		}
 		break;
 	default:

Modified: head/sys/dev/vxge/vxge.c
==============================================================================
--- head/sys/dev/vxge/vxge.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/dev/vxge/vxge.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -3710,8 +3710,8 @@ vxge_ioctl_regs(vxge_dev_t *vdev, struct ifreq *ifr)
 	u32 offset, reqd_size = 0;
 	int i, err = EINVAL;
 
-	char *command = (char *) ifr->ifr_data;
-	void *reg_info = (void *) ifr->ifr_data;
+	char *command = ifr_data_get_ptr(ifr);
+	void *reg_info = ifr_data_get_ptr(ifr);
 
 	vxge_vpath_t *vpath;
 	vxge_hal_status_e status = VXGE_HAL_OK;
@@ -3818,7 +3818,7 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr)
 	vxge_drv_stats_t *drv_stat;
 
 	char *buffer = NULL;
-	char *command = (char *) ifr->ifr_data;
+	char *command = ifr_data_get_ptr(ifr);
 	vxge_hal_status_e status = VXGE_HAL_OK;
 
 	switch (*command) {
@@ -3829,7 +3829,8 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr)
 			status = vxge_hal_aux_pci_config_read(vdev->devh,
 			    bufsize, buffer, &retsize);
 			if (status == VXGE_HAL_OK)
-				err = copyout(buffer, ifr->ifr_data, retsize);
+				err = copyout(buffer, ifr_data_get_ptr(ifr),
+				    retsize);
 			else
 				device_printf(vdev->ndev,
 				    "failed pciconfig statistics query\n");
@@ -3848,7 +3849,8 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr)
 			status = vxge_hal_aux_stats_mrpcim_read(vdev->devh,
 			    bufsize, buffer, &retsize);
 			if (status == VXGE_HAL_OK)
-				err = copyout(buffer, ifr->ifr_data, retsize);
+				err = copyout(buffer, ifr_data_get_ptr(ifr),
+				    retsize);
 			else
 				device_printf(vdev->ndev,
 				    "failed mrpcim statistics query\n");
@@ -3864,7 +3866,8 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr)
 			status = vxge_hal_aux_stats_device_read(vdev->devh,
 			    bufsize, buffer, &retsize);
 			if (status == VXGE_HAL_OK)
-				err = copyout(buffer, ifr->ifr_data, retsize);
+				err = copyout(buffer, ifr_data_get_ptr(ifr),
+				    retsize);
 			else
 				device_printf(vdev->ndev,
 				    "failed device statistics query\n");
@@ -3888,7 +3891,7 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr)
 			((vxge_device_hw_info_t *) buffer)->port_failure =
 			    vdev->port_failure;
 
-			err = copyout(buffer, ifr->ifr_data, bufsize);
+			err = copyout(buffer, ifr_data_get_ptr(ifr), bufsize);
 			if (err != 0)
 				device_printf(vdev->ndev,
 				    "failed device hardware info query\n");
@@ -3915,7 +3918,7 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr)
 				    sizeof(vxge_drv_stats_t));
 			}
 
-			err = copyout(drv_stat, ifr->ifr_data, bufsize);
+			err = copyout(drv_stat, ifr_data_get_ptr(ifr), bufsize);
 			if (err != 0)
 				device_printf(vdev->ndev,
 				    "failed driver statistics query\n");
@@ -3925,7 +3928,7 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr)
 		break;
 
 	case VXGE_GET_BANDWIDTH:
-		bw_info = (vxge_bw_info_t *) ifr->ifr_data;
+		bw_info = ifr_data_get_ptr(ifr);
 
 		if ((vdev->config.hw_info.func_id != 0) &&
 		    (vdev->hw_fw_version < VXGE_FW_VERSION(1, 8, 0)))
@@ -3938,7 +3941,8 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr)
 		if (status != VXGE_HAL_OK)
 			break;
 
-		err = copyout(bw_info, ifr->ifr_data, sizeof(vxge_bw_info_t));
+		err = copyout(bw_info, ifr_data_get_ptr(ifr),
+		    sizeof(vxge_bw_info_t));
 		break;
 
 	case VXGE_SET_BANDWIDTH:
@@ -3949,7 +3953,7 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr)
 	case VXGE_SET_PORT_MODE:
 		if (vdev->is_privilaged) {
 			if (vdev->config.hw_info.ports == VXGE_DUAL_PORT_MODE) {
-				port_info = (vxge_port_info_t *) ifr->ifr_data;
+				port_info = ifr_data_get_ptr(ifr);
 				vdev->config.port_mode = port_info->port_mode;
 				err = vxge_port_mode_update(vdev);
 				if (err != ENXIO)
@@ -3966,10 +3970,11 @@ vxge_ioctl_stats(vxge_dev_t *vdev, struct ifreq *ifr)
 	case VXGE_GET_PORT_MODE:
 		if (vdev->is_privilaged) {
 			if (vdev->config.hw_info.ports == VXGE_DUAL_PORT_MODE) {
-				port_info = (vxge_port_info_t *) ifr->ifr_data;
+				port_info = ifr_data_get_ptr(ifr);
 				err = vxge_port_mode_get(vdev, port_info);
 				if (err == VXGE_HAL_OK) {
-					err = copyout(port_info, ifr->ifr_data,
+					err = copyout(port_info,
+					    ifr_data_get_ptr(ifr),
 					    sizeof(vxge_port_info_t));
 				}
 			}
@@ -4005,7 +4010,7 @@ vxge_bw_priority_set(vxge_dev_t *vdev, struct ifreq *i
 	u32 func_id;
 	vxge_bw_info_t *bw_info;
 
-	bw_info = (vxge_bw_info_t *) ifr->ifr_data;
+	bw_info = ifr_data_get_ptr(ifr);
 	func_id = bw_info->func_id;
 
 	vdev->config.bw_info[func_id].priority = bw_info->priority;

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/net/if.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -2403,6 +2403,20 @@ ifr_buffer_set_length(struct thread *td, void *data, s
 		ifrup->ifr.ifr_ifru.ifru_buffer.length = len;
 }
 
+void *
+ifr_data_get_ptr(void *ifrp)
+{
+	union ifreq_union *ifrup;
+
+	ifrup = ifrp;
+#ifdef COMPAT_FREEBSD32
+	if (SV_CURPROC_FLAG(SV_ILP32))
+		return ((void *)(uintptr_t)
+		    ifrup->ifr32.ifr_ifru.ifru_data);
+#endif
+		return (ifrup->ifr.ifr_ifru.ifru_data);
+}
+
 /*
  * Hardware specific interface ioctls.
  */
@@ -2584,7 +2598,8 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data,
 		error = priv_check(td, PRIV_NET_SETIFNAME);
 		if (error)
 			return (error);
-		error = copyinstr(ifr->ifr_data, new_name, IFNAMSIZ, NULL);
+		error = copyinstr(ifr_data_get_ptr(ifr), new_name, IFNAMSIZ,
+		    NULL);
 		if (error != 0)
 			return (error);
 		if (new_name[0] == '\0')
@@ -2895,8 +2910,8 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, s
 		error = priv_check(td, PRIV_NET_IFCREATE);
 		if (error == 0)
 			error = if_clone_create(ifr->ifr_name,
-			    sizeof(ifr->ifr_name),
-			    cmd == SIOCIFCREATE2 ? ifr->ifr_data : NULL);
+			    sizeof(ifr->ifr_name), cmd == SIOCIFCREATE2 ?
+			    ifr_data_get_ptr(ifr) : NULL);
 		CURVNET_RESTORE();
 		return (error);
 	case SIOCIFDESTROY:

Modified: head/sys/net/if.h
==============================================================================
--- head/sys/net/if.h	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/net/if.h	Fri Mar 30 18:50:13 2018	(r331797)
@@ -412,7 +412,9 @@ struct	ifreq {
 #define	ifr_mtu		ifr_ifru.ifru_mtu	/* mtu */
 #define ifr_phys	ifr_ifru.ifru_phys	/* physical wire */
 #define ifr_media	ifr_ifru.ifru_media	/* physical media */
+#ifndef _KERNEL
 #define	ifr_data	ifr_ifru.ifru_data	/* for use by interface */
+#endif
 #define	ifr_reqcap	ifr_ifru.ifru_cap[0]	/* requested capabilities */
 #define	ifr_curcap	ifr_ifru.ifru_cap[1]	/* current capabilities */
 #define	ifr_index	ifr_ifru.ifru_index	/* interface index */

Modified: head/sys/net/if_gif.c
==============================================================================
--- head/sys/net/if_gif.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/net/if_gif.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -898,12 +898,14 @@ gif_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 		break;
 	case GIFGOPTS:
 		options = sc->gif_options;
-		error = copyout(&options, ifr->ifr_data, sizeof(options));
+		error = copyout(&options, ifr_data_get_ptr(ifr),
+		    sizeof(options));
 		break;
 	case GIFSOPTS:
 		if ((error = priv_check(curthread, PRIV_NET_GIF)) != 0)
 			break;
-		error = copyin(ifr->ifr_data, &options, sizeof(options));
+		error = copyin(ifr_data_get_ptr(ifr), &options,
+		    sizeof(options));
 		if (error)
 			break;
 		if (options & ~GIF_OPTMASK)

Modified: head/sys/net/if_gre.c
==============================================================================
--- head/sys/net/if_gre.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/net/if_gre.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -455,7 +455,8 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 	case GRESKEY:
 		if ((error = priv_check(curthread, PRIV_NET_GRE)) != 0)
 			break;
-		if ((error = copyin(ifr->ifr_data, &opt, sizeof(opt))) != 0)
+		if ((error = copyin(ifr_data_get_ptr(ifr), &opt,
+		    sizeof(opt))) != 0)
 			break;
 		if (sc->gre_key != opt) {
 			GRE_WLOCK(sc);
@@ -465,13 +466,14 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 		}
 		break;
 	case GREGKEY:
-		error = copyout(&sc->gre_key, ifr->ifr_data,
+		error = copyout(&sc->gre_key, ifr_data_get_ptr(ifr),
 		    sizeof(sc->gre_key));
 		break;
 	case GRESOPTS:
 		if ((error = priv_check(curthread, PRIV_NET_GRE)) != 0)
 			break;
-		if ((error = copyin(ifr->ifr_data, &opt, sizeof(opt))) != 0)
+		if ((error = copyin(ifr_data_get_ptr(ifr), &opt,
+		    sizeof(opt))) != 0)
 			break;
 		if (opt & ~GRE_OPTMASK)
 			error = EINVAL;
@@ -486,7 +488,7 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 		break;
 
 	case GREGOPTS:
-		error = copyout(&sc->gre_options, ifr->ifr_data,
+		error = copyout(&sc->gre_options, ifr_data_get_ptr(ifr),
 		    sizeof(sc->gre_options));
 		break;
 	default:

Modified: head/sys/net/if_ipsec.c
==============================================================================
--- head/sys/net/if_ipsec.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/net/if_ipsec.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -688,12 +688,12 @@ ipsec_ioctl(struct ifnet *ifp, u_long cmd, caddr_t dat
 		break;
 	case IPSECGREQID:
 		reqid = sc->reqid;
-		error = copyout(&reqid, ifr->ifr_data, sizeof(reqid));
+		error = copyout(&reqid, ifr_data_get_ptr(ifr), sizeof(reqid));
 		break;
 	case IPSECSREQID:
 		if ((error = priv_check(curthread, PRIV_NET_SETIFCAP)) != 0)
 			break;
-		error = copyin(ifr->ifr_data, &reqid, sizeof(reqid));
+		error = copyin(ifr_data_get_ptr(ifr), &reqid, sizeof(reqid));
 		if (error != 0)
 			break;
 		error = ipsec_set_reqid(ifp, reqid);

Modified: head/sys/net/if_spppsubr.c
==============================================================================
--- head/sys/net/if_spppsubr.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/net/if_spppsubr.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -5058,17 +5058,17 @@ sppp_params(struct sppp *sp, u_long cmd, void *data)
 	if ((spr = malloc(sizeof(struct spppreq), M_TEMP, M_NOWAIT)) == NULL)
 		return (EAGAIN);
 	/*
-	 * ifr->ifr_data is supposed to point to a struct spppreq.
+	 * ifr_data_get_ptr(ifr) is supposed to point to a struct spppreq.
 	 * Check the cmd word first before attempting to fetch all the
 	 * data.
 	 */
-	rv = fueword(ifr->ifr_data, &subcmd);
+	rv = fueword(ifr_data_get_ptr(ifr), &subcmd);
 	if (rv == -1) {
 		rv = EFAULT;
 		goto quit;
 	}
 
-	if (copyin((caddr_t)ifr->ifr_data, spr, sizeof(struct spppreq)) != 0) {
+	if (copyin(ifr_data_get_ptr(ifr), spr, sizeof(struct spppreq)) != 0) {
 		rv = EFAULT;
 		goto quit;
 	}
@@ -5105,8 +5105,8 @@ sppp_params(struct sppp *sp, u_long cmd, void *data)
 		 * setting it.
 		 */
 		spr->defs.lcp.timeout = sp->lcp.timeout * 1000 / hz;
-		rv = copyout(spr, (caddr_t)ifr->ifr_data,
-			     sizeof(struct spppreq));
+		rv = copyout(spr, ifr_data_get_ptr(ifr),
+		    sizeof(struct spppreq));
 		break;
 
 	case (u_long)SPPPIOSDEFS:

Modified: head/sys/net/if_var.h
==============================================================================
--- head/sys/net/if_var.h	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/net/if_var.h	Fri Mar 30 18:50:13 2018	(r331797)
@@ -719,6 +719,9 @@ int drbr_enqueue_drv(if_t ifp, struct buf_ring *br, st
 void if_hw_tsomax_common(if_t ifp, struct ifnet_hw_tsomax *);
 int if_hw_tsomax_update(if_t ifp, struct ifnet_hw_tsomax *);
 
+/* accessors for struct ifreq */
+void *ifr_data_get_ptr(void *ifrp);
+
 #ifdef DEVICE_POLLING
 enum poll_cmd { POLL_ONLY, POLL_AND_CHECK_STATUS };
 

Modified: head/sys/net/if_vlan.c
==============================================================================
--- head/sys/net/if_vlan.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/net/if_vlan.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -1857,7 +1857,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data
 			break;
 		}
 #endif
-		error = copyin(ifr->ifr_data, &vlr, sizeof(vlr));
+		error = copyin(ifr_data_get_ptr(ifr), &vlr, sizeof(vlr));
 		if (error)
 			break;
 		if (vlr.vlr_parent[0] == '\0') {
@@ -1888,7 +1888,7 @@ vlan_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data
 			vlr.vlr_tag = ifv->ifv_vid;
 		}
 		VLAN_SUNLOCK();
-		error = copyout(&vlr, ifr->ifr_data, sizeof(vlr));
+		error = copyout(&vlr, ifr_data_get_ptr(ifr), sizeof(vlr));
 		break;
 		
 	case SIOCSIFFLAGS:

Modified: head/sys/net/iflib.c
==============================================================================
--- head/sys/net/iflib.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/net/iflib.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -3984,7 +3984,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data)
 	{
 		struct ifi2creq i2c;
 
-		err = copyin(ifr->ifr_data, &i2c, sizeof(i2c));
+		err = copyin(ifr_data_get_ptr(ifr), &i2c, sizeof(i2c));
 		if (err != 0)
 			break;
 		if (i2c.dev_addr != 0xA0 && i2c.dev_addr != 0xA2) {
@@ -3997,7 +3997,8 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data)
 		}
 
 		if ((err = IFDI_I2C_REQ(ctx, &i2c)) == 0)
-			err = copyout(&i2c, ifr->ifr_data, sizeof(i2c));
+			err = copyout(&i2c, ifr_data_get_ptr(ifr),
+			    sizeof(i2c));
 		break;
 	}
 	case SIOCSIFCAP:

Modified: head/sys/net80211/ieee80211_ioctl.c
==============================================================================
--- head/sys/net80211/ieee80211_ioctl.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/net80211/ieee80211_ioctl.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -3567,7 +3567,8 @@ ieee80211_ioctl(struct ifnet *ifp, u_long cmd, caddr_t
 		break;
 	case SIOCG80211STATS:
 		ifr = (struct ifreq *)data;
-		copyout(&vap->iv_stats, ifr->ifr_data, sizeof (vap->iv_stats));
+		copyout(&vap->iv_stats, ifr_data_get_ptr(ifr),
+		    sizeof (vap->iv_stats));
 		break;
 	case SIOCSIFMTU:
 		ifr = (struct ifreq *)data;

Modified: head/sys/netinet/ip_carp.c
==============================================================================
--- head/sys/netinet/ip_carp.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/netinet/ip_carp.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -1708,7 +1708,7 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa
 	struct carp_softc *sc = NULL;
 	int error = 0, locked = 0;
 
-	if ((error = copyin(ifr->ifr_data, &carpr, sizeof carpr)))
+	if ((error = copyin(ifr_data_get_ptr(ifr), &carpr, sizeof carpr)))
 		return (error);
 
 	ifp = ifunit_ref(ifr->ifr_name);
@@ -1824,7 +1824,8 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa
 				break;
 			}
 			carp_carprcp(&carpr, sc, priveleged);
-			error = copyout(&carpr, ifr->ifr_data, sizeof(carpr));
+			error = copyout(&carpr, ifr_data_get_ptr(ifr),
+			    sizeof(carpr));
 		} else  {
 			int i, count;
 
@@ -1842,7 +1843,8 @@ carp_ioctl(struct ifreq *ifr, u_long cmd, struct threa
 			IFNET_FOREACH_CARP(ifp, sc) {
 				carp_carprcp(&carpr, sc, priveleged);
 				carpr.carpr_count = count;
-				error = copyout(&carpr, ifr->ifr_data +
+				error = copyout(&carpr,
+				    (caddr_t)ifr_data_get_ptr(ifr) +
 				    (i * sizeof(carpr)), sizeof(carpr));
 				if (error) {
 					CIF_UNLOCK(ifp->if_carp);

Modified: head/sys/netpfil/pf/if_pfsync.c
==============================================================================
--- head/sys/netpfil/pf/if_pfsync.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/netpfil/pf/if_pfsync.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -1319,7 +1319,8 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t dat
 		pfsyncr.pfsyncr_defer = (PFSYNCF_DEFER ==
 		    (sc->sc_flags & PFSYNCF_DEFER));
 		PFSYNC_UNLOCK(sc);
-		return (copyout(&pfsyncr, ifr->ifr_data, sizeof(pfsyncr)));
+		return (copyout(&pfsyncr, ifr_data_get_ptr(ifr),
+		    sizeof(pfsyncr)));
 
 	case SIOCSETPFSYNC:
 	    {
@@ -1330,7 +1331,8 @@ pfsyncioctl(struct ifnet *ifp, u_long cmd, caddr_t dat
 
 		if ((error = priv_check(curthread, PRIV_NETINET_PF)) != 0)
 			return (error);
-		if ((error = copyin(ifr->ifr_data, &pfsyncr, sizeof(pfsyncr))))
+		if ((error = copyin(ifr_data_get_ptr(ifr), &pfsyncr,
+		    sizeof(pfsyncr))))
 			return (error);
 
 		if (pfsyncr.pfsyncr_maxupdates > 255)

Modified: head/sys/security/mac/mac_net.c
==============================================================================
--- head/sys/security/mac/mac_net.c	Fri Mar 30 18:49:52 2018	(r331796)
+++ head/sys/security/mac/mac_net.c	Fri Mar 30 18:50:13 2018	(r331797)
@@ -406,7 +406,7 @@ mac_ifnet_ioctl_get(struct ucred *cred, struct ifreq *
 	if (!(mac_labeled & MPC_OBJECT_IFNET))
 		return (EINVAL);
 
-	error = copyin(ifr->ifr_ifru.ifru_data, &mac, sizeof(mac));
+	error = copyin(ifr_data_get_ptr(ifr), &mac, sizeof(mac));
 	if (error)
 		return (error);
 
@@ -449,7 +449,7 @@ mac_ifnet_ioctl_set(struct ucred *cred, struct ifreq *
 	if (!(mac_labeled & MPC_OBJECT_IFNET))
 		return (EINVAL);
 
-	error = copyin(ifr->ifr_ifru.ifru_data, &mac, sizeof(mac));
+	error = copyin(ifr_data_get_ptr(ifr), &mac, sizeof(mac));
 	if (error)
 		return (error);
 

From owner-svn-src-head@freebsd.org  Fri Mar 30 19:08:38 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F935F5957D;
 Fri, 30 Mar 2018 19:08:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id C327778F65;
 Fri, 30 Mar 2018 19:08:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B92BC500A;
 Fri, 30 Mar 2018 19:08:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UJ8bOh094347;
 Fri, 30 Mar 2018 19:08:37 GMT (envelope-from gjb@FreeBSD.org)
Received: (from gjb@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UJ8b5D094346;
 Fri, 30 Mar 2018 19:08:37 GMT (envelope-from gjb@FreeBSD.org)
Message-Id: <201803301908.w2UJ8b5D094346@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org
 using -f
From: Glen Barber 
Date: Fri, 30 Mar 2018 19:08:37 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331806 - head/release
X-SVN-Group: head
X-SVN-Commit-Author: gjb
X-SVN-Commit-Paths: head/release
X-SVN-Commit-Revision: 331806
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 19:08:38 -0000

Author: gjb
Date: Fri Mar 30 19:08:37 2018
New Revision: 331806
URL: https://svnweb.freebsd.org/changeset/base/331806

Log:
  Add logic for "families" for GCE images.
  
  This allows for GCE consumers to easily detect the latest major
  version of FreeBSD when using the gcloud command line utility.
  
  To ensure snapshot builds do not conflict with release-style
  builds (ALPHA, BETA, RC, RELEASE), the '-snap' suffix is appended
  to the GCE image family name.
  
  MFC after:	3 days
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/release/Makefile.gce

Modified: head/release/Makefile.gce
==============================================================================
--- head/release/Makefile.gce	Fri Mar 30 19:02:24 2018	(r331805)
+++ head/release/Makefile.gce	Fri Mar 30 19:08:37 2018	(r331806)
@@ -18,8 +18,13 @@ CLEANFILES+=		${GCE_UPLOAD_TGTS}
 
 GCE_BUCKET?=
 
+.if !defined(GCE_FAMILY) || empty(GCE_FAMILY)
+GCE_FAMILY=		${TYPE:tl}-${REVISION:S,.,-,}
+.endif
+
 .if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE"
 SNAPSHOT_DATE!=		date +-%Y-%m-%d
+GCE_FAMILY_SUFX=	-snap
 .endif
 
 # Really?  Uppercase characters are not allowed?  Sigh...
@@ -64,6 +69,7 @@ gce-do-upload:
 	/usr/local/bin/gsutil cp ${.OBJDIR}/${GCE_TARGET}.tar.gz \
 		gs://${GCE_BUCKET}/
 	/usr/local/bin/gcloud compute images create ${GCE_TARGET} \
+		--family=${GCE_FAMILY}${GCE_FAMILY_SUFX} \
 		--source-uri gs://${GCE_BUCKET}/${GCE_TARGET}.tar.gz
 	touch ${.OBJDIR}/${.TARGET}
 

From owner-svn-src-head@freebsd.org  Fri Mar 30 19:35:32 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88E1DF5C023;
 Fri, 30 Mar 2018 19:35:32 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 37DF77B680;
 Fri, 30 Mar 2018 19:35:32 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32B5B54EF;
 Fri, 30 Mar 2018 19:35:32 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UJZW5a010015;
 Fri, 30 Mar 2018 19:35:32 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UJZWdu010014;
 Fri, 30 Mar 2018 19:35:32 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201803301935.w2UJZWdu010014@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
 hselasky@FreeBSD.org using -f
From: Hans Petter Selasky 
Date: Fri, 30 Mar 2018 19:35:32 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331819 - head/sys/dev/mlx5/mlx5_core
X-SVN-Group: head
X-SVN-Commit-Author: hselasky
X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core
X-SVN-Commit-Revision: 331819
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 19:35:32 -0000

Author: hselasky
Date: Fri Mar 30 19:35:31 2018
New Revision: 331819
URL: https://svnweb.freebsd.org/changeset/base/331819

Log:
  Add missing newline character in print in mlx5core.
  
  MFC after:	3 days
  Submitted by:	slavash@
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_health.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_health.c	Fri Mar 30 19:26:45 2018	(r331818)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c	Fri Mar 30 19:35:31 2018	(r331819)
@@ -183,7 +183,7 @@ static void reset_fw_if_needed(struct mlx5_core_dev *d
 	    fatal_error == MLX5_SENSOR_NIC_DISABLED ||
 	    fatal_error == MLX5_SENSOR_NIC_SW_RESET ||
 	    test_bit(MLX5_SKIP_SW_RESET, &health->flags)) {
-		mlx5_core_warn(dev, "Not issuing FW reset. Either it's already done or won't help.");
+		mlx5_core_warn(dev, "Not issuing FW reset. Either it's already done or won't help.\n");
 		return;
 	}
 

From owner-svn-src-head@freebsd.org  Fri Mar 30 19:39:28 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40D37F5C543;
 Fri, 30 Mar 2018 19:39:28 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E70A37B9C5;
 Fri, 30 Mar 2018 19:39:27 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1EF754F4;
 Fri, 30 Mar 2018 19:39:27 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UJdReA010419;
 Fri, 30 Mar 2018 19:39:27 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UJdRqB010418;
 Fri, 30 Mar 2018 19:39:27 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201803301939.w2UJdRqB010418@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
 hselasky@FreeBSD.org using -f
From: Hans Petter Selasky 
Date: Fri, 30 Mar 2018 19:39:27 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331820 - head/sys/dev/mlx5/mlx5_core
X-SVN-Group: head
X-SVN-Commit-Author: hselasky
X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core
X-SVN-Commit-Revision: 331820
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 19:39:28 -0000

Author: hselasky
Date: Fri Mar 30 19:39:27 2018
New Revision: 331820
URL: https://svnweb.freebsd.org/changeset/base/331820

Log:
  Properly check if crspace is supported in mlx5core.
  
  The old code checked for MLX5_CR_SPACE_DOMAIN which is irrelevant here.
  However, if dev->vsec_addr would be 0, an access to wrong offset would
  happen.
  
  MFC after:	3 days
  Submitted by:	slavash@
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_crspace.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_crspace.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_crspace.c	Fri Mar 30 19:35:31 2018	(r331819)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_crspace.c	Fri Mar 30 19:39:27 2018	(r331820)
@@ -65,6 +65,8 @@ enum {
 #define MLX5_MERGE(rsrc1, rsrc2, start, len)	\
 	(((len) == 32) ? (rsrc2) : MLX5_MERGE_C(rsrc1, rsrc2, start, len))
 
+#define MLX5_SEMAPHORE_SPACE_DOMAIN 0xA
+
 static int mlx5_pciconf_wait_on_flag(struct mlx5_core_dev *dev,
 				     u8 expected_val)
 {
@@ -131,6 +133,9 @@ int mlx5_pciconf_cap9_sem(struct mlx5_core_dev *dev, i
 	int retries = 0;
 	u32 lock_val;
 
+	if (!dev->vsec_addr)
+		return -ENXIO;
+
 	if (state == UNLOCK) {
 		pci_write_config_dword(dev->pdev, dev->vsec_addr +
 				       PCI_SEMAPHORE_OFFSET, 0);
@@ -159,7 +164,6 @@ int mlx5_pciconf_cap9_sem(struct mlx5_core_dev *dev, i
 	return 0;
 }
 
-#define MLX5_PROTECTED_CR_SPACE_DOMAIN 0x6
 static int mlx5_pciconf_set_addr_space(struct mlx5_core_dev *dev,
 				       u16 space)
 {
@@ -183,7 +187,6 @@ static int mlx5_pciconf_set_addr_space(struct mlx5_cor
 	return 0;
 }
 
-#define MLX5_CR_SPACE_DOMAIN 0x2
 static int mlx5_get_vendor_cap_addr(struct mlx5_core_dev *dev)
 {
 	int vend_cap;
@@ -196,24 +199,27 @@ static int mlx5_get_vendor_cap_addr(struct mlx5_core_d
 	ret = mlx5_pciconf_cap9_sem(dev, LOCK);
 	if (ret) {
 		mlx5_core_warn(dev,
-			       "pciconf_cap9_sem locking failure\n");
+		    "pciconf_cap9_sem locking failure\n");
 		return 0;
 	}
-	if (mlx5_pciconf_set_addr_space(dev, MLX5_CR_SPACE_DOMAIN))
+	if (mlx5_pciconf_set_addr_space(dev,
+	       MLX5_SEMAPHORE_SPACE_DOMAIN))
 		vend_cap = 0;
 	ret = mlx5_pciconf_cap9_sem(dev, UNLOCK);
 	if (ret)
 		mlx5_core_warn(dev,
-			       "pciconf_cap9_sem unlocking failure\n");
+		    "pciconf_cap9_sem unlocking failure\n");
 	return vend_cap;
 }
 
-#define MLX5_SEMAPHORE_SPACE_DOMAIN 0xA
 int mlx5_pciconf_set_sem_addr_space(struct mlx5_core_dev *dev,
 				    u32 sem_space_address, int state)
 {
 	u32 data, id = 0;
 	int ret;
+
+	if (!dev->vsec_addr)
+		return -ENXIO;
 
 	ret = mlx5_pciconf_set_addr_space(dev,
 					  MLX5_SEMAPHORE_SPACE_DOMAIN);

From owner-svn-src-head@freebsd.org  Fri Mar 30 19:43:16 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1802FF5CBA7;
 Fri, 30 Mar 2018 19:43:16 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id BC5AC7BF57;
 Fri, 30 Mar 2018 19:43:15 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CBAF5684;
 Fri, 30 Mar 2018 19:43:15 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UJhFnr015706;
 Fri, 30 Mar 2018 19:43:15 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UJhFYT015704;
 Fri, 30 Mar 2018 19:43:15 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201803301943.w2UJhFYT015704@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
 hselasky@FreeBSD.org using -f
From: Hans Petter Selasky 
Date: Fri, 30 Mar 2018 19:43:15 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331821 - head/sys/dev/mlx5/mlx5_core
X-SVN-Group: head
X-SVN-Commit-Author: hselasky
X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core
X-SVN-Commit-Revision: 331821
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 19:43:16 -0000

Author: hselasky
Date: Fri Mar 30 19:43:15 2018
New Revision: 331821
URL: https://svnweb.freebsd.org/changeset/base/331821

Log:
  Prepare for FW dump in error state in mlx5core.
  
  - Move firmware dump prep and cleanup to init_one() and remove_one() so that
  the init and cleanup will happen only upon driver reload.
  - Add some prints to indicate firmware dump.
  
  MFC after:	3 days
  Submitted by:	slavash@
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c
  head/sys/dev/mlx5/mlx5_core/mlx5_main.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c	Fri Mar 30 19:39:27 2018	(r331820)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_fwdump.c	Fri Mar 30 19:43:15 2018	(r331821)
@@ -116,14 +116,18 @@ mlx5_fwdump(struct mlx5_core_dev *mdev)
 	uint32_t i, ri;
 	int error;
 
+	dev_info(&mdev->pdev->dev, "Issuing FW dump\n");
 	dd = (struct mlx5_dump_data *)atomic_load_acq_ptr((uintptr_t *)
 	    &mdev->dump_data);
 	if (dd == NULL)
 		return;
 	mtx_lock(&dd->dump_lock);
-	if (dd->dump_valid)
+	if (dd->dump_valid) {
 		/* only one dump */
+		dev_warn(&mdev->pdev->dev,
+		    "Only one FW dump can be captured aborting FW dump\n");
 		goto failed;
+	}
 
 	/* mlx5_vsc already warns, be silent. */
 	error = mlx5_vsc_lock(mdev);

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_main.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_main.c	Fri Mar 30 19:39:27 2018	(r331820)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_main.c	Fri Mar 30 19:43:15 2018	(r331821)
@@ -1056,8 +1056,6 @@ static int mlx5_load_one(struct mlx5_core_dev *dev, st
 		goto err_fs;
 	}
 
-	mlx5_fwdump_prep(dev);
-
 	clear_bit(MLX5_INTERFACE_STATE_DOWN, &dev->intf_state);
 	set_bit(MLX5_INTERFACE_STATE_UP, &dev->intf_state);
 
@@ -1127,7 +1125,6 @@ static int mlx5_unload_one(struct mlx5_core_dev *dev, 
 		goto out;
 	}
 
-	mlx5_fwdump_clean(dev);
 	mlx5_unregister_device(dev);
 
 	mlx5_cleanup_fs(dev);
@@ -1179,7 +1176,6 @@ struct mlx5_core_event_handler {
 		      void *data);
 };
 
-
 static int init_one(struct pci_dev *pdev,
 		    const struct pci_device_id *id)
 {
@@ -1224,6 +1220,8 @@ static int init_one(struct pci_dev *pdev,
 		goto clean_health;
 	}
 
+	mlx5_fwdump_prep(dev);
+
 	pci_save_state(pdev->dev.bsddev);
 	return 0;
 
@@ -1248,6 +1246,7 @@ static void remove_one(struct pci_dev *pdev)
 		return;
 	}
 
+	mlx5_fwdump_clean(dev);
 	mlx5_pagealloc_cleanup(dev);
 	mlx5_health_cleanup(dev);
 	mlx5_pci_close(dev, priv);
@@ -1264,6 +1263,7 @@ static pci_ers_result_t mlx5_pci_err_detected(struct p
 	dev_info(&pdev->dev, "%s was called\n", __func__);
 	mlx5_enter_error_state(dev, false);
 	mlx5_unload_one(dev, priv, false);
+
 	if (state) {
 		mlx5_drain_health_wq(dev);
 		mlx5_pci_disable_device(dev);

From owner-svn-src-head@freebsd.org  Fri Mar 30 19:45:49 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC091F5CF01;
 Fri, 30 Mar 2018 19:45:49 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 4A98D7C1C6;
 Fri, 30 Mar 2018 19:45:49 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 414F05685;
 Fri, 30 Mar 2018 19:45:49 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UJjnAO015861;
 Fri, 30 Mar 2018 19:45:49 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UJjngu015860;
 Fri, 30 Mar 2018 19:45:49 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201803301945.w2UJjngu015860@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
 hselasky@FreeBSD.org using -f
From: Hans Petter Selasky 
Date: Fri, 30 Mar 2018 19:45:49 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331822 - head/sys/dev/mlx5/mlx5_core
X-SVN-Group: head
X-SVN-Commit-Author: hselasky
X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core
X-SVN-Commit-Revision: 331822
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 19:45:50 -0000

Author: hselasky
Date: Fri Mar 30 19:45:48 2018
New Revision: 331822
URL: https://svnweb.freebsd.org/changeset/base/331822

Log:
  Reorganize health recovery in mlx5core.
  
  - Move the semaphore locking and unlocking to the same function.
  - Flags are no longer needed if the reset and crdump will be done in the
    same function.
  
  MFC after:	3 days
  Submitted by:	slavash@
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_health.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_health.c	Fri Mar 30 19:43:15 2018	(r331821)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c	Fri Mar 30 19:45:48 2018	(r331822)
@@ -48,8 +48,6 @@ enum {
 enum {
 	MLX5_DROP_NEW_HEALTH_WORK,
 	MLX5_DROP_NEW_RECOVERY_WORK,
-	MLX5_SKIP_SW_RESET,
-	MLX5_SW_RESET_SEM_LOCKED,
 };
 
 enum  {
@@ -167,7 +165,6 @@ static void reset_fw_if_needed(struct mlx5_core_dev *d
 {
 	bool supported = (ioread32be(&dev->iseg->initializing) >>
 			  MLX5_FW_RESET_SUPPORTED_OFFSET) & 1;
-	struct mlx5_core_health *health = &dev->priv.health;
 	u32 cmdq_addr, fatal_error;
 
 	if (!supported)
@@ -181,8 +178,7 @@ static void reset_fw_if_needed(struct mlx5_core_dev *d
 	fatal_error = check_fatal_sensors(dev);
 	if (fatal_error == MLX5_SENSOR_PCI_COMM_ERR ||
 	    fatal_error == MLX5_SENSOR_NIC_DISABLED ||
-	    fatal_error == MLX5_SENSOR_NIC_SW_RESET ||
-	    test_bit(MLX5_SKIP_SW_RESET, &health->flags)) {
+	    fatal_error == MLX5_SENSOR_NIC_SW_RESET) {
 		mlx5_core_warn(dev, "Not issuing FW reset. Either it's already done or won't help.\n");
 		return;
 	}
@@ -197,26 +193,65 @@ static void reset_fw_if_needed(struct mlx5_core_dev *d
 		    &dev->iseg->cmdq_addr_l_sz);
 }
 
+#define MLX5_CRDUMP_WAIT_MS	60000
+#define MLX5_FW_RESET_WAIT_MS	1000
+#define MLX5_NIC_STATE_POLL_MS	5
 void mlx5_enter_error_state(struct mlx5_core_dev *dev, bool force)
 {
+	unsigned long end, delay_ms = MLX5_CRDUMP_WAIT_MS;
+	u32 fatal_error;
+	int lock = -EBUSY;
+
 	mutex_lock(&dev->intf_state_mutex);
 	if (dev->state == MLX5_DEVICE_STATE_INTERNAL_ERROR) {
 		goto unlock;
 		return;
 	}
 
-	if (!force)
-		mlx5_core_err(dev, "internal state error detected\n");
-	if (check_fatal_sensors(dev) || force) {
-		reset_fw_if_needed(dev);
+	fatal_error = check_fatal_sensors(dev);
+
+	if (fatal_error || force) {
+		if (!force)
+			mlx5_core_err(dev, "internal state error detected\n");
 		dev->state = MLX5_DEVICE_STATE_INTERNAL_ERROR;
 		mlx5_trigger_cmd_completions(dev);
 	}
 
-	mlx5_core_event(dev, MLX5_DEV_EVENT_SYS_ERROR, 0);
-	if (!force)
-		mlx5_core_err(dev, "system error event triggered\n");
+	if (force)
+		goto err_state_done;
 
+	if (fatal_error == MLX5_SENSOR_FW_SYND_RFR) {
+		if (mlx5_core_is_pf(dev))
+			lock = lock_sem_sw_reset(dev, LOCK);
+
+		if (lock != -EBUSY) {
+			reset_fw_if_needed(dev);
+			delay_ms = MLX5_FW_RESET_WAIT_MS;
+		}
+	}
+
+	/* Recover from SW reset */
+	end = jiffies + msecs_to_jiffies(delay_ms);
+	do {
+		if (sensor_nic_disabled(dev))
+			break;
+
+		msleep(MLX5_NIC_STATE_POLL_MS);
+	} while (!time_after(jiffies, end));
+
+	if (!sensor_nic_disabled(dev)) {
+		dev_err(&dev->pdev->dev, "NIC IFC still %d after %lums.\n",
+			get_nic_mode(dev), delay_ms);
+	}
+
+	/* Release FW semaphore if you are the lock owner */
+	if (!lock)
+		lock_sem_sw_reset(dev, UNLOCK);
+
+	mlx5_core_err(dev, "system error event triggered\n");
+
+err_state_done:
+	mlx5_core_event(dev, MLX5_DEV_EVENT_SYS_ERROR, 0);
 unlock:
 	mutex_unlock(&dev->intf_state_mutex);
 }
@@ -265,7 +300,6 @@ static void health_recover(struct work_struct *work)
 	if (sensor_pci_no_comm(dev)) {
 		dev_err(&dev->pdev->dev, "health recovery flow aborted, PCI reads still not working\n");
 		recover = false;
-		goto clear_sem;
 	}
 
 	nic_mode = get_nic_mode(dev);
@@ -281,14 +315,6 @@ static void health_recover(struct work_struct *work)
 		recover = false;
 	}
 
-clear_sem:
-	if (test_and_clear_bit(MLX5_SW_RESET_SEM_LOCKED, &health->flags)) {
-		mlx5_core_dbg(dev, "Unlocking FW reset semaphore\n");
-		lock_sem_sw_reset(dev, UNLOCK);
-	}
-
-	test_and_clear_bit(MLX5_SKIP_SW_RESET, &health->flags);
-
 	if (recover) {
 		dev_err(&dev->pdev->dev, "starting health recovery flow\n");
 		mlx5_recover_device(dev);
@@ -312,28 +338,10 @@ static void health_care(struct work_struct *work)
 	struct mlx5_core_dev *dev;
 	struct mlx5_priv *priv;
 	unsigned long flags;
-	int ret;
 
 	health = container_of(work, struct mlx5_core_health, work);
 	priv = container_of(health, struct mlx5_priv, health);
 	dev = container_of(priv, struct mlx5_core_dev, priv);
-
-	if (mlx5_core_is_pf(dev)) {
-		ret = lock_sem_sw_reset(dev, LOCK);
-		if (!ret) {
-			mlx5_core_warn(dev, "Locked FW reset semaphore\n");
-			set_bit(MLX5_SW_RESET_SEM_LOCKED, &health->flags);
-		}
-		else if (ret == -EBUSY) {
-			/* sw reset will be skipped only in case we detect the
-			 * semaphore was already taken. In case of an error
-			 * while taking the semaphore we prefer to issue a
-			 * reset since longer cr-dump time and multiple resets
-			 * are better than a stuck fw.
-			 */
-			set_bit(MLX5_SKIP_SW_RESET, &health->flags);
-		}
-	}
 
 	mlx5_core_warn(dev, "handling bad device here\n");
 	mlx5_handle_bad_state(dev);

From owner-svn-src-head@freebsd.org  Fri Mar 30 19:48:26 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E08FF6020A;
 Fri, 30 Mar 2018 19:48:26 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id CEF807C3E8;
 Fri, 30 Mar 2018 19:48:25 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C28EA5686;
 Fri, 30 Mar 2018 19:48:25 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UJmPfu015989;
 Fri, 30 Mar 2018 19:48:25 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UJmPDr015988;
 Fri, 30 Mar 2018 19:48:25 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201803301948.w2UJmPDr015988@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
 hselasky@FreeBSD.org using -f
From: Hans Petter Selasky 
Date: Fri, 30 Mar 2018 19:48:25 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331823 - head/sys/dev/mlx5/mlx5_core
X-SVN-Group: head
X-SVN-Commit-Author: hselasky
X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core
X-SVN-Commit-Revision: 331823
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 19:48:26 -0000

Author: hselasky
Date: Fri Mar 30 19:48:25 2018
New Revision: 331823
URL: https://svnweb.freebsd.org/changeset/base/331823

Log:
  Collect firmware dump when mlx5core is in device error state.
  
  Firmware dump collecting should be triggered in case firmware syndrome
  with request for reset bit is set.
  
  MFC after:	3 days
  Submitted by:	slavash@
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_health.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_health.c	Fri Mar 30 19:45:48 2018	(r331822)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c	Fri Mar 30 19:48:25 2018	(r331823)
@@ -221,10 +221,13 @@ void mlx5_enter_error_state(struct mlx5_core_dev *dev,
 		goto err_state_done;
 
 	if (fatal_error == MLX5_SENSOR_FW_SYND_RFR) {
+		/* Get cr-dump and reset FW semaphore */
 		if (mlx5_core_is_pf(dev))
 			lock = lock_sem_sw_reset(dev, LOCK);
 
+		/* Execute cr-dump and SW reset */
 		if (lock != -EBUSY) {
+			mlx5_fwdump(dev);
 			reset_fw_if_needed(dev);
 			delay_ms = MLX5_FW_RESET_WAIT_MS;
 		}

From owner-svn-src-head@freebsd.org  Fri Mar 30 19:49:36 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E850F60357;
 Fri, 30 Mar 2018 19:49:36 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id C60B07C568;
 Fri, 30 Mar 2018 19:49:35 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C0D565687;
 Fri, 30 Mar 2018 19:49:35 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UJnZSe016070;
 Fri, 30 Mar 2018 19:49:35 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UJnZ57016069;
 Fri, 30 Mar 2018 19:49:35 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201803301949.w2UJnZ57016069@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
 hselasky@FreeBSD.org using -f
From: Hans Petter Selasky 
Date: Fri, 30 Mar 2018 19:49:35 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331824 - head/sys/dev/mlx5/mlx5_core
X-SVN-Group: head
X-SVN-Commit-Author: hselasky
X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core
X-SVN-Commit-Revision: 331824
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 19:49:36 -0000

Author: hselasky
Date: Fri Mar 30 19:49:35 2018
New Revision: 331824
URL: https://svnweb.freebsd.org/changeset/base/331824

Log:
  Make sure Giant is locked when allocating bus resources in mlx5core.
  
  During health care IRQ resources will be reallocated.
  Newbus requires that Giant is locked before accessing
  these resources.
  
  MFC after:	3 days
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_health.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_health.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_health.c	Fri Mar 30 19:48:25 2018	(r331823)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_health.c	Fri Mar 30 19:49:35 2018	(r331824)
@@ -300,6 +300,8 @@ static void health_recover(struct work_struct *work)
 	priv = container_of(health, struct mlx5_priv, health);
 	dev = container_of(priv, struct mlx5_core_dev, priv);
 
+	mtx_lock(&Giant);	/* XXX newbus needs this */
+
 	if (sensor_pci_no_comm(dev)) {
 		dev_err(&dev->pdev->dev, "health recovery flow aborted, PCI reads still not working\n");
 		recover = false;
@@ -322,6 +324,8 @@ static void health_recover(struct work_struct *work)
 		dev_err(&dev->pdev->dev, "starting health recovery flow\n");
 		mlx5_recover_device(dev);
 	}
+
+	mtx_unlock(&Giant);
 }
 
 /* How much time to wait until health resetting the driver (in msecs) */

From owner-svn-src-head@freebsd.org  Fri Mar 30 19:50:46 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20569F60539;
 Fri, 30 Mar 2018 19:50:46 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id CAE737C74F;
 Fri, 30 Mar 2018 19:50:45 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5D195698;
 Fri, 30 Mar 2018 19:50:45 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UJojNL016180;
 Fri, 30 Mar 2018 19:50:45 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UJojYe016179;
 Fri, 30 Mar 2018 19:50:45 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201803301950.w2UJojYe016179@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
 hselasky@FreeBSD.org using -f
From: Hans Petter Selasky 
Date: Fri, 30 Mar 2018 19:50:45 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331825 - head/sys/dev/mlx5/mlx5_core
X-SVN-Group: head
X-SVN-Commit-Author: hselasky
X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core
X-SVN-Commit-Revision: 331825
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 19:50:46 -0000

Author: hselasky
Date: Fri Mar 30 19:50:45 2018
New Revision: 331825
URL: https://svnweb.freebsd.org/changeset/base/331825

Log:
  Fix for use after free in mlx5core.
  
  Make sure the command completion handler is not called when the device is
  in internal error state. This can easily trigger use after free situations.
  
  MFC after:	3 days
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_eq.c

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c	Fri Mar 30 19:49:35 2018	(r331824)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c	Fri Mar 30 19:50:45 2018	(r331825)
@@ -254,7 +254,8 @@ static int mlx5_eq_int(struct mlx5_core_dev *dev, stru
 			break;
 
 		case MLX5_EVENT_TYPE_CMD:
-			mlx5_cmd_comp_handler(dev, be32_to_cpu(eqe->data.cmd.vector));
+			if (dev->state != MLX5_DEVICE_STATE_INTERNAL_ERROR)
+				mlx5_cmd_comp_handler(dev, be32_to_cpu(eqe->data.cmd.vector));
 			break;
 
 		case MLX5_EVENT_TYPE_PORT_CHANGE:

From owner-svn-src-head@freebsd.org  Fri Mar 30 19:55:32 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47893F60D71;
 Fri, 30 Mar 2018 19:55:32 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id EA8327CC82;
 Fri, 30 Mar 2018 19:55:31 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E542E5819;
 Fri, 30 Mar 2018 19:55:31 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UJtVpF020752;
 Fri, 30 Mar 2018 19:55:31 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UJtVrH020751;
 Fri, 30 Mar 2018 19:55:31 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201803301955.w2UJtVrH020751@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
 hselasky@FreeBSD.org using -f
From: Hans Petter Selasky 
Date: Fri, 30 Mar 2018 19:55:31 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331826 - head/sys/dev/mlx5/mlx5_core
X-SVN-Group: head
X-SVN-Commit-Author: hselasky
X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_core
X-SVN-Commit-Revision: 331826
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 19:55:32 -0000

Author: hselasky
Date: Fri Mar 30 19:55:31 2018
New Revision: 331826
URL: https://svnweb.freebsd.org/changeset/base/331826

Log:
  Bump mlx5core driver version.
  
  MFC after:	3 days
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/mlx5/mlx5_core/mlx5_core.h

Modified: head/sys/dev/mlx5/mlx5_core/mlx5_core.h
==============================================================================
--- head/sys/dev/mlx5/mlx5_core/mlx5_core.h	Fri Mar 30 19:50:45 2018	(r331825)
+++ head/sys/dev/mlx5/mlx5_core/mlx5_core.h	Fri Mar 30 19:55:31 2018	(r331826)
@@ -33,8 +33,10 @@
 #include 
 
 #define DRIVER_NAME "mlx5_core"
-#define DRIVER_VERSION "1.23.0 (03 Mar 2015)"
-#define DRIVER_RELDATE "03 Mar 2015"
+#ifndef DRIVER_VERSION
+#define DRIVER_VERSION "3.4.1"
+#endif
+#define DRIVER_RELDATE "February 2018"
 
 extern int mlx5_core_debug_mask;
 

From owner-svn-src-head@freebsd.org  Fri Mar 30 19:58:58 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D43EBF631CA;
 Fri, 30 Mar 2018 19:58:58 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 84D0A7CEEA;
 Fri, 30 Mar 2018 19:58:58 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F481581D;
 Fri, 30 Mar 2018 19:58:58 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UJwwbf020899;
 Fri, 30 Mar 2018 19:58:58 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UJwwrl020898;
 Fri, 30 Mar 2018 19:58:58 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201803301958.w2UJwwrl020898@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
 hselasky@FreeBSD.org using -f
From: Hans Petter Selasky 
Date: Fri, 30 Mar 2018 19:58:58 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331827 - head/sys/dev/mlx5
X-SVN-Group: head
X-SVN-Commit-Author: hselasky
X-SVN-Commit-Paths: head/sys/dev/mlx5
X-SVN-Commit-Revision: 331827
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 19:58:59 -0000

Author: hselasky
Date: Fri Mar 30 19:58:58 2018
New Revision: 331827
URL: https://svnweb.freebsd.org/changeset/base/331827

Log:
  Remove unused structure field in mlx5core.
  
  MFC after:	3 days
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/dev/mlx5/driver.h

Modified: head/sys/dev/mlx5/driver.h
==============================================================================
--- head/sys/dev/mlx5/driver.h	Fri Mar 30 19:55:31 2018	(r331826)
+++ head/sys/dev/mlx5/driver.h	Fri Mar 30 19:58:58 2018	(r331827)
@@ -371,7 +371,6 @@ struct mlx5_cmd {
 	struct cmd_msg_cache cache;
 	int checksum_disabled;
 	struct mlx5_cmd_stats stats[MLX5_CMD_OP_MAX];
-	int moving_to_polling;
 };
 
 struct mlx5_port_caps {

From owner-svn-src-head@freebsd.org  Fri Mar 30 20:11:13 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE7ACF64030;
 Fri, 30 Mar 2018 20:11:13 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 5CE3E7D6FF;
 Fri, 30 Mar 2018 20:11:13 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57BDC59E5;
 Fri, 30 Mar 2018 20:11:13 +0000 (UTC)
 (envelope-from hselasky@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UKBD2O029564;
 Fri, 30 Mar 2018 20:11:13 GMT (envelope-from hselasky@FreeBSD.org)
Received: (from hselasky@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UKBC8q029559;
 Fri, 30 Mar 2018 20:11:12 GMT (envelope-from hselasky@FreeBSD.org)
Message-Id: <201803302011.w2UKBC8q029559@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: hselasky set sender to
 hselasky@FreeBSD.org using -f
From: Hans Petter Selasky 
Date: Fri, 30 Mar 2018 20:11:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331828 - in head/sys/compat/linuxkpi/common:
 include/linux src
X-SVN-Group: head
X-SVN-Commit-Author: hselasky
X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src
X-SVN-Commit-Revision: 331828
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 20:11:14 -0000

Author: hselasky
Date: Fri Mar 30 20:11:12 2018
New Revision: 331828
URL: https://svnweb.freebsd.org/changeset/base/331828

Log:
  Optimise use of Giant in the LinuxKPI.
  
  - Make sure Giant is locked when calling PCI device methods.
  Newbus currently requires this.
  
  - Avoid unlocking Giant right before aquiring the sleepqueue lock.
  This can save a task switch.
  
  MFC after:	1 week
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/module.h
  head/sys/compat/linuxkpi/common/src/linux_compat.c
  head/sys/compat/linuxkpi/common/src/linux_pci.c
  head/sys/compat/linuxkpi/common/src/linux_rcu.c
  head/sys/compat/linuxkpi/common/src/linux_schedule.c

Modified: head/sys/compat/linuxkpi/common/include/linux/module.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/module.h	Fri Mar 30 19:58:58 2018	(r331827)
+++ head/sys/compat/linuxkpi/common/include/linux/module.h	Fri Mar 30 20:11:12 2018	(r331828)
@@ -78,9 +78,7 @@ _module_run(void *arg)
 		printf("Running %s (%p)\n", name, pc);
 #endif
 	fn = arg;
-	DROP_GIANT();
 	fn();
-	PICKUP_GIANT();
 }
 
 #define	module_init(fn)							\

Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_compat.c	Fri Mar 30 19:58:58 2018	(r331827)
+++ head/sys/compat/linuxkpi/common/src/linux_compat.c	Fri Mar 30 20:11:12 2018	(r331828)
@@ -1804,8 +1804,6 @@ linux_wait_for_common(struct completion *c, int flags)
 	if (SCHEDULER_STOPPED())
 		return (0);
 
-	DROP_GIANT();
-
 	task = current;
 
 	if (flags != 0)
@@ -1819,22 +1817,25 @@ linux_wait_for_common(struct completion *c, int flags)
 			break;
 		sleepq_add(c, NULL, "completion", flags, 0);
 		if (flags & SLEEPQ_INTERRUPTIBLE) {
+			DROP_GIANT();
 			error = -sleepq_wait_sig(c, 0);
+			PICKUP_GIANT();
 			if (error != 0) {
 				linux_schedule_save_interrupt_value(task, error);
 				error = -ERESTARTSYS;
 				goto intr;
 			}
-		} else
+		} else {
+			DROP_GIANT();
 			sleepq_wait(c, 0);
+			PICKUP_GIANT();
+		}
 	}
 	if (c->done != UINT_MAX)
 		c->done--;
 	sleepq_release(c);
 
 intr:
-	PICKUP_GIANT();
-
 	return (error);
 }
 
@@ -1851,8 +1852,6 @@ linux_wait_for_timeout_common(struct completion *c, in
 	if (SCHEDULER_STOPPED())
 		return (0);
 
-	DROP_GIANT();
-
 	task = current;
 
 	if (flags != 0)
@@ -1866,10 +1865,14 @@ linux_wait_for_timeout_common(struct completion *c, in
 			break;
 		sleepq_add(c, NULL, "completion", flags, 0);
 		sleepq_set_timeout(c, linux_timer_jiffies_until(end));
+
+		DROP_GIANT();
 		if (flags & SLEEPQ_INTERRUPTIBLE)
 			error = -sleepq_timedwait_sig(c, 0);
 		else
 			error = -sleepq_timedwait(c, 0);
+		PICKUP_GIANT();
+
 		if (error != 0) {
 			/* check for timeout */
 			if (error == -EWOULDBLOCK) {
@@ -1889,8 +1892,6 @@ linux_wait_for_timeout_common(struct completion *c, in
 	/* return how many jiffies are left */
 	error = linux_timer_jiffies_until(end);
 done:
-	PICKUP_GIANT();
-
 	return (error);
 }
 

Modified: head/sys/compat/linuxkpi/common/src/linux_pci.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_pci.c	Fri Mar 30 19:58:58 2018	(r331827)
+++ head/sys/compat/linuxkpi/common/src/linux_pci.c	Fri Mar 30 20:11:12 2018	(r331828)
@@ -171,12 +171,11 @@ linux_pci_attach(device_t dev)
 		pdev->bus = pbus;
 	}
 
-	DROP_GIANT();
 	spin_lock(&pci_lock);
 	list_add(&pdev->links, &pci_devices);
 	spin_unlock(&pci_lock);
+
 	error = pdrv->probe(pdev, id);
-	PICKUP_GIANT();
 	if (error) {
 		spin_lock(&pci_lock);
 		list_del(&pdev->links);
@@ -194,9 +193,9 @@ linux_pci_detach(device_t dev)
 
 	linux_set_current(curthread);
 	pdev = device_get_softc(dev);
-	DROP_GIANT();
+
 	pdev->pdrv->remove(pdev);
-	PICKUP_GIANT();
+
 	spin_lock(&pci_lock);
 	list_del(&pdev->links);
 	spin_unlock(&pci_lock);
@@ -258,11 +257,8 @@ linux_pci_shutdown(device_t dev)
 
 	linux_set_current(curthread);
 	pdev = device_get_softc(dev);
-	if (pdev->pdrv->shutdown != NULL) {
-		DROP_GIANT();
+	if (pdev->pdrv->shutdown != NULL)
 		pdev->pdrv->shutdown(pdev);
-		PICKUP_GIANT();
-	}
 	return (0);
 }
 

Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_rcu.c	Fri Mar 30 19:58:58 2018	(r331827)
+++ head/sys/compat/linuxkpi/common/src/linux_rcu.c	Fri Mar 30 20:11:12 2018	(r331828)
@@ -297,13 +297,13 @@ linux_synchronize_rcu(void)
 
 	td = curthread;
 
-	DROP_GIANT();
-
 	/*
 	 * Synchronizing RCU might change the CPU core this function
 	 * is running on. Save current values:
 	 */
 	thread_lock(td);
+
+	DROP_GIANT();
 
 	old_cpu = PCPU_GET(cpuid);
 	old_pinned = td->td_pinned;

Modified: head/sys/compat/linuxkpi/common/src/linux_schedule.c
==============================================================================
--- head/sys/compat/linuxkpi/common/src/linux_schedule.c	Fri Mar 30 19:58:58 2018	(r331827)
+++ head/sys/compat/linuxkpi/common/src/linux_schedule.c	Fri Mar 30 20:11:12 2018	(r331828)
@@ -55,6 +55,8 @@ linux_add_to_sleepqueue(void *wchan, struct task_struc
 	sleepq_add(wchan, NULL, wmesg, flags, 0);
 	if (timeout != 0)
 		sleepq_set_timeout(wchan, timeout);
+
+	DROP_GIANT();
 	if ((state & TASK_INTERRUPTIBLE) != 0) {
 		if (timeout == 0)
 			ret = -sleepq_wait_sig(wchan, 0);
@@ -67,6 +69,8 @@ linux_add_to_sleepqueue(void *wchan, struct task_struc
 		} else
 			ret = -sleepq_timedwait(wchan, 0);
 	}
+	PICKUP_GIANT();
+
 	/* filter return value */
 	if (ret != 0 && ret != -EWOULDBLOCK) {
 		linux_schedule_save_interrupt_value(task, ret);
@@ -248,8 +252,6 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q
 	if (lock != NULL)
 		spin_unlock_irq(lock);
 
-	DROP_GIANT();
-
 	/* range check timeout */
 	if (timeout < 1)
 		timeout = 1;
@@ -272,8 +274,6 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q
 	}
 	PRELE(task->task_thread->td_proc);
 
-	PICKUP_GIANT();
-
 	if (lock != NULL)
 		spin_lock_irq(lock);
 	return (ret);
@@ -297,8 +297,6 @@ linux_schedule_timeout(int timeout)
 
 	remainder = ticks + timeout;
 
-	DROP_GIANT();
-
 	sleepq_lock(task);
 	state = atomic_read(&task->state);
 	if (state != TASK_WAKING) {
@@ -309,8 +307,6 @@ linux_schedule_timeout(int timeout)
 	}
 	set_task_state(task, TASK_RUNNING);
 
-	PICKUP_GIANT();
-
 	if (timeout == 0)
 		return (MAX_SCHEDULE_TIMEOUT);
 
@@ -356,8 +352,6 @@ linux_wait_on_bit_timeout(unsigned long *word, int bit
 	void *wchan;
 	int ret;
 
-	DROP_GIANT();
-
 	/* range check timeout */
 	if (timeout < 1)
 		timeout = 1;
@@ -380,8 +374,6 @@ linux_wait_on_bit_timeout(unsigned long *word, int bit
 	}
 	set_task_state(task, TASK_RUNNING);
 
-	PICKUP_GIANT();
-
 	return (ret);
 }
 
@@ -399,8 +391,6 @@ linux_wait_on_atomic_t(atomic_t *a, unsigned int state
 	void *wchan;
 	int ret;
 
-	DROP_GIANT();
-
 	task = current;
 	wchan = a;
 	for (;;) {
@@ -416,8 +406,6 @@ linux_wait_on_atomic_t(atomic_t *a, unsigned int state
 			break;
 	}
 	set_task_state(task, TASK_RUNNING);
-
-	PICKUP_GIANT();
 
 	return (ret);
 }

From owner-svn-src-head@freebsd.org  Fri Mar 30 20:24:30 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53F1FF64FAC;
 Fri, 30 Mar 2018 20:24:30 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 017957E012;
 Fri, 30 Mar 2018 20:24:30 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F04FB5CEA;
 Fri, 30 Mar 2018 20:24:29 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UKOTX6036281;
 Fri, 30 Mar 2018 20:24:29 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UKOTvH036277;
 Fri, 30 Mar 2018 20:24:29 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803302024.w2UKOTvH036277@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Fri, 30 Mar 2018 20:24:29 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331829 - in head/sys/dev: ex ixgb nxge vxge
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: in head/sys/dev: ex ixgb nxge vxge
X-SVN-Commit-Revision: 331829
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 20:24:30 -0000

Author: brooks
Date: Fri Mar 30 20:24:29 2018
New Revision: 331829
URL: https://svnweb.freebsd.org/changeset/base/331829

Log:
  Fall back to ether_ioctl() by default.
  
  The common pratice in ethernet device drivers is to fall back to
  ether_ioctl() to implement generic ioctls not implemented by the driver
  and to fail if no handler exists.
  
  Convert these drivers to follow that practice rather than calling
  ether_ioctl() for specific cases.
  
  vxge(4) aready had the default case, but it was only called on failure
  to match.
  
  Reviewed by:	imp
  Obtained from:	CheriBSD
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14895

Modified:
  head/sys/dev/ex/if_ex.c
  head/sys/dev/ixgb/if_ixgb.c
  head/sys/dev/nxge/if_nxge.c
  head/sys/dev/vxge/vxge.c

Modified: head/sys/dev/ex/if_ex.c
==============================================================================
--- head/sys/dev/ex/if_ex.c	Fri Mar 30 20:11:12 2018	(r331828)
+++ head/sys/dev/ex/if_ex.c	Fri Mar 30 20:24:29 2018	(r331829)
@@ -823,12 +823,6 @@ ex_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 	DODEBUG(Start_End, printf("%s: ex_ioctl: start ", ifp->if_xname););
 
 	switch(cmd) {
-		case SIOCSIFADDR:
-		case SIOCGIFADDR:
-		case SIOCSIFMTU:
-			error = ether_ioctl(ifp, cmd, data);
-			break;
-
 		case SIOCSIFFLAGS:
 			DODEBUG(Start_End, printf("SIOCSIFFLAGS"););
 			EX_LOCK(sc);
@@ -850,8 +844,8 @@ ex_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
 			error = ifmedia_ioctl(ifp, ifr, &sc->ifmedia, cmd);
 			break;
 		default:
-			DODEBUG(Start_End, printf("unknown"););
-			error = EINVAL;
+			error = ether_ioctl(ifp, cmd, data);
+			break;
 	}
 
 	DODEBUG(Start_End, printf("\n%s: ex_ioctl: finish\n", ifp->if_xname););

Modified: head/sys/dev/ixgb/if_ixgb.c
==============================================================================
--- head/sys/dev/ixgb/if_ixgb.c	Fri Mar 30 20:11:12 2018	(r331828)
+++ head/sys/dev/ixgb/if_ixgb.c	Fri Mar 30 20:24:29 2018	(r331829)
@@ -525,11 +525,6 @@ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD_TYPE command,
 		goto out;
 
 	switch (command) {
-	case SIOCSIFADDR:
-	case SIOCGIFADDR:
-		IOCTL_DEBUGOUT("ioctl rcv'd: SIOCxIFADDR (Get/Set Interface Addr)");
-		ether_ioctl(ifp, command, data);
-		break;
 	case SIOCSIFMTU:
 		IOCTL_DEBUGOUT("ioctl rcv'd: SIOCSIFMTU (Set Interface MTU)");
 		if (ifr->ifr_mtu > IXGB_MAX_JUMBO_FRAME_SIZE - ETHER_HDR_LEN) {
@@ -610,8 +605,8 @@ ixgb_ioctl(struct ifnet * ifp, IOCTL_CMD_TYPE command,
 		}
 		break;
 	default:
-		IOCTL_DEBUGOUT1("ioctl received: UNKNOWN (0x%X)\n", (int)command);
-		error = EINVAL;
+		error = ether_ioctl(ifp, command, data);
+		break;
 	}
 
 out:

Modified: head/sys/dev/nxge/if_nxge.c
==============================================================================
--- head/sys/dev/nxge/if_nxge.c	Fri Mar 30 20:11:12 2018	(r331828)
+++ head/sys/dev/nxge/if_nxge.c	Fri Mar 30 20:24:29 2018	(r331829)
@@ -1623,12 +1623,6 @@ xge_ioctl(struct ifnet *ifnetp, unsigned long command,
 	}
 
 	switch(command) {
-	    /* Set/Get ifnet address */
-	    case SIOCSIFADDR:
-	    case SIOCGIFADDR:
-	        ether_ioctl(ifnetp, command, data);
-	        break;
-
 	    /* Set ifnet MTU */
 	    case SIOCSIFMTU:
 	        retValue = xge_change_mtu(lldev, ifreqp->ifr_mtu);
@@ -1713,7 +1707,7 @@ xge_ioctl(struct ifnet *ifnetp, unsigned long command,
 	        break;
 
 	    default:
-	        retValue = EINVAL;
+	        retValue = ether_ioctl(ifnetp, command, data);
 	        break;
 	}
 	return retValue;

Modified: head/sys/dev/vxge/vxge.c
==============================================================================
--- head/sys/dev/vxge/vxge.c	Fri Mar 30 20:11:12 2018	(r331828)
+++ head/sys/dev/vxge/vxge.c	Fri Mar 30 20:24:29 2018	(r331829)
@@ -3573,12 +3573,6 @@ vxge_ioctl(ifnet_t ifp, u_long command, caddr_t data)
 		return (EBUSY);
 
 	switch (command) {
-		/* Set/Get ifnet address */
-	case SIOCSIFADDR:
-	case SIOCGIFADDR:
-		ether_ioctl(ifp, command, data);
-		break;
-
 		/* Set Interface MTU */
 	case SIOCSIFMTU:
 		err = vxge_change_mtu(vdev, (unsigned long)ifr->ifr_mtu);

From owner-svn-src-head@freebsd.org  Fri Mar 30 20:27:48 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15E88F66344;
 Fri, 30 Mar 2018 20:27:48 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id B61F37E222;
 Fri, 30 Mar 2018 20:27:47 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A59EC5CEF;
 Fri, 30 Mar 2018 20:27:47 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2UKRlLw036555;
 Fri, 30 Mar 2018 20:27:47 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2UKRl81036549;
 Fri, 30 Mar 2018 20:27:47 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803302027.w2UKRl81036549@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Fri, 30 Mar 2018 20:27:47 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331830 - in head: share/man/man4 sys/dev/cm sys/dev/pdq
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/cm sys/dev/pdq
X-SVN-Commit-Revision: 331830
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 20:27:48 -0000

Author: brooks
Date: Fri Mar 30 20:27:47 2018
New Revision: 331830
URL: https://svnweb.freebsd.org/changeset/base/331830

Log:
  Add deprecation notices for Arcnet and FDDI drivers.
  
  We intend to remove support before FreeBSD 12 is branched.
  
  Reviewed by:	imp, emaste
  MFC after:	3 days
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14890

Modified:
  head/share/man/man4/cm.4
  head/share/man/man4/fpa.4
  head/sys/dev/cm/if_cm_isa.c
  head/sys/dev/pdq/if_fpa.c

Modified: head/share/man/man4/cm.4
==============================================================================
--- head/share/man/man4/cm.4	Fri Mar 30 20:24:29 2018	(r331829)
+++ head/share/man/man4/cm.4	Fri Mar 30 20:27:47 2018	(r331830)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd July 16, 2005
+.Dd March 29, 2018
 .Dt CM 4
 .Os
 .Sh NAME
@@ -46,6 +46,12 @@ module at boot time, place the following line in
 .Bd -literal -offset indent
 if_cm_load="YES"
 .Ed
+.Sh DEPRECATION NOTICE
+The
+.Nm
+driver is not present in
+.Fx 12.0
+and later.
 .Sh DESCRIPTION
 The
 .Nm

Modified: head/share/man/man4/fpa.4
==============================================================================
--- head/share/man/man4/fpa.4	Fri Mar 30 20:24:29 2018	(r331829)
+++ head/share/man/man4/fpa.4	Fri Mar 30 20:27:47 2018	(r331830)
@@ -4,7 +4,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd February 15, 2017
+.Dd March 29, 2018
 .Dt FPA 4
 .Os
 .Sh NAME
@@ -16,6 +16,12 @@
 .Fx
 only:
 .Cd "device fddi"
+.Sh DEPRECATION NOTICE
+The
+.Nm
+driver is not present in
+.Fx 12.0
+and later.
 .Sh DESCRIPTION
 The
 .Nm

Modified: head/sys/dev/cm/if_cm_isa.c
==============================================================================
--- head/sys/dev/cm/if_cm_isa.c	Fri Mar 30 20:24:29 2018	(r331829)
+++ head/sys/dev/cm/if_cm_isa.c	Fri Mar 30 20:27:47 2018	(r331830)
@@ -113,6 +113,7 @@ cm_isa_attach(dev)
 	if (error)
 		goto err;
 
+	gone_in_dev(dev, 12, "cm(4) driver");
 	return 0;
 
 err:

Modified: head/sys/dev/pdq/if_fpa.c
==============================================================================
--- head/sys/dev/pdq/if_fpa.c	Fri Mar 30 20:24:29 2018	(r331829)
+++ head/sys/dev/pdq/if_fpa.c	Fri Mar 30 20:27:47 2018	(r331830)
@@ -158,6 +158,7 @@ pdq_pci_attach(device_t dev)
     }
 
 
+    gone_in_dev(dev, 12, "fpa(4) driver");
     return (0);
 bad:
     pdq_free(dev);

From owner-svn-src-head@freebsd.org  Fri Mar 30 21:13:34 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB675F6AA02;
 Fri, 30 Mar 2018 21:13:34 +0000 (UTC)
 (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 29CF280454;
 Fri, 30 Mar 2018 21:13:33 +0000 (UTC)
 (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1])
 by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w2ULDNdl070087;
 Fri, 30 Mar 2018 14:13:23 -0700 (PDT)
 (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net)
Received: (from freebsd@localhost)
 by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w2ULDMbv070086;
 Fri, 30 Mar 2018 14:13:22 -0700 (PDT) (envelope-from freebsd)
From: "Rodney W. Grimes" 
Message-Id: <201803302113.w2ULDMbv070086@pdx.rh.CN85.dnsmgr.net>
Subject: Re: svn commit: r331830 - in head: share/man/man4 sys/dev/cm
 sys/dev/pdq
In-Reply-To: <201803302027.w2UKRl81036549@repo.freebsd.org>
To: Brooks Davis 
Date: Fri, 30 Mar 2018 14:13:22 -0700 (PDT)
CC: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Reply-To: rgrimes@freebsd.org
X-Mailer: ELM [version 2.4ME+ PL121h (25)]
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 21:13:34 -0000

> Author: brooks
> Date: Fri Mar 30 20:27:47 2018
> New Revision: 331830
> URL: https://svnweb.freebsd.org/changeset/base/331830
> 
> Log:
>   Add deprecation notices for Arcnet and FDDI drivers.
>   
>   We intend to remove support before FreeBSD 12 is branched.
>   
>   Reviewed by:	imp, emaste
>   MFC after:	3 days
>   Sponsored by:	DARPA, AFRL
>   Differential Revision:	https://reviews.freebsd.org/D14890
> 
> Modified:
>   head/share/man/man4/cm.4
>   head/share/man/man4/fpa.4
>   head/sys/dev/cm/if_cm_isa.c
>   head/sys/dev/pdq/if_fpa.c

There is still an if_fea.c, which is also an FDDI driver, in the
11.1 src tree.
Not sure what happened to it in ^head, as it seems missing.

You'll probably need to make a direct commit to add a
+    gone_in_dev(dev, 12, "fea(4) driver");

Thanks,
Rod

> 
> Modified: head/share/man/man4/cm.4
> ==============================================================================
> --- head/share/man/man4/cm.4	Fri Mar 30 20:24:29 2018	(r331829)
> +++ head/share/man/man4/cm.4	Fri Mar 30 20:27:47 2018	(r331830)
> @@ -25,7 +25,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd July 16, 2005
> +.Dd March 29, 2018
>  .Dt CM 4
>  .Os
>  .Sh NAME
> @@ -46,6 +46,12 @@ module at boot time, place the following line in
>  .Bd -literal -offset indent
>  if_cm_load="YES"
>  .Ed
> +.Sh DEPRECATION NOTICE
> +The
> +.Nm
> +driver is not present in
> +.Fx 12.0
> +and later.
>  .Sh DESCRIPTION
>  The
>  .Nm
> 
> Modified: head/share/man/man4/fpa.4
> ==============================================================================
> --- head/share/man/man4/fpa.4	Fri Mar 30 20:24:29 2018	(r331829)
> +++ head/share/man/man4/fpa.4	Fri Mar 30 20:27:47 2018	(r331830)
> @@ -4,7 +4,7 @@
>  .\"
>  .\" $FreeBSD$
>  .\"
> -.Dd February 15, 2017
> +.Dd March 29, 2018
>  .Dt FPA 4
>  .Os
>  .Sh NAME
> @@ -16,6 +16,12 @@
>  .Fx
>  only:
>  .Cd "device fddi"
> +.Sh DEPRECATION NOTICE
> +The
> +.Nm
> +driver is not present in
> +.Fx 12.0
> +and later.
>  .Sh DESCRIPTION
>  The
>  .Nm
> 
> Modified: head/sys/dev/cm/if_cm_isa.c
> ==============================================================================
> --- head/sys/dev/cm/if_cm_isa.c	Fri Mar 30 20:24:29 2018	(r331829)
> +++ head/sys/dev/cm/if_cm_isa.c	Fri Mar 30 20:27:47 2018	(r331830)
> @@ -113,6 +113,7 @@ cm_isa_attach(dev)
>  	if (error)
>  		goto err;
>  
> +	gone_in_dev(dev, 12, "cm(4) driver");
>  	return 0;
>  
>  err:
> 
> Modified: head/sys/dev/pdq/if_fpa.c
> ==============================================================================
> --- head/sys/dev/pdq/if_fpa.c	Fri Mar 30 20:24:29 2018	(r331829)
> +++ head/sys/dev/pdq/if_fpa.c	Fri Mar 30 20:27:47 2018	(r331830)
> @@ -158,6 +158,7 @@ pdq_pci_attach(device_t dev)
>      }
>  
>  
> +    gone_in_dev(dev, 12, "fpa(4) driver");
>      return (0);
>  bad:
>      pdq_free(dev);
> 
> 

-- 
Rod Grimes                                                 rgrimes@freebsd.org

From owner-svn-src-head@freebsd.org  Fri Mar 30 21:38:54 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ED15F6C53A;
 Fri, 30 Mar 2018 21:38:54 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 159E081700;
 Fri, 30 Mar 2018 21:38:54 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0D11F684B;
 Fri, 30 Mar 2018 21:38:54 +0000 (UTC)
 (envelope-from brooks@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2ULcrKe072846;
 Fri, 30 Mar 2018 21:38:53 GMT (envelope-from brooks@FreeBSD.org)
Received: (from brooks@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2ULcrjl072844;
 Fri, 30 Mar 2018 21:38:53 GMT (envelope-from brooks@FreeBSD.org)
Message-Id: <201803302138.w2ULcrjl072844@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: brooks set sender to
 brooks@FreeBSD.org using -f
From: Brooks Davis 
Date: Fri, 30 Mar 2018 21:38:53 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331831 - in head/sys: net netinet6
X-SVN-Group: head
X-SVN-Commit-Author: brooks
X-SVN-Commit-Paths: in head/sys: net netinet6
X-SVN-Commit-Revision: 331831
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 21:38:54 -0000

Author: brooks
Date: Fri Mar 30 21:38:53 2018
New Revision: 331831
URL: https://svnweb.freebsd.org/changeset/base/331831

Log:
  Document and enforce assumptions about struct (in6_)ifreq.
  
  - The two types must be type-punnable for shared members of ifr_ifru.
    This allows compatibility accessors to be shared.
  
  - There must be no padding gap between ifr_name and ifr_ifru.  This is
    assumed in tcpdump's use of SIOCGIFFLAGS output which attempts to be
    broadly portable.  This is true for all current architectures, but very
    large (256-bit) fat-pointers could violate this invariant.
  
  Reviewed by:	kib
  Obtained from:	CheriBSD
  Sponsored by:	DARPA, AFRL
  Differential Revision:	https://reviews.freebsd.org/D14910

Modified:
  head/sys/net/if.c
  head/sys/netinet6/in6.c

Modified: head/sys/net/if.c
==============================================================================
--- head/sys/net/if.c	Fri Mar 30 20:27:47 2018	(r331830)
+++ head/sys/net/if.c	Fri Mar 30 21:38:53 2018	(r331831)
@@ -97,6 +97,13 @@
 
 #include 
 
+/*
+ * Consumers of struct ifreq such as tcpdump assume no pad between ifr_name
+ * and ifr_ifru when it is used in SIOCGIFCONF.
+ */
+_Static_assert(sizeof(((struct ifreq *)0)->ifr_name) ==
+    offsetof(struct ifreq, ifr_ifru), "gap between ifr_name and ifr_ifru");
+
 #ifdef COMPAT_FREEBSD32
 #include 
 #include 

Modified: head/sys/netinet6/in6.c
==============================================================================
--- head/sys/netinet6/in6.c	Fri Mar 30 20:27:47 2018	(r331830)
+++ head/sys/netinet6/in6.c	Fri Mar 30 21:38:53 2018	(r331831)
@@ -112,6 +112,14 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+/*
+ * struct in6_ifreq and struct ifreq must be type punnable for common members
+ * of ifr_ifru to allow accessors to be shared.
+ */
+_Static_assert(offsetof(struct in6_ifreq, ifr_ifru) ==
+    offsetof(struct ifreq, ifr_ifru),
+    "struct in6_ifreq and struct ifreq are not type punnable");
+
 VNET_DECLARE(int, icmp6_nodeinfo_oldmcprefix);
 #define V_icmp6_nodeinfo_oldmcprefix	VNET(icmp6_nodeinfo_oldmcprefix)
 

From owner-svn-src-head@freebsd.org  Fri Mar 30 21:41:16 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 018FFF6C9F6;
 Fri, 30 Mar 2018 21:41:16 +0000 (UTC)
 (envelope-from brooks@spindle.one-eyed-alien.net)
Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net
 [199.48.129.229])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id C6B4E81ACB;
 Fri, 30 Mar 2018 21:41:15 +0000 (UTC)
 (envelope-from brooks@spindle.one-eyed-alien.net)
Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001)
 id CDBF25A9F17; Fri, 30 Mar 2018 21:41:14 +0000 (UTC)
Date: Fri, 30 Mar 2018 21:41:14 +0000
From: Brooks Davis 
To: rgrimes@freebsd.org
Cc: Brooks Davis , src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r331830 - in head: share/man/man4 sys/dev/cm
 sys/dev/pdq
Message-ID: <20180330214114.GA53770@spindle.one-eyed-alien.net>
References: <201803302027.w2UKRl81036549@repo.freebsd.org>
 <201803302113.w2ULDMbv070086@pdx.rh.CN85.dnsmgr.net>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
 protocol="application/pgp-signature"; boundary="Q68bSM7Ycu6FN28Q"
Content-Disposition: inline
In-Reply-To: <201803302113.w2ULDMbv070086@pdx.rh.CN85.dnsmgr.net>
User-Agent: Mutt/1.9.4 (2018-02-28)
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Fri, 30 Mar 2018 21:41:16 -0000


--Q68bSM7Ycu6FN28Q
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Mar 30, 2018 at 02:13:22PM -0700, Rodney W. Grimes wrote:
> > Author: brooks
> > Date: Fri Mar 30 20:27:47 2018
> > New Revision: 331830
> > URL: https://svnweb.freebsd.org/changeset/base/331830
> >=20
> > Log:
> >   Add deprecation notices for Arcnet and FDDI drivers.
> >  =20
> >   We intend to remove support before FreeBSD 12 is branched.
> >  =20
> >   Reviewed by:	imp, emaste
> >   MFC after:	3 days
> >   Sponsored by:	DARPA, AFRL
> >   Differential Revision:	https://reviews.freebsd.org/D14890
> >=20
> > Modified:
> >   head/share/man/man4/cm.4
> >   head/share/man/man4/fpa.4
> >   head/sys/dev/cm/if_cm_isa.c
> >   head/sys/dev/pdq/if_fpa.c
>=20
> There is still an if_fea.c, which is also an FDDI driver, in the
> 11.1 src tree.
> Not sure what happened to it in ^head, as it seems missing.

It went away with EISA support.

> You'll probably need to make a direct commit to add a
> +    gone_in_dev(dev, 12, "fea(4) driver");

Thanks for the reminder, I'll do that now.

-- Brooks

--Q68bSM7Ycu6FN28Q
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJavq76AAoJEKzQXbSebgfAuoAIAIgrSi5WEIETc14j5JhEWOBR
YwPElGM48tkhjsjZOselWF5oQNNmYHDL0AI+WM+tN4o0Ek/+FU/A6/Q641lY7A0Q
9ax1u/94ykQU9Dm6JckuHqtcghwhBD9ivIhPZxB1C9Y8v2HOU1CB5AY/oLepXmr3
QkmsqPAWTorXtVvG5kuLfZPwifnaNxGn8UUd45+sDkqOm4Umn4AvPxlcn/9pZ2wP
eJOvewthOIl+PZbjYorSDFQDjdZsyxao8OlqF3m63Tm/SI8khNGkxe9PGnrAPzUB
ExItm60xGt8DJFGsv5K8FMbnM+BprPZjBTLkqVDl22pevL3s4V5iCzCi1lrMkwA=
=I36g
-----END PGP SIGNATURE-----

--Q68bSM7Ycu6FN28Q--

From owner-svn-src-head@freebsd.org  Sat Mar 31 05:17:15 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DA6EF5A47E;
 Sat, 31 Mar 2018 05:17:15 +0000 (UTC) (envelope-from jah@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id E8374720D0;
 Sat, 31 Mar 2018 05:17:12 +0000 (UTC) (envelope-from jah@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD5B7136C2;
 Sat, 31 Mar 2018 05:17:12 +0000 (UTC) (envelope-from jah@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2V5HCbp015285;
 Sat, 31 Mar 2018 05:17:12 GMT (envelope-from jah@FreeBSD.org)
Received: (from jah@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2V5HCSg015284;
 Sat, 31 Mar 2018 05:17:12 GMT (envelope-from jah@FreeBSD.org)
Message-Id: <201803310517.w2V5HCSg015284@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: jah set sender to jah@FreeBSD.org
 using -f
From: "Jason A. Harmening" 
Date: Sat, 31 Mar 2018 05:17:12 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331836 - head/sys/conf
X-SVN-Group: head
X-SVN-Commit-Author: jah
X-SVN-Commit-Paths: head/sys/conf
X-SVN-Commit-Revision: 331836
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 31 Mar 2018 05:17:15 -0000

Author: jah
Date: Sat Mar 31 05:17:12 2018
New Revision: 331836
URL: https://svnweb.freebsd.org/changeset/base/331836

Log:
  Remove MK_AUTO_OBJ from env passed to PORTS_MODULES
  
  This fixes a failure to resolve object file paths seen when buildkernel
  (which sets MK_AUTO_OBJ=yes) and installkernel (which sets MK_AUTO_OBJ=no)
  are run as separate steps.  r329232 partially fixed this scenario by removing
  MAKEOBJDIR, but it seems the AUTO_OBJ setting also needs to be on the same
  page for the build and install steps.
  
  Reviewed by:	bdrewery
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D14143

Modified:
  head/sys/conf/kern.post.mk

Modified: head/sys/conf/kern.post.mk
==============================================================================
--- head/sys/conf/kern.post.mk	Sat Mar 31 01:37:14 2018	(r331835)
+++ head/sys/conf/kern.post.mk	Sat Mar 31 05:17:12 2018	(r331836)
@@ -70,8 +70,9 @@ PORTSMODULESENV=\
 	-u CXX \
 	-u CPP \
 	-u MAKESYSPATH \
+	-u MK_AUTO_OBJ \
 	-u MAKEOBJDIR \
-	MAKEFLAGS="${MAKEFLAGS:M*:tW:S/^-m /-m_/g:S/ -m / -m_/g:tw:N-m_*}" \
+	MAKEFLAGS="${MAKEFLAGS:M*:tW:S/^-m /-m_/g:S/ -m / -m_/g:tw:N-m_*:NMK_AUTO_OBJ=*}" \
 	SYSDIR=${SYSDIR} \
 	PATH=${PATH}:${LOCALBASE}/bin:${LOCALBASE}/sbin \
 	SRC_BASE=${SRC_BASE} \

From owner-svn-src-head@freebsd.org  Sat Mar 31 09:19:20 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80F85F7177F;
 Sat, 31 Mar 2018 09:19:20 +0000 (UTC)
 (envelope-from freebsd@omnilan.de)
Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 07F757A30B;
 Sat, 31 Mar 2018 09:19:19 +0000 (UTC)
 (envelope-from freebsd@omnilan.de)
Received: from mh0.gentlemail.de (mh0.gentlemail.de [78.138.80.135])
 by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id w2V9JIvm012358;
 Sat, 31 Mar 2018 11:19:18 +0200 (CEST)
 (envelope-from freebsd@omnilan.de)
Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mh0.gentlemail.de (Postfix) with ESMTPSA id 8C126F6E;
 Sat, 31 Mar 2018 11:19:18 +0200 (CEST)
Message-ID: <5ABF5296.3050307@omnilan.de>
Date: Sat, 31 Mar 2018 11:19:18 +0200
From: Harry Schmalzbauer 
Organization: OmniLAN
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE;
 rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2
MIME-Version: 1.0
To: Andriy Voskoboinyk 
CC: Bryan Drewery , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r324673 - head/sys/kern
References: <201710162146.v9GLkB6t036842@repo.freebsd.org>
 <5305175e-e8d2-453d-9ba6-0281af1582a9@FreeBSD.org>
 
In-Reply-To: 
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Greylist: ACL 130 matched, not delayed by milter-greylist-4.2.7
 (mx0.gentlemail.de [78.138.80.130]); Sat, 31 Mar 2018 11:19:18 +0200 (CEST)
X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135;
 Sender-helo: mh0.gentlemail.de; )
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 31 Mar 2018 09:19:20 -0000

 Bezüglich Andriy Voskoboinyk's Nachricht vom 17.10.2017 00:50 (localtime):
> Tue, 17 Oct 2017 00:53:28 +0300 було написано Bryan Drewery
> :
>
>> On 10/16/2017 2:46 PM, Andriy Voskoboinyk wrote:
>>> Author: avos
>>> Date: Mon Oct 16 21:46:11 2017
>>> New Revision: 324673
>>> URL: https://svnweb.freebsd.org/changeset/base/324673
>>>
>>> Log:
>>>   mbuf(9): unbreak m_fragment()
>>
>> How was it broken
>
> Due to m_cat() usage reason (as described below); this part was
> not changed since function creation in r119644.
>
>> and since when?
>
> No idea here - probably, it was partially working until m_cat()
> improvement in r242256.
>
> P.S. Just checked with m_fragment(m, M_NOWAIT, -2) placed
> right before ieee80211_mbuf_defrag() (from D4077) and
> various m_len printf's before and after - it defragments
> frames before this change and works as intended after it.
>
>>
>>>
>>>   - Fix it by replacing m_cat() with m_prev->m_next = m_new
>>>   (m_cat() will try to append data - as a result, there will be no
>>>   fragmentation).
>>>   - Move some constants out of the loop.
>>>
>>>   Was previously tested with D4077.
>>>
>>>   Differential Revision:    https://reviews.freebsd.org/D4090


Will r324673 be MFCd before 11.2?

Thanks,

-harry

From owner-svn-src-head@freebsd.org  Sat Mar 31 09:33:50 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78FD0F7268F;
 Sat, 31 Mar 2018 09:33:50 +0000 (UTC)
 (envelope-from freebsd@omnilan.de)
Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 006527ACE1;
 Sat, 31 Mar 2018 09:33:49 +0000 (UTC)
 (envelope-from freebsd@omnilan.de)
Received: from mh0.gentlemail.de (ezra.dcm1.omnilan.net [78.138.80.135])
 by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id w2V9XmlY012477;
 Sat, 31 Mar 2018 11:33:48 +0200 (CEST)
 (envelope-from freebsd@omnilan.de)
Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mh0.gentlemail.de (Postfix) with ESMTPSA id 90B3CF72;
 Sat, 31 Mar 2018 11:33:48 +0200 (CEST)
Message-ID: <5ABF55FC.6030102@omnilan.de>
Date: Sat, 31 Mar 2018 11:33:48 +0200
From: Harry Schmalzbauer 
Organization: OmniLAN
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE;
 rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2
MIME-Version: 1.0
To: Sean Bruno 
CC: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r324508 - head/sys/kern
References: <201710102221.v9AML554015782@repo.freebsd.org>
In-Reply-To: <201710102221.v9AML554015782@repo.freebsd.org>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Greylist: ACL 130 matched, not delayed by milter-greylist-4.2.7
 (mx0.gentlemail.de [78.138.80.130]); Sat, 31 Mar 2018 11:33:48 +0200 (CEST)
X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135;
 Sender-helo: mh0.gentlemail.de; )
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 31 Mar 2018 09:33:50 -0000

 Bezglich Sean Bruno's Nachricht vom 11.10.2017 00:21 (localtime):
> Author: sbruno
> Date: Tue Oct 10 22:21:05 2017
> New Revision: 324508
> URL: https://svnweb.freebsd.org/changeset/base/324508
>
> Log:
>   match sendfile() error handling to send().
>   
>   Sendfile() should match the error checking order of send() which
>   is currently:
>   
>   SBS_CANTSENDMORE
>   so_error
>   SS_ISCONNECTED
>   
>   Submitted by:	Jason Eggleston 
>   Reviewed by:	glebius
>   MFC after:	2 weeks
>   Sponsored by:	Limelight Networks
>   Differential Revision:	https://reviews.freebsd.org/D12633
>
> Modified:
>   head/sys/kern/kern_sendfile.c
>

I'm still applying this one locally to stable/11.
Is it going to be MFCd before 11.2?

There are a view more candidates:
https://svnweb.freebsd.org/base?view=revision&revision=324601 along with
r324448
https://svnweb.freebsd.org/base?view=revision&revision=327596
https://svnweb.freebsd.org/base?view=revision&revision=328977
These were flagged for MFC with expired defer time.
And tomorrow this one was supposed to be MFCd also:
https://svnweb.freebsd.org/base?view=revision&revision=331130

Thanks,

-harry

From owner-svn-src-head@freebsd.org  Sat Mar 31 09:35:40 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDD3FF728D2;
 Sat, 31 Mar 2018 09:35:40 +0000 (UTC)
 (envelope-from freebsd@omnilan.de)
Received: from mx0.gentlemail.de (mx0.gentlemail.de [IPv6:2a00:e10:2800::a130])
 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 507887AE91;
 Sat, 31 Mar 2018 09:35:40 +0000 (UTC)
 (envelope-from freebsd@omnilan.de)
Received: from mh0.gentlemail.de (ezra.dcm1.omnilan.net [78.138.80.135])
 by mx0.gentlemail.de (8.14.5/8.14.5) with ESMTP id w2V9Zdqb012493;
 Sat, 31 Mar 2018 11:35:39 +0200 (CEST)
 (envelope-from freebsd@omnilan.de)
Received: from titan.inop.mo1.omnilan.net (s1.omnilan.de [217.91.127.234])
 (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mh0.gentlemail.de (Postfix) with ESMTPSA id 1782BF74;
 Sat, 31 Mar 2018 11:35:39 +0200 (CEST)
Message-ID: <5ABF566A.2050907@omnilan.de>
Date: Sat, 31 Mar 2018 11:35:38 +0200
From: Harry Schmalzbauer 
Organization: OmniLAN
User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; de-DE;
 rv:1.9.2.8) Gecko/20100906 Lightning/1.0b2 Thunderbird/3.1.2
MIME-Version: 1.0
To: src-committers@freebsd.org
CC: svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject: Re: svn commit: r317567 - head/sys/x86/x86
References: <201704281825.v3SIPAnU089576@repo.freebsd.org>
In-Reply-To: <201704281825.v3SIPAnU089576@repo.freebsd.org>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Greylist: ACL 130 matched, not delayed by milter-greylist-4.2.7
 (mx0.gentlemail.de [78.138.80.130]); Sat, 31 Mar 2018 11:35:39 +0200 (CEST)
X-Milter: Spamilter (Reciever: mx0.gentlemail.de; Sender-ip: 78.138.80.135;
 Sender-helo: mh0.gentlemail.de; )
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 31 Mar 2018 09:35:41 -0000

 Bezglich Conrad Meyer's Nachricht vom 28.04.2017 20:25 (localtime):
> Author: cem
> Date: Fri Apr 28 18:25:10 2017
> New Revision: 317567
> URL: https://svnweb.freebsd.org/changeset/base/317567
>
> Log:
>   x86 MCA: Fix a deadlock in MCA exception processing
>   
>   In exceptional circumstances, an MCA exception will trigger when the
>   freelist is exhausted. In such a case, no error will be logged on the list
>   and 'mca_count' will not be incremented.
>   
>   Prior to this patch, all CPUs that received the exception would spin
>   forever.
>   
>   With this change, the CPU that detects the error but finds the freelist
>   empty will proceed to panic the machine, ending the deadlock.
>   
>   A follow-up to r260457.
>   
>   Reported by:	Ryan Libby 
>   Reviewed by:	jhb@
>   Sponsored by:	Dell EMC Isilon
>   Differential Revision:	https://reviews.freebsd.org/D10536
>
> Modified:
>   head/sys/x86/x86/mca.c

Does anybody want to MFC this one before 11.2?

Thanks,

-harry




From owner-svn-src-head@freebsd.org  Sat Mar 31 15:04:43 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEBBDF67E1D;
 Sat, 31 Mar 2018 15:04:42 +0000 (UTC)
 (envelope-from benno@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 97952873D0;
 Sat, 31 Mar 2018 15:04:42 +0000 (UTC)
 (envelope-from benno@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 925FC1968D;
 Sat, 31 Mar 2018 15:04:42 +0000 (UTC)
 (envelope-from benno@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2VF4gTN024788;
 Sat, 31 Mar 2018 15:04:42 GMT (envelope-from benno@FreeBSD.org)
Received: (from benno@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2VF4gxR024784;
 Sat, 31 Mar 2018 15:04:42 GMT (envelope-from benno@FreeBSD.org)
Message-Id: <201803311504.w2VF4gxR024784@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: benno set sender to
 benno@FreeBSD.org using -f
From: Benno Rice 
Date: Sat, 31 Mar 2018 15:04:42 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331843 - in head/usr.sbin/makefs: . cd9660
X-SVN-Group: head
X-SVN-Commit-Author: benno
X-SVN-Commit-Paths: in head/usr.sbin/makefs: . cd9660
X-SVN-Commit-Revision: 331843
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 31 Mar 2018 15:04:43 -0000

Author: benno
Date: Sat Mar 31 15:04:41 2018
New Revision: 331843
URL: https://svnweb.freebsd.org/changeset/base/331843

Log:
  Synchronise with NetBSD's version of EFI handling for El Torito images.
  
  When I implemented my EFI support I failed to check if the upstream version
  of makefs in NetBSD had done the same. Override my version with theirs to
  make it easier to stay in sync with them in the future.
  
  Reviewed by:	imp, mav
  Obtained from:	NetBSD
  MFC after:	1 week
  Sponsored by:	iXsystems, Inc.
  Differential Revision:	https://reviews.freebsd.org/D14913

Modified:
  head/usr.sbin/makefs/cd9660.c
  head/usr.sbin/makefs/cd9660/cd9660_eltorito.c
  head/usr.sbin/makefs/cd9660/cd9660_eltorito.h
  head/usr.sbin/makefs/makefs.8

Modified: head/usr.sbin/makefs/cd9660.c
==============================================================================
--- head/usr.sbin/makefs/cd9660.c	Sat Mar 31 13:19:27 2018	(r331842)
+++ head/usr.sbin/makefs/cd9660.c	Sat Mar 31 15:04:41 2018	(r331843)
@@ -309,6 +309,7 @@ cd9660_prep_opts(fsinfo_t *fsopts)
 		OPT_STR('\0', "no-boot", "No boot support"),
 		OPT_STR('\0', "hard-disk-boot", "Boot from hard disk"),
 		OPT_STR('\0', "boot-load-segment", "Boot load segment"),
+		OPT_STR('\0', "platformid", "Section Header Platform ID"),
 
 		{ .name = NULL }
 	};
@@ -444,7 +445,8 @@ cd9660_parse_opts(const char *option, fsinfo_t *fsopts
 			/* RRIP */
 			cd9660_eltorito_add_boot_option(diskStructure, name, 0);
 			rv = 1;
-		} else if (strcmp(name, "boot-load-segment") == 0) {
+		} else if (strcmp(name, "boot-load-segment") == 0 ||
+		    strcmp(name, "platformid") == 0) {
 			if (buf[0] == '\0') {
 				warnx("Option `%s' doesn't contain a value",
 				    name);

Modified: head/usr.sbin/makefs/cd9660/cd9660_eltorito.c
==============================================================================
--- head/usr.sbin/makefs/cd9660/cd9660_eltorito.c	Sat Mar 31 13:19:27 2018	(r331842)
+++ head/usr.sbin/makefs/cd9660/cd9660_eltorito.c	Sat Mar 31 15:04:41 2018	(r331843)
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660_eltorito.c,v 1.17 2011/06/23 02:35:56 enami Exp $	*/
+/*	$NetBSD: cd9660_eltorito.c,v 1.23 2018/03/28 06:48:55 nonaka Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-NetBSD
@@ -47,16 +47,19 @@ __FBSDID("$FreeBSD$");
 #define	ELTORITO_DPRINTF(__x)
 #endif
 
+#include 
+
 static struct boot_catalog_entry *cd9660_init_boot_catalog_entry(void);
 static struct boot_catalog_entry *cd9660_boot_setup_validation_entry(char);
 static struct boot_catalog_entry *cd9660_boot_setup_default_entry(
     struct cd9660_boot_image *);
 static struct boot_catalog_entry *cd9660_boot_setup_section_head(char);
-static struct boot_catalog_entry *cd9660_boot_setup_validation_entry(char);
 #if 0
 static u_char cd9660_boot_get_system_type(struct cd9660_boot_image *);
 #endif
 
+static struct cd9660_boot_image *default_boot_image;
+
 int
 cd9660_add_boot_disk(iso9660_disk *diskStructure, const char *boot_info)
 {
@@ -104,12 +107,9 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, cons
 	else if (strcmp(sysname, "macppc") == 0 ||
 	         strcmp(sysname, "mac68k") == 0)
 		new_image->system = ET_SYS_MAC;
-	else if (strcmp(sysname, "efi") == 0 ||
-		 strcmp(sysname, "uefi") == 0)
-		new_image->system = ET_SYS_UEFI;
 	else {
 		warnx("boot disk system must be "
-		      "efi, i386, powerpc, macppc, mac68k");
+		      "i386, powerpc, macppc, or mac68k");
 		free(temp);
 		free(new_image);
 		return 0;
@@ -174,9 +174,15 @@ cd9660_add_boot_disk(iso9660_disk *diskStructure, cons
 
 	new_image->serialno = diskStructure->image_serialno++;
 
+	new_image->platform_id = new_image->system;
+
 	/* TODO : Need to do anything about the boot image in the tree? */
 	diskStructure->is_bootable = 1;
 
+	/* First boot image is initial/default entry. */
+	if (default_boot_image == NULL)
+		default_boot_image = new_image;
+
 	return 1;
 }
 
@@ -210,6 +216,13 @@ cd9660_eltorito_add_boot_option(iso9660_disk *diskStru
 			warn("%s: strtoul", __func__);
 			return 0;
 		}
+	} else if (strcmp(option_string, "platformid") == 0) {
+		if (strcmp(value, "efi") == 0)
+			image->platform_id = ET_SYS_EFI;
+		else {
+			warn("%s: unknown platform: %s", __func__, value);
+			return 0;
+		}
 	} else {
 		return 0;
 	}
@@ -232,6 +245,7 @@ cd9660_boot_setup_validation_entry(char sys)
 	size_t i;
 	entry = cd9660_init_boot_catalog_entry();
 
+	entry->entry_type = ET_ENTRY_VE;
 	ve = &entry->entry_data.VE;
 
 	ve->header_id[0] = 1;
@@ -266,6 +280,7 @@ cd9660_boot_setup_default_entry(struct cd9660_boot_ima
 	if (default_entry == NULL)
 		return NULL;
 
+	default_entry->entry_type = ET_ENTRY_IE;
 	ie = &default_entry->entry_data.IE;
 
 	ie->boot_indicator[0] = disk->bootable;
@@ -293,6 +308,7 @@ cd9660_boot_setup_section_head(char platform)
 	if (entry == NULL)
 		return NULL;
 
+	entry->entry_type = ET_ENTRY_SH;
 	sh = &entry->entry_data.SH;
 	/*
 	 * More by default.
@@ -312,6 +328,7 @@ cd9660_boot_setup_section_entry(struct cd9660_boot_ima
 	if ((entry = cd9660_init_boot_catalog_entry()) == NULL)
 		return NULL;
 
+	entry->entry_type = ET_ENTRY_SE;
 	se = &entry->entry_data.SE;
 
 	se->boot_indicator[0] = ET_BOOTABLE;
@@ -344,12 +361,12 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int fir
 	int used_sectors;
 	int num_entries = 0;
 	int catalog_sectors;
-	struct boot_catalog_entry *x86_head, *mac_head, *ppc_head, *uefi_head,
+	struct boot_catalog_entry *x86_head, *mac_head, *ppc_head, *efi_head,
 		*valid_entry, *default_entry, *temp, *head, **headp, *next;
 	struct cd9660_boot_image *tmp_disk;
 
 	headp = NULL;
-	x86_head = mac_head = ppc_head = uefi_head = NULL;
+	x86_head = mac_head = ppc_head = efi_head = NULL;
 
 	/* If there are no boot disks, don't bother building boot information */
 	if (TAILQ_EMPTY(&diskStructure->boot_images))
@@ -393,14 +410,25 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int fir
 	sector = first_sector + catalog_sectors;
 	TAILQ_FOREACH(tmp_disk, &diskStructure->boot_images, image_list) {
 		tmp_disk->sector = sector;
-		sector += tmp_disk->num_sectors;
+		sector += tmp_disk->num_sectors /
+		    (diskStructure->sectorSize / 512);
 	}
 
 	LIST_INSERT_HEAD(&diskStructure->boot_entries, valid_entry, ll_struct);
 
 	/* Step 1b: Initial/default entry */
 	/* TODO : PARAM */
-	tmp_disk = TAILQ_FIRST(&diskStructure->boot_images);
+	if (default_boot_image != NULL) {
+		struct cd9660_boot_image *tcbi;
+		TAILQ_FOREACH(tcbi, &diskStructure->boot_images, image_list) {
+			if (tcbi == default_boot_image) {
+				tmp_disk = tcbi;
+				break;
+			}
+		}
+	}
+	if (tmp_disk == NULL)
+		tmp_disk = TAILQ_FIRST(&diskStructure->boot_images);
 	default_entry = cd9660_boot_setup_default_entry(tmp_disk);
 	if (default_entry == NULL) {
 		warnx("Error: memory allocation failed in cd9660_setup_boot");
@@ -411,14 +439,18 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int fir
 
 	/* Todo: multiple default entries? */
 
-	tmp_disk = TAILQ_NEXT(tmp_disk, image_list);
+	tmp_disk = TAILQ_FIRST(&diskStructure->boot_images);
 
+	head = NULL;
 	temp = default_entry;
 
 	/* If multiple boot images are given : */
-	while (tmp_disk != NULL) {
+	for (; tmp_disk != NULL; tmp_disk = TAILQ_NEXT(tmp_disk, image_list)) {
+		if (tmp_disk == default_boot_image)
+			continue;
+
 		/* Step 2: Section header */
-		switch (tmp_disk->system) {
+		switch (tmp_disk->platform_id) {
 		case ET_SYS_X86:
 			headp = &x86_head;
 			break;
@@ -428,8 +460,8 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int fir
 		case ET_SYS_MAC:
 			headp = &mac_head;
 			break;
-		case ET_SYS_UEFI:
-			headp = &uefi_head;
+		case ET_SYS_EFI:
+			headp = &efi_head;
 			break;
 		default:
 			warnx("%s: internal error: unknown system type",
@@ -439,7 +471,7 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int fir
 
 		if (*headp == NULL) {
 			head =
-			    cd9660_boot_setup_section_head(tmp_disk->system);
+			  cd9660_boot_setup_section_head(tmp_disk->platform_id);
 			if (head == NULL) {
 				warnx("Error: memory allocation failed in "
 				      "cd9660_setup_boot");
@@ -464,7 +496,6 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int fir
 			head = next;
 
 		LIST_INSERT_AFTER(head, temp, ll_struct);
-		tmp_disk = TAILQ_NEXT(tmp_disk, image_list);
 	}
 
 	/* Find the last Section Header entry and mark it as the last. */
@@ -474,8 +505,7 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int fir
 			head = next;
 	}
 	if (head != NULL)
-		head->entry_data.SH.header_indicator[0] =
-		    ET_SECTION_HEADER_LAST;
+		head->entry_data.SH.header_indicator[0] = ET_SECTION_HEADER_LAST;
 
 	/* TODO: Remaining boot disks when implemented */
 
@@ -577,13 +607,13 @@ cd9660_write_apm_partition_entry(FILE *fd, int idx, in
 
 	apm32 = 0;
 	/* pmLgDataStart */
-        fwrite(&apm32, sizeof(apm32), 1, fd);
+	fwrite(&apm32, sizeof(apm32), 1, fd);
 	/* pmDataCnt */ 
 	apm32 = htobe32(nsectors);
-        fwrite(&apm32, sizeof(apm32), 1, fd);
+	fwrite(&apm32, sizeof(apm32), 1, fd);
 	/* pmPartStatus */
 	apm32 = htobe32(part_status);
-        fwrite(&apm32, sizeof(apm32), 1, fd);
+	fwrite(&apm32, sizeof(apm32), 1, fd);
 
 	return 0;
 }
@@ -700,8 +730,9 @@ cd9660_write_boot(iso9660_disk *diskStructure, FILE *f
 			    t->num_sectors * (diskStructure->sectorSize / 512),
 			    512, "CD Boot", "Apple_Bootstrap");
 		}
+
 		/* Write ISO9660 descriptor, enclosing the whole disk */
-                cd9660_write_apm_partition_entry(fd, 2 + apm_partitions,
+		cd9660_write_apm_partition_entry(fd, 2 + apm_partitions,
 		    total_parts, 0, diskStructure->totalSectors *
 		    (diskStructure->sectorSize / 512), 512, "ISO9660",
 		    "CD_ROM_Mode_1");
@@ -709,4 +740,3 @@ cd9660_write_boot(iso9660_disk *diskStructure, FILE *f
 
 	return 0;
 }
-

Modified: head/usr.sbin/makefs/cd9660/cd9660_eltorito.h
==============================================================================
--- head/usr.sbin/makefs/cd9660/cd9660_eltorito.h	Sat Mar 31 13:19:27 2018	(r331842)
+++ head/usr.sbin/makefs/cd9660/cd9660_eltorito.h	Sat Mar 31 15:04:41 2018	(r331843)
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660_eltorito.h,v 1.5 2009/07/04 14:31:38 ahoka Exp $	*/
+/*	$NetBSD: cd9660_eltorito.h,v 1.6 2017/01/24 11:22:43 nonaka Exp $	*/
 
 /*-
  * SPDX-License-Identifier: BSD-2-Clause-NetBSD
@@ -44,7 +44,7 @@
 #define	ET_SYS_X86	0
 #define	ET_SYS_PPC	1
 #define	ET_SYS_MAC	2
-#define	ET_SYS_UEFI	0xef
+#define	ET_SYS_EFI	0xef	/* Platform ID at section header entry */
 
 #define ET_BOOT_ENTRY_SIZE 0x20
 
@@ -150,6 +150,7 @@ struct cd9660_boot_image {
 	u_char targetMode;
 	u_char system;
 	u_char bootable;
+	u_char platform_id;		/* for section header entry */
 	/*
 	 * If the boot image exists in the filesystem
 	 * already, this is a pointer to that node. For the sake

Modified: head/usr.sbin/makefs/makefs.8
==============================================================================
--- head/usr.sbin/makefs/makefs.8	Sat Mar 31 13:19:27 2018	(r331842)
+++ head/usr.sbin/makefs/makefs.8	Sat Mar 31 15:04:41 2018	(r331843)
@@ -35,7 +35,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 26, 2017
+.Dd March 30, 2018
 .Dt MAKEFS 8
 .Os
 .Sh NAME
@@ -394,6 +394,8 @@ ElTorito image.
 Do not pad the image (apparently Linux needs the padding).
 .It Sy omit-trailing-period
 Omit trailing periods in filenames.
+.It Sy platformid
+Set platform ID of section header entry of the boot image.
 .It Sy preparer
 Preparer ID of the image.
 .It Sy publisher

From owner-svn-src-head@freebsd.org  Sat Mar 31 15:06:15 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1682CF680E6;
 Sat, 31 Mar 2018 15:06:15 +0000 (UTC)
 (envelope-from melifaro@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id B3373875DB;
 Sat, 31 Mar 2018 15:06:14 +0000 (UTC)
 (envelope-from melifaro@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ADF081969F;
 Sat, 31 Mar 2018 15:06:14 +0000 (UTC)
 (envelope-from melifaro@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2VF6Ek7024923;
 Sat, 31 Mar 2018 15:06:14 GMT (envelope-from melifaro@FreeBSD.org)
Received: (from melifaro@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2VF6EUJ024922;
 Sat, 31 Mar 2018 15:06:14 GMT (envelope-from melifaro@FreeBSD.org)
Message-Id: <201803311506.w2VF6EUJ024922@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: melifaro set sender to
 melifaro@FreeBSD.org using -f
From: "Alexander V. Chernikov" 
Date: Sat, 31 Mar 2018 15:06:14 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331844 - head/sbin/route
X-SVN-Group: head
X-SVN-Commit-Author: melifaro
X-SVN-Commit-Paths: head/sbin/route
X-SVN-Commit-Revision: 331844
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 31 Mar 2018 15:06:15 -0000

Author: melifaro
Date: Sat Mar 31 15:06:14 2018
New Revision: 331844
URL: https://svnweb.freebsd.org/changeset/base/331844

Log:
  Fix memory leaks in route(8).
  
  Submitted by:	Tom Rix (trix_juniper.net)
  MFC after:	2 weeks
  Differential Revision:	https://reviews.freebsd.org/D9676

Modified:
  head/sbin/route/route.c

Modified: head/sbin/route/route.c
==============================================================================
--- head/sbin/route/route.c	Sat Mar 31 15:04:41 2018	(r331843)
+++ head/sbin/route/route.c	Sat Mar 31 15:06:14 2018	(r331844)
@@ -523,6 +523,7 @@ retry:
 			printf("done\n");
 		}
 	}
+	free(buf);
 	return (error);
 }
 
@@ -1439,6 +1440,7 @@ retry2:
 		rtm = (struct rt_msghdr *)(void *)next;
 		print_rtmsg(rtm, rtm->rtm_msglen);
 	}
+	free(buf);
 }
 
 static void

From owner-svn-src-head@freebsd.org  Sat Mar 31 17:33:44 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0EAAF72BB6;
 Sat, 31 Mar 2018 17:33:43 +0000 (UTC)
 (envelope-from andriyvos@gmail.com)
Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com
 [209.85.215.41])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 546E76DA69;
 Sat, 31 Mar 2018 17:33:43 +0000 (UTC)
 (envelope-from andriyvos@gmail.com)
Received: by mail-lf0-f41.google.com with SMTP id t132-v6so16003862lfe.2;
 Sat, 31 Mar 2018 10:33:43 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:to:cc:subject:references:date:mime-version
 :content-transfer-encoding:from:message-id:in-reply-to:user-agent;
 bh=MoeSSxj/1Rvl5UqoMUbezbSEASz5Dzt9qtyxRIDhyMs=;
 b=IZRRZJNw5ULgcfXs/8/OH65NJlB5sJGTsPzeMX/0PXrXBvSUkRyrupmey2/dRbXS5W
 nO8AH89L/giMtOnMtxBSDi02Lo72T0AvDOh0pi7hHeanE7Gv++FvkiSPdFYQPK50H9Qs
 txhinF2yoq2NzcracZKb/dsIZ+LKmbM64uj5Uyv7fRyXH1QvjCoFT0jvgnI+t3FqMnFi
 HPzlnMuaF+kyV3+0+Ev8FehyCvC6+BFcxk0eUgBLWPy5mVLQ6VR7d+1+5rWQtGxziCLA
 +2ENUrC1O3ZU0wXmsjb3K8844MNWCCDOVAsiGQEtvnzG4CCl0vxtlvCUilABfDeF+oFY
 gaPw==
X-Gm-Message-State: ALQs6tD/KVJEuHwm21UvKMRr0zBAFmw7YDuczllwN5gfFN1O5tPr9LFe
 lo/i2EUcLnlKQtn3ISvvuCUerw4P
X-Google-Smtp-Source: AIpwx4+7hqR095oRl0uXVn3oPIjuNajXfwJnLAlYpRNr3ZXmwjMJIuj4xDO9prJiHc/x4+l2fEV69A==
X-Received: by 2002:a19:2c85:: with SMTP id
 s127-v6mr2202004lfs.18.1522517616094; 
 Sat, 31 Mar 2018 10:33:36 -0700 (PDT)
Received: from localhost (46-133-77-179.dialup.umc.net.ua. [46.133.77.179])
 by smtp.gmail.com with ESMTPSA id l24sm1899399ljb.60.2018.03.31.10.33.34
 (version=TLS1 cipher=AES128-SHA bits=128/128);
 Sat, 31 Mar 2018 10:33:35 -0700 (PDT)
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
To: "Harry Schmalzbauer" 
Cc: "Bryan Drewery" , svn-src-head@freebsd.org,
 svn-src-all@freebsd.org, src-committers@freebsd.org
Subject: Re: svn commit: r324673 - head/sys/kern
References: <201710162146.v9GLkB6t036842@repo.freebsd.org>
 <5305175e-e8d2-453d-9ba6-0281af1582a9@FreeBSD.org>
  <5ABF5296.3050307@omnilan.de>
Date: Sat, 31 Mar 2018 20:31:11 +0300
MIME-Version: 1.0
Content-Transfer-Encoding: Quoted-Printable
From: "Andriy Voskoboinyk" 
Message-ID: 
In-Reply-To: <5ABF5296.3050307@omnilan.de>
User-Agent: Opera Mail/12.15 (FreeBSD)
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 31 Mar 2018 17:33:44 -0000

Sat, 31 Mar 2018 12:19:18 +0300 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0=
=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Harry Schmalzbauer  =

:

>  Bez=C3=BCglich Andriy Voskoboinyk's Nachricht vom 17.10.2017 00:50  =

> (localtime):
>> Tue, 17 Oct 2017 00:53:28 +0300 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=
=D0=BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Bryan Drewery
>> :
>>
>>> On 10/16/2017 2:46 PM, Andriy Voskoboinyk wrote:
>>>> Author: avos
>>>> Date: Mon Oct 16 21:46:11 2017
>>>> New Revision: 324673
>>>> URL: https://svnweb.freebsd.org/changeset/base/324673
>>>>
>>>> Log:
>>>>   mbuf(9): unbreak m_fragment()
>>>
>>> How was it broken
>>
>> Due to m_cat() usage reason (as described below); this part was
>> not changed since function creation in r119644.
>>
>>> and since when?
>>
>> No idea here - probably, it was partially working until m_cat()
>> improvement in r242256.
>>
>> P.S. Just checked with m_fragment(m, M_NOWAIT, -2) placed
>> right before ieee80211_mbuf_defrag() (from D4077) and
>> various m_len printf's before and after - it defragments
>> frames before this change and works as intended after it.
>>
>>>
>>>>
>>>>   - Fix it by replacing m_cat() with m_prev->m_next =3D m_new
>>>>   (m_cat() will try to append data - as a result, there will be no
>>>>   fragmentation).
>>>>   - Move some constants out of the loop.
>>>>
>>>>   Was previously tested with D4077.
>>>>
>>>>   Differential Revision:    https://reviews.freebsd.org/D4090
>
>
> Will r324673 be MFCd before 11.2?
>
> Thanks,
>
> -harry

Done in r331847.

From owner-svn-src-head@freebsd.org  Sat Mar 31 18:22:32 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1981AF75E98;
 Sat, 31 Mar 2018 18:22:32 +0000 (UTC)
 (envelope-from tijl@freebsd.org)
Received: from mailrelay114.isp.belgacom.be (mailrelay114.isp.belgacom.be
 [195.238.20.141])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "relay.skynet.be",
 Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 374B96FB21;
 Sat, 31 Mar 2018 18:22:29 +0000 (UTC)
 (envelope-from tijl@freebsd.org)
X-Belgacom-Dynamic: yes
IronPort-PHdr: =?us-ascii?q?9a23=3AD9l1BRzwUtKbbSjXCy+O+j09IxM/srCxBDY+r6Qd?=
 =?us-ascii?q?2uMeIJqq85mqBkHD//Il1AaPAd2Araocw8Pt8InYEVQa5piAtH1QOLdtbDQizf?=
 =?us-ascii?q?ssogo7HcSeAlf6JvO5JwYzHcBFSUM3tyrjaRsdF8nxfUDdrWOv5jAOBBr/KRB1?=
 =?us-ascii?q?JuPoEYLOksi7ze+/94HdbglSmDaxfa55IQmrownWqsQYm5ZpJLwryhvOrHtIeu?=
 =?us-ascii?q?BWyn1tKFmOgRvy5dq+8YB6/ShItP0v68BPUaPhf6QlVrNYFygpM3o05MLwqxbO?=
 =?us-ascii?q?SxaE62YGXWUXlhpIBBXF7A3/U5zsvCb2qvZx1S+HNsDtU7s6RSqt4LtqSB/wiS?=
 =?us-ascii?q?cIKTg58H3MisdtiK5XuQ+tqwBjz4LRZoyeKfhwcb7Hfd4CS2RPXthfWTFCDIy+?=
 =?us-ascii?q?YYsAAPYOM+lDoonhpVYCsQeyCRWwCO/xzDJDm3/43bc90+QkCQzIwg0gH9AKsH?=
 =?us-ascii?q?/Jstj1M6ASUfurw6nN1zrDaehW0ir65YjUcxAho/WMUKlwf8rL10YgCR7IgEie?=
 =?us-ascii?q?p4D/ODOVzOsNvnGd4uF9W+yvjGsnpBtwojip3soshJPJiZwLxV/f7iV23Zw5Jd?=
 =?us-ascii?q?qiSE50Z9OvDZhetzmCOoZ1X88uWX9ktSknxrEcp5K3YDYGxI46yxPfZfGKdZWD?=
 =?us-ascii?q?7Aj5W+aLOzh4gWpoeLe4hxmv70et0vb8Vsyo0FZSqSpFj8XMumgN1xPN7siHTe?=
 =?us-ascii?q?Nw/kS71jaL1gDT7/9LIVozlabBN54hw7wwlp4JvUvfGS/2n172g7GTdko+/Oio?=
 =?us-ascii?q?8P7rYrL8pp+TL4N0iwf+PboymsGnAuk0LxICU3aU9OihzrHv41H1TKtQgvErkq?=
 =?us-ascii?q?TUvojWJcEBqa64Bw9V3Jwj6xG6Dzq+zNQYnHsHLFZedRKJlYjmJU/BL+vjDfii?=
 =?us-ascii?q?mVisly1rx//eMr37HprNNmTDkKvmfbtl8E5c1gwzwclE55JOFr4NOfLzVVHru9?=
 =?us-ascii?q?PFFRI5PRa0zPj5B9pmzYMRRHiDAqiDMKPdqVWI/P4gI/GQZI8JvzbwM+Ml5+Do?=
 =?us-ascii?q?jXMggl8dZ7Wm0YINZ3C8GvRrOEuZYWDyjdgfCmgKpRcxQPbtiF2YXj5Zf2yyUL?=
 =?us-ascii?q?4k5jEnFIKmCp/ORpu3gLOdxSu0AppWZmVDClCNDXfoa5uLW+0XaC+JLM9hiCIL?=
 =?us-ascii?q?Wqa6RI86yB6irgj6y6BoLuDM4C0XqYrj1MRp5+3UjRwy8CZ7D96e02GPVGx0kH?=
 =?us-ascii?q?kISCEo069kukxy102P0a9ig/xXRpRv4KZsWx05fbzbz+phF9f0ElbEd82KSn6I?=
 =?us-ascii?q?WNirKwodCNUrzIldTVx6HoCejxLHlwGtBKQYkrWNH9Rg7qPe21DfPctw4U3qkq?=
 =?us-ascii?q?47gA91EYN0KWS6i/snpEDoDInTnhDczv7yeA=3D=3D?=
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AoDAAH0b9a/5nK8VFcHgEGDINCUw5vF?=
 =?us-ascii?q?ROMOowiAQGBczEBXZJTgXouhGEChCQiNRcBAgEBAQEBAQIBaiiCNyQBgkkBBSc?=
 =?us-ascii?q?THCMQCxQECSUPKh4GE4URC69RM4g6giYFiXSDXDSEb4VUApc6CIVRiFJli12JF?=
 =?us-ascii?q?YgNHQE2gVJNMAiCfYIgF44YPTCQBQEB?=
X-IPAS-Result: =?us-ascii?q?A2AoDAAH0b9a/5nK8VFcHgEGDINCUw5vFROMOowiAQGBczE?=
 =?us-ascii?q?BXZJTgXouhGEChCQiNRcBAgEBAQEBAQIBaiiCNyQBgkkBBScTHCMQCxQECSUPK?=
 =?us-ascii?q?h4GE4URC69RM4g6giYFiXSDXDSEb4VUApc6CIVRiFJli12JFYgNHQE2gVJNMAi?=
 =?us-ascii?q?CfYIgF44YPTCQBQEB?=
Received: from 153.202-241-81.adsl-dyn.isp.belgacom.be (HELO
 kalimero.tijl.coosemans.org) ([81.241.202.153])
 by relay.skynet.be with ESMTP; 31 Mar 2018 20:21:19 +0200
Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org
 [127.0.0.1])
 by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id w2VILJ04001720;
 Sat, 31 Mar 2018 20:21:19 +0200 (CEST)
 (envelope-from tijl@FreeBSD.org)
Date: Sat, 31 Mar 2018 20:21:18 +0200
From: Tijl Coosemans 
To: Mark Johnston 
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r331732 - head/sys/vm
Message-ID: <20180331202118.5401ed2a@kalimero.tijl.coosemans.org>
In-Reply-To: <201803291427.w2TEReA3024929@repo.freebsd.org>
References: <201803291427.w2TEReA3024929@repo.freebsd.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 31 Mar 2018 18:22:32 -0000

On Thu, 29 Mar 2018 14:27:40 +0000 (UTC) Mark Johnston  wrote:
> Author: markj
> Date: Thu Mar 29 14:27:40 2018
> New Revision: 331732
> URL: https://svnweb.freebsd.org/changeset/base/331732
> 
> Log:
>   Fix the background laundering mechanism after r329882.
>   
>   Rather than using the number of inactive queue scans as a metric for
>   how many clean pages are being freed by the page daemon, have the
>   page daemon keep a running counter of the number of pages it has freed,
>   and have the laundry thread use that when computing the background
>   laundering threshold.
>   
>   Reviewed by:	kib
>   Differential Revision:	https://reviews.freebsd.org/D14884
> 
> Modified:
>   head/sys/vm/vm_pageout.c
>   head/sys/vm/vm_pagequeue.h
> 
> Modified: head/sys/vm/vm_pageout.c
> ==============================================================================
> --- head/sys/vm/vm_pageout.c	Thu Mar 29 13:55:23 2018	(r331731)
> +++ head/sys/vm/vm_pageout.c	Thu Mar 29 14:27:40 2018	(r331732)
> @@ -943,8 +943,7 @@ vm_pageout_laundry_worker(void *arg)
>  {
>  	struct vm_domain *vmd;
>  	struct vm_pagequeue *pq;
> -	uint64_t nclean, ndirty;
> -	u_int inactq_scans, last_launder;
> +	uint64_t nclean, ndirty, nfreed;
>  	int domain, last_target, launder, shortfall, shortfall_cycle, target;
>  	bool in_shortfall;
>  
> @@ -958,8 +957,7 @@ vm_pageout_laundry_worker(void *arg)
>  	in_shortfall = false;
>  	shortfall_cycle = 0;
>  	target = 0;
> -	inactq_scans = 0;
> -	last_launder = 0;
> +	nfreed = 0;
>  
>  	/*
>  	 * Calls to these handlers are serialized by the swap syscall lock.
> @@ -1000,7 +998,6 @@ vm_pageout_laundry_worker(void *arg)
>  			target = 0;
>  			goto trybackground;
>  		}
> -		last_launder = inactq_scans;
>  		launder = target / shortfall_cycle--;
>  		goto dolaundry;
>  
> @@ -1009,24 +1006,23 @@ vm_pageout_laundry_worker(void *arg)
>  		 * meet the conditions to perform background laundering:
>  		 *
>  		 * 1. The ratio of dirty to clean inactive pages exceeds the
> -		 *    background laundering threshold and the pagedaemon has
> -		 *    been woken up to reclaim pages since our last
> -		 *    laundering, or
> +		 *    background laundering threshold, or
>  		 * 2. we haven't yet reached the target of the current
>  		 *    background laundering run.
>  		 *
>  		 * The background laundering threshold is not a constant.
>  		 * Instead, it is a slowly growing function of the number of
> -		 * page daemon scans since the last laundering.  Thus, as the
> -		 * ratio of dirty to clean inactive pages grows, the amount of
> -		 * memory pressure required to trigger laundering decreases.
> +		 * clean pages freed by the page daemon since the last
> +		 * background laundering.  Thus, as the ratio of dirty to
> +		 * clean inactive pages grows, the amount of memory pressure
> +		 * required to trigger laundering decreases.
>  		 */
>  trybackground:
>  		nclean = vmd->vmd_free_count +
>  		    vmd->vmd_pagequeues[PQ_INACTIVE].pq_cnt;
>  		ndirty = vmd->vmd_pagequeues[PQ_LAUNDRY].pq_cnt;
> -		if (target == 0 && inactq_scans != last_launder &&
> -		    ndirty * isqrt(inactq_scans - last_launder) >= nclean) {
> +		if (target == 0 && ndirty * isqrt(nfreed /
> +		    (vmd->vmd_free_target - vmd->vmd_free_min)) >= nclean) {

I'm seeing big processes being killed with an "out of swap space" message
even though there's still plenty of swap available.  It seems to be fixed
by making this division round upwards:

		if (target == 0 && ndirty * isqrt((nfreed +
		    (vmd->vmd_free_target - vmd->vmd_free_min) - 1) /
		    (vmd->vmd_free_target - vmd->vmd_free_min)) >= nclean) {

I don't know where this formula comes from, so I don't know if this
change is correct.

From owner-svn-src-head@freebsd.org  Sat Mar 31 19:39:20 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8A98F7AAF5
 for ;
 Sat, 31 Mar 2018 19:39:20 +0000 (UTC)
 (envelope-from steven@multiplay.co.uk)
Received: from mail-wr0-x22d.google.com (mail-wr0-x22d.google.com
 [IPv6:2a00:1450:400c:c0c::22d])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 4A785731FA
 for ; Sat, 31 Mar 2018 19:39:20 +0000 (UTC)
 (envelope-from steven@multiplay.co.uk)
Received: by mail-wr0-x22d.google.com with SMTP id s18so10404194wrg.9
 for ; Sat, 31 Mar 2018 12:39:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623;
 h=from:subject:to:cc:references:message-id:date:user-agent
 :mime-version:in-reply-to:content-language;
 bh=Olqr3SH+/fwvOK7YPk07VQFeypuJVlK/6L3mSk8EsaM=;
 b=Fbv7nAZO9nWaqwIQ2lnEDXdrwwIsfIo6SXt6Zedm4iQER8+FHgJwexIXkxb2qwVYPZ
 eYUmbCvOeED4JTTL4NYMtNdUCkUY/EqbWxOk9PbFFVs0647AHHInRIGfCGrEzlAnYime
 By/kJwBzsnZRffnA3E13+heDiHEG3kod0lvJUunj9/FuzXD5OHrLbxnKxK9cThrvHgz4
 TwUf+I7CJGj58pNF8H8gcsqt7rWt7QgUz0u8VUmF/fa1mgw54GEHAEl+Lh9zT88UaB6a
 4lO7+3PUw9yWuo+ekl7j4l6NfGVLkpXKAJKoWagykkpIst8fdVtQ8U+nVzFK4V9rBF7v
 eLrQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:subject:to:cc:references:message-id:date
 :user-agent:mime-version:in-reply-to:content-language;
 bh=Olqr3SH+/fwvOK7YPk07VQFeypuJVlK/6L3mSk8EsaM=;
 b=jS4YGGxF5pQs9EFI2gF4RF/VHmfzEvhdhwLn/7oLbnU5n+F56B7kRb6FOB9Ev4J2eC
 AlFsA9jYEXbt6beyr1ZbfTNUFwIUkr4z/TptA/JUScepDruvNaSSdxJGRtHFa5w8TEMc
 ar4s1ex955HZAiz0r6DvYFYLWHmIn7d7L0GYU77LcHGQV1Jnqzhptn+5k/fbo7QfPlC2
 JTVGRYCONwJp+Y4aslO5ZqW2Ukjq14a+HrYIi03tYcM1sx2w8obVa2WRSlP1q5ieg5Er
 3QtCuljUVRA58MK8AmQTumfiepP0NnUaXbAnHlKeLO02VJLWw/yu3q6THqz/G5pEOll8
 RwQQ==
X-Gm-Message-State: AElRT7GSBGt9qt7EzNhsRMZ8x9XRUIEpN6rrrVmFMhKyggHyWO8DAp0t
 T6+XjoGwbDlJUO7Y1qk/E/i76dmsQGg=
X-Google-Smtp-Source: AIpwx4/2iMNpZTKRPLb3Ah0bob02LVQ6wa+lkPvmoZDWyIWHWVLJ3AbuzARj2lPYcgT9TYdTI81e7A==
X-Received: by 10.223.157.3 with SMTP id k3mr2686675wre.179.1522525158503;
 Sat, 31 Mar 2018 12:39:18 -0700 (PDT)
Received: from [10.10.1.111] ([185.97.61.1])
 by smtp.gmail.com with ESMTPSA id 134sm11202687wmm.42.2018.03.31.12.39.17
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 31 Mar 2018 12:39:17 -0700 (PDT)
From: Steven Hartland 
X-Google-Original-From: Steven Hartland 
Subject: Re: svn commit: r327559 - in head: . sys/net
To: Slawa Olhovchenkov , Eugene Grosbein 
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
References: <201801042005.w04K5liB049411@repo.freebsd.org>
 <5A4E9397.9000308@grosbein.net> <20180105131105.GB5368@zxy.spb.ru>
Message-ID: <4598904f-fab2-a094-3887-6e9c5e6a4cc2@freebsd.org>
Date: Sat, 31 Mar 2018 20:40:00 +0100
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
 Thunderbird/52.6.0
MIME-Version: 1.0
In-Reply-To: <20180105131105.GB5368@zxy.spb.ru>
Content-Language: en-US
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Content-Filtered-By: Mailman/MimeDel 2.1.25
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 31 Mar 2018 19:39:21 -0000

On 05/01/2018 13:11, Slawa Olhovchenkov wrote:
> On Fri, Jan 05, 2018 at 03:50:31AM +0700, Eugene Grosbein wrote:
>
>> 05.01.2018 3:05, Steven Hartland wrote:
>>
>>> Author: smh
>>> Date: Thu Jan  4 20:05:47 2018
>>> New Revision: 327559
>>> URL: https://svnweb.freebsd.org/changeset/base/327559
>>>
>>> Log:
>>>    Disabled the use of flowid for lagg by default
>>>    
>>>    Disabled the use of RSS hash from the network card aka flowid for
>>>    lagg(4) interfaces by default as it's currently incompatible with
>>>    the lacp and loadbalance protocols.
>>>    
>>>    The incompatibility is due to the fact that the flowid isn't know
>>>    for the first packet of a new outbound stream which can result in
>>>    the hash calculation method changing and hence a stream being
>>>    incorrectly split across multiple interfaces during normal
>>>    operation.
>>>    
>>>    This can be re-enabled by setting the following in loader.conf:
>>>    net.link.lagg.default_use_flowid="1"
>>>    
>>>    Discussed with: kmacy
>>>    Sponsored by:	Multiplay
>> RSS by definition has meaning to received stream. What is "outbound" stream
>> in this context, why can the hash calculatiom method change and what exactly
>> does it mean "a stream being incorrectly split"?
>>
>> Defaults should not be changed so easily just because they are not optimal
>> for some specific case. Each lagg has its own setting for flowid usage
>> and why one cannot just use "ifconfig lagg0 -use_flowid" for such cases?
> Irrelevant to RSS and etc. flowid distribution in lacp case work very
> bad. This is good and must be MFC (IMHO).
There was no concrete conclusion to this thread and I've not had time to 
look into this more and it's on my open list to MFC to stable/11 in time 
for 11.2.

Even given the drop in performance, I think we should prefer correctness 
over increased performance and given the new default can still be 
overridden in loader.conf I'm looking to MFC this shortly unless I get 
any strong objections with a clear path forward.

     Regards
     Steve

From owner-svn-src-head@freebsd.org  Sat Mar 31 22:03:00 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D377F546E4;
 Sat, 31 Mar 2018 22:03:00 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 3317F77F23;
 Sat, 31 Mar 2018 22:03:00 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 14CB21DB14;
 Sat, 31 Mar 2018 22:03:00 +0000 (UTC) (envelope-from imp@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2VM2xGC047654;
 Sat, 31 Mar 2018 22:02:59 GMT (envelope-from imp@FreeBSD.org)
Received: (from imp@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2VM2xHt047650;
 Sat, 31 Mar 2018 22:02:59 GMT (envelope-from imp@FreeBSD.org)
Message-Id: <201803312202.w2VM2xHt047650@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org
 using -f
From: Warner Losh 
Date: Sat, 31 Mar 2018 22:02:59 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331852 - in head: stand/i386/libfirewire sys/dev/firewire
X-SVN-Group: head
X-SVN-Commit-Author: imp
X-SVN-Commit-Paths: in head: stand/i386/libfirewire sys/dev/firewire
X-SVN-Commit-Revision: 331852
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 31 Mar 2018 22:03:00 -0000

Author: imp
Date: Sat Mar 31 22:02:59 2018
New Revision: 331852
URL: https://svnweb.freebsd.org/changeset/base/331852

Log:
  fwohcireg.h is 99% the same between the boot loader and the
  kernel. Delete it and fix up the 1% difference because there's no need
  for them to be different.

Deleted:
  head/stand/i386/libfirewire/fwohcireg.h
Modified:
  head/stand/i386/libfirewire/firewire.c
  head/stand/i386/libfirewire/fwohci.c
  head/stand/i386/libfirewire/fwohci.h
  head/sys/dev/firewire/fwohcireg.h

Modified: head/stand/i386/libfirewire/firewire.c
==============================================================================
--- head/stand/i386/libfirewire/firewire.c	Sat Mar 31 19:21:57 2018	(r331851)
+++ head/stand/i386/libfirewire/firewire.c	Sat Mar 31 22:02:59 2018	(r331852)
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include "fwohci.h"
 #include 
 

Modified: head/stand/i386/libfirewire/fwohci.c
==============================================================================
--- head/stand/i386/libfirewire/fwohci.c	Sat Mar 31 19:21:57 2018	(r331851)
+++ head/stand/i386/libfirewire/fwohci.c	Sat Mar 31 22:02:59 2018	(r331852)
@@ -39,8 +39,9 @@
 #include 
 #include 
 
+#include 
 #include "fwohci.h"
-#include "fwohcireg.h"
+#include 
 #include 
 
 static uint32_t fwphy_wrdata ( struct fwohci_softc *, uint32_t, uint32_t);
@@ -62,12 +63,6 @@ char *linkspeed[] = {
 	"S100", "S200", "S400", "S800",
 	"S1600", "S3200", "undef", "undef"
 };
-
-#define FW_EUI64_BYTE(eui, x) \
-	((((x)<4)?				\
-		((eui)->hi >> (8*(3-(x)))): 	\
-		((eui)->lo >> (8*(7-(x))))	\
-	) & 0xff)
 
 /*
  * Communication with PHY device

Modified: head/stand/i386/libfirewire/fwohci.h
==============================================================================
--- head/stand/i386/libfirewire/fwohci.h	Sat Mar 31 19:21:57 2018	(r331851)
+++ head/stand/i386/libfirewire/fwohci.h	Sat Mar 31 22:02:59 2018	(r331852)
@@ -37,10 +37,6 @@
 #define MAX_OHCI 5
 #define CROMSIZE 0x400
 
-struct fw_eui64 {
-        uint32_t hi, lo;
-};
-
 struct fwohci_softc {
 	uint32_t locator;
 	uint32_t devid;

Modified: head/sys/dev/firewire/fwohcireg.h
==============================================================================
--- head/sys/dev/firewire/fwohcireg.h	Sat Mar 31 19:21:57 2018	(r331851)
+++ head/sys/dev/firewire/fwohcireg.h	Sat Mar 31 22:02:59 2018	(r331852)
@@ -330,6 +330,7 @@ struct ohci_registers {
 	struct ohci_dma dma_irch[0x20];
 };
 
+#ifndef _STANDALONE
 struct fwohcidb_tr {
 	STAILQ_ENTRY(fwohcidb_tr) link;
 	struct fw_xfer *xfer;
@@ -339,6 +340,7 @@ struct fwohcidb_tr {
 	bus_addr_t bus_addr;
 	int dbcnt;
 };
+#endif
 
 /*
  * OHCI info structure.

From owner-svn-src-head@freebsd.org  Sat Mar 31 22:54:37 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9533F5CC90;
 Sat, 31 Mar 2018 22:54:36 +0000 (UTC)
 (envelope-from markjdb@gmail.com)
Received: from mail-io0-x234.google.com (mail-io0-x234.google.com
 [IPv6:2607:f8b0:4001:c06::234])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 6EE4C7ABF9;
 Sat, 31 Mar 2018 22:54:36 +0000 (UTC)
 (envelope-from markjdb@gmail.com)
Received: by mail-io0-x234.google.com with SMTP id m83so14424022ioi.8;
 Sat, 31 Mar 2018 15:54:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:date:from:to:cc:subject:message-id:references:mime-version
 :content-disposition:in-reply-to:user-agent;
 bh=P4l/Wjtvw9z3v+iiZ9Rc/VieHpnq0sm1JTa2GWSSikY=;
 b=WwkoTGgBUcJIMdknbRGb5yCvVmtz5BD4lkAHWGRioaphuigfgev139eJgufVh0DJRx
 HK3l7hpq7oQBdSFwtWpEgXj9Ih3/+E5WAedI9bkAGt/wfYiEi0WxATQOY/pjDl3H+wDL
 FMddNxSpXpCC7NiXAj273wnZqmknco5iKxDeKbH8KPt5aGI9nzw8xI85+W6UMzCj6r83
 DGopkI5IDUYL38yXFuo0rDuTKBUSObbXR/3dhU+sUWF03e0BjSTzBVfvpzUdiHVRpvXu
 VW9S1Qgl6naOy6KTdYLwUsbaFxgbVUIWwNMjR70pOkbUly0FOW+2X9fWSxeH/8+bYcR9
 oGdA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:date:from:to:cc:subject:message-id
 :references:mime-version:content-disposition:in-reply-to:user-agent;
 bh=P4l/Wjtvw9z3v+iiZ9Rc/VieHpnq0sm1JTa2GWSSikY=;
 b=jikPnf+TPYsxw+oEIJp1F+TBFmYaUUzBz06dsXNnzu2XB9TlhEXMR3DKC+FR+KlMJC
 xD37IiCX2if7thw/kdbpMZ9ClpWubFRqNrAJ474lzsq47LNBVLtZKigQsJE1NO7BvJcF
 FBD+L5j2vqJybqRWNgMs+qxpkbwBsxcZ82u0CIdKUYYfUG7pawVWyTsHPKKv0oaJcJdg
 uGLTybj7SMS240uFu9L98XQwUqq+8v+qGXoDCQLu1gniJi1DTKFodI3+sJiRSWShcVge
 xz5oISP1n+eUL0JplnJjI+mVH7JnJ08GOm1CiuCt/1hBTb+YlAQXae/Ycz1kSgvxA+90
 vJ5A==
X-Gm-Message-State: AElRT7Hr8lQ/kU7j/KzQvrkC1B8KVt05y3+ErP/XAAtdzDFQD9MHoTYv
 9HBkr9Bmylz6XCQMftz/IIlfPA==
X-Google-Smtp-Source: AIpwx49mrF5PdNUUHXy7tLThiZ7K5UizcWX/t1CwyyKZBHYfLO3rTw2Dzgr27ta/SYcBCXTMg2Rxlw==
X-Received: by 10.107.134.140 with SMTP id q12mr3638866ioi.92.1522536875557;
 Sat, 31 Mar 2018 15:54:35 -0700 (PDT)
Received: from raichu (toroon0560w-lp130-01-174-88-76-83.dsl.bell.ca.
 [174.88.76.83])
 by smtp.gmail.com with ESMTPSA id 134-v6sm3857965itl.34.2018.03.31.15.54.34
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
 Sat, 31 Mar 2018 15:54:34 -0700 (PDT)
Sender: Mark Johnston 
Date: Sat, 31 Mar 2018 18:54:32 -0400
From: Mark Johnston 
To: Tijl Coosemans 
Cc: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: Re: svn commit: r331732 - head/sys/vm
Message-ID: <20180331225432.GB1440@raichu>
References: <201803291427.w2TEReA3024929@repo.freebsd.org>
 <20180331202118.5401ed2a@kalimero.tijl.coosemans.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20180331202118.5401ed2a@kalimero.tijl.coosemans.org>
User-Agent: Mutt/1.9.4 (2018-02-28)
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 31 Mar 2018 22:54:37 -0000

On Sat, Mar 31, 2018 at 08:21:18PM +0200, Tijl Coosemans wrote:
> On Thu, 29 Mar 2018 14:27:40 +0000 (UTC) Mark Johnston  wrote:
> > Author: markj
> > Date: Thu Mar 29 14:27:40 2018
> > New Revision: 331732
> > URL: https://svnweb.freebsd.org/changeset/base/331732
> > 
> > Log:
> >   Fix the background laundering mechanism after r329882.
> >   
> >   Rather than using the number of inactive queue scans as a metric for
> >   how many clean pages are being freed by the page daemon, have the
> >   page daemon keep a running counter of the number of pages it has freed,
> >   and have the laundry thread use that when computing the background
> >   laundering threshold.
> > [...]
> 
> I'm seeing big processes being killed with an "out of swap space" message
> even though there's still plenty of swap available.  It seems to be fixed
> by making this division round upwards:
> 
> 		if (target == 0 && ndirty * isqrt((nfreed +
> 		    (vmd->vmd_free_target - vmd->vmd_free_min) - 1) /
> 		    (vmd->vmd_free_target - vmd->vmd_free_min)) >= nclean) {
> 
> I don't know where this formula comes from, so I don't know if this
> change is correct.

Hm, that's somewhat surprising. This code shouldn't be executing in
situations where the OOM kill logic is invoked (i.e., memory pressure
plus a shortage of clean pages in the inactive queue).

How much RAM does the system have? Could you collect "sysctl vm" output
around the time of an OOM kill?

I'm wondering if the higher inactive queue scan frequency after r329882
might be responsible: OOM kills are performed after vm.pageout_oom_seq
back-to-back scans fail to reclaim any pages. Does your problem persist
if you increase the value of that sysctl, say to 60?

From owner-svn-src-head@freebsd.org  Sat Mar 31 23:24:29 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2735DF6527A;
 Sat, 31 Mar 2018 23:24:29 +0000 (UTC)
 (envelope-from markj@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id CFE3A7BEFA;
 Sat, 31 Mar 2018 23:24:28 +0000 (UTC)
 (envelope-from markj@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAE651E80D;
 Sat, 31 Mar 2018 23:24:28 +0000 (UTC)
 (envelope-from markj@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2VNOSmp092467;
 Sat, 31 Mar 2018 23:24:28 GMT (envelope-from markj@FreeBSD.org)
Received: (from markj@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2VNOSoK092466;
 Sat, 31 Mar 2018 23:24:28 GMT (envelope-from markj@FreeBSD.org)
Message-Id: <201803312324.w2VNOSoK092466@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: markj set sender to
 markj@FreeBSD.org using -f
From: Mark Johnston 
Date: Sat, 31 Mar 2018 23:24:28 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331853 - head/sys/sys
X-SVN-Group: head
X-SVN-Commit-Author: markj
X-SVN-Commit-Paths: head/sys/sys
X-SVN-Commit-Revision: 331853
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 31 Mar 2018 23:24:29 -0000

Author: markj
Date: Sat Mar 31 23:24:28 2018
New Revision: 331853
URL: https://svnweb.freebsd.org/changeset/base/331853

Log:
  Don't verify td_locks accounting after a panic.
  
  Reported by:	pho
  X-MFC with:	r331738

Modified:
  head/sys/sys/proc.h

Modified: head/sys/sys/proc.h
==============================================================================
--- head/sys/sys/proc.h	Sat Mar 31 22:02:59 2018	(r331852)
+++ head/sys/sys/proc.h	Sat Mar 31 23:24:28 2018	(r331853)
@@ -382,7 +382,8 @@ do {									\
 
 #define	TD_LOCKS_INC(td)	((td)->td_locks++)
 #define	TD_LOCKS_DEC(td) do {						\
-	KASSERT((td)->td_locks > 0, ("thread %p owns no locks", (td)));	\
+	KASSERT(SCHEDULER_STOPPED_TD(td) || (td)->td_locks > 0,		\
+	    ("thread %p owns no locks", (td)));				\
 	(td)->td_locks--;						\
 } while (0)
 #else

From owner-svn-src-head@freebsd.org  Sat Mar 31 23:40:06 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20070F664F8;
 Sat, 31 Mar 2018 23:40:06 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id C6D097C836;
 Sat, 31 Mar 2018 23:40:05 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1CB11E9D0;
 Sat, 31 Mar 2018 23:40:05 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2VNe5Om097845;
 Sat, 31 Mar 2018 23:40:05 GMT (envelope-from kevans@FreeBSD.org)
Received: (from kevans@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2VNe5bT097844;
 Sat, 31 Mar 2018 23:40:05 GMT (envelope-from kevans@FreeBSD.org)
Message-Id: <201803312340.w2VNe5bT097844@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kevans set sender to
 kevans@FreeBSD.org using -f
From: Kyle Evans 
Date: Sat, 31 Mar 2018 23:40:05 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331854 - head/stand/lua
X-SVN-Group: head
X-SVN-Commit-Author: kevans
X-SVN-Commit-Paths: head/stand/lua
X-SVN-Commit-Revision: 331854
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 31 Mar 2018 23:40:06 -0000

Author: kevans
Date: Sat Mar 31 23:40:05 2018
New Revision: 331854
URL: https://svnweb.freebsd.org/changeset/base/331854

Log:
  lualoader: Do case-insensitive comparison of "yes"

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==============================================================================
--- head/stand/lua/config.lua	Sat Mar 31 23:24:28 2018	(r331853)
+++ head/stand/lua/config.lua	Sat Mar 31 23:40:05 2018	(r331854)
@@ -205,7 +205,7 @@ local function loadModule(mod, silent)
 	local status = true
 	local pstatus
 	for k, v in pairs(mod) do
-		if v.load == "YES" then
+		if v.load:lower() == "yes" then
 			local str = "load "
 			if v.flags ~= nil then
 				str = str .. v.flags .. " "

From owner-svn-src-head@freebsd.org  Sat Mar 31 23:49:01 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 621ECF66FA9;
 Sat, 31 Mar 2018 23:49:01 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id 090957CE6F;
 Sat, 31 Mar 2018 23:49:01 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F03271EB66;
 Sat, 31 Mar 2018 23:49:00 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2VNn0gi002907;
 Sat, 31 Mar 2018 23:49:00 GMT (envelope-from kevans@FreeBSD.org)
Received: (from kevans@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2VNn0EK002906;
 Sat, 31 Mar 2018 23:49:00 GMT (envelope-from kevans@FreeBSD.org)
Message-Id: <201803312349.w2VNn0EK002906@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kevans set sender to
 kevans@FreeBSD.org using -f
From: Kyle Evans 
Date: Sat, 31 Mar 2018 23:49:00 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331855 - head/stand/lua
X-SVN-Group: head
X-SVN-Commit-Author: kevans
X-SVN-Commit-Paths: head/stand/lua
X-SVN-Commit-Revision: 331855
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 31 Mar 2018 23:49:01 -0000

Author: kevans
Date: Sat Mar 31 23:49:00 2018
New Revision: 331855
URL: https://svnweb.freebsd.org/changeset/base/331855

Log:
  lualoader: Don't assume that {module}_load is set
  
  The previous iteration of this assumed that {module}_load was set. In the
  old world order of default loader.conf(5), this was probably a safe
  assumption given that we had almost every module explicitly not-loaded in
  it.
  
  In the new world order, this is no longer the case, so one could delete a
  _load line inadvertently while leaving a _name, _type, _flags, _before,
  _after, or _error. This would have caused a confusing Lua error and borked
  module loading.

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==============================================================================
--- head/stand/lua/config.lua	Sat Mar 31 23:40:05 2018	(r331854)
+++ head/stand/lua/config.lua	Sat Mar 31 23:49:00 2018	(r331855)
@@ -205,6 +205,9 @@ local function loadModule(mod, silent)
 	local status = true
 	local pstatus
 	for k, v in pairs(mod) do
+		if v.load == nil then
+			goto continue
+		end
 		if v.load:lower() == "yes" then
 			local str = "load "
 			if v.flags ~= nil then
@@ -232,6 +235,7 @@ local function loadModule(mod, silent)
 				end
 				if v.error ~= nil then
 					cli_execute_unparsed(v.error)
+
 				end
 				status = false
 			end
@@ -249,6 +253,7 @@ local function loadModule(mod, silent)
 --				print("Skipping module '". . k .. "'")
 --			end
 		end
+		::continue::
 	end
 
 	return status

From owner-svn-src-head@freebsd.org  Sat Mar 31 23:50:21 2018
Return-Path: 
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17A91F67123;
 Sat, 31 Mar 2018 23:50:21 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org
 [IPv6:2610:1c1:1:606c::19:3])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client CN "mxrelay.nyi.freebsd.org",
 Issuer "Let's Encrypt Authority X3" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id BE3BA7CFEA;
 Sat, 31 Mar 2018 23:50:20 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B85ED1EB6A;
 Sat, 31 Mar 2018 23:50:20 +0000 (UTC)
 (envelope-from kevans@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2VNoKCi003054;
 Sat, 31 Mar 2018 23:50:20 GMT (envelope-from kevans@FreeBSD.org)
Received: (from kevans@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2VNoKVT003053;
 Sat, 31 Mar 2018 23:50:20 GMT (envelope-from kevans@FreeBSD.org)
Message-Id: <201803312350.w2VNoKVT003053@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: kevans set sender to
 kevans@FreeBSD.org using -f
From: Kyle Evans 
Date: Sat, 31 Mar 2018 23:50:20 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r331856 - head/stand/lua
X-SVN-Group: head
X-SVN-Commit-Author: kevans
X-SVN-Commit-Paths: head/stand/lua
X-SVN-Commit-Revision: 331856
X-SVN-Commit-Repository: base
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 
List-Unsubscribe: ,
 
List-Archive: 
List-Post: 
List-Help: 
List-Subscribe: ,
 
X-List-Received-Date: Sat, 31 Mar 2018 23:50:21 -0000

Author: kevans
Date: Sat Mar 31 23:50:20 2018
New Revision: 331856
URL: https://svnweb.freebsd.org/changeset/base/331856

Log:
  lualoader: revert whitespace change that snuck in

Modified:
  head/stand/lua/config.lua

Modified: head/stand/lua/config.lua
==============================================================================
--- head/stand/lua/config.lua	Sat Mar 31 23:49:00 2018	(r331855)
+++ head/stand/lua/config.lua	Sat Mar 31 23:50:20 2018	(r331856)
@@ -235,7 +235,6 @@ local function loadModule(mod, silent)
 				end
 				if v.error ~= nil then
 					cli_execute_unparsed(v.error)
-
 				end
 				status = false
 			end