From owner-svn-src-all@freebsd.org Sun Apr 30 02:08:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D8A0D56BDB; Sun, 30 Apr 2017 02:08:48 +0000 (UTC) (envelope-from anish@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CF7C18D9; Sun, 30 Apr 2017 02:08:47 +0000 (UTC) (envelope-from anish@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3U28lVr093448; Sun, 30 Apr 2017 02:08:47 GMT (envelope-from anish@FreeBSD.org) Received: (from anish@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3U28lZo093446; Sun, 30 Apr 2017 02:08:47 GMT (envelope-from anish@FreeBSD.org) Message-Id: <201704300208.v3U28lZo093446@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: anish set sender to anish@FreeBSD.org using -f From: Anish Gupta Date: Sun, 30 Apr 2017 02:08:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317600 - in head/sys: amd64/vmm/amd modules/vmm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 02:08:48 -0000 Author: anish Date: Sun Apr 30 02:08:46 2017 New Revision: 317600 URL: https://svnweb.freebsd.org/changeset/base/317600 Log: Add AMD IOMMU/AMD-Vi support in bhyve for passthrough/direct assignment to VMs. To enable AMD-Vi, set hw.vmm.amdvi.enable=1. Reviewed by:bcr Approved by:grehan Tested by:rgrimes Differential Revision:https://reviews.freebsd.org/D10049 Added: head/sys/amd64/vmm/amd/amdvi_hw.c (contents, props changed) head/sys/amd64/vmm/amd/amdvi_priv.h (contents, props changed) head/sys/amd64/vmm/amd/ivrs_drv.c (contents, props changed) Modified: head/sys/modules/vmm/Makefile Added: head/sys/amd64/vmm/amd/amdvi_hw.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/vmm/amd/amdvi_hw.c Sun Apr 30 02:08:46 2017 (r317600) @@ -0,0 +1,1509 @@ +/*- + * Copyright (c) 2016, Anish Gupta (anish@freebsd.org) + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include "pcib_if.h" + +#include "io/iommu.h" +#include "amdvi_priv.h" + +SYSCTL_DECL(_hw_vmm); +SYSCTL_NODE(_hw_vmm, OID_AUTO, amdvi, CTLFLAG_RW, NULL, NULL); + +#define MOD_INC(a, s, m) (((a) + (s)) % ((m) * (s))) +#define MOD_DEC(a, s, m) (((a) - (s)) % ((m) * (s))) + +/* Print RID or device ID in PCI string format. */ +#define RID2PCI_STR(d) PCI_RID2BUS(d), PCI_RID2SLOT(d), PCI_RID2FUNC(d) + +static void amdvi_dump_cmds(struct amdvi_softc *softc); +static void amdvi_print_dev_cap(struct amdvi_softc *softc); + +MALLOC_DEFINE(M_AMDVI, "amdvi", "amdvi"); + +extern device_t *ivhd_devs; + +extern int ivhd_count; +SYSCTL_INT(_hw_vmm_amdvi, OID_AUTO, count, CTLFLAG_RDTUN, &ivhd_count, + 0, NULL); + +static int amdvi_enable_user = 0; +SYSCTL_INT(_hw_vmm_amdvi, OID_AUTO, enable, CTLFLAG_RDTUN, + &amdvi_enable_user, 0, NULL); +TUNABLE_INT("hw.vmm.amdvi_enable", &amdvi_enable_user); + +#ifdef AMDVI_ATS_ENABLE +/* XXX: ATS is not tested. */ +static int amdvi_enable_iotlb = 1; +SYSCTL_INT(_hw_vmm_amdvi, OID_AUTO, iotlb_enabled, CTLFLAG_RDTUN, + &amdvi_enable_iotlb, 0, NULL); +TUNABLE_INT("hw.vmm.enable_iotlb", &amdvi_enable_iotlb); +#endif + +static int amdvi_host_ptp = 1; /* Use page tables for host. */ +SYSCTL_INT(_hw_vmm_amdvi, OID_AUTO, host_ptp, CTLFLAG_RDTUN, + &amdvi_host_ptp, 0, NULL); +TUNABLE_INT("hw.vmm.amdvi.host_ptp", &amdvi_host_ptp); + +/* Page table level used <= supported by h/w[v1=7]. */ +static int amdvi_ptp_level = 4; +SYSCTL_INT(_hw_vmm_amdvi, OID_AUTO, ptp_level, CTLFLAG_RDTUN, + &amdvi_ptp_level, 0, NULL); +TUNABLE_INT("hw.vmm.amdvi.ptp_level", &amdvi_ptp_level); + +/* Disable fault event reporting. */ +static int amdvi_disable_io_fault = 0; +SYSCTL_INT(_hw_vmm_amdvi, OID_AUTO, disable_io_fault, CTLFLAG_RDTUN, + &amdvi_disable_io_fault, 0, NULL); +TUNABLE_INT("hw.vmm.amdvi.disable_io_fault", &amdvi_disable_io_fault); + +static uint32_t amdvi_dom_id = 0; /* 0 is reserved for host. */ +SYSCTL_UINT(_hw_vmm_amdvi, OID_AUTO, domain_id, CTLFLAG_RD, + &amdvi_dom_id, 0, NULL); +/* + * Device table entry. + * Bus(256) x Dev(32) x Fun(8) x DTE(256 bits or 32 bytes). + * = 256 * 2 * PAGE_SIZE. + */ +static struct amdvi_dte amdvi_dte[PCI_NUM_DEV_MAX] __aligned(PAGE_SIZE); +CTASSERT(PCI_NUM_DEV_MAX == 0x10000); +CTASSERT(sizeof(amdvi_dte) == 0x200000); + +static SLIST_HEAD (, amdvi_domain) dom_head; + +static inline void +amdvi_pci_write(struct amdvi_softc *softc, int off, uint32_t data) +{ + + pci_cfgregwrite(PCI_RID2BUS(softc->pci_rid), + PCI_RID2SLOT(softc->pci_rid), PCI_RID2FUNC(softc->pci_rid), + off, data, 4); +} + +static inline uint32_t +amdvi_pci_read(struct amdvi_softc *softc, int off) +{ + + return (pci_cfgregread(PCI_RID2BUS(softc->pci_rid), + PCI_RID2SLOT(softc->pci_rid), PCI_RID2FUNC(softc->pci_rid), + off, 4)); +} + +static int +amdvi_find_pci_cap(struct amdvi_softc *softc, uint8_t capability, int *off) +{ + uint32_t read; + uint8_t ptr; + + read = amdvi_pci_read(softc, PCIR_COMMAND); + if (((read >> 16) & PCIM_STATUS_CAPPRESENT) == 0) + return (ENXIO); + + /* Read the starting of capability pointer. */ + read = amdvi_pci_read(softc, PCIR_CAP_PTR); + ptr = read & 0xFF; + + while (ptr != 0) { + read = amdvi_pci_read(softc, ptr); + if ((read & 0xFF) == capability) { + *off = ptr; + return (0); + } + ptr = (read >> 8) & 0xFF; + } + + return (ENOENT); +} + +#ifdef AMDVI_ATS_ENABLE +/* XXX: Should be in pci.c */ +/* + * Check if device has ATS capability and its enabled. + * If ATS is absent or disabled, return (-1), otherwise ATS + * queue length. + */ +static int +amdvi_find_ats_qlen(uint16_t devid) +{ + device_t dev; + uint32_t off, cap; + int qlen = -1; + + dev = pci_find_bsf(PCI_RID2BUS(devid), PCI_RID2SLOT(devid), + PCI_RID2FUNC(devid)); + + if (!dev) { + return (-1); + } +#define PCIM_ATS_EN BIT(31) + + if (pci_find_extcap(dev, PCIZ_ATS, &off) == 0) { + cap = pci_read_config(dev, off + 4, 4); + qlen = (cap & 0x1F); + qlen = qlen ? qlen : 32; + printf("AMD-Vi: PCI device %d.%d.%d ATS %s qlen=%d\n", + RID2PCI_STR(devid), + (cap & PCIM_ATS_EN) ? "enabled" : "Disabled", + qlen); + qlen = (cap & PCIM_ATS_EN) ? qlen : -1; + } + + return (qlen); +} + +/* + * Check if an endpoint device support device IOTLB or ATS. + */ +static inline bool +amdvi_dev_support_iotlb(struct amdvi_softc *softc, uint16_t devid) +{ + struct ivhd_dev_cfg *cfg; + int qlen, i; + bool pci_ats, ivhd_ats; + + qlen = amdvi_find_ats_qlen(devid); + if (qlen < 0) + return (false); + + KASSERT(softc, ("softc is NULL")); + cfg = softc->dev_cfg; + + ivhd_ats = false; + for (i = 0; i < softc->dev_cfg_cnt; i++) { + if ((cfg->start_id <= devid) && (cfg->end_id >= devid)) { + ivhd_ats = cfg->enable_ats; + break; + } + cfg++; + } + + pci_ats = (qlen < 0) ? false : true; + if (pci_ats != ivhd_ats) + device_printf(softc->dev, + "BIOS bug: mismatch in ATS setting for %d.%d.%d," + "ATS inv qlen = %d\n", RID2PCI_STR(devid), qlen); + + /* Ignore IVRS setting and respect PCI setting. */ + return (pci_ats); +} +#endif + +/* Enable IOTLB support for IOMMU if its supported. */ +static inline void +amdvi_hw_enable_iotlb(struct amdvi_softc *softc) +{ +#ifndef AMDVI_ATS_ENABLE + softc->iotlb = false; +#else + bool supported; + + supported = (softc->ivhd_flag & IVHD_FLAG_IOTLB) ? true : false; + + if (softc->pci_cap & AMDVI_PCI_CAP_IOTLB) { + if (!supported) + device_printf(softc->dev, "IOTLB disabled by BIOS.\n"); + + if (supported && !amdvi_enable_iotlb) { + device_printf(softc->dev, "IOTLB disabled by user.\n"); + supported = false; + } + } else + supported = false; + + softc->iotlb = supported; + +#endif +} + +static int +amdvi_init_cmd(struct amdvi_softc *softc) +{ + struct amdvi_ctrl *ctrl = softc->ctrl; + + ctrl->cmd.len = 8; /* Use 256 command buffer entries. */ + softc->cmd_max = 1 << ctrl->cmd.len; + + softc->cmd = malloc(sizeof(struct amdvi_cmd) * + softc->cmd_max, M_AMDVI, M_WAITOK | M_ZERO); + + if ((uintptr_t)softc->cmd & PAGE_MASK) + panic("AMDVi: Command buffer not aligned on page boundary."); + + ctrl->cmd.base = vtophys(softc->cmd) / PAGE_SIZE; + /* + * XXX: Reset the h/w pointers in case IOMMU is restarting, + * h/w doesn't clear these pointers based on empirical data. + */ + ctrl->cmd_tail = 0; + ctrl->cmd_head = 0; + + return (0); +} + +/* + * Note: Update tail pointer after we have written the command since tail + * pointer update cause h/w to execute new commands, see section 3.3 + * of AMD IOMMU spec ver 2.0. + */ +/* Get the command tail pointer w/o updating it. */ +static struct amdvi_cmd * +amdvi_get_cmd_tail(struct amdvi_softc *softc) +{ + struct amdvi_ctrl *ctrl; + struct amdvi_cmd *tail; + + KASSERT(softc, ("softc is NULL")); + KASSERT(softc->cmd != NULL, ("cmd is NULL")); + + ctrl = softc->ctrl; + KASSERT(ctrl != NULL, ("ctrl is NULL")); + + tail = (struct amdvi_cmd *)((uint8_t *)softc->cmd + + ctrl->cmd_tail); + + return (tail); +} + +/* + * Update the command tail pointer which will start command execution. + */ +static void +amdvi_update_cmd_tail(struct amdvi_softc *softc) +{ + struct amdvi_ctrl *ctrl; + int size; + + size = sizeof(struct amdvi_cmd); + KASSERT(softc->cmd != NULL, ("cmd is NULL")); + + ctrl = softc->ctrl; + KASSERT(ctrl != NULL, ("ctrl is NULL")); + + ctrl->cmd_tail = MOD_INC(ctrl->cmd_tail, size, softc->cmd_max); + softc->total_cmd++; + +#ifdef AMDVI_DEBUG_CMD + device_printf(softc->dev, "cmd_tail: %s Tail:0x%x, Head:0x%x.\n", + ctrl->cmd_tail, + ctrl->cmd_head); +#endif + +} + +/* + * Various commands supported by IOMMU. + */ + +/* Completion wait command. */ +static void +amdvi_cmd_cmp(struct amdvi_softc *softc, const uint64_t data) +{ + struct amdvi_cmd *cmd; + uint64_t pa; + + cmd = amdvi_get_cmd_tail(softc); + KASSERT(cmd != NULL, ("Cmd is NULL")); + + pa = vtophys(&softc->cmp_data); + cmd->opcode = AMDVI_CMP_WAIT_OPCODE; + cmd->word0 = (pa & 0xFFFFFFF8) | + (AMDVI_CMP_WAIT_STORE); + //(AMDVI_CMP_WAIT_FLUSH | AMDVI_CMP_WAIT_STORE); + cmd->word1 = (pa >> 32) & 0xFFFFF; + cmd->addr = data; + + amdvi_update_cmd_tail(softc); +} + +/* Invalidate device table entry. */ +static void +amdvi_cmd_inv_dte(struct amdvi_softc *softc, uint16_t devid) +{ + struct amdvi_cmd *cmd; + + cmd = amdvi_get_cmd_tail(softc); + KASSERT(cmd != NULL, ("Cmd is NULL")); + cmd->opcode = AMDVI_INVD_DTE_OPCODE; + cmd->word0 = devid; + amdvi_update_cmd_tail(softc); +#ifdef AMDVI_DEBUG_CMD + device_printf(softc->dev, "Invalidated DTE:0x%x\n", devid); +#endif +} + +/* Invalidate IOMMU page, use for invalidation of domain. */ +static void +amdvi_cmd_inv_iommu_pages(struct amdvi_softc *softc, uint16_t domain_id, + uint64_t addr, bool guest_nested, + bool pde, bool page) +{ + struct amdvi_cmd *cmd; + + cmd = amdvi_get_cmd_tail(softc); + KASSERT(cmd != NULL, ("Cmd is NULL")); + + + cmd->opcode = AMDVI_INVD_PAGE_OPCODE; + cmd->word1 = domain_id; + /* + * Invalidate all addresses for this domain. + */ + cmd->addr = addr; + cmd->addr |= pde ? AMDVI_INVD_PAGE_PDE : 0; + cmd->addr |= page ? AMDVI_INVD_PAGE_S : 0; + + amdvi_update_cmd_tail(softc); +} + +#ifdef AMDVI_ATS_ENABLE +/* Invalidate device IOTLB. */ +static void +amdvi_cmd_inv_iotlb(struct amdvi_softc *softc, uint16_t devid) +{ + struct amdvi_cmd *cmd; + int qlen; + + if (!softc->iotlb) + return; + + qlen = amdvi_find_ats_qlen(devid); + if (qlen < 0) { + panic("AMDVI: Invalid ATS qlen(%d) for device %d.%d.%d\n", + qlen, RID2PCI_STR(devid)); + } + cmd = amdvi_get_cmd_tail(softc); + KASSERT(cmd != NULL, ("Cmd is NULL")); + +#ifdef AMDVI_DEBUG_CMD + device_printf(softc->dev, "Invalidate IOTLB devID 0x%x" + " Qlen:%d\n", devid, qlen); +#endif + cmd->opcode = AMDVI_INVD_IOTLB_OPCODE; + cmd->word0 = devid; + cmd->word1 = qlen; + cmd->addr = AMDVI_INVD_IOTLB_ALL_ADDR | + AMDVI_INVD_IOTLB_S; + amdvi_update_cmd_tail(softc); +} +#endif + +#ifdef notyet /* For Interrupt Remap. */ +static void +amdvi_cmd_inv_intr_map(struct amdvi_softc *softc, + uint16_t devid) +{ + struct amdvi_cmd *cmd; + + cmd = amdvi_get_cmd_tail(softc); + KASSERT(cmd != NULL, ("Cmd is NULL")); + cmd->opcode = AMDVI_INVD_INTR_OPCODE; + cmd->word0 = devid; + amdvi_update_cmd_tail(softc); +#ifdef AMDVI_DEBUG_CMD + device_printf(softc->dev, "Invalidate INTR map of devID 0x%x\n", devid); +#endif +} +#endif + +/* Invalidate domain using INVALIDATE_IOMMU_PAGES command. */ +static void +amdvi_inv_domain(struct amdvi_softc *softc, uint16_t domain_id) +{ + struct amdvi_cmd *cmd; + + cmd = amdvi_get_cmd_tail(softc); + KASSERT(cmd != NULL, ("Cmd is NULL")); + + /* + * See section 3.3.3 of IOMMU spec rev 2.0, software note + * for invalidating domain. + */ + amdvi_cmd_inv_iommu_pages(softc, domain_id, AMDVI_INVD_PAGE_ALL_ADDR, + false, true, true); + +#ifdef AMDVI_DEBUG_CMD + device_printf(softc->dev, "Invalidate domain:0x%x\n", domain_id); + +#endif +} + +static bool +amdvi_cmp_wait(struct amdvi_softc *softc) +{ + struct amdvi_ctrl *ctrl; + const uint64_t VERIFY = 0xA5A5; + volatile uint64_t *read; + int i; + bool status; + + ctrl = softc->ctrl; + read = &softc->cmp_data; + *read = 0; + amdvi_cmd_cmp(softc, VERIFY); + /* Wait for h/w to update completion data. */ + for (i = 0; i < 100 && (*read != VERIFY); i++) { + DELAY(1000); /* 1 ms */ + } + status = (VERIFY == softc->cmp_data) ? true : false; + +#ifdef AMDVI_DEBUG_CMD + if (status) + device_printf(softc->dev, "CMD completion DONE Tail:0x%x, + "Head:0x%x, loop:%d.\n", ctrl->cmd_tail, + ctrl->cmd_head, loop); +#endif + return (status); +} + +static void +amdvi_wait(struct amdvi_softc *softc) +{ + struct amdvi_ctrl *ctrl; + int i; + + KASSERT(softc, ("softc is NULL")); + + ctrl = softc->ctrl; + KASSERT(ctrl != NULL, ("ctrl is NULL")); + /* Don't wait if h/w is not enabled. */ + if ((ctrl->control & AMDVI_CTRL_EN) == 0) + return; + + for (i = 0; i < 10; i++) { + if (amdvi_cmp_wait(softc)) + return; + } + + device_printf(softc->dev, "Error: completion failed" + " tail:0x%x, head:0x%x.\n", + ctrl->cmd_tail, ctrl->cmd_head); + amdvi_dump_cmds(softc); +} + +static void +amdvi_dump_cmds(struct amdvi_softc *softc) +{ + struct amdvi_ctrl *ctrl; + struct amdvi_cmd *cmd; + int off, i; + + ctrl = softc->ctrl; + device_printf(softc->dev, "Dump all the commands:\n"); + /* + * If h/w is stuck in completion, it is the previous command, + * start dumping from previous command onward. + */ + off = MOD_DEC(ctrl->cmd_head, sizeof(struct amdvi_cmd), + softc->cmd_max); + for (i = 0; off != ctrl->cmd_tail && + i < softc->cmd_max; i++) { + cmd = (struct amdvi_cmd *)((uint8_t *)softc->cmd + off); + printf(" [CMD%d, off:0x%x] opcode= 0x%x 0x%x" + " 0x%x 0x%lx\n", i, off, cmd->opcode, + cmd->word0, cmd->word1, cmd->addr); + off = (off + sizeof(struct amdvi_cmd)) % + (softc->cmd_max * sizeof(struct amdvi_cmd)); + } +} + +static int +amdvi_init_event(struct amdvi_softc *softc) +{ + struct amdvi_ctrl *ctrl; + + ctrl = softc->ctrl; + ctrl->event.len = 8; + softc->event_max = 1 << ctrl->event.len; + softc->event = malloc(sizeof(struct amdvi_event) * + softc->event_max, M_AMDVI, M_WAITOK | M_ZERO); + if ((uintptr_t)softc->event & PAGE_MASK) { + device_printf(softc->dev, "Event buffer not aligned on page."); + return (false); + } + ctrl->event.base = vtophys(softc->event) / PAGE_SIZE; + + /* Reset the pointers. */ + ctrl->evt_head = 0; + ctrl->evt_tail = 0; + + return (0); +} + +static inline void +amdvi_decode_evt_flag(uint16_t flag) +{ + + flag &= AMDVI_EVENT_FLAG_MASK; + printf("0x%b]\n", flag, + "\020" + "\001GN" + "\002NX" + "\003US" + "\004I" + "\005PR" + "\006RW" + "\007PE" + "\010RZ" + "\011TR" + ); +} + +/* See section 2.5.4 of AMD IOMMU spec ver 2.62.*/ +static inline void +amdvi_decode_evt_flag_type(uint8_t type) +{ + + switch (AMDVI_EVENT_FLAG_TYPE(type)) { + case 0: + printf("RSVD\n"); + break; + case 1: + printf("Master Abort\n"); + break; + case 2: + printf("Target Abort\n"); + break; + case 3: + printf("Data Err\n"); + break; + default: + break; + } +} + +static void +amdvi_decode_inv_dte_evt(uint16_t devid, uint16_t domid, uint64_t addr, + uint16_t flag) +{ + + printf("\t[IO_PAGE_FAULT EVT: devId:0x%x DomId:0x%x" + " Addr:0x%lx", + devid, domid, addr); + amdvi_decode_evt_flag(flag); +} + +static void +amdvi_decode_pf_evt(uint16_t devid, uint16_t domid, uint64_t addr, + uint16_t flag) +{ + + printf("\t[IO_PAGE_FAULT EVT: devId:0x%x DomId:0x%x" + " Addr:0x%lx", + devid, domid, addr); + amdvi_decode_evt_flag(flag); +} + +static void +amdvi_decode_dte_hwerr_evt(uint16_t devid, uint16_t domid, + uint64_t addr, uint16_t flag) +{ + + printf("\t[DEV_TAB_HW_ERR EVT: devId:0x%x DomId:0x%x" + " Addr:0x%lx", devid, domid, addr); + amdvi_decode_evt_flag(flag); + amdvi_decode_evt_flag_type(flag); +} + +static void +amdvi_decode_page_hwerr_evt(uint16_t devid, uint16_t domid, uint64_t addr, + uint16_t flag) +{ + + printf("\t[PAGE_TAB_HW_ERR EVT: devId:0x%x DomId:0x%x" + " Addr:0x%lx", devid, domid, addr); + amdvi_decode_evt_flag(flag); + amdvi_decode_evt_flag_type(AMDVI_EVENT_FLAG_TYPE(flag)); +} + +static void +amdvi_decode_evt(struct amdvi_event *evt) +{ + struct amdvi_cmd *cmd; + + switch (evt->opcode) { + case AMDVI_EVENT_INVALID_DTE: + amdvi_decode_inv_dte_evt(evt->devid, evt->pasid_domid, + evt->addr, evt->flag); + break; + + case AMDVI_EVENT_PFAULT: + amdvi_decode_pf_evt(evt->devid, evt->pasid_domid, + evt->addr, evt->flag); + break; + + case AMDVI_EVENT_DTE_HW_ERROR: + amdvi_decode_dte_hwerr_evt(evt->devid, evt->pasid_domid, + evt->addr, evt->flag); + break; + + case AMDVI_EVENT_PAGE_HW_ERROR: + amdvi_decode_page_hwerr_evt(evt->devid, evt->pasid_domid, + evt->addr, evt->flag); + break; + + case AMDVI_EVENT_ILLEGAL_CMD: + /* FALL THROUGH */ + case AMDVI_EVENT_CMD_HW_ERROR: + printf("\t[%s EVT]", (evt->opcode == AMDVI_EVENT_ILLEGAL_CMD) ? + "ILLEGAL CMD" : "CMD HW ERR"); + cmd = (struct amdvi_cmd *)PHYS_TO_DMAP(evt->addr); + printf("\tCMD opcode= 0x%x 0x%x 0x%x 0x%lx\n", + cmd->opcode, cmd->word0, cmd->word1, cmd->addr); + break; + + case AMDVI_EVENT_IOTLB_TIMEOUT: + printf("\t[IOTLB_INV_TIMEOUT devid:0x%x addr:0x%lx", + evt->devid, evt->addr); + break; + + case AMDVI_EVENT_INVALID_DTE_REQ: + printf("\t[INV_DTE devid:0x%x addr:0x%lx", + evt->devid, evt->addr); + break; + + case AMDVI_EVENT_INVALID_PPR_REQ: + case AMDVI_EVENT_COUNTER_ZERO: + printf("AMD-Vi: v2 events.\n"); + break; + + default: + printf("Unsupported AMD-Vi event:%d", evt->opcode); + } +} + +static void +amdvi_print_events(struct amdvi_softc *softc) +{ + struct amdvi_ctrl *ctrl; + struct amdvi_event *event; + int i, size; + + ctrl = softc->ctrl; + size = sizeof(struct amdvi_event); + for (i = 0; i < softc->event_max; i++) { + event = &softc->event[ctrl->evt_head / size]; + if (!event->opcode) + break; + device_printf(softc->dev, "\t[Event%d: Head:0x%x Tail:0x%x]\n", + i, ctrl->evt_head, ctrl->evt_tail); + amdvi_decode_evt(event); + ctrl->evt_head = MOD_INC(ctrl->evt_head, size, + softc->event_max); + } +} + +static int +amdvi_init_dte(struct amdvi_softc *softc) +{ + struct amdvi_ctrl *ctrl; + + ctrl = softc->ctrl; + ctrl->dte.base = vtophys(amdvi_dte) / PAGE_SIZE; + ctrl->dte.size = 0x1FF; /* 2MB device table. */ + + return (0); +} + +/* + * Not all capabilities of IOMMU are available in ACPI IVHD flag + * or EFR entry, read directly from device. + */ +static int +amdvi_print_pci_cap(device_t dev) +{ + struct amdvi_softc *softc; + uint32_t off, cap; + + + softc = device_get_softc(dev); + off = softc->cap_off; + + /* + * Section 3.7.1 of IOMMU sepc rev 2.0. + * Read capability from device. + */ + cap = amdvi_pci_read(softc, off); + + /* Make sure capability type[18:16] is 3. */ + KASSERT((((cap >> 16) & 0x7) == 0x3), + ("Not a IOMMU capability 0x%x@0x%x", cap, off)); + + softc->pci_cap = cap >> 24; + device_printf(softc->dev, "PCI cap 0x%x@0x%x feature:%b\n", + cap, off, softc->pci_cap, + "\020\001IOTLB\002HT\003NPCache\004EFR"); + + /* IOMMU spec Rev 2.0, section 3.7.2.1 */ + softc->pci_efr = softc->ctrl->ex_feature; + if (softc->pci_efr) { + device_printf(softc->dev, "PCI extended Feature:%b\n", + (int)softc->pci_efr, + "\020\001PreFSup\002PPRSup\003XTSup\004NXSup\006IASup" + "\007GASup\008HESup\009PCSup"); + device_printf(softc->dev, + "PCI HATS = %d GATS = %d GLXSup = %d, max PASID: 0x%x ", + (int)((softc->pci_efr >> 10) & 0x3), + (int)((softc->pci_efr >> 12) & 0x3), + (int)((softc->pci_efr >> 14) & 0x3), + (int)((softc->pci_efr >> 32) & 0x1F) + 1); + } + + return (0); +} + +static void +amdvi_event_intr(void *arg) +{ + struct amdvi_softc *softc; + struct amdvi_ctrl *ctrl; + + softc = (struct amdvi_softc *)arg; + ctrl = softc->ctrl; + device_printf(softc->dev, "EVT INTR %ld Status:0x%x" + " EVT Head:0x%x Tail:0x%x]\n", softc->event_intr_cnt++, + ctrl->status, ctrl->evt_head, ctrl->evt_tail); + printf(" [CMD Total 0x%lx] Tail:0x%x, Head:0x%x.\n", + softc->total_cmd, ctrl->cmd_tail, ctrl->cmd_head); + + amdvi_print_events(softc); +} + +static void +amdvi_free_evt_intr_res(device_t dev) +{ + + struct amdvi_softc *softc; + + softc = device_get_softc(dev); + if (softc->event_tag != NULL) { + bus_teardown_intr(dev, softc->event_res, softc->event_tag); + } + if (softc->event_res != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, softc->event_rid, + softc->event_res); + } + bus_delete_resource(dev, SYS_RES_IRQ, softc->event_rid); + PCIB_RELEASE_MSI(device_get_parent(device_get_parent(dev)), + dev, 1, &softc->event_irq); +} + +static bool +amdvi_alloc_intr_resources(struct amdvi_softc *softc) +{ + device_t dev, pcib; + uint64_t msi_addr; + uint32_t msi_data, temp; + int err, msi_off; + + dev = softc->dev; + pcib = device_get_parent(device_get_parent(dev)); + softc->event_irq = -1; + softc->event_rid = 0; + /* + * Section 3.7.1 of IOMMU rev 2.0. With MSI, there is only one + * interrupt. XXX: Enable MSI/X support. + */ + + err = PCIB_ALLOC_MSI(pcib, dev, 1, 1, &softc->event_irq); + if (err) { + device_printf(dev, + "Couldn't find event MSI IRQ resource.\n"); + return (ENOENT); + } + err = bus_set_resource(dev, SYS_RES_IRQ, softc->event_rid, + softc->event_irq, 1); + if (err) { + device_printf(dev, "Couldn't set event MSI resource.\n"); + return (ENXIO); + } + softc->event_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &softc->event_rid, RF_ACTIVE); + if (!softc->event_res) { + device_printf(dev, + "Unable to allocate event INTR resource.\n"); + return (ENOMEM); + } + + if (bus_setup_intr(dev, softc->event_res, + INTR_TYPE_MISC | INTR_MPSAFE, NULL, amdvi_event_intr, + softc, &softc->event_tag)) { + device_printf(dev, "Fail to setup event intr\n"); + bus_release_resource(softc->dev, SYS_RES_IRQ, + softc->event_rid, softc->event_res); + softc->event_res = NULL; + return (ENXIO); + } + + bus_describe_intr(dev, softc->event_res, softc->event_tag, + "fault"); + + err = amdvi_find_pci_cap(softc, PCIY_MSI, &msi_off); + if (err) { + device_printf(dev, "Couldn't find MSI capability, err = %d.\n", + err); + return (err); + } + + err = PCIB_MAP_MSI(pcib, dev, softc->event_irq, &msi_addr, + &msi_data); + if (err) { + device_printf(dev, + "Event interrupt config failed, err=%d.\n", + err); + amdvi_free_evt_intr_res(softc->dev); + return (err); + } + + /* Configure MSI */ + amdvi_pci_write(softc, msi_off + PCIR_MSI_ADDR, msi_addr); + amdvi_pci_write(softc, msi_off + PCIR_MSI_ADDR_HIGH, + msi_addr >> 32); + amdvi_pci_write(softc, msi_off + PCIR_MSI_DATA_64BIT, msi_data); + + /* Now enable MSI interrupt. */ + temp = amdvi_pci_read(softc, msi_off); + temp |= (PCIM_MSICTRL_MSI_ENABLE << 16); /* MSI enable. */ + amdvi_pci_write(softc, msi_off, temp); + + return (0); +} + + +static void +amdvi_print_dev_cap(struct amdvi_softc *softc) +{ + struct ivhd_dev_cfg *cfg; + int i; + + cfg = softc->dev_cfg; + for (i = 0; i < softc->dev_cfg_cnt; i++) { + device_printf(softc->dev, "device [0x%x - 0x%x]" + "config:%b%s\n", cfg->start_id, cfg->end_id, + cfg->data, + "\020\001INIT\002ExtInt\003NMI" + "\007LINT0\008LINT1", + cfg->enable_ats ? "ATS enabled" : ""); + cfg++; + } +} + +static int +amdvi_handle_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct amdvi_softc *softc; + int result, type, error = 0; + + softc = (struct amdvi_softc *)arg1; + type = arg2; + + switch (type) { + case 0: + result = softc->ctrl->cmd_head; + error = sysctl_handle_int(oidp, &result, 0, + req); + break; + case 1: + result = softc->ctrl->cmd_tail; + error = sysctl_handle_int(oidp, &result, 0, + req); + break; + case 2: + result = softc->ctrl->evt_head; + error = sysctl_handle_int(oidp, &result, 0, + req); + break; + case 3: + result = softc->ctrl->evt_tail; + error = sysctl_handle_int(oidp, &result, 0, + req); + break; + + default: + device_printf(softc->dev, "Unknown sysctl:%d\n", type); + } + + return (error); +} + +static void +amdvi_add_sysctl(struct amdvi_softc *softc) +{ + struct sysctl_oid_list *child; + struct sysctl_ctx_list *ctx; + device_t dev; + + dev = softc->dev; + ctx = device_get_sysctl_ctx(dev); + child = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); + + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "event_intr_count", CTLFLAG_RD, + &softc->event_intr_cnt, "Event interrupt count"); + SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "command_count", CTLFLAG_RD, + &softc->total_cmd, "Command submitted count"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "pci_rid", CTLFLAG_RD, + (int *)&softc->pci_rid, 0, + "IOMMU RID"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "start_dev_rid", CTLFLAG_RD, + (int *)&softc->start_dev_rid, 0, + "Start of device under this IOMMU"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "end_dev_rid", CTLFLAG_RD, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sun Apr 30 05:56:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B0BED54BA1; Sun, 30 Apr 2017 05:56:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D2131180; Sun, 30 Apr 2017 05:56:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3U5uwtI088897; Sun, 30 Apr 2017 05:56:58 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3U5uwZ8088896; Sun, 30 Apr 2017 05:56:58 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704300556.v3U5uwZ8088896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 30 Apr 2017 05:56:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317601 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 05:56:59 -0000 Author: dchagin Date: Sun Apr 30 05:56:57 2017 New Revision: 317601 URL: https://svnweb.freebsd.org/changeset/base/317601 Log: Fix symlinkat() which use the newdfd argument to look up the old path, while it should use it for the new path instead. Reported by: trasz@ MFC after: 1 month Modified: head/sys/compat/linux/linux_file.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Sun Apr 30 02:08:46 2017 (r317600) +++ head/sys/compat/linux/linux_file.c Sun Apr 30 05:56:57 2017 (r317601) @@ -826,7 +826,7 @@ linux_symlinkat(struct thread *td, struc int error, dfd; dfd = (args->newdfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->newdfd; - LCONVPATHEXIST_AT(td, args->oldname, &path, dfd); + LCONVPATHEXIST(td, args->oldname, &path); /* Expand LCONVPATHCREATE so that `path' can be freed on errors */ error = linux_emul_convpath(td, args->newname, UIO_USERSPACE, &to, 1, dfd); if (to == NULL) { From owner-svn-src-all@freebsd.org Sun Apr 30 06:14:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 734FFD56128; Sun, 30 Apr 2017 06:14:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4035919F5; Sun, 30 Apr 2017 06:14:59 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3U6EwiO096940; Sun, 30 Apr 2017 06:14:58 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3U6EwPT096938; Sun, 30 Apr 2017 06:14:58 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704300614.v3U6EwPT096938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 30 Apr 2017 06:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317602 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 06:14:59 -0000 Author: dchagin Date: Sun Apr 30 06:14:57 2017 New Revision: 317602 URL: https://svnweb.freebsd.org/changeset/base/317602 Log: MFC r317323: Add Evdev ioctl handler to the Linuxulator. PR: 218627 Modified: stable/11/sys/compat/linux/linux_ioctl.c stable/11/sys/compat/linux/linux_ioctl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/11/sys/compat/linux/linux_ioctl.c Sun Apr 30 05:56:57 2017 (r317601) +++ stable/11/sys/compat/linux/linux_ioctl.c Sun Apr 30 06:14:57 2017 (r317602) @@ -70,6 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #ifdef COMPAT_LINUX32 @@ -83,6 +84,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -110,6 +112,7 @@ static linux_ioctl_function_t linux_ioct static linux_ioctl_function_t linux_ioctl_v4l2; static linux_ioctl_function_t linux_ioctl_special; static linux_ioctl_function_t linux_ioctl_fbsd_usb; +static linux_ioctl_function_t linux_ioctl_evdev; static struct linux_ioctl_handler cdrom_handler = { linux_ioctl_cdrom, LINUX_IOCTL_CDROM_MIN, LINUX_IOCTL_CDROM_MAX }; @@ -139,6 +142,8 @@ static struct linux_ioctl_handler video2 { linux_ioctl_v4l2, LINUX_IOCTL_VIDEO2_MIN, LINUX_IOCTL_VIDEO2_MAX }; static struct linux_ioctl_handler fbsd_usb = { linux_ioctl_fbsd_usb, FBSD_LUSB_MIN, FBSD_LUSB_MAX }; +static struct linux_ioctl_handler evdev_handler = +{ linux_ioctl_evdev, LINUX_IOCTL_EVDEV_MIN, LINUX_IOCTL_EVDEV_MAX }; DATA_SET(linux_ioctl_handler_set, cdrom_handler); DATA_SET(linux_ioctl_handler_set, vfat_handler); @@ -154,6 +159,7 @@ DATA_SET(linux_ioctl_handler_set, sg_han DATA_SET(linux_ioctl_handler_set, video_handler); DATA_SET(linux_ioctl_handler_set, video2_handler); DATA_SET(linux_ioctl_handler_set, fbsd_usb); +DATA_SET(linux_ioctl_handler_set, evdev_handler); struct handler_element { @@ -3573,6 +3579,65 @@ linux_ioctl_fbsd_usb(struct thread *td, } /* + * Some evdev ioctls must be translated. + * - EVIOCGMTSLOTS is a IOC_READ ioctl on Linux although it has input data + * (must be IOC_INOUT on FreeBSD). + * - On Linux, EVIOCGRAB, EVIOCREVOKE and EVIOCRMFF are defined as _IOW with + * an int argument. You don't pass an int pointer to the ioctl(), however, + * but just the int directly. On FreeBSD, they are defined as _IOWINT for + * this to work. + */ +static int +linux_ioctl_evdev(struct thread *td, struct linux_ioctl_args *args) +{ + cap_rights_t rights; + struct file *fp; + clockid_t clock; + int error; + + args->cmd = SETDIR(args->cmd); + + switch (args->cmd) { + case (EVIOCGRAB & ~IOC_DIRMASK) | IOC_IN: + args->cmd = EVIOCGRAB; + break; + case (EVIOCREVOKE & ~IOC_DIRMASK) | IOC_IN: + args->cmd = EVIOCREVOKE; + break; + case (EVIOCRMFF & ~IOC_DIRMASK) | IOC_IN: + args->cmd = EVIOCRMFF; + break; + case EVIOCSCLOCKID: { + error = copyin(PTRIN(args->arg), &clock, sizeof(clock)); + if (error != 0) + return (error); + if (clock & ~(LINUX_IOCTL_EVDEV_CLK)) + return (EINVAL); + error = linux_to_native_clockid(&clock, clock); + if (error != 0) + return (error); + + error = fget(td, args->fd, + cap_rights_init(&rights, CAP_IOCTL), &fp); + if (error != 0) + return (error); + + error = fo_ioctl(fp, EVIOCSCLOCKID, &clock, td->td_ucred, td); + fdrop(fp, td); + return (error); + } + default: + break; + } + + if (IOCBASECMD(args->cmd) == + ((EVIOCGMTSLOTS(0) & ~IOC_DIRMASK) | IOC_OUT)) + args->cmd = (args->cmd & ~IOC_DIRMASK) | IOC_INOUT; + + return (sys_ioctl(td, (struct ioctl_args *)args)); +} + +/* * main ioctl syscall function */ Modified: stable/11/sys/compat/linux/linux_ioctl.h ============================================================================== --- stable/11/sys/compat/linux/linux_ioctl.h Sun Apr 30 05:56:57 2017 (r317601) +++ stable/11/sys/compat/linux/linux_ioctl.h Sun Apr 30 06:14:57 2017 (r317602) @@ -749,7 +749,13 @@ */ #define LINUX_BTRFS_IOC_CLONE 0x9409 /* 0x40049409 */ - +/* + * Linux evdev ioctl min and max + */ +#define LINUX_IOCTL_EVDEV_MIN 0x4500 +#define LINUX_IOCTL_EVDEV_MAX 0x45ff +#define LINUX_IOCTL_EVDEV_CLK LINUX_CLOCK_REALTIME | \ + LINUX_CLOCK_MONOTONIC |LINUX_CLOCK_BOOTTIME /* * Pluggable ioctl handlers */ From owner-svn-src-all@freebsd.org Sun Apr 30 06:15:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 061AAD561C6; Sun, 30 Apr 2017 06:15:58 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CBC121B30; Sun, 30 Apr 2017 06:15:57 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3U6FuQG097052; Sun, 30 Apr 2017 06:15:56 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3U6FuXo097051; Sun, 30 Apr 2017 06:15:56 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201704300615.v3U6FuXo097051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 30 Apr 2017 06:15:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317603 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 06:15:58 -0000 Author: dchagin Date: Sun Apr 30 06:15:56 2017 New Revision: 317603 URL: https://svnweb.freebsd.org/changeset/base/317603 Log: MFC r317324: Map Linux CLOCK_BOOTTIME to native CLOCK_UPTIME. Modified: stable/11/sys/compat/linux/linux_time.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_time.c ============================================================================== --- stable/11/sys/compat/linux/linux_time.c Sun Apr 30 06:14:57 2017 (r317602) +++ stable/11/sys/compat/linux/linux_time.c Sun Apr 30 06:15:56 2017 (r317603) @@ -207,8 +207,10 @@ linux_to_native_clockid(clockid_t *n, cl case LINUX_CLOCK_MONOTONIC_COARSE: *n = CLOCK_MONOTONIC_FAST; break; - case LINUX_CLOCK_MONOTONIC_RAW: case LINUX_CLOCK_BOOTTIME: + *n = CLOCK_UPTIME; + break; + case LINUX_CLOCK_MONOTONIC_RAW: case LINUX_CLOCK_REALTIME_ALARM: case LINUX_CLOCK_BOOTTIME_ALARM: case LINUX_CLOCK_SGI_CYCLE: From owner-svn-src-all@freebsd.org Sun Apr 30 07:31:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB1B8D5761E; Sun, 30 Apr 2017 07:31:49 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A2495D79; Sun, 30 Apr 2017 07:31:49 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3U7VmwT026901; Sun, 30 Apr 2017 07:31:48 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3U7Vmod026900; Sun, 30 Apr 2017 07:31:48 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201704300731.v3U7Vmod026900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 30 Apr 2017 07:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317604 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 07:31:50 -0000 Author: loos Date: Sun Apr 30 07:31:48 2017 New Revision: 317604 URL: https://svnweb.freebsd.org/changeset/base/317604 Log: Set the correct default for #address-cells variable when the property does not exist. This has never caused any issue because #address-cells is mandatory. Sponsored by: Rubicon Communications, LLC (Netgate) MFC after: 2 weeks Modified: head/sys/dev/fdt/fdt_common.c Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Sun Apr 30 06:15:56 2017 (r317603) +++ head/sys/dev/fdt/fdt_common.c Sun Apr 30 07:31:48 2017 (r317604) @@ -422,7 +422,7 @@ fdt_addrsize_cells(phandle_t node, int * */ cell_size = sizeof(cell); if (OF_getencprop(node, "#address-cells", &cell, cell_size) < cell_size) - *addr_cells = 2; + cell = 2; *addr_cells = (int)cell; if (OF_getencprop(node, "#size-cells", &cell, cell_size) < cell_size) From owner-svn-src-all@freebsd.org Sun Apr 30 07:51:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52B05D57BA1; Sun, 30 Apr 2017 07:51:33 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AF9C172C; Sun, 30 Apr 2017 07:51:32 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3U7pWob036470; Sun, 30 Apr 2017 07:51:32 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3U7pWYg036469; Sun, 30 Apr 2017 07:51:32 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201704300751.v3U7pWYg036469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Sun, 30 Apr 2017 07:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317605 - head/sys/dev/etherswitch/e6000sw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 07:51:33 -0000 Author: loos Date: Sun Apr 30 07:51:31 2017 New Revision: 317605 URL: https://svnweb.freebsd.org/changeset/base/317605 Log: When the switch is set to operate in the Multi Chip Addressing Mode we cannot access the GLOBAL2 register directly. Despite the comment in code (which was misleading), the indirect access is only used to read the switch CONFIG data from the scrap register and not for the GLOBAL2 access. Use the dsa data to define when the switch is in the Multi Chip Addressing Mode (a even address different than zero). While here fix a typo. Sponsored by: Rubicon Communications, LLC (Netgate) Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c Modified: head/sys/dev/etherswitch/e6000sw/e6000sw.c ============================================================================== --- head/sys/dev/etherswitch/e6000sw/e6000sw.c Sun Apr 30 07:31:48 2017 (r317604) +++ head/sys/dev/etherswitch/e6000sw/e6000sw.c Sun Apr 30 07:51:31 2017 (r317605) @@ -214,7 +214,6 @@ e6000sw_probe(device_t dev) e6000sw_softc_t *sc; const char *description; unsigned int id; - uint16_t dev_addr; phandle_t dsa_node, switch_node; dsa_node = fdt_find_compatible(OF_finddevice("/"), @@ -229,21 +228,11 @@ e6000sw_probe(device_t dev) sc->dev = dev; sc->node = switch_node; - /* Read ADDR[4:1]n using indirect access */ - MDIO_WRITE(dev, REG_GLOBAL2, SCR_AND_MISC_REG, - SCR_AND_MISC_PTR_CFG); - dev_addr = MDIO_READ(dev, REG_GLOBAL2, SCR_AND_MISC_REG) & - SCR_AND_MISC_DATA_CFG_MASK; - if (dev_addr != 0) { - sc->multi_chip = true; - device_printf(dev, "multi-chip addresing mode\n"); - } else { - device_printf(dev, "single-chip addressing mode\n"); - } - if (OF_getencprop(sc->node, "reg", &sc->sw_addr, sizeof(sc->sw_addr)) < 0) return (ENXIO); + if (sc->sw_addr != 0 && (sc->sw_addr % 2) == 0) + sc->multi_chip = true; /* Lock is necessary due to assertions. */ sx_init(&sc->sx, "e6000sw"); @@ -368,6 +357,11 @@ e6000sw_attach(device_t dev) err = 0; sc = device_get_softc(dev); + if (sc->multi_chip) + device_printf(dev, "multi-chip addressing mode\n"); + else + device_printf(dev, "single-chip addressing mode\n"); + E6000SW_LOCK(sc); e6000sw_setup(dev, sc); bzero(member_ports, sizeof(member_ports)); From owner-svn-src-all@freebsd.org Sun Apr 30 10:48:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 79DA5D57C8B; Sun, 30 Apr 2017 10:48:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51E6F841; Sun, 30 Apr 2017 10:48:00 +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 v3UAlxjq007875; Sun, 30 Apr 2017 10:47:59 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3UAlxoH007874; Sun, 30 Apr 2017 10:47:59 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704301047.v3UAlxoH007874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Apr 2017 10:47:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317606 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 10:48:00 -0000 Author: kib Date: Sun Apr 30 10:47:59 2017 New Revision: 317606 URL: https://svnweb.freebsd.org/changeset/base/317606 Log: Style. - Use ANSI C function definitions. - Remove redundand cast. - Minor style compliance tweaks. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Sun Apr 30 07:51:31 2017 (r317605) +++ head/lib/libc/gen/sem_new.c Sun Apr 30 10:47:59 2017 (r317606) @@ -77,24 +77,26 @@ struct sem_nameinfo { static pthread_once_t once = PTHREAD_ONCE_INIT; static pthread_mutex_t sem_llock; -static LIST_HEAD(,sem_nameinfo) sem_list = LIST_HEAD_INITIALIZER(sem_list); +static LIST_HEAD(, sem_nameinfo) sem_list = LIST_HEAD_INITIALIZER(sem_list); static void -sem_prefork() +sem_prefork(void) { _pthread_mutex_lock(&sem_llock); } static void -sem_postfork() +sem_postfork(void) { + _pthread_mutex_unlock(&sem_llock); } static void -sem_child_postfork() +sem_child_postfork(void) { + _pthread_mutex_unlock(&sem_llock); } @@ -116,10 +118,8 @@ sem_check_validity(sem_t *sem) if (sem->_magic == SEM_MAGIC) return (0); - else { - errno = EINVAL; - return (-1); - } + errno = EINVAL; + return (-1); } int @@ -142,13 +142,16 @@ sem_t * _sem_open(const char *name, int flags, ...) { char path[PATH_MAX]; - struct stat sb; va_list ap; - struct sem_nameinfo *ni = NULL; - sem_t *sem = NULL; - int fd = -1, mode, len, errsave; - int value = 0; + struct sem_nameinfo *ni; + sem_t *sem, tmp; + int errsave, fd, len, mode, value; + + ni = NULL; + sem = NULL; + fd = -1; + value = 0; if (name[0] != '/') { errno = EINVAL; @@ -213,8 +216,6 @@ _sem_open(const char *name, int flags, . goto error; } if (sb.st_size < sizeof(sem_t)) { - sem_t tmp; - tmp._magic = SEM_MAGIC; tmp._kern._count = value; tmp._kern._flags = USYNC_PROCESS_SHARED | SEM_NAMED; @@ -222,8 +223,8 @@ _sem_open(const char *name, int flags, . goto error; } flock(fd, LOCK_UN); - sem = (sem_t *)mmap(NULL, sizeof(sem_t), PROT_READ|PROT_WRITE, - MAP_SHARED|MAP_NOSYNC, fd, 0); + sem = mmap(NULL, sizeof(sem_t), PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_NOSYNC, fd, 0); if (sem == MAP_FAILED) { sem = NULL; if (errno == ENOMEM) @@ -277,12 +278,11 @@ _sem_close(sem_t *sem) _pthread_mutex_unlock(&sem_llock); return (0); } - else - break; + break; } } - if (ni) { + if (ni != NULL) { LIST_REMOVE(ni, next); _pthread_mutex_unlock(&sem_llock); munmap(sem, sizeof(*sem)); @@ -342,7 +342,8 @@ _sem_getvalue(sem_t * __restrict sem, in static __inline int usem_wake(struct _usem2 *sem) { - return _umtx_op(sem, UMTX_OP_SEM2_WAKE, 0, NULL, NULL); + + return (_umtx_op(sem, UMTX_OP_SEM2_WAKE, 0, NULL, NULL)); } static __inline int @@ -436,6 +437,7 @@ int _sem_timedwait(sem_t * __restrict sem, const struct timespec * __restrict abstime) { + return (_sem_clockwait_np(sem, CLOCK_REALTIME, TIMER_ABSTIME, abstime, NULL)); }; @@ -443,7 +445,8 @@ _sem_timedwait(sem_t * __restrict sem, int _sem_wait(sem_t *sem) { - return _sem_timedwait(sem, NULL); + + return (_sem_timedwait(sem, NULL)); } /* From owner-svn-src-all@freebsd.org Sun Apr 30 13:25:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DC21D57133; Sun, 30 Apr 2017 13:25:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D70CF4B; Sun, 30 Apr 2017 13:25:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3UDPBVB075194; Sun, 30 Apr 2017 13:25:11 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3UDPB1H075193; Sun, 30 Apr 2017 13:25:11 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201704301325.v3UDPB1H075193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 30 Apr 2017 13:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317607 - stable/11/tools/build/mk X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 13:25:12 -0000 Author: dim Date: Sun Apr 30 13:25:10 2017 New Revision: 317607 URL: https://svnweb.freebsd.org/changeset/base/317607 Log: MFC r310889 (by jkim): Do not remove llvm-objdump. It is installed by default since r310840. MFC r311311 (by jkim): Remove llvm-objdump when Clang is disabled. It was missed in r310889. Submitted by: dim Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/11/tools/build/mk/OptionalObsoleteFiles.inc Sun Apr 30 10:47:59 2017 (r317606) +++ stable/11/tools/build/mk/OptionalObsoleteFiles.inc Sun Apr 30 13:25:10 2017 (r317607) @@ -1354,6 +1354,7 @@ OLD_FILES+=usr/bin/clang OLD_FILES+=usr/bin/clang++ OLD_FILES+=usr/bin/clang-cpp OLD_FILES+=usr/bin/clang-tblgen +OLD_FILES+=usr/bin/llvm-objdump OLD_FILES+=usr/bin/llvm-tblgen OLD_FILES+=usr/lib/clang/4.0.0/include/sanitizer/allocator_interface.h OLD_FILES+=usr/lib/clang/4.0.0/include/sanitizer/asan_interface.h @@ -1498,7 +1499,6 @@ OLD_FILES+=usr/bin/llvm-lto2 OLD_FILES+=usr/bin/llvm-mc OLD_FILES+=usr/bin/llvm-modextract OLD_FILES+=usr/bin/llvm-nm -OLD_FILES+=usr/bin/llvm-objdump OLD_FILES+=usr/bin/llvm-pdbdump OLD_FILES+=usr/bin/llvm-ranlib OLD_FILES+=usr/bin/llvm-rtdyld From owner-svn-src-all@freebsd.org Sun Apr 30 14:35:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E6ECD577E2; Sun, 30 Apr 2017 14:35:31 +0000 (UTC) (envelope-from rionda@gmail.com) Received: from mail-qt0-x236.google.com (mail-qt0-x236.google.com [IPv6:2607:f8b0:400d:c0d::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 2593DA91; Sun, 30 Apr 2017 14:35:31 +0000 (UTC) (envelope-from rionda@gmail.com) Received: by mail-qt0-x236.google.com with SMTP id m36so77978383qtb.0; Sun, 30 Apr 2017 07:35:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=AMTYd9Vg/gxep0ZomHUJOXNXkcQVSFRiRweHUgh0CPE=; b=aIbfEhq86/YTqafvtgvbNuvSdUuC/aCHG1fcFDeVEaXNbl/dbgl/Bdg+a1c8qVKmQ8 4LYwtxVRVYZNBLWiK3Sz+ELJ0Fw5RuTtC0WUSzo8JPDE4Rwn1s5fUORq4KGjBEc6+M2p 9ohG1wjeG+dMQ0qcPfEti1lWyATC5Zg6AbH3b0LdUL3BIuRE4+gNZ7Bv5IX65mQ/dHco H8HglZWwBjDZsImkqR6cd6pJW7R113ZKYvg6Y8L77EQ8jh2NvEjg/fDKP/GaKUn4Kr7x GnrQ5iAMXcEgACwjBYGpYvO+eSOoTlonVPIfBIUeZGzZLPtvuz8rL1PFViqGa1ICWJyl E78g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=AMTYd9Vg/gxep0ZomHUJOXNXkcQVSFRiRweHUgh0CPE=; b=a8eAtK/bvo0aH8DSnaWE6J9duO4msMhiaovYBzfD7yFI7y9/fDBFNoek5cSQ5jQxPe GjtRq0bedio9Bzr3XrxyHOTd/A8UoJcJ2Yl7aWkpOUpkO91VLg3r7vAz7dMC6l8J0+Ld vFY5ex53LALUbPsRZM3KTOaoL/fRcUX33QP+j43rPeOKs1Jl6zZVf5UTrIcknPI79Rjo 0O8wakZEg0En++9ZnpXkCbuQ6IrP73+SRWBj9tn9bNQasZEpVxDMk4mI72DXYzYLHYyk udWpv58HgZF22fr4CC3mm1vlsOjqhpGgeyhhl0OGXQYqIcqwLdaFC6soR00Hlwa+vHK7 TgBw== X-Gm-Message-State: AN3rC/4vMbOLhRJrV8p/y9y5vzdbtkK5asA/m8paPCN1+u0vNwZ6SV7D HPh8l9Nc9FVykUVFFdo= X-Received: by 10.200.44.130 with SMTP id 2mr19023058qtw.59.1493562930039; Sun, 30 Apr 2017 07:35:30 -0700 (PDT) Received: from abulafia.home (pool-72-92-236-111.prvdri.fios.verizon.net. [72.92.236.111]) by smtp.gmail.com with ESMTPSA id o190sm8174005qkc.65.2017.04.30.07.35.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Apr 2017 07:35:28 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r317600 - in head/sys: amd64/vmm/amd modules/vmm From: Matteo Riondato In-Reply-To: <201704300208.v3U28lZo093446@repo.freebsd.org> Date: Sun, 30 Apr 2017 10:35:33 -0400 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <11FF3746-5B36-47A2-B44C-9ED53AE02F03@gmail.com> References: <201704300208.v3U28lZo093446@repo.freebsd.org> To: Anish Gupta X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 14:35:31 -0000 > On Apr 29, 2017, at 10:08 PM, Anish Gupta wrote: >=20 > Author: anish > Date: Sun Apr 30 02:08:46 2017 > New Revision: 317600 > URL: https://svnweb.freebsd.org/changeset/base/317600 >=20 > Log: > Add AMD IOMMU/AMD-Vi support in bhyve for passthrough/direct = assignment to VMs. To enable AMD-Vi, set hw.vmm.amdvi.enable=3D1. This knob should likely be documented somewhere, and maybe also = "Relnotes: yes" ? Thank you, Matteo From owner-svn-src-all@freebsd.org Sun Apr 30 16:12:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FF6FD570DE; Sun, 30 Apr 2017 16:12:25 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3F07C57; Sun, 30 Apr 2017 16:12:24 +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 v3UGCNPk048028; Sun, 30 Apr 2017 16:12:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3UGCNLl048027; Sun, 30 Apr 2017 16:12:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201704301612.v3UGCNLl048027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 30 Apr 2017 16:12:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317608 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 16:12:25 -0000 Author: emaste Date: Sun Apr 30 16:12:23 2017 New Revision: 317608 URL: https://svnweb.freebsd.org/changeset/base/317608 Log: revert r313473 (Disable LLD_IS_LD option combinations that fail) r316647 corrected the build of tblgen and libllvm as dependencies for LLD so undo the temporary seat-belt. We still want to extend the build infrastructure to automatically detect the case where the host LLD can be used instead of building a bootstrap LLD, and likely extend libllvmminimal to meet LLD's needs for cases where the build includes LLD but not Clang. Sponsored by: The FreeBSD Foundation Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sun Apr 30 13:25:10 2017 (r317607) +++ head/share/mk/src.opts.mk Sun Apr 30 16:12:23 2017 (r317608) @@ -339,16 +339,6 @@ MK_LDNS_UTILS:= no MK_UNBOUND:= no .endif -.if ${MK_LLD} == "no" -MK_LLD_IS_LD:= no -.endif - -# LLD requires LLVM libraries, and we do not yet compare in-tree and host LLD -# versions to avoid building it if they are identical. -.if ${MK_LLD_IS_LD} != "no" -MK_SYSTEM_COMPILER:= no -.endif - .if ${MK_SOURCELESS} == "no" MK_SOURCELESS_HOST:= no MK_SOURCELESS_UCODE:= no From owner-svn-src-all@freebsd.org Sun Apr 30 18:39:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A95D5D57E66; Sun, 30 Apr 2017 18:39:32 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 704061AF7; Sun, 30 Apr 2017 18:39:32 +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 v3UIdVni005368; Sun, 30 Apr 2017 18:39:31 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3UIdVcA005366; Sun, 30 Apr 2017 18:39:31 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201704301839.v3UIdVcA005366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 30 Apr 2017 18:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317609 - in stable/11/sys/dev/drm2: . i915 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 18:39:32 -0000 Author: markj Date: Sun Apr 30 18:39:31 2017 New Revision: 317609 URL: https://svnweb.freebsd.org/changeset/base/317609 Log: MFC r316749 (by cem): drm2: Add some missing PCIIDs for some Haswell systems PR: 218969 Modified: stable/11/sys/dev/drm2/drm_pciids.h stable/11/sys/dev/drm2/i915/i915_drv.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/drm2/drm_pciids.h ============================================================================== --- stable/11/sys/dev/drm2/drm_pciids.h Sun Apr 30 16:12:23 2017 (r317608) +++ stable/11/sys/dev/drm2/drm_pciids.h Sun Apr 30 18:39:31 2017 (r317609) @@ -54,6 +54,7 @@ {0x8086, 0x0412, 0, "Intel Haswell (GT2 desktop)"}, \ {0x8086, 0x0416, 0, "Intel Haswell (GT2 mobile)"}, \ {0x8086, 0x041A, 0, "Intel Haswell (GT2 server)"}, \ + {0x8086, 0x041E, 0, "Intel Haswell (GT2 desktop)"}, \ {0x8086, 0x0422, 0, "Intel Haswell (GT2 desktop)"}, \ {0x8086, 0x0426, 0, "Intel Haswell (GT2 mobile)"}, \ {0x8086, 0x042A, 0, "Intel Haswell (GT2 server)"}, \ Modified: stable/11/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- stable/11/sys/dev/drm2/i915/i915_drv.c Sun Apr 30 16:12:23 2017 (r317608) +++ stable/11/sys/dev/drm2/i915/i915_drv.c Sun Apr 30 18:39:31 2017 (r317609) @@ -380,6 +380,7 @@ static const struct intel_gfx_device_id INTEL_VGA_DEVICE(0x016a, &intel_ivybridge_d_info), /* GT2 server */ INTEL_VGA_DEVICE(0x0402, &intel_haswell_d_info), /* GT1 desktop */ INTEL_VGA_DEVICE(0x0412, &intel_haswell_d_info), /* GT2 desktop */ + INTEL_VGA_DEVICE(0x041e, &intel_haswell_d_info), /* GT2 desktop */ INTEL_VGA_DEVICE(0x0422, &intel_haswell_d_info), /* GT2 desktop */ INTEL_VGA_DEVICE(0x040a, &intel_haswell_d_info), /* GT1 server */ INTEL_VGA_DEVICE(0x041a, &intel_haswell_d_info), /* GT2 server */ From owner-svn-src-all@freebsd.org Sun Apr 30 19:32:52 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD39CD57F53; Sun, 30 Apr 2017 19:32:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D93618D3; Sun, 30 Apr 2017 19:32:52 +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 v3UJWpsw029580; Sun, 30 Apr 2017 19:32:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3UJWpHH029579; Sun, 30 Apr 2017 19:32:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704301932.v3UJWpHH029579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Apr 2017 19:32:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317610 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 19:32:52 -0000 Author: kib Date: Sun Apr 30 19:32:51 2017 New Revision: 317610 URL: https://svnweb.freebsd.org/changeset/base/317610 Log: Restructure normal (non-error) control flow in sem_close(). Do not retest for the found semaphore after the loop to look it up. Instead, handle both cases of last and non-last close simultaneously, which allows to consolidate the list unlock and successful return. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Sun Apr 30 18:39:31 2017 (r317609) +++ head/lib/libc/gen/sem_new.c Sun Apr 30 19:32:51 2017 (r317610) @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include @@ -260,6 +261,7 @@ int _sem_close(sem_t *sem) { struct sem_nameinfo *ni; + bool last; if (sem_check_validity(sem) != 0) return (-1); @@ -274,21 +276,17 @@ _sem_close(sem_t *sem) _pthread_mutex_lock(&sem_llock); LIST_FOREACH(ni, &sem_list, next) { if (sem == ni->sem) { - if (--ni->open_count > 0) { - _pthread_mutex_unlock(&sem_llock); - return (0); + last = --ni->open_count == 0; + if (last) + LIST_REMOVE(ni, next); + _pthread_mutex_unlock(&sem_llock); + if (last) { + munmap(sem, sizeof(*sem)); + free(ni); } - break; + return (0); } } - - if (ni != NULL) { - LIST_REMOVE(ni, next); - _pthread_mutex_unlock(&sem_llock); - munmap(sem, sizeof(*sem)); - free(ni); - return (0); - } _pthread_mutex_unlock(&sem_llock); errno = EINVAL; return (-1); From owner-svn-src-all@freebsd.org Sun Apr 30 19:37:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DB47D57081; Sun, 30 Apr 2017 19:37:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E3471ADC; Sun, 30 Apr 2017 19:37:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3UJbjTk029819; Sun, 30 Apr 2017 19:37:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3UJbjGE029818; Sun, 30 Apr 2017 19:37:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201704301937.v3UJbjGE029818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Apr 2017 19:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317611 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 19:37:46 -0000 Author: kib Date: Sun Apr 30 19:37:45 2017 New Revision: 317611 URL: https://svnweb.freebsd.org/changeset/base/317611 Log: Make semaphore names list mutex non-recursive. The mutex is used in sem_open() and sem_close(), which cannot recurse. The atfork handlers cannot collide with the open and close code. Reviewed by: vangyzen Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D10545 Modified: head/lib/libc/gen/sem_new.c Modified: head/lib/libc/gen/sem_new.c ============================================================================== --- head/lib/libc/gen/sem_new.c Sun Apr 30 19:32:51 2017 (r317610) +++ head/lib/libc/gen/sem_new.c Sun Apr 30 19:37:45 2017 (r317611) @@ -104,12 +104,8 @@ sem_child_postfork(void) static void sem_module_init(void) { - pthread_mutexattr_t ma; - _pthread_mutexattr_init(&ma); - _pthread_mutexattr_settype(&ma, PTHREAD_MUTEX_RECURSIVE); - _pthread_mutex_init(&sem_llock, &ma); - _pthread_mutexattr_destroy(&ma); + _pthread_mutex_init(&sem_llock, NULL); _pthread_atfork(sem_prefork, sem_postfork, sem_child_postfork); } From owner-svn-src-all@freebsd.org Sun Apr 30 19:43:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AAEDD572EF; Sun, 30 Apr 2017 19:43:51 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id 53BD41F4A; Sun, 30 Apr 2017 19:43:51 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from ford.home.vangyzen.net (unknown [76.164.15.242]) by smtp.vangyzen.net (Postfix) with ESMTPSA id B10875646C; Sun, 30 Apr 2017 14:43:50 -0500 (CDT) Subject: Re: svn commit: r315526 - in head: contrib/netbsd-tests/lib/libc/sys include lib/libc/include lib/libc/sys lib/libc/tests/sys lib/libthr/thread share/man/man3 sys/compat/freebsd32 sys/kern sys/sys To: Chagin Dmitry Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201703190051.v2J0pDW9028513@repo.freebsd.org> <20170429093946.GA2227@mordor.heemeyer.club> From: Eric van Gyzen Message-ID: <878e48b9-2680-e4ba-c578-8e8c6ed43cb0@FreeBSD.org> Date: Sun, 30 Apr 2017 14:43:45 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0 MIME-Version: 1.0 In-Reply-To: <20170429093946.GA2227@mordor.heemeyer.club> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 19:43:51 -0000 On 04/29/2017 04:39, Chagin Dmitry wrote: > On Sun, Mar 19, 2017 at 12:51:13AM +0000, Eric van Gyzen wrote: >> Author: vangyzen >> Date: Sun Mar 19 00:51:12 2017 >> New Revision: 315526 >> URL: https://svnweb.freebsd.org/changeset/base/315526 >> >> Log: >> Add clock_nanosleep() > > hi, why it is not merged still? There is no technical reason, just time and other priorities. I'm starting the merge now. Eric From owner-svn-src-all@freebsd.org Sun Apr 30 20:13:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EABB0D57B85; Sun, 30 Apr 2017 20:13:31 +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 90F22D2; Sun, 30 Apr 2017 20:13:31 +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 v3UKDP6n046704 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 30 Apr 2017 23:13:26 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v3UKDP6n046704 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v3UKDPZO046703; Sun, 30 Apr 2017 23:13:25 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 30 Apr 2017 23:13:25 +0300 From: Konstantin Belousov To: Bruce Evans Cc: Alan Somers , Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... Message-ID: <20170430201324.GV1622@kib.kiev.ua> References: <201704171734.v3HHYlf5022945@repo.freebsd.org> <20170419130428.J956@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170419130428.J956@besplex.bde.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Apr 2017 20:13:32 -0000 On Wed, Apr 19, 2017 at 02:09:58PM +1000, Bruce Evans wrote: > On Tue, 18 Apr 2017, Alan Somers wrote: > > > On Mon, Apr 17, 2017 at 11:34 AM, Gleb Smirnoff wrote: > > >> head/usr.bin/top/machine.c > >> head/usr.bin/vmstat/vmstat.c > > The previous 2 lines turn out to be relevant. I missed the update to > vmstat and checked a wrong version in my bug report described below > I checked an updated top, but the change seemed too small to help. > systat was not updated. > > > This change broke backwards compatibility with old top binaries. When > > I use a kernel at version 317094 but a top from 14-April, I get the > > error "top: sysctl(vm.stats.vm.v_swappgsin...) failed: Cannot allocate > > memory". I get the same error when running top from an 11.0-RELEASE > > jail. Can you please add backward compatibility shims? > > I sent a much longer (30 times longer) bug report to the author of the > bug. > > Most or all statistics utilities that use vmmeter are broken. vmstat > is too broken to even notice the bug -- it silently ignores the error, > an has type errors which prevent other errors which it doesn't ignore. > The result is silently truncating to 32 bits, like a quick fix would > do intentionally. systat -v detects the errors but prints warning > messages to the status line where they overwrite each other so make > the problem look smaller than it is. The result is unsilently > truncating to 32 bits. > > I've never seen any backwards compatibility shims added for sysctls. > None should be needed, but there are few or no utilities other than > sysctl(8) which use sysctl(3) in a portable way. See vfs.bufspace handled by vfs_bio.c:sysctl_bufspace(). In fact, not only top and vmstat are broken. Quite unexpected and worrying, reboot(8) is broken as well. This is due to get_pageins() failing and system stopping userspace much earlier than it is desirable. I now believe that compat shims to handle int-sized vmstat queries are required. From owner-svn-src-all@freebsd.org Mon May 1 00:42:33 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28487D45823; Mon, 1 May 2017 00:42:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC0F13D7; Mon, 1 May 2017 00:42:32 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v410gVhe057450; Mon, 1 May 2017 00:42:31 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v410gVSO057449; Mon, 1 May 2017 00:42:31 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201705010042.v410gVSO057449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 1 May 2017 00:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317613 - stable/11/lib/libc/gen X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 00:42:33 -0000 Author: pfg Date: Mon May 1 00:42:31 2017 New Revision: 317613 URL: https://svnweb.freebsd.org/changeset/base/317613 Log: MFC r317372: scandir(3): promote arraysz to size_t to match numitems. The internal array size goes through a loop and is compared with numitems which at its limits makes can be unreachably higher than arraysz. Prevent an hypothetical overflow, and signed/unsigned comparison, by matching the types. Modified: stable/11/lib/libc/gen/scandir.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/scandir.c ============================================================================== --- stable/11/lib/libc/gen/scandir.c Sun Apr 30 22:38:15 2017 (r317612) +++ stable/11/lib/libc/gen/scandir.c Mon May 1 00:42:31 2017 (r317613) @@ -82,8 +82,7 @@ scandir(const char *dirname, struct dire #endif { struct dirent *d, *p, **names = NULL; - size_t numitems; - long arraysz; + size_t arraysz, numitems; DIR *dirp; if ((dirp = opendir(dirname)) == NULL) From owner-svn-src-all@freebsd.org Mon May 1 00:53:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19B61D45DBE; Mon, 1 May 2017 00:53:09 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFEF4C82; Mon, 1 May 2017 00:53:08 +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 v410r7Y5061694; Mon, 1 May 2017 00:53:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v410r7eB061693; Mon, 1 May 2017 00:53:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705010053.v410r7eB061693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 1 May 2017 00:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317614 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 00:53:09 -0000 Author: emaste Date: Mon May 1 00:53:07 2017 New Revision: 317614 URL: https://svnweb.freebsd.org/changeset/base/317614 Log: makefs: remove unused cd9660_defaults_set global Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/makefs/cd9660.c Modified: head/usr.sbin/makefs/cd9660.c ============================================================================== --- head/usr.sbin/makefs/cd9660.c Mon May 1 00:42:31 2017 (r317613) +++ head/usr.sbin/makefs/cd9660.c Mon May 1 00:53:07 2017 (r317614) @@ -186,8 +186,6 @@ cd9660_allocate_cd9660node(void) return temp; } -int cd9660_defaults_set = 0; - /** * Set default values for cd9660 extension to makefs */ @@ -234,8 +232,6 @@ cd9660_set_defaults(iso9660_disk *diskSt strcpy(diskStructure->primaryDescriptor.system_id, "FreeBSD"); - cd9660_defaults_set = 1; - /* Boot support: Initially disabled */ diskStructure->has_generic_bootimage = 0; diskStructure->generic_bootimage = NULL; From owner-svn-src-all@freebsd.org Mon May 1 01:36:59 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 693A7D58C1C; Mon, 1 May 2017 01:36:59 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 327231765; Mon, 1 May 2017 01:36:59 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v411awLT078897; Mon, 1 May 2017 01:36:58 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v411atC9078866; Mon, 1 May 2017 01:36:55 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201705010136.v411atC9078866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Mon, 1 May 2017 01:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317618 - in stable/11: contrib/netbsd-tests/lib/libc/sys include lib/libc/include lib/libc/sys lib/libc/tests/sys lib/libthr/thread share/man/man3 sys/compat/freebsd32 sys/kern sys/sys X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 01:36:59 -0000 Author: vangyzen Date: Mon May 1 01:36:54 2017 New Revision: 317618 URL: https://svnweb.freebsd.org/changeset/base/317618 Log: MFC r315526 Add clock_nanosleep() Add a clock_nanosleep() syscall, as specified by POSIX. Make nanosleep() a wrapper around it. Attach the clock_nanosleep test from NetBSD. Adjust it for the FreeBSD behavior of updating rmtp only when interrupted by a signal. I believe this to be POSIX-compliant, since POSIX mentions the rmtp parameter only in the paragraph about EINTR. This is also what Linux does. (NetBSD updates rmtp unconditionally.) Copy the whole nanosleep.2 man page from NetBSD because it is complete and closely resembles the POSIX description. Edit, polish, and reword it a bit, being sure to keep any relevant text from the FreeBSD page. Regenerate syscall files. Relnotes: yes Sponsored by: Dell EMC Added: stable/11/lib/libc/sys/clock_nanosleep.c - copied unchanged from r315526, head/lib/libc/sys/clock_nanosleep.c Modified: stable/11/contrib/netbsd-tests/lib/libc/sys/t_clock_nanosleep.c stable/11/include/time.h stable/11/lib/libc/include/libc_private.h stable/11/lib/libc/include/namespace.h stable/11/lib/libc/include/un-namespace.h stable/11/lib/libc/sys/Makefile.inc stable/11/lib/libc/sys/Symbol.map stable/11/lib/libc/sys/interposing_table.c stable/11/lib/libc/sys/nanosleep.2 stable/11/lib/libc/tests/sys/Makefile stable/11/lib/libthr/thread/thr_private.h stable/11/lib/libthr/thread/thr_syscalls.c stable/11/share/man/man3/pthread_testcancel.3 stable/11/sys/compat/freebsd32/freebsd32_misc.c stable/11/sys/compat/freebsd32/freebsd32_proto.h stable/11/sys/compat/freebsd32/freebsd32_syscall.h stable/11/sys/compat/freebsd32/freebsd32_syscalls.c stable/11/sys/compat/freebsd32/freebsd32_sysent.c stable/11/sys/compat/freebsd32/freebsd32_systrace_args.c stable/11/sys/compat/freebsd32/syscalls.master stable/11/sys/kern/init_sysent.c stable/11/sys/kern/kern_time.c stable/11/sys/kern/syscalls.c stable/11/sys/kern/syscalls.master stable/11/sys/kern/systrace_args.c stable/11/sys/sys/syscall.h stable/11/sys/sys/syscall.mk stable/11/sys/sys/syscallsubr.h stable/11/sys/sys/sysproto.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/netbsd-tests/lib/libc/sys/t_clock_nanosleep.c ============================================================================== --- stable/11/contrib/netbsd-tests/lib/libc/sys/t_clock_nanosleep.c Mon May 1 01:35:43 2017 (r317617) +++ stable/11/contrib/netbsd-tests/lib/libc/sys/t_clock_nanosleep.c Mon May 1 01:36:54 2017 (r317618) @@ -46,7 +46,11 @@ ATF_TC_BODY(clock_nanosleep_remain, tc) rqtp.tv_sec = 0; rqtp.tv_nsec = 0; rmtp.tv_sec = -1; rmtp.tv_nsec = -1; ATF_REQUIRE(clock_nanosleep(CLOCK_REALTIME, 0, &rqtp, &rmtp) == 0); +#ifdef __FreeBSD__ + ATF_CHECK(rmtp.tv_sec == -1 && rmtp.tv_nsec == -1); +#else ATF_CHECK(rmtp.tv_sec == 0 && rmtp.tv_nsec == 0); +#endif ATF_REQUIRE(clock_gettime(CLOCK_REALTIME, &rqtp) == 0); rmtp.tv_sec = -1; rmtp.tv_nsec = -1; Modified: stable/11/include/time.h ============================================================================== --- stable/11/include/time.h Mon May 1 01:35:43 2017 (r317617) +++ stable/11/include/time.h Mon May 1 01:36:54 2017 (r317618) @@ -169,12 +169,12 @@ void tzset(void); int clock_getres(clockid_t, struct timespec *); int clock_gettime(clockid_t, struct timespec *); int clock_settime(clockid_t, const struct timespec *); -/* XXX missing: clock_nanosleep() */ int nanosleep(const struct timespec *, struct timespec *); #endif /* __POSIX_VISIBLE >= 199309 */ #if __POSIX_VISIBLE >= 200112 int clock_getcpuclockid(pid_t, clockid_t *); +int clock_nanosleep(clockid_t, int, const struct timespec *, struct timespec *); #endif #if __POSIX_VISIBLE >= 199506 Modified: stable/11/lib/libc/include/libc_private.h ============================================================================== --- stable/11/lib/libc/include/libc_private.h Mon May 1 01:35:43 2017 (r317617) +++ stable/11/lib/libc/include/libc_private.h Mon May 1 01:36:54 2017 (r317618) @@ -229,6 +229,7 @@ enum { INTERPOS_ppoll, INTERPOS_map_stacks_exec, INTERPOS_fdatasync, + INTERPOS_clock_nanosleep, INTERPOS_MAX }; @@ -318,6 +319,8 @@ int __sys_aio_suspend(const struct aioc int __sys_accept(int, struct sockaddr *, __socklen_t *); int __sys_accept4(int, struct sockaddr *, __socklen_t *, int); int __sys_clock_gettime(__clockid_t, struct timespec *ts); +int __sys_clock_nanosleep(__clockid_t, int, + const struct timespec *, struct timespec *); int __sys_close(int); int __sys_connect(int, const struct sockaddr *, __socklen_t); int __sys_fcntl(int, int, ...); Modified: stable/11/lib/libc/include/namespace.h ============================================================================== --- stable/11/lib/libc/include/namespace.h Mon May 1 01:35:43 2017 (r317617) +++ stable/11/lib/libc/include/namespace.h Mon May 1 01:36:54 2017 (r317618) @@ -56,6 +56,7 @@ #define bind _bind #define __cap_get_fd ___cap_get_fd #define __cap_set_fd ___cap_set_fd +#define clock_nanosleep _clock_nanosleep #define close _close #define connect _connect #define dup _dup Modified: stable/11/lib/libc/include/un-namespace.h ============================================================================== --- stable/11/lib/libc/include/un-namespace.h Mon May 1 01:35:43 2017 (r317617) +++ stable/11/lib/libc/include/un-namespace.h Mon May 1 01:36:54 2017 (r317618) @@ -37,6 +37,7 @@ #undef bind #undef __cap_get_fd #undef __cap_set_fd +#undef clock_nanosleep #undef close #undef connect #undef dup Modified: stable/11/lib/libc/sys/Makefile.inc ============================================================================== --- stable/11/lib/libc/sys/Makefile.inc Mon May 1 01:35:43 2017 (r317617) +++ stable/11/lib/libc/sys/Makefile.inc Mon May 1 01:36:54 2017 (r317618) @@ -34,6 +34,7 @@ INTERPOSED = \ accept \ accept4 \ aio_suspend \ + clock_nanosleep \ close \ connect \ fcntl \ @@ -349,6 +350,7 @@ MLINKS+=chown.2 fchown.2 \ chown.2 lchown.2 MLINKS+=clock_gettime.2 clock_getres.2 \ clock_gettime.2 clock_settime.2 +MLINKS+=nanosleep.2 clock_nanosleep.2 MLINKS+=cpuset.2 cpuset_getid.2 \ cpuset.2 cpuset_setid.2 MLINKS+=cpuset_getaffinity.2 cpuset_setaffinity.2 Modified: stable/11/lib/libc/sys/Symbol.map ============================================================================== --- stable/11/lib/libc/sys/Symbol.map Mon May 1 01:35:43 2017 (r317617) +++ stable/11/lib/libc/sys/Symbol.map Mon May 1 01:36:54 2017 (r317618) @@ -399,6 +399,7 @@ FBSD_1.4 { }; FBSD_1.5 { + clock_nanosleep; fdatasync; }; @@ -511,6 +512,7 @@ FBSDprivate_1.0 { __sys_clock_getres; _clock_gettime; __sys_clock_gettime; + __sys_clock_nanosleep; _clock_settime; __sys_clock_settime; _close; Copied: stable/11/lib/libc/sys/clock_nanosleep.c (from r315526, head/lib/libc/sys/clock_nanosleep.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libc/sys/clock_nanosleep.c Mon May 1 01:36:54 2017 (r317618, copy of r315526, head/lib/libc/sys/clock_nanosleep.c) @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2017 Eric van Gyzen + * Copyright (c) 2014 The FreeBSD Foundation. + * All rights reserved. + * + * Portions of this software were developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice(s), this list of conditions and the following disclaimer as + * the first lines of this file unmodified other than the possible + * addition of one or more copyright notices. + * 2. Redistributions in binary form must reproduce the above copyright + * notice(s), this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE + * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, + * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include "libc_private.h" + +__weak_reference(__sys_clock_nanosleep, __clock_nanosleep); + +#pragma weak clock_nanosleep +int +clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, + struct timespec *rmtp) +{ + + return (((int (*)(clockid_t, int, const struct timespec *, + struct timespec *)) + __libc_interposing[INTERPOS_clock_nanosleep])(clock_id, flags, + rqtp, rmtp)); +} Modified: stable/11/lib/libc/sys/interposing_table.c ============================================================================== --- stable/11/lib/libc/sys/interposing_table.c Mon May 1 01:35:43 2017 (r317617) +++ stable/11/lib/libc/sys/interposing_table.c Mon May 1 01:36:54 2017 (r317618) @@ -80,6 +80,7 @@ interpos_func_t __libc_interposing[INTER SLOT(ppoll, __sys_ppoll), SLOT(map_stacks_exec, __libc_map_stacks_exec), SLOT(fdatasync, __sys_fdatasync), + SLOT(clock_nanosleep, __sys_clock_nanosleep), }; #undef SLOT Modified: stable/11/lib/libc/sys/nanosleep.2 ============================================================================== --- stable/11/lib/libc/sys/nanosleep.2 Mon May 1 01:35:43 2017 (r317617) +++ stable/11/lib/libc/sys/nanosleep.2 Mon May 1 01:36:54 2017 (r317618) @@ -1,5 +1,4 @@ -.\" $OpenBSD: nanosleep.2,v 1.1 1997/04/20 20:56:20 tholo Exp $ -.\" $NetBSD: nanosleep.2,v 1.1 1997/04/17 18:12:02 jtc Exp $ +.\" $NetBSD: nanosleep.2,v 1.23 2016/11/14 10:40:59 wiz Exp $ .\" .\" Copyright (c) 1986, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -31,51 +30,136 @@ .\" @(#)sleep.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 17, 1997 +.Dd March 17, 2017 .Dt NANOSLEEP 2 .Os .Sh NAME .Nm nanosleep -.Nd suspend process execution for an interval measured in nanoseconds +.Nd high resolution sleep .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In time.h .Ft int -.Fn nanosleep "const struct timespec *rqtp" "struct timespec *rmtp" +.Fo clock_nanosleep +.Fa "clockid_t clock_id" +.Fa "int flags" +.Fa "const struct timespec *rqtp" +.Fa "struct timespec *rmtp" +.Fc +.Ft int +.Fo nanosleep +.Fa "const struct timespec *rqtp" +.Fa "struct timespec *rmtp" +.Fc .Sh DESCRIPTION -The -.Fn nanosleep -system call -causes the calling thread to sleep until the time interval specified by +If the +.Dv TIMER_ABSTIME +flag is not set in the +.Fa flags +argument, then +.Fn clock_nanosleep +suspends execution of the calling thread until either the +time interval specified by the +.Fa rqtp +argument has elapsed, +or a signal is delivered to the calling process and its +action is to invoke a signal-catching function or to terminate the +process. +The clock used to measure the time is specified by the +.Fa clock_id +argument. +.Pp +If the +.Dv TIMER_ABSTIME +flag is set in the +.Fa flags +argument, then +.Fn clock_nanosleep +suspends execution of the calling thread until either the value +of the clock specified by the +.Fa clock_id +argument reaches the absolute time specified by the +.Fa rqtp +argument, +or a signal is delivered to the calling process and its +action is to invoke a signal-catching function or to terminate the +process. +If, at the time of the call, the time value specified by .Fa rqtp -has elapsed. -An unmasked signal will -cause it to terminate the sleep early, regardless of the +is less than or equal to the time value of the specified clock, then +.Fn clock_nanosleep +returns immediately and the calling thread is not suspended. +.Pp +The suspension time may be longer than requested due to the +scheduling of other activity by the system. +An unmasked signal will terminate the sleep early, regardless of the .Dv SA_RESTART value on the interrupting signal. -.Sh RETURN VALUES -If the +The +.Fa rqtp +and +.Fa rmtp +arguments can point to the same object. +.Pp +The following +.Fa clock_id +values are supported: +.Pp +.Bl -item -compact -offset indent +.It +CLOCK_MONOTONIC +.It +CLOCK_MONOTONIC_FAST +.It +CLOCK_MONOTONIC_PRECISE +.It +CLOCK_REALTIME +.It +CLOCK_REALTIME_FAST +.It +CLOCK_REALTIME_PRECISE +.It +CLOCK_SECOND +.It +CLOCK_UPTIME +.It +CLOCK_UPTIME_FAST +.It +CLOCK_UPTIME_PRECISE +.El +.Pp +The .Fn nanosleep -system call returns because the requested time has elapsed, the value -returned will be zero. +function behaves like +.Fn clock_nanosleep +with a +.Fa clock_id +argument of +.Dv CLOCK_REALTIME +and without the +.Dv TIMER_ABSTIME +flag in the +.Fa flags +argument. +.Sh RETURN VALUES +These functions return zero when the requested time has elapsed. .Pp -If the +If these functions return for any other reason, then +.Fn clock_nanosleep +will directly return the error number, and .Fn nanosleep -system call returns due to the delivery of a signal, the value returned -will be -1, and the global variable +will return \-1 with the global variable .Va errno -will be set to indicate the interruption. -If +set to indicate the error. +If a relative sleep is interrupted by a signal and .Fa rmtp is -.No non- Ns Dv NULL , +.Pf non- Dv NULL , the timespec structure it references is updated to contain the unslept amount (the request time minus the time actually slept). .Sh ERRORS -The -.Fn nanosleep -system call fails if: +These functions can fail with the following errors. .Bl -tag -width Er .It Bq Er EFAULT Either @@ -85,27 +169,32 @@ or points to memory that is not a valid part of the process address space. .It Bq Er EINTR -The -.Fn nanosleep -system call -was interrupted by the delivery of a signal. +The function was interrupted by the delivery of a signal. .It Bq Er EINVAL The .Fa rqtp -argument -specified a nanosecond value less than zero +argument specified a nanosecond value less than zero or greater than or equal to 1000 million. -.It Bq Er ENOSYS +.It Bq Er EINVAL The -.Fn nanosleep -system call -is not supported by this implementation. +.Fa flags +argument contained an invalid flag. +.It Bq Er EINVAL +The +.Fa clock_id +argument was +.Dv CLOCK_THREAD_CPUTIME_ID +or an unrecognized value. +.It Bq Er ENOTSUP +The +.Fa clock_id +argument was valid but not supported by this implementation of +.Fn clock_nanosleep . .El .Sh SEE ALSO -.Xr sigsuspend 2 , +.Xr clock_gettime 2 , +.Xr sigaction 2 , .Xr sleep 3 .Sh STANDARDS -The -.Fn nanosleep -system call conforms to -.St -p1003.1b-93 . +These functions conform to +.St -p1003.1-2008 . Modified: stable/11/lib/libc/tests/sys/Makefile ============================================================================== --- stable/11/lib/libc/tests/sys/Makefile Mon May 1 01:35:43 2017 (r317617) +++ stable/11/lib/libc/tests/sys/Makefile Mon May 1 01:36:54 2017 (r317618) @@ -12,6 +12,7 @@ NETBSD_ATF_TESTS_C+= access_test NETBSD_ATF_TESTS_C+= bind_test NETBSD_ATF_TESTS_C+= chroot_test NETBSD_ATF_TESTS_C+= clock_gettime_test +NETBSD_ATF_TESTS_C+= clock_nanosleep_test NETBSD_ATF_TESTS_C+= connect_test NETBSD_ATF_TESTS_C+= dup_test NETBSD_ATF_TESTS_C+= fsync_test Modified: stable/11/lib/libthr/thread/thr_private.h ============================================================================== --- stable/11/lib/libthr/thread/thr_private.h Mon May 1 01:35:43 2017 (r317617) +++ stable/11/lib/libthr/thread/thr_private.h Mon May 1 01:36:54 2017 (r317618) @@ -865,6 +865,8 @@ int __sys_sigwaitinfo(const sigset_t *se /* #include */ #ifdef _TIME_H_ +int __sys_clock_nanosleep(clockid_t, int, const struct timespec *, + struct timespec *); int __sys_nanosleep(const struct timespec *, struct timespec *); #endif Modified: stable/11/lib/libthr/thread/thr_syscalls.c ============================================================================== --- stable/11/lib/libthr/thread/thr_syscalls.c Mon May 1 01:35:43 2017 (r317617) +++ stable/11/lib/libthr/thread/thr_syscalls.c Mon May 1 01:36:54 2017 (r317618) @@ -260,6 +260,22 @@ __thr_msync(void *addr, size_t len, int } static int +__thr_clock_nanosleep(clockid_t clock_id, int flags, + const struct timespec *time_to_sleep, struct timespec *time_remaining) +{ + struct pthread *curthread; + int ret; + + curthread = _get_curthread(); + _thr_cancel_enter(curthread); + ret = __sys_clock_nanosleep(clock_id, flags, time_to_sleep, + time_remaining); + _thr_cancel_leave(curthread, 1); + + return (ret); +} + +static int __thr_nanosleep(const struct timespec *time_to_sleep, struct timespec *time_remaining) { @@ -668,6 +684,7 @@ __thr_interpose_libc(void) SLOT(ppoll); SLOT(map_stacks_exec); SLOT(fdatasync); + SLOT(clock_nanosleep); #undef SLOT *(__libc_interposing_slot( INTERPOS__pthread_mutex_init_calloc_cb)) = Modified: stable/11/share/man/man3/pthread_testcancel.3 ============================================================================== --- stable/11/share/man/man3/pthread_testcancel.3 Mon May 1 01:35:43 2017 (r317617) +++ stable/11/share/man/man3/pthread_testcancel.3 Mon May 1 01:36:54 2017 (r317618) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd February 17, 2017 +.Dd March 18, 2017 .Dt PTHREAD_TESTCANCEL 3 .Os .Sh NAME @@ -105,6 +105,7 @@ functions: .It Fn accept4 .It Fn aio_suspend .It Fn connect +.It Fn clock_nanosleep .It Fn close .It Fn creat .It Fn fcntl Modified: stable/11/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_misc.c Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/compat/freebsd32/freebsd32_misc.c Mon May 1 01:36:54 2017 (r317618) @@ -129,6 +129,8 @@ CTASSERT(sizeof(struct sigaction32) == 2 static int freebsd32_kevent_copyout(void *arg, struct kevent *kevp, int count); static int freebsd32_kevent_copyin(void *arg, struct kevent *kevp, int count); +static int freebsd32_user_clock_nanosleep(struct thread *td, clockid_t clock_id, + int flags, const struct timespec32 *ua_rqtp, struct timespec32 *ua_rmtp); void freebsd32_rusage_out(const struct rusage *s, struct rusage32 *s32) @@ -2226,28 +2228,48 @@ ofreebsd32_sigstack(struct thread *td, int freebsd32_nanosleep(struct thread *td, struct freebsd32_nanosleep_args *uap) { + + return (freebsd32_user_clock_nanosleep(td, CLOCK_REALTIME, + TIMER_RELTIME, uap->rqtp, uap->rmtp)); +} + +int +freebsd32_clock_nanosleep(struct thread *td, + struct freebsd32_clock_nanosleep_args *uap) +{ + int error; + + error = freebsd32_user_clock_nanosleep(td, uap->clock_id, uap->flags, + uap->rqtp, uap->rmtp); + return (kern_posix_error(td, error)); +} + +static int +freebsd32_user_clock_nanosleep(struct thread *td, clockid_t clock_id, + int flags, const struct timespec32 *ua_rqtp, struct timespec32 *ua_rmtp) +{ struct timespec32 rmt32, rqt32; struct timespec rmt, rqt; int error; - error = copyin(uap->rqtp, &rqt32, sizeof(rqt32)); + error = copyin(ua_rqtp, &rqt32, sizeof(rqt32)); if (error) return (error); CP(rqt32, rqt, tv_sec); CP(rqt32, rqt, tv_nsec); - if (uap->rmtp && - !useracc((caddr_t)uap->rmtp, sizeof(rmt), VM_PROT_WRITE)) + if (ua_rmtp != NULL && (flags & TIMER_ABSTIME) == 0 && + !useracc(ua_rmtp, sizeof(rmt32), VM_PROT_WRITE)) return (EFAULT); - error = kern_nanosleep(td, &rqt, &rmt); - if (error == EINTR && uap->rmtp) { + error = kern_clock_nanosleep(td, clock_id, flags, &rqt, &rmt); + if (error == EINTR && ua_rmtp != NULL && (flags & TIMER_ABSTIME) == 0) { int error2; CP(rmt, rmt32, tv_sec); CP(rmt, rmt32, tv_nsec); - error2 = copyout(&rmt32, uap->rmtp, sizeof(rmt32)); + error2 = copyout(&rmt32, ua_rmtp, sizeof(rmt32)); if (error2) error = error2; } Modified: stable/11/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_proto.h Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/compat/freebsd32/freebsd32_proto.h Mon May 1 01:36:54 2017 (r317618) @@ -236,6 +236,12 @@ struct freebsd32_nanosleep_args { char rqtp_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * rqtp; char rqtp_r_[PADR_(const struct timespec32 *)]; char rmtp_l_[PADL_(struct timespec32 *)]; struct timespec32 * rmtp; char rmtp_r_[PADR_(struct timespec32 *)]; }; +struct freebsd32_clock_nanosleep_args { + char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char rqtp_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * rqtp; char rqtp_r_[PADR_(const struct timespec32 *)]; + char rmtp_l_[PADL_(struct timespec32 *)]; struct timespec32 * rmtp; char rmtp_r_[PADR_(struct timespec32 *)]; +}; struct freebsd32_clock_getcpuclockid2_args { char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; @@ -728,6 +734,7 @@ int freebsd32_ktimer_create(struct threa int freebsd32_ktimer_settime(struct thread *, struct freebsd32_ktimer_settime_args *); int freebsd32_ktimer_gettime(struct thread *, struct freebsd32_ktimer_gettime_args *); int freebsd32_nanosleep(struct thread *, struct freebsd32_nanosleep_args *); +int freebsd32_clock_nanosleep(struct thread *, struct freebsd32_clock_nanosleep_args *); int freebsd32_clock_getcpuclockid2(struct thread *, struct freebsd32_clock_getcpuclockid2_args *); int freebsd32_aio_read(struct thread *, struct freebsd32_aio_read_args *); int freebsd32_aio_write(struct thread *, struct freebsd32_aio_write_args *); @@ -1186,6 +1193,7 @@ int freebsd10_freebsd32_pipe(struct thre #define FREEBSD32_SYS_AUE_freebsd32_ktimer_settime AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_ktimer_gettime AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_nanosleep AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_clock_nanosleep AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_clock_getcpuclockid2 AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_aio_read AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_aio_write AUE_NULL Modified: stable/11/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_syscall.h Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/compat/freebsd32/freebsd32_syscall.h Mon May 1 01:36:54 2017 (r317618) @@ -215,6 +215,7 @@ #define FREEBSD32_SYS_ffclock_getcounter 241 #define FREEBSD32_SYS_ffclock_setestimate 242 #define FREEBSD32_SYS_ffclock_getestimate 243 +#define FREEBSD32_SYS_freebsd32_clock_nanosleep 244 #define FREEBSD32_SYS_freebsd32_clock_getcpuclockid2 247 #define FREEBSD32_SYS_minherit 250 #define FREEBSD32_SYS_rfork 251 Modified: stable/11/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_syscalls.c Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/compat/freebsd32/freebsd32_syscalls.c Mon May 1 01:36:54 2017 (r317618) @@ -254,7 +254,7 @@ const char *freebsd32_syscallnames[] = { "ffclock_getcounter", /* 241 = ffclock_getcounter */ "ffclock_setestimate", /* 242 = ffclock_setestimate */ "ffclock_getestimate", /* 243 = ffclock_getestimate */ - "#244", /* 244 = nosys */ + "freebsd32_clock_nanosleep", /* 244 = freebsd32_clock_nanosleep */ "#245", /* 245 = nosys */ "#246", /* 246 = nosys */ "freebsd32_clock_getcpuclockid2", /* 247 = freebsd32_clock_getcpuclockid2 */ Modified: stable/11/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_sysent.c Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/compat/freebsd32/freebsd32_sysent.c Mon May 1 01:36:54 2017 (r317618) @@ -297,7 +297,7 @@ struct sysent freebsd32_sysent[] = { { AS(ffclock_getcounter_args), (sy_call_t *)sys_ffclock_getcounter, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 241 = ffclock_getcounter */ { AS(ffclock_setestimate_args), (sy_call_t *)sys_ffclock_setestimate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 242 = ffclock_setestimate */ { AS(ffclock_getestimate_args), (sy_call_t *)sys_ffclock_getestimate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 243 = ffclock_getestimate */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 244 = nosys */ + { AS(freebsd32_clock_nanosleep_args), (sy_call_t *)freebsd32_clock_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 244 = freebsd32_clock_nanosleep */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 245 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 246 = nosys */ { AS(freebsd32_clock_getcpuclockid2_args), (sy_call_t *)freebsd32_clock_getcpuclockid2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 247 = freebsd32_clock_getcpuclockid2 */ Modified: stable/11/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- stable/11/sys/compat/freebsd32/freebsd32_systrace_args.c Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/compat/freebsd32/freebsd32_systrace_args.c Mon May 1 01:36:54 2017 (r317618) @@ -1260,6 +1260,16 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } + /* freebsd32_clock_nanosleep */ + case 244: { + struct freebsd32_clock_nanosleep_args *p = params; + iarg[0] = p->clock_id; /* clockid_t */ + iarg[1] = p->flags; /* int */ + uarg[2] = (intptr_t) p->rqtp; /* const struct timespec32 * */ + uarg[3] = (intptr_t) p->rmtp; /* struct timespec32 * */ + *n_args = 4; + break; + } /* freebsd32_clock_getcpuclockid2 */ case 247: { struct freebsd32_clock_getcpuclockid2_args *p = params; @@ -5312,6 +5322,25 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* freebsd32_clock_nanosleep */ + case 244: + switch(ndx) { + case 0: + p = "clockid_t"; + break; + case 1: + p = "int"; + break; + case 2: + p = "const struct timespec32 *"; + break; + case 3: + p = "struct timespec32 *"; + break; + default: + break; + }; + break; /* freebsd32_clock_getcpuclockid2 */ case 247: switch(ndx) { @@ -9651,6 +9680,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* freebsd32_clock_nanosleep */ + case 244: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* freebsd32_clock_getcpuclockid2 */ case 247: if (ndx == 0 || ndx == 1) Modified: stable/11/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/11/sys/compat/freebsd32/syscalls.master Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/compat/freebsd32/syscalls.master Mon May 1 01:36:54 2017 (r317618) @@ -462,7 +462,10 @@ struct ffclock_estimate *cest); } 243 AUE_NULL NOPROTO { int ffclock_getestimate( \ struct ffclock_estimate *cest); } -244 AUE_NULL UNIMPL nosys +244 AUE_NULL STD { int freebsd32_clock_nanosleep( \ + clockid_t clock_id, int flags, \ + const struct timespec32 *rqtp, \ + struct timespec32 *rmtp); } 245 AUE_NULL UNIMPL nosys 246 AUE_NULL UNIMPL nosys 247 AUE_NULL STD { int freebsd32_clock_getcpuclockid2(\ Modified: stable/11/sys/kern/init_sysent.c ============================================================================== --- stable/11/sys/kern/init_sysent.c Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/kern/init_sysent.c Mon May 1 01:36:54 2017 (r317618) @@ -290,7 +290,7 @@ struct sysent sysent[] = { { AS(ffclock_getcounter_args), (sy_call_t *)sys_ffclock_getcounter, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 241 = ffclock_getcounter */ { AS(ffclock_setestimate_args), (sy_call_t *)sys_ffclock_setestimate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 242 = ffclock_setestimate */ { AS(ffclock_getestimate_args), (sy_call_t *)sys_ffclock_getestimate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 243 = ffclock_getestimate */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 244 = nosys */ + { AS(clock_nanosleep_args), (sy_call_t *)sys_clock_nanosleep, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 244 = clock_nanosleep */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 245 = nosys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 246 = nosys */ { AS(clock_getcpuclockid2_args), (sy_call_t *)sys_clock_getcpuclockid2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 247 = clock_getcpuclockid2 */ Modified: stable/11/sys/kern/kern_time.c ============================================================================== --- stable/11/sys/kern/kern_time.c Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/kern/kern_time.c Mon May 1 01:36:54 2017 (r317618) @@ -86,6 +86,9 @@ static uma_zone_t itimer_zone = NULL; static int settime(struct thread *, struct timeval *); static void timevalfix(struct timeval *); +static int user_clock_nanosleep(struct thread *td, clockid_t clock_id, + int flags, const struct timespec *ua_rqtp, + struct timespec *ua_rmtp); static void itimer_start(void); static int itimer_init(void *, int, int); @@ -474,47 +477,95 @@ kern_clock_getres(struct thread *td, clo return (0); } +int +kern_nanosleep(struct thread *td, struct timespec *rqt, struct timespec *rmt) +{ + + return (kern_clock_nanosleep(td, CLOCK_REALTIME, TIMER_RELTIME, rqt, + rmt)); +} + static uint8_t nanowait[MAXCPU]; int -kern_nanosleep(struct thread *td, struct timespec *rqt, struct timespec *rmt) +kern_clock_nanosleep(struct thread *td, clockid_t clock_id, int flags, + const struct timespec *rqt, struct timespec *rmt) { - struct timespec ts; + struct timespec ts, now; sbintime_t sbt, sbtt, prec, tmp; time_t over; int error; + bool is_abs_real; if (rqt->tv_nsec < 0 || rqt->tv_nsec >= 1000000000) return (EINVAL); - if (rqt->tv_sec < 0 || (rqt->tv_sec == 0 && rqt->tv_nsec == 0)) - return (0); - ts = *rqt; - if (ts.tv_sec > INT32_MAX / 2) { - over = ts.tv_sec - INT32_MAX / 2; - ts.tv_sec -= over; - } else - over = 0; - tmp = tstosbt(ts); - prec = tmp; - prec >>= tc_precexp; - if (TIMESEL(&sbt, tmp)) - sbt += tc_tick_sbt; - sbt += tmp; - error = tsleep_sbt(&nanowait[curcpu], PWAIT | PCATCH, "nanslp", - sbt, prec, C_ABSOLUTE); + if ((flags & ~TIMER_ABSTIME) != 0) + return (EINVAL); + switch (clock_id) { + case CLOCK_REALTIME: + case CLOCK_REALTIME_PRECISE: + case CLOCK_REALTIME_FAST: + case CLOCK_SECOND: + is_abs_real = (flags & TIMER_ABSTIME) != 0; + break; + case CLOCK_MONOTONIC: + case CLOCK_MONOTONIC_PRECISE: + case CLOCK_MONOTONIC_FAST: + case CLOCK_UPTIME: + case CLOCK_UPTIME_PRECISE: + case CLOCK_UPTIME_FAST: + is_abs_real = false; + break; + case CLOCK_VIRTUAL: + case CLOCK_PROF: + case CLOCK_PROCESS_CPUTIME_ID: + return (ENOTSUP); + case CLOCK_THREAD_CPUTIME_ID: + default: + return (EINVAL); + } + do { + ts = *rqt; + if ((flags & TIMER_ABSTIME) != 0) { + if (is_abs_real) + td->td_rtcgen = + atomic_load_acq_int(&rtc_generation); + error = kern_clock_gettime(td, clock_id, &now); + KASSERT(error == 0, ("kern_clock_gettime: %d", error)); + timespecsub(&ts, &now); + } + if (ts.tv_sec < 0 || (ts.tv_sec == 0 && ts.tv_nsec == 0)) { + error = EWOULDBLOCK; + break; + } + if (ts.tv_sec > INT32_MAX / 2) { + over = ts.tv_sec - INT32_MAX / 2; + ts.tv_sec -= over; + } else + over = 0; + tmp = tstosbt(ts); + prec = tmp; + prec >>= tc_precexp; + if (TIMESEL(&sbt, tmp)) + sbt += tc_tick_sbt; + sbt += tmp; + error = tsleep_sbt(&nanowait[curcpu], PWAIT | PCATCH, "nanslp", + sbt, prec, C_ABSOLUTE); + } while (error == 0 && is_abs_real && td->td_rtcgen == 0); + td->td_rtcgen = 0; if (error != EWOULDBLOCK) { + TIMESEL(&sbtt, tmp); + if (sbtt >= sbt) + return (0); if (error == ERESTART) error = EINTR; - TIMESEL(&sbtt, tmp); - if (rmt != NULL) { + if ((flags & TIMER_ABSTIME) == 0 && rmt != NULL) { ts = sbttots(sbt - sbtt); ts.tv_sec += over; if (ts.tv_sec < 0) timespecclear(&ts); *rmt = ts; } - if (sbtt >= sbt) - return (0); return (error); } return (0); @@ -530,21 +581,48 @@ struct nanosleep_args { int sys_nanosleep(struct thread *td, struct nanosleep_args *uap) { + + return (user_clock_nanosleep(td, CLOCK_REALTIME, TIMER_RELTIME, + uap->rqtp, uap->rmtp)); +} + +#ifndef _SYS_SYSPROTO_H_ +struct clock_nanosleep_args { + clockid_t clock_id; + int flags; + struct timespec *rqtp; + struct timespec *rmtp; +}; +#endif +/* ARGSUSED */ +int +sys_clock_nanosleep(struct thread *td, struct clock_nanosleep_args *uap) +{ + int error; + + error = user_clock_nanosleep(td, uap->clock_id, uap->flags, uap->rqtp, + uap->rmtp); + return (kern_posix_error(td, error)); +} + +static int +user_clock_nanosleep(struct thread *td, clockid_t clock_id, int flags, + const struct timespec *ua_rqtp, struct timespec *ua_rmtp) +{ struct timespec rmt, rqt; int error; - error = copyin(uap->rqtp, &rqt, sizeof(rqt)); + error = copyin(ua_rqtp, &rqt, sizeof(rqt)); if (error) return (error); - - if (uap->rmtp && - !useracc((caddr_t)uap->rmtp, sizeof(rmt), VM_PROT_WRITE)) - return (EFAULT); - error = kern_nanosleep(td, &rqt, &rmt); - if (error == EINTR && uap->rmtp) { + if (ua_rmtp != NULL && (flags & TIMER_ABSTIME) == 0 && + !useracc(ua_rmtp, sizeof(rmt), VM_PROT_WRITE)) + return (EFAULT); + error = kern_clock_nanosleep(td, clock_id, flags, &rqt, &rmt); + if (error == EINTR && ua_rmtp != NULL && (flags & TIMER_ABSTIME) == 0) { int error2; - error2 = copyout(&rmt, uap->rmtp, sizeof(rmt)); + error2 = copyout(&rmt, ua_rmtp, sizeof(rmt)); if (error2) error = error2; } Modified: stable/11/sys/kern/syscalls.c ============================================================================== --- stable/11/sys/kern/syscalls.c Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/kern/syscalls.c Mon May 1 01:36:54 2017 (r317618) @@ -251,7 +251,7 @@ const char *syscallnames[] = { "ffclock_getcounter", /* 241 = ffclock_getcounter */ "ffclock_setestimate", /* 242 = ffclock_setestimate */ "ffclock_getestimate", /* 243 = ffclock_getestimate */ - "#244", /* 244 = nosys */ + "clock_nanosleep", /* 244 = clock_nanosleep */ "#245", /* 245 = nosys */ "#246", /* 246 = nosys */ "clock_getcpuclockid2", /* 247 = clock_getcpuclockid2 */ Modified: stable/11/sys/kern/syscalls.master ============================================================================== --- stable/11/sys/kern/syscalls.master Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/kern/syscalls.master Mon May 1 01:36:54 2017 (r317618) @@ -461,7 +461,9 @@ struct ffclock_estimate *cest); } 243 AUE_NULL STD { int ffclock_getestimate( \ struct ffclock_estimate *cest); } -244 AUE_NULL UNIMPL nosys +244 AUE_NULL STD { int clock_nanosleep(clockid_t clock_id, \ + int flags, const struct timespec *rqtp, \ + struct timespec *rmtp); } 245 AUE_NULL UNIMPL nosys 246 AUE_NULL UNIMPL nosys 247 AUE_NULL STD { int clock_getcpuclockid2(id_t id,\ Modified: stable/11/sys/kern/systrace_args.c ============================================================================== --- stable/11/sys/kern/systrace_args.c Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/kern/systrace_args.c Mon May 1 01:36:54 2017 (r317618) @@ -1290,6 +1290,16 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } + /* clock_nanosleep */ + case 244: { + struct clock_nanosleep_args *p = params; + iarg[0] = p->clock_id; /* clockid_t */ + iarg[1] = p->flags; /* int */ + uarg[2] = (intptr_t) p->rqtp; /* const struct timespec * */ + uarg[3] = (intptr_t) p->rmtp; /* struct timespec * */ + *n_args = 4; + break; + } /* clock_getcpuclockid2 */ case 247: { struct clock_getcpuclockid2_args *p = params; @@ -5374,6 +5384,25 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; + /* clock_nanosleep */ + case 244: + switch(ndx) { + case 0: + p = "clockid_t"; + break; + case 1: + p = "int"; + break; + case 2: + p = "const struct timespec *"; + break; + case 3: + p = "struct timespec *"; + break; + default: + break; + }; + break; /* clock_getcpuclockid2 */ case 247: switch(ndx) { @@ -9628,6 +9657,11 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; + /* clock_nanosleep */ + case 244: + if (ndx == 0 || ndx == 1) + p = "int"; + break; /* clock_getcpuclockid2 */ case 247: if (ndx == 0 || ndx == 1) Modified: stable/11/sys/sys/syscall.h ============================================================================== --- stable/11/sys/sys/syscall.h Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/sys/syscall.h Mon May 1 01:36:54 2017 (r317618) @@ -219,6 +219,7 @@ #define SYS_ffclock_getcounter 241 #define SYS_ffclock_setestimate 242 #define SYS_ffclock_getestimate 243 +#define SYS_clock_nanosleep 244 #define SYS_clock_getcpuclockid2 247 #define SYS_ntp_gettime 248 #define SYS_minherit 250 Modified: stable/11/sys/sys/syscall.mk ============================================================================== --- stable/11/sys/sys/syscall.mk Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/sys/syscall.mk Mon May 1 01:36:54 2017 (r317618) @@ -159,6 +159,7 @@ MIASM = \ ffclock_getcounter.o \ ffclock_setestimate.o \ ffclock_getestimate.o \ + clock_nanosleep.o \ clock_getcpuclockid2.o \ ntp_gettime.o \ minherit.o \ Modified: stable/11/sys/sys/syscallsubr.h ============================================================================== --- stable/11/sys/sys/syscallsubr.h Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/sys/syscallsubr.h Mon May 1 01:36:54 2017 (r317618) @@ -83,6 +83,8 @@ int kern_clock_getres(struct thread *td, struct timespec *ts); int kern_clock_gettime(struct thread *td, clockid_t clock_id, struct timespec *ats); +int kern_clock_nanosleep(struct thread *td, clockid_t clock_id, int flags, + const struct timespec *rqtp, struct timespec *rmtp); int kern_clock_settime(struct thread *td, clockid_t clock_id, struct timespec *ats); int kern_close(struct thread *td, int fd); Modified: stable/11/sys/sys/sysproto.h ============================================================================== --- stable/11/sys/sys/sysproto.h Mon May 1 01:35:43 2017 (r317617) +++ stable/11/sys/sys/sysproto.h Mon May 1 01:36:54 2017 (r317618) @@ -698,6 +698,12 @@ struct ffclock_setestimate_args { struct ffclock_getestimate_args { char cest_l_[PADL_(struct ffclock_estimate *)]; struct ffclock_estimate * cest; char cest_r_[PADR_(struct ffclock_estimate *)]; }; +struct clock_nanosleep_args { + char clock_id_l_[PADL_(clockid_t)]; clockid_t clock_id; char clock_id_r_[PADR_(clockid_t)]; + char flags_l_[PADL_(int)]; int flags; char flags_r_[PADR_(int)]; + char rqtp_l_[PADL_(const struct timespec *)]; const struct timespec * rqtp; char rqtp_r_[PADR_(const struct timespec *)]; + char rmtp_l_[PADL_(struct timespec *)]; struct timespec * rmtp; char rmtp_r_[PADR_(struct timespec *)]; +}; struct clock_getcpuclockid2_args { char id_l_[PADL_(id_t)]; id_t id; char id_r_[PADR_(id_t)]; char which_l_[PADL_(int)]; int which; char which_r_[PADR_(int)]; @@ -1942,6 +1948,7 @@ int sys_nanosleep(struct thread *, struc int sys_ffclock_getcounter(struct thread *, struct ffclock_getcounter_args *); int sys_ffclock_setestimate(struct thread *, struct ffclock_setestimate_args *); int sys_ffclock_getestimate(struct thread *, struct ffclock_getestimate_args *); +int sys_clock_nanosleep(struct thread *, struct clock_nanosleep_args *); int sys_clock_getcpuclockid2(struct thread *, struct clock_getcpuclockid2_args *); int sys_ntp_gettime(struct thread *, struct ntp_gettime_args *); int sys_minherit(struct thread *, struct minherit_args *); @@ -2713,6 +2720,7 @@ int freebsd10_pipe(struct thread *, stru #define SYS_AUE_ffclock_getcounter AUE_NULL #define SYS_AUE_ffclock_setestimate AUE_NULL #define SYS_AUE_ffclock_getestimate AUE_NULL +#define SYS_AUE_clock_nanosleep AUE_NULL #define SYS_AUE_clock_getcpuclockid2 AUE_NULL #define SYS_AUE_ntp_gettime AUE_NULL #define SYS_AUE_minherit AUE_MINHERIT *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 1 01:40:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95646D58CA6; Mon, 1 May 2017 01:40:25 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66BD118F2; Mon, 1 May 2017 01:40:25 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v411eOr0079099; Mon, 1 May 2017 01:40:24 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v411eOsM079098; Mon, 1 May 2017 01:40:24 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201705010140.v411eOsM079098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Mon, 1 May 2017 01:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317619 - stable/11/bin/dd X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 01:40:25 -0000 Author: vangyzen Date: Mon May 1 01:40:24 2017 New Revision: 317619 URL: https://svnweb.freebsd.org/changeset/base/317619 Log: MFC r316430 Fix indentation in dd(1) Quoting http://mdocml.bsd.lv/mdoc/details/width.html Do not use macros in the argument specifying the width, since that's not portable. While GNU troff can handle it, mandoc cannot. Sponsored by: Dell EMC Modified: stable/11/bin/dd/dd.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/dd/dd.1 ============================================================================== --- stable/11/bin/dd/dd.1 Mon May 1 01:36:54 2017 (r317618) +++ stable/11/bin/dd/dd.1 Mon May 1 01:40:24 2017 (r317619) @@ -32,7 +32,7 @@ .\" @(#)dd.1 8.2 (Berkeley) 1/13/94 .\" $FreeBSD$ .\" -.Dd October 5, 2016 +.Dd April 2, 2017 .Dt DD 1 .Os .Sh NAME @@ -54,7 +54,7 @@ displays the number of complete and part and truncated input records to the standard error output. .Pp The following operands are available: -.Bl -tag -width ".Cm of Ns = Ns Ar file" +.Bl -tag -width "of=file" .It Cm bs Ns = Ns Ar n Set both input and output block size to .Ar n @@ -164,7 +164,7 @@ bytes per second. Where .Cm value is one of the symbols from the following list. -.Bl -tag -width ".Cm noxfer" +.Bl -tag -width "noxfer" .It Cm noxfer Do not print the transfer statistics as the last line of status output. .It Cm none @@ -175,7 +175,7 @@ Error messages are shown; informational Where .Cm value is one of the symbols from the following list. -.Bl -tag -width ".Cm unblock" +.Bl -tag -width "unblock" .It Cm ascii , oldascii The same as the .Cm unblock @@ -459,4 +459,4 @@ subsystem might prevent the super-user f Instructions for temporarily disabling these protection mechanisms can be found in the .Xr geom 4 -manpage. +man page. From owner-svn-src-all@freebsd.org Mon May 1 01:42:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D67BFD58E14; Mon, 1 May 2017 01:42:27 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A86131CC0; Mon, 1 May 2017 01:42:27 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v411gQoe082716; Mon, 1 May 2017 01:42:26 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v411gQlH082715; Mon, 1 May 2017 01:42:26 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201705010142.v411gQlH082715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 1 May 2017 01:42:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317620 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 01:42:27 -0000 Author: asomers Date: Mon May 1 01:42:26 2017 New Revision: 317620 URL: https://svnweb.freebsd.org/changeset/base/317620 Log: Fix a comment that's been wrong ever since this file was imported in 1997 Modified: head/sbin/ifconfig/ifmedia.c Modified: head/sbin/ifconfig/ifmedia.c ============================================================================== --- head/sbin/ifconfig/ifmedia.c Mon May 1 01:40:24 2017 (r317619) +++ head/sbin/ifconfig/ifmedia.c Mon May 1 01:42:26 2017 (r317620) @@ -371,7 +371,7 @@ setmediamode(const char *val, int d, int } /********************************************************************** - * A good chunk of this is duplicated from sys/net/ifmedia.c + * A good chunk of this is duplicated from sys/net/if_media.c **********************************************************************/ static struct ifmedia_description ifm_type_descriptions[] = From owner-svn-src-all@freebsd.org Mon May 1 01:52:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4274CD581A1; Mon, 1 May 2017 01:52:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D4814647; Mon, 1 May 2017 01:52:06 +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 v411q5MH085064; Mon, 1 May 2017 01:52:05 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v411q4l3085040; Mon, 1 May 2017 01:52:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705010152.v411q4l3085040@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 1 May 2017 01:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317623 - in stable/11: contrib/elftoolchain/addr2line contrib/elftoolchain/ar contrib/elftoolchain/common contrib/elftoolchain/cxxfilt contrib/elftoolchain/elfcopy contrib/elftoolchain... X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 01:52:07 -0000 Author: emaste Date: Mon May 1 01:52:03 2017 New Revision: 317623 URL: https://svnweb.freebsd.org/changeset/base/317623 Log: MFC r317075: Update ELF Tool Chain to upstream r3520 Highlights of changes between r3490 and r3520: - Improve C++ demangling - Improve compatibility with Binutils tools wrt. error messages - Handle additional types/sections/etc. in readelf and elfdump - addr2line, cxxfilt: use setvbuf to set line buffering for filter use Also MFC r317076, version bump. Sponsored by: The FreeBSD Foundation Added: stable/11/contrib/elftoolchain/ar/os.FreeBSD.mk - copied unchanged from r317075, head/contrib/elftoolchain/ar/os.FreeBSD.mk stable/11/contrib/elftoolchain/elfcopy/os.FreeBSD.mk - copied unchanged from r317075, head/contrib/elftoolchain/elfcopy/os.FreeBSD.mk Modified: stable/11/contrib/elftoolchain/addr2line/addr2line.c stable/11/contrib/elftoolchain/common/elfdefinitions.h stable/11/contrib/elftoolchain/cxxfilt/cxxfilt.c stable/11/contrib/elftoolchain/elfcopy/main.c stable/11/contrib/elftoolchain/elfcopy/pe.c stable/11/contrib/elftoolchain/elfcopy/symbols.c stable/11/contrib/elftoolchain/elfdump/elfdump.c stable/11/contrib/elftoolchain/libdwarf/dwarf.h stable/11/contrib/elftoolchain/libdwarf/dwarf_attrval.c stable/11/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 stable/11/contrib/elftoolchain/libdwarf/dwarf_dump.c stable/11/contrib/elftoolchain/libelf/gelf_newehdr.3 stable/11/contrib/elftoolchain/libelf/gelf_newphdr.3 stable/11/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 stable/11/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c stable/11/contrib/elftoolchain/libelftc/libelftc_dem_arm.c stable/11/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c stable/11/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c stable/11/contrib/elftoolchain/nm/nm.c stable/11/contrib/elftoolchain/readelf/readelf.c stable/11/contrib/elftoolchain/strings/strings.c stable/11/lib/libelftc/elftc_version.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/elftoolchain/addr2line/addr2line.c ============================================================================== --- stable/11/contrib/elftoolchain/addr2line/addr2line.c Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/addr2line/addr2line.c Mon May 1 01:52:03 2017 (r317623) @@ -40,7 +40,7 @@ #include "uthash.h" #include "_elftc.h" -ELFTC_VCSID("$Id: addr2line.c 3446 2016-05-03 01:31:17Z emaste $"); +ELFTC_VCSID("$Id: addr2line.c 3499 2016-11-25 16:06:29Z emaste $"); struct Func { char *name; @@ -720,11 +720,11 @@ main(int argc, char **argv) if (argc > 0) for (i = 0; i < argc; i++) translate(dbg, e, argv[i]); - else - while (fgets(line, sizeof(line), stdin) != NULL) { + else { + setvbuf(stdout, NULL, _IOLBF, 0); + while (fgets(line, sizeof(line), stdin) != NULL) translate(dbg, e, line); - fflush(stdout); - } + } dwarf_finish(dbg, &de); Copied: stable/11/contrib/elftoolchain/ar/os.FreeBSD.mk (from r317075, head/contrib/elftoolchain/ar/os.FreeBSD.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/elftoolchain/ar/os.FreeBSD.mk Mon May 1 01:52:03 2017 (r317623, copy of r317075, head/contrib/elftoolchain/ar/os.FreeBSD.mk) @@ -0,0 +1,2 @@ +DPADD+= ${LIBBZ2} +LDADD+= -lbz2 Modified: stable/11/contrib/elftoolchain/common/elfdefinitions.h ============================================================================== --- stable/11/contrib/elftoolchain/common/elfdefinitions.h Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/common/elfdefinitions.h Mon May 1 01:52:03 2017 (r317623) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfdefinitions.h 3485 2016-08-18 13:38:52Z emaste $ + * $Id: elfdefinitions.h 3515 2017-01-24 22:04:22Z emaste $ */ /* @@ -153,6 +153,8 @@ _ELF_DEFINE_DT(DT_SUNW_FILTER, 0x60 "offset of string naming standard filtees") \ _ELF_DEFINE_DT(DT_SUNW_CAP, 0x60000010UL, \ "address of hardware capabilities section") \ +_ELF_DEFINE_DT(DT_SUNW_ASLR, 0x60000023UL, \ + "Address Space Layout Randomization flag") \ _ELF_DEFINE_DT(DT_HIOS, 0x6FFFF000UL, \ "end of OS-specific types") \ _ELF_DEFINE_DT(DT_VALRNGLO, 0x6FFFFD00UL, \ @@ -919,6 +921,12 @@ _ELF_DEFINE_PT(PT_GNU_STACK, 0x6474E "Stack flags") \ _ELF_DEFINE_PT(PT_GNU_RELRO, 0x6474E552UL, \ "Segment becomes read-only after relocation") \ +_ELF_DEFINE_PT(PT_OPENBSD_RANDOMIZE,0x65A3DBE6UL, \ + "Segment filled with random data") \ +_ELF_DEFINE_PT(PT_OPENBSD_WXNEEDED, 0x65A3DBE7UL, \ + "Program violates W^X") \ +_ELF_DEFINE_PT(PT_OPENBSD_BOOTDATA, 0x65A41BE6UL, \ + "Boot data") \ _ELF_DEFINE_PT(PT_SUNWBSS, 0x6FFFFFFAUL, \ "A Solaris .SUNW_bss section") \ _ELF_DEFINE_PT(PT_SUNWSTACK, 0x6FFFFFFBUL, \ Modified: stable/11/contrib/elftoolchain/cxxfilt/cxxfilt.c ============================================================================== --- stable/11/contrib/elftoolchain/cxxfilt/cxxfilt.c Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/cxxfilt/cxxfilt.c Mon May 1 01:52:03 2017 (r317623) @@ -35,7 +35,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: cxxfilt.c 3454 2016-05-07 17:11:05Z kaiwang27 $"); +ELFTC_VCSID("$Id: cxxfilt.c 3499 2016-11-25 16:06:29Z emaste $"); #define STRBUFSZ 8192 @@ -175,6 +175,7 @@ main(int argc, char **argv) } else { p = 0; for (;;) { + setvbuf(stdout, NULL, _IOLBF, 0); c = fgetc(stdin); if (c == EOF || !(isalnum(c) || strchr(".$_", c))) { if (p > 0) { Modified: stable/11/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- stable/11/contrib/elftoolchain/elfcopy/main.c Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/elfcopy/main.c Mon May 1 01:52:03 2017 (r317623) @@ -39,7 +39,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: main.c 3446 2016-05-03 01:31:17Z emaste $"); +ELFTC_VCSID("$Id: main.c 3520 2017-04-17 01:47:52Z kaiwang27 $"); enum options { @@ -285,6 +285,7 @@ create_elf(struct elfcopy *ecp) size_t ishnum; ecp->flags |= SYMTAB_INTACT; + ecp->flags &= ~SYMTAB_EXIST; /* Create EHDR. */ if (gelf_getehdr(ecp->ein, &ieh) == NULL) @@ -499,6 +500,10 @@ free_elf(struct elfcopy *ecp) } } + ecp->symtab = NULL; + ecp->strtab = NULL; + ecp->shstrtab = NULL; + if (ecp->secndx != NULL) { free(ecp->secndx); ecp->secndx = NULL; Copied: stable/11/contrib/elftoolchain/elfcopy/os.FreeBSD.mk (from r317075, head/contrib/elftoolchain/elfcopy/os.FreeBSD.mk) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/elftoolchain/elfcopy/os.FreeBSD.mk Mon May 1 01:52:03 2017 (r317623, copy of r317075, head/contrib/elftoolchain/elfcopy/os.FreeBSD.mk) @@ -0,0 +1,4 @@ +.if !defined(LIBELF_AR) +DPADD+= ${LIBBZ2} +LDADD+= -lbz2 +.endif Modified: stable/11/contrib/elftoolchain/elfcopy/pe.c ============================================================================== --- stable/11/contrib/elftoolchain/elfcopy/pe.c Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/elfcopy/pe.c Mon May 1 01:52:03 2017 (r317623) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: pe.c 3490 2016-08-31 00:12:22Z emaste $"); +ELFTC_VCSID("$Id: pe.c 3508 2016-12-27 06:19:39Z kaiwang27 $"); /* Convert ELF object to Portable Executable (PE). */ void Modified: stable/11/contrib/elftoolchain/elfcopy/symbols.c ============================================================================== --- stable/11/contrib/elftoolchain/elfcopy/symbols.c Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/elfcopy/symbols.c Mon May 1 01:52:03 2017 (r317623) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: symbols.c 3446 2016-05-03 01:31:17Z emaste $"); +ELFTC_VCSID("$Id: symbols.c 3520 2017-04-17 01:47:52Z kaiwang27 $"); /* Backwards compatibility for systems with older ELF definitions. */ #ifndef STB_GNU_UNIQUE @@ -676,6 +676,8 @@ create_symtab(struct elfcopy *ecp) sy = ecp->symtab; st = ecp->strtab; + assert(sy != NULL && st != NULL); + /* * Set section index map for .symtab and .strtab. We need to set * these map because otherwise symbols which refer to .symtab and Modified: stable/11/contrib/elftoolchain/elfdump/elfdump.c ============================================================================== --- stable/11/contrib/elftoolchain/elfdump/elfdump.c Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/elfdump/elfdump.c Mon May 1 01:52:03 2017 (r317623) @@ -50,7 +50,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: elfdump.c 3482 2016-08-02 18:47:00Z emaste $"); +ELFTC_VCSID("$Id: elfdump.c 3497 2016-10-17 20:57:22Z emaste $"); #if defined(ELFTC_NEED_ELF_NOTE_DEFINITION) #include "native-elf-format.h" @@ -223,9 +223,9 @@ d_tags(uint64_t tag) case 0x6ffffff0: return "DT_GNU_VERSYM"; /* 0x70000000 - 0x7fffffff processor-specific semantics */ case 0x70000000: return "DT_IA_64_PLT_RESERVE"; - case 0x7ffffffd: return "DT_SUNW_AUXILIARY"; - case 0x7ffffffe: return "DT_SUNW_USED"; - case 0x7fffffff: return "DT_SUNW_FILTER"; + case DT_AUXILIARY: return "DT_AUXILIARY"; + case DT_USED: return "DT_USED"; + case DT_FILTER: return "DT_FILTER"; } snprintf(unknown_buf, sizeof(unknown_buf), Modified: stable/11/contrib/elftoolchain/libdwarf/dwarf.h ============================================================================== --- stable/11/contrib/elftoolchain/libdwarf/dwarf.h Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/libdwarf/dwarf.h Mon May 1 01:52:03 2017 (r317623) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: dwarf.h 3052 2014-05-26 20:36:24Z kaiwang27 $ + * $Id: dwarf.h 3494 2016-09-20 17:16:13Z emaste $ */ #ifndef _DWARF_H_ @@ -208,6 +208,25 @@ #define DW_AT_lo_user 0x2000 #define DW_AT_hi_user 0x3fff +/* SGI/MIPS extensions. */ +#define DW_AT_MIPS_fde 0x2001 +#define DW_AT_MIPS_loop_begin 0x2002 +#define DW_AT_MIPS_tail_loop_begin 0x2003 +#define DW_AT_MIPS_epilog_begin 0x2004 +#define DW_AT_MIPS_loop_unroll_factor 0x2005 +#define DW_AT_MIPS_software_pipeline_depth 0x2006 +#define DW_AT_MIPS_linkage_name 0x2007 +#define DW_AT_MIPS_stride 0x2008 +#define DW_AT_MIPS_abstract_name 0x2009 +#define DW_AT_MIPS_clone_origin 0x200a +#define DW_AT_MIPS_has_inlines 0x200b +#define DW_AT_MIPS_stride_byte 0x200c +#define DW_AT_MIPS_stride_elem 0x200d +#define DW_AT_MIPS_ptr_dopetype 0x200e +#define DW_AT_MIPS_allocatable_dopetype 0x200f +#define DW_AT_MIPS_assumed_shape_dopetype 0x2010 +#define DW_AT_MIPS_assumed_size 0x2011 + /* GNU extensions. */ #define DW_AT_sf_names 0x2101 #define DW_AT_src_info 0x2102 @@ -505,6 +524,7 @@ #define DW_LANG_UPC 0x0012 #define DW_LANG_D 0x0013 #define DW_LANG_lo_user 0x8000 +#define DW_LANG_Mips_Assembler 0x8001 #define DW_LANG_hi_user 0xffff #define DW_ID_case_sensitive 0x00 Modified: stable/11/contrib/elftoolchain/libdwarf/dwarf_attrval.c ============================================================================== --- stable/11/contrib/elftoolchain/libdwarf/dwarf_attrval.c Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/libdwarf/dwarf_attrval.c Mon May 1 01:52:03 2017 (r317623) @@ -26,7 +26,7 @@ #include "_libdwarf.h" -ELFTC_VCSID("$Id: dwarf_attrval.c 3159 2015-02-15 21:43:27Z emaste $"); +ELFTC_VCSID("$Id: dwarf_attrval.c 3509 2016-12-29 03:58:41Z emaste $"); int dwarf_attrval_flag(Dwarf_Die die, Dwarf_Half attr, Dwarf_Bool *valp, Dwarf_Error *err) Modified: stable/11/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 ============================================================================== --- stable/11/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/libdwarf/dwarf_attrval_signed.3 Mon May 1 01:52:03 2017 (r317623) @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: dwarf_attrval_signed.3 2980 2014-01-21 20:15:54Z kaiwang27 $ +.\" $Id: dwarf_attrval_signed.3 3509 2016-12-29 03:58:41Z emaste $ .\" .Dd December 26, 2016 .Os Modified: stable/11/contrib/elftoolchain/libdwarf/dwarf_dump.c ============================================================================== --- stable/11/contrib/elftoolchain/libdwarf/dwarf_dump.c Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/libdwarf/dwarf_dump.c Mon May 1 01:52:03 2017 (r317623) @@ -27,7 +27,7 @@ #include "_libdwarf.h" -ELFTC_VCSID("$Id: dwarf_dump.c 3052 2014-05-26 20:36:24Z kaiwang27 $"); +ELFTC_VCSID("$Id: dwarf_dump.c 3494 2016-09-20 17:16:13Z emaste $"); int dwarf_get_ACCESS_name(unsigned access, const char **s) @@ -262,6 +262,40 @@ dwarf_get_AT_name(unsigned attr, const c *s = "DW_AT_body_begin"; break; case DW_AT_body_end: *s = "DW_AT_body_end"; break; + case DW_AT_MIPS_fde: + *s = "DW_AT_MIPS_fde"; break; + case DW_AT_MIPS_loop_begin: + *s = "DW_AT_MIPS_loop_begin"; break; + case DW_AT_MIPS_tail_loop_begin: + *s = "DW_AT_MIPS_tail_loop_begin"; break; + case DW_AT_MIPS_epilog_begin: + *s = "DW_AT_MIPS_epilog_begin"; break; + case DW_AT_MIPS_loop_unroll_factor: + *s = "DW_AT_MIPS_loop_unroll_factor"; break; + case DW_AT_MIPS_software_pipeline_depth: + *s = "DW_AT_MIPS_software_pipeline_depth"; break; + case DW_AT_MIPS_linkage_name: + *s = "DW_AT_MIPS_linkage_name"; break; + case DW_AT_MIPS_stride: + *s = "DW_AT_MIPS_stride"; break; + case DW_AT_MIPS_abstract_name: + *s = "DW_AT_MIPS_abstract_name"; break; + case DW_AT_MIPS_clone_origin: + *s = "DW_AT_MIPS_clone_origin"; break; + case DW_AT_MIPS_has_inlines: + *s = "DW_AT_MIPS_has_inlines"; break; + case DW_AT_MIPS_stride_byte: + *s = "DW_AT_MIPS_stride_byte"; break; + case DW_AT_MIPS_stride_elem: + *s = "DW_AT_MIPS_stride_elem"; break; + case DW_AT_MIPS_ptr_dopetype: + *s = "DW_AT_MIPS_ptr_dopetype"; break; + case DW_AT_MIPS_allocatable_dopetype: + *s = "DW_AT_MIPS_allocatable_dopetype"; break; + case DW_AT_MIPS_assumed_shape_dopetype: + *s = "DW_AT_MIPS_assumed_shape_dopetype"; break; + case DW_AT_MIPS_assumed_size: + *s = "DW_AT_MIPS_assumed_size"; break; case DW_AT_GNU_vector: *s = "DW_AT_GNU_vector"; break; case DW_AT_GNU_guarded_by: @@ -756,6 +790,8 @@ dwarf_get_LANG_name(unsigned lang, const *s = "DW_LANG_D"; break; case DW_LANG_lo_user: *s = "DW_LANG_lo_user"; break; + case DW_LANG_Mips_Assembler: + *s = "DW_LANG_Mips_Assembler"; break; case DW_LANG_hi_user: *s = "DW_LANG_hi_user"; break; default: Modified: stable/11/contrib/elftoolchain/libelf/gelf_newehdr.3 ============================================================================== --- stable/11/contrib/elftoolchain/libelf/gelf_newehdr.3 Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/libelf/gelf_newehdr.3 Mon May 1 01:52:03 2017 (r317623) @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_newehdr.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_newehdr.3 3500 2016-12-04 11:08:44Z jkoshy $ .\" .Dd October 22, 2007 .Os @@ -127,6 +127,15 @@ flag on ELF descriptor .Sh RETURN VALUES These functions return a pointer to a translated header descriptor if successful, or NULL on failure. +.Sh COMPATIBILITY +The +.Fn gelf_newehdr +function uses a type of +.Ft "void *" +for its returned value. +This differs from some other implementations of the ELF(3) API, which use an +.Ft "unsigned long" +return type. .Sh ERRORS These functions can fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" Modified: stable/11/contrib/elftoolchain/libelf/gelf_newphdr.3 ============================================================================== --- stable/11/contrib/elftoolchain/libelf/gelf_newphdr.3 Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/libelf/gelf_newphdr.3 Mon May 1 01:52:03 2017 (r317623) @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: gelf_newphdr.3 189 2008-07-20 10:38:08Z jkoshy $ +.\" $Id: gelf_newphdr.3 3500 2016-12-04 11:08:44Z jkoshy $ .\" .Dd October 22, 2007 .Os @@ -97,6 +97,15 @@ will no longer be valid. .Sh RETURN VALUES The functions a valid pointer if successful, or NULL in case an error was encountered. +.Sh COMPATIBILITY +The +.Fn gelf_newphdr +function uses a type of +.Ft "void *" +for its returned value. +This differs from some other implementations of the ELF(3) API, which use an +.Ft "unsigned long" +return type. .Sh ERRORS These functions may fail with the following errors: .Bl -tag -width "[ELF_E_RESOURCE]" Modified: stable/11/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 ============================================================================== --- stable/11/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/libelftc/elftc_bfd_find_target.3 Mon May 1 01:52:03 2017 (r317623) @@ -21,7 +21,7 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elftc_bfd_find_target.3 3488 2016-08-24 18:15:57Z emaste $ +.\" $Id: elftc_bfd_find_target.3 3516 2017-02-10 02:33:08Z emaste $ .\" .Dd November 30, 2011 .Os @@ -74,6 +74,7 @@ Known descriptor names and their propert .It Li elf32-littlearm Ta ELF Ta LSB Ta 32 .It Li elf32-littlemips Ta ELF Ta LSB Ta 32 .It Li elf32-powerpc Ta ELF Ta MSB Ta 32 +.It Li elf32-powerpc-freebsd Ta ELF Ta MSB Ta 32 .It Li elf32-powerpcle Ta ELF Ta LSB Ta 32 .It Li elf32-sh Ta ELF Ta MSB Ta 32 .It Li elf32-shl Ta ELF Ta LSB Ta 32 @@ -94,6 +95,7 @@ Known descriptor names and their propert .It Li elf64-littleaarch64 Ta ELF Ta LSB Ta 64 .It Li elf64-littlemips Ta ELF Ta LSB Ta 64 .It Li elf64-powerpc Ta ELF Ta MSB Ta 64 +.It Li elf64-powerpc-freebsd Ta ELF Ta MSB Ta 64 .It Li elf64-powerpcle Ta ELF Ta LSB Ta 64 .It Li elf64-sh64 Ta ELF Ta MSB Ta 64 .It Li elf64-sh64l Ta ELF Ta LSB Ta 64 Modified: stable/11/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c ============================================================================== --- stable/11/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/libelftc/libelftc_bfdtarget.c Mon May 1 01:52:03 2017 (r317623) @@ -30,7 +30,7 @@ #include "_libelftc.h" -ELFTC_VCSID("$Id: libelftc_bfdtarget.c 3488 2016-08-24 18:15:57Z emaste $"); +ELFTC_VCSID("$Id: libelftc_bfdtarget.c 3516 2017-02-10 02:33:08Z emaste $"); struct _Elftc_Bfd_Target _libelftc_targets[] = { Modified: stable/11/contrib/elftoolchain/libelftc/libelftc_dem_arm.c ============================================================================== --- stable/11/contrib/elftoolchain/libelftc/libelftc_dem_arm.c Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/libelftc/libelftc_dem_arm.c Mon May 1 01:52:03 2017 (r317623) @@ -37,7 +37,7 @@ #include "_libelftc.h" -ELFTC_VCSID("$Id: libelftc_dem_arm.c 3447 2016-05-03 13:32:23Z emaste $"); +ELFTC_VCSID("$Id: libelftc_dem_arm.c 3513 2016-12-29 07:04:22Z kaiwang27 $"); /** * @file cpp_demangle_arm.c @@ -68,6 +68,7 @@ struct demangle_data { }; #define SIMPLE_HASH(x,y) (64 * x + y) +#define VEC_PUSH_STR(d,s) vector_str_push((d), (s), strlen((s))) #define CPP_DEMANGLE_ARM_TRY 128 static void dest_cstring(struct cstring *); @@ -137,7 +138,7 @@ cpp_demangle_ARM(const char *org) ++d.p; /* start argument types */ - if (vector_str_push(&d.vec, "(", 1) == false) + if (VEC_PUSH_STR(&d.vec, "(") == false) goto clean; for (;;) { @@ -169,21 +170,21 @@ cpp_demangle_ARM(const char *org) goto clean; if (d.ptr == true) { - if (vector_str_push(&d.vec, "*", 1) == false) + if (VEC_PUSH_STR(&d.vec, "*") == false) goto clean; d.ptr = false; } if (d.ref == true) { - if (vector_str_push(&d.vec, "&", 1) == false) + if (VEC_PUSH_STR(&d.vec, "&") == false) goto clean; d.ref = false; } if (d.cnst == true) { - if (vector_str_push(&d.vec, " const", 6) == false) + if (VEC_PUSH_STR(&d.vec, " const") == false) goto clean; d.cnst = false; @@ -210,7 +211,7 @@ cpp_demangle_ARM(const char *org) free(arg); - if (vector_str_push(&d.vec, ", ", 2) == false) + if (VEC_PUSH_STR(&d.vec, ", ") == false) goto clean; if (++try > CPP_DEMANGLE_ARM_TRY) @@ -218,7 +219,7 @@ cpp_demangle_ARM(const char *org) } /* end argument types */ - if (vector_str_push(&d.vec, ")", 1) == false) + if (VEC_PUSH_STR(&d.vec, ")") == false) goto clean; flat: @@ -323,11 +324,10 @@ push_CTDT(const char *s, size_t l, struc return (false); assert(v->size > 1); - if (vector_str_push(v, v->container[v->size - 2], - strlen(v->container[v->size - 2])) == false) + if (VEC_PUSH_STR(v, v->container[v->size - 2]) == false) return (false); - if (vector_str_push(v, "()", 2) == false) + if (VEC_PUSH_STR(v, "()") == false) return (false); return (true); @@ -429,7 +429,7 @@ read_func(struct demangle_data *d) if (read_class(d) == false) return (false); - if (vector_str_push(&d->vec, "::", 2) == false) + if (VEC_PUSH_STR(&d->vec, "::") == false) return (false); } @@ -486,7 +486,7 @@ read_func_name(struct demangle_data *d) if (read_qual_name(d) == false) goto clean; - if (vector_str_push(&d->vec, "::", 2) == false) + if (VEC_PUSH_STR(&d->vec, "::") == false) goto clean; if (vector_str_push(&d->vec, op_name, len) == false) @@ -508,7 +508,7 @@ read_func_name(struct demangle_data *d) if (read_class(d) == false) goto clean; - if (vector_str_push(&d->vec, "::", 2) == false) + if (VEC_PUSH_STR(&d->vec, "::") == false) goto clean; if (vector_str_push(&d->vec, op_name, len) == false) @@ -553,7 +553,7 @@ read_func_ptr(struct demangle_data *d) } if (fptr.ptr == true) { - if (vector_str_push(&fptr.vec, "*", 1) == false) { + if (VEC_PUSH_STR(&fptr.vec, "*") == false) { dest_demangle_data(&fptr); return (false); @@ -563,7 +563,7 @@ read_func_ptr(struct demangle_data *d) } if (fptr.ref == true) { - if (vector_str_push(&fptr.vec, "&", 1) == false) { + if (VEC_PUSH_STR(&fptr.vec, "&") == false) { dest_demangle_data(&fptr); return (false); @@ -573,7 +573,7 @@ read_func_ptr(struct demangle_data *d) } if (fptr.cnst == true) { - if (vector_str_push(&fptr.vec, " const", 6) == false) { + if (VEC_PUSH_STR(&fptr.vec, " const") == false) { dest_demangle_data(&fptr); return (false); @@ -585,7 +585,7 @@ read_func_ptr(struct demangle_data *d) if (*fptr.p == '_') break; - if (vector_str_push(&fptr.vec, ", ", 2) == false) { + if (VEC_PUSH_STR(&fptr.vec, ", ") == false) { dest_demangle_data(&fptr); return (false); @@ -636,7 +636,7 @@ read_func_ptr(struct demangle_data *d) free(rtn_type); - if (vector_str_push(&d->vec, " (*)(", 5) == false) { + if (VEC_PUSH_STR(&d->vec, " (*)(") == false) { free(arg_type); return (false); @@ -650,7 +650,7 @@ read_func_ptr(struct demangle_data *d) free(arg_type); - return (vector_str_push(&d->vec, ")", 1)); + return (VEC_PUSH_STR(&d->vec, ")")); } static bool @@ -689,7 +689,7 @@ read_memptr(struct demangle_data *d) if (vector_str_push(&d->vec, mptr_str, len) == false) goto clean; - if (vector_str_push(&d->vec, "::*", 3) == false) + if (VEC_PUSH_STR(&d->vec, "::*") == false) goto clean; rtn = true; @@ -712,108 +712,102 @@ read_op(struct demangle_data *d) switch (SIMPLE_HASH(*(d->p), *(d->p+1))) { case SIMPLE_HASH('m', 'l') : d->p += 2; - return (vector_str_push(&d->vec, "operator*", 9)); + return (VEC_PUSH_STR(&d->vec, "operator*")); case SIMPLE_HASH('d', 'v') : d->p += 2; - return (vector_str_push(&d->vec, "operator/", 9)); + return (VEC_PUSH_STR(&d->vec, "operator/")); case SIMPLE_HASH('m', 'd') : d->p += 2; - return (vector_str_push(&d->vec, "operator%", 9)); + return (VEC_PUSH_STR(&d->vec, "operator%")); case SIMPLE_HASH('p', 'l') : d->p += 2; - return (vector_str_push(&d->vec, "operator+", 9)); + return (VEC_PUSH_STR(&d->vec, "operator+")); case SIMPLE_HASH('m', 'i') : d->p += 2; - return (vector_str_push(&d->vec, "operator-", 9)); + return (VEC_PUSH_STR(&d->vec, "operator-")); case SIMPLE_HASH('l', 's') : d->p += 2; - return (vector_str_push(&d->vec, "operator<<", 10)); + return (VEC_PUSH_STR(&d->vec, "operator<<")); case SIMPLE_HASH('r', 's') : d->p += 2; - return (vector_str_push(&d->vec, "operator>>", 10)); + return (VEC_PUSH_STR(&d->vec, "operator>>")); case SIMPLE_HASH('e', 'q') : d->p += 2; - return (vector_str_push(&d->vec, "operator==", 10)); + return (VEC_PUSH_STR(&d->vec, "operator==")); case SIMPLE_HASH('n', 'e') : d->p += 2; - return (vector_str_push(&d->vec, "operator!=", 10)); + return (VEC_PUSH_STR(&d->vec, "operator!=")); case SIMPLE_HASH('l', 't') : d->p += 2; - return (vector_str_push(&d->vec, "operator<", 9)); + return (VEC_PUSH_STR(&d->vec, "operator<")); case SIMPLE_HASH('g', 't') : d->p += 2; - return (vector_str_push(&d->vec, "operator>", 9)); + return (VEC_PUSH_STR(&d->vec, "operator>")); case SIMPLE_HASH('l', 'e') : d->p += 2; - return (vector_str_push(&d->vec, "operator<=", 10)); + return (VEC_PUSH_STR(&d->vec, "operator<=")); case SIMPLE_HASH('g', 'e') : d->p += 2; - return (vector_str_push(&d->vec, "operator>=", 10)); + return (VEC_PUSH_STR(&d->vec, "operator>=")); case SIMPLE_HASH('a', 'd') : d->p += 2; if (*d->p == 'v') { ++d->p; - return (vector_str_push(&d->vec, "operator/=", - 10)); + return (VEC_PUSH_STR(&d->vec, "operator/=")); } else - return (vector_str_push(&d->vec, "operator&", 9)); + return (VEC_PUSH_STR(&d->vec, "operator&")); case SIMPLE_HASH('o', 'r') : d->p += 2; - return (vector_str_push(&d->vec, "operator|", 9)); + return (VEC_PUSH_STR(&d->vec, "operator|")); case SIMPLE_HASH('e', 'r') : d->p += 2; - return (vector_str_push(&d->vec, "operator^", 9)); + return (VEC_PUSH_STR(&d->vec, "operator^")); case SIMPLE_HASH('a', 'a') : d->p += 2; if (*d->p == 'd') { ++d->p; - return (vector_str_push(&d->vec, "operator&=", - 10)); + return (VEC_PUSH_STR(&d->vec, "operator&=")); } else - return (vector_str_push(&d->vec, "operator&&", - 10)); + return (VEC_PUSH_STR(&d->vec, "operator&&")); case SIMPLE_HASH('o', 'o') : d->p += 2; - return (vector_str_push(&d->vec, "operator||", 10)); + return (VEC_PUSH_STR(&d->vec, "operator||")); case SIMPLE_HASH('n', 't') : d->p += 2; - return (vector_str_push(&d->vec, "operator!", 9)); + return (VEC_PUSH_STR(&d->vec, "operator!")); case SIMPLE_HASH('c', 'o') : d->p += 2; - return (vector_str_push(&d->vec, "operator~", 9)); + return (VEC_PUSH_STR(&d->vec, "operator~")); case SIMPLE_HASH('p', 'p') : d->p += 2; - return (vector_str_push(&d->vec, "operator++", 10)); + return (VEC_PUSH_STR(&d->vec, "operator++")); case SIMPLE_HASH('m', 'm') : d->p += 2; - return (vector_str_push(&d->vec, "operator--", 10)); + return (VEC_PUSH_STR(&d->vec, "operator--")); case SIMPLE_HASH('a', 's') : d->p += 2; - return (vector_str_push(&d->vec, "operator=", 9)); + return (VEC_PUSH_STR(&d->vec, "operator=")); case SIMPLE_HASH('r', 'f') : d->p += 2; - return (vector_str_push(&d->vec, "operator->", 10)); + return (VEC_PUSH_STR(&d->vec, "operator->")); case SIMPLE_HASH('a', 'p') : /* apl */ if (*(d->p + 2) != 'l') return (false); d->p += 3; - return (vector_str_push(&d->vec, "operator+=", 10)); + return (VEC_PUSH_STR(&d->vec, "operator+=")); case SIMPLE_HASH('a', 'm') : d->p += 2; if (*d->p == 'i') { ++d->p; - return (vector_str_push(&d->vec, "operator-=", - 10)); + return (VEC_PUSH_STR(&d->vec, "operator-=")); } else if (*d->p == 'u') { ++d->p; - return (vector_str_push(&d->vec, "operator*=", - 10)); + return (VEC_PUSH_STR(&d->vec, "operator*=")); } else if (*d->p == 'd') { ++d->p; - return (vector_str_push(&d->vec, "operator%=", - 10)); + return (VEC_PUSH_STR(&d->vec, "operator%=")); } return (false); @@ -823,40 +817,40 @@ read_op(struct demangle_data *d) return (false); d->p += 3; - return (vector_str_push(&d->vec, "operator<<=", 11)); + return (VEC_PUSH_STR(&d->vec, "operator<<=")); case SIMPLE_HASH('a', 'r') : /* ars */ if (*(d->p + 2) != 's') return (false); d->p += 3; - return (vector_str_push(&d->vec, "operator>>=", 11)); + return (VEC_PUSH_STR(&d->vec, "operator>>=")); case SIMPLE_HASH('a', 'o') : /* aor */ if (*(d->p + 2) != 'r') return (false); d->p += 3; - return (vector_str_push(&d->vec, "operator|=", 10)); + return (VEC_PUSH_STR(&d->vec, "operator|=")); case SIMPLE_HASH('a', 'e') : /* aer */ if (*(d->p + 2) != 'r') return (false); d->p += 3; - return (vector_str_push(&d->vec, "operator^=", 10)); + return (VEC_PUSH_STR(&d->vec, "operator^=")); case SIMPLE_HASH('c', 'm') : d->p += 2; - return (vector_str_push(&d->vec, "operator,", 9)); + return (VEC_PUSH_STR(&d->vec, "operator,")); case SIMPLE_HASH('r', 'm') : d->p += 2; - return (vector_str_push(&d->vec, "operator->*", 11)); + return (VEC_PUSH_STR(&d->vec, "operator->*")); case SIMPLE_HASH('c', 'l') : d->p += 2; - return (vector_str_push(&d->vec, "()", 2)); + return (VEC_PUSH_STR(&d->vec, "()")); case SIMPLE_HASH('v', 'c') : d->p += 2; - return (vector_str_push(&d->vec, "[]", 2)); + return (VEC_PUSH_STR(&d->vec, "[]")); case SIMPLE_HASH('c', 't') : d->p += 4; d->type = ENCODE_OP_CT; @@ -883,11 +877,10 @@ read_op(struct demangle_data *d) return (false); case SIMPLE_HASH('n', 'w') : d->p += 2; - return (vector_str_push(&d->vec, "operator new()", 14)); + return (VEC_PUSH_STR(&d->vec, "operator new()")); case SIMPLE_HASH('d', 'l') : d->p += 2; - return (vector_str_push(&d->vec, "operator delete()", - 17)); + return (VEC_PUSH_STR(&d->vec, "operator delete()")); case SIMPLE_HASH('o', 'p') : /* __op__ */ d->p += 2; @@ -962,13 +955,13 @@ read_op_user(struct demangle_data *d) if (vector_str_push(&d->vec, from_str, from_len) == false) goto clean; - if (vector_str_push(&d->vec, "::operator ", 11) == false) + if (VEC_PUSH_STR(&d->vec, "::operator ") == false) return (false); if (vector_str_push(&d->vec, to_str, to_len) == false) goto clean; - rtn = vector_str_push(&d->vec, "()", 2); + rtn = VEC_PUSH_STR(&d->vec, "()"); clean: free(to_str); free(from_str); @@ -1000,7 +993,7 @@ read_qual_name(struct demangle_data *d) if (read_class(d) == false) return (false); - if (vector_str_push(&d->vec, "::", 2) == false) + if (VEC_PUSH_STR(&d->vec, "::") == false) return (false); } @@ -1029,12 +1022,10 @@ read_subst(struct demangle_data *d) d->p = str; - if (vector_str_push(&d->vec, d->arg.container[idx - 1], - strlen(d->arg.container[idx - 1])) == false) + if (VEC_PUSH_STR(&d->vec, d->arg.container[idx - 1]) == false) return (-1); - if (vector_str_push(&d->arg, d->arg.container[idx - 1], - strlen(d->arg.container[idx - 1])) == false) + if (VEC_PUSH_STR(&d->arg, d->arg.container[idx - 1]) == false) return (-1); if (*d->p == '\0') @@ -1073,16 +1064,14 @@ read_subst_iter(struct demangle_data *d) d->p = str; for (i = 0; i < repeat ; ++i) { - if (vector_str_push(&d->vec, d->arg.container[idx - 1], - strlen(d->arg.container[idx - 1])) == false) + if (VEC_PUSH_STR(&d->vec, d->arg.container[idx - 1]) == false) return (-1); - if (vector_str_push(&d->arg, d->arg.container[idx - 1], - strlen(d->arg.container[idx - 1])) == false) + if (VEC_PUSH_STR(&d->arg, d->arg.container[idx - 1]) == false) return (-1); if (i != repeat - 1 && - vector_str_push(&d->vec, ", ", 2) == false) + VEC_PUSH_STR(&d->vec, ", ") == false) return (-1); } @@ -1108,7 +1097,7 @@ read_type(struct demangle_data *d) case 'U' : ++d->p; - if (vector_str_push(&d->vec, "unsigned ", 9) == false) + if (VEC_PUSH_STR(&d->vec, "unsigned ") == false) return (false); break; @@ -1118,7 +1107,7 @@ read_type(struct demangle_data *d) if (*d->p == 'P') d->cnst = true; else { - if (vector_str_push(&d->vec, "const ", 6) == + if (VEC_PUSH_STR(&d->vec, "const ") == false) return (false); } @@ -1127,14 +1116,14 @@ read_type(struct demangle_data *d) case 'V' : ++d->p; - if (vector_str_push(&d->vec, "volatile ", 9) == false) + if (VEC_PUSH_STR(&d->vec, "volatile ") == false) return (false); break; case 'S' : ++d->p; - if (vector_str_push(&d->vec, "signed ", 7) == false) + if (VEC_PUSH_STR(&d->vec, "signed ") == false) return (false); break; @@ -1185,39 +1174,39 @@ read_type(struct demangle_data *d) case 'v' : ++d->p; - return (vector_str_push(&d->vec, "void", 4)); + return (VEC_PUSH_STR(&d->vec, "void")); case 'c' : ++d->p; - return (vector_str_push(&d->vec, "char", 4)); + return (VEC_PUSH_STR(&d->vec, "char")); case 's' : ++d->p; - return (vector_str_push(&d->vec, "short", 5)); + return (VEC_PUSH_STR(&d->vec, "short")); case 'i' : ++d->p; - return (vector_str_push(&d->vec, "int", 3)); + return (VEC_PUSH_STR(&d->vec, "int")); case 'l' : ++d->p; - return (vector_str_push(&d->vec, "long", 4)); + return (VEC_PUSH_STR(&d->vec, "long")); case 'f' : ++d->p; - return (vector_str_push(&d->vec, "float", 5)); + return (VEC_PUSH_STR(&d->vec, "float")); case 'd': ++d->p; - return (vector_str_push(&d->vec, "double", 6)); + return (VEC_PUSH_STR(&d->vec, "double")); case 'r': ++d->p; - return (vector_str_push(&d->vec, "long double", 11)); + return (VEC_PUSH_STR(&d->vec, "long double")); case 'e': ++d->p; - return (vector_str_push(&d->vec, "...", 3)); + return (VEC_PUSH_STR(&d->vec, "...")); default: return (false); }; Modified: stable/11/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c ============================================================================== --- stable/11/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c Mon May 1 01:51:50 2017 (r317622) +++ stable/11/contrib/elftoolchain/libelftc/libelftc_dem_gnu2.c Mon May 1 01:52:03 2017 (r317623) @@ -37,7 +37,7 @@ #include "_libelftc.h" -ELFTC_VCSID("$Id: libelftc_dem_gnu2.c 3447 2016-05-03 13:32:23Z emaste $"); +ELFTC_VCSID("$Id: libelftc_dem_gnu2.c 3513 2016-12-29 07:04:22Z kaiwang27 $"); /** * @file cpp_demangle_gnu2.c @@ -66,6 +66,7 @@ struct demangle_data { }; #define SIMPLE_HASH(x,y) (64 * x + y) +#define VEC_PUSH_STR(d,s) vector_str_push((d), (s), strlen((s))) #define CPP_DEMANGLE_GNU2_TRY 128 static void dest_cstring(struct cstring *); @@ -126,7 +127,7 @@ cpp_demangle_gnu2(const char *org) if (push_CTDT("::~", 3, &d.vec) == false) goto clean; - if (vector_str_push(&d.vec, "(void)", 6) == false) + if (VEC_PUSH_STR(&d.vec, "(void)") == false) goto clean; goto flat; @@ -141,7 +142,7 @@ cpp_demangle_gnu2(const char *org) ++d.p; else if (*d.p == '\0') { if (d.class_name == true) { - if (vector_str_push(&d.vec, "(void)", 6) == false) + if (VEC_PUSH_STR(&d.vec, "(void)") == false) goto clean; goto flat; @@ -150,7 +151,7 @@ cpp_demangle_gnu2(const char *org) } /* start argument types */ - if (vector_str_push(&d.vec, "(", 1) == false) + if (VEC_PUSH_STR(&d.vec, "(") == false) goto clean; for (;;) { @@ -182,21 +183,21 @@ cpp_demangle_gnu2(const char *org) goto clean; if (d.ptr == true) { - if (vector_str_push(&d.vec, "*", 1) == false) + if (VEC_PUSH_STR(&d.vec, "*") == false) goto clean; d.ptr = false; } if (d.ref == true) { - if (vector_str_push(&d.vec, "&", 1) == false) + if (VEC_PUSH_STR(&d.vec, "&") == false) goto clean; d.ref = false; } if (d.cnst == true) { - if (vector_str_push(&d.vec, " const", 6) == false) + if (VEC_PUSH_STR(&d.vec, " const") == false) goto clean; d.cnst = false; @@ -223,7 +224,7 @@ cpp_demangle_gnu2(const char *org) free(arg); - if (vector_str_push(&d.vec, ", ", 2) == false) + if (VEC_PUSH_STR(&d.vec, ", ") == false) goto clean; if (++try > CPP_DEMANGLE_GNU2_TRY) @@ -231,10 +232,10 @@ cpp_demangle_gnu2(const char *org) } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 1 01:54:04 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE422D5824E; Mon, 1 May 2017 01:54:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DA2A97D; Mon, 1 May 2017 01:54:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v411s3cB087333; Mon, 1 May 2017 01:54:03 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v411s3CV087331; Mon, 1 May 2017 01:54:03 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201705010154.v411s3CV087331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Mon, 1 May 2017 01:54:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r317625 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 01:54:04 -0000 Author: gonzo Date: Mon May 1 01:54:03 2017 New Revision: 317625 URL: https://svnweb.freebsd.org/changeset/base/317625 Log: Welcome Vladimir Kondratyev (wulf) as a new src committer. Vladimir did great job on improving and finishing jceel's evdev driver, contributed Elantech trackpad support for psm(4) and submitted multiple fixes to psm(4) and atkbd(4) drivers. I will be his mentor and bapt@ agreed to act as a co-mentor Approved by: core Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Mon May 1 01:53:05 2017 (r317624) +++ svnadmin/conf/access Mon May 1 01:54:03 2017 (r317625) @@ -215,6 +215,7 @@ whu will wma wollman +wulf yongari zbb zec Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Mon May 1 01:53:05 2017 (r317624) +++ svnadmin/conf/mentors Mon May 1 01:54:03 2017 (r317625) @@ -27,3 +27,4 @@ pstef pfg rgrimes grehan slm ken Co-mentor: scottl, ambrisko stevek sjg +wulf gonzo Co-mentor: bapt From owner-svn-src-all@freebsd.org Mon May 1 01:56:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 214FDD58342; Mon, 1 May 2017 01:56:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E760CBD0; Mon, 1 May 2017 01:56: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 v411uBM7087622; Mon, 1 May 2017 01:56:11 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v411uBGM087621; Mon, 1 May 2017 01:56:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705010156.v411uBGM087621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 1 May 2017 01:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317626 - head/contrib/elftoolchain/cxxfilt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 01:56:13 -0000 Author: emaste Date: Mon May 1 01:56:11 2017 New Revision: 317626 URL: https://svnweb.freebsd.org/changeset/base/317626 Log: revert r308465: c++filt: flush output after newline The ELF Tool Chain update to r3520 uses setvbuf to set line buffering. Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/cxxfilt/cxxfilt.c Modified: head/contrib/elftoolchain/cxxfilt/cxxfilt.c ============================================================================== --- head/contrib/elftoolchain/cxxfilt/cxxfilt.c Mon May 1 01:54:03 2017 (r317625) +++ head/contrib/elftoolchain/cxxfilt/cxxfilt.c Mon May 1 01:56:11 2017 (r317626) @@ -189,8 +189,6 @@ main(int argc, char **argv) if (c == EOF) break; putchar(c); - if (c == '\n') - fflush(stdout); } else { if ((size_t) p >= sizeof(buf) - 1) warnx("buffer overflowed"); From owner-svn-src-all@freebsd.org Mon May 1 04:32:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D34CD58797; Mon, 1 May 2017 04:32:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39E42F37; Mon, 1 May 2017 04:32:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x244.google.com with SMTP id v1so14588216pgv.3; Sun, 30 Apr 2017 21:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=QHCJDH8h/9D0X3lgF+rcHEIYiYof6Ymnaragme3/uao=; b=dawkuwDVjQKRk4aFU7zF8cNQ6MKWCGXV04GuBoZcOgP8BunLSEHZgRXGyT4cZBnJ5R Wj6NdCwB0wRRLFmKFRaBVIngu382jFL99SwSQdUy1DfJLW/GWNQYgCRuw/5DUClJbO8O 4gqV/fLLrm/5TDZz2NKZDVYf11M22K7XVdaYEF3AOl3w/L+ozCrhQbQXBfkBHFCbScYd h8Wl4frU3aINZESVkdMDv+UvwF/HlqXHSGUDu2B6serbz8lQZUtfLzLhyAYoucsiBCsI xLLm/b++RnQcFSV1c7ryHSI3xl7qiDBdd3iH1gbh/AdfOszoJ4/3kZJNgZ1rodxIQ2ZE ocoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=QHCJDH8h/9D0X3lgF+rcHEIYiYof6Ymnaragme3/uao=; b=ZKJAaLKOW+85zA0fnEracOsGqKOSnEtPamRJO6gA7Ijk+A/13jD+Rygqy0h5gz+6p2 puE43hp9xaPkMVgsH1nsatMz9V2av6p88B56tiEQ+oDJcANXw1jN12vXVQc+AL+gi+IK NKjQY4i0YMbFJD7ZvPXyhHNY3v8jihtyoCy3na3UHzIbegMmAxlqbyv7CZoU6v6ZG71g zq9jmVd/FjIppGVXpphYkXi/iuotcrhUyPF2UDUNymb3B7yAZJSHOKoaClch/MpjaomK Qzn13/9EIKZ37dteJf8ssF91m0Oi4aILPxRa4U3eX0XUnnaM7ga5anInEbg++iR0qCzs NSZg== X-Gm-Message-State: AN3rC/6HqlLOOR87N/C8XQGMGyAZOq8cpKgz7wJQOsaznyz7QWZ7WD9P UCSzWOJJLz2u8re3jsA= X-Received: by 10.84.205.70 with SMTP id o6mr31595234plh.63.1493613142828; Sun, 30 Apr 2017 21:32:22 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id s89sm21862005pfi.79.2017.04.30.21.32.21 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 30 Apr 2017 21:32:21 -0700 (PDT) Subject: Re: svn commit: r317600 - in head/sys: amd64/vmm/amd modules/vmm Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_B8AD2F48-D6E0-496F-A3D4-5C8EB5B6E0CC"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <11FF3746-5B36-47A2-B44C-9ED53AE02F03@gmail.com> Date: Sun, 30 Apr 2017 21:32:20 -0700 Cc: Anish Gupta , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <90675112-83AD-4012-8BA2-F0736DAE88D5@gmail.com> References: <201704300208.v3U28lZo093446@repo.freebsd.org> <11FF3746-5B36-47A2-B44C-9ED53AE02F03@gmail.com> To: Matteo Riondato X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 04:32:23 -0000 --Apple-Mail=_B8AD2F48-D6E0-496F-A3D4-5C8EB5B6E0CC Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > On Apr 30, 2017, at 07:35, Matteo Riondato wrote: >=20 >=20 >> On Apr 29, 2017, at 10:08 PM, Anish Gupta wrote: >>=20 >> Author: anish >> Date: Sun Apr 30 02:08:46 2017 >> New Revision: 317600 >> URL: https://svnweb.freebsd.org/changeset/base/317600 >>=20 >> Log: >> Add AMD IOMMU/AMD-Vi support in bhyve for passthrough/direct = assignment to VMs. To enable AMD-Vi, set hw.vmm.amdvi.enable=3D1. >=20 > This knob should likely be documented somewhere, and maybe also = "Relnotes: yes" ? Good catch. The knob should be documented in the driver manpage. Thanks! -Ngie --Apple-Mail=_B8AD2F48-D6E0-496F-A3D4-5C8EB5B6E0CC Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZBrpUAAoJEPWDqSZpMIYVW6gP/3EtwQmgdwsWc0oYiEtaiCeO W+w3X2PL/QgPVg8dWJ9WIQCcnhd/5U6GZao5vEjiUMKs8CsJe6hsz1DsT6WsCT4W KChrgUwriXybIzS/Vc2BFuONAkTOMw/m3QtG2TMovffU8Yjp8V+iHgDI0O2hy5Sz c8HsfcFP4sYhydshnE16XbM3hi+9rwSNE02BDgEU8AvM2ONZ6KNLFskBAZ0h1fu5 qE7ll/F0Ij+C6zcPIYGhz5buje3zBy4LyGpg/i/Z48JINIMbqr54pI7fkt9vRZgh jtnp+Z3QHzcqZKLEpbsxaPSuXzwagfOkEHm5oSNf+nHkYGvWUNaR4LxtIj6WGhu2 ICOkzHnjpOlAqDetWYtR05O68KfbQn9Lu2AX5mLR99fKwsBz6UZnt9geuv3E41Xw r6DPqeNeaCExMEAubcH0wbBj35rSYlpbD3PA4j80+WUyrM6IvfN+67Eb5/eFn3Yh cMC7kw3A/1PjFyJu2Im78zAzvpw+Uym/aj6PoyRkJf4dBhfJPcNwUgaU5cE9HHk6 fCTs/jCG3MtVm+PcgwQ+29eanAB0nOt2riVDxhqlIScl4JdfMOZmusQ5QmAK1WUx 4eHqPR0E7Dj2LZfeN8N7hEB3JEpK258T6bTG123HZF0pWvYBZL8Kilpyp7oj7xoc mmczb++/aN82GAqiKxAH =IW7c -----END PGP SIGNATURE----- --Apple-Mail=_B8AD2F48-D6E0-496F-A3D4-5C8EB5B6E0CC-- From owner-svn-src-all@freebsd.org Mon May 1 06:03:09 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E7F7D58DA8; Mon, 1 May 2017 06:03:09 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 27CF815BD; Mon, 1 May 2017 06:03:09 +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 v41638wF089419; Mon, 1 May 2017 06:03:08 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41638tq089418; Mon, 1 May 2017 06:03:08 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201705010603.v41638tq089418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 1 May 2017 06:03:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317633 - stable/11/lib/libc/gen X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 06:03:09 -0000 Author: mav Date: Mon May 1 06:03:07 2017 New Revision: 317633 URL: https://svnweb.freebsd.org/changeset/base/317633 Log: MFC r317064: Optimize pathologic case of telldir() for Samba. When application reads large directory, calling telldir() for each entry, like Samba does, it creates exponential performance drop as number of entries reach tenths to hundreds of thousands. It is caused by full search through the internal list, that never finds matches in that scenario, but creates O(n^2) delays. This patch optimizes that search, limiting it to entries of the same buffer, turning time closer to O(n) in case of linear directory scan. Modified: stable/11/lib/libc/gen/telldir.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/telldir.c ============================================================================== --- stable/11/lib/libc/gen/telldir.c Mon May 1 05:59:52 2017 (r317632) +++ stable/11/lib/libc/gen/telldir.c Mon May 1 06:03:07 2017 (r317633) @@ -52,15 +52,22 @@ __FBSDID("$FreeBSD$"); long telldir(DIR *dirp) { - struct ddloc *lp; + struct ddloc *lp, *flp; long idx; if (__isthreaded) _pthread_mutex_lock(&dirp->dd_lock); + flp = NULL; LIST_FOREACH(lp, &dirp->dd_td->td_locq, loc_lqe) { - if (lp->loc_seek == dirp->dd_seek && - lp->loc_loc == dirp->dd_loc) + if (lp->loc_seek == dirp->dd_seek) { + if (flp == NULL) + flp = lp; + if (lp->loc_loc == dirp->dd_loc) + break; + } else if (flp != NULL) { + lp = NULL; break; + } } if (lp == NULL) { lp = malloc(sizeof(struct ddloc)); @@ -72,7 +79,10 @@ telldir(DIR *dirp) lp->loc_index = dirp->dd_td->td_loccnt++; lp->loc_seek = dirp->dd_seek; lp->loc_loc = dirp->dd_loc; - LIST_INSERT_HEAD(&dirp->dd_td->td_locq, lp, loc_lqe); + if (flp != NULL) + LIST_INSERT_BEFORE(flp, lp, loc_lqe); + else + LIST_INSERT_HEAD(&dirp->dd_td->td_locq, lp, loc_lqe); } idx = lp->loc_index; if (__isthreaded) From owner-svn-src-all@freebsd.org Mon May 1 06:03:46 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14343D58EBA; Mon, 1 May 2017 06:03:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDB7D16BF; Mon, 1 May 2017 06:03:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4163i0T089497; Mon, 1 May 2017 06:03:44 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4163iiD089496; Mon, 1 May 2017 06:03:44 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201705010603.v4163iiD089496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 1 May 2017 06:03:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r317634 - stable/10/lib/libc/gen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 06:03:46 -0000 Author: mav Date: Mon May 1 06:03:44 2017 New Revision: 317634 URL: https://svnweb.freebsd.org/changeset/base/317634 Log: MFC r317064: Optimize pathologic case of telldir() for Samba. When application reads large directory, calling telldir() for each entry, like Samba does, it creates exponential performance drop as number of entries reach tenths to hundreds of thousands. It is caused by full search through the internal list, that never finds matches in that scenario, but creates O(n^2) delays. This patch optimizes that search, limiting it to entries of the same buffer, turning time closer to O(n) in case of linear directory scan. Modified: stable/10/lib/libc/gen/telldir.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/gen/telldir.c ============================================================================== --- stable/10/lib/libc/gen/telldir.c Mon May 1 06:03:07 2017 (r317633) +++ stable/10/lib/libc/gen/telldir.c Mon May 1 06:03:44 2017 (r317634) @@ -53,15 +53,22 @@ long telldir(dirp) DIR *dirp; { - struct ddloc *lp; + struct ddloc *lp, *flp; long idx; if (__isthreaded) _pthread_mutex_lock(&dirp->dd_lock); + flp = NULL; LIST_FOREACH(lp, &dirp->dd_td->td_locq, loc_lqe) { - if (lp->loc_seek == dirp->dd_seek && - lp->loc_loc == dirp->dd_loc) + if (lp->loc_seek == dirp->dd_seek) { + if (flp == NULL) + flp = lp; + if (lp->loc_loc == dirp->dd_loc) + break; + } else if (flp != NULL) { + lp = NULL; break; + } } if (lp == NULL) { lp = malloc(sizeof(struct ddloc)); @@ -73,7 +80,10 @@ telldir(dirp) lp->loc_index = dirp->dd_td->td_loccnt++; lp->loc_seek = dirp->dd_seek; lp->loc_loc = dirp->dd_loc; - LIST_INSERT_HEAD(&dirp->dd_td->td_locq, lp, loc_lqe); + if (flp != NULL) + LIST_INSERT_BEFORE(flp, lp, loc_lqe); + else + LIST_INSERT_HEAD(&dirp->dd_td->td_locq, lp, loc_lqe); } idx = lp->loc_index; if (__isthreaded) From owner-svn-src-all@freebsd.org Mon May 1 05:54:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22B6BD5C74F; Mon, 1 May 2017 05:54:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E77EAD73; Mon, 1 May 2017 05:54:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v415sXwD085476; Mon, 1 May 2017 05:54:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v415sX3A085475; Mon, 1 May 2017 05:54:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705010554.v415sX3A085475@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 1 May 2017 05:54:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317631 - head/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 05:54:35 -0000 Author: ngie Date: Mon May 1 05:54:33 2017 New Revision: 317631 URL: https://svnweb.freebsd.org/changeset/base/317631 Log: Fix "make cscope" after r317411 Sponsored by: Dell EMC Isilon Modified: head/sys/Makefile Modified: head/sys/Makefile ============================================================================== --- head/sys/Makefile Mon May 1 02:08:44 2017 (r317630) +++ head/sys/Makefile Mon May 1 05:54:33 2017 (r317631) @@ -3,7 +3,7 @@ # Directories to include in cscope name file and TAGS. CSCOPEDIRS= boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \ geom gnu isa kern libkern modules net net80211 \ - netgraph netinet netinet6 netipsec netnatm netpfil \ + netgraph netinet netinet6 netipsec netpfil \ netsmb nfs nfsclient nfsserver nlm ofed opencrypto \ rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR} .if !defined(CSCOPE_ARCHDIR) From owner-svn-src-all@freebsd.org Mon May 1 05:59:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE99ED5CE8C; Mon, 1 May 2017 05:59:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE3AAF44; Mon, 1 May 2017 05:59:53 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v415xq0n085700; Mon, 1 May 2017 05:59:52 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v415xqx2085699; Mon, 1 May 2017 05:59:52 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201705010559.v415xqx2085699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Ngie Cooper Date: Mon, 1 May 2017 05:59:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317632 - head/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 05:59:54 -0000 Author: ngie Date: Mon May 1 05:59:52 2017 New Revision: 317632 URL: https://svnweb.freebsd.org/changeset/base/317632 Log: Fix "make cscope-clean" when .OBJDIR already exists The cscope generated files are always put in .CURDIR . MFC after: 1 month Sponsored by: Dell EMC Isilon Modified: head/sys/Makefile Modified: head/sys/Makefile ============================================================================== --- head/sys/Makefile Mon May 1 05:54:33 2017 (r317631) +++ head/sys/Makefile Mon May 1 05:59:52 2017 (r317632) @@ -32,7 +32,8 @@ ${.CURDIR}/cscope.files: .PHONY find ${CSCOPEDIRS} -name "*.[chSsly]" -a -type f > ${.TARGET} cscope-clean: - rm -f cscope.files cscope.out cscope.in.out cscope.po.out + cd ${.CURDIR}; \ + rm -f cscope.files cscope.out cscope.in.out cscope.po.out # # Installs SCM hooks to update the cscope database every time the source tree From owner-svn-src-all@freebsd.org Mon May 1 06:04:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9844D58FC4; Mon, 1 May 2017 06:04:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A971A17B7; Mon, 1 May 2017 06:04:35 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4164Y4N089580; Mon, 1 May 2017 06:04:34 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4164YKg089579; Mon, 1 May 2017 06:04:34 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201705010604.v4164YKg089579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 1 May 2017 06:04:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317635 - stable/11/sys/dev/isp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 06:04:36 -0000 Author: mav Date: Mon May 1 06:04:34 2017 New Revision: 317635 URL: https://svnweb.freebsd.org/changeset/base/317635 Log: MFC r317356: Switch isp_reset to scratchpad not requiring ISP_MBOXDMASETUP. Modified: stable/11/sys/dev/isp/isp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/isp/isp.c ============================================================================== --- stable/11/sys/dev/isp/isp.c Mon May 1 06:03:44 2017 (r317634) +++ stable/11/sys/dev/isp/isp.c Mon May 1 06:04:34 2017 (r317635) @@ -1012,7 +1012,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d fwt = isp->isp_fwattr; if (IS_24XX(isp)) { - buf = FCPARAM(isp, 0)->isp_scratch; + buf = FCPARAM(isp, 0)->isp_scanscratch; ISP_SNPRINTF(buf, ISP_FC_SCRLEN, "Attributes:"); if (fwt & ISP2400_FW_ATTR_CLASS2) { fwt ^=ISP2400_FW_ATTR_CLASS2; @@ -1101,7 +1101,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d } isp_prt(isp, ISP_LOGCONFIG, "%s", buf); } else if (IS_FC(isp)) { - buf = FCPARAM(isp, 0)->isp_scratch; + buf = FCPARAM(isp, 0)->isp_scanscratch; ISP_SNPRINTF(buf, ISP_FC_SCRLEN, "Attributes:"); if (fwt & ISP_FW_ATTR_TMODE) { fwt ^=ISP_FW_ATTR_TMODE; From owner-svn-src-all@freebsd.org Mon May 1 06:05:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0CA1D5B04A; Mon, 1 May 2017 06:05:05 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0E5218B2; Mon, 1 May 2017 06:05: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 v41654gJ089661; Mon, 1 May 2017 06:05:04 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41654sm089660; Mon, 1 May 2017 06:05:04 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201705010605.v41654sm089660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 1 May 2017 06:05:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r317636 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 06:05:06 -0000 Author: mav Date: Mon May 1 06:05:04 2017 New Revision: 317636 URL: https://svnweb.freebsd.org/changeset/base/317636 Log: MFC r317356: Switch isp_reset to scratchpad not requiring ISP_MBOXDMASETUP. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Mon May 1 06:04:34 2017 (r317635) +++ stable/10/sys/dev/isp/isp.c Mon May 1 06:05:04 2017 (r317636) @@ -1012,7 +1012,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d fwt = isp->isp_fwattr; if (IS_24XX(isp)) { - buf = FCPARAM(isp, 0)->isp_scratch; + buf = FCPARAM(isp, 0)->isp_scanscratch; ISP_SNPRINTF(buf, ISP_FC_SCRLEN, "Attributes:"); if (fwt & ISP2400_FW_ATTR_CLASS2) { fwt ^=ISP2400_FW_ATTR_CLASS2; @@ -1101,7 +1101,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d } isp_prt(isp, ISP_LOGCONFIG, "%s", buf); } else if (IS_FC(isp)) { - buf = FCPARAM(isp, 0)->isp_scratch; + buf = FCPARAM(isp, 0)->isp_scanscratch; ISP_SNPRINTF(buf, ISP_FC_SCRLEN, "Attributes:"); if (fwt & ISP_FW_ATTR_TMODE) { fwt ^=ISP_FW_ATTR_TMODE; From owner-svn-src-all@freebsd.org Mon May 1 06:42:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34A91D5A559; Mon, 1 May 2017 06:42:41 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1014BDBC; Mon, 1 May 2017 06:42:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v416geKj005620; Mon, 1 May 2017 06:42:40 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v416gdvU005618; Mon, 1 May 2017 06:42:39 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201705010642.v416gdvU005618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 1 May 2017 06:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317637 - stable/11/sys/compat/linux X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 06:42:41 -0000 Author: dchagin Date: Mon May 1 06:42:39 2017 New Revision: 317637 URL: https://svnweb.freebsd.org/changeset/base/317637 Log: MFC r316426: Use the kern_clock_nanosleep() to implement Linux clock_nanosleep() with the proper handling of the TIMER_ABSTIME flag. Modified: stable/11/sys/compat/linux/linux_time.c stable/11/sys/compat/linux/linux_timer.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_time.c ============================================================================== --- stable/11/sys/compat/linux/linux_time.c Mon May 1 06:05:04 2017 (r317636) +++ stable/11/sys/compat/linux/linux_time.c Mon May 1 06:42:39 2017 (r317637) @@ -231,6 +231,18 @@ linux_to_native_clockid(clockid_t *n, cl } int +linux_to_native_timerflags(int *nflags, int flags) +{ + + if (flags & ~LINUX_TIMER_ABSTIME) + return (EINVAL); + *nflags = 0; + if (flags & LINUX_TIMER_ABSTIME) + *nflags |= TIMER_ABSTIME; + return (0); +} + +int linux_clock_gettime(struct thread *td, struct linux_clock_gettime_args *args) { struct l_timespec lts; @@ -543,24 +555,26 @@ linux_clock_nanosleep(struct thread *td, struct timespec *rmtp; struct l_timespec lrqts, lrmts; struct timespec rqts, rmts; - int error, error2; + int error, error2, flags; + clockid_t clockid; LIN_SDT_PROBE4(time, linux_clock_nanosleep, entry, args->which, args->flags, args->rqtp, args->rmtp); - if (args->flags != 0) { - /* XXX deal with TIMER_ABSTIME */ + error = linux_to_native_timerflags(&flags, args->flags); + if (error != 0) { LIN_SDT_PROBE1(time, linux_clock_nanosleep, unsupported_flags, args->flags); - LIN_SDT_PROBE1(time, linux_clock_nanosleep, return, EINVAL); - return (EINVAL); /* XXX deal with TIMER_ABSTIME */ + LIN_SDT_PROBE1(time, linux_clock_nanosleep, return, error); + return (error); } - if (args->which != LINUX_CLOCK_REALTIME) { + error = linux_to_native_clockid(&clockid, args->which); + if (error != 0) { LIN_SDT_PROBE1(time, linux_clock_nanosleep, unsupported_clockid, args->which); - LIN_SDT_PROBE1(time, linux_clock_nanosleep, return, EINVAL); - return (EINVAL); + LIN_SDT_PROBE1(time, linux_clock_settime, return, error); + return (error); } error = copyin(args->rqtp, &lrqts, sizeof(lrqts)); @@ -583,9 +597,9 @@ linux_clock_nanosleep(struct thread *td, LIN_SDT_PROBE1(time, linux_clock_nanosleep, return, error); return (error); } - error = kern_nanosleep(td, &rqts, rmtp); - if (error == EINTR && args->rmtp != NULL) { - /* XXX. Not for TIMER_ABSTIME */ + error = kern_clock_nanosleep(td, clockid, flags, &rqts, rmtp); + if (error == EINTR && (flags & TIMER_ABSTIME) == 0 && + args->rmtp != NULL) { error2 = native_to_linux_timespec(&lrmts, rmtp); if (error2 != 0) return (error2); Modified: stable/11/sys/compat/linux/linux_timer.h ============================================================================== --- stable/11/sys/compat/linux/linux_timer.h Mon May 1 06:05:04 2017 (r317636) +++ stable/11/sys/compat/linux/linux_timer.h Mon May 1 06:42:39 2017 (r317637) @@ -72,6 +72,7 @@ #define LINUX_CPUCLOCK_PERTHREAD(clock) \ (((clock) & (clockid_t) LINUX_CPUCLOCK_PERTHREAD_MASK) != 0) +#define LINUX_TIMER_ABSTIME 0x01 #define L_SIGEV_SIGNAL 0 #define L_SIGEV_NONE 1 @@ -120,5 +121,6 @@ int native_to_linux_itimerspec(struct l_ struct itimerspec *); int linux_to_native_itimerspec(struct itimerspec *, struct l_itimerspec *); +int linux_to_native_timerflags(int *, int); #endif /* _LINUX_TIMER_H */ From owner-svn-src-all@freebsd.org Mon May 1 08:25:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72EA1D58889; Mon, 1 May 2017 08:25:27 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id EAD031E2C; Mon, 1 May 2017 08:25:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 5F24A106670; Mon, 1 May 2017 18:25:15 +1000 (AEST) Date: Mon, 1 May 2017 18:25:11 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , Alan Somers , Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... In-Reply-To: <20170430201324.GV1622@kib.kiev.ua> Message-ID: <20170501163725.U972@besplex.bde.org> References: <201704171734.v3HHYlf5022945@repo.freebsd.org> <20170419130428.J956@besplex.bde.org> <20170430201324.GV1622@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=AYLBJzfG c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=3k7yWw-cxINEvggbrqQA:9 a=3FEMvmqPBOvLgTTy:21 a=ADBJ0AdOzlxKT8_j:21 a=1DRM5oOrNcreRuyr:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 08:25:27 -0000 On Sun, 30 Apr 2017, Konstantin Belousov wrote: > On Wed, Apr 19, 2017 at 02:09:58PM +1000, Bruce Evans wrote: >> On Tue, 18 Apr 2017, Alan Somers wrote: >> >>> On Mon, Apr 17, 2017 at 11:34 AM, Gleb Smirnoff wrote: >> >>>> head/usr.bin/top/machine.c >>>> head/usr.bin/vmstat/vmstat.c >> >> The previous 2 lines turn out to be relevant. I missed the update to >> vmstat and checked a wrong version in my bug report described below >> I checked an updated top, but the change seemed too small to help. >> systat was not updated. >> >>> This change broke backwards compatibility with old top binaries. When >>> I use a kernel at version 317094 but a top from 14-April, I get the >>> error "top: sysctl(vm.stats.vm.v_swappgsin...) failed: Cannot allocate >>> memory". I get the same error when running top from an 11.0-RELEASE >>> jail. Can you please add backward compatibility shims? >> >> I sent a much longer (30 times longer) bug report to the author of the >> bug. >> >> Most or all statistics utilities that use vmmeter are broken. vmstat >> is too broken to even notice the bug -- it silently ignores the error, >> an has type errors which prevent other errors which it doesn't ignore. >> The result is silently truncating to 32 bits, like a quick fix would >> do intentionally. systat -v detects the errors but prints warning >> messages to the status line where they overwrite each other so make >> the problem look smaller than it is. The result is unsilently >> truncating to 32 bits. >> >> I've never seen any backwards compatibility shims added for sysctls. >> None should be needed, but there are few or no utilities other than >> sysctl(8) which use sysctl(3) in a portable way. > See vfs.bufspace handled by vfs_bio.c:sysctl_bufspace(). Ugh. My fix for this continues to work fine. It handles about 162 combinations of integer sizes/signedness for all sysctls in not much more space than sysctl_bufspace(). Unfortunately, the full version breaks the API slightly (it even breaks sysctl(8)), and the dumbed down version causes problems although it technically doesn't change the API. sysctl_bufspace() also changes the API slightly, much like my dumbed down version. This tends to break probes. > In fact, not only top and vmstat are broken. Quite unexpected and > worrying, reboot(8) is broken as well. This is due to get_pageins() > failing and system stopping userspace much earlier than it is desirable. > > I now believe that compat shims to handle int-sized vmstat queries are > required. Here are my current versions and a test program (mainly for old design and implementation bugs with short reads and writes). XX Index: kern_sysctl.c XX =================================================================== XX --- kern_sysctl.c (revision 317604) XX +++ kern_sysctl.c (working copy) This version changes the API too much, and I now use the simpler patch to fix the immediate problem with counters. The full version of it does: - let userland do reads and writes of integers with any size large enough to hold the value - new errno EOVERFLOW for userland sizes that are not large enough. This replaces ENOMEM in most cases for integer sysctls. Only oldlen = 0 should mean to probe. - new errno EOVERFLOW for kernel sizes that are not large enough. Be more careful not to write anything if the kernel size is not large enough. The previous errno for this is EINVAL. - it is no longer very fragile to read with a type larger than the kernel type. The kernel expands to the requested size. This used to be a non-error with garbage in the bits after the end of the unexpanded kernel size. - it is now possible to write with a type smaller than the kernel type. The kernel expands to its size. The case is documented to fail with EINVAL, and works as documented IIRC. - it is now possible to write correctly with a type larger than the kernel type, provided the value fits. The case is documented to fail with EINVAL, but IIRC it is the case that has been broken for almost 20 years. Usually, the bug is harmless since the value fits (due to are 0's or 1's in the unwritten top bits). The dumbed down version keeps ENOMEM instead of EOVERFLOW, and doesn't allow all combinations of sizes. For the counter ABI change, the case where the userland variable is smaller must be supported for reading, and the opposite is not needed yet. I forget what happens for writing. XX @@ -1344,6 +1344,302 @@ XX return (error); XX } XX XX +int sysctl_uicvt(const void *src, size_t srclen, void *dst, size_t dstlen); XX +int XX +sysctl_uicvt(const void *src, size_t srclen, void *dst, size_t dstlen) XX +{ XX + uintmax_t val, valtrunc; XX + uint64_t val64; XX + uint32_t val32; XX + uint16_t val16; XX + uint8_t val8; XX + XX + if (dstlen > sizeof(uintmax_t)) XX + dstlen = sizeof(uintmax_t); XX + if (dstlen > srclen) XX + dstlen = srclen; The conversion functions are trivial, but not as small or as fast as they could be. In most case, no conversion is needed. These dstlen adjustments are dumbing down. The first one is mainly to reduce the number of cases, but is not quite write. Suppose that the userland uintmax_t is larger than the kernel's, or userland is reading into a large u_char array or struct for some reason. Then reducing dstlen to sizeof(uintmax_t) gives garbage after the end of a uintmax_t, the same as in the current API. The second one loses the size adjustment in 1 direction -- see below. This is complicated and perhaps buggy because it tries to support both directions in userland <-> kernel in shared code. XX + switch (srclen) { XX + case 1: XX + val = *(const int8_t *)src; XX + break; XX + case 2: XX + val = *(const int16_t *)src; XX + break; XX + case 4: XX + val = *(const int32_t *)src; XX + break; XX + case 8: XX + val = *(const int64_t *)src; XX + break; XX + default: XX + bcopy(src, dst, MIN(srclen, dstlen)); XX + return (srclen); XX + } XX + XX + switch (dstlen) { XX + case 1: XX + valtrunc = val8 = val; XX + src = &val8; XX + break; XX + case 2: XX + valtrunc = val16 = val; XX + src = &val16; XX + break; XX + case 4: XX + valtrunc = val32 = val; XX + src = &val32; XX + break; XX + case 8: XX + valtrunc = val64 = val; XX + src = &val64; XX + break; XX + default: XX + valtrunc = val - 1; XX + break; XX + } XX + if (valtrunc != val) { XX + if (dstlen != 0) XX + printf("val %#jx, valtrunc %#jx\n", val, valtrunc); XX + bcopy(src, dst, dstlen); XX + return (srclen); XX + } else { XX + bcopy(src, dst, dstlen); XX + return (dstlen); XX + } XX +} XX + XX +/* Output a signed integer if possible. */ XX +static int XX +sysctl_out_i(struct sysctl_req *req, intmax_t val, size_t kernlen) XX +{ XX + size_t len; XX + intmax_t valtrunc; XX + int64_t val64; XX + int32_t val32; XX + int16_t val16; XX + int8_t val8; XX + int error; XX + XX + len = req->oldlen != 0 ? req->oldlen : kernlen; XX + /* XX + * XXX: sysctl(8) determines the correct length, but then twee-ly XX + * doubles it, so we can't tell the application's integer size. XX + * If we supplied the doubled length (as is possible up to size 4), XX + * then sysctl(8) would treat the result as an array. XX + * XX + * Work around this by only supplying the default length if that XX + * fits. This restores the original broken behaviour of not XX + * extending, so applications get garbage in the top bits if they XX + * use a larger integer size. XX + */ XX + if (len > kernlen) XX + len = kernlen; See the comment. Without this hack, sysctl(8) prints most variables as "v 0", where v is the correct output, because it sees int as [u_]int[2]. Statistics utilities are not as "smart" as sysctl, so they kept seeing plain [u_]int, as intended for the counter variables which became uint64_t. XX + switch (len) { XX + case 1: XX + valtrunc = val8 = val; XX + error = SYSCTL_OUT(req, &val8, 1); XX + break; XX + case 2: XX + valtrunc = val16 = val; XX + error = SYSCTL_OUT(req, &val16, 2); XX + break; XX + case 4: XX + valtrunc = val32 = val; XX + error = SYSCTL_OUT(req, &val32, 4); XX + break; XX + case 8: XX + valtrunc = val64 = val; XX + error = SYSCTL_OUT(req, &val64, 8); XX + break; XX + default: XX + /* XXX: not quite compat; should convert back to kernel type. */ XX + return (SYSCTL_OUT(req, &val, sizeof(val))); XX + } XX + if (valtrunc != val && error == 0) { XX + printf("val %#jx, valtrunc %#jx\n", val, valtrunc); XX + error = ENOMEM; /* should be EOVERFLOW */ XX + } XX + return (error); XX +} XX + XX +/* Output an usigned integer if possible. */ XX +static int XX +sysctl_out_ui(struct sysctl_req *req, uintmax_t val, size_t kernlen) XX +{ XX + size_t len; XX + uintmax_t valtrunc; XX + uint64_t val64; XX + uint32_t val32; XX + uint16_t val16; XX + uint8_t val8; XX + int error; XX + XX + len = req->oldlen != 0 ? req->oldlen : kernlen; XX + if (len > kernlen) XX + len = kernlen; XX + switch (len) { XX + case 1: XX + valtrunc = val8 = val; XX + error = SYSCTL_OUT(req, &val8, 1); XX + break; XX + case 2: XX + valtrunc = val16 = val; XX + error = SYSCTL_OUT(req, &val16, 2); XX + break; XX + case 4: XX + valtrunc = val32 = val; XX + error = SYSCTL_OUT(req, &val32, 4); XX + break; XX + case 8: XX + valtrunc = val64 = val; XX + error = SYSCTL_OUT(req, &val64, 8); XX + break; XX + default: XX + return (SYSCTL_OUT(req, &val, sizeof(val))); XX + } XX + if (valtrunc != val && error == 0) { XX + printf("val %#jx, valtrunc %#jx\n", val, valtrunc); XX + error = ENOMEM; /* should be EOVERFLOW */ XX + } XX + return (error); XX +} XX + XX +/* Input a signed integer if possible. */ XX +static int XX +sysctl_in_i(struct sysctl_req *req, void *valp, size_t kernlen) XX +{ XX + intmax_t val; XX + int64_t val64; XX + int32_t val32; XX + int16_t val16; XX + int8_t val8; XX + int error; XX + XX + switch (req->newlen) { XX + case 1: XX + error = SYSCTL_IN(req, &val8, 1); XX + val = val8; XX + break; XX + case 2: XX + error = SYSCTL_IN(req, &val16, 2); XX + val = val16; XX + break; XX + case 4: XX + error = SYSCTL_IN(req, &val32, 4); XX + val = val32; XX + break; XX + case 8: XX + error = SYSCTL_IN(req, &val64, 8); XX + val = val64; XX + break; XX + default: XX + /* Only kernel lengths are supported; we hard-code {1,2,4,8}. */ XX + error = EINVAL; XX + break; XX + } XX + if (error != 0) XX + return (error); XX + XX + switch (kernlen) { XX + case 1: XX + if ((int8_t)val == val) XX + *(int8_t *)valp = val; XX + else XX + error = EINVAL; /* should be EOVERFLOW everywhere */ XX + break; XX + case 2: XX + if ((int16_t)val == val) XX + *(int16_t *)valp = val; XX + else XX + error = EINVAL; XX + break; XX + case 4: XX + if ((int32_t)val == val) XX + *(int32_t *)valp = val; XX + else XX + error = EINVAL; XX + break; XX + case 8: XX + if ((uint64_t)val == val) XX + *(uint64_t *)valp = val; XX + else XX + error = EINVAL; XX + default: XX + error = EDOOFUS; XX + break; XX + } XX + return (error); XX +} XX + XX +/* Input an unsigned integer if possible. */ XX +static int XX +sysctl_in_ui(struct sysctl_req *req, void *valp, size_t kernlen) XX +{ XX + uintmax_t val; XX + uint64_t val64; XX + uint32_t val32; XX + uint16_t val16; XX + uint8_t val8; XX + int error; XX + XX + switch (req->newlen) { XX + case 1: XX + error = SYSCTL_IN(req, &val8, 1); XX + val = val8; XX + break; XX + case 2: XX + error = SYSCTL_IN(req, &val16, 2); XX + val = val16; XX + break; XX + case 4: XX + error = SYSCTL_IN(req, &val32, 4); XX + val = val32; XX + break; XX + case 8: XX + default: XX + if (req->newlen == sizeof(val)) XX + error = SYSCTL_IN(req, &val, sizeof(val)); XX + else if (req->newlen == 8) { XX + error = SYSCTL_IN(req, &val64, 8); XX + val = val64; XX + } else XX + error = EINVAL; XX + break; XX + } XX + if (error != 0) XX + return (error); XX + XX + switch (kernlen) { XX + case 1: XX + if ((uint8_t)val == val) XX + *(uint8_t *)valp = val; XX + else XX + error = EINVAL; XX + break; XX + case 2: XX + if ((uint16_t)val == val) XX + *(uint16_t *)valp = val; XX + else XX + error = EINVAL; XX + break; XX + case 4: XX + if ((uint32_t)val == val) XX + *(uint32_t *)valp = val; XX + else XX + error = EINVAL; XX + break; XX + case 8: XX + if ((uint64_t)val == val) XX + *(uint64_t *)valp = val; XX + else XX + error = EINVAL; XX + break; XX + default: XX + error = EDOOFUS; XX + } XX + return (error); XX +} XX + XX /* XX * Handle an int, signed or unsigned. XX * Two cases: XX @@ -1354,24 +1650,35 @@ XX int XX sysctl_handle_int(SYSCTL_HANDLER_ARGS) XX { XX - int tmpout, error = 0; XX + int error; XX XX - /* XX - * Attempt to get a coherent snapshot by making a copy of the data. XX - */ XX - if (arg1) XX - tmpout = *(int *)arg1; XX - else XX - tmpout = arg2; XX - error = SYSCTL_OUT(req, &tmpout, sizeof(int)); XX + switch (oidp->oid_kind & CTLTYPE) { XX + case CTLTYPE_UINT: XX + error = sysctl_out_ui(req, XX + arg1 != NULL ? *(u_int *)arg1 : arg2, sizeof(u_int)); XX + break; XX + case CTLTYPE_INT: XX + default: XX + error = sysctl_out_i(req, XX + arg1 != NULL ? *(int *)arg1 : arg2, sizeof(int)); XX + break; XX + } XX XX if (error || !req->newptr) XX return (error); XX XX if (!arg1) XX - error = EPERM; XX - else XX - error = SYSCTL_IN(req, arg1, sizeof(int)); XX + return (EPERM); XX + XX + switch (oidp->oid_kind & CTLTYPE) { XX + case CTLTYPE_UINT: XX + error = sysctl_in_ui(req, arg1, sizeof(int)); XX + break; XX + case CTLTYPE_INT: XX + default: XX + error = sysctl_in_i(req, arg1, sizeof(int)); XX + break; XX + } XX return (error); XX } I only fixed sysctl_handle_int(), including style bugs and its type puns for u_int. All of the integer handling functions should be in this one, with the case statement expanded in the obvious way. XX XX Index: subr_counter.c XX =================================================================== XX --- subr_counter.c (revision 317604) XX +++ subr_counter.c (working copy) XX @@ -78,11 +78,15 @@ XX sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS) XX { XX uint64_t out; XX + uint32_t out32; XX int error; XX XX out = counter_u64_fetch(*(counter_u64_t *)arg1); XX XX - error = SYSCTL_OUT(req, &out, sizeof(uint64_t)); XX + if (req->oldlen == 4 && (out32 = out) == out) XX + error = SYSCTL_OUT(req, &out32, sizeof(out32)); XX + else XX + error = SYSCTL_OUT(req, &out, sizeof(out)); XX XX if (error || !req->newptr) XX return (error); This does the minimum necessary to fix the current problem. This works until the counters become too large for a u_int. There could be an option to get truncation with no error, but that would require an API change, so applications should be required to do the truncation for themself if that is what they want. "Smart" applications are still broken by the above. They might have support for reading with 64 bit sizes, but probe with 32-bit sizes. Then the above will succeed early, but later when the counters overflow the sysctl will start failing. It fails with the old errno of ENOMEM, so the "smart" applications should start using 64 bit sizes, but it might assume that the initial sizing is enough for integers. After all, the size of an integer can't change in the kernel while the kernel is running, and the API tacitly implies returning actual kernel integers and not their representation in any convenient smaller type. Test program. It tests mainly for old bugs involving no errors for short reads and writes. After the API change, these non-errors become correct. YY #include YY #include YY YY #include YY #include YY #include YY #include YY YY #define TESTMIB "vfs.ffs.doasyncfree" YY YY /* Use for initialization and later tests. */ YY static void YY get(int32_t *oldvalp) YY { YY size_t oldlen; YY YY oldlen = sizeof(*oldvalp); YY if (sysctlbyname(TESTMIB, oldvalp, &oldlen, NULL, 0) != 0) YY err(1, "basic: read failed"); YY /* YY * It is currently difficult to find the correct size/type to use. YY * Assume that the size is 32 bits here since the focus is not quite YY * on the design errors behind that, and we want to do a safe null YY * change to the MIB (the kernel variable should be a bool or a YY * 1-bit bit-field, and we should be able to set it to 0 or 1 but YY * no other values using any integer type (but not a bit-field). YY */ YY if (oldlen != sizeof(*oldvalp)) YY err(1, "basic: size mismatch"); YY } YY YY /* Use for initial test and unclobber. */ YY static void YY set(int32_t newval) YY { YY size_t newlen; YY YY newlen = sizeof(newval); YY if (sysctlbyname(TESTMIB, NULL, NULL, &newval, YY newlen) != 0) YY err(1, "basic: write failed"); YY } YY YY int YY main(void) YY { YY size_t newlen, oldlen; YY int64_t longnewval, longoldval; YY int32_t oldval, origval; YY int16_t shortnewval, shortoldval; YY int error; YY YY /* Normal operation. */ YY get(&origval); YY set(origval); YY warnx("basic: passed: val %d", origval); YY YY /* Long read. No bugs expected. Just design errors. */ YY shortoldval = ~origval; YY oldlen = sizeof(shortoldval); YY error = sysctlbyname(TESTMIB, &shortoldval, &oldlen, NULL, 0); YY if (error == 0 && shortoldval == origval) YY warnx("long read: unexpectedly worked right"); YY else if (error == 0) YY warnx("long read: unexpectedly succeeded, but gave garbage"); YY else if (errno != ENOMEM) YY warn("long read: failed with unexpected errno"); YY else YY warnx("long read: passed"); YY YY /* Short read. No bugs expected. Just design errors. */ YY longoldval = ~origval; YY oldlen = sizeof(longoldval); YY error = sysctlbyname(TESTMIB, &longoldval, &oldlen, NULL, 0); YY if (error != 0) YY warn("short read: failed"); YY else if (longoldval != origval) YY warnx("short read: passed: garbage in top bits as expected"); YY else if (oldlen == sizeof(longoldval) && longoldval == origval) YY warnx("short read: unexpectedly worked right"); YY else YY warnx("short read: succeeded with right val but wrong length"); YY YY /* Long write. Expect success with top bits not written (broken). */ YY longnewval = 0x100000666; /* unrepresentable */ YY newlen = sizeof(longnewval); YY error = sysctlbyname(TESTMIB, NULL, NULL, &longnewval, newlen); YY get(&oldval); YY if (error != 0 && errno == EINVAL) YY warnx("long write: unexpectedly unbroken (failed with EINVAL)"); YY else if (error == 0 && oldval == 0x666) YY warnx("long write: broken as expected (success and value)"); YY else if (error == 0) YY warnx("long write: more broken than expected (succ. and !val)"); YY else YY warn("long write: failed with unexpected errno"); YY if (oldval == origval) YY warnx("long write: preserved value"); YY else if (oldval == longnewval) YY warnx("long write: set value correctly (impossible)"); YY else YY warnx("long write: clobbered value"); YY set(origval); YY YY /* Another case for long write. */ YY longnewval = -1; /* representable assuming signed */ YY newlen = sizeof(longnewval); YY error = sysctlbyname(TESTMIB, NULL, NULL, &longnewval, newlen); YY get(&oldval); YY if (error != 0 && errno == EINVAL) YY warnx("long write: unexpectedly unbroken (failed with EINVAL)"); YY else if (error == 0 && oldval == longnewval) YY warnx("long write: broken as expected, or working"); YY else if (error == 0) YY warnx("long write: more broken than expected (succ. and !val)"); YY else YY warn("long write: failed with unexpected errno"); YY if (oldval == origval) YY warnx("long write: preserved value"); YY else if (oldval == longnewval) YY warnx("long write: set value correctly"); YY else YY warnx("long write: clobbered value"); YY set(origval); YY YY /* Short write. No bugs expected. Just design errors. */ YY shortnewval = origval + 1; YY newlen = sizeof(shortnewval); YY error = sysctlbyname(TESTMIB, NULL, NULL, &shortnewval, newlen); YY get(&oldval); YY if (error == 0 && oldval == shortnewval) YY warnx("short write: unexpectedly worked"); YY else if (error == 0) YY warnx("short write: unexpectedly succeed but set garbage"); YY else if (errno != EINVAL) YY warn("short write: failed with unexpected errno"); YY else YY warnx("short write: passed"); YY if (oldval == origval) YY warnx("short write: preserved value"); YY else if (oldval == shortnewval) YY warnx("short write: set value correctly"); YY else YY warnx("short write: clobbered value"); YY set(origval); YY return (0); YY } Bruce From owner-svn-src-all@freebsd.org Mon May 1 12:25:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B4A7D58CF0; Mon, 1 May 2017 12:25:38 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D509922; Mon, 1 May 2017 12:25:38 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v41CPbPX043211; Mon, 1 May 2017 12:25:37 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41CPbA6043210; Mon, 1 May 2017 12:25:37 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201705011225.v41CPbA6043210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Mon, 1 May 2017 12:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317645 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 12:25:38 -0000 Author: dchagin Date: Mon May 1 12:25:37 2017 New Revision: 317645 URL: https://svnweb.freebsd.org/changeset/base/317645 Log: Fix NULL pointer dereference in futex_wake_op() in case when the same address specified for arguments uaddr and uaddr2. PR: 218987 Reported by: luke.tw gmail MFC after: 1 week Modified: head/sys/compat/linux/linux_futex.c Modified: head/sys/compat/linux/linux_futex.c ============================================================================== --- head/sys/compat/linux/linux_futex.c Mon May 1 10:12:59 2017 (r317644) +++ head/sys/compat/linux/linux_futex.c Mon May 1 12:25:37 2017 (r317645) @@ -952,6 +952,11 @@ retry1: args->uaddr, args->val, args->uaddr2, args->val3, args->timeout); + if (args->uaddr == args->uaddr2) { + LIN_SDT_PROBE1(futex, linux_sys_futex, return, EINVAL); + return (EINVAL); + } + retry2: error = futex_get(args->uaddr, NULL, &f, flags | FUTEX_DONTLOCK); if (error) { @@ -959,9 +964,7 @@ retry2: return (error); } - if (args->uaddr != args->uaddr2) - error = futex_get(args->uaddr2, NULL, &f2, - flags | FUTEX_DONTLOCK); + error = futex_get(args->uaddr2, NULL, &f2, flags | FUTEX_DONTLOCK); if (error) { futex_put(f, NULL); From owner-svn-src-all@freebsd.org Mon May 1 12:41:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F86DD581F3; Mon, 1 May 2017 12:41:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1CA22156; Mon, 1 May 2017 12:41:12 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v41CfBQF048444; Mon, 1 May 2017 12:41:11 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41CfBpt048442; Mon, 1 May 2017 12:41:11 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201705011241.v41CfBpt048442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 1 May 2017 12:41:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317646 - stable/11/lib/libc/tests/string X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 12:41:12 -0000 Author: bapt Date: Mon May 1 12:41:10 2017 New Revision: 317646 URL: https://svnweb.freebsd.org/changeset/base/317646 Log: MFC r302920 Add a regression test to make sure the Russian collation is actually working when importing collation support from Dragonfly/Illumos amdmi3@ tested the collation branch and reported an issue with Russian collation. John Marino fixed the issue in Dragonfly and I merged it back to FreeBSD. Now that Illumos is working on merging our fixes they (Lauri Tirkkonen) found issues with the commit that fixes the russian collation in UTF-8 that resulted in a crash with strxfrm(3) and the ISO-8859-5 locale (fixed in FreeBSD r302916). This small test was written to ensure we do not bring back the old issue with russian collation while fixing the other issue. Added: stable/11/lib/libc/tests/string/wcscoll_test.c - copied unchanged from r302920, head/lib/libc/tests/string/wcscoll_test.c Modified: stable/11/lib/libc/tests/string/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/tests/string/Makefile ============================================================================== --- stable/11/lib/libc/tests/string/Makefile Mon May 1 12:25:37 2017 (r317645) +++ stable/11/lib/libc/tests/string/Makefile Mon May 1 12:41:10 2017 (r317646) @@ -6,6 +6,7 @@ ATF_TESTS_C+= stpncpy_test ATF_TESTS_C+= strerror2_test ATF_TESTS_C+= wcscasecmp_test ATF_TESTS_C+= wcsnlen_test +ATF_TESTS_C+= wcscoll_test # TODO: popcount, stresep Copied: stable/11/lib/libc/tests/string/wcscoll_test.c (from r302920, head/lib/libc/tests/string/wcscoll_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/lib/libc/tests/string/wcscoll_test.c Mon May 1 12:41:10 2017 (r317646, copy of r302920, head/lib/libc/tests/string/wcscoll_test.c) @@ -0,0 +1,63 @@ +/*- + * Copyright (c) 2016 Baptiste Daroussin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include + +static int +cmp(const void *a, const void *b) +{ + const wchar_t wa[2] = { *(const wchar_t *)a, 0 }; + const wchar_t wb[2] = { *(const wchar_t *)b, 0 }; + + return (wcscoll(wa, wb)); +} + +ATF_TC_WITHOUT_HEAD(russian_collation); +ATF_TC_BODY(russian_collation, tc) +{ + wchar_t c[] = L"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÐÐБВГДЕЖЗИЙКЛМÐОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрÑтуфхцчшщъыьÑÑŽÑÑ‘"; + wchar_t res[] = L"aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZаÐбБвВгГдДеЕёÐжЖзЗиИйЙкКлЛмМнÐоОпПрРÑСтТуУфФхХцЦчЧшШщЩъЪыЫьЬÑЭюЮÑЯ"; + + ATF_CHECK_MSG(setlocale(LC_ALL, "ru_RU.UTF-8") != NULL, + "Fail to set locale to \"ru_RU.UTF-8\""); + qsort(c, wcslen(c), sizeof(wchar_t), cmp); + ATF_CHECK_MSG(wcscmp(c, res) == 0, + "Bad collation, expected: '%ls' got '%ls'", res, c); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, russian_collation); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Mon May 1 12:42:07 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E05A8D5827C; Mon, 1 May 2017 12:42:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD5BF36E; Mon, 1 May 2017 12:42:07 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v41Cg68k049258; Mon, 1 May 2017 12:42:06 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41Cg6aD049256; Mon, 1 May 2017 12:42:06 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201705011242.v41Cg6aD049256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 1 May 2017 12:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317647 - in stable/11/lib/libc: string tests/string X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 12:42:08 -0000 Author: bapt Date: Mon May 1 12:42:06 2017 New Revision: 317647 URL: https://svnweb.freebsd.org/changeset/base/317647 Log: MFC r317034: Fix strcoll_l disagreeing with strxfrm by reworking the forward order case in wcscoll_l(). Illumos fixed this while grabbing back our patches: https://www.illumos.org/rb/r/402/ This does not 100% fix what postgresql folks reported as there is still a remaining issue: https://www.illumos.org/issues/7962, it improves the situation The initial issue was reported in postgresql mailing lists: https://www.postgresql.org/message-id/flat/111D0E27-A8F3-4A84-A4E0-B0FB703863DF@s24.com#111D0E27-A8F3-4A84-A4E0-B0FB703863DF@s24.com Submitted by: Yuri Pankov Obtained from: Illumos Modified: stable/11/lib/libc/string/wcscoll.c stable/11/lib/libc/tests/string/wcscoll_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/string/wcscoll.c ============================================================================== --- stable/11/lib/libc/string/wcscoll.c Mon May 1 12:41:10 2017 (r317646) +++ stable/11/lib/libc/string/wcscoll.c Mon May 1 12:42:06 2017 (r317647) @@ -1,5 +1,5 @@ /*- - * Copyright 2010 Nexenta Systems, Inc. All rights reserved. + * Copyright 2017 Nexenta Systems, Inc. * Copyright (c) 2002 Tim J. Robbins * All rights reserved. * @@ -42,22 +42,22 @@ __FBSDID("$FreeBSD$"); int wcscoll_l(const wchar_t *ws1, const wchar_t *ws2, locale_t locale) { - int len1, len2, pri1, pri2, ret; + int len1, len2, pri1, pri2; wchar_t *tr1 = NULL, *tr2 = NULL; int direc, pass; + int ret = wcscmp(ws1, ws2); FIX_LOCALE(locale); struct xlocale_collate *table = (struct xlocale_collate*)locale->components[XLC_COLLATE]; - if (table->__collate_load_error) - /* - * Locale has no special collating order or could not be - * loaded, do a fast binary comparison. - */ - return (wcscmp(ws1, ws2)); + if (table->__collate_load_error || ret == 0) + return (ret); - ret = 0; + if (*ws1 == 0 && *ws2 != 0) + return (-1); + if (*ws1 != 0 && *ws2 == 0) + return (1); /* * Once upon a time we had code to try to optimize this, but @@ -77,19 +77,19 @@ wcscoll_l(const wchar_t *ws1, const wcha const int32_t *st2 = NULL; const wchar_t *w1 = ws1; const wchar_t *w2 = ws2; - int check1, check2; /* special pass for UNDEFINED */ if (pass == table->info->directive_count) { - direc = DIRECTIVE_FORWARD | DIRECTIVE_UNDEFINED; + direc = DIRECTIVE_FORWARD; } else { direc = table->info->directive[pass]; } if (direc & DIRECTIVE_BACKWARD) { wchar_t *bp, *fp, c; + free(tr1); if ((tr1 = wcsdup(w1)) == NULL) - goto fail; + goto end; bp = tr1; fp = tr1 + wcslen(tr1) - 1; while (bp < fp) { @@ -97,8 +97,9 @@ wcscoll_l(const wchar_t *ws1, const wcha *bp++ = *fp; *fp-- = c; } + free(tr2); if ((tr2 = wcsdup(w2)) == NULL) - goto fail; + goto end; bp = tr2; fp = tr2 + wcslen(tr2) - 1; while (bp < fp) { @@ -111,6 +112,7 @@ wcscoll_l(const wchar_t *ws1, const wcha } if (direc & DIRECTIVE_POSITION) { + int check1, check2; while (*w1 && *w2) { pri1 = pri2 = 0; check1 = check2 = 1; @@ -120,7 +122,7 @@ wcscoll_l(const wchar_t *ws1, const wcha &pri1, pass, &st1); if (pri1 < 0) { errno = EINVAL; - goto fail; + goto end; } if (!pri1) { pri1 = COLLATE_MAX_PRIORITY; @@ -133,7 +135,7 @@ wcscoll_l(const wchar_t *ws1, const wcha &pri2, pass, &st2); if (pri2 < 0) { errno = EINVAL; - goto fail; + goto end; } if (!pri2) { pri2 = COLLATE_MAX_PRIORITY; @@ -149,58 +151,64 @@ wcscoll_l(const wchar_t *ws1, const wcha w1 += len1; w2 += len2; } + if (!*w1) { + if (*w2) { + ret = -(int)*w2; + goto end; + } + } else { + ret = *w1; + goto end; + } } else { - while (*w1 && *w2) { - pri1 = pri2 = 0; - check1 = check2 = 1; - while ((pri1 == pri2) && (check1 || check2)) { - while (check1 && *w1) { - _collate_lookup(table, w1, - &len1, &pri1, pass, &st1); - if (pri1 > 0) - break; - if (pri1 < 0) { - errno = EINVAL; - goto fail; - } - st1 = NULL; - w1 += 1; + int vpri1 = 0, vpri2 = 0; + while (*w1 || *w2 || st1 || st2) { + pri1 = 1; + while (*w1 || st1) { + _collate_lookup(table, w1, &len1, &pri1, + pass, &st1); + w1 += len1; + if (pri1 > 0) { + vpri1++; + break; } - check1 = (st1 != NULL); - while (check2 && *w2) { - _collate_lookup(table, w2, - &len2, &pri2, pass, &st2); - if (pri2 > 0) - break; - if (pri2 < 0) { - errno = EINVAL; - goto fail; - } - st2 = NULL; - w2 += 1; + + if (pri1 < 0) { + errno = EINVAL; + goto end; } - check2 = (st2 != NULL); - if (!pri1 || !pri2) + st1 = NULL; + } + pri2 = 1; + while (*w2 || st2) { + _collate_lookup(table, w2, &len2, &pri2, + pass, &st2); + w2 += len2; + if (pri2 > 0) { + vpri2++; break; + } + if (pri2 < 0) { + errno = EINVAL; + goto end; + } + st2 = NULL; } - if (!pri1 || !pri2) + if ((!pri1 || !pri2) && (vpri1 == vpri2)) break; if (pri1 != pri2) { ret = pri1 - pri2; goto end; } - w1 += len1; - w2 += len2; } - } - if (!*w1) { - if (*w2) { - ret = -(int)*w2; + if (vpri1 && !vpri2) { + ret = 1; + goto end; + } + if (!vpri1 && vpri2) { + ret = -1; goto end; } - } else { - ret = *w1; - goto end; } } ret = 0; @@ -210,10 +218,6 @@ end: free(tr2); return (ret); - -fail: - ret = wcscmp(ws1, ws2); - goto end; } int Modified: stable/11/lib/libc/tests/string/wcscoll_test.c ============================================================================== --- stable/11/lib/libc/tests/string/wcscoll_test.c Mon May 1 12:41:10 2017 (r317646) +++ stable/11/lib/libc/tests/string/wcscoll_test.c Mon May 1 12:42:06 2017 (r317647) @@ -1,5 +1,7 @@ /*- * Copyright (c) 2016 Baptiste Daroussin + * Copyright 2016 Tom Lane + * Copyright 2017 Nexenta Systems, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,6 +32,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include @@ -55,9 +59,98 @@ ATF_TC_BODY(russian_collation, tc) "Bad collation, expected: '%ls' got '%ls'", res, c); } +#define NSTRINGS 2000 +#define MAXSTRLEN 20 +#define MAXXFRMLEN (MAXSTRLEN * 20) + +typedef struct { + char sval[MAXSTRLEN]; + char xval[MAXXFRMLEN]; +} cstr; + +ATF_TC_WITHOUT_HEAD(strcoll_vs_strxfrm); +ATF_TC_BODY(strcoll_vs_strxfrm, tc) +{ + cstr data[NSTRINGS]; + char *curloc; + int i, j; + + curloc = setlocale(LC_ALL, "en_US.UTF-8"); + ATF_CHECK_MSG(curloc != NULL, "Fail to set locale"); + + /* Ensure new random() values on every run */ + srandom((unsigned int) time(NULL)); + + /* Generate random UTF8 strings of length less than MAXSTRLEN bytes */ + for (i = 0; i < NSTRINGS; i++) { + char *p; + int len; + +again: + p = data[i].sval; + len = 1 + (random() % (MAXSTRLEN - 1)); + while (len > 0) { + int c; + /* + * Generate random printable char in ISO8859-1 range. + * Bias towards producing a lot of spaces. + */ + + if ((random() % 16) < 3) { + c = ' '; + } else { + do { + c = random() & 0xFF; + } while (!((c >= ' ' && c <= 127) || + (c >= 0xA0 && c <= 0xFF))); + } + + if (c <= 127) { + *p++ = c; + len--; + } else { + if (len < 2) + break; + /* Poor man's utf8-ification */ + *p++ = 0xC0 + (c >> 6); + len--; + *p++ = 0x80 + (c & 0x3F); + len--; + } + } + *p = '\0'; + /* strxfrm() each string as we produce it */ + errno = 0; + ATF_CHECK_MSG(strxfrm(data[i].xval, data[i].sval, + MAXXFRMLEN) < MAXXFRMLEN, "strxfrm() result for %d-length " + " string exceeded %d bytes", (int)strlen(data[i].sval), + MAXXFRMLEN); + + /* + * Amend strxfrm() failing on certain characters to be fixed and + * test later + */ + if (errno != 0) + goto again; + } + + for (i = 0; i < NSTRINGS; i++) { + for (j = 0; j < NSTRINGS; j++) { + int sr = strcoll(data[i].sval, data[j].sval); + int sx = strcmp(data[i].xval, data[j].xval); + + ATF_CHECK_MSG(!((sr * sx < 0) || + (sr * sx == 0 && sr + sx != 0)), + "%s: diff for \"%s\" and \"%s\"", + curloc, data[i].sval, data[j].sval); + } + } +} + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, russian_collation); + ATF_TP_ADD_TC(tp, strcoll_vs_strxfrm); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Mon May 1 12:56:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9907D58BE3; Mon, 1 May 2017 12:56:13 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B985E357; Mon, 1 May 2017 12:56:13 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v41CuCGl058366; Mon, 1 May 2017 12:56:12 GMT (envelope-from jpaetzel@FreeBSD.org) Received: (from jpaetzel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41CuChd058365; Mon, 1 May 2017 12:56:12 GMT (envelope-from jpaetzel@FreeBSD.org) Message-Id: <201705011256.v41CuChd058365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jpaetzel set sender to jpaetzel@FreeBSD.org using -f From: Josh Paetzel Date: Mon, 1 May 2017 12:56:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317648 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 12:56:14 -0000 Author: jpaetzel Date: Mon May 1 12:56:12 2017 New Revision: 317648 URL: https://svnweb.freebsd.org/changeset/base/317648 Log: Fix misport of compressed ZFS send/recv from 317414 Reported by: Michael Jung Reviewed by: avg Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon May 1 12:42:06 2017 (r317647) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon May 1 12:56:12 2017 (r317648) @@ -962,7 +962,7 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui flags |= ZIO_FLAG_DONT_QUEUE; zio = zio_create(pio, spa, txg, bp, NULL, size, - BP_GET_PSIZE(bp), NULL, NULL, ZIO_TYPE_FREE, ZIO_PRIORITY_NOW, + size, NULL, NULL, ZIO_TYPE_FREE, ZIO_PRIORITY_NOW, flags, NULL, 0, NULL, ZIO_STAGE_OPEN, stage); return (zio); From owner-svn-src-all@freebsd.org Mon May 1 15:03:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA0E0D58F2A; Mon, 1 May 2017 15:03:05 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7014390A; Mon, 1 May 2017 15:03:05 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v41F34xc016927; Mon, 1 May 2017 15:03:04 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41F2w6n016858; Mon, 1 May 2017 15:02:58 GMT (envelope-from des@FreeBSD.org) Message-Id: <201705011502.v41F2w6n016858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Mon, 1 May 2017 15:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317649 - in vendor/openpam/dist: . bin bin/openpam_dump_policy bin/pamtest bin/su doc doc/man include include/security lib lib/libpam misc modules modules/pam_deny modules/pam_permit m... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 15:03:05 -0000 Author: des Date: Mon May 1 15:02:58 2017 New Revision: 317649 URL: https://svnweb.freebsd.org/changeset/base/317649 Log: Vendor import of OpenPAM Resedacea. Modified: vendor/openpam/dist/HISTORY vendor/openpam/dist/Makefile.am vendor/openpam/dist/Makefile.in vendor/openpam/dist/RELNOTES vendor/openpam/dist/autogen.sh vendor/openpam/dist/bin/Makefile.am vendor/openpam/dist/bin/Makefile.in vendor/openpam/dist/bin/openpam_dump_policy/Makefile.am vendor/openpam/dist/bin/openpam_dump_policy/Makefile.in vendor/openpam/dist/bin/openpam_dump_policy/openpam_dump_policy.c vendor/openpam/dist/bin/pamtest/Makefile.am vendor/openpam/dist/bin/pamtest/Makefile.in vendor/openpam/dist/bin/pamtest/pamtest.1 vendor/openpam/dist/bin/pamtest/pamtest.c vendor/openpam/dist/bin/su/Makefile.am vendor/openpam/dist/bin/su/Makefile.in vendor/openpam/dist/bin/su/su.1 vendor/openpam/dist/bin/su/su.c vendor/openpam/dist/configure vendor/openpam/dist/configure.ac vendor/openpam/dist/doc/Makefile.am vendor/openpam/dist/doc/Makefile.in vendor/openpam/dist/doc/man/Makefile.am vendor/openpam/dist/doc/man/Makefile.in vendor/openpam/dist/doc/man/openpam.3 vendor/openpam/dist/doc/man/openpam.man vendor/openpam/dist/doc/man/openpam_borrow_cred.3 vendor/openpam/dist/doc/man/openpam_free_data.3 vendor/openpam/dist/doc/man/openpam_free_envlist.3 vendor/openpam/dist/doc/man/openpam_get_feature.3 vendor/openpam/dist/doc/man/openpam_get_option.3 vendor/openpam/dist/doc/man/openpam_log.3 vendor/openpam/dist/doc/man/openpam_nullconv.3 vendor/openpam/dist/doc/man/openpam_readline.3 vendor/openpam/dist/doc/man/openpam_readlinev.3 vendor/openpam/dist/doc/man/openpam_readword.3 vendor/openpam/dist/doc/man/openpam_restore_cred.3 vendor/openpam/dist/doc/man/openpam_set_feature.3 vendor/openpam/dist/doc/man/openpam_set_option.3 vendor/openpam/dist/doc/man/openpam_straddch.3 vendor/openpam/dist/doc/man/openpam_subst.3 vendor/openpam/dist/doc/man/openpam_ttyconv.3 vendor/openpam/dist/doc/man/pam.3 vendor/openpam/dist/doc/man/pam.conf.5 vendor/openpam/dist/doc/man/pam.man vendor/openpam/dist/doc/man/pam_acct_mgmt.3 vendor/openpam/dist/doc/man/pam_authenticate.3 vendor/openpam/dist/doc/man/pam_chauthtok.3 vendor/openpam/dist/doc/man/pam_close_session.3 vendor/openpam/dist/doc/man/pam_conv.3 vendor/openpam/dist/doc/man/pam_end.3 vendor/openpam/dist/doc/man/pam_error.3 vendor/openpam/dist/doc/man/pam_get_authtok.3 vendor/openpam/dist/doc/man/pam_get_data.3 vendor/openpam/dist/doc/man/pam_get_item.3 vendor/openpam/dist/doc/man/pam_get_user.3 vendor/openpam/dist/doc/man/pam_getenv.3 vendor/openpam/dist/doc/man/pam_getenvlist.3 vendor/openpam/dist/doc/man/pam_info.3 vendor/openpam/dist/doc/man/pam_open_session.3 vendor/openpam/dist/doc/man/pam_prompt.3 vendor/openpam/dist/doc/man/pam_putenv.3 vendor/openpam/dist/doc/man/pam_set_data.3 vendor/openpam/dist/doc/man/pam_set_item.3 vendor/openpam/dist/doc/man/pam_setcred.3 vendor/openpam/dist/doc/man/pam_setenv.3 vendor/openpam/dist/doc/man/pam_sm_acct_mgmt.3 vendor/openpam/dist/doc/man/pam_sm_authenticate.3 vendor/openpam/dist/doc/man/pam_sm_chauthtok.3 vendor/openpam/dist/doc/man/pam_sm_close_session.3 vendor/openpam/dist/doc/man/pam_sm_open_session.3 vendor/openpam/dist/doc/man/pam_sm_setcred.3 vendor/openpam/dist/doc/man/pam_start.3 vendor/openpam/dist/doc/man/pam_strerror.3 vendor/openpam/dist/doc/man/pam_verror.3 vendor/openpam/dist/doc/man/pam_vinfo.3 vendor/openpam/dist/doc/man/pam_vprompt.3 vendor/openpam/dist/include/Makefile.am vendor/openpam/dist/include/Makefile.in vendor/openpam/dist/include/security/Makefile.am vendor/openpam/dist/include/security/Makefile.in vendor/openpam/dist/include/security/openpam.h vendor/openpam/dist/include/security/openpam_attr.h vendor/openpam/dist/include/security/openpam_version.h vendor/openpam/dist/include/security/pam_appl.h vendor/openpam/dist/include/security/pam_constants.h vendor/openpam/dist/include/security/pam_modules.h vendor/openpam/dist/include/security/pam_types.h vendor/openpam/dist/lib/Makefile.am vendor/openpam/dist/lib/Makefile.in vendor/openpam/dist/lib/libpam/Makefile.am vendor/openpam/dist/lib/libpam/Makefile.in vendor/openpam/dist/lib/libpam/openpam_asprintf.c vendor/openpam/dist/lib/libpam/openpam_asprintf.h vendor/openpam/dist/lib/libpam/openpam_borrow_cred.c vendor/openpam/dist/lib/libpam/openpam_check_owner_perms.c vendor/openpam/dist/lib/libpam/openpam_configure.c vendor/openpam/dist/lib/libpam/openpam_constants.c vendor/openpam/dist/lib/libpam/openpam_constants.h vendor/openpam/dist/lib/libpam/openpam_cred.h vendor/openpam/dist/lib/libpam/openpam_ctype.h vendor/openpam/dist/lib/libpam/openpam_debug.h vendor/openpam/dist/lib/libpam/openpam_dispatch.c vendor/openpam/dist/lib/libpam/openpam_dlfunc.h vendor/openpam/dist/lib/libpam/openpam_dynamic.c vendor/openpam/dist/lib/libpam/openpam_features.c vendor/openpam/dist/lib/libpam/openpam_features.h vendor/openpam/dist/lib/libpam/openpam_findenv.c vendor/openpam/dist/lib/libpam/openpam_free_data.c vendor/openpam/dist/lib/libpam/openpam_free_envlist.c vendor/openpam/dist/lib/libpam/openpam_get_feature.c vendor/openpam/dist/lib/libpam/openpam_get_option.c vendor/openpam/dist/lib/libpam/openpam_impl.h vendor/openpam/dist/lib/libpam/openpam_load.c vendor/openpam/dist/lib/libpam/openpam_log.c vendor/openpam/dist/lib/libpam/openpam_nullconv.c vendor/openpam/dist/lib/libpam/openpam_readline.c vendor/openpam/dist/lib/libpam/openpam_readlinev.c vendor/openpam/dist/lib/libpam/openpam_readword.c vendor/openpam/dist/lib/libpam/openpam_restore_cred.c vendor/openpam/dist/lib/libpam/openpam_set_feature.c vendor/openpam/dist/lib/libpam/openpam_set_option.c vendor/openpam/dist/lib/libpam/openpam_static.c vendor/openpam/dist/lib/libpam/openpam_straddch.c vendor/openpam/dist/lib/libpam/openpam_strlcat.c vendor/openpam/dist/lib/libpam/openpam_strlcat.h vendor/openpam/dist/lib/libpam/openpam_strlcmp.h vendor/openpam/dist/lib/libpam/openpam_strlcpy.c vendor/openpam/dist/lib/libpam/openpam_strlcpy.h vendor/openpam/dist/lib/libpam/openpam_strlset.c vendor/openpam/dist/lib/libpam/openpam_strlset.h vendor/openpam/dist/lib/libpam/openpam_subst.c vendor/openpam/dist/lib/libpam/openpam_ttyconv.c vendor/openpam/dist/lib/libpam/openpam_vasprintf.c vendor/openpam/dist/lib/libpam/openpam_vasprintf.h vendor/openpam/dist/lib/libpam/pam_acct_mgmt.c vendor/openpam/dist/lib/libpam/pam_authenticate.c vendor/openpam/dist/lib/libpam/pam_authenticate_secondary.c vendor/openpam/dist/lib/libpam/pam_chauthtok.c vendor/openpam/dist/lib/libpam/pam_close_session.c vendor/openpam/dist/lib/libpam/pam_end.c vendor/openpam/dist/lib/libpam/pam_error.c vendor/openpam/dist/lib/libpam/pam_get_authtok.c vendor/openpam/dist/lib/libpam/pam_get_data.c vendor/openpam/dist/lib/libpam/pam_get_item.c vendor/openpam/dist/lib/libpam/pam_get_mapped_authtok.c vendor/openpam/dist/lib/libpam/pam_get_mapped_username.c vendor/openpam/dist/lib/libpam/pam_get_user.c vendor/openpam/dist/lib/libpam/pam_getenv.c vendor/openpam/dist/lib/libpam/pam_getenvlist.c vendor/openpam/dist/lib/libpam/pam_info.c vendor/openpam/dist/lib/libpam/pam_open_session.c vendor/openpam/dist/lib/libpam/pam_prompt.c vendor/openpam/dist/lib/libpam/pam_putenv.c vendor/openpam/dist/lib/libpam/pam_set_data.c vendor/openpam/dist/lib/libpam/pam_set_item.c vendor/openpam/dist/lib/libpam/pam_set_mapped_authtok.c vendor/openpam/dist/lib/libpam/pam_set_mapped_username.c vendor/openpam/dist/lib/libpam/pam_setcred.c vendor/openpam/dist/lib/libpam/pam_setenv.c vendor/openpam/dist/lib/libpam/pam_sm_acct_mgmt.c vendor/openpam/dist/lib/libpam/pam_sm_authenticate.c vendor/openpam/dist/lib/libpam/pam_sm_authenticate_secondary.c vendor/openpam/dist/lib/libpam/pam_sm_chauthtok.c vendor/openpam/dist/lib/libpam/pam_sm_close_session.c vendor/openpam/dist/lib/libpam/pam_sm_get_mapped_authtok.c vendor/openpam/dist/lib/libpam/pam_sm_get_mapped_username.c vendor/openpam/dist/lib/libpam/pam_sm_open_session.c vendor/openpam/dist/lib/libpam/pam_sm_set_mapped_authtok.c vendor/openpam/dist/lib/libpam/pam_sm_set_mapped_username.c vendor/openpam/dist/lib/libpam/pam_sm_setcred.c vendor/openpam/dist/lib/libpam/pam_start.c vendor/openpam/dist/lib/libpam/pam_strerror.c vendor/openpam/dist/lib/libpam/pam_verror.c vendor/openpam/dist/lib/libpam/pam_vinfo.c vendor/openpam/dist/lib/libpam/pam_vprompt.c vendor/openpam/dist/misc/gendoc.pl vendor/openpam/dist/mkpkgng.in vendor/openpam/dist/modules/Makefile.am vendor/openpam/dist/modules/Makefile.in vendor/openpam/dist/modules/pam_deny/Makefile.am vendor/openpam/dist/modules/pam_deny/Makefile.in vendor/openpam/dist/modules/pam_deny/pam_deny.c vendor/openpam/dist/modules/pam_permit/Makefile.am vendor/openpam/dist/modules/pam_permit/Makefile.in vendor/openpam/dist/modules/pam_permit/pam_permit.c vendor/openpam/dist/modules/pam_return/Makefile.am vendor/openpam/dist/modules/pam_return/Makefile.in vendor/openpam/dist/modules/pam_return/pam_return.c vendor/openpam/dist/modules/pam_unix/Makefile.am vendor/openpam/dist/modules/pam_unix/Makefile.in vendor/openpam/dist/modules/pam_unix/pam_unix.c vendor/openpam/dist/t/Makefile.am vendor/openpam/dist/t/Makefile.in vendor/openpam/dist/t/t_openpam_ctype.c vendor/openpam/dist/t/t_openpam_dispatch.c vendor/openpam/dist/t/t_openpam_readlinev.c vendor/openpam/dist/t/t_openpam_readword.c vendor/openpam/dist/t/t_pam_conv.c vendor/openpam/dist/t/t_pam_conv.h Modified: vendor/openpam/dist/HISTORY ============================================================================== --- vendor/openpam/dist/HISTORY Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/HISTORY Mon May 1 15:02:58 2017 (r317649) @@ -1,3 +1,23 @@ +OpenPAM Resedacea 2017-04-30 + + - BUGFIX: Reinstore the NULL check in pam_end(3) which was removed in + OpenPAM Radula, as it breaks common error-handling constructs. + + - BUGFIX: Return PAM_SYMBOL_ERR instead of PAM_SYSTEM_ERR from the + dispatcher when the required service function could not be found. + + - ENHANCE: Introduce the PAM_BAD_HANDLE error code for when pamh is + NULL in API functions that have a NULL check. + + - ENHANCE: Introduce the PAM_BAD_ITEM, PAM_BAD_FEATURE and + PAM_BAD_CONSTANT error codes for situations where we previously + incorrectly used PAM_SYMBOL_ERR to denote that an invalid constant + had been passed to an API function. + + - ENHANCE: Improve the RETURN VALUES section in API man pages, + especially for functions that cannot fail, which were incorrectly + documented as returning -1 on failure. +============================================================================ OpenPAM Radula 2017-02-19 - BUGFIX: Fix an inverted test which prevented pam_get_authtok(3) and Modified: vendor/openpam/dist/Makefile.am ============================================================================== --- vendor/openpam/dist/Makefile.am Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/Makefile.am Mon May 1 15:02:58 2017 (r317649) @@ -1,4 +1,4 @@ -# $Id: Makefile.am 917 2017-02-18 14:45:27Z des $ +# $OpenPAM: Makefile.am 938 2017-04-30 21:34:42Z des $ ACLOCAL_AMFLAGS = -I m4 Modified: vendor/openpam/dist/Makefile.in ============================================================================== --- vendor/openpam/dist/Makefile.in Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/Makefile.in Mon May 1 15:02:58 2017 (r317649) @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.am 917 2017-02-18 14:45:27Z des $ +# $OpenPAM: Makefile.am 938 2017-04-30 21:34:42Z des $ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ @@ -165,7 +165,7 @@ CSCOPE = cscope DIST_SUBDIRS = misc include lib bin modules doc t am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/mkpkgng.in INSTALL README TODO compile config.guess \ - config.sub depcomp install-sh ltmain.sh missing + config.sub install-sh ltmain.sh missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) Modified: vendor/openpam/dist/RELNOTES ============================================================================== --- vendor/openpam/dist/RELNOTES Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/RELNOTES Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ - Release notes for OpenPAM Radula - ================================ + Release notes for OpenPAM Resedacea + =================================== OpenPAM is developed primarily on FreeBSD, but is expected to work on almost any POSIX-like platform that has GNU autotools, GNU make and Modified: vendor/openpam/dist/autogen.sh ============================================================================== --- vendor/openpam/dist/autogen.sh Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/autogen.sh Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ #!/bin/sh # -# $Id: autogen.sh 814 2014-09-12 07:46:46Z des $ +# $OpenPAM: autogen.sh 938 2017-04-30 21:34:42Z des $ # libtoolize --copy --force Modified: vendor/openpam/dist/bin/Makefile.am ============================================================================== --- vendor/openpam/dist/bin/Makefile.am Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/bin/Makefile.am Mon May 1 15:02:58 2017 (r317649) @@ -1,4 +1,4 @@ -# $Id: Makefile.am 907 2017-01-18 09:39:01Z des $ +# $OpenPAM: Makefile.am 938 2017-04-30 21:34:42Z des $ SUBDIRS = openpam_dump_policy Modified: vendor/openpam/dist/bin/Makefile.in ============================================================================== --- vendor/openpam/dist/bin/Makefile.in Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/bin/Makefile.in Mon May 1 15:02:58 2017 (r317649) @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.am 907 2017-01-18 09:39:01Z des $ +# $OpenPAM: Makefile.am 938 2017-04-30 21:34:42Z des $ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ Modified: vendor/openpam/dist/bin/openpam_dump_policy/Makefile.am ============================================================================== --- vendor/openpam/dist/bin/openpam_dump_policy/Makefile.am Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/bin/openpam_dump_policy/Makefile.am Mon May 1 15:02:58 2017 (r317649) @@ -1,4 +1,4 @@ -# $Id: Makefile.am 834 2014-10-28 10:25:58Z des $ +# $OpenPAM: Makefile.am 938 2017-04-30 21:34:42Z des $ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/lib/libpam Modified: vendor/openpam/dist/bin/openpam_dump_policy/Makefile.in ============================================================================== --- vendor/openpam/dist/bin/openpam_dump_policy/Makefile.in Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/bin/openpam_dump_policy/Makefile.in Mon May 1 15:02:58 2017 (r317649) @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.am 834 2014-10-28 10:25:58Z des $ +# $OpenPAM: Makefile.am 938 2017-04-30 21:34:42Z des $ VPATH = @srcdir@ am__is_gnu_make = { \ Modified: vendor/openpam/dist/bin/openpam_dump_policy/openpam_dump_policy.c ============================================================================== --- vendor/openpam/dist/bin/openpam_dump_policy/openpam_dump_policy.c Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/bin/openpam_dump_policy/openpam_dump_policy.c Mon May 1 15:02:58 2017 (r317649) @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: openpam_dump_policy.c 890 2016-01-11 16:22:09Z des $ + * $OpenPAM: openpam_dump_policy.c 938 2017-04-30 21:34:42Z des $ */ #ifdef HAVE_CONFIG_H Modified: vendor/openpam/dist/bin/pamtest/Makefile.am ============================================================================== --- vendor/openpam/dist/bin/pamtest/Makefile.am Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/bin/pamtest/Makefile.am Mon May 1 15:02:58 2017 (r317649) @@ -1,4 +1,4 @@ -# $Id: Makefile.am 834 2014-10-28 10:25:58Z des $ +# $OpenPAM: Makefile.am 938 2017-04-30 21:34:42Z des $ AM_CPPFLAGS = -I$(top_srcdir)/include Modified: vendor/openpam/dist/bin/pamtest/Makefile.in ============================================================================== --- vendor/openpam/dist/bin/pamtest/Makefile.in Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/bin/pamtest/Makefile.in Mon May 1 15:02:58 2017 (r317649) @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.am 834 2014-10-28 10:25:58Z des $ +# $OpenPAM: Makefile.am 938 2017-04-30 21:34:42Z des $ VPATH = @srcdir@ am__is_gnu_make = { \ Modified: vendor/openpam/dist/bin/pamtest/pamtest.1 ============================================================================== --- vendor/openpam/dist/bin/pamtest/pamtest.1 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/bin/pamtest/pamtest.1 Mon May 1 15:02:58 2017 (r317649) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2011 Dag-Erling Smørgrav +.\" Copyright (c) 2011-2017 Dag-Erling Smørgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -26,9 +26,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: pamtest.1 924 2017-02-19 20:52:28Z des $ +.\" $OpenPAM: pamtest.1 939 2017-04-30 21:36:50Z des $ .\" -.Dd February 19, 2017 +.Dd April 30, 2017 .Dt PAMTEST 1 .Os .Sh NAME Modified: vendor/openpam/dist/bin/pamtest/pamtest.c ============================================================================== --- vendor/openpam/dist/bin/pamtest/pamtest.c Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/bin/pamtest/pamtest.c Mon May 1 15:02:58 2017 (r317649) @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: pamtest.c 685 2013-07-11 16:33:34Z des $ + * $OpenPAM: pamtest.c 938 2017-04-30 21:34:42Z des $ */ #ifdef HAVE_CONFIG_H Modified: vendor/openpam/dist/bin/su/Makefile.am ============================================================================== --- vendor/openpam/dist/bin/su/Makefile.am Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/bin/su/Makefile.am Mon May 1 15:02:58 2017 (r317649) @@ -1,4 +1,4 @@ -# $Id: Makefile.am 834 2014-10-28 10:25:58Z des $ +# $OpenPAM: Makefile.am 938 2017-04-30 21:34:42Z des $ AM_CPPFLAGS = -I$(top_srcdir)/include Modified: vendor/openpam/dist/bin/su/Makefile.in ============================================================================== --- vendor/openpam/dist/bin/su/Makefile.in Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/bin/su/Makefile.in Mon May 1 15:02:58 2017 (r317649) @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.am 834 2014-10-28 10:25:58Z des $ +# $OpenPAM: Makefile.am 938 2017-04-30 21:34:42Z des $ VPATH = @srcdir@ am__is_gnu_make = { \ Modified: vendor/openpam/dist/bin/su/su.1 ============================================================================== --- vendor/openpam/dist/bin/su/su.1 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/bin/su/su.1 Mon May 1 15:02:58 2017 (r317649) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2011 Dag-Erling Smørgrav +.\" Copyright (c) 2011-2017 Dag-Erling Smørgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -26,9 +26,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: su.1 924 2017-02-19 20:52:28Z des $ +.\" $OpenPAM: su.1 939 2017-04-30 21:36:50Z des $ .\" -.Dd February 19, 2017 +.Dd April 30, 2017 .Dt SU 1 .Os .Sh NAME Modified: vendor/openpam/dist/bin/su/su.c ============================================================================== --- vendor/openpam/dist/bin/su/su.c Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/bin/su/su.c Mon May 1 15:02:58 2017 (r317649) @@ -32,7 +32,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: su.c 648 2013-03-05 17:54:27Z des $ + * $OpenPAM: su.c 938 2017-04-30 21:34:42Z des $ */ #ifdef HAVE_CONFIG_H Modified: vendor/openpam/dist/configure ============================================================================== --- vendor/openpam/dist/configure Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/configure Mon May 1 15:02:58 2017 (r317649) @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.ac Id: configure.ac 924 2017-02-19 20:52:28Z des . +# From configure.ac OpenPAM: configure.ac 939 2017-04-30 21:36:50Z des . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for OpenPAM 20170219. +# Generated by GNU Autoconf 2.69 for OpenPAM 20170430. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='OpenPAM' PACKAGE_TARNAME='openpam' -PACKAGE_VERSION='20170219' -PACKAGE_STRING='OpenPAM 20170219' +PACKAGE_VERSION='20170430' +PACKAGE_STRING='OpenPAM 20170430' PACKAGE_BUGREPORT='des@des.no' PACKAGE_URL='http://www.openpam.org/' @@ -1345,7 +1345,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures OpenPAM 20170219 to adapt to many kinds of systems. +\`configure' configures OpenPAM 20170430 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1415,7 +1415,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of OpenPAM 20170219:";; + short | recursive ) echo "Configuration of OpenPAM 20170430:";; esac cat <<\_ACEOF @@ -1540,7 +1540,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -OpenPAM configure 20170219 +OpenPAM configure 20170430 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1909,7 +1909,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by OpenPAM $as_me 20170219, which was +It was created by OpenPAM $as_me 20170430, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2774,7 +2774,7 @@ fi # Define the identity of the package. PACKAGE='openpam' - VERSION='20170219' + VERSION='20170430' cat >>confdefs.h <<_ACEOF @@ -13577,7 +13577,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by OpenPAM $as_me 20170219, which was +This file was extended by OpenPAM $as_me 20170430, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13644,7 +13644,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -OpenPAM config.status 20170219 +OpenPAM config.status 20170430 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/openpam/dist/configure.ac ============================================================================== --- vendor/openpam/dist/configure.ac Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/configure.ac Mon May 1 15:02:58 2017 (r317649) @@ -1,8 +1,8 @@ -dnl $Id: configure.ac 924 2017-02-19 20:52:28Z des $ +dnl $OpenPAM: configure.ac 939 2017-04-30 21:36:50Z des $ AC_PREREQ([2.62]) -AC_REVISION([$Id: configure.ac 924 2017-02-19 20:52:28Z des $]) -AC_INIT([OpenPAM], [20170219], [des@des.no], [openpam], [http://www.openpam.org/]) +AC_REVISION([$OpenPAM: configure.ac 939 2017-04-30 21:36:50Z des $]) +AC_INIT([OpenPAM], [20170430], [des@des.no], [openpam], [http://www.openpam.org/]) AC_CONFIG_SRCDIR([lib/libpam/pam_start.c]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([foreign]) Modified: vendor/openpam/dist/doc/Makefile.am ============================================================================== --- vendor/openpam/dist/doc/Makefile.am Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/Makefile.am Mon May 1 15:02:58 2017 (r317649) @@ -1,3 +1,3 @@ -# $Id: Makefile.am 648 2013-03-05 17:54:27Z des $ +# $OpenPAM: Makefile.am 938 2017-04-30 21:34:42Z des $ SUBDIRS = man Modified: vendor/openpam/dist/doc/Makefile.in ============================================================================== --- vendor/openpam/dist/doc/Makefile.in Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/Makefile.in Mon May 1 15:02:58 2017 (r317649) @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.am 648 2013-03-05 17:54:27Z des $ +# $OpenPAM: Makefile.am 938 2017-04-30 21:34:42Z des $ VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ Modified: vendor/openpam/dist/doc/man/Makefile.am ============================================================================== --- vendor/openpam/dist/doc/man/Makefile.am Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/Makefile.am Mon May 1 15:02:58 2017 (r317649) @@ -1,4 +1,4 @@ -# $Id: Makefile.am 907 2017-01-18 09:39:01Z des $ +# $OpenPAM: Makefile.am 938 2017-04-30 21:34:42Z des $ NULL = Modified: vendor/openpam/dist/doc/man/Makefile.in ============================================================================== --- vendor/openpam/dist/doc/man/Makefile.in Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/Makefile.in Mon May 1 15:02:58 2017 (r317649) @@ -14,7 +14,7 @@ @SET_MAKE@ -# $Id: Makefile.am 907 2017-01-18 09:39:01Z des $ +# $OpenPAM: Makefile.am 938 2017-04-30 21:34:42Z des $ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ Modified: vendor/openpam/dist/doc/man/openpam.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,5 +1,5 @@ .\" Generated by gendoc.pl -.Dd February 19, 2017 +.Dd April 30, 2017 .Dt OPENPAM 3 .Os .Sh NAME @@ -81,7 +81,7 @@ .Ft "int" .Fn pam_vprompt "const pam_handle_t *pamh" "int style" "char **resp" "const char *fmt" "va_list ap" .\" -.\" $Id: openpam.man 648 2013-03-05 17:54:27Z des $ +.\" $OpenPAM: openpam.man 938 2017-04-30 21:34:42Z des $ .\" .Sh DESCRIPTION These functions are OpenPAM extensions to the PAM API. Modified: vendor/openpam/dist/doc/man/openpam.man ============================================================================== --- vendor/openpam/dist/doc/man/openpam.man Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam.man Mon May 1 15:02:58 2017 (r317649) @@ -1,5 +1,5 @@ .\" -.\" $Id: openpam.man 648 2013-03-05 17:54:27Z des $ +.\" $OpenPAM: openpam.man 938 2017-04-30 21:34:42Z des $ .\" .Sh DESCRIPTION These functions are OpenPAM extensions to the PAM API. Modified: vendor/openpam/dist/doc/man/openpam_borrow_cred.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_borrow_cred.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_borrow_cred.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_borrow_cred.c by gendoc.pl -.\" $Id: openpam_borrow_cred.c 649 2013-03-05 17:58:33Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_borrow_cred.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_BORROW_CRED 3 .Os .Sh NAME @@ -29,6 +29,8 @@ The .Fn openpam_borrow_cred function returns one of the following values: .Bl -tag -width 18n +.It Bq Er PAM_SUCCESS +Success. .It Bq Er PAM_BUF_ERR Memory buffer error. .It Bq Er PAM_PERM_DENIED Modified: vendor/openpam/dist/doc/man/openpam_free_data.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_free_data.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_free_data.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_free_data.c by gendoc.pl -.\" $Id: openpam_free_data.c 648 2013-03-05 17:54:27Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_free_data.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_FREE_DATA 3 .Os .Sh NAME Modified: vendor/openpam/dist/doc/man/openpam_free_envlist.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_free_envlist.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_free_envlist.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_free_envlist.c by gendoc.pl -.\" $Id: openpam_free_envlist.c 648 2013-03-05 17:54:27Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_free_envlist.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_FREE_ENVLIST 3 .Os .Sh NAME Modified: vendor/openpam/dist/doc/man/openpam_get_feature.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_get_feature.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_get_feature.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_get_feature.c by gendoc.pl -.\" $Id: openpam_get_feature.c 648 2013-03-05 17:54:27Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_get_feature.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_GET_FEATURE 3 .Os .Sh NAME @@ -50,8 +50,10 @@ The .Fn openpam_get_feature function returns one of the following values: .Bl -tag -width 18n -.It Bq Er PAM_SYMBOL_ERR -Invalid symbol. +.It Bq Er PAM_SUCCESS +Success. +.It Bq Er PAM_BAD_FEATURE +Unrecognized or restricted feature. .El .Sh SEE ALSO .Xr openpam_set_feature 3 , Modified: vendor/openpam/dist/doc/man/openpam_get_option.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_get_option.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_get_option.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_get_option.c by gendoc.pl -.\" $Id: openpam_get_option.c 648 2013-03-05 17:54:27Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_get_option.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_GET_OPTION 3 .Os .Sh NAME Modified: vendor/openpam/dist/doc/man/openpam_log.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_log.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_log.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_log.c by gendoc.pl -.\" $Id: openpam_log.c 686 2013-07-11 16:36:02Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_log.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_LOG 3 .Os .Sh NAME Modified: vendor/openpam/dist/doc/man/openpam_nullconv.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_nullconv.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_nullconv.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_nullconv.c by gendoc.pl -.\" $Id: openpam_nullconv.c 648 2013-03-05 17:54:27Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_nullconv.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_NULLCONV 3 .Os .Sh NAME @@ -38,6 +38,8 @@ The .Fn openpam_nullconv function returns one of the following values: .Bl -tag -width 18n +.It Bq Er PAM_SUCCESS +Success. .It Bq Er PAM_CONV_ERR Conversation failure. .El Modified: vendor/openpam/dist/doc/man/openpam_readline.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_readline.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_readline.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_readline.c by gendoc.pl -.\" $Id: openpam_readline.c 703 2013-08-16 11:57:54Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_readline.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_READLINE 3 .Os .Sh NAME Modified: vendor/openpam/dist/doc/man/openpam_readlinev.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_readlinev.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_readlinev.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_readlinev.c by gendoc.pl -.\" $Id: openpam_readlinev.c 890 2016-01-11 16:22:09Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_readlinev.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_READLINEV 3 .Os .Sh NAME Modified: vendor/openpam/dist/doc/man/openpam_readword.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_readword.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_readword.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_readword.c by gendoc.pl -.\" $Id: openpam_readword.c 916 2017-02-07 12:25:58Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_readword.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_READWORD 3 .Os .Sh NAME Modified: vendor/openpam/dist/doc/man/openpam_restore_cred.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_restore_cred.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_restore_cred.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_restore_cred.c by gendoc.pl -.\" $Id: openpam_restore_cred.c 648 2013-03-05 17:54:27Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_restore_cred.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_RESTORE_CRED 3 .Os .Sh NAME @@ -23,6 +23,8 @@ The .Fn openpam_restore_cred function returns one of the following values: .Bl -tag -width 18n +.It Bq Er PAM_SUCCESS +Success. .It Bq Er PAM_NO_MODULE_DATA Module data not found. .It Bq Er PAM_SYSTEM_ERR Modified: vendor/openpam/dist/doc/man/openpam_set_feature.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_set_feature.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_set_feature.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_set_feature.c by gendoc.pl -.\" $Id: openpam_set_feature.c 648 2013-03-05 17:54:27Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_set_feature.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_SET_FEATURE 3 .Os .Sh NAME @@ -32,8 +32,10 @@ The .Fn openpam_set_feature function returns one of the following values: .Bl -tag -width 18n -.It Bq Er PAM_SYMBOL_ERR -Invalid symbol. +.It Bq Er PAM_SUCCESS +Success. +.It Bq Er PAM_BAD_FEATURE +Unrecognized or restricted feature. .El .Sh SEE ALSO .Xr openpam_get_feature 3 , Modified: vendor/openpam/dist/doc/man/openpam_set_option.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_set_option.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_set_option.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_set_option.c by gendoc.pl -.\" $Id: openpam_set_option.c 648 2013-03-05 17:54:27Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_set_option.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_SET_OPTION 3 .Os .Sh NAME @@ -23,6 +23,8 @@ The .Fn openpam_set_option function returns one of the following values: .Bl -tag -width 18n +.It Bq Er PAM_SUCCESS +Success. .It Bq Er PAM_BUF_ERR Memory buffer error. .It Bq Er PAM_SYSTEM_ERR Modified: vendor/openpam/dist/doc/man/openpam_straddch.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_straddch.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_straddch.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_straddch.c by gendoc.pl -.\" $Id: openpam_straddch.c 648 2013-03-05 17:54:27Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_straddch.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_STRADDCH 3 .Os .Sh NAME Modified: vendor/openpam/dist/doc/man/openpam_subst.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_subst.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_subst.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_subst.c by gendoc.pl -.\" $Id: openpam_subst.c 648 2013-03-05 17:54:27Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_subst.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_SUBST 3 .Os .Sh NAME @@ -81,6 +81,10 @@ The .Fn openpam_subst function returns one of the following values: .Bl -tag -width 18n +.It Bq Er PAM_SUCCESS +Success. +.It Bq Er PAM_BAD_ITEM +Unrecognized or restricted item. .It Bq Er PAM_TRY_AGAIN Try again. .El Modified: vendor/openpam/dist/doc/man/openpam_ttyconv.3 ============================================================================== --- vendor/openpam/dist/doc/man/openpam_ttyconv.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/openpam_ttyconv.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from openpam_ttyconv.c by gendoc.pl -.\" $Id: openpam_ttyconv.c 890 2016-01-11 16:22:09Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: openpam_ttyconv.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt OPENPAM_TTYCONV 3 .Os .Sh NAME @@ -32,6 +32,8 @@ The .Fn openpam_ttyconv function returns one of the following values: .Bl -tag -width 18n +.It Bq Er PAM_SUCCESS +Success. .It Bq Er PAM_BUF_ERR Memory buffer error. .It Bq Er PAM_CONV_ERR Modified: vendor/openpam/dist/doc/man/pam.3 ============================================================================== --- vendor/openpam/dist/doc/man/pam.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/pam.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,5 +1,5 @@ .\" Generated by gendoc.pl -.Dd February 19, 2017 +.Dd April 30, 2017 .Dt PAM 3 .Os .Sh NAME @@ -60,7 +60,7 @@ .Ft "const char *" .Fn pam_strerror "const pam_handle_t *pamh" "int error_number" .\" -.\" $Id: pam.man 648 2013-03-05 17:54:27Z des $ +.\" $OpenPAM: pam.man 938 2017-04-30 21:34:42Z des $ .\" .Sh DESCRIPTION The Pluggable Authentication Modules (PAM) library abstracts a number @@ -180,6 +180,14 @@ Authentication token lock busy. Failed to recover old authentication token. .It Bq Er PAM_AUTH_ERR Authentication error. +.It Bq Er PAM_BAD_CONSTANT +Bad constant. +.It Bq Er PAM_BAD_FEATURE +Unrecognized or restricted feature. +.It Bq Er PAM_BAD_HANDLE +Invalid PAM handle. +.It Bq Er PAM_BAD_ITEM +Unrecognized or restricted item. .It Bq Er PAM_BUF_ERR Memory buffer error. .It Bq Er PAM_CONV_ERR Modified: vendor/openpam/dist/doc/man/pam.conf.5 ============================================================================== --- vendor/openpam/dist/doc/man/pam.conf.5 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/pam.conf.5 Mon May 1 15:02:58 2017 (r317649) @@ -1,5 +1,5 @@ .\"- -.\" Copyright (c) 2005-2011 Dag-Erling Smørgrav +.\" Copyright (c) 2005-2017 Dag-Erling Smørgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -26,9 +26,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: pam.conf.5 924 2017-02-19 20:52:28Z des $ +.\" $OpenPAM: pam.conf.5 939 2017-04-30 21:36:50Z des $ .\" -.Dd February 19, 2017 +.Dd April 30, 2017 .Dt PAM.CONF 5 .Os .Sh NAME Modified: vendor/openpam/dist/doc/man/pam.man ============================================================================== --- vendor/openpam/dist/doc/man/pam.man Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/pam.man Mon May 1 15:02:58 2017 (r317649) @@ -1,5 +1,5 @@ .\" -.\" $Id: pam.man 648 2013-03-05 17:54:27Z des $ +.\" $OpenPAM: pam.man 938 2017-04-30 21:34:42Z des $ .\" .Sh DESCRIPTION The Pluggable Authentication Modules (PAM) library abstracts a number Modified: vendor/openpam/dist/doc/man/pam_acct_mgmt.3 ============================================================================== --- vendor/openpam/dist/doc/man/pam_acct_mgmt.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/pam_acct_mgmt.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from pam_acct_mgmt.c by gendoc.pl -.\" $Id: pam_acct_mgmt.c 648 2013-03-05 17:54:27Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: pam_acct_mgmt.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt PAM_ACCT_MGMT 3 .Os .Sh NAME @@ -37,6 +37,8 @@ The .Fn pam_acct_mgmt function returns one of the following values: .Bl -tag -width 18n +.It Bq Er PAM_SUCCESS +Success. .It Bq Er PAM_ABORT General failure. .It Bq Er PAM_ACCT_EXPIRED Modified: vendor/openpam/dist/doc/man/pam_authenticate.3 ============================================================================== --- vendor/openpam/dist/doc/man/pam_authenticate.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/pam_authenticate.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from pam_authenticate.c by gendoc.pl -.\" $Id: pam_authenticate.c 648 2013-03-05 17:54:27Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: pam_authenticate.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt PAM_AUTHENTICATE 3 .Os .Sh NAME @@ -41,18 +41,22 @@ Fail if the user's authentication token If any other bits are set, .Fn pam_authenticate will return -.Dv PAM_SYMBOL_ERR . +.Dv PAM_BAD_CONSTANT . .Sh RETURN VALUES The .Fn pam_authenticate function returns one of the following values: .Bl -tag -width 18n +.It Bq Er PAM_SUCCESS +Success. .It Bq Er PAM_ABORT General failure. .It Bq Er PAM_AUTHINFO_UNAVAIL Authentication information is unavailable. .It Bq Er PAM_AUTH_ERR Authentication error. +.It Bq Er PAM_BAD_CONSTANT +Bad constant. .It Bq Er PAM_BUF_ERR Memory buffer error. .It Bq Er PAM_CONV_ERR @@ -65,8 +69,6 @@ Maximum number of tries exceeded. Permission denied. .It Bq Er PAM_SERVICE_ERR Error in service module. -.It Bq Er PAM_SYMBOL_ERR -Invalid symbol. .It Bq Er PAM_SYSTEM_ERR System error. .It Bq Er PAM_USER_UNKNOWN Modified: vendor/openpam/dist/doc/man/pam_chauthtok.3 ============================================================================== --- vendor/openpam/dist/doc/man/pam_chauthtok.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/pam_chauthtok.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from pam_chauthtok.c by gendoc.pl -.\" $Id: pam_chauthtok.c 648 2013-03-05 17:54:27Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: pam_chauthtok.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt PAM_CHAUTHTOK 3 .Os .Sh NAME @@ -33,12 +33,14 @@ Change only those authentication tokens If any other bits are set, .Fn pam_chauthtok will return -.Dv PAM_SYMBOL_ERR . +.Dv PAM_BAD_CONSTANT . .Sh RETURN VALUES The .Fn pam_chauthtok function returns one of the following values: .Bl -tag -width 18n +.It Bq Er PAM_SUCCESS +Success. .It Bq Er PAM_ABORT General failure. .It Bq Er PAM_AUTHTOK_DISABLE_AGING @@ -49,6 +51,8 @@ Authentication token failure. Authentication token lock busy. .It Bq Er PAM_AUTHTOK_RECOVERY_ERR Failed to recover old authentication token. +.It Bq Er PAM_BAD_CONSTANT +Bad constant. .It Bq Er PAM_BUF_ERR Memory buffer error. .It Bq Er PAM_CONV_ERR @@ -57,8 +61,6 @@ Conversation failure. Permission denied. .It Bq Er PAM_SERVICE_ERR Error in service module. -.It Bq Er PAM_SYMBOL_ERR -Invalid symbol. .It Bq Er PAM_SYSTEM_ERR System error. .It Bq Er PAM_TRY_AGAIN Modified: vendor/openpam/dist/doc/man/pam_close_session.3 ============================================================================== --- vendor/openpam/dist/doc/man/pam_close_session.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/pam_close_session.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from pam_close_session.c by gendoc.pl -.\" $Id: pam_close_session.c 648 2013-03-05 17:54:27Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: pam_close_session.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt PAM_CLOSE_SESSION 3 .Os .Sh NAME @@ -30,14 +30,18 @@ Do not emit any messages. If any other bits are set, .Fn pam_close_session will return -.Dv PAM_SYMBOL_ERR . +.Dv PAM_BAD_CONSTANT . .Sh RETURN VALUES The .Fn pam_close_session function returns one of the following values: .Bl -tag -width 18n +.It Bq Er PAM_SUCCESS +Success. .It Bq Er PAM_ABORT General failure. +.It Bq Er PAM_BAD_CONSTANT +Bad constant. .It Bq Er PAM_BUF_ERR Memory buffer error. .It Bq Er PAM_CONV_ERR @@ -48,8 +52,6 @@ Permission denied. Error in service module. .It Bq Er PAM_SESSION_ERR Session failure. -.It Bq Er PAM_SYMBOL_ERR -Invalid symbol. .It Bq Er PAM_SYSTEM_ERR System error. .El Modified: vendor/openpam/dist/doc/man/pam_conv.3 ============================================================================== --- vendor/openpam/dist/doc/man/pam_conv.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/pam_conv.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\"- .\" Copyright (c) 2002-2003 Networks Associates Technology, Inc. -.\" Copyright (c) 2004-2014 Dag-Erling Smørgrav +.\" Copyright (c) 2004-2017 Dag-Erling Smørgrav .\" All rights reserved. .\" .\" This software was developed for the FreeBSD Project by ThinkSec AS and @@ -32,9 +32,9 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: pam_conv.3 924 2017-02-19 20:52:28Z des $ +.\" $OpenPAM: pam_conv.3 939 2017-04-30 21:36:50Z des $ .\" -.Dd February 19, 2017 +.Dd April 30, 2017 .Dt PAM_CONV 3 .Os .Sh NAME Modified: vendor/openpam/dist/doc/man/pam_end.3 ============================================================================== --- vendor/openpam/dist/doc/man/pam_end.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/pam_end.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from pam_end.c by gendoc.pl -.\" $Id: pam_end.c 913 2017-01-21 15:11:12Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: pam_end.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt PAM_END 3 .Os .Sh NAME @@ -25,7 +25,13 @@ last API call before the call to .Sh RETURN VALUES The .Fn pam_end -function returns 0 on success and -1 on failure. +function returns one of the following values: +.Bl -tag -width 18n +.It Bq Er PAM_SUCCESS +Success. +.It Bq Er PAM_BAD_HANDLE +Invalid PAM handle. +.El .Sh SEE ALSO .Xr pam 3 , .Xr pam_strerror 3 Modified: vendor/openpam/dist/doc/man/pam_error.3 ============================================================================== --- vendor/openpam/dist/doc/man/pam_error.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/pam_error.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from pam_error.c by gendoc.pl -.\" $Id: pam_error.c 648 2013-03-05 17:54:27Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: pam_error.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt PAM_ERROR 3 .Os .Sh NAME @@ -22,6 +22,8 @@ The .Fn pam_error function returns one of the following values: .Bl -tag -width 18n +.It Bq Er PAM_SUCCESS +Success. .It Bq Er PAM_BUF_ERR Memory buffer error. .It Bq Er PAM_CONV_ERR Modified: vendor/openpam/dist/doc/man/pam_get_authtok.3 ============================================================================== --- vendor/openpam/dist/doc/man/pam_get_authtok.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/pam_get_authtok.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from pam_get_authtok.c by gendoc.pl -.\" $Id: pam_get_authtok.c 913 2017-01-21 15:11:12Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: pam_get_authtok.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt PAM_GET_AUTHTOK 3 .Os .Sh NAME @@ -121,6 +121,12 @@ The .Fn pam_get_authtok function returns one of the following values: .Bl -tag -width 18n +.It Bq Er PAM_SUCCESS +Success. +.It Bq Er PAM_BAD_CONSTANT +Bad constant. +.It Bq Er PAM_BAD_ITEM +Unrecognized or restricted item. .It Bq Er PAM_BUF_ERR Memory buffer error. .It Bq Er PAM_CONV_ERR Modified: vendor/openpam/dist/doc/man/pam_get_data.3 ============================================================================== --- vendor/openpam/dist/doc/man/pam_get_data.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/pam_get_data.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from pam_get_data.c by gendoc.pl -.\" $Id: pam_get_data.c 913 2017-01-21 15:11:12Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: pam_get_data.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt PAM_GET_DATA 3 .Os .Sh NAME @@ -39,6 +39,8 @@ The .Fn pam_get_data function returns one of the following values: .Bl -tag -width 18n +.It Bq Er PAM_SUCCESS +Success. .It Bq Er PAM_NO_MODULE_DATA Module data not found. .El Modified: vendor/openpam/dist/doc/man/pam_get_item.3 ============================================================================== --- vendor/openpam/dist/doc/man/pam_get_item.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/pam_get_item.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from pam_get_item.c by gendoc.pl -.\" $Id: pam_get_item.c 913 2017-01-21 15:11:12Z des $ -.Dd February 19, 2017 +.\" $OpenPAM: pam_get_item.c 938 2017-04-30 21:34:42Z des $ +.Dd April 30, 2017 .Dt PAM_GET_ITEM 3 .Os .Sh NAME @@ -74,8 +74,10 @@ The .Fn pam_get_item function returns one of the following values: .Bl -tag -width 18n -.It Bq Er PAM_SYMBOL_ERR -Invalid symbol. +.It Bq Er PAM_SUCCESS +Success. +.It Bq Er PAM_BAD_ITEM +Unrecognized or restricted item. .El .Sh SEE ALSO .Xr pam 3 , Modified: vendor/openpam/dist/doc/man/pam_get_user.3 ============================================================================== --- vendor/openpam/dist/doc/man/pam_get_user.3 Mon May 1 12:56:12 2017 (r317648) +++ vendor/openpam/dist/doc/man/pam_get_user.3 Mon May 1 15:02:58 2017 (r317649) @@ -1,6 +1,6 @@ .\" Generated from pam_get_user.c by gendoc.pl *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 1 15:03:41 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B495CD58F83; Mon, 1 May 2017 15:03:41 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AFD6A4C; Mon, 1 May 2017 15:03:41 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v41F3eWn017046; Mon, 1 May 2017 15:03:40 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41F3e3F017045; Mon, 1 May 2017 15:03:40 GMT (envelope-from des@FreeBSD.org) Message-Id: <201705011503.v41F3e3F017045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Mon, 1 May 2017 15:03:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317650 - vendor/openpam/RESEDACEA X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 15:03:41 -0000 Author: des Date: Mon May 1 15:03:40 2017 New Revision: 317650 URL: https://svnweb.freebsd.org/changeset/base/317650 Log: Tag OpenPAM Resedacea. Added: vendor/openpam/RESEDACEA/ - copied from r317649, vendor/openpam/dist/ From owner-svn-src-all@freebsd.org Mon May 1 16:28:47 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45E63D5837F; Mon, 1 May 2017 16:28:47 +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 0444615E2; Mon, 1 May 2017 16:28:46 +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 v41GSjgL090809; Mon, 1 May 2017 09:28:45 -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 v41GSj5b090808; Mon, 1 May 2017 09:28:45 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201705011628.v41GSj5b090808@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r317631 - head/sys In-Reply-To: <201705010554.v415sX3A085475@repo.freebsd.org> To: Ngie Cooper Date: Mon, 1 May 2017 09:28:45 -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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 16:28:47 -0000 > Author: ngie > Date: Mon May 1 05:54:33 2017 > New Revision: 317631 > URL: https://svnweb.freebsd.org/changeset/base/317631 > > Log: > Fix "make cscope" after r317411 This commit is disconnect netnatm module from build ? Mixed 2 commit messages perhaps? > Sponsored by: Dell EMC Isilon > > Modified: > head/sys/Makefile > > Modified: head/sys/Makefile > ============================================================================== > --- head/sys/Makefile Mon May 1 02:08:44 2017 (r317630) > +++ head/sys/Makefile Mon May 1 05:54:33 2017 (r317631) > @@ -3,7 +3,7 @@ > # Directories to include in cscope name file and TAGS. > CSCOPEDIRS= boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \ > geom gnu isa kern libkern modules net net80211 \ > - netgraph netinet netinet6 netipsec netnatm netpfil \ > + netgraph netinet netinet6 netipsec netpfil \ > netsmb nfs nfsclient nfsserver nlm ofed opencrypto \ > rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR} > .if !defined(CSCOPE_ARCHDIR) > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon May 1 16:30:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16BA8D585B1; Mon, 1 May 2017 16:30:43 +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 EA1BA17C2; Mon, 1 May 2017 16:30:42 +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 v41GUfCJ090825; Mon, 1 May 2017 09:30:41 -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 v41GUfVV090824; Mon, 1 May 2017 09:30:41 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201705011630.v41GUfVV090824@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r317632 - head/sys In-Reply-To: <201705010559.v415xqx2085699@repo.freebsd.org> To: Ngie Cooper Date: Mon, 1 May 2017 09:30:41 -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-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 16:30:43 -0000 > Author: ngie > Date: Mon May 1 05:59:52 2017 > New Revision: 317632 > URL: https://svnweb.freebsd.org/changeset/base/317632 > > Log: > Fix "make cscope-clean" when .OBJDIR already exists > > The cscope generated files are always put in .CURDIR . If this is writing to src dir then it should be fixed, or have we abandoned all hope of readonly src tree? > MFC after: 1 month > Sponsored by: Dell EMC Isilon > > Modified: > head/sys/Makefile > > Modified: head/sys/Makefile > ============================================================================== > --- head/sys/Makefile Mon May 1 05:54:33 2017 (r317631) > +++ head/sys/Makefile Mon May 1 05:59:52 2017 (r317632) > @@ -32,7 +32,8 @@ ${.CURDIR}/cscope.files: .PHONY > find ${CSCOPEDIRS} -name "*.[chSsly]" -a -type f > ${.TARGET} > > cscope-clean: > - rm -f cscope.files cscope.out cscope.in.out cscope.po.out > + cd ${.CURDIR}; \ > + rm -f cscope.files cscope.out cscope.in.out cscope.po.out > > # > # Installs SCM hooks to update the cscope database every time the source tree > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Mon May 1 16:31:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D022D588F7 for ; Mon, 1 May 2017 16:31:53 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x235.google.com (mail-it0-x235.google.com [IPv6:2607:f8b0:4001:c0b::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 063971C52 for ; Mon, 1 May 2017 16:31:52 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x235.google.com with SMTP id e65so26190097ita.1 for ; Mon, 01 May 2017 09:31: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=oLjhCz9w2ZrqrRQNK/4/4hDMJXWBr4nYXc3usROrhyQ=; b=z88QxqP2lczj/WIH4OO/mVzadOV4epsjSWi/ucRGbdaF9z3itiF3N4yu+Nsmoq2eH8 mY9ba2BFiwPvKzzcwtg9mRphYDbUv9CMXdL+uO0O/7FUc8QTMxJhlla2zJBhvJWXOU4D MMDxQonQOF6LQE1k64hSp/uq80IwP3Z9TkZstO1mkwlgwO4d2IYkX5WNMtZtfeyQiZ17 eXOxHB4FEFyh3N/eNLgZhut5nIVCEKrY8RyIU9IiPhJlX3YE1xxUihhQKfaeIVuJISt8 VrZax3LmrxofyIzyrTos10Pj6q9pGJAkguFqew2plj98LkeJbCccM6lyl8YaDDVZFoXQ ktNg== 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=oLjhCz9w2ZrqrRQNK/4/4hDMJXWBr4nYXc3usROrhyQ=; b=MvReQnUuGdopgCGRovSTJ0PGQEsFqBBOEX58+CibujG9XF2EnB4oM40nes7QIiW37P 2ZbW7zL/uw+1JyMl3i05GUMQaBddf6MhlVjgIBnn1uDZlK7l8bMqycgtcOi3xwKe1Xdn uhkQQa/53UOF7zOvxsGw5yc/WxElzrYpipsPFJfzcDXL0+pY9rZ02cnBXFtZNdObqicJ DXCAfLaEtu7CTMUQ5avATlXFdyu++1gSrFpWdWD8OqcrBnliuiyDDxKdPG/1gNjZxMLK EwV69NOdcqYXFq9oHobGHdPbJSv5LmGntN+JUZB/7NMWxw+oQusVkhjMJY3I+ZY/qmE7 PF6A== X-Gm-Message-State: AN3rC/4NDe4t13xA+nF5dZ/AEgtv//4iTi1xgcYNzj4DYZR3zHA0kVoW rM8SZ3EeZeut7j8EI6m4gJ+mPk/VnA== X-Received: by 10.36.3.136 with SMTP id e130mr6319267ite.64.1493656312053; Mon, 01 May 2017 09:31:52 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.126.6 with HTTP; Mon, 1 May 2017 09:31:51 -0700 (PDT) X-Originating-IP: [2607:fb10:7021:1::4e6c] In-Reply-To: <201705011628.v41GSj5b090808@pdx.rh.CN85.dnsmgr.net> References: <201705010554.v415sX3A085475@repo.freebsd.org> <201705011628.v41GSj5b090808@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Mon, 1 May 2017 10:31:51 -0600 X-Google-Sender-Auth: vQUI7DxIa1L5C_BJupslmHD7U_o Message-ID: Subject: Re: svn commit: r317631 - head/sys To: "Rodney W. Grimes" Cc: Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 16:31:53 -0000 No, this disconnected netnatm from the cscope target. sys/Makefile is normally unused otherwise in the build process. Warner On Mon, May 1, 2017 at 10:28 AM, Rodney W. Grimes wrote: >> Author: ngie >> Date: Mon May 1 05:54:33 2017 >> New Revision: 317631 >> URL: https://svnweb.freebsd.org/changeset/base/317631 >> >> Log: >> Fix "make cscope" after r317411 > > This commit is disconnect netnatm module from build > > ? Mixed 2 commit messages perhaps? > >> Sponsored by: Dell EMC Isilon >> >> Modified: >> head/sys/Makefile >> >> Modified: head/sys/Makefile >> ============================================================================== >> --- head/sys/Makefile Mon May 1 02:08:44 2017 (r317630) >> +++ head/sys/Makefile Mon May 1 05:54:33 2017 (r317631) >> @@ -3,7 +3,7 @@ >> # Directories to include in cscope name file and TAGS. >> CSCOPEDIRS= boot bsm cam cddl compat conf contrib crypto ddb dev fs gdb \ >> geom gnu isa kern libkern modules net net80211 \ >> - netgraph netinet netinet6 netipsec netnatm netpfil \ >> + netgraph netinet netinet6 netipsec netpfil \ >> netsmb nfs nfsclient nfsserver nlm ofed opencrypto \ >> rpc security sys ufs vm xdr xen ${CSCOPE_ARCHDIR} >> .if !defined(CSCOPE_ARCHDIR) >> >> > > -- > Rod Grimes rgrimes@freebsd.org > From owner-svn-src-all@freebsd.org Mon May 1 16:32:29 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3A77D589FD; Mon, 1 May 2017 16:32:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76CA71E47; Mon, 1 May 2017 16:32:29 +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 v41GWSxb052898; Mon, 1 May 2017 16:32:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41GWS67052895; Mon, 1 May 2017 16:32:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201705011632.v41GWS67052895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 1 May 2017 16:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317651 - in head/sys/compat/linuxkpi/common: include/asm include/linux src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 16:32:29 -0000 Author: markj Date: Mon May 1 16:32:28 2017 New Revision: 317651 URL: https://svnweb.freebsd.org/changeset/base/317651 Log: Add on_each_cpu() and wbinvd_on_all_cpus(). Reviewed by: hselasky MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10550 Added: head/sys/compat/linuxkpi/common/include/asm/smp.h (contents, props changed) head/sys/compat/linuxkpi/common/include/linux/smp.h (contents, props changed) Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Added: head/sys/compat/linuxkpi/common/include/asm/smp.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/asm/smp.h Mon May 1 16:32:28 2017 (r317651) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2017 Mark Johnston + * + * 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$ + */ + +#ifndef _ASM_SMP_H_ +#define _ASM_SMP_H_ + +#if defined(__i386__) || defined(__amd64__) + +#define wbinvd_on_all_cpus() linux_wbinvd_on_all_cpus() + +int linux_wbinvd_on_all_cpus(void); + +#endif + +#endif /* _ASM_SMP_H_ */ Added: head/sys/compat/linuxkpi/common/include/linux/smp.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/compat/linuxkpi/common/include/linux/smp.h Mon May 1 16:32:28 2017 (r317651) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2017 Mark Johnston + * + * 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$ + */ + +#ifndef _LINUX_SMP_H_ +#define _LINUX_SMP_H_ + +#define on_each_cpu(cb, data, wait) ({ \ + CTASSERT(wait); \ + linux_on_each_cpu(cb, data); \ +}) + +extern int linux_on_each_cpu(void (*)(void *), void *); + +#endif /* _LINUX_SMP_H_ */ Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 1 15:03:40 2017 (r317650) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 1 16:32:28 2017 (r317651) @@ -48,6 +48,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include @@ -74,8 +77,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include -#include +#if defined(__i386__) || defined(__amd64__) +#include +#endif SYSCTL_NODE(_compat, OID_AUTO, linuxkpi, CTLFLAG_RW, 0, "LinuxKPI parameters"); @@ -1619,6 +1625,31 @@ linux_irq_handler(void *ent) irqe->handler(irqe->irq, irqe->arg); } +#if defined(__i386__) || defined(__amd64__) +static void +wbinvd_cb(void *arg __unused) +{ + + wbinvd(); +} + +int +linux_wbinvd_on_all_cpus(void) +{ + + return (linux_on_each_cpu(wbinvd_cb, NULL)); +} +#endif + +int +linux_on_each_cpu(void callback(void *), void *data) +{ + + smp_rendezvous(smp_no_rendezvous_barrier, callback, + smp_no_rendezvous_barrier, data); + return (0); +} + struct linux_cdev * linux_find_cdev(const char *name, unsigned major, unsigned minor) { From owner-svn-src-all@freebsd.org Mon May 1 16:34:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17BBFD58AED for ; Mon, 1 May 2017 16:34:13 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x22b.google.com (mail-it0-x22b.google.com [IPv6:2607:f8b0:4001:c0b::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D44121FFF for ; Mon, 1 May 2017 16:34:12 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x22b.google.com with SMTP id c15so17660540ith.0 for ; Mon, 01 May 2017 09:34:12 -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=s36RarNDXTa7YBsIYecTJDmd4xPBdVKWa21h24HZ5aI=; b=MY8dhKMM/tjZN9w7M5MnQ4wvk2nDspyiFTRy70lo70KEl0VBCQWU/cAu5Yc/wz7P27 QFvk4Gzpt1CeNYjPZsu/KG4HOzyyLY0alZrkZFyPogsN5AVxN2d/gW/aTzUcn9K9kmWv XTRV+EcdICqUTjRxNFJHwzQwdyUxr+5LSolHaUONVLncj6bZcw1RhrX8leQ2mm0C/60l LUn1CJ6uw+calJaIyi3ShcZ1nxgPDjelm24oGbcMakSLAPPHeiPvOsy/4D1uTuTDBqRy cJtN/Le4v9l7d0IcMrw+8cFoCRWH6pvkZzm74MMbZHxgdAzNjpGyxcU/HtXVArGax782 N+xA== 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=s36RarNDXTa7YBsIYecTJDmd4xPBdVKWa21h24HZ5aI=; b=KlpY1l81a1GB/8r7FdeLEg9f6dJ4RkkUKLBw7Y4CSxHHc+2v6+aGK66l08Ycz6jtQW qH/HHSVIy9Sj2MaxpqBGi6RLgRxKhoRgwEOLmEt/oZM42N/IqMqsnYhEBz3+BeOB8ZoK MVw6CYNcAeNeWPTxspRlUP0CT0TTCTzOZTViDZ7lZ+6XcCEYw+QJL3wHJzR4Rw/Q4mY3 UgrsWjgFvkxJYOW6o5Y75zYqLKFf84DPxSiEHZ/EW8eAEEaBgNT11a6J5xrXzUGJ0Rfe ioBUyk0Ic1kiZtLI2osygrVEDgJnmPn4Wf38eoKnHhJvFpiw4AUTSaJ4nlVOkpT52rep BnfQ== X-Gm-Message-State: AN3rC/5ARrplxDjGvMCWq4a71wBLsmoaQ27hmr157/xODpoqmRQ8tSrw 83FEhdWlg4rBRWbwfZ/dt2b7eI4vVA== X-Received: by 10.36.6.142 with SMTP id 136mr6452115itv.0.1493656452200; Mon, 01 May 2017 09:34:12 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.126.6 with HTTP; Mon, 1 May 2017 09:34:11 -0700 (PDT) X-Originating-IP: [2607:fb10:7021:1::4e6c] In-Reply-To: <201705011630.v41GUfVV090824@pdx.rh.CN85.dnsmgr.net> References: <201705010559.v415xqx2085699@repo.freebsd.org> <201705011630.v41GUfVV090824@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Mon, 1 May 2017 10:34:11 -0600 X-Google-Sender-Auth: iJqsW6bOyfPhG4-8HMrlQ-UDeMM Message-ID: Subject: Re: svn commit: r317632 - head/sys To: "Rodney W. Grimes" Cc: Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 16:34:13 -0000 On Mon, May 1, 2017 at 10:30 AM, Rodney W. Grimes wrote: >> Author: ngie >> Date: Mon May 1 05:59:52 2017 >> New Revision: 317632 >> URL: https://svnweb.freebsd.org/changeset/base/317632 >> >> Log: >> Fix "make cscope-clean" when .OBJDIR already exists >> >> The cscope generated files are always put in .CURDIR . > > If this is writing to src dir then it should be fixed, > or have we abandoned all hope of readonly src tree? This is only for the cscope target, which isn't part of the normal build. readonly src tree works great still.... Warner From owner-svn-src-all@freebsd.org Mon May 1 16:56:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30D02D591C2; Mon, 1 May 2017 16:56:36 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F3F72E1A; Mon, 1 May 2017 16:56:35 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v41GuYig061433; Mon, 1 May 2017 16:56:34 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41GuY8R061432; Mon, 1 May 2017 16:56:34 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201705011656.v41GuY8R061432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 1 May 2017 16:56:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317652 - head/sys/boot/efi/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 16:56:36 -0000 Author: tsoome Date: Mon May 1 16:56:34 2017 New Revision: 317652 URL: https://svnweb.freebsd.org/changeset/base/317652 Log: loader.efi: ResetSystem does not use data with EFI_SUCCESS The current reboot command in efi/loader/main.c is passing extra data with ResetSystem, however, UEFI spec 2.6, page 265 does state: "ResetData is only valid if ResetStatus is something other than EFI_SUCCESS unless the ResetType is EfiResetPlatformSpecific where a minimum amount of ResetData is always required." Therefore we should use DataSize 0 and ResetData NULL - those are two last arguments for the call. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D10562 Modified: head/sys/boot/efi/loader/main.c Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Mon May 1 16:32:28 2017 (r317651) +++ head/sys/boot/efi/loader/main.c Mon May 1 16:56:34 2017 (r317652) @@ -507,8 +507,7 @@ command_reboot(int argc, char *argv[]) if (devsw[i]->dv_cleanup != NULL) (devsw[i]->dv_cleanup)(); - RS->ResetSystem(EfiResetCold, EFI_SUCCESS, 23, - (CHAR16 *)"Reboot from the loader"); + RS->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL); /* NOTREACHED */ return (CMD_ERROR); From owner-svn-src-all@freebsd.org Mon May 1 16:59:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44D1BD59371; Mon, 1 May 2017 16:59: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 mx1.freebsd.org (Postfix) with ESMTPS id 14965112A; Mon, 1 May 2017 16:59: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 v41GxtRh061622; Mon, 1 May 2017 16:59:55 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41GxtWv061621; Mon, 1 May 2017 16:59:55 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201705011659.v41GxtWv061621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 1 May 2017 16:59:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317653 - stable/11/usr.bin/getaddrinfo X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 16:59:56 -0000 Author: brooks Date: Mon May 1 16:59:54 2017 New Revision: 317653 URL: https://svnweb.freebsd.org/changeset/base/317653 Log: MFC r317385: Clean up Makefile. Prefer SRCTOP vs .CURDIR relative paths. Find libnetbsd using LIBADD infrastructure rather than manual hackery. Reviewed by: ngie, bapt Obtained from: CheriBSD Sponsored by: DARPA, AFRL Modified: stable/11/usr.bin/getaddrinfo/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/getaddrinfo/Makefile ============================================================================== --- stable/11/usr.bin/getaddrinfo/Makefile Mon May 1 16:56:34 2017 (r317652) +++ stable/11/usr.bin/getaddrinfo/Makefile Mon May 1 16:59:54 2017 (r317653) @@ -3,19 +3,15 @@ .include PROG= getaddrinfo +SRCS= getaddrinfo.c tables.h -CFLAGS+= -I${.CURDIR}/../../lib/libnetbsd -LIBNETBSDDIR= ${.OBJDIR}/../../lib/libnetbsd -LIBNETBSD= ${LIBNETBSDDIR}/libnetbsd.a -DPADD+= ${LIBNETBSD} -LDADD+= ${LIBNETBSD} +CFLAGS+= -I${SRCTOP}/lib/libnetbsd -LIBADD+= util +LIBADD+= netbsd util -SYS_SOCKET_H?= ${.CURDIR}/../../sys/sys/socket.h +SYS_SOCKET_H?= ${SRCTOP}/sys/sys/socket.h -CFLAGS+= -I. -DPSRCS+= tables.h +CFLAGS+= -I${.OBJDIR} CLEANFILES+= tables.h tables.h: tables.awk ${SYS_SOCKET_H} LC_ALL=C awk -f ${.ALLSRC} > ${.TARGET} From owner-svn-src-all@freebsd.org Mon May 1 17:01:01 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0E2BD593EA; Mon, 1 May 2017 17:01:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C09F71453; Mon, 1 May 2017 17:01:01 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v41H10HA061760; Mon, 1 May 2017 17:01:00 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41H10W0061759; Mon, 1 May 2017 17:01:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201705011701.v41H10W0061759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 1 May 2017 17:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317654 - head/sys/cddl/dev/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 17:01:02 -0000 Author: markj Date: Mon May 1 17:01:00 2017 New Revision: 317654 URL: https://svnweb.freebsd.org/changeset/base/317654 Log: Fix a harmless LOR in dtrace_load(). MFC after: 1 week Modified: head/sys/cddl/dev/dtrace/dtrace_load.c Modified: head/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_load.c Mon May 1 16:59:54 2017 (r317653) +++ head/sys/cddl/dev/dtrace/dtrace_load.c Mon May 1 17:01:00 2017 (r317654) @@ -97,11 +97,9 @@ dtrace_load(void *dummy) mutex_init(&dtrace_errlock,"dtrace error lock", MUTEX_DEFAULT, NULL); #endif + mutex_enter(&cpu_lock); mutex_enter(&dtrace_provider_lock); mutex_enter(&dtrace_lock); - mutex_enter(&cpu_lock); - - ASSERT(MUTEX_HELD(&cpu_lock)); dtrace_state_cache = kmem_cache_create("dtrace_state_cache", sizeof (dtrace_dstate_percpu_t) * NCPU, DTRACE_STATE_ALIGN, @@ -151,13 +149,9 @@ dtrace_load(void *dummy) dtrace_probeid_error = dtrace_probe_create((dtrace_provider_id_t) dtrace_provider, NULL, NULL, "ERROR", 1, NULL); - mutex_exit(&cpu_lock); - mutex_exit(&dtrace_lock); mutex_exit(&dtrace_provider_lock); - mutex_enter(&cpu_lock); - #ifdef EARLY_AP_STARTUP CPU_FOREACH(i) { (void) dtrace_cpu_setup(CPU_CONFIG, i); @@ -173,6 +167,4 @@ dtrace_load(void *dummy) "dtrace/dtrace"); helper_dev = make_dev(&helper_cdevsw, 0, UID_ROOT, GID_WHEEL, 0660, "dtrace/helper"); - - return; } From owner-svn-src-all@freebsd.org Mon May 1 17:02:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B613D59590; Mon, 1 May 2017 17:02:53 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D0DB1779; Mon, 1 May 2017 17:02:52 +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 v41H2qCA065362; Mon, 1 May 2017 17:02:52 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41H2qHb065361; Mon, 1 May 2017 17:02:52 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201705011702.v41H2qHb065361@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 1 May 2017 17:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317655 - stable/11/usr.sbin/ntp/sntp X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 17:02:53 -0000 Author: brooks Date: Mon May 1 17:02:51 2017 New Revision: 317655 URL: https://svnweb.freebsd.org/changeset/base/317655 Log: MFC r317388: Use the approved syntax to build no man pages. Sponsored by: DARPA, AFRL Modified: stable/11/usr.sbin/ntp/sntp/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/ntp/sntp/Makefile ============================================================================== --- stable/11/usr.sbin/ntp/sntp/Makefile Mon May 1 17:01:00 2017 (r317654) +++ stable/11/usr.sbin/ntp/sntp/Makefile Mon May 1 17:02:51 2017 (r317655) @@ -5,7 +5,7 @@ .PATH: ${.CURDIR}/../../../contrib/ntp/sntp PROG= sntp -MK_MAN= no +MAN= SRCS= crypto.c kod_management.c log.c main.c networking.c \ sntp-opts.c sntp.c utilities.c From owner-svn-src-all@freebsd.org Mon May 1 17:10:45 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50577D59751; Mon, 1 May 2017 17:10:45 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04BA01B0D; Mon, 1 May 2017 17:10:44 +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 v41HAhsE065731; Mon, 1 May 2017 17:10:43 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41HAhT3065730; Mon, 1 May 2017 17:10:43 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201705011710.v41HAhT3065730@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 1 May 2017 17:10:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317656 - stable/11/sys/dev/ieee488 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 17:10:45 -0000 Author: brooks Date: Mon May 1 17:10:43 2017 New Revision: 317656 URL: https://svnweb.freebsd.org/changeset/base/317656 Log: Partial, manual MFC of r317411: Remove directory made empty by IEEE488 removal. Deleted: stable/11/sys/dev/ieee488/ Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Mon May 1 18:53:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08278D58428; Mon, 1 May 2017 18:53:49 +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 mx1.freebsd.org (Postfix) with ESMTPS id BC1A2DE7; Mon, 1 May 2017 18:53:48 +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 v41IrlJf010562; Mon, 1 May 2017 18:53:47 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41IrlrC010559; Mon, 1 May 2017 18:53:47 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201705011853.v41IrlrC010559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Mon, 1 May 2017 18:53:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317657 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 18:53:49 -0000 Author: ken Date: Mon May 1 18:53:47 2017 New Revision: 317657 URL: https://svnweb.freebsd.org/changeset/base/317657 Log: Fix camcontrol timestamp setting and update the man page. camcontrol timestamp -s would somtimes fail due to stack garbage. Zero out the timestamp parameters to fix it. Fix another nearby bug, and update the man page. sbin/camcontrol/timestamp.c: In set_timestamp(), bzero ts_p prior to creating the timestamp. Previously stack garbage could cause some tape drives to reject the timestamp. In set_timestamp(), check for failures from strptime(). sbin/camcontrol/camcontrol.8: Add the time argument to the -T option to camcontrol timestamp -s in the long description. Change the time/date format used in the camcontrol timestamp example to RFC 2822 format. This fixes a time zone issue with the original example by specifying the time zone as -0600. Otherwise, the time zone seems to default to standard time in the current locale, which makes the time, when reported back from the drive, 1 hour off from the intended setting. This also fixes a duplicate day of the week ("Wednesday Wed") in the previous example. Submitted by: Sam Klopsch MFC after: 3 days Sponsored by: Spectra Logic Modified: head/sbin/camcontrol/camcontrol.8 head/sbin/camcontrol/timestamp.c Modified: head/sbin/camcontrol/camcontrol.8 ============================================================================== --- head/sbin/camcontrol/camcontrol.8 Mon May 1 17:10:43 2017 (r317656) +++ head/sbin/camcontrol/camcontrol.8 Mon May 1 18:53:47 2017 (r317657) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 17, 2017 +.Dd May 1, 2017 .Dt CAMCONTROL 8 .Os .Sh NAME @@ -2488,7 +2488,7 @@ Specify the strptime format string, as d The time must also be specified with the .Fl T option. -.It Fl T +.It Fl T Ar time Provide the time in the format specified with the .Fl f option. @@ -2814,8 +2814,8 @@ drive .Pa ada0 . .Pp .Bd -literal -offset indent -camcontrol timestamp sa0 -s -f "%A %c" \e - -T "Wednesday Wed Oct 26 21:43:57 2016" +camcontrol timestamp sa0 -s -f "%a, %d %b %Y %T %z" \e + -T "Wed, 26 Oct 2016 21:43:57 -0600" .Ed .Pp Set the timestamp of drive Modified: head/sbin/camcontrol/timestamp.c ============================================================================== --- head/sbin/camcontrol/timestamp.c Mon May 1 17:10:43 2017 (r317656) +++ head/sbin/camcontrol/timestamp.c Mon May 1 18:53:47 2017 (r317657) @@ -282,12 +282,18 @@ set_timestamp(struct cam_device *device, ts = (uint64_t) time_value; } else { bzero(&time_struct, sizeof(struct tm)); - strptime(timestamp_string, format_string, &time_struct); + if (strptime(timestamp_string, format_string, + &time_struct) == NULL) { + warnx("%s: strptime(3) failed", __func__); + error = 1; + goto bailout; + } time_value = mktime(&time_struct); ts = (uint64_t) time_value; } /* Convert time from seconds to milliseconds */ ts *= 1000; + bzero(&ts_p, sizeof(ts_p)); scsi_create_timestamp(ts_p.timestamp, ts); scsi_set_timestamp(&ccb->csio, From owner-svn-src-all@freebsd.org Mon May 1 19:34:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23BAFD5924D; Mon, 1 May 2017 19:34:17 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E813DC6A; Mon, 1 May 2017 19:34:16 +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 v41JYFls027859; Mon, 1 May 2017 19:34:15 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41JYFks027858; Mon, 1 May 2017 19:34:15 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201705011934.v41JYFks027858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 1 May 2017 19:34:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317658 - head/usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 19:34:17 -0000 Author: bdrewery Date: Mon May 1 19:34:15 2017 New Revision: 317658 URL: https://svnweb.freebsd.org/changeset/base/317658 Log: Redo r288270: Hookup mkcsmapper_static and mkesdb_static for 'make clean' These are only built as part of the top-level 'build-tools' call for 'make buildworld'. They still need to be cleaned during the 'make clean' treewalks though. Reported by: markj MFC after: 2 weeks Sponsored by: Dell EMC Isilon Modified: head/usr.bin/Makefile Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Mon May 1 18:53:47 2017 (r317657) +++ head/usr.bin/Makefile Mon May 1 19:34:15 2017 (r317658) @@ -301,6 +301,12 @@ SUBDIR.${MK_UTMPX}+= who SUBDIR.${MK_SVN}+= svn SUBDIR.${MK_SVNLITE}+= svn +# These are normally only handled for build-tools. +.if make(clean*) +SUBDIR+= mkcsmapper_static +SUBDIR+= mkesdb_static +.endif + .include SUBDIR:= ${SUBDIR:O:u} From owner-svn-src-all@freebsd.org Mon May 1 19:47:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6186ED59468; Mon, 1 May 2017 19:47:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CF6A218; Mon, 1 May 2017 19:47:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v41JlBcR031964; Mon, 1 May 2017 19:47:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41JlAIv031962; Mon, 1 May 2017 19:47:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201705011947.v41JlAIv031962@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 1 May 2017 19:47:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317659 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 19:47:12 -0000 Author: mav Date: Mon May 1 19:47:10 2017 New Revision: 317659 URL: https://svnweb.freebsd.org/changeset/base/317659 Log: Make some UART consoles to not spin wait for data to be sent. At least with Tx FIFO enabled it shows me ~10% reduction of verbose boot time with serial console at 115200 baud. Reviewed by: marcel MFC after: 2 weeks Modified: head/sys/dev/uart/uart_dev_lpc.c head/sys/dev/uart/uart_dev_ns8250.c Modified: head/sys/dev/uart/uart_dev_lpc.c ============================================================================== --- head/sys/dev/uart/uart_dev_lpc.c Mon May 1 19:34:15 2017 (r317658) +++ head/sys/dev/uart/uart_dev_lpc.c Mon May 1 19:47:10 2017 (r317659) @@ -345,9 +345,6 @@ lpc_ns8250_putc(struct uart_bas *bas, in DELAY(4); uart_setreg(bas, REG_DATA, c); uart_barrier(bas); - limit = 250000; - while ((uart_getreg(bas, REG_LSR) & LSR_TEMT) == 0 && --limit) - DELAY(4); } static int @@ -890,8 +887,13 @@ lpc_ns8250_bus_transmit(struct uart_soft bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); - while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) - ; + if (sc->sc_txdatasz > 1) { + if ((uart_getreg(bas, REG_LSR) & LSR_TEMT) == 0) + ns8250_drain(bas, UART_DRAIN_TRANSMITTER); + } else { + while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) + DELAY(4); + } for (i = 0; i < sc->sc_txdatasz; i++) { uart_setreg(bas, REG_DATA, sc->sc_txbuf[i]); uart_barrier(bas); Modified: head/sys/dev/uart/uart_dev_ns8250.c ============================================================================== --- head/sys/dev/uart/uart_dev_ns8250.c Mon May 1 19:34:15 2017 (r317658) +++ head/sys/dev/uart/uart_dev_ns8250.c Mon May 1 19:47:10 2017 (r317659) @@ -315,7 +315,7 @@ ns8250_init(struct uart_bas *bas, int ba /* Disable the FIFO (if present). */ val = 0; #ifdef CPU_XBURST - val = FCR_UART_ON; + val |= FCR_UART_ON; #endif uart_setreg(bas, REG_FCR, val); uart_barrier(bas); @@ -346,9 +346,6 @@ ns8250_putc(struct uart_bas *bas, int c) DELAY(4); uart_setreg(bas, REG_DATA, c); uart_barrier(bas); - limit = 250000; - while ((uart_getreg(bas, REG_LSR) & LSR_TEMT) == 0 && --limit) - DELAY(4); } static int @@ -999,8 +996,13 @@ ns8250_bus_transmit(struct uart_softc *s bas = &sc->sc_bas; uart_lock(sc->sc_hwmtx); - while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) - ; + if (sc->sc_txdatasz > 1) { + if ((uart_getreg(bas, REG_LSR) & LSR_TEMT) == 0) + ns8250_drain(bas, UART_DRAIN_TRANSMITTER); + } else { + while ((uart_getreg(bas, REG_LSR) & LSR_THRE) == 0) + DELAY(4); + } for (i = 0; i < sc->sc_txdatasz; i++) { uart_setreg(bas, REG_DATA, sc->sc_txbuf[i]); uart_barrier(bas); From owner-svn-src-all@freebsd.org Mon May 1 20:04:08 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F059CD59B7A; Mon, 1 May 2017 20:04:08 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C25ACF14; Mon, 1 May 2017 20:04:08 +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 v41K47xN040265; Mon, 1 May 2017 20:04:07 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v41K47IF040264; Mon, 1 May 2017 20:04:07 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201705012004.v41K47IF040264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Mon, 1 May 2017 20:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317660 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 20:04:09 -0000 Author: brooks Date: Mon May 1 20:04:07 2017 New Revision: 317660 URL: https://svnweb.freebsd.org/changeset/base/317660 Log: Support clnt_raw's use of FD_SETSIZE as a fake file descriptor. Accomplish this by allocating space for it in __svc_xports and allowing it to be registered. The failure to allocate space was causing an out-of-bounds read in svc_getreq_common(). The failure to register caused PR 211804. The bug was found with CHERI bounds checking. PR: 211804 Obtained from: CheriBSD Sponsored by: DARPA, AFRL Reviewed by: ngie MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D10528 Modified: head/lib/libc/rpc/svc.c Modified: head/lib/libc/rpc/svc.c ============================================================================== --- head/lib/libc/rpc/svc.c Mon May 1 19:47:10 2017 (r317659) +++ head/lib/libc/rpc/svc.c Mon May 1 20:04:07 2017 (r317660) @@ -108,18 +108,19 @@ xprt_register(SVCXPRT *xprt) rwlock_wrlock(&svc_fd_lock); if (__svc_xports == NULL) { __svc_xports = (SVCXPRT **) - mem_alloc(FD_SETSIZE * sizeof(SVCXPRT *)); + mem_alloc((FD_SETSIZE + 1) * sizeof(SVCXPRT *)); if (__svc_xports == NULL) { rwlock_unlock(&svc_fd_lock); return; } - memset(__svc_xports, '\0', FD_SETSIZE * sizeof(SVCXPRT *)); + memset(__svc_xports, '\0', (FD_SETSIZE + 1) * sizeof(SVCXPRT *)); } if (sock < FD_SETSIZE) { __svc_xports[sock] = xprt; FD_SET(sock, &svc_fdset); svc_maxfd = max(svc_maxfd, sock); - } + } else if (sock == FD_SETSIZE) + __svc_xports[sock] = xprt; rwlock_unlock(&svc_fd_lock); } @@ -157,7 +158,8 @@ __xprt_do_unregister(SVCXPRT *xprt, bool if (__svc_xports[svc_maxfd]) break; } - } + } else if ((sock == FD_SETSIZE) && (__svc_xports[sock] == xprt)) + __svc_xports[sock] = NULL; if (dolock) rwlock_unlock(&svc_fd_lock); } From owner-svn-src-all@freebsd.org Mon May 1 20:55:43 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6504D596B9; Mon, 1 May 2017 20:55:43 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F0C0BD3; Mon, 1 May 2017 20:55:43 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x230.google.com with SMTP id e65so2334133ita.1; Mon, 01 May 2017 13:55:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=WE9Ti6DJDhdMmEYkeyu+L4JQqzyy0/TfKE4Ll05r3Qo=; b=E+MfO3WA5F4re6KIvoQabmb680ADG2YHbYFEV3kEtCy9ruRHE3xgh3k0PtyJ6EbE6m VfrEkbxs5qaSB/Hqn40TjJqUScqbCfJ91noWda4rbaZMih4F4EPHfpUNkqtgmiRXBydk QrsvYITmEixZZIOW5llvq99JIufqJVudbG3qNgBRPOpro3owSHi3/DbUjf1gXgAuCLIx aGjCW/MjXFVviiSD88XCAJXM6AiT4ozHNh/EJayOT+oYx8jTHO+Wo7hj/ykAHnsdwooX PHPYqJFfeFYpb2HDkXxZT/nT5c+Iamvtxddmu80bsRM3PRLAS5DbfM2PE773cO5D5XGN Vx6g== 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=WE9Ti6DJDhdMmEYkeyu+L4JQqzyy0/TfKE4Ll05r3Qo=; b=EcmLvGIBqdIhae78gx2ra2gdaNhaSChIBIQReEN+kdQA3Oc3deVCuYiqLzGdsAAGUj PIAZ9GuGiIMVHWvxI22rr6alkcBsg01xJ+CQDbwraxzReoOhqMwgN/sbMqKrPJu2qtIX gZ4LYkJ3JTpVkIeYTUnUdtPvU+pSo5alAYopoby+JbusveOPVa39q0N9uD9wp+0Rr4ey YYbzbB6TNZuTawAcat1lILQJJ/pc/1AcAFk5cJmJ5saTjm7IUcyqwZ9hhZY8HYMZPXH9 f5seBjWd4AlfxIuWOEsrGyOdh0jdoE8gx+GyxKQInhJp1M/g6kQogK9Cm3HY08pWplUu JmRA== X-Gm-Message-State: AN3rC/51CGvGWzumQsPtfZrEYwSIJl3sBOCpLGafM4LBPfScu8L7IOuJ q1ZflUBFD0NG7NGzpp0NI9zVCrSdrBhF0p8= X-Received: by 10.36.190.205 with SMTP id i196mr540338itf.88.1493672142551; Mon, 01 May 2017 13:55:42 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.30.136 with HTTP; Mon, 1 May 2017 13:55:22 -0700 (PDT) In-Reply-To: References: <201704192221.v3JMLFPs032866@repo.freebsd.org> From: Ed Maste Date: Mon, 1 May 2017 16:55:22 -0400 X-Google-Sender-Auth: TXSW0pwnBWZEcF6DAkPAcp3MuOo Message-ID: Subject: Re: svn commit: r317171 - head/sys/dev/vt To: Jung-uk Kim Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 20:55:43 -0000 On 20 April 2017 at 14:06, Jung-uk Kim wrote: > > Maybe but I haven't seen much improvement in the area for many years. > Do you have any reason to believe someone is working on it? > > Even if we have such backend, I don't expect much difference in drawing > small area, i.e., redrawing narrow borders. On top of that, I don't > like "if (vd->vd_driver->vd_drawrect == NULL) return (ENOTSUP)" stuff. I don't believe anyone is working on it at the moment, but I expect that effort will go into improved VGA / VESA support at some point and that might implement an improved drawrect. I agree that there's unlikely to be a noticeable difference in the case of occasional operations filling a small region (e.g., border clearing after vt switch). However, the vd_drawrect == NULL case is really no different than vd_setpixel == NULL. All vt drivers except ofwfb provide both, and ofwfb provides neither. From owner-svn-src-all@freebsd.org Mon May 1 22:26:36 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86143D59E94; Mon, 1 May 2017 22:26:36 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) by mx1.freebsd.org (Postfix) with ESMTP id 0453814F4; Mon, 1 May 2017 22:26:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r317171 - head/sys/dev/vt To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201704192221.v3JMLFPs032866@repo.freebsd.org> From: Jung-uk Kim Message-ID: Date: Mon, 1 May 2017 18:26:30 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6aPrr0tDOmCmg8qbDKsFTuBjbaVbdugQW" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 May 2017 22:26:36 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6aPrr0tDOmCmg8qbDKsFTuBjbaVbdugQW Content-Type: multipart/mixed; boundary="AskN0PpHWXPevlE3cejCgW0Qsvn95lF3D"; protected-headers="v1" From: Jung-uk Kim To: Ed Maste Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Subject: Re: svn commit: r317171 - head/sys/dev/vt References: <201704192221.v3JMLFPs032866@repo.freebsd.org> In-Reply-To: --AskN0PpHWXPevlE3cejCgW0Qsvn95lF3D Content-Type: multipart/mixed; boundary="------------E589CBB9D5721B08A742F296" Content-Language: en-US This is a multi-part message in MIME format. --------------E589CBB9D5721B08A742F296 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 05/01/2017 16:55, Ed Maste wrote: > On 20 April 2017 at 14:06, Jung-uk Kim wrote: >> >> Maybe but I haven't seen much improvement in the area for many years. >> Do you have any reason to believe someone is working on it? >> >> Even if we have such backend, I don't expect much difference in drawin= g >> small area, i.e., redrawing narrow borders. On top of that, I don't >> like "if (vd->vd_driver->vd_drawrect =3D=3D NULL) return (ENOTSUP)" st= uff. >=20 > I don't believe anyone is working on it at the moment, but I expect > that effort will go into improved VGA / VESA support at some point and > that might implement an improved drawrect. I agree that there's > unlikely to be a noticeable difference in the case of occasional > operations filling a small region (e.g., border clearing after vt > switch). >=20 > However, the vd_drawrect =3D=3D NULL case is really no different than > vd_setpixel =3D=3D NULL. All vt drivers except ofwfb provide both, and > ofwfb provides neither. I can revert it but I don't like the previous implementation. There were overlapping regions and off-by-one issues. Please see the attached patch, which is against the previous version. Jung-uk Kim --------------E589CBB9D5721B08A742F296 Content-Type: text/x-patch; name="vt_core.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="vt_core.diff" --- vt_core.c.orig +++ vt_core.c @@ -1546,21 +1546,23 @@ /* Left bar. */ if (vw->vw_draw_area.tr_begin.tp_col > 0) vd->vd_driver->vd_drawrect(vd, - 0, 0, - vw->vw_draw_area.tr_begin.tp_col - 1, vd->vd_height - 1, + 0, vw->vw_draw_area.tr_begin.tp_row, + vw->vw_draw_area.tr_begin.tp_col - 1, + vw->vw_draw_area.tr_end.tp_row - 1, 1, c); =20 /* Right bar. */ if (vw->vw_draw_area.tr_end.tp_col < vd->vd_width) vd->vd_driver->vd_drawrect(vd, - vw->vw_draw_area.tr_end.tp_col - 1, 0, - vd->vd_width - 1, vd->vd_height - 1, + vw->vw_draw_area.tr_end.tp_col, + vw->vw_draw_area.tr_begin.tp_row, + vd->vd_width - 1, vw->vw_draw_area.tr_end.tp_row - 1, 1, c); =20 /* Bottom bar. */ if (vw->vw_draw_area.tr_end.tp_row < vd->vd_height) vd->vd_driver->vd_drawrect(vd, - 0, vw->vw_draw_area.tr_end.tp_row - 1, + 0, vw->vw_draw_area.tr_end.tp_row, vd->vd_width - 1, vd->vd_height - 1, 1, c); =20 --------------E589CBB9D5721B08A742F296-- --AskN0PpHWXPevlE3cejCgW0Qsvn95lF3D-- --6aPrr0tDOmCmg8qbDKsFTuBjbaVbdugQW Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEl1bqgKaRyqfWXu/CfJ+WJvzb8UYFAlkHthYACgkQfJ+WJvzb 8Ub8xQf+LSNyv25YHjZXI26jjDmtinxhhRVAA0+hsfBYvKgWnjU04L/K2820wza1 8vhoKnjQRUPFMmCY1V1aXXkk/1yl/IfCc/6D1BdpvrJEBW0T+8HnRxfk28FG+9Z3 G5ruRBZHSI3urBF8FcU4lY3349YGEzykjAZCSin9cCiQN5fUTlfZYejniDpOJuBo CXuQptxw80V5vP9p+0TkPiPRc89nmy2OMFgsNxXCUuAXHJQIFmoNvsGgT/9xzH9I LE2UpRbSQKjARZUZEc7ZEVdLiv0tI0PNQ6e8S6igLLn683AUeNKOI1eCVYnYnaGJ nUortZ3bSyCMSI3m8MNOK8AK0QzNHA== =p+Wt -----END PGP SIGNATURE----- --6aPrr0tDOmCmg8qbDKsFTuBjbaVbdugQW-- From owner-svn-src-all@freebsd.org Tue May 2 00:16:14 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3D64D59802; Tue, 2 May 2017 00:16:14 +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 B419DE1B; Tue, 2 May 2017 00:16:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id EB29A10A7B9; Mon, 1 May 2017 20:16:12 -0400 (EDT) From: John Baldwin To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317651 - in head/sys/compat/linuxkpi/common: include/asm include/linux src Date: Mon, 01 May 2017 14:19:02 -0700 Message-ID: <6396628.i00z9sPEvp@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.0-STABLE; KDE/4.14.10; amd64; ; ) In-Reply-To: <201705011632.v41GWS67052895@repo.freebsd.org> References: <201705011632.v41GWS67052895@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); Mon, 01 May 2017 20:16:13 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 00:16:14 -0000 On Monday, May 01, 2017 04:32:28 PM Mark Johnston wrote: > Author: markj > Date: Mon May 1 16:32:28 2017 > New Revision: 317651 > URL: https://svnweb.freebsd.org/changeset/base/317651 > > Log: > Add on_each_cpu() and wbinvd_on_all_cpus(). For wbinvd_on_all_cpus() we do have a dedicated IPI. You could just use 'pmap_invalidate_cache()' in place of wbinvd_on_all_cpus() directly. -- John Baldwin From owner-svn-src-all@freebsd.org Tue May 2 01:04:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1DDCD58514; Tue, 2 May 2017 01:04:00 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50A5F89E; Tue, 2 May 2017 01:04:00 +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 v4213xsU062863; Tue, 2 May 2017 01:03:59 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4213xEM062862; Tue, 2 May 2017 01:03:59 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201705020103.v4213xEM062862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 2 May 2017 01:03:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317663 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 01:04:00 -0000 Author: ae Date: Tue May 2 01:03:59 2017 New Revision: 317663 URL: https://svnweb.freebsd.org/changeset/base/317663 Log: Properly initialize ipfw_range_tlv variable to fix possible EINVAL in case when ipfw delete/zero/resetlog command issued for several rules in the loop. Also reorder some variables by size. PR: 218993 MFC after: 1 week Modified: head/sbin/ipfw/ipfw2.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Mon May 1 21:21:04 2017 (r317662) +++ head/sbin/ipfw/ipfw2.c Tue May 2 01:03:59 2017 (r317663) @@ -3187,15 +3187,14 @@ fill_flags_cmd(ipfw_insn *cmd, enum ipfw void ipfw_delete(char *av[]) { + ipfw_range_tlv rt; + char *sep; int i, j; int exitval = EX_OK; int do_set = 0; - char *sep; - ipfw_range_tlv rt; av++; NEED1("missing rule specification"); - memset(&rt, 0, sizeof(rt)); if ( *av && _substrcmp(*av, "set") == 0) { /* Do not allow using the following syntax: * ipfw set N delete set M @@ -3222,6 +3221,7 @@ ipfw_delete(char *av[]) } else if (co.do_pipe) { exitval = ipfw_delete_pipe(co.do_pipe, i); } else { + memset(&rt, 0, sizeof(rt)); if (do_set != 0) { rt.set = i & 31; rt.flags = IPFW_RCFLAG_SET; @@ -5157,18 +5157,17 @@ void ipfw_zero(int ac, char *av[], int optname) { ipfw_range_tlv rt; - uint32_t arg; - int failed = EX_OK; char const *errstr; char const *name = optname ? "RESETLOG" : "ZERO"; + uint32_t arg; + int failed = EX_OK; optname = optname ? IP_FW_XRESETLOG : IP_FW_XZERO; - memset(&rt, 0, sizeof(rt)); - av++; ac--; if (ac == 0) { /* clear all entries */ + memset(&rt, 0, sizeof(rt)); rt.flags = IPFW_RCFLAG_ALL; if (do_range_cmd(optname, &rt) < 0) err(EX_UNAVAILABLE, "setsockopt(IP_FW_X%s)", name); @@ -5186,6 +5185,7 @@ ipfw_zero(int ac, char *av[], int optnam if (errstr) errx(EX_DATAERR, "invalid rule number %s\n", *av); + memset(&rt, 0, sizeof(rt)); rt.start_rule = arg; rt.end_rule = arg; rt.flags |= IPFW_RCFLAG_RANGE; From owner-svn-src-all@freebsd.org Tue May 2 01:30:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BD65D595ED; Tue, 2 May 2017 01:30:48 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E1B19943; Tue, 2 May 2017 01:30:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v421Ukxc071132; Tue, 2 May 2017 01:30:46 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v421UkUH071131; Tue, 2 May 2017 01:30:46 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201705020130.v421UkUH071131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 2 May 2017 01:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317664 - stable/11/sys/dev/hyperv/netvsc X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 01:30:48 -0000 Author: sephe Date: Tue May 2 01:30:46 2017 New Revision: 317664 URL: https://svnweb.freebsd.org/changeset/base/317664 Log: hyperv/hn: Enable sorted LRO (direct commit). This is a direct commit. Sorted LRO is much better than plain (linked list LRO), which hash LRO is not available on this branch. Sponsored by: Microsoft Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c Modified: stable/11/sys/dev/hyperv/netvsc/if_hn.c ============================================================================== --- stable/11/sys/dev/hyperv/netvsc/if_hn.c Tue May 2 01:03:59 2017 (r317663) +++ stable/11/sys/dev/hyperv/netvsc/if_hn.c Tue May 2 01:30:46 2017 (r317664) @@ -487,7 +487,7 @@ SYSCTL_INT(_hw_hn, OID_AUTO, tx_swq_dept /* Enable sorted LRO, and the depth of the per-channel mbuf queue */ #if __FreeBSD_version >= 1100095 -static u_int hn_lro_mbufq_depth = 0; +static u_int hn_lro_mbufq_depth = 512; SYSCTL_UINT(_hw_hn, OID_AUTO, lro_mbufq_depth, CTLFLAG_RDTUN, &hn_lro_mbufq_depth, 0, "Depth of LRO mbuf queue"); #endif From owner-svn-src-all@freebsd.org Tue May 2 02:32:11 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99E2FD59A7A; Tue, 2 May 2017 02:32:11 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5D0CC10AB; Tue, 2 May 2017 02:32:11 +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 v422WA08099081; Tue, 2 May 2017 02:32:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v422WAdu099079; Tue, 2 May 2017 02:32:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705020232.v422WAdu099079@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 2 May 2017 02:32:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317665 - in head: contrib/netbsd-tests/usr.bin/grep usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 02:32:11 -0000 Author: emaste Date: Tue May 2 02:32:10 2017 New Revision: 317665 URL: https://svnweb.freebsd.org/changeset/base/317665 Log: bsdgrep: fix -w -v matching improperly with certain patterns -w and -v flag matching was mostly functional but had some minor problems: 1. -w flag processing only allowed one iteration through pattern matching on a line. This was problematic if one pattern could match more than once, or if there were multiple patterns and the earliest/ longest match was not the most ideal, and 2. Previous work "fixed" things to not further process a line if the first iteration through patterns produced no matches. This is clearly wrong if we're dealing with the more restrictive -w matching. #2 breakage could have also occurred before recent broad rewrites, but it would be more arbitrary based on input patterns as to whether or not it actually affected things. Fix both of these by forcing a retry of the patterns after advancing just past the start of the first match if we're doing more restrictive -w matching and we didn't get any hits to start with. Also move -v flag processing outside of the loop so that we have a greater change to match in the more restrictive cases. This wasn't strictly wrong, but it could be a little more error prone. While here, introduce some regressions tests for this behavior and fix some excessive wrapping nearby that hindered readability. GNU grep passes these new tests. PR: 218467, 218811 Submitted by: Kyle Evans Reviewed by: cem, ngie Differential Revision: https://reviews.freebsd.org/D10329 Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh head/usr.bin/grep/util.c Modified: head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Tue May 2 01:30:46 2017 (r317664) +++ head/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Tue May 2 02:32:10 2017 (r317665) @@ -93,6 +93,12 @@ word_regexps_body() { atf_check -o file:"$(atf_get_srcdir)/d_word_regexps.out" \ grep -w separated $(atf_get_srcdir)/d_input + + # Begin FreeBSD + printf "xmatch pmatch\n" > test1 + + atf_check -o inline:"pmatch\n" grep -Eow "(match )?pmatch" test1 + # End FreeBSD } atf_test_case begin_end @@ -439,6 +445,23 @@ grep_sanity_body() atf_check -o inline:"M\n" grep -o -e "M\{1\}" test2 } + +atf_test_case wv_combo_break +wv_combo_break_head() +{ + atf_set "descr" "Check for incorrectly matching lines with both -w and -v flags (PR 218467)" +} +wv_combo_break_body() +{ + printf "x xx\n" > test1 + printf "xx x\n" > test2 + + atf_check -o file:test1 grep -w "x" test1 + atf_check -o file:test2 grep -w "x" test2 + + atf_check -s exit:1 grep -v -w "x" test1 + atf_check -s exit:1 grep -v -w "x" test2 +} # End FreeBSD atf_init_test_cases() @@ -467,6 +490,7 @@ atf_init_test_cases() atf_add_test_case escmap atf_add_test_case egrep_empty_invalid atf_add_test_case zerolen + atf_add_test_case wv_combo_break atf_add_test_case fgrep_sanity atf_add_test_case egrep_sanity atf_add_test_case grep_sanity Modified: head/usr.bin/grep/util.c ============================================================================== --- head/usr.bin/grep/util.c Tue May 2 01:30:46 2017 (r317664) +++ head/usr.bin/grep/util.c Tue May 2 02:32:10 2017 (r317665) @@ -305,6 +305,7 @@ procline(struct str *l, int nottext) unsigned int i; int c = 0, m = 0, r = 0, lastmatches = 0, leflags = eflags; int startm = 0; + int retry; /* Initialize to avoid a false positive warning from GCC. */ lastmatch.rm_so = lastmatch.rm_eo = 0; @@ -313,6 +314,7 @@ procline(struct str *l, int nottext) while (st <= l->len) { lastmatches = 0; startm = m; + retry = 0; if (st > 0) leflags |= REG_NOTBOL; /* Loop to compare with all the patterns */ @@ -356,6 +358,17 @@ procline(struct str *l, int nottext) else if (iswword(wbegin) || iswword(wend)) r = REG_NOMATCH; + /* + * If we're doing whole word matching and we + * matched once, then we should try the pattern + * again after advancing just past the start of + * the earliest match. This allows the pattern + * to match later on in the line and possibly + * still match a whole word. + */ + if (r == REG_NOMATCH && + (retry == 0 || pmatch.rm_so + 1 < retry)) + retry = pmatch.rm_so + 1; } if (r == 0) { lastmatches++; @@ -385,9 +398,14 @@ procline(struct str *l, int nottext) } } - if (vflag) { - c = !c; - break; + /* + * Advance to just past the start of the earliest match, try + * again just in case we still have a chance to match later in + * the string. + */ + if (lastmatches == 0 && retry > 0) { + st = retry; + continue; } /* One pass if we are not recording matches */ @@ -410,6 +428,9 @@ procline(struct str *l, int nottext) } + if (vflag) + c = !c; + /* Count the matches if we have a match limit */ if (mflag) mcount -= c; From owner-svn-src-all@freebsd.org Tue May 2 05:02:13 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8CB2D5AC2C; Tue, 2 May 2017 05:02:13 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7965A985; Tue, 2 May 2017 05:02:13 +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 v4252CY7061391; Tue, 2 May 2017 05:02:12 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4252ClR061390; Tue, 2 May 2017 05:02:12 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201705020502.v4252ClR061390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 2 May 2017 05:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317666 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 05:02:13 -0000 Author: ae Date: Tue May 2 05:02:12 2017 New Revision: 317666 URL: https://svnweb.freebsd.org/changeset/base/317666 Log: Add sets support for ipfw table info/list/flush commands. PR: 212668 MFC after: 1 week Modified: head/sbin/ipfw/tables.c Modified: head/sbin/ipfw/tables.c ============================================================================== --- head/sbin/ipfw/tables.c Tue May 2 02:32:10 2017 (r317665) +++ head/sbin/ipfw/tables.c Tue May 2 05:02:12 2017 (r317666) @@ -1628,18 +1628,19 @@ tables_foreach(table_cb_t *f, void *arg, } if (sort != 0) - qsort(olh + 1, olh->count, olh->objsize, tablename_cmp); + qsort(olh + 1, olh->count, olh->objsize, + tablename_cmp); info = (ipfw_xtable_info *)(olh + 1); for (i = 0; i < olh->count; i++) { - error = f(info, arg); /* Ignore errors for now */ - info = (ipfw_xtable_info *)((caddr_t)info + olh->objsize); + if (co.use_set == 0 || info->set == co.use_set - 1) + error = f(info, arg); + info = (ipfw_xtable_info *)((caddr_t)info + + olh->objsize); } - free(olh); break; } - return (0); } From owner-svn-src-all@freebsd.org Tue May 2 05:20:56 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F241D59501; Tue, 2 May 2017 05:20:56 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D59C01334; Tue, 2 May 2017 05:20:55 +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 v425Ks4t065763; Tue, 2 May 2017 05:20:54 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v425Ks6J065762; Tue, 2 May 2017 05:20:54 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201705020520.v425Ks6J065762@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 2 May 2017 05:20:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317667 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 05:20:56 -0000 Author: ae Date: Tue May 2 05:20:54 2017 New Revision: 317667 URL: https://svnweb.freebsd.org/changeset/base/317667 Log: In parse_range() validate both range values instead of checking the top value twice. PR: 202295 MFC after: 1 week Modified: head/sbin/ipfw/dummynet.c Modified: head/sbin/ipfw/dummynet.c ============================================================================== --- head/sbin/ipfw/dummynet.c Tue May 2 05:02:12 2017 (r317666) +++ head/sbin/ipfw/dummynet.c Tue May 2 05:20:54 2017 (r317667) @@ -1881,7 +1881,7 @@ parse_range(int ac, char *av[], uint32_t av--; } if (v[1] < v[0] || - v[1] >= DN_MAX_ID-1 || + v[0] >= DN_MAX_ID-1 || v[1] >= DN_MAX_ID-1) { continue; /* invalid entry */ } From owner-svn-src-all@freebsd.org Tue May 2 06:27:48 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F3C2D5A505; Tue, 2 May 2017 06:27:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4F9431B6D; Tue, 2 May 2017 06:27: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 v426Rlna095061; Tue, 2 May 2017 06:27:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v426Rls5095058; Tue, 2 May 2017 06:27:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201705020627.v426Rls5095058@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 2 May 2017 06:27:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r317673 - stable/11/sys/dev/ahci X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 06:27:48 -0000 Author: mav Date: Tue May 2 06:27:46 2017 New Revision: 317673 URL: https://svnweb.freebsd.org/changeset/base/317673 Log: MFC r317080: Block FPDMA TRIM for ASMedia HBAs. Experiments show FPDMA TRIM command timeouts on ASMedia HBAs, while the same SSDs working fine on Intel HBAs. Modified: stable/11/sys/dev/ahci/ahci.c stable/11/sys/dev/ahci/ahci.h stable/11/sys/dev/ahci/ahci_pci.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ahci/ahci.c ============================================================================== --- stable/11/sys/dev/ahci/ahci.c Tue May 2 06:16:35 2017 (r317672) +++ stable/11/sys/dev/ahci/ahci.c Tue May 2 06:27:46 2017 (r317673) @@ -2684,7 +2684,9 @@ ahciaction(struct cam_sim *sim, union cc if (ch->caps & AHCI_CAP_SPM) cpi->hba_inquiry |= PI_SATAPM; cpi->target_sprt = 0; - cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED | PIM_ATA_EXT; + cpi->hba_misc = PIM_SEQSCAN | PIM_UNMAPPED; + if ((ch->quirks & AHCI_Q_NOAUX) == 0) + cpi->hba_misc |= PIM_ATA_EXT; cpi->hba_eng_cnt = 0; if (ch->caps & AHCI_CAP_SPM) cpi->max_target = 15; Modified: stable/11/sys/dev/ahci/ahci.h ============================================================================== --- stable/11/sys/dev/ahci/ahci.h Tue May 2 06:16:35 2017 (r317672) +++ stable/11/sys/dev/ahci/ahci.h Tue May 2 06:27:46 2017 (r317673) @@ -599,6 +599,7 @@ enum ahci_err_type { #define AHCI_Q_RESTORE_CAP 0x00080000 #define AHCI_Q_NOMSIX 0x00100000 #define AHCI_Q_NOCCS 0x00400000 +#define AHCI_Q_NOAUX 0x00800000 #define AHCI_Q_BIT_STRING \ "\020" \ @@ -623,7 +624,8 @@ enum ahci_err_type { "\023FORCE_PI" \ "\024RESTORE_CAP" \ "\025NOMSIX" \ - "\027NOCCS" + "\027NOCCS" \ + "\030NOAUX" int ahci_attach(device_t dev); int ahci_detach(device_t dev); Modified: stable/11/sys/dev/ahci/ahci_pci.c ============================================================================== --- stable/11/sys/dev/ahci/ahci_pci.c Tue May 2 06:16:35 2017 (r317672) +++ stable/11/sys/dev/ahci/ahci_pci.c Tue May 2 06:27:46 2017 (r317673) @@ -73,15 +73,15 @@ static const struct { {0x78021022, 0x00, "AMD Hudson-2", 0}, {0x78031022, 0x00, "AMD Hudson-2", 0}, {0x78041022, 0x00, "AMD Hudson-2", 0}, - {0x06011b21, 0x00, "ASMedia ASM1060", AHCI_Q_NOCCS}, - {0x06021b21, 0x00, "ASMedia ASM1060", AHCI_Q_NOCCS}, - {0x06111b21, 0x00, "ASMedia ASM1061", AHCI_Q_NOCCS}, - {0x06121b21, 0x00, "ASMedia ASM1062", AHCI_Q_NOCCS}, - {0x06201b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS}, - {0x06211b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS}, - {0x06221b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS}, - {0x06241b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS}, - {0x06251b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS}, + {0x06011b21, 0x00, "ASMedia ASM1060", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06021b21, 0x00, "ASMedia ASM1060", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06111b21, 0x00, "ASMedia ASM1061", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06121b21, 0x00, "ASMedia ASM1062", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06201b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06211b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06221b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06241b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, + {0x06251b21, 0x00, "ASMedia ASM106x", AHCI_Q_NOCCS|AHCI_Q_NOAUX}, {0x26528086, 0x00, "Intel ICH6", AHCI_Q_NOFORCE}, {0x26538086, 0x00, "Intel ICH6M", AHCI_Q_NOFORCE}, {0x26818086, 0x00, "Intel ESB2", 0}, From owner-svn-src-all@freebsd.org Tue May 2 09:55:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AB87D5AF7B; Tue, 2 May 2017 09:55:35 +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 B27051D29; Tue, 2 May 2017 09:55:34 +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 v429tSTq044051 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 2 May 2017 12:55:28 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v429tSTq044051 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v429tRYa044043; Tue, 2 May 2017 12:55:27 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 2 May 2017 12:55:27 +0300 From: Konstantin Belousov To: Bruce Evans Cc: Alan Somers , Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... Message-ID: <20170502095527.GB1622@kib.kiev.ua> References: <201704171734.v3HHYlf5022945@repo.freebsd.org> <20170419130428.J956@besplex.bde.org> <20170430201324.GV1622@kib.kiev.ua> <20170501163725.U972@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170501163725.U972@besplex.bde.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 09:55:35 -0000 On Mon, May 01, 2017 at 06:25:11PM +1000, Bruce Evans wrote: > XX Index: subr_counter.c > XX =================================================================== > XX --- subr_counter.c (revision 317604) > XX +++ subr_counter.c (working copy) > XX @@ -78,11 +78,15 @@ > XX sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS) > XX { > XX uint64_t out; > XX + uint32_t out32; > XX int error; > XX > XX out = counter_u64_fetch(*(counter_u64_t *)arg1); > XX > XX - error = SYSCTL_OUT(req, &out, sizeof(uint64_t)); > XX + if (req->oldlen == 4 && (out32 = out) == out) > XX + error = SYSCTL_OUT(req, &out32, sizeof(out32)); > XX + else > XX + error = SYSCTL_OUT(req, &out, sizeof(out)); > XX > XX if (error || !req->newptr) > XX return (error); > > This does the minimum necessary to fix the current problem. > > This works until the counters become too large for a u_int. There > could be an option to get truncation with no error, but that would > require an API change, so applications should be required to do the > truncation for themself if that is what they want. Yes, this is approximately what I consider to be enough fix, but with some details which I do not like and which did not worked well on my test machine with enough memory to generate lot of increments. Below is what I consider to be good enough. I will proceed with this version unless very strong objections appear. diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index 5f4cd46ab1e..93d5161de89 100644 --- a/sys/vm/vm_meter.c +++ b/sys/vm/vm_meter.c @@ -266,8 +266,29 @@ static SYSCTL_NODE(_vm_stats, OID_AUTO, vm, CTLFLAG_RW, 0, "VM meter vm stats"); SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc stats"); +static int +sysctl_handle_vmstat(SYSCTL_HANDLER_ARGS) +{ + uint64_t out; +#ifdef COMPAT_FREEBSD11 + uint32_t out1; +#endif + + out = counter_u64_fetch(*(counter_u64_t *)arg1); +#ifdef COMPAT_FREEBSD11 + if (req->oldlen == sizeof(uint32_t)) { + out1 = 0xffffffff; + if (out < out1) + out1 = out; + return (SYSCTL_OUT(req, &out1, sizeof(uint32_t))); + } +#endif + return (SYSCTL_OUT(req, &out, sizeof(uint64_t))); +} + #define VM_STATS(parent, var, descr) \ - SYSCTL_COUNTER_U64(parent, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, descr) + SYSCTL_OID(parent, OID_AUTO, var, CTLTYPE_U64 | CTLFLAG_MPSAFE | \ + CTLFLAG_RD, &vm_cnt.var, 0, sysctl_handle_vmstat, "QU", descr); #define VM_STATS_VM(var, descr) VM_STATS(_vm_stats_vm, var, descr) #define VM_STATS_SYS(var, descr) VM_STATS(_vm_stats_sys, var, descr) From owner-svn-src-all@freebsd.org Tue May 2 10:04:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 261BFD57361; Tue, 2 May 2017 10:04:28 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCE422CC; Tue, 2 May 2017 10:04:27 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id E940D2617C3; Tue, 2 May 2017 12:04:25 +0200 (CEST) Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... To: Konstantin Belousov , Bruce Evans Cc: Alan Somers , Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" References: <201704171734.v3HHYlf5022945@repo.freebsd.org> <20170419130428.J956@besplex.bde.org> <20170430201324.GV1622@kib.kiev.ua> <20170501163725.U972@besplex.bde.org> <20170502095527.GB1622@kib.kiev.ua> From: Hans Petter Selasky Message-ID: <27c9a2b4-b993-2370-1da8-b4beef354a1b@selasky.org> Date: Tue, 2 May 2017 12:02:32 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 MIME-Version: 1.0 In-Reply-To: <20170502095527.GB1622@kib.kiev.ua> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 10:04:28 -0000 On 05/02/17 11:55, Konstantin Belousov wrote: > + out1 = 0xffffffff; Nitpicking: Should this be written: 0xffffffffU ?? --HPS From owner-svn-src-all@freebsd.org Tue May 2 10:29:38 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61FE7D57B2E; Tue, 2 May 2017 10:29:38 +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 CE06C338; Tue, 2 May 2017 10:29:37 +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 v42ATWO3052312 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 2 May 2017 13:29:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v42ATWO3052312 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v42ATWFV052311; Tue, 2 May 2017 13:29:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 2 May 2017 13:29:32 +0300 From: Konstantin Belousov To: Hans Petter Selasky Cc: Bruce Evans , Alan Somers , Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... Message-ID: <20170502102932.GC1622@kib.kiev.ua> References: <201704171734.v3HHYlf5022945@repo.freebsd.org> <20170419130428.J956@besplex.bde.org> <20170430201324.GV1622@kib.kiev.ua> <20170501163725.U972@besplex.bde.org> <20170502095527.GB1622@kib.kiev.ua> <27c9a2b4-b993-2370-1da8-b4beef354a1b@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <27c9a2b4-b993-2370-1da8-b4beef354a1b@selasky.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 10:29:38 -0000 On Tue, May 02, 2017 at 12:02:32PM +0200, Hans Petter Selasky wrote: > On 05/02/17 11:55, Konstantin Belousov wrote: > > + out1 = 0xffffffff; > > Nitpicking: > > Should this be written: 0xffffffffU ?? Compiler must do it on its own. The constant is not representable as int so it is auto-promoted to unsigned int, if fitting. From owner-svn-src-all@freebsd.org Tue May 2 11:25:51 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8D6BD590BD; Tue, 2 May 2017 11:25:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 98E03879; Tue, 2 May 2017 11:25:51 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id B91FC104AC0D; Tue, 2 May 2017 21:25:40 +1000 (AEST) Date: Tue, 2 May 2017 21:25:40 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , Alan Somers , Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... In-Reply-To: <20170502095527.GB1622@kib.kiev.ua> Message-ID: <20170502203703.I1176@besplex.bde.org> References: <201704171734.v3HHYlf5022945@repo.freebsd.org> <20170419130428.J956@besplex.bde.org> <20170430201324.GV1622@kib.kiev.ua> <20170501163725.U972@besplex.bde.org> <20170502095527.GB1622@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=9c1YXFi_s6pBL_uy8JYA:9 a=2h5AcP7PeoVhcE4n:21 a=dWn9O7JRpMvWnKfk:21 a=ecD9VUfY_Hat2frr:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 11:25:52 -0000 On Tue, 2 May 2017, Konstantin Belousov wrote: > On Mon, May 01, 2017 at 06:25:11PM +1000, Bruce Evans wrote: >> XX Index: subr_counter.c >> XX =================================================================== >> XX --- subr_counter.c (revision 317604) >> XX +++ subr_counter.c (working copy) >> XX @@ -78,11 +78,15 @@ >> XX sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS) >> XX { >> XX uint64_t out; >> XX + uint32_t out32; >> XX int error; >> XX >> XX out = counter_u64_fetch(*(counter_u64_t *)arg1); >> XX >> XX - error = SYSCTL_OUT(req, &out, sizeof(uint64_t)); >> XX + if (req->oldlen == 4 && (out32 = out) == out) >> XX + error = SYSCTL_OUT(req, &out32, sizeof(out32)); >> XX + else >> XX + error = SYSCTL_OUT(req, &out, sizeof(out)); >> XX >> XX if (error || !req->newptr) >> XX return (error); >> >> This does the minimum necessary to fix the current problem. >> >> This works until the counters become too large for a u_int. There >> could be an option to get truncation with no error, but that would >> require an API change, so applications should be required to do the >> truncation for themself if that is what they want. > > Yes, this is approximately what I consider to be enough fix, but with > some details which I do not like and which did not worked well on my > test machine with enough memory to generate lot of increments. > > Below is what I consider to be good enough. I will proceed with this > version unless very strong objections appear. I prefer my version. It is the same as for sysctl_bufspace(), except for simplifications and bug fixes that are easier because the types are unsigned. Your version is especially broken for the case of a lot of increments. Clamping breaks many cases in systat -v which just needs unsigned counters to calculate small differences. Not many counters overflow faster than the refresh interval in systat or top. These cases used to appear to work perfectly for most counters when the kernel did blind truncations. Clamping breaks the API. Not returing ENOMEM breaks the API. In my version, this is handled as specified by the API by truncating and returning ENOMEM. Then: - top sees the ENOMEM and mishandles it by aborting - systat sees the ENOMEM (and also sees a short count, if it has the newer breakage of hard-coding 64-bit counters instead of u_int ones, and is run on a kernel with u_int counters) and mishandles it better by printing an error message but not aborting. Thus it appears to work just as well as when the kernel did blind truncation, except for the error message. Clamping would be difficult for the application to handle even if an error is returned. This would be like the situation for clamping for strtoul(), but worse since it changes the API. Many applications don't understand how to handle errno for strtoul(), but they do do a bogus check of the clamped value. For sysctl(), clamping is not part of the API now, so applications shouldn't check for the clamped values. Ones that work with deltas like systat -v would see the counters stop incrementing when the clamped value is reached, while truncated values allow them to continue to appear to work perfectly. > diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c > index 5f4cd46ab1e..93d5161de89 100644 > --- a/sys/vm/vm_meter.c > +++ b/sys/vm/vm_meter.c > @@ -266,8 +266,29 @@ static SYSCTL_NODE(_vm_stats, OID_AUTO, vm, CTLFLAG_RW, 0, > "VM meter vm stats"); > SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc stats"); > > +static int > +sysctl_handle_vmstat(SYSCTL_HANDLER_ARGS) > +{ > + uint64_t out; > +#ifdef COMPAT_FREEBSD11 > + uint32_t out1; > +#endif The extra wrapper and the ifdef limit the damage from the API change. Otherwise, I don't like them. I prefer my variable name out32 to the nondescript out1. ('out' should also be renamed out64, but I wanted to keep the diffs small.) > + > + out = counter_u64_fetch(*(counter_u64_t *)arg1); > +#ifdef COMPAT_FREEBSD11 > + if (req->oldlen == sizeof(uint32_t)) { sizeof(uint32_t) is an obfuscated spelling of '4'. The size is already hard-coded in '32'. This depends on sizeof(char) being 1. It is, and won't change. POSIX started specifying this in 2001, and the mere existence of uint8_t probably requires 8-bit chars since u_char must be the smallest type of an object. This depends on the size of a u_int being 32 bits/4 bytes in the old ABI. This won't change, and is already hard-coded as 32, as it must be because sizeof(u_int) may change. > + out1 = 0xffffffff; > + if (out < out1) > + out1 = out; This does the clamping. Clamping is probably better expressed as: out1 = MIN(out, 0xffffffff) > + return (SYSCTL_OUT(req, &out1, sizeof(uint32_t))); Here sizeof(uint32_t) is an obfuscated spelling of sizeof(out1). I think the sizeof() is justified in this case, to limit the hard-coding to of sizes to 1 place. Truncation by assigment to the destination variable also helps limit this (sysctl_bufspace() could also be improved by truncation by assignment. Its integers are signed, so the result is implementation-defined, but we know that it is benign 2's complement and don't really care what it is provided it is reasonable. This is better than laboriously checking the lower limit or neglecting to check it). Here the limit 0xffffffff also depends on the size. > + } > +#endif > + return (SYSCTL_OUT(req, &out, sizeof(uint64_t))); > +} > + > #define VM_STATS(parent, var, descr) \ > - SYSCTL_COUNTER_U64(parent, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, descr) > + SYSCTL_OID(parent, OID_AUTO, var, CTLTYPE_U64 | CTLFLAG_MPSAFE | \ > + CTLFLAG_RD, &vm_cnt.var, 0, sysctl_handle_vmstat, "QU", descr); I see a new problem, shared with my version. The sysctl data says that this sysctl is pure 64 bits, but it can return 32 bits. The sysctl data just can't describe the variation. I guess this is not much a problem, since it takes magic to read the sysctl data from the kernel and not many programs except sysctl know how to do it. There programs will see the pure 64 bits and only attempt to use 64 bit types. > #define VM_STATS_VM(var, descr) VM_STATS(_vm_stats_vm, var, descr) > #define VM_STATS_SYS(var, descr) VM_STATS(_vm_stats_sys, var, descr) Bruce From owner-svn-src-all@freebsd.org Tue May 2 11:52:00 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45D6CD599D6; Tue, 2 May 2017 11:52:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 09E0E7AC; Tue, 2 May 2017 11:51:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id CD9B4102199; Tue, 2 May 2017 21:51:49 +1000 (AEST) Date: Tue, 2 May 2017 21:51:49 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Hans Petter Selasky , Bruce Evans , Alan Somers , Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... In-Reply-To: <20170502102932.GC1622@kib.kiev.ua> Message-ID: <20170502212549.Y1176@besplex.bde.org> References: <201704171734.v3HHYlf5022945@repo.freebsd.org> <20170419130428.J956@besplex.bde.org> <20170430201324.GV1622@kib.kiev.ua> <20170501163725.U972@besplex.bde.org> <20170502095527.GB1622@kib.kiev.ua> <27c9a2b4-b993-2370-1da8-b4beef354a1b@selasky.org> <20170502102932.GC1622@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=5cO7WIxmaFd0sSc_HjoA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 11:52:00 -0000 On Tue, 2 May 2017, Konstantin Belousov wrote: > On Tue, May 02, 2017 at 12:02:32PM +0200, Hans Petter Selasky wrote: >> On 05/02/17 11:55, Konstantin Belousov wrote: >>> + out1 = 0xffffffff; >> >> Nitpicking: >> >> Should this be written: 0xffffffffU ?? No, 0xffffffffU should be written 0xffffffff except in very delicate code which needs it to have type precisely u_int (and u_int has at least 32 bits, else the constant would still not be u_int). > Compiler must do it on its own. The constant is not representable as > int so it is auto-promoted to unsigned int, if fitting. It doesn't really matter here, but we must make too many assumptions and do too many type analyses to see that it doesn't matter (or too see that either 0xffffffff or 0xffffffffU is correct or needed, but plain 0xffffffff usually works better since it lets the compiler decide). Here you assume <= 32-bit ints for simplicity (otherwise, 0xffffffff would be int). POSIX and practice also requires >= 32-bit ints. So ints are assumed to be precisely 32 bits, and then 0xffffffff is just a better spelling of 0xffffffffU. Here we only need that the constant is non-negative. Its type is irrelevant, so it would be a style bug to force the type to unsigned or larger (with < 32-bit ints) using a U suffix. All integer constants are non-negative. We could even spell the constant in decimal here. It would then have type int64_t. Spelling it in hex makes its value clearer and allows its type to be unsigned. Bruce From owner-svn-src-all@freebsd.org Tue May 2 12:17:18 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6ECE6D5A959; Tue, 2 May 2017 12:17: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 EF33EBA3; Tue, 2 May 2017 12:17:17 +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 v42CHBTf076523 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 2 May 2017 15:17:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v42CHBTf076523 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v42CHB8o076522; Tue, 2 May 2017 15:17:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 2 May 2017 15:17:11 +0300 From: Konstantin Belousov To: Bruce Evans Cc: Alan Somers , Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... Message-ID: <20170502121711.GE1622@kib.kiev.ua> References: <201704171734.v3HHYlf5022945@repo.freebsd.org> <20170419130428.J956@besplex.bde.org> <20170430201324.GV1622@kib.kiev.ua> <20170501163725.U972@besplex.bde.org> <20170502095527.GB1622@kib.kiev.ua> <20170502203703.I1176@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170502203703.I1176@besplex.bde.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 12:17:18 -0000 On Tue, May 02, 2017 at 09:25:40PM +1000, Bruce Evans wrote: > On Tue, 2 May 2017, Konstantin Belousov wrote: > > > On Mon, May 01, 2017 at 06:25:11PM +1000, Bruce Evans wrote: > >> XX Index: subr_counter.c > >> XX =================================================================== > >> XX --- subr_counter.c (revision 317604) > >> XX +++ subr_counter.c (working copy) > >> XX @@ -78,11 +78,15 @@ > >> XX sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS) > >> XX { > >> XX uint64_t out; > >> XX + uint32_t out32; > >> XX int error; > >> XX > >> XX out = counter_u64_fetch(*(counter_u64_t *)arg1); > >> XX > >> XX - error = SYSCTL_OUT(req, &out, sizeof(uint64_t)); > >> XX + if (req->oldlen == 4 && (out32 = out) == out) > >> XX + error = SYSCTL_OUT(req, &out32, sizeof(out32)); > >> XX + else > >> XX + error = SYSCTL_OUT(req, &out, sizeof(out)); > >> XX > >> XX if (error || !req->newptr) > >> XX return (error); > >> > >> This does the minimum necessary to fix the current problem. > >> > >> This works until the counters become too large for a u_int. There > >> could be an option to get truncation with no error, but that would > >> require an API change, so applications should be required to do the > >> truncation for themself if that is what they want. > > > > Yes, this is approximately what I consider to be enough fix, but with > > some details which I do not like and which did not worked well on my > > test machine with enough memory to generate lot of increments. > > > > Below is what I consider to be good enough. I will proceed with this > > version unless very strong objections appear. > > I prefer my version. It is the same as for sysctl_bufspace(), except > for simplifications and bug fixes that are easier because the types > are unsigned. > > Your version is especially broken for the case of a lot of increments. You consider the 'differentiators' as the main users, but I only want systat and top to not abort, I have no intent of making them work for updated counters if overflown. Instead, I want something human-visible so that person looking at raw counters values using old tools detected the failure. > > Clamping breaks many cases in systat -v which just needs unsigned counters > to calculate small differences. Not many counters overflow faster than > the refresh interval in systat or top. These cases used to appear to > work perfectly for most counters when the kernel did blind truncations. > Clamping breaks the API. Not returing ENOMEM breaks the API. > > In my version, this is handled as specified by the API by truncating and > returning ENOMEM. Then: > - top sees the ENOMEM and mishandles it by aborting > - systat sees the ENOMEM (and also sees a short count, if it has the newer > breakage of hard-coding 64-bit counters instead of u_int ones, and is > run on a kernel with u_int counters) and mishandles it better by > printing an error message but not aborting. Thus it appears to work > just as well as when the kernel did blind truncation, except for the > error message. ENOMEM is, of course, the situation which I want to avoid. > > Clamping would be difficult for the application to handle even if an > error is returned. This would be like the situation for clamping for > strtoul(), but worse since it changes the API. Many applications don't > understand how to handle errno for strtoul(), but they do do a bogus > check of the clamped value. For sysctl(), clamping is not part of > the API now, so applications shouldn't check for the clamped values. > Ones that work with deltas like systat -v would see the counters stop > incrementing when the clamped value is reached, while truncated values > allow them to continue to appear to work perfectly. > > > diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c > > index 5f4cd46ab1e..93d5161de89 100644 > > --- a/sys/vm/vm_meter.c > > +++ b/sys/vm/vm_meter.c > > @@ -266,8 +266,29 @@ static SYSCTL_NODE(_vm_stats, OID_AUTO, vm, CTLFLAG_RW, 0, > > "VM meter vm stats"); > > SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc stats"); > > > > +static int > > +sysctl_handle_vmstat(SYSCTL_HANDLER_ARGS) > > +{ > > + uint64_t out; > > +#ifdef COMPAT_FREEBSD11 > > + uint32_t out1; > > +#endif > > The extra wrapper and the ifdef limit the damage from the API change. > Otherwise, I don't like them. > > I prefer my variable name out32 to the nondescript out1. ('out' should > also be renamed out64, but I wanted to keep the diffs small.) Changed to the out32 name. > > > + > > + out = counter_u64_fetch(*(counter_u64_t *)arg1); > > +#ifdef COMPAT_FREEBSD11 > > + if (req->oldlen == sizeof(uint32_t)) { > > sizeof(uint32_t) is an obfuscated spelling of '4'. The size is already > hard-coded in '32'. This depends on sizeof(char) being 1. It is, and > won't change. POSIX started specifying this in 2001, and the mere > existence of uint8_t probably requires 8-bit chars since u_char must > be the smallest type of an object. This depends on the size of a u_int > being 32 bits/4 bytes in the old ABI. This won't change, and is already > hard-coded as 32, as it must be because sizeof(u_int) may change. I prefer the sizeof over 4. > > > + out1 = 0xffffffff; > > + if (out < out1) > > + out1 = out; > > This does the clamping. Clamping is probably better expressed as: > > out1 = MIN(out, 0xffffffff) Changed as well. > > > + return (SYSCTL_OUT(req, &out1, sizeof(uint32_t))); > > Here sizeof(uint32_t) is an obfuscated spelling of sizeof(out1). I think > the sizeof() is justified in this case, to limit the hard-coding to of > sizes to 1 place. Truncation by assigment to the destination variable also > helps limit this > (sysctl_bufspace() could also be improved by truncation by assignment. > Its integers are signed, so the result is implementation-defined, but > we know that it is benign 2's complement and don't really care what it > is provided it is reasonable. This is better than laboriously checking > the lower limit or neglecting to check it). > Here the limit 0xffffffff also depends on the size. Yes, there is no UINT32_MAX, and never will. > > > + } > > +#endif > > + return (SYSCTL_OUT(req, &out, sizeof(uint64_t))); > > +} > > + > > #define VM_STATS(parent, var, descr) \ > > - SYSCTL_COUNTER_U64(parent, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, descr) > > + SYSCTL_OID(parent, OID_AUTO, var, CTLTYPE_U64 | CTLFLAG_MPSAFE | \ > > + CTLFLAG_RD, &vm_cnt.var, 0, sysctl_handle_vmstat, "QU", descr); > > I see a new problem, shared with my version. The sysctl data says that this > sysctl is pure 64 bits, but it can return 32 bits. The sysctl data just > can't describe the variation. I guess this is not much a problem, since it > takes magic to read the sysctl data from the kernel and not many programs > except sysctl know how to do it. There programs will see the pure 64 > bits and only attempt to use 64 bit types. It can return 32bit only on improper use, which we allow for ABI compat. So I do not see this as a problem either. diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index 5f4cd46ab1e..67f24609b5a 100644 --- a/sys/vm/vm_meter.c +++ b/sys/vm/vm_meter.c @@ -266,8 +266,27 @@ static SYSCTL_NODE(_vm_stats, OID_AUTO, vm, CTLFLAG_RW, 0, "VM meter vm stats"); SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc stats"); +static int +sysctl_handle_vmstat(SYSCTL_HANDLER_ARGS) +{ + uint64_t out; +#ifdef COMPAT_FREEBSD11 + uint32_t out32; +#endif + + out = counter_u64_fetch(*(counter_u64_t *)arg1); +#ifdef COMPAT_FREEBSD11 + if (req->oldlen == sizeof(uint32_t)) { + out32 = MIN(out, 0xffffffff); + return (SYSCTL_OUT(req, &out32, sizeof(uint32_t))); + } +#endif + return (SYSCTL_OUT(req, &out, sizeof(uint64_t))); +} + #define VM_STATS(parent, var, descr) \ - SYSCTL_COUNTER_U64(parent, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, descr) + SYSCTL_OID(parent, OID_AUTO, var, CTLTYPE_U64 | CTLFLAG_MPSAFE | \ + CTLFLAG_RD, &vm_cnt.var, 0, sysctl_handle_vmstat, "QU", descr); #define VM_STATS_VM(var, descr) VM_STATS(_vm_stats_vm, var, descr) #define VM_STATS_SYS(var, descr) VM_STATS(_vm_stats_sys, var, descr) From owner-svn-src-all@freebsd.org Tue May 2 13:31:35 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FF69D5A22F; Tue, 2 May 2017 13:31:35 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id D055AEFA; Tue, 2 May 2017 13:31:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 3F6D2428B61; Tue, 2 May 2017 23:31:25 +1000 (AEST) Date: Tue, 2 May 2017 23:31:21 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , Alan Somers , Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... In-Reply-To: <20170502121711.GE1622@kib.kiev.ua> Message-ID: <20170502223324.P1508@besplex.bde.org> References: <201704171734.v3HHYlf5022945@repo.freebsd.org> <20170419130428.J956@besplex.bde.org> <20170430201324.GV1622@kib.kiev.ua> <20170501163725.U972@besplex.bde.org> <20170502095527.GB1622@kib.kiev.ua> <20170502203703.I1176@besplex.bde.org> <20170502121711.GE1622@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=mHWIdm293UD_E3JX448A:9 a=puMN4P7tOccZgmq3:21 a=Us1PpGA1RNK12n6-:21 a=Wqx8G2oh0YgEZZqx:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 13:31:35 -0000 On Tue, 2 May 2017, Konstantin Belousov wrote: > On Tue, May 02, 2017 at 09:25:40PM +1000, Bruce Evans wrote: >> On Tue, 2 May 2017, Konstantin Belousov wrote: >> >>> On Mon, May 01, 2017 at 06:25:11PM +1000, Bruce Evans wrote: >>>> XX Index: subr_counter.c >>>> XX =================================================================== >>>> XX --- subr_counter.c (revision 317604) >>>> XX +++ subr_counter.c (working copy) >>>> XX @@ -78,11 +78,15 @@ >>>> XX sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS) >>>> XX { >>>> XX uint64_t out; >>>> XX + uint32_t out32; >>>> XX int error; >>>> XX >>>> XX out = counter_u64_fetch(*(counter_u64_t *)arg1); >>>> XX >>>> XX - error = SYSCTL_OUT(req, &out, sizeof(uint64_t)); >>>> XX + if (req->oldlen == 4 && (out32 = out) == out) >>>> XX + error = SYSCTL_OUT(req, &out32, sizeof(out32)); >>>> XX + else >>>> XX + error = SYSCTL_OUT(req, &out, sizeof(out)); >>>> XX >>>> XX if (error || !req->newptr) >>>> XX return (error); >>>> >>>> This does the minimum necessary to fix the current problem. >>>> >>>> This works until the counters become too large for a u_int. There >>>> could be an option to get truncation with no error, but that would >>>> require an API change, so applications should be required to do the >>>> truncation for themself if that is what they want. >>> >>> Yes, this is approximately what I consider to be enough fix, but with >>> some details which I do not like and which did not worked well on my >>> test machine with enough memory to generate lot of increments. >>> >>> Below is what I consider to be good enough. I will proceed with this >>> version unless very strong objections appear. >> >> I prefer my version. It is the same as for sysctl_bufspace(), except >> for simplifications and bug fixes that are easier because the types >> are unsigned. >> >> Your version is especially broken for the case of a lot of increments. > You consider the 'differentiators' as the main users, but I only want > systat and top to not abort, I have no intent of making them work > for updated counters if overflown. Instead, I want something human-visible > so that person looking at raw counters values using old tools detected the > failure. Clamping doesn't work for that either. Truncating either just works using differences like it has done for 30 years or so, or gives weirder values that clamping. Arguably, the API is that the counters may wrap, and applications must handle this as well as possible by sampling them more often than they wrap, so that only the initial values might be wrong. Applications should also have attempt to guess when the initial values are wrong, and print hints about this that are more visible than printing blindly wrapped value. >> Clamping breaks many cases in systat -v which just needs unsigned counters >> to calculate small differences. Not many counters overflow faster than >> the refresh interval in systat or top. These cases used to appear to >> work perfectly for most counters when the kernel did blind truncations. >> Clamping breaks the API. Not returing ENOMEM breaks the API. >> >> In my version, this is handled as specified by the API by truncating and >> returning ENOMEM. Then: >> - top sees the ENOMEM and mishandles it by aborting >> - systat sees the ENOMEM (and also sees a short count, if it has the newer >> breakage of hard-coding 64-bit counters instead of u_int ones, and is >> run on a kernel with u_int counters) and mishandles it better by >> printing an error message but not aborting. Thus it appears to work >> just as well as when the kernel did blind truncation, except for the >> error message. > ENOMEM is, of course, the situation which I want to avoid. Then you have to return no error, but truncate the value instead of clamping. Anything else is incompatible. To find the buggy applications, it is better to return a new errno, not ENOMEM. EOVERFLOW resulted in top aborting with a useful error message. >>> ... >>> + out = counter_u64_fetch(*(counter_u64_t *)arg1); >>> +#ifdef COMPAT_FREEBSD11 >>> + if (req->oldlen == sizeof(uint32_t)) { >> >> sizeof(uint32_t) is an obfuscated spelling of '4'. The size is already >> hard-coded in '32'. This depends on sizeof(char) being 1. It is, and >> won't change. POSIX started specifying this in 2001, and the mere >> existence of uint8_t probably requires 8-bit chars since u_char must >> be the smallest type of an object. This depends on the size of a u_int >> being 32 bits/4 bytes in the old ABI. This won't change, and is already >> hard-coded as 32, as it must be because sizeof(u_int) may change. > I prefer the sizeof over 4. sizeof is really bloated when you handle all the sizes as in my larger patch. The basic sizes are 1, 2, 4 and 8 bytes (and possibly a larger intmax_t), and it is a detail that the sizes in the integer types are in bits. However, once we have set up the variables to match the sizes in bytes, it is not so bad to use sizeof(var) instead of sizeof(typename). The size is then hard-coded in only 1 place. That works here too: use sizeof(out32). >>> + out1 = 0xffffffff; >>> + if (out < out1) >>> + out1 = out; >> >> This does the clamping. Clamping is probably better expressed as: >> >> out1 = MIN(out, 0xffffffff) > Changed as well. I forgot to mention that I don't really like MIN(). It is an unsafe macro with ugly spelling indicating that it is unsafe. 4.4BSD removed it in the kernel and tried to replace it by the imin() family of inline functions, but this API is hard to use because it is not type-generic. The kernel was reinfected with MIN() via contrib'ed code using home-made versions of MIN(). uqmin() would work here, but quad_t is another mistake... >> >>> + return (SYSCTL_OUT(req, &out1, sizeof(uint32_t))); sizeof(var) works even better here when it is used above. >> >> Here sizeof(uint32_t) is an obfuscated spelling of sizeof(out1). I think >> the sizeof() is justified in this case, to limit the hard-coding to of >> sizes to 1 place. Truncation by assigment to the destination variable also >> helps limit this >> (sysctl_bufspace() could also be improved by truncation by assignment. >> Its integers are signed, so the result is implementation-defined, but >> we know that it is benign 2's complement and don't really care what it >> is provided it is reasonable. This is better than laboriously checking >> the lower limit or neglecting to check it). >> Here the limit 0xffffffff also depends on the size. > Yes, there is no UINT32_MAX, and never will. You mean that you don't want to use it here. Of course, UINT32_MAX does exist, and is quite delicate due to complications to give it the correct type. It must have the type of its default promotion, and this depends on the size of int and long. So it is defined in an MD file, and has an unnecessary U suffix on i386. This contrasts with UINT16_MAX, which is also defined in an MD file but has type signed int on all arches and must be defined without a U suffix, since all arches have more than 16 bits in it. There is also the UINT32_C() macro which has to append U on x86 since smaller constants or the same constant in decimal would not be naturally unsigned. >>> + } >>> +#endif >>> + return (SYSCTL_OUT(req, &out, sizeof(uint64_t))); >>> +} >>> + >>> #define VM_STATS(parent, var, descr) \ >>> - SYSCTL_COUNTER_U64(parent, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, descr) >>> + SYSCTL_OID(parent, OID_AUTO, var, CTLTYPE_U64 | CTLFLAG_MPSAFE | \ >>> + CTLFLAG_RD, &vm_cnt.var, 0, sysctl_handle_vmstat, "QU", descr); >> >> I see a new problem, shared with my version. The sysctl data says that this >> sysctl is pure 64 bits, but it can return 32 bits. The sysctl data just >> can't describe the variation. I guess this is not much a problem, since it >> takes magic to read the sysctl data from the kernel and not many programs >> except sysctl know how to do it. There programs will see the pure 64 >> bits and only attempt to use 64 bit types. > > It can return 32bit only on improper use, which we allow for ABI compat. > So I do not see this as a problem either. I'm trying to fix the API. Another bug in the public API is that there is no way to probe for the sign of a type. This is the only useful thing in the sysct data. > diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c > index 5f4cd46ab1e..67f24609b5a 100644 > --- a/sys/vm/vm_meter.c > +++ b/sys/vm/vm_meter.c > @@ -266,8 +266,27 @@ static SYSCTL_NODE(_vm_stats, OID_AUTO, vm, CTLFLAG_RW, 0, > "VM meter vm stats"); > SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc stats"); > > +static int > +sysctl_handle_vmstat(SYSCTL_HANDLER_ARGS) > +{ > + uint64_t out; > +#ifdef COMPAT_FREEBSD11 > + uint32_t out32; > +#endif > + > + out = counter_u64_fetch(*(counter_u64_t *)arg1); > +#ifdef COMPAT_FREEBSD11 > + if (req->oldlen == sizeof(uint32_t)) { > + out32 = MIN(out, 0xffffffff); Incompatible for negative advantages. It should truncate. > + return (SYSCTL_OUT(req, &out32, sizeof(uint32_t))); It seems to be necessary to drop the error reporting for compatility. How does sysctl_bufspace() work when it intentionally keeps the error reporting and even has a comment about this? > + } > +#endif > + return (SYSCTL_OUT(req, &out, sizeof(uint64_t))); > +} This still has the style bug 'sizeof(typename)'. If you want to use the type name too much, then you can also use it to spell 0xffffffff as (uint32_t)-1. Then the size 4 bytes would be consistently represented as 32 bits. Going from type variable out32 to its maximum should be spellable as __maxof(out32) but __maxof() doesn't exist. > + > #define VM_STATS(parent, var, descr) \ > - SYSCTL_COUNTER_U64(parent, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, descr) > + SYSCTL_OID(parent, OID_AUTO, var, CTLTYPE_U64 | CTLFLAG_MPSAFE | \ > + CTLFLAG_RD, &vm_cnt.var, 0, sysctl_handle_vmstat, "QU", descr); > #define VM_STATS_VM(var, descr) VM_STATS(_vm_stats_vm, var, descr) > #define VM_STATS_SYS(var, descr) VM_STATS(_vm_stats_sys, var, descr) Bruce From owner-svn-src-all@freebsd.org Tue May 2 13:38:23 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1190DD5A57E; Tue, 2 May 2017 13:38:23 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7E9612F7; Tue, 2 May 2017 13:38:22 +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 v42DcLCf076667; Tue, 2 May 2017 13:38:21 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v42DcKpq076654; Tue, 2 May 2017 13:38:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705021338.v42DcKpq076654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 2 May 2017 13:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317678 - in head/usr.bin/grep: . nls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 13:38:23 -0000 Author: emaste Date: Tue May 2 13:38:20 2017 New Revision: 317678 URL: https://svnweb.freebsd.org/changeset/base/317678 Log: bsdgrep: Add GNU compatible version string indicator As reported in r218614 it's useful to have an indication of whether or not BSD grep was built with GNU_GREP_COMPAT. Submitted by: Kyle Evans Reported by: mandree Differential Revision: https://reviews.freebsd.org/D10451 Modified: head/usr.bin/grep/Makefile head/usr.bin/grep/grep.c head/usr.bin/grep/nls/C.msg head/usr.bin/grep/nls/es_ES.ISO8859-1.msg head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg head/usr.bin/grep/nls/ja_JP.SJIS.msg head/usr.bin/grep/nls/ja_JP.UTF-8.msg head/usr.bin/grep/nls/ja_JP.eucJP.msg head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg head/usr.bin/grep/nls/ru_RU.KOI8-R.msg head/usr.bin/grep/nls/uk_UA.UTF-8.msg head/usr.bin/grep/nls/zh_CN.UTF-8.msg Modified: head/usr.bin/grep/Makefile ============================================================================== --- head/usr.bin/grep/Makefile Tue May 2 10:13:50 2017 (r317677) +++ head/usr.bin/grep/Makefile Tue May 2 13:38:20 2017 (r317678) @@ -82,7 +82,7 @@ CFLAGS+= -DWITHOUT_BZIP2 .endif .if ${MK_GNU_GREP_COMPAT} != "no" -CFLAGS+= -I${DESTDIR}/usr/include/gnu +CFLAGS+= -I${DESTDIR}/usr/include/gnu -DWITH_GNU LIBADD+= gnuregex .endif Modified: head/usr.bin/grep/grep.c ============================================================================== --- head/usr.bin/grep/grep.c Tue May 2 10:13:50 2017 (r317677) +++ head/usr.bin/grep/grep.c Tue May 2 13:38:20 2017 (r317678) @@ -74,6 +74,7 @@ const char *errstr[] = { /* 7*/ "\t[--null] [pattern] [file ...]\n", /* 8*/ "Binary file %s matches\n", /* 9*/ "%s (BSD grep) %s\n", +/* 10*/ "%s (BSD grep, GNU compatible) %s\n", }; /* Flags passed to regcomp() and regexec() */ @@ -596,7 +597,11 @@ main(int argc, char *argv[]) filebehave = FILE_MMAP; break; case 'V': +#ifdef WITH_GNU + printf(getstr(10), getprogname(), VERSION); +#else printf(getstr(9), getprogname(), VERSION); +#endif exit(0); case 'v': vflag = true; Modified: head/usr.bin/grep/nls/C.msg ============================================================================== --- head/usr.bin/grep/nls/C.msg Tue May 2 10:13:50 2017 (r317677) +++ head/usr.bin/grep/nls/C.msg Tue May 2 13:38:20 2017 (r317678) @@ -11,3 +11,4 @@ $quote " 7 "\t[--null] [pattern] [file ...]\n" 8 "Binary file %s matches\n" 9 "%s (BSD grep) %s\n" +10 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/es_ES.ISO8859-1.msg ============================================================================== --- head/usr.bin/grep/nls/es_ES.ISO8859-1.msg Tue May 2 10:13:50 2017 (r317677) +++ head/usr.bin/grep/nls/es_ES.ISO8859-1.msg Tue May 2 13:38:20 2017 (r317678) @@ -11,3 +11,4 @@ $quote " 7 "\t[--null] [pauta] [fichero ...]\n" 8 "fichero binario %s se ajusta\n" 9 "%s (BSD grep) %s\n" +10 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg ============================================================================== --- head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg Tue May 2 10:13:50 2017 (r317677) +++ head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg Tue May 2 13:38:20 2017 (r317678) @@ -11,3 +11,4 @@ $quote " 7 "\t[--null] [pauta] [ficheiro ...]\n" 8 "ficheiro binario %s conforma\n" 9 "%s (BSD grep) %s\n" +10 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg ============================================================================== --- head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg Tue May 2 10:13:50 2017 (r317677) +++ head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg Tue May 2 13:38:20 2017 (r317678) @@ -11,3 +11,4 @@ $quote " 7 "\t[--null] [minta] [fájl ...]\n" 8 "%s bináris fájl illeszkedik\n" 9 "%s (BSD grep) %s\n" +10 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/ja_JP.SJIS.msg ============================================================================== --- head/usr.bin/grep/nls/ja_JP.SJIS.msg Tue May 2 10:13:50 2017 (r317677) +++ head/usr.bin/grep/nls/ja_JP.SJIS.msg Tue May 2 13:38:20 2017 (r317678) @@ -11,3 +11,4 @@ $quote " 7 "\t[--null] [ƒpƒ^[ƒ“] [ƒtƒ@ƒCƒ‹–¼ ...]\n" 8 "ƒoƒCƒiƒŠƒtƒ@ƒCƒ‹ %s ‚Ƀ}ƒbƒ`‚µ‚Ü‚µ‚½\n" 9 "%s (BSD grep) %s\n" +10 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/ja_JP.UTF-8.msg ============================================================================== --- head/usr.bin/grep/nls/ja_JP.UTF-8.msg Tue May 2 10:13:50 2017 (r317677) +++ head/usr.bin/grep/nls/ja_JP.UTF-8.msg Tue May 2 13:38:20 2017 (r317678) @@ -11,3 +11,4 @@ $quote " 7 "\t[--null] [パターン] [ファイルå ...]\n" 8 "ãƒã‚¤ãƒŠãƒªãƒ•ã‚¡ã‚¤ãƒ« %s ã«ãƒžãƒƒãƒã—ã¾ã—ãŸ\n" 9 "%s (BSD grep) %s\n" +10 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/ja_JP.eucJP.msg ============================================================================== --- head/usr.bin/grep/nls/ja_JP.eucJP.msg Tue May 2 10:13:50 2017 (r317677) +++ head/usr.bin/grep/nls/ja_JP.eucJP.msg Tue May 2 13:38:20 2017 (r317678) @@ -11,3 +11,4 @@ $quote " 7 "\t[--null] [¥Ñ¥¿¡¼¥ó] [¥Õ¥¡¥¤¥ë̾ ...]\n" 8 "¥Ð¥¤¥Ê¥ê¥Õ¥¡¥¤¥ë %s ¤Ë¥Þ¥Ã¥Á¤·¤Þ¤·¤¿\n" 9 "%s (BSD grep) %s\n" +10 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg ============================================================================== --- head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg Tue May 2 10:13:50 2017 (r317677) +++ head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg Tue May 2 13:38:20 2017 (r317678) @@ -11,3 +11,4 @@ $quote " 7 "\t[--null] [padrão] [arquivo ...]\n" 8 "arquivo binário %s casa com o padrão\n" 9 "%s (BSD grep) %s\n" +10 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/ru_RU.KOI8-R.msg ============================================================================== --- head/usr.bin/grep/nls/ru_RU.KOI8-R.msg Tue May 2 10:13:50 2017 (r317677) +++ head/usr.bin/grep/nls/ru_RU.KOI8-R.msg Tue May 2 13:38:20 2017 (r317678) @@ -11,3 +11,4 @@ $quote " 7 "\t[--null] [ÛÁÂÌÏÎ] [ÆÁÊÌ ...]\n" 8 "Ä×ÏÉÞÎÙÊ ÆÁÊÌ %s ÓÏ×ÐÁÄÁÅÔ\n" 9 "%s (BSD grep) %s\n" +10 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/uk_UA.UTF-8.msg ============================================================================== --- head/usr.bin/grep/nls/uk_UA.UTF-8.msg Tue May 2 10:13:50 2017 (r317677) +++ head/usr.bin/grep/nls/uk_UA.UTF-8.msg Tue May 2 13:38:20 2017 (r317678) @@ -10,3 +10,4 @@ $quote " 7 "\t[--null] [шаблон] [файл ...]\n" 8 "двійковий файл %s Ñпівпадає\n" 9 "%s (BSD grep) %s\n" +10 "%s (BSD grep, GNU compatible) %s\n" Modified: head/usr.bin/grep/nls/zh_CN.UTF-8.msg ============================================================================== --- head/usr.bin/grep/nls/zh_CN.UTF-8.msg Tue May 2 10:13:50 2017 (r317677) +++ head/usr.bin/grep/nls/zh_CN.UTF-8.msg Tue May 2 13:38:20 2017 (r317678) @@ -11,3 +11,4 @@ $quote " 7 "\t[--null] [模å¼] [文件å ...]\n" 8 "二进制文件 %s 包å«æ¨¡å¼\n" 9 "%s (BSD grep) %s\n" +10 "%s (BSD grep, GNU compatible) %s\n" From owner-svn-src-all@freebsd.org Tue May 2 13:47:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B66F0D5A842; Tue, 2 May 2017 13:47:17 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 936CB1A44; Tue, 2 May 2017 13:47:17 +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 v42DlGhg080753; Tue, 2 May 2017 13:47:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v42DlFYj080741; Tue, 2 May 2017 13:47:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201705021347.v42DlFYj080741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 2 May 2017 13:47:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317679 - head/usr.bin/grep/nls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 13:47:17 -0000 Author: emaste Date: Tue May 2 13:47:15 2017 New Revision: 317679 URL: https://svnweb.freebsd.org/changeset/base/317679 Log: bsdgrep: correct nls usage data after r317049 r317049 added -z/--null-data to BSD grep but missed the update to nls catalogs. Submitted by: Kyle Evans Differential Revision: https://reviews.freebsd.org/D10456 Modified: head/usr.bin/grep/nls/C.msg head/usr.bin/grep/nls/es_ES.ISO8859-1.msg head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg head/usr.bin/grep/nls/ja_JP.SJIS.msg head/usr.bin/grep/nls/ja_JP.UTF-8.msg head/usr.bin/grep/nls/ja_JP.eucJP.msg head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg head/usr.bin/grep/nls/ru_RU.KOI8-R.msg head/usr.bin/grep/nls/uk_UA.UTF-8.msg head/usr.bin/grep/nls/zh_CN.UTF-8.msg Modified: head/usr.bin/grep/nls/C.msg ============================================================================== --- head/usr.bin/grep/nls/C.msg Tue May 2 13:38:20 2017 (r317678) +++ head/usr.bin/grep/nls/C.msg Tue May 2 13:47:15 2017 (r317679) @@ -5,7 +5,7 @@ $quote " 1 "(standard input)" 2 "cannot read bzip2 compressed file" 3 "unknown %s option" -4 "usage: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]\n" +4 "usage: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A num] [-B num] [-C[num]]\n" 5 "\t[-e pattern] [-f file] [--binary-files=value] [--color=when]\n" 6 "\t[--context[=num]] [--directories=action] [--label] [--line-buffered]\n" 7 "\t[--null] [pattern] [file ...]\n" Modified: head/usr.bin/grep/nls/es_ES.ISO8859-1.msg ============================================================================== --- head/usr.bin/grep/nls/es_ES.ISO8859-1.msg Tue May 2 13:38:20 2017 (r317678) +++ head/usr.bin/grep/nls/es_ES.ISO8859-1.msg Tue May 2 13:47:15 2017 (r317679) @@ -5,7 +5,7 @@ $quote " 1 "(entrada estándar)" 2 "no se puede leer el fichero comprimido bzip2" 3 "opción desconocida de %s" -4 "uso: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A no] [-B no] [-C[no]]\n" +4 "uso: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A no] [-B no] [-C[no]]\n" 5 "\t[-e pauta] [-f fichero] [--binary-files=valor] [--color=cuando]\n" 6 "\t[--context[=no]] [--directories=acción] [--label] [--line-buffered]\n" 7 "\t[--null] [pauta] [fichero ...]\n" Modified: head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg ============================================================================== --- head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg Tue May 2 13:38:20 2017 (r317678) +++ head/usr.bin/grep/nls/gl_ES.ISO8859-1.msg Tue May 2 13:47:15 2017 (r317679) @@ -5,7 +5,7 @@ $quote " 1 "(entrada estándar)" 2 "non se pode ler o ficheiro comprimido bzip2" 3 "opción descoñecida de %s" -4 "uso: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A no] [-B no] [-C[no]]\n" +4 "uso: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A no] [-B no] [-C[no]]\n" 5 "\t[-e pauta] [-f ficheiro] [--binary-files=valor] [--color=cando]\n" 6 "\t[--context[=no]] [--directories=acción] [--label] [--line-buffered]\n" 7 "\t[--null] [pauta] [ficheiro ...]\n" Modified: head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg ============================================================================== --- head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg Tue May 2 13:38:20 2017 (r317678) +++ head/usr.bin/grep/nls/hu_HU.ISO8859-2.msg Tue May 2 13:47:15 2017 (r317679) @@ -5,7 +5,7 @@ $quote " 1 "(szabványos bemenet)" 2 "bzip2 tömörített fájl nem olvasható" 3 "ismeretlen %s opció" -4 "használat: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A szám] [-B szám] [-C[szám]]\n" +4 "használat: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A szám] [-B szám] [-C[szám]]\n" 5 "\t[-e minta] [-f fájl] [--binary-files=érték] [--color=mikor]\n" 6 "\t[--context[=szám]] [--directories=mûvelet] [--label] [--line-buffered]\n" 7 "\t[--null] [minta] [fájl ...]\n" Modified: head/usr.bin/grep/nls/ja_JP.SJIS.msg ============================================================================== --- head/usr.bin/grep/nls/ja_JP.SJIS.msg Tue May 2 13:38:20 2017 (r317678) +++ head/usr.bin/grep/nls/ja_JP.SJIS.msg Tue May 2 13:47:15 2017 (r317679) @@ -5,7 +5,7 @@ $quote " 1 "(•W€“ü—Í)" 2 "bzip2 ˆ³kƒtƒ@ƒCƒ‹‚ð“Ç‚Ýž‚Þ‚±‚Æ‚ª‚Å‚«‚Ü‚¹‚ñ" 3 "%s ƒIƒvƒVƒ‡ƒ“‚ÌŽw’è’l‚ÉŒë‚肪‚ ‚è‚Ü‚·" -4 "Žg‚¢•û: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A ”Žš] [-B ”Žš] [-C[”Žš]]\n" +4 "Žg‚¢•û: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A ”Žš] [-B ”Žš] [-C[”Žš]]\n" 5 "\t[-e ƒpƒ^[ƒ“] [-f ƒtƒ@ƒCƒ‹–¼] [--binary-files=’l] [--color=’l]\n" 6 "\t[--context[=”Žš]] [--directories=“®ì] [--label] [--line-buffered]\n" 7 "\t[--null] [ƒpƒ^[ƒ“] [ƒtƒ@ƒCƒ‹–¼ ...]\n" Modified: head/usr.bin/grep/nls/ja_JP.UTF-8.msg ============================================================================== --- head/usr.bin/grep/nls/ja_JP.UTF-8.msg Tue May 2 13:38:20 2017 (r317678) +++ head/usr.bin/grep/nls/ja_JP.UTF-8.msg Tue May 2 13:47:15 2017 (r317679) @@ -5,7 +5,7 @@ $quote " 1 "(標準入力)" 2 "bzip2 圧縮ファイルを読ã¿è¾¼ã‚€ã“ã¨ãŒã§ãã¾ã›ã‚“" 3 "%s オプションã®æŒ‡å®šå€¤ã«èª¤ã‚ŠãŒã‚ã‚Šã¾ã™" -4 "使ã„æ–¹: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A æ•°å­—] [-B æ•°å­—] [-C[æ•°å­—]]\n" +4 "使ã„æ–¹: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A æ•°å­—] [-B æ•°å­—] [-C[æ•°å­—]]\n" 5 "\t[-e パターン] [-f ファイルå] [--binary-files=値] [--color=値]\n" 6 "\t[--context[=æ•°å­—]] [--directories=動作] [--label] [--line-buffered]\n" 7 "\t[--null] [パターン] [ファイルå ...]\n" Modified: head/usr.bin/grep/nls/ja_JP.eucJP.msg ============================================================================== --- head/usr.bin/grep/nls/ja_JP.eucJP.msg Tue May 2 13:38:20 2017 (r317678) +++ head/usr.bin/grep/nls/ja_JP.eucJP.msg Tue May 2 13:47:15 2017 (r317679) @@ -5,7 +5,7 @@ $quote " 1 "(ɸ½àÆþÎÏ)" 2 "bzip2 °µ½Ì¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó" 3 "%s ¥ª¥×¥·¥ç¥ó¤Î»ØÄêÃͤ˸í¤ê¤¬¤¢¤ê¤Þ¤¹" -4 "»È¤¤Êý: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A ¿ô»ú] [-B ¿ô»ú] [-C[¿ô»ú]]\n" +4 "»È¤¤Êý: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A ¿ô»ú] [-B ¿ô»ú] [-C[¿ô»ú]]\n" 5 "\t[-e ¥Ñ¥¿¡¼¥ó] [-f ¥Õ¥¡¥¤¥ë̾] [--binary-files=ÃÍ] [--color=ÃÍ]\n" 6 "\t[--context[=¿ô»ú]] [--directories=Æ°ºî] [--label] [--line-buffered]\n" 7 "\t[--null] [¥Ñ¥¿¡¼¥ó] [¥Õ¥¡¥¤¥ë̾ ...]\n" Modified: head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg ============================================================================== --- head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg Tue May 2 13:38:20 2017 (r317678) +++ head/usr.bin/grep/nls/pt_BR.ISO8859-1.msg Tue May 2 13:47:15 2017 (r317679) @@ -5,7 +5,7 @@ $quote " 1 "(entrada padrão)" 2 "não se posso ler o fichero comprimido bzip2" 3 "opcão não conhecida de %s" -4 "uso: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A num] [-B num] [-C[num]]\n" +4 "uso: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A num] [-B num] [-C[num]]\n" 5 "\t[-e padrão] [-f arquivo] [--binary-files=valor] [--color=quando]\n" 6 "\t[--context[=num]] [--directories=ação] [--label] [--line-buffered]\n" 7 "\t[--null] [padrão] [arquivo ...]\n" Modified: head/usr.bin/grep/nls/ru_RU.KOI8-R.msg ============================================================================== --- head/usr.bin/grep/nls/ru_RU.KOI8-R.msg Tue May 2 13:38:20 2017 (r317678) +++ head/usr.bin/grep/nls/ru_RU.KOI8-R.msg Tue May 2 13:47:15 2017 (r317679) @@ -5,7 +5,7 @@ $quote " 1 "(ÓÔÁÎÄÁÒÔÎÙÊ ××ÏÄ)" 2 "ÎÅ ÍÏÇÕ ÐÒÏÞÉÔÁÔØ ÓÖÁÔÙÊ × bzip2 ÆÁÊÌ" 3 "ÎÅÉÚ×ÅÓÔÎÙÊ ËÌÀÞ %s" -4 "ÉÓÐÏÌØÚÏ×ÁÎÉÅ: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A ÞÉÓ] [-B ÞÉÓ] [-C[ÞÉÓ]]\n" +4 "ÉÓÐÏÌØÚÏ×ÁÎÉÅ: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A ÞÉÓ] [-B ÞÉÓ] [-C[ÞÉÓ]]\n" 5 "\t[-e ÛÁÂÌÏÎ] [-f ÆÁÊÌ] [--binary-files=ÚÎÁÞÅÎÉÅ] [--color=ËÏÇÄÁ]\n" 6 "\t[--context[=ÞÉÓ]] [--directories=ÄÅÊÓÔ×ÉÅ] [--label] [--line-buffered]\n" 7 "\t[--null] [ÛÁÂÌÏÎ] [ÆÁÊÌ ...]\n" Modified: head/usr.bin/grep/nls/uk_UA.UTF-8.msg ============================================================================== --- head/usr.bin/grep/nls/uk_UA.UTF-8.msg Tue May 2 13:38:20 2017 (r317678) +++ head/usr.bin/grep/nls/uk_UA.UTF-8.msg Tue May 2 13:47:15 2017 (r317679) @@ -4,7 +4,7 @@ $quote " 1 "(Ñтандартний ввід)" 2 "не можу прочитати ÑтиÑнутий bzip2 файл" 3 "невiдома Ð¾Ð¿Ñ†Ñ–Ñ %s" -4 "викориÑтаннÑ: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A чиÑ] [-B чиÑ] [-C[чиÑ]]\n" +4 "викориÑтаннÑ: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A чиÑ] [-B чиÑ] [-C[чиÑ]]\n" 5 "\t[-e шаблон] [-f файл] [--binary-files=значеннÑ] [--color=коли]\n" 6 "\t[--context[=чиÑ] [--directories=діÑ] [--label] [--line-buffered]\n" 7 "\t[--null] [шаблон] [файл ...]\n" Modified: head/usr.bin/grep/nls/zh_CN.UTF-8.msg ============================================================================== --- head/usr.bin/grep/nls/zh_CN.UTF-8.msg Tue May 2 13:38:20 2017 (r317678) +++ head/usr.bin/grep/nls/zh_CN.UTF-8.msg Tue May 2 13:47:15 2017 (r317679) @@ -5,7 +5,7 @@ $quote " 1 "(标准输入)" 2 "è¯»å– bzip2 压缩文件时出错" 3 "选项 %s 无法识别" -4 "用法: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZ] [-A 行数] [-B 行数] [-C[行数]]\n" +4 "用法: %s [-abcDEFGHhIiJLlmnOoPqRSsUVvwxZz] [-A 行数] [-B 行数] [-C[行数]]\n" 5 "\t[-e 模å¼] [-f 文件] [--binary-files=值] [--color=何时]\n" 6 "\t[--context[=行数]] [--directories=动作] [--label] [--line-buffered]\n" 7 "\t[--null] [模å¼] [文件å ...]\n" From owner-svn-src-all@freebsd.org Tue May 2 14:48:34 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67087D5AFA7; Tue, 2 May 2017 14:48:34 +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 0D95E974; Tue, 2 May 2017 14:48:33 +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 v42EmOgw009725 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 2 May 2017 17:48:24 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v42EmOgw009725 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v42EmNSH009724; Tue, 2 May 2017 17:48:23 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 2 May 2017 17:48:23 +0300 From: Konstantin Belousov To: Bruce Evans Cc: Alan Somers , Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... Message-ID: <20170502144823.GH1622@kib.kiev.ua> References: <201704171734.v3HHYlf5022945@repo.freebsd.org> <20170419130428.J956@besplex.bde.org> <20170430201324.GV1622@kib.kiev.ua> <20170501163725.U972@besplex.bde.org> <20170502095527.GB1622@kib.kiev.ua> <20170502203703.I1176@besplex.bde.org> <20170502121711.GE1622@kib.kiev.ua> <20170502223324.P1508@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170502223324.P1508@besplex.bde.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 14:48:34 -0000 On Tue, May 02, 2017 at 11:31:21PM +1000, Bruce Evans wrote: > On Tue, 2 May 2017, Konstantin Belousov wrote: > > ENOMEM is, of course, the situation which I want to avoid. > > Then you have to return no error, but truncate the value instead of > clamping. Anything else is incompatible. I do not quite agree with the truncation part, bit I do not think that it is too important. As I noted before, IMO the absolute numbers for the counters have more values than per-interval diffs displayed by e.g. systat. But if truncating causes less disagreement than clamping, lets do truncation. diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index 5f4cd46ab1e..6266ef670a6 100644 --- a/sys/vm/vm_meter.c +++ b/sys/vm/vm_meter.c @@ -266,8 +266,27 @@ static SYSCTL_NODE(_vm_stats, OID_AUTO, vm, CTLFLAG_RW, 0, "VM meter vm stats"); SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc stats"); +static int +sysctl_handle_vmstat(SYSCTL_HANDLER_ARGS) +{ + uint64_t out; +#ifdef COMPAT_FREEBSD11 + uint32_t out32; +#endif + + out = counter_u64_fetch(*(counter_u64_t *)arg1); +#ifdef COMPAT_FREEBSD11 + if (req->oldlen == sizeof(out32)) { + out32 = (uint32_t)out; /* truncate */ + return (SYSCTL_OUT(req, &out32, sizeof(out32))); + } +#endif + return (SYSCTL_OUT(req, &out, sizeof(out))); +} + #define VM_STATS(parent, var, descr) \ - SYSCTL_COUNTER_U64(parent, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, descr) + SYSCTL_OID(parent, OID_AUTO, var, CTLTYPE_U64 | CTLFLAG_MPSAFE | \ + CTLFLAG_RD, &vm_cnt.var, 0, sysctl_handle_vmstat, "QU", descr); #define VM_STATS_VM(var, descr) VM_STATS(_vm_stats_vm, var, descr) #define VM_STATS_SYS(var, descr) VM_STATS(_vm_stats_sys, var, descr) From owner-svn-src-all@freebsd.org Tue May 2 14:52:30 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15715D5A285; Tue, 2 May 2017 14:52:30 +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 mx1.freebsd.org (Postfix) with ESMTPS id D93EBE01; Tue, 2 May 2017 14:52:29 +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 v42EqSjg010066; Tue, 2 May 2017 14:52:28 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v42EqSdJ010065; Tue, 2 May 2017 14:52:28 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201705021452.v42EqSdJ010065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Tue, 2 May 2017 14:52:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317680 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 14:52:30 -0000 Author: ken Date: Tue May 2 14:52:28 2017 New Revision: 317680 URL: https://svnweb.freebsd.org/changeset/base/317680 Log: Add the SCSI SSC Manufacturer assigned serial number VPD page. This is current as of SSC-5r03. Submitted by: Sam Klopsch MFC after: 3 days Modified: head/sys/cam/scsi/scsi_sa.h Modified: head/sys/cam/scsi/scsi_sa.h ============================================================================== --- head/sys/cam/scsi/scsi_sa.h Tue May 2 13:47:15 2017 (r317679) +++ head/sys/cam/scsi/scsi_sa.h Tue May 2 14:52:28 2017 (r317680) @@ -487,6 +487,19 @@ struct scsi_medium_type_data { }; /* + * Manufacturer-assigned Serial Number VPD page. + * Current as of SSC-5r03, 28 September 2016. + */ +struct scsi_vpd_mfg_serial_number +{ + u_int8_t device; + u_int8_t page_code; +#define SVPD_MFG_SERIAL_NUMBER_PAGE_CODE 0xB1 + u_int8_t page_length[2]; + u_int8_t mfg_serial_num[]; +}; + +/* * Security Protocol Specific values for the Tape Data Encryption protocol * (0x20) used with SECURITY PROTOCOL IN. See below for values used with * SECURITY PROTOCOL OUT. Current as of SSC4r03. From owner-svn-src-all@freebsd.org Tue May 2 14:52:37 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39203D5A2B2; Tue, 2 May 2017 14:52:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E45FBE67; Tue, 2 May 2017 14:52:36 +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 v42EqZjb010116; Tue, 2 May 2017 14:52:35 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v42EqZSB010115; Tue, 2 May 2017 14:52:35 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201705021452.v42EqZSB010115@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 2 May 2017 14:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317681 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 14:52:37 -0000 Author: kib Date: Tue May 2 14:52:35 2017 New Revision: 317681 URL: https://svnweb.freebsd.org/changeset/base/317681 Log: Document time_t size. Reviewed by: emaste, imp, vangyzen Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D10568 Modified: head/share/man/man7/arch.7 Modified: head/share/man/man7/arch.7 ============================================================================== --- head/share/man/man7/arch.7 Tue May 2 14:52:28 2017 (r317680) +++ head/share/man/man7/arch.7 Tue May 2 14:52:35 2017 (r317681) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 21, 2017 +.Dd May 2, 2017 .Dt ARCH 7 .Os .Sh NAME @@ -47,27 +47,27 @@ On all supported architectures, .It float Ta 4 .It double Ta 8 .El -.Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy sizeof(long double)" -.It Sy Architecture Ta Sy sizeof(void *) Ta Sy sizeof(long double) -.It amd64 Ta 8 Ta 16 -.It arm Ta 4 Ta 8 -.It armeb Ta 4 Ta 8 -.It armv6 Ta 4 Ta 8 -.It arm64 Ta 8 Ta 16 -.It i386 Ta 4 Ta 12 -.It mips Ta 4 Ta 8 -.It mipsel Ta 4 Ta 8 -.It mipselhf Ta 4 Ta 8 -.It mipshf Ta 4 Ta 8 -.It mipsn32 Ta 4 Ta 8 -.It mips64 Ta 8 Ta 8 -.It mips64el Ta 8 Ta 8 -.It mips64elhf Ta 8 Ta 8 -.It mips64hf Ta 8 Ta 8 -.It powerpc Ta 4 Ta 8 -.It powerpc64 Ta 8 Ta 8 -.It riscv Ta 8 Ta 16 -.It sparc64 Ta 8 Ta 16 +.Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy sizeof(long double)" "Sy sizeof(time_t)" +.It Sy Architecture Ta Sy sizeof(void *) Ta Sy sizeof(long double) Ta Sy sizeof(time_t) +.It amd64 Ta 8 Ta 16 Ta 8 +.It arm Ta 4 Ta 8 Ta 8 +.It armeb Ta 4 Ta 8 Ta 8 +.It armv6 Ta 4 Ta 8 Ta 8 +.It arm64 Ta 8 Ta 16 Ta 8 +.It i386 Ta 4 Ta 12 Ta 4 +.It mips Ta 4 Ta 8 Ta 8 +.It mipsel Ta 4 Ta 8 Ta 8 +.It mipselhf Ta 4 Ta 8 Ta 8 +.It mipshf Ta 4 Ta 8 Ta 8 +.It mipsn32 Ta 4 Ta 8 Ta 8 +.It mips64 Ta 8 Ta 8 Ta 8 +.It mips64el Ta 8 Ta 8 Ta 8 +.It mips64elhf Ta 8 Ta 8 Ta 8 +.It mips64hf Ta 8 Ta 8 Ta 8 +.It powerpc Ta 4 Ta 8 Ta 4 +.It powerpc64 Ta 8 Ta 8 Ta 8 +.It riscv Ta 8 Ta 16 Ta 8 +.It sparc64 Ta 8 Ta 16 Ta 8 .El .Ss Endianness and Char Signedness .Bl -column -offset indent "Sy Architecture" "Sy Endianness" "Sy char Signedness" From owner-svn-src-all@freebsd.org Tue May 2 15:31:15 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 145BDD5A2EC; Tue, 2 May 2017 15:31:15 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 9ECA6E22; Tue, 2 May 2017 15:31:14 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 045131048B19; Wed, 3 May 2017 01:31:11 +1000 (AEST) Date: Wed, 3 May 2017 01:31:10 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , Alan Somers , Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... In-Reply-To: <20170502144823.GH1622@kib.kiev.ua> Message-ID: <20170503005322.K1968@besplex.bde.org> References: <201704171734.v3HHYlf5022945@repo.freebsd.org> <20170419130428.J956@besplex.bde.org> <20170430201324.GV1622@kib.kiev.ua> <20170501163725.U972@besplex.bde.org> <20170502095527.GB1622@kib.kiev.ua> <20170502203703.I1176@besplex.bde.org> <20170502121711.GE1622@kib.kiev.ua> <20170502223324.P1508@besplex.bde.org> <20170502144823.GH1622@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=t0vv-wrxefp5Oj2dI0IA:9 a=LDhBBNh50KkugDdz:21 a=PFlbG7WVNzEJfU_R:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 15:31:15 -0000 On Tue, 2 May 2017, Konstantin Belousov wrote: > On Tue, May 02, 2017 at 11:31:21PM +1000, Bruce Evans wrote: >> On Tue, 2 May 2017, Konstantin Belousov wrote: >>> ENOMEM is, of course, the situation which I want to avoid. >> >> Then you have to return no error, but truncate the value instead of >> clamping. Anything else is incompatible. > I do not quite agree with the truncation part, bit I do not think that > it is too important. As I noted before, IMO the absolute numbers for > the counters have more values than per-interval diffs displayed by e.g. > systat. But if truncating causes less disagreement than clamping, lets > do truncation. This is better. I also thought of changing the scale when the values get high. The values would increase slower above about 2G instead of stabilizing at 4G-1. This is basically floating point and too complicated since nothing would understand it. Which counters wrap faster than a reasonable refresh interval of 1-10 seconds (which should be shorter if wrapping is a problem)? > diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c > index 5f4cd46ab1e..6266ef670a6 100644 > --- a/sys/vm/vm_meter.c > +++ b/sys/vm/vm_meter.c > @@ -266,8 +266,27 @@ static SYSCTL_NODE(_vm_stats, OID_AUTO, vm, CTLFLAG_RW, 0, > "VM meter vm stats"); > SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc stats"); > > +static int > +sysctl_handle_vmstat(SYSCTL_HANDLER_ARGS) > +{ > + uint64_t out; > +#ifdef COMPAT_FREEBSD11 > + uint32_t out32; > +#endif > + > + out = counter_u64_fetch(*(counter_u64_t *)arg1); > +#ifdef COMPAT_FREEBSD11 > + if (req->oldlen == sizeof(out32)) { > + out32 = (uint32_t)out; /* truncate */ Style: - redundant cast. Especially not needed with the commit. Compilers might warn about this since they don't trust programmers, but don't because implicit downwards conversions are used often. - comment not indented I would also omit the ifdefs, and rename 'out' to out64, and may rename 'out*' to val*. > + return (SYSCTL_OUT(req, &out32, sizeof(out32))); > + } > +#endif > + return (SYSCTL_OUT(req, &out, sizeof(out))); > +} > + > #define VM_STATS(parent, var, descr) \ > - SYSCTL_COUNTER_U64(parent, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, descr) > + SYSCTL_OID(parent, OID_AUTO, var, CTLTYPE_U64 | CTLFLAG_MPSAFE | \ > + CTLFLAG_RD, &vm_cnt.var, 0, sysctl_handle_vmstat, "QU", descr); > #define VM_STATS_VM(var, descr) VM_STATS(_vm_stats_vm, var, descr) > #define VM_STATS_SYS(var, descr) VM_STATS(_vm_stats_sys, var, descr) I just noticed that this sysctl is r/o (I thought I was preserving support for resetting 64-bit counters using a 32-bit size in my fix in sysctl_handle_counter_64(). That function has the dubious feature of not checking the size, so it allows writes of any length (0 to SIZE_MAX, possibly larger than the user data) to reset the counter to zero.) The r/o misfeature goes back to at least FreeBSD-3. 64-bit counters need resetting less than 32-bit ones, and it is more useful to ever reset them since they can hold the full counts since boot time, but there is no reason to limit resetting them now that the low-level code supports it. Is there already a better atomic reset of all vm stats? Bruce From owner-svn-src-all@freebsd.org Tue May 2 16:35:28 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6813BD5B7F7; Tue, 2 May 2017 16:35:28 +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 F08DBC3B; Tue, 2 May 2017 16:35:27 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id BE3FED64D47; Wed, 3 May 2017 02:35:18 +1000 (AEST) Date: Wed, 3 May 2017 02:35:17 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317681 - head/share/man/man7 In-Reply-To: <201705021452.v42EqZSB010115@repo.freebsd.org> Message-ID: <20170503013818.F2099@besplex.bde.org> References: <201705021452.v42EqZSB010115@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=VbSHBBh9 c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=RxVg6HnhAFfXALl6JzsA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 16:35:28 -0000 On Tue, 2 May 2017, Konstantin Belousov wrote: > Log: > Document time_t size. > > Modified: head/share/man/man7/arch.7 > ============================================================================== > --- head/share/man/man7/arch.7 Tue May 2 14:52:28 2017 (r317680) > +++ head/share/man/man7/arch.7 Tue May 2 14:52:35 2017 (r317681) > @@ -47,27 +47,27 @@ On all supported architectures, > .It float Ta 4 > .It double Ta 8 > .El > -.Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy sizeof(long double)" > -.It Sy Architecture Ta Sy sizeof(void *) Ta Sy sizeof(long double) > ... > +.Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy sizeof(long double)" "Sy sizeof(time_t)" > +.It Sy Architecture Ta Sy sizeof(void *) Ta Sy sizeof(long double) Ta Sy sizeof(time_t) > +.It amd64 Ta 8 Ta 16 Ta 8 > +.It arm Ta 4 Ta 8 Ta 8 Verbose types mess up the formatting of man pages too. The header is obviously too long. -current man misformats it to 91 columns on 80-column terminals. FreeBSD-5 man respects COLUMNS, but mangles the header more completely to do this (1). -current man can't handle macros like "Sy" with -width or some other things including the things used above. This causes it to produce excessive column spacing. The formatting is bad enough without this (verbose headers but all columns except "Architecture" have only 1-2 digits). -current man just considers "Sy " as literal and increases the column spacing by 3, giving a spacing of 7 columns instead of 4, where we really want a negative number but 2 would work OK. Also, these Sy's have syntax errors. They really are literals, since they are not preceded by a dot. With -current man, dots would unimprove the formatting further by producing an extra column for each dot. Perhaps that is why it is already left out (it might break other lists). The syntax is something like ".Sy ... Architecture" where other macros in "..." don't need (and shouldn't have?) dots. Removing all 4 Sy's only reduces the column widths by 3*3, so the total width to 82. There is a different problem before the first collumn. The Sy's are already not present in the previous -column directive, and this might what causes different leading indentation for the previous list. But I didn't touch the Sy's in the later -column directions, and all the following first columns line up with this one. (1) gnu man/groff splits the long line in the middle of 'long double', long before the new problem with time_t. Before that, it produces the same wrong separation of 7 columns. It then prints a long line, with 87 blanks to misformat "double)" 1 line and 7 columns into the next (in the middle of nowhere under "Architecture"), then a further 7 columns to sizeof(time_t) in the middle of nowhere. It prints a diagnostic about not being able to split the long line. Gnu man/groff does understand .Sy, but treats Sy as literal. Changing the Sy's to .Sy's doesn't work any better than removing them in this list, but it improves all the other lists. The formatting for the first list can be fixed by changing '-indent' in it to 'indent' to match the other list. This [-]indent controls indentation in ways that I don't understand, but experiment shows that the '-' in it gives an unwanted extra column of indentation, and adding more minus signs gives more indentation. The minus sign is only used for the first list. We really want outdentation. I tried ++indent for that, but it gave the same indentation as --indent. Bruce From owner-svn-src-all@freebsd.org Tue May 2 17:07:27 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA153D5A333; Tue, 2 May 2017 17:07:27 +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 68B6769C; Tue, 2 May 2017 17:07:27 +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 v42H7Lcp040956 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 2 May 2017 20:07:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v42H7Lcp040956 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v42H7Lkh040955; Tue, 2 May 2017 20:07:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 2 May 2017 20:07:21 +0300 From: Konstantin Belousov To: Bruce Evans Cc: Alan Somers , Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... Message-ID: <20170502170721.GI1622@kib.kiev.ua> References: <20170419130428.J956@besplex.bde.org> <20170430201324.GV1622@kib.kiev.ua> <20170501163725.U972@besplex.bde.org> <20170502095527.GB1622@kib.kiev.ua> <20170502203703.I1176@besplex.bde.org> <20170502121711.GE1622@kib.kiev.ua> <20170502223324.P1508@besplex.bde.org> <20170502144823.GH1622@kib.kiev.ua> <20170503005322.K1968@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170503005322.K1968@besplex.bde.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 17:07:28 -0000 On Wed, May 03, 2017 at 01:31:10AM +1000, Bruce Evans wrote: > > > On Tue, 2 May 2017, Konstantin Belousov wrote: > I also thought of changing the scale when the values get high. The values > would increase slower above about 2G instead of stabilizing at 4G-1. > This is basically floating point and too complicated since nothing would > understand it. > > Which counters wrap faster than a reasonable refresh interval of 1-10 > seconds (which should be shorter if wrapping is a problem)? Things like various counters for pages freed due to a reason can. E.g. freed due to the process exit is the counter which I saw changing fast. Wire counts might fluctuate relatively quickly, but I think that wiring is slower. Unwiring might be fast. > Style: > - redundant cast. Especially not needed with the commit. Compilers might > warn about this since they don't trust programmers, but don't because > implicit downwards conversions are used often. > - comment not indented > > I would also omit the ifdefs, and rename 'out' to out64, and may rename > 'out*' to val*. Ok. > I just noticed that this sysctl is r/o (I thought I was preserving support > for resetting 64-bit counters using a 32-bit size in my fix in > sysctl_handle_counter_64(). That function has the dubious feature of not > checking the size, so it allows writes of any length (0 to SIZE_MAX, > possibly larger than the user data) to reset the counter to zero.) > > The r/o misfeature goes back to at least FreeBSD-3. 64-bit counters need > resetting less than 32-bit ones, and it is more useful to ever reset them > since they can hold the full counts since boot time, but there is no reason > to limit resetting them now that the low-level code supports it. Is there > already a better atomic reset of all vm stats? I do not see why vmstat counters ever need to be reset. I do not think that truncating the value to present small values to 32bit readers is a reasonable cause. diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c index 5f4cd46ab1e..b4666a400b2 100644 --- a/sys/vm/vm_meter.c +++ b/sys/vm/vm_meter.c @@ -266,8 +266,27 @@ static SYSCTL_NODE(_vm_stats, OID_AUTO, vm, CTLFLAG_RW, 0, "VM meter vm stats"); SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc stats"); +static int +sysctl_handle_vmstat(SYSCTL_HANDLER_ARGS) +{ + uint64_t val; +#ifdef COMPAT_FREEBSD11 + uint32_t val32; +#endif + + val = counter_u64_fetch(*(counter_u64_t *)arg1); +#ifdef COMPAT_FREEBSD11 + if (req->oldlen == sizeof(val32)) { + val32 = val; /* truncate */ + return (SYSCTL_OUT(req, &val32, sizeof(val32))); + } +#endif + return (SYSCTL_OUT(req, &val, sizeof(val))); +} + #define VM_STATS(parent, var, descr) \ - SYSCTL_COUNTER_U64(parent, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, descr) + SYSCTL_OID(parent, OID_AUTO, var, CTLTYPE_U64 | CTLFLAG_MPSAFE | \ + CTLFLAG_RD, &vm_cnt.var, 0, sysctl_handle_vmstat, "QU", descr); #define VM_STATS_VM(var, descr) VM_STATS(_vm_stats_vm, var, descr) #define VM_STATS_SYS(var, descr) VM_STATS(_vm_stats_sys, var, descr) From owner-svn-src-all@freebsd.org Tue May 2 17:16:25 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5FC5D5A599; Tue, 2 May 2017 17:16:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87EACC57; Tue, 2 May 2017 17:16:25 +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 v42HGOXV069472; Tue, 2 May 2017 17:16:24 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v42HGOBd069470; Tue, 2 May 2017 17:16:24 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201705021716.v42HGOBd069470@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 2 May 2017 17:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r317682 - head/sbin/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 17:16:25 -0000 Author: ae Date: Tue May 2 17:16:24 2017 New Revision: 317682 URL: https://svnweb.freebsd.org/changeset/base/317682 Log: Add `ipfw table all destroy` support. PR: 212669 MFC after: 1 week Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/tables.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Tue May 2 14:52:35 2017 (r317681) +++ head/sbin/ipfw/ipfw.8 Tue May 2 17:16:24 2017 (r317682) @@ -50,7 +50,9 @@ in-kernel NAT. .Nm .Oo Cm set Ar N Oc Cm table Ar name Cm create Ar create-options .Nm -.Oo Cm set Ar N Oc Cm table Ar name Cm destroy +.Oo Cm set Ar N Oc Cm table +.Brq Ar name | all +.Cm destroy .Nm .Oo Cm set Ar N Oc Cm table Ar name Cm modify Ar modify-options .Nm Modified: head/sbin/ipfw/tables.c ============================================================================== --- head/sbin/ipfw/tables.c Tue May 2 14:52:35 2017 (r317681) +++ head/sbin/ipfw/tables.c Tue May 2 17:16:24 2017 (r317682) @@ -54,6 +54,7 @@ static int table_swap(ipfw_obj_header *o static int table_get_info(ipfw_obj_header *oh, ipfw_xtable_info *i); static int table_show_info(ipfw_xtable_info *i, void *arg); +static int table_destroy_one(ipfw_xtable_info *i, void *arg); static int table_flush_one(ipfw_xtable_info *i, void *arg); static int table_show_one(ipfw_xtable_info *i, void *arg); static int table_do_get_list(ipfw_xtable_info *i, ipfw_obj_header **poh); @@ -132,7 +133,7 @@ lookup_host (char *host, struct in_addr * This one handles all table-related commands * ipfw table NAME create ... * ipfw table NAME modify ... - * ipfw table NAME destroy + * ipfw table {NAME | all} destroy * ipfw table NAME swap NAME * ipfw table NAME lock * ipfw table NAME unlock @@ -200,6 +201,7 @@ ipfw_table_handler(int ac, char *av[]) case TOK_INFO: case TOK_DETAIL: case TOK_FLUSH: + case TOK_DESTROY: break; default: if (is_all != 0) @@ -223,13 +225,21 @@ ipfw_table_handler(int ac, char *av[]) table_modify(&oh, ac, av); break; case TOK_DESTROY: - if (table_destroy(&oh) == 0) - break; - if (errno != ESRCH) - err(EX_OSERR, "failed to destroy table %s", tablename); - /* ESRCH isn't fatal, warn if not quiet mode */ - if (co.do_quiet == 0) - warn("failed to destroy table %s", tablename); + if (is_all == 0) { + if (table_destroy(&oh) == 0) + break; + if (errno != ESRCH) + err(EX_OSERR, "failed to destroy table %s", + tablename); + /* ESRCH isn't fatal, warn if not quiet mode */ + if (co.do_quiet == 0) + warn("failed to destroy table %s", tablename); + } else { + error = tables_foreach(table_destroy_one, &oh, 1); + if (error != 0) + err(EX_OSERR, + "failed to destroy tables list"); + } break; case TOK_FLUSH: if (is_all == 0) { @@ -567,6 +577,22 @@ table_destroy(ipfw_obj_header *oh) return (0); } +static int +table_destroy_one(ipfw_xtable_info *i, void *arg) +{ + ipfw_obj_header *oh; + + oh = (ipfw_obj_header *)arg; + table_fill_ntlv(&oh->ntlv, i->tablename, i->set, 1); + if (table_destroy(oh) != 0) { + if (co.do_quiet == 0) + warn("failed to destroy table(%s) in set %u", + i->tablename, i->set); + return (-1); + } + return (0); +} + /* * Flushes given table specified by @oh->ntlv. * Returns 0 on success. From owner-svn-src-all@freebsd.org Tue May 2 17:32:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC1D3D5ABE2; Tue, 2 May 2017 17:32:32 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x242.google.com (mail-pg0-x242.google.com [IPv6:2607:f8b0:400e:c05::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 AA409A0E; Tue, 2 May 2017 17:32:32 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x242.google.com with SMTP id s62so11969533pgc.0; Tue, 02 May 2017 10:32:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=qrzA7LL0kKxVkzxRH5qp/aWZ7epK/1gd4vwp22bPYNA=; b=BDCFQN1+8yGWuhtN4cp56aVeOqIYG3jYcdsohpulJ4cyt7uf+4+BOLvadgDGPwwvFU JWfv/NfZ6eRg0dShipFyCyjYmuStdVQTGzGTZK6MnNYM1tRZOdtY1oIuYhMNecmj6u67 h7pK2GFJiu4UInczLWlLS3Bk5lpq8iEDhm/NCaWFP1Sxtl8kZq/p3vHoJbs68ofHGgPn sQBB+xLE820FUnhZjkPPUaV7kL4j2HV6xKFyLYUNrrA1Hvo74C8pt9dA/VM3T7FEzJoD W2Du6gcIFdr8TmMoRsAoagyh5dJgRwN392q6LtU7Y5QNG1YYNU9pgeEy5KIkGeDenTxF GR/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=qrzA7LL0kKxVkzxRH5qp/aWZ7epK/1gd4vwp22bPYNA=; b=bxcwVfuduygB29ZaalIbpf9gqIaHKhBPFUkT+Q1fwFvOdvVrCXVcD87h1M4VpdUGSA TPSfRdy/2wkbcxhcN+rCv97Zf8XyfeQ0FNqX8crgNy4NOwG6ZI8lGuyuPx9sifxUUn1p iHTqYKsIgj/l7PIK4Uld96Zhhg3sE5NS0b0OaE7McC/2dMvWRpuvKjyj07EgHZzdoVkh gapj6QL2kqgtdtkSJsXEXHgFcHwCg7dyYBdIkSYjOIYnFyJPhxBJj+rnRrJpaVDNb/TT Do1ra99epa7xsm+0tB9tIh6tocTnQzgo0JtqV+r9EMECbybZ7LMfaJ6fZ8LmByx0Y8yM FcDw== X-Gm-Message-State: AN3rC/4FFnHpLDwIvl3VwCMFVPVeyrwPVy4Vf42zVDgoP7Da3durjB7o 8BNRirhr5YR9/HMim3E= X-Received: by 10.84.231.136 with SMTP id g8mr42766739plk.12.1493746352086; Tue, 02 May 2017 10:32:32 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id c83sm58709pfd.113.2017.05.02.10.32.31 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 May 2017 10:32:31 -0700 (PDT) Subject: Re: svn commit: r317631 - head/sys Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_2B7E30A1-8EAE-4803-8DDD-81FDD9E9D061"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201705011628.v41GSj5b090808@pdx.rh.CN85.dnsmgr.net> Date: Tue, 2 May 2017 10:32:29 -0700 Cc: Ngie Cooper , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <22AB91F2-131C-497A-A490-94D8DBD8B221@gmail.com> References: <201705011628.v41GSj5b090808@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 17:32:33 -0000 --Apple-Mail=_2B7E30A1-8EAE-4803-8DDD-81FDD9E9D061 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 1, 2017, at 09:28, Rodney W. Grimes = wrote: >=20 >> Author: ngie >> Date: Mon May 1 05:54:33 2017 >> New Revision: 317631 >> URL: https://svnweb.freebsd.org/changeset/base/317631 >>=20 >> Log: >> Fix "make cscope" after r317411 >=20 > This commit is disconnect netnatm module from build >=20 > ? Mixed 2 commit messages perhaps? No, it was intentional (I made the readers read between the = lines as to why this commit was necessary, so mea culpa). r317411 removed sys/netatm, which broke the =E2=80=9Cmake = cscope=E2=80=9D target, as it tried to iterate down that directory with = find and failed. Thanks! -Ngie $ svn log -c r317411 ------------------------------------------------------------------------ r317411 | brooks | 2017-04-25 10:00:08 -0700 (Tue, 25 Apr 2017) | 4 = lines Remove directories made empty by NATM, EISA, and IEEE488 removals. Reported by: ak = =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80= =94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94= =E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2=80=94=E2= =80=94=E2=80=94=E2=80=94 $ svn diff -c r317411 --summarize D sbin/atm/atmconfig D sbin/atm D sys/netnatm D sys/dev/eisa D sys/dev/fatm D sys/dev/hatm D sys/dev/patm/genrtab D sys/dev/patm D sys/dev/ahb D sys/dev/ieee488 D sys/dev/en D sys/dev/utopia D sys/modules/fatm D sys/modules/hatm D sys/modules/patm D sys/modules/ahb D sys/modules/en D sys/modules/utopia D sys/modules/aic7xxx/ahc/ahc_eisa D sys/modules/netgraph/atm/atm D usr.sbin/bsnmpd/modules/snmp_atm --Apple-Mail=_2B7E30A1-8EAE-4803-8DDD-81FDD9E9D061 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZCMKuAAoJEPWDqSZpMIYVGFMP/1DMKLO3EYxcjvNQIJreryTg pZVRYZUplNw60tzQ4XUIU/sqP4z+dX4s+EoieWQFtoxTb9thckhA+S9Olk8oEvNx grJ0BxjMJsZtnsYI40g7wSXT5iexwwYfFRk2UrtvgliVGvro0z7rMio6PleQi2kQ PtuVQXfS+NFv+1XqVFVS8F/QcleNowJD5ChwsJ3jXbiaZhkryu8Nh332iNJIcbNO AnjPTKZSFsNfgmocBbFsPR93B7R8iAkjbRu+CRImlAgC0a5ESviFDXCHqTAfM8mu px0fg6qSNsaqoP9YzqKUL4v12DSUm9I81Nnp0j/lGu+ahhSr7NvK+betPGDoeUlB boIj9/cU+J+Ncw/kKgWnCJOnGRWamLQCaatfQY6ZqTd64w9RX6dBG/0sqj6TjibK Wi44tyerrozop24syl5j/wmomdZBRxPtKbo6ik0Nhq9zWljja+hLD3GD7e5qrmcn nt4MAF8IHiWY/HdWBB33Acqcykdb7q7nE2Cy9PVh6MN7/cGBUQaBpwFGVP+8nMvG cKukh4TQ2CwxSBP+lgYOO7NQHt1oiWAolmrqiP4g4tM3So6IsD45AylHUizkJMZo Xpupasu60zS4eG0KO45kuj5JJQ31ECRG8og+knXkxxiLtU5PeDy5A8a7O5g0+zOb lVoybJOAoTqI6SIEejTj =xGNV -----END PGP SIGNATURE----- --Apple-Mail=_2B7E30A1-8EAE-4803-8DDD-81FDD9E9D061-- From owner-svn-src-all@freebsd.org Tue May 2 17:40:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20E3BD5AE28; Tue, 2 May 2017 17:40:31 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg0-x243.google.com (mail-pg0-x243.google.com [IPv6:2607:f8b0:400e:c05::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 E019FE5C; Tue, 2 May 2017 17:40:30 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg0-x243.google.com with SMTP id v1so23639623pgv.3; Tue, 02 May 2017 10:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=qP1/jB7RwqT6E0ZVS9859amI+i3X1XFwL+kRdtUueTg=; b=OA8/QlBiRJWOf+se+HfN1/i9tmVTI8jcqvyS3OIk3ZrrvxaR8gvJRfJY8PkMA4ABOk nYU2ZhVZai2EonA069ysJTqFj8JbtowEMGOUJATiu4JEHlsInz5U6mZX0j9h1oKZ5CB9 hRDYPprD3J3nU4Q4G1NhfMOMUrQaweTKT4xSNHHmicsute6tyV2nvGMQgQca24JNrUkZ Tz9Q/MCTWsWjbRTTPxEuNpfTXNP0KyBmHSeifs5P5klcMXABnm+HRdVPZwMAyCtrXnVg u6ztrp36+LJi2/vfMzI6zq63yW2ifGZ4jq8bYDdMS86LCGF+wm6Cif60FfV0RpB9vplm xc6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=qP1/jB7RwqT6E0ZVS9859amI+i3X1XFwL+kRdtUueTg=; b=eMxDxDO+JfE4QV/Y/LHK4+c40ocxcV9KZE5K4ML8rlaT+MXJnHO3qLZC/djLG8pSE/ +jQp7vkz0dHmMjKTgveGgfHbbMwApTTSSC2oI5y8M0xWUu0JvIBM61LgIDOHxUg7o7eT GwC66ssZjxuBeV5m38fPdJZx7DT7SlT/77uqTPG5NYEAg/Y9z4SclHheWwfIzfdGhi+8 TDD2odRgctbZWNKQ7rDasikrkPUC2byU3Xfqeu05IQgB6UzH8HXLPasaGxEGQmB+KA4T hJu4CQPCfcy9DLtWeimNn18RbvwrBb1VCi1KbWTj5/tcHTE4MyARDh/cq1t0SzaPG87R 8MOQ== X-Gm-Message-State: AN3rC/6ARENuA+VtOgSi5fxRBCwMYCMcOB228+kVmDR+ERTkR1VSFbNQ bwjTr5Qft8eO3g== X-Received: by 10.98.155.206 with SMTP id e75mr229485pfk.24.1493746830388; Tue, 02 May 2017 10:40:30 -0700 (PDT) Received: from pinklady.local (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id a190sm30502790pgc.60.2017.05.02.10.40.28 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 May 2017 10:40:29 -0700 (PDT) Subject: Re: svn commit: r317632 - head/sys Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_CA59FF78-3F84-4AB5-9B21-5F4C75A7EB05"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail From: "Ngie Cooper (yaneurabeya)" In-Reply-To: Date: Tue, 2 May 2017 10:40:28 -0700 Cc: "Rodney W. Grimes" , Ngie Cooper , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <17C74380-374C-40A8-A3C4-0401D32E9A06@gmail.com> References: <201705010559.v415xqx2085699@repo.freebsd.org> <201705011630.v41GUfVV090824@pdx.rh.CN85.dnsmgr.net> To: Warner Losh X-Mailer: Apple Mail (2.3124) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 17:40:31 -0000 --Apple-Mail=_CA59FF78-3F84-4AB5-9B21-5F4C75A7EB05 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On May 1, 2017, at 09:34, Warner Losh wrote: >=20 > On Mon, May 1, 2017 at 10:30 AM, Rodney W. Grimes > wrote: >>> Author: ngie >>> Date: Mon May 1 05:59:52 2017 >>> New Revision: 317632 >>> URL: https://svnweb.freebsd.org/changeset/base/317632 >>>=20 >>> Log: >>> Fix "make cscope-clean" when .OBJDIR already exists >>>=20 >>> The cscope generated files are always put in .CURDIR . >>=20 >> If this is writing to src dir then it should be fixed, >> or have we abandoned all hope of readonly src tree? >=20 > This is only for the cscope target, which isn't part of the normal = build. >=20 > readonly src tree works great still=E2=80=A6. Hi Rod, I can=E2=80=99t personally vouch for readonly src trees working = in all cases, but readonly src trees work well for installation purposes = (I use readonly obj and src trees at work when installing over NFS). As Warner noted, =E2=80=9Cmake cscope=E2=80=9D is a developer = target that aids with building the cscope database in a consistent = manner. It doesn=E2=80=99t conform to the existing =E2=80=9Cnorms=E2=80=9D= of build targets in the tree; changing the behavior doesn=E2=80=99t = seem prudent at this point in time because it would violate POLA. Thanks! -Ngie --Apple-Mail=_CA59FF78-3F84-4AB5-9B21-5F4C75A7EB05 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJZCMSMAAoJEPWDqSZpMIYVZW8P+wYGhwukc0EkRcScm/cLo8J4 WP9BRc1hzoYnsK1O55yMlBh6nWcC5BCDrJ7BwPdrXmE5xZnF0DwSvzXDlzEkFE/N ZdWFJcYNnnH0fvMOHmvem0n3UJmJ8V0S3zffodIm3Y6Wt7P/cQ+b9Gc3oLfsK2gI Ia5RaU86WCi8jmn3zs9IAJI5JhutvWJZzxI3mltlhVQocgvq7ScAEsCcUrQ6XJOk 5FVfnZrkXbvmrdp5DcHC5UjOt3bSbWcTV4ZrG584u+H9N+LIKl8q0Hh+GmkFkDH7 VSeeUxFhXzfDqbGU2IZsFM3FlIs/gwPhDHf6b14apGnd7BgVLA9YG0DWiUiN3mgz tcvWGZ1z4pASsuztRY3+4nbr4fSqSpIe9WskExEbwb799E7RBWVGAbocSEpY6JLu siUTZPqZ4JI6/cKQ1elE0lrOktiMv8xUauMGrW1OD+VPrGbWUSuZ2t8CBcQnyspX vC2gwxXLsna6FnW4Zt63R+lTxk3ylA10Z5j/OIkZV+ahkBYau1Kgrp+z3y8rDrIc rM4okOX6V2e0/KTuq9z9GNOrCHA/SR5Wgd3/L8zu02gfbHXe4KaLeGj8SZ7BOFdb zB3EflUxcGYksB0O8/T1xm+mBeSPd/RKHiGUkz+NslGy1VimCeIjbQfSaZ47MFoW bndcMAb88saO5aTXtLgo =HMqn -----END PGP SIGNATURE----- --Apple-Mail=_CA59FF78-3F84-4AB5-9B21-5F4C75A7EB05-- From owner-svn-src-all@freebsd.org Tue May 2 17:45:05 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8B2BD5B0F2; Tue, 2 May 2017 17:45:05 +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 4FE801310; Tue, 2 May 2017 17:45:05 +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 v42HitHB048802 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 2 May 2017 20:44:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v42HitHB048802 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v42Hit3M048801; Tue, 2 May 2017 20:44:55 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 2 May 2017 20:44:55 +0300 From: Konstantin Belousov To: Bruce Evans Cc: emaste@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r317681 - head/share/man/man7 Message-ID: <20170502174455.GJ1622@kib.kiev.ua> References: <201705021452.v42EqZSB010115@repo.freebsd.org> <20170503013818.F2099@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170503013818.F2099@besplex.bde.org> User-Agent: Mutt/1.8.2 (2017-04-18) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 17:45:06 -0000 On Wed, May 03, 2017 at 02:35:17AM +1000, Bruce Evans wrote: > On Tue, 2 May 2017, Konstantin Belousov wrote: > > > Log: > > Document time_t size. > > > > Modified: head/share/man/man7/arch.7 > > ============================================================================== > > --- head/share/man/man7/arch.7 Tue May 2 14:52:28 2017 (r317680) > > +++ head/share/man/man7/arch.7 Tue May 2 14:52:35 2017 (r317681) > > @@ -47,27 +47,27 @@ On all supported architectures, > > .It float Ta 4 > > .It double Ta 8 > > .El > > -.Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy sizeof(long double)" > > -.It Sy Architecture Ta Sy sizeof(void *) Ta Sy sizeof(long double) > > ... > > +.Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy sizeof(long double)" "Sy sizeof(time_t)" > > +.It Sy Architecture Ta Sy sizeof(void *) Ta Sy sizeof(long double) Ta Sy sizeof(time_t) > > +.It amd64 Ta 8 Ta 16 Ta 8 > > +.It arm Ta 4 Ta 8 Ta 8 > > Verbose types mess up the formatting of man pages too. > > The header is obviously too long. -current man misformats it to 91 columns > on 80-column terminals. FreeBSD-5 man respects COLUMNS, but mangles the > header more completely to do this (1). I removed excessive sizeof(), which fixed width. diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7 index 1ce397a303e..73552d60209 100644 --- a/share/man/man7/arch.7 +++ b/share/man/man7/arch.7 @@ -47,8 +47,10 @@ On all supported architectures, .It float Ta 4 .It double Ta 8 .El -.Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy sizeof(long double)" "Sy sizeof(time_t)" -.It Sy Architecture Ta Sy sizeof(void *) Ta Sy sizeof(long double) Ta Sy sizeof(time_t) +.Pp +Machine-depended type's sizes: +.Bl -column -offset indent "Sy Architecture" "Sy void *" "Sy long double" "Sy time_t" +.It Sy Architecture Ta Sy void * Ta Sy long double Ta Sy time_t .It amd64 Ta 8 Ta 16 Ta 8 .It arm Ta 4 Ta 8 Ta 8 .It armeb Ta 4 Ta 8 Ta 8 From owner-svn-src-all@freebsd.org Tue May 2 17:47:50 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25B2BD5B190; Tue, 2 May 2017 17:47:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail107.syd.optusnet.com.au (mail107.syd.optusnet.com.au [211.29.132.53]) by mx1.freebsd.org (Postfix) with ESMTP id AE9561507; Tue, 2 May 2017 17:47:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail107.syd.optusnet.com.au (Postfix) with ESMTPS id 85FD3D43E1A; Wed, 3 May 2017 03:47:41 +1000 (AEST) Date: Wed, 3 May 2017 03:47:37 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: Bruce Evans , Alan Somers , Gleb Smirnoff , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r317061 - in head: libexec/rpc.rstatd sys/amd64/amd64 sys/amd64/include sys/arm/arm sys/arm/include sys/arm64/include sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/compat/linprocfs... In-Reply-To: <20170502170721.GI1622@kib.kiev.ua> Message-ID: <20170503032643.K2791@besplex.bde.org> References: <20170419130428.J956@besplex.bde.org> <20170430201324.GV1622@kib.kiev.ua> <20170501163725.U972@besplex.bde.org> <20170502095527.GB1622@kib.kiev.ua> <20170502203703.I1176@besplex.bde.org> <20170502121711.GE1622@kib.kiev.ua> <20170502223324.P1508@besplex.bde.org> <20170502144823.GH1622@kib.kiev.ua> <20170503005322.K1968@besplex.bde.org> <20170502170721.GI1622@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=rddVpAsjNRg6FjyyaoQA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 17:47:50 -0000 On Tue, 2 May 2017, Konstantin Belousov wrote: > On Wed, May 03, 2017 at 01:31:10AM +1000, Bruce Evans wrote: >> >> >> On Tue, 2 May 2017, Konstantin Belousov wrote: >> I also thought of changing the scale when the values get high. The values >> would increase slower above about 2G instead of stabilizing at 4G-1. >> This is basically floating point and too complicated since nothing would >> understand it. >> >> Which counters wrap faster than a reasonable refresh interval of 1-10 >> seconds (which should be shorter if wrapping is a problem)? > Things like various counters for pages freed due to a reason can. E.g. > freed due to the process exit is the counter which I saw changing fast. 4 billion page operations/second or 10 is impossible. It is difficult to even increment a register to count events that fast. > Wire counts might fluctuate relatively quickly, but I think that wiring > is slower. Unwiring might be fast. The need to zero pages before reuse limits the speed. >> I just noticed that this sysctl is r/o (I thought I was preserving support >> for resetting 64-bit counters using a 32-bit size in my fix in >> sysctl_handle_counter_64(). That function has the dubious feature of not >> checking the size, so it allows writes of any length (0 to SIZE_MAX, >> possibly larger than the user data) to reset the counter to zero.) >> >> The r/o misfeature goes back to at least FreeBSD-3. 64-bit counters need >> resetting less than 32-bit ones, and it is more useful to ever reset them >> since they can hold the full counts since boot time, but there is no reason >> to limit resetting them now that the low-level code supports it. Is there >> already a better atomic reset of all vm stats? > > I do not see why vmstat counters ever need to be reset. I do not think > that truncating the value to present small values to 32bit readers is > a reasonable cause. It would be mostly for presenting a consistent set of values. > diff --git a/sys/vm/vm_meter.c b/sys/vm/vm_meter.c > index 5f4cd46ab1e..b4666a400b2 100644 > --- a/sys/vm/vm_meter.c > +++ b/sys/vm/vm_meter.c > @@ -266,8 +266,27 @@ static SYSCTL_NODE(_vm_stats, OID_AUTO, vm, CTLFLAG_RW, 0, > "VM meter vm stats"); > SYSCTL_NODE(_vm_stats, OID_AUTO, misc, CTLFLAG_RW, 0, "VM meter misc stats"); > > +static int > +sysctl_handle_vmstat(SYSCTL_HANDLER_ARGS) > +{ > + uint64_t val; > +#ifdef COMPAT_FREEBSD11 > + uint32_t val32; > +#endif > + > + val = counter_u64_fetch(*(counter_u64_t *)arg1); > +#ifdef COMPAT_FREEBSD11 > + if (req->oldlen == sizeof(val32)) { > + val32 = val; /* truncate */ > + return (SYSCTL_OUT(req, &val32, sizeof(val32))); > + } > +#endif > + return (SYSCTL_OUT(req, &val, sizeof(val))); > +} > + > #define VM_STATS(parent, var, descr) \ > - SYSCTL_COUNTER_U64(parent, OID_AUTO, var, CTLFLAG_RD, &vm_cnt.var, descr) > + SYSCTL_OID(parent, OID_AUTO, var, CTLTYPE_U64 | CTLFLAG_MPSAFE | \ > + CTLFLAG_RD, &vm_cnt.var, 0, sysctl_handle_vmstat, "QU", descr); > #define VM_STATS_VM(var, descr) VM_STATS(_vm_stats_vm, var, descr) > #define VM_STATS_SYS(var, descr) VM_STATS(_vm_stats_sys, var, descr) OK. Bruce From owner-svn-src-all@freebsd.org Tue May 2 18:04:31 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6C5DD5B6F9; Tue, 2 May 2017 18:04:31 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001: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 5ACD31A5; Tue, 2 May 2017 18:04:31 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x231.google.com with SMTP id o22so38186527iod.0; Tue, 02 May 2017 11:04:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2UMghvtxkLR190uYsl7PDyQUeatN+DpeKrnR2wFw5kw=; b=qv+VBM4L7RxodCe1UPlmLqljH1XFyGGA1TqZjN/o2viLGeBaV1KOI0pVt6Of10WVD0 MJk7DmHecH/W8Y8l2srrM2qCSWH6tEeQdv1dtg+/Mkg1+0iXvECUPmJIR6StKDctAgRl BF+fEFyKuaYCejo8CK0AxvLOuOKtN9Mc1kk5AMQasNNUPxtodj8AvWfW4Co/kcBGSLw3 6vxeoA3IbXS3ZVTyVl5xoQr+34/fM6ZdpSnwLKg1Z5yMk/Q3L2eRigmlBDC2e9XnfCjD nrIxZU1r9CPbEsE5g3nfl8C0IIGuRmPhX5TsAM1b+l6AfNaMV/X0c0hb8jVcWvmE/jr5 dM2Q== 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=2UMghvtxkLR190uYsl7PDyQUeatN+DpeKrnR2wFw5kw=; b=COFfJmO9JBdu6nCcoyPet2cPz8b2jwXMT4byOSLRmFsCf01rD5Oy/Emj+ylozEpZPT 60nIlavJ13WjBN/NFaEH14SSISSsPDo5BsHcf+DuFJ9pGSVaSbsRUt70cuciIx564q6Q V+LJRQwm8BUzoIuZ6brwV4nZseLhycbPD2JO1HPkVeZTm5c5tzPHQbDk5Gp1EIS9H3vO 5mG3WR3p+Tkucdcmqk2Eex2QEBX6lyXjpqAJeMPiB+2t9GwxAP+Be7DolEzpRNAqtfn4 q9b2mIaRukRfm23m8wbLzoy0OeNgkt7nkEQL0wzb3y/vl+I89s2+VCRKFLxRnVmncIvL 3rfQ== X-Gm-Message-State: AN3rC/7H0S8SJGLq2GMJifY5yyF2Y/y0vE7F4N8Hgsry/aqnuUA9OX3B XStAi5aXvUrNfDX14lD8O8+aELGifQ== X-Received: by 10.107.167.19 with SMTP id q19mr14347133ioe.110.1493748270675; Tue, 02 May 2017 11:04:30 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.30.136 with HTTP; Tue, 2 May 2017 11:04:09 -0700 (PDT) In-Reply-To: <20170503013818.F2099@besplex.bde.org> References: <201705021452.v42EqZSB010115@repo.freebsd.org> <20170503013818.F2099@besplex.bde.org> From: Ed Maste Date: Tue, 2 May 2017 14:04:09 -0400 X-Google-Sender-Auth: mp5bMj_ohBERHk4zya_ii9QvSqI Message-ID: Subject: Re: svn commit: r317681 - head/share/man/man7 To: Bruce Evans Cc: Konstantin Belousov , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 18:04:31 -0000 On 2 May 2017 at 12:35, Bruce Evans wrote: > > -current man can't handle macros like "Sy" with -width or some other > things including the things used above. This causes it to produce > excessive column spacing. The formatting is bad enough without this > (verbose headers but all columns except "Architecture" have only 1-2 > digits). -current man just considers "Sy " as literal and increases > the column spacing by 3, giving a spacing of 7 columns instead of 4, > where we really want a negative number but 2 would work OK. We discussed this in review D7261. I created arch.7 with ".Sy based on an example from FreeBSD 10's mdoc(7). In D7261 I noted that there were existing man pages with both ".Sy and "Sy . Do you believe we should remove them altogether? On 2 May 2017 at 13:44, Konstantin Belousov wrote: > > I removed excessive sizeof(), which fixed width. > > diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7 > index 1ce397a303e..73552d60209 100644 > --- a/share/man/man7/arch.7 > +++ b/share/man/man7/arch.7 > @@ -47,8 +47,10 @@ On all supported architectures, > .It float Ta 4 > .It double Ta 8 > .El > -.Bl -column -offset indent "Sy Architecture" "Sy sizeof(void *)" "Sy sizeof(long double)" "Sy sizeof(time_t)" > -.It Sy Architecture Ta Sy sizeof(void *) Ta Sy sizeof(long double) Ta Sy sizeof(time_t) > +.Pp > +Machine-depended type's sizes: Probably "Machine-dependent type sizes" From owner-svn-src-all@freebsd.org Tue May 2 18:30:17 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2608AD5BC8C; Tue, 2 May 2017 18:30:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A27A7FFF; Tue, 2 May 2017 18:30:16 +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 v42IUFeA098544; Tue, 2 May 2017 18:30:15 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v42IUDwK098524; Tue, 2 May 2017 18:30:13 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705021830.v42IUDwK098524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 2 May 2017 18:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317683 - in vendor/llvm/dist: cmake/modules docs docs/TableGen include/llvm include/llvm/ADT include/llvm/Analysis include/llvm/Bitcode include/llvm/CodeGen include/llvm/CodeGen/Global... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 18:30:17 -0000 Author: dim Date: Tue May 2 18:30:13 2017 New Revision: 317683 URL: https://svnweb.freebsd.org/changeset/base/317683 Log: Vendor import of llvm trunk r301939: https://llvm.org/svn/llvm-project/llvm/trunk@301939 Added: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleDebugFragment.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleDebugFragmentRecord.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleDebugFragmentVisitor.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleDebugLineFragment.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleDebugUnknownFragment.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptor.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h (contents, props changed) vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/ModuleDebugStreamBuilder.h (contents, props changed) vendor/llvm/dist/include/llvm/Transforms/Scalar/SimpleLoopUnswitch.h (contents, props changed) vendor/llvm/dist/lib/CodeGen/MachineFrameInfo.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/ModuleDebugFileChecksumFragment.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/ModuleDebugFragment.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/ModuleDebugFragmentRecord.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/ModuleDebugFragmentVisitor.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/ModuleDebugInlineeLinesFragment.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/ModuleDebugLineFragment.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/CodeView/ModuleDebugUnknownFragment.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiModuleDescriptor.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiModuleDescriptorBuilder.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp (contents, props changed) vendor/llvm/dist/lib/DebugInfo/PDB/Native/ModuleDebugStreamBuilder.cpp (contents, props changed) vendor/llvm/dist/lib/Support/Unix/DynamicLibrary.inc (contents, props changed) vendor/llvm/dist/lib/Target/Mips/MicroMipsSizeReduction.cpp (contents, props changed) vendor/llvm/dist/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp (contents, props changed) vendor/llvm/dist/test/Analysis/AliasSet/unknown-inst-tracking.ll vendor/llvm/dist/test/CodeGen/AMDGPU/llvm.amdgcn.init.exec.ll vendor/llvm/dist/test/CodeGen/AVR/rot.ll vendor/llvm/dist/test/CodeGen/BPF/mem_offset_be.ll vendor/llvm/dist/test/CodeGen/Hexagon/cfgopt-fall-through.ll vendor/llvm/dist/test/CodeGen/Hexagon/rdf-def-mask.ll vendor/llvm/dist/test/CodeGen/Hexagon/unreachable-mbb-phi-subreg.mir vendor/llvm/dist/test/CodeGen/Mips/micromips-sizereduction/ vendor/llvm/dist/test/CodeGen/Mips/micromips-sizereduction/micromips-lwsp-swsp.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/ext-x86-64.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/ext.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/legalize-ext-x86-64.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/legalize-ext.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/memop-x32.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/regbankselect-X86_64.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-ext-x86-64.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-ext.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-inc.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-memop-x32.mir vendor/llvm/dist/test/CodeGen/X86/addcarry.ll vendor/llvm/dist/test/CodeGen/X86/cast-vsel.ll vendor/llvm/dist/test/CodeGen/X86/inline-0bh.ll vendor/llvm/dist/test/CodeGen/X86/pr28129.ll vendor/llvm/dist/test/CodeGen/X86/pr31088.ll vendor/llvm/dist/test/CodeGen/X86/stackmap-large-location-size.ll vendor/llvm/dist/test/DebugInfo/AMDGPU/dbg-value-sched-crash.ll vendor/llvm/dist/test/DebugInfo/Generic/thrownTypes.ll vendor/llvm/dist/test/DebugInfo/PDB/Inputs/simple-line-info.yaml vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-yaml-lineinfo-write.test vendor/llvm/dist/test/Instrumentation/AddressSanitizer/no-globals.ll vendor/llvm/dist/test/MC/AArch64/arm32-large-relocs.s (contents, props changed) vendor/llvm/dist/test/MC/AArch64/arm32-tls-relocs.s (contents, props changed) vendor/llvm/dist/test/MC/AArch64/elf-reloc-pcreladdressing-ilp32.s (contents, props changed) vendor/llvm/dist/test/MC/AArch64/lp64-diagnostics.s (contents, props changed) vendor/llvm/dist/test/MC/AsmParser/altmacro_expression.s (contents, props changed) vendor/llvm/dist/test/MC/AsmParser/negativ_altmacro_expression.s (contents, props changed) vendor/llvm/dist/test/MC/Hexagon/PacketRules/ vendor/llvm/dist/test/MC/Hexagon/PacketRules/registers_readonly.s (contents, props changed) vendor/llvm/dist/test/MC/Hexagon/PacketRules/solo.s (contents, props changed) vendor/llvm/dist/test/MC/Hexagon/multiple_errs.s (contents, props changed) vendor/llvm/dist/test/MC/Hexagon/registers_readonly.s (contents, props changed) vendor/llvm/dist/test/MC/Hexagon/ro-c9.s (contents, props changed) vendor/llvm/dist/test/MC/Hexagon/ro-cc9.s (contents, props changed) vendor/llvm/dist/test/MC/WebAssembly/reloc-code.ll vendor/llvm/dist/test/MC/WebAssembly/reloc-data.ll vendor/llvm/dist/test/MC/WebAssembly/sections.ll vendor/llvm/dist/test/MC/X86/pr27884.s (contents, props changed) vendor/llvm/dist/test/Transforms/CodeExtractor/PartialInlineAnd.ll vendor/llvm/dist/test/Transforms/CodeExtractor/PartialInlineAndOr.ll vendor/llvm/dist/test/Transforms/CodeExtractor/PartialInlineOr.ll vendor/llvm/dist/test/Transforms/CodeExtractor/PartialInlineOrAnd.ll vendor/llvm/dist/test/Transforms/CodeExtractor/SingleCondition.ll vendor/llvm/dist/test/Transforms/GlobalOpt/localize-constexpr-debuginfo.ll vendor/llvm/dist/test/Transforms/InferAddressSpaces/AMDGPU/infer-addrspacecast.ll vendor/llvm/dist/test/Transforms/Inline/AArch64/switch.ll vendor/llvm/dist/test/Transforms/InstCombine/apint-and.ll vendor/llvm/dist/test/Transforms/InstCombine/demorgan.ll vendor/llvm/dist/test/Transforms/LoopUnswitch/pr32818.ll vendor/llvm/dist/test/Transforms/NewGVN/pr32852.ll vendor/llvm/dist/test/Transforms/PGOProfile/memop_size_opt_zero.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/ vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2006-06-13-SingleEntryPHI.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2006-06-27-DeadSwitchCase.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2007-05-09-Unreachable.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2007-05-09-tl.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2007-07-12-ExitDomInfo.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2007-07-13-DomInfo.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2007-07-18-DomInfo.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2007-08-01-Dom.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2007-08-01-LCSSA.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2007-10-04-DomFrontier.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2008-06-02-DomInfo.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2008-06-17-DomFrontier.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2010-11-18-LCSSA.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2011-06-02-CritSwitch.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2011-09-26-EHCrash.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2012-04-02-IndirectBr.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2012-04-30-LoopUnswitch-LPad-Crash.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2012-05-20-Phi.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/2015-09-18-Addrspace.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/LIV-loop-condtion.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/basictest.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/cleanuppad.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/copy-metadata.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/crash.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/exponential-behavior.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/infinite-loop.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/msan.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/preserve-analyses.ll vendor/llvm/dist/test/Transforms/SimpleLoopUnswitch/trivial-unswitch.ll vendor/llvm/dist/test/Transforms/SimplifyCFG/speculate-call.ll vendor/llvm/dist/test/Verifier/DISubprogram.ll vendor/llvm/dist/test/Verifier/speculatable-callsite-invalid.ll vendor/llvm/dist/test/Verifier/speculatable-callsite.ll vendor/llvm/dist/test/tools/llvm-pdbdump/raw-stream-data.test vendor/llvm/dist/test/tools/llvm-readobj/Inputs/const-import.lib (contents, props changed) vendor/llvm/dist/test/tools/llvm-readobj/coff-const-import.test vendor/llvm/dist/test/tools/llvm-readobj/resources.test vendor/llvm/dist/tools/llvm-pdbdump/C13DebugFragmentVisitor.cpp (contents, props changed) vendor/llvm/dist/tools/llvm-pdbdump/C13DebugFragmentVisitor.h (contents, props changed) vendor/llvm/dist/unittests/Support/DynamicLibrary/CMakeLists.txt (contents, props changed) vendor/llvm/dist/unittests/Support/DynamicLibrary/DynamicLibraryTest.cpp (contents, props changed) vendor/llvm/dist/unittests/Support/DynamicLibrary/PipSqueak.cxx (contents, props changed) vendor/llvm/dist/unittests/Support/DynamicLibrary/PipSqueak.h (contents, props changed) Deleted: vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleSubstream.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/ModuleSubstreamVisitor.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/ModInfo.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/ModInfoBuilder.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/ModStream.h vendor/llvm/dist/include/llvm/Object/ModuleSummaryIndexObjectFile.h vendor/llvm/dist/lib/DebugInfo/CodeView/ModuleSubstream.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/ModuleSubstreamVisitor.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/ModInfo.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/ModInfoBuilder.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/ModStream.cpp vendor/llvm/dist/lib/Object/ModuleSummaryIndexObjectFile.cpp vendor/llvm/dist/lib/Support/SearchForAddressOfSpecialSymbol.cpp vendor/llvm/dist/lib/Target/ARM/ARMInstructionSelector.h vendor/llvm/dist/test/CodeGen/X86/GlobalISel/X86-regbankselect.mir vendor/llvm/dist/test/CodeGen/X86/adde-carry.ll vendor/llvm/dist/test/CodeGen/X86/pr14657.ll vendor/llvm/dist/test/Transforms/InstCombine/apint-and1.ll vendor/llvm/dist/test/Transforms/InstCombine/apint-and2.ll vendor/llvm/dist/test/Transforms/InstCombine/demorgan-zext.ll Modified: vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake vendor/llvm/dist/cmake/modules/VersionFromVCS.cmake vendor/llvm/dist/docs/AMDGPUUsage.rst vendor/llvm/dist/docs/CMakeLists.txt vendor/llvm/dist/docs/LangRef.rst vendor/llvm/dist/docs/ProgrammersManual.rst vendor/llvm/dist/docs/README.txt vendor/llvm/dist/docs/StackMaps.rst vendor/llvm/dist/docs/TableGen/LangIntro.rst vendor/llvm/dist/docs/doxygen.cfg.in vendor/llvm/dist/include/llvm/ADT/APInt.h vendor/llvm/dist/include/llvm/Analysis/AssumptionCache.h vendor/llvm/dist/include/llvm/Analysis/CGSCCPassManager.h vendor/llvm/dist/include/llvm/Analysis/CallGraph.h vendor/llvm/dist/include/llvm/Analysis/IVUsers.h vendor/llvm/dist/include/llvm/Analysis/InlineCost.h vendor/llvm/dist/include/llvm/Analysis/InstructionSimplify.h vendor/llvm/dist/include/llvm/Analysis/MemoryBuiltins.h vendor/llvm/dist/include/llvm/Analysis/ScalarEvolutionExpander.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfo.h vendor/llvm/dist/include/llvm/Analysis/TargetTransformInfoImpl.h vendor/llvm/dist/include/llvm/Analysis/ValueTracking.h vendor/llvm/dist/include/llvm/Bitcode/BitcodeReader.h vendor/llvm/dist/include/llvm/Bitcode/LLVMBitCodes.h vendor/llvm/dist/include/llvm/CodeGen/BasicTTIImpl.h vendor/llvm/dist/include/llvm/CodeGen/FunctionLoweringInfo.h vendor/llvm/dist/include/llvm/CodeGen/GlobalISel/InstructionSelector.h vendor/llvm/dist/include/llvm/CodeGen/ISDOpcodes.h vendor/llvm/dist/include/llvm/CodeGen/MIRYamlMapping.h vendor/llvm/dist/include/llvm/CodeGen/MachineFrameInfo.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAG.h vendor/llvm/dist/include/llvm/CodeGen/SelectionDAGNodes.h vendor/llvm/dist/include/llvm/CodeGen/ValueTypes.td vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CVRecord.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/CodeView.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/Line.h vendor/llvm/dist/include/llvm/DebugInfo/CodeView/TypeDatabase.h vendor/llvm/dist/include/llvm/DebugInfo/DIContext.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFContext.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h vendor/llvm/dist/include/llvm/DebugInfo/DWARF/DWARFFormValue.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiStream.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/DbiStreamBuilder.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/NativeCompilandSymbol.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/NativeEnumModules.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/RawTypes.h vendor/llvm/dist/include/llvm/DebugInfo/PDB/Native/StringTableBuilder.h vendor/llvm/dist/include/llvm/DebugInfo/Symbolize/Symbolize.h vendor/llvm/dist/include/llvm/IR/Argument.h vendor/llvm/dist/include/llvm/IR/Attributes.h vendor/llvm/dist/include/llvm/IR/Attributes.td vendor/llvm/dist/include/llvm/IR/CallSite.h vendor/llvm/dist/include/llvm/IR/CallingConv.h vendor/llvm/dist/include/llvm/IR/DIBuilder.h vendor/llvm/dist/include/llvm/IR/DebugInfoMetadata.h vendor/llvm/dist/include/llvm/IR/Function.h vendor/llvm/dist/include/llvm/IR/InstrTypes.h vendor/llvm/dist/include/llvm/IR/Instructions.h vendor/llvm/dist/include/llvm/IR/IntrinsicInst.h vendor/llvm/dist/include/llvm/IR/Intrinsics.td vendor/llvm/dist/include/llvm/IR/IntrinsicsAMDGPU.td vendor/llvm/dist/include/llvm/IR/ModuleSummaryIndex.h vendor/llvm/dist/include/llvm/IR/ValueHandle.h vendor/llvm/dist/include/llvm/InitializePasses.h vendor/llvm/dist/include/llvm/MC/ConstantPools.h vendor/llvm/dist/include/llvm/MC/LaneBitmask.h vendor/llvm/dist/include/llvm/MC/MCAssembler.h vendor/llvm/dist/include/llvm/MC/MCContext.h vendor/llvm/dist/include/llvm/MC/MCDwarf.h vendor/llvm/dist/include/llvm/MC/MCExpr.h vendor/llvm/dist/include/llvm/MC/MCFragment.h vendor/llvm/dist/include/llvm/MC/MCInst.h vendor/llvm/dist/include/llvm/MC/MCLinkerOptimizationHint.h vendor/llvm/dist/include/llvm/MC/MCParser/MCAsmLexer.h vendor/llvm/dist/include/llvm/MC/MCParser/MCAsmParser.h vendor/llvm/dist/include/llvm/MC/MCParser/MCTargetAsmParser.h vendor/llvm/dist/include/llvm/MC/MCRegisterInfo.h vendor/llvm/dist/include/llvm/MC/MCSection.h vendor/llvm/dist/include/llvm/MC/MCSectionWasm.h vendor/llvm/dist/include/llvm/MC/MCStreamer.h vendor/llvm/dist/include/llvm/MC/MCSubtargetInfo.h vendor/llvm/dist/include/llvm/MC/MCSymbol.h vendor/llvm/dist/include/llvm/MC/MCWasmObjectWriter.h vendor/llvm/dist/include/llvm/Object/Binary.h vendor/llvm/dist/include/llvm/Object/COFF.h vendor/llvm/dist/include/llvm/Object/COFFImportFile.h vendor/llvm/dist/include/llvm/Object/ELF.h vendor/llvm/dist/include/llvm/Support/AArch64TargetParser.def vendor/llvm/dist/include/llvm/Support/BinaryStreamArray.h vendor/llvm/dist/include/llvm/Support/BinaryStreamReader.h vendor/llvm/dist/include/llvm/Support/BinaryStreamWriter.h vendor/llvm/dist/include/llvm/Support/CMakeLists.txt vendor/llvm/dist/include/llvm/Support/DynamicLibrary.h vendor/llvm/dist/include/llvm/Support/ELFRelocs/AArch64.def vendor/llvm/dist/include/llvm/Support/KnownBits.h vendor/llvm/dist/include/llvm/Support/LEB128.h vendor/llvm/dist/include/llvm/Support/ScopedPrinter.h vendor/llvm/dist/include/llvm/Support/StringSaver.h vendor/llvm/dist/include/llvm/Support/Wasm.h vendor/llvm/dist/include/llvm/Target/Target.td vendor/llvm/dist/include/llvm/Target/TargetLowering.h vendor/llvm/dist/include/llvm/Transforms/Scalar/NaryReassociate.h vendor/llvm/dist/include/llvm/Transforms/Utils/Cloning.h vendor/llvm/dist/include/llvm/Transforms/Utils/Local.h vendor/llvm/dist/include/llvm/Transforms/Utils/ModuleUtils.h vendor/llvm/dist/include/llvm/Transforms/Utils/SimplifyIndVar.h vendor/llvm/dist/include/llvm/Transforms/Utils/ValueMapper.h vendor/llvm/dist/include/llvm/Transforms/Vectorize/SLPVectorizer.h vendor/llvm/dist/lib/Analysis/AssumptionCache.cpp vendor/llvm/dist/lib/Analysis/CFLGraph.h vendor/llvm/dist/lib/Analysis/CallGraphSCCPass.cpp vendor/llvm/dist/lib/Analysis/DemandedBits.cpp vendor/llvm/dist/lib/Analysis/InlineCost.cpp vendor/llvm/dist/lib/Analysis/InstructionSimplify.cpp vendor/llvm/dist/lib/Analysis/LazyValueInfo.cpp vendor/llvm/dist/lib/Analysis/Lint.cpp vendor/llvm/dist/lib/Analysis/PHITransAddr.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolution.cpp vendor/llvm/dist/lib/Analysis/ScalarEvolutionExpander.cpp vendor/llvm/dist/lib/Analysis/TargetTransformInfo.cpp vendor/llvm/dist/lib/Analysis/ValueTracking.cpp vendor/llvm/dist/lib/AsmParser/LLLexer.cpp vendor/llvm/dist/lib/AsmParser/LLParser.cpp vendor/llvm/dist/lib/AsmParser/LLToken.h vendor/llvm/dist/lib/Bitcode/Reader/BitcodeReader.cpp vendor/llvm/dist/lib/Bitcode/Reader/MetadataLoader.cpp vendor/llvm/dist/lib/Bitcode/Reader/ValueList.cpp vendor/llvm/dist/lib/Bitcode/Reader/ValueList.h vendor/llvm/dist/lib/Bitcode/Writer/BitcodeWriter.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/AsmPrinter.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/CodeViewDebug.h vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfUnit.cpp vendor/llvm/dist/lib/CodeGen/AsmPrinter/DwarfUnit.h vendor/llvm/dist/lib/CodeGen/CMakeLists.txt vendor/llvm/dist/lib/CodeGen/CodeGenPrepare.cpp vendor/llvm/dist/lib/CodeGen/DFAPacketizer.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/CallLowering.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/IRTranslator.cpp vendor/llvm/dist/lib/CodeGen/GlobalISel/InstructionSelector.cpp vendor/llvm/dist/lib/CodeGen/MIRParser/MIRParser.cpp vendor/llvm/dist/lib/CodeGen/MIRPrinter.cpp vendor/llvm/dist/lib/CodeGen/MachineFunction.cpp vendor/llvm/dist/lib/CodeGen/MachineInstr.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/DAGCombiner.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeTypes.h vendor/llvm/dist/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAG.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/StatepointLowering.cpp vendor/llvm/dist/lib/CodeGen/SelectionDAG/TargetLowering.cpp vendor/llvm/dist/lib/CodeGen/StackMaps.cpp vendor/llvm/dist/lib/CodeGen/TargetLoweringBase.cpp vendor/llvm/dist/lib/CodeGen/UnreachableBlockElim.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/CMakeLists.txt vendor/llvm/dist/lib/DebugInfo/CodeView/EnumTables.cpp vendor/llvm/dist/lib/DebugInfo/CodeView/TypeDatabase.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFContext.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFDebugLine.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFDebugPubTable.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFFormValue.cpp vendor/llvm/dist/lib/DebugInfo/DWARF/DWARFGdbIndex.cpp vendor/llvm/dist/lib/DebugInfo/PDB/CMakeLists.txt vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiStream.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/DbiStreamBuilder.cpp vendor/llvm/dist/lib/DebugInfo/PDB/Native/StringTableBuilder.cpp vendor/llvm/dist/lib/DebugInfo/Symbolize/Symbolize.cpp vendor/llvm/dist/lib/ExecutionEngine/Interpreter/Execution.cpp vendor/llvm/dist/lib/Fuzzer/FuzzerInternal.h vendor/llvm/dist/lib/Fuzzer/test/cxxstring.test vendor/llvm/dist/lib/IR/AsmWriter.cpp vendor/llvm/dist/lib/IR/Attributes.cpp vendor/llvm/dist/lib/IR/ConstantRange.cpp vendor/llvm/dist/lib/IR/DIBuilder.cpp vendor/llvm/dist/lib/IR/DebugInfoMetadata.cpp vendor/llvm/dist/lib/IR/Function.cpp vendor/llvm/dist/lib/IR/Instructions.cpp vendor/llvm/dist/lib/IR/LLVMContextImpl.h vendor/llvm/dist/lib/IR/Metadata.cpp vendor/llvm/dist/lib/IR/ModuleSummaryIndex.cpp vendor/llvm/dist/lib/IR/Value.cpp vendor/llvm/dist/lib/IR/Verifier.cpp vendor/llvm/dist/lib/LTO/LTO.cpp vendor/llvm/dist/lib/LTO/ThinLTOCodeGenerator.cpp vendor/llvm/dist/lib/MC/ELFObjectWriter.cpp vendor/llvm/dist/lib/MC/MCCodeView.cpp vendor/llvm/dist/lib/MC/MCParser/AsmParser.cpp vendor/llvm/dist/lib/MC/MCParser/MCAsmLexer.cpp vendor/llvm/dist/lib/MC/StringTableBuilder.cpp vendor/llvm/dist/lib/MC/WasmObjectWriter.cpp vendor/llvm/dist/lib/MC/WinCOFFObjectWriter.cpp vendor/llvm/dist/lib/Object/CMakeLists.txt vendor/llvm/dist/lib/Object/ELF.cpp vendor/llvm/dist/lib/Passes/PassBuilder.cpp vendor/llvm/dist/lib/Passes/PassRegistry.def vendor/llvm/dist/lib/Support/APInt.cpp vendor/llvm/dist/lib/Support/CMakeLists.txt vendor/llvm/dist/lib/Support/DynamicLibrary.cpp vendor/llvm/dist/lib/Support/PrettyStackTrace.cpp vendor/llvm/dist/lib/Support/ScopedPrinter.cpp vendor/llvm/dist/lib/Support/SourceMgr.cpp vendor/llvm/dist/lib/Support/Windows/DynamicLibrary.inc vendor/llvm/dist/lib/Target/AArch64/AArch64AsmPrinter.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64FastISel.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64ISelLowering.h vendor/llvm/dist/lib/Target/AArch64/AArch64InstrInfo.td vendor/llvm/dist/lib/Target/AArch64/AArch64InstructionSelector.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64Subtarget.cpp vendor/llvm/dist/lib/Target/AArch64/AArch64Subtarget.h vendor/llvm/dist/lib/Target/AArch64/AArch64TargetMachine.cpp vendor/llvm/dist/lib/Target/AArch64/MCTargetDesc/AArch64ELFObjectWriter.cpp vendor/llvm/dist/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.cpp vendor/llvm/dist/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPU.td vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUAsmPrinter.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUISelLowering.h vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUInstrInfo.td vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp vendor/llvm/dist/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/AMDGPU/GCNSchedStrategy.cpp vendor/llvm/dist/lib/Target/AMDGPU/R600Intrinsics.td vendor/llvm/dist/lib/Target/AMDGPU/SIAnnotateControlFlow.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIDefines.h vendor/llvm/dist/lib/Target/AMDGPU/SIFixSGPRCopies.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIISelLowering.cpp vendor/llvm/dist/lib/Target/AMDGPU/SIInstructions.td vendor/llvm/dist/lib/Target/AMDGPU/Utils/AMDGPUBaseInfo.cpp vendor/llvm/dist/lib/Target/ARM/ARM.h vendor/llvm/dist/lib/Target/ARM/ARMCallLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMFastISel.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.cpp vendor/llvm/dist/lib/Target/ARM/ARMISelLowering.h vendor/llvm/dist/lib/Target/ARM/ARMInstrInfo.td vendor/llvm/dist/lib/Target/ARM/ARMInstructionSelector.cpp vendor/llvm/dist/lib/Target/ARM/ARMTargetMachine.cpp vendor/llvm/dist/lib/Target/ARM/CMakeLists.txt vendor/llvm/dist/lib/Target/AVR/AVRFrameLowering.cpp vendor/llvm/dist/lib/Target/AVR/AVRISelLowering.cpp vendor/llvm/dist/lib/Target/AVR/AVRISelLowering.h vendor/llvm/dist/lib/Target/AVR/AVRInstrInfo.td vendor/llvm/dist/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp vendor/llvm/dist/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.h vendor/llvm/dist/lib/Target/BPF/Disassembler/BPFDisassembler.cpp vendor/llvm/dist/lib/Target/Hexagon/AsmParser/HexagonAsmParser.cpp vendor/llvm/dist/lib/Target/Hexagon/Disassembler/HexagonDisassembler.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonBitTracker.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonCFGOptimizer.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonDepITypes.h vendor/llvm/dist/lib/Target/Hexagon/HexagonDepITypes.td vendor/llvm/dist/lib/Target/Hexagon/HexagonDepInstrInfo.td vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrFormats.td vendor/llvm/dist/lib/Target/Hexagon/HexagonInstrFormatsV60.td vendor/llvm/dist/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp vendor/llvm/dist/lib/Target/Hexagon/HexagonMachineScheduler.h vendor/llvm/dist/lib/Target/Hexagon/HexagonRegisterInfo.td vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonAsmBackend.cpp vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonBaseInfo.h vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.cpp vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonMCChecker.h vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonMCCompound.cpp vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.cpp vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonMCInstrInfo.h vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.cpp vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonMCShuffler.h vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.cpp vendor/llvm/dist/lib/Target/Hexagon/MCTargetDesc/HexagonShuffler.h vendor/llvm/dist/lib/Target/Hexagon/RDFLiveness.cpp vendor/llvm/dist/lib/Target/Lanai/LanaiRegisterInfo.cpp vendor/llvm/dist/lib/Target/Lanai/LanaiRegisterInfo.h vendor/llvm/dist/lib/Target/Mips/CMakeLists.txt vendor/llvm/dist/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp vendor/llvm/dist/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp vendor/llvm/dist/lib/Target/Mips/MCTargetDesc/MipsFixupKinds.h vendor/llvm/dist/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp vendor/llvm/dist/lib/Target/Mips/Mips.h vendor/llvm/dist/lib/Target/Mips/MipsFastISel.cpp vendor/llvm/dist/lib/Target/Mips/MipsTargetMachine.cpp vendor/llvm/dist/lib/Target/NVPTX/NVPTXAsmPrinter.cpp vendor/llvm/dist/lib/Target/NVPTX/NVPTXLowerArgs.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.cpp vendor/llvm/dist/lib/Target/PowerPC/PPCISelLowering.h vendor/llvm/dist/lib/Target/PowerPC/PPCInstrVSX.td vendor/llvm/dist/lib/Target/Sparc/SparcISelLowering.cpp vendor/llvm/dist/lib/Target/Sparc/SparcISelLowering.h vendor/llvm/dist/lib/Target/SystemZ/SystemZISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZISelLowering.cpp vendor/llvm/dist/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp vendor/llvm/dist/lib/Target/TargetLoweringObjectFile.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/WebAssembly/WebAssemblyInstrMemory.td vendor/llvm/dist/lib/Target/X86/X86FastISel.cpp vendor/llvm/dist/lib/Target/X86/X86ISelDAGToDAG.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.cpp vendor/llvm/dist/lib/Target/X86/X86ISelLowering.h vendor/llvm/dist/lib/Target/X86/X86InstrCompiler.td vendor/llvm/dist/lib/Target/X86/X86InstrInfo.td vendor/llvm/dist/lib/Target/X86/X86InstructionSelector.cpp vendor/llvm/dist/lib/Target/X86/X86LegalizerInfo.cpp vendor/llvm/dist/lib/Target/X86/X86OptimizeLEAs.cpp vendor/llvm/dist/lib/Target/X86/X86SelectionDAGInfo.cpp vendor/llvm/dist/lib/Target/X86/X86Subtarget.cpp vendor/llvm/dist/lib/Target/X86/X86Subtarget.h vendor/llvm/dist/lib/Target/X86/X86TargetMachine.cpp vendor/llvm/dist/lib/Target/XCore/XCoreISelLowering.cpp vendor/llvm/dist/lib/Target/XCore/XCoreISelLowering.h vendor/llvm/dist/lib/Target/XCore/XCoreLowerThreadLocal.cpp vendor/llvm/dist/lib/Transforms/IPO/ArgumentPromotion.cpp vendor/llvm/dist/lib/Transforms/IPO/FunctionAttrs.cpp vendor/llvm/dist/lib/Transforms/IPO/FunctionImport.cpp vendor/llvm/dist/lib/Transforms/IPO/GlobalOpt.cpp vendor/llvm/dist/lib/Transforms/IPO/LLVMBuild.txt vendor/llvm/dist/lib/Transforms/IPO/MergeFunctions.cpp vendor/llvm/dist/lib/Transforms/IPO/PartialInlining.cpp vendor/llvm/dist/lib/Transforms/IPO/PassManagerBuilder.cpp vendor/llvm/dist/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineAddSub.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCalls.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineCompares.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineInternal.h vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombinePHI.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineSelect.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineShifts.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstCombineVectorOps.cpp vendor/llvm/dist/lib/Transforms/InstCombine/InstructionCombining.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/AddressSanitizer.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/IndirectCallPromotion.cpp vendor/llvm/dist/lib/Transforms/Instrumentation/MemorySanitizer.cpp vendor/llvm/dist/lib/Transforms/ObjCARC/ObjCARC.h vendor/llvm/dist/lib/Transforms/ObjCARC/PtrState.cpp vendor/llvm/dist/lib/Transforms/Scalar/CMakeLists.txt vendor/llvm/dist/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp vendor/llvm/dist/lib/Transforms/Scalar/EarlyCSE.cpp vendor/llvm/dist/lib/Transforms/Scalar/GVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/IndVarSimplify.cpp vendor/llvm/dist/lib/Transforms/Scalar/InferAddressSpaces.cpp vendor/llvm/dist/lib/Transforms/Scalar/JumpThreading.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopIdiomRecognize.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopInstSimplify.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopRotation.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopSimplifyCFG.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopStrengthReduce.cpp vendor/llvm/dist/lib/Transforms/Scalar/LoopUnswitch.cpp vendor/llvm/dist/lib/Transforms/Scalar/MemCpyOptimizer.cpp vendor/llvm/dist/lib/Transforms/Scalar/NaryReassociate.cpp vendor/llvm/dist/lib/Transforms/Scalar/NewGVN.cpp vendor/llvm/dist/lib/Transforms/Scalar/Reassociate.cpp vendor/llvm/dist/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp vendor/llvm/dist/lib/Transforms/Scalar/SROA.cpp vendor/llvm/dist/lib/Transforms/Scalar/Scalar.cpp vendor/llvm/dist/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp vendor/llvm/dist/lib/Transforms/Utils/BasicBlockUtils.cpp vendor/llvm/dist/lib/Transforms/Utils/CloneFunction.cpp vendor/llvm/dist/lib/Transforms/Utils/InlineFunction.cpp vendor/llvm/dist/lib/Transforms/Utils/LibCallsShrinkWrap.cpp vendor/llvm/dist/lib/Transforms/Utils/Local.cpp vendor/llvm/dist/lib/Transforms/Utils/LoopSimplify.cpp vendor/llvm/dist/lib/Transforms/Utils/LoopUnroll.cpp vendor/llvm/dist/lib/Transforms/Utils/ModuleUtils.cpp vendor/llvm/dist/lib/Transforms/Utils/PromoteMemoryToRegister.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyCFG.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyIndVar.cpp vendor/llvm/dist/lib/Transforms/Utils/SimplifyInstructions.cpp vendor/llvm/dist/lib/Transforms/Vectorize/SLPVectorizer.cpp vendor/llvm/dist/test/Analysis/ScalarEvolution/flags-from-poison.ll vendor/llvm/dist/test/Assembler/dinamespace.ll vendor/llvm/dist/test/Assembler/disubprogram.ll vendor/llvm/dist/test/Bitcode/DINamespace.ll vendor/llvm/dist/test/Bitcode/attributes.ll vendor/llvm/dist/test/Bitcode/compatibility.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-anyregcc.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-stackmap.ll vendor/llvm/dist/test/CodeGen/AArch64/arm64-tls-dynamics.ll vendor/llvm/dist/test/CodeGen/AArch64/stackmap-liveness.ll vendor/llvm/dist/test/CodeGen/AMDGPU/annotate-kernel-features-hsa.ll vendor/llvm/dist/test/CodeGen/AMDGPU/inline-asm.ll vendor/llvm/dist/test/CodeGen/AMDGPU/zext-lid.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll vendor/llvm/dist/test/CodeGen/ARM/GlobalISel/arm-isel.ll vendor/llvm/dist/test/CodeGen/ARM/bool-ext-inc.ll vendor/llvm/dist/test/CodeGen/AVR/calling-conv/c/stack.ll vendor/llvm/dist/test/CodeGen/AVR/return.ll vendor/llvm/dist/test/CodeGen/AVR/varargs.ll vendor/llvm/dist/test/CodeGen/MIR/Generic/frame-info.mir vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/add.ll vendor/llvm/dist/test/CodeGen/Mips/llvm-ir/sub.ll vendor/llvm/dist/test/CodeGen/NVPTX/f16-instructions.ll vendor/llvm/dist/test/CodeGen/PowerPC/build-vector-tests.ll vendor/llvm/dist/test/CodeGen/PowerPC/ppc64-anyregcc.ll vendor/llvm/dist/test/CodeGen/PowerPC/ppc64-i128-abi.ll vendor/llvm/dist/test/CodeGen/PowerPC/ppc64-stackmap.ll vendor/llvm/dist/test/CodeGen/PowerPC/swaps-le-1.ll vendor/llvm/dist/test/CodeGen/PowerPC/swaps-le-2.ll vendor/llvm/dist/test/CodeGen/PowerPC/vsx-ldst.ll vendor/llvm/dist/test/CodeGen/PowerPC/vsx.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/binop.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/callingconv.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/irtranslator-call.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/memop.ll vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-add.mir vendor/llvm/dist/test/CodeGen/X86/GlobalISel/select-memop.mir vendor/llvm/dist/test/CodeGen/X86/all-ones-vector.ll vendor/llvm/dist/test/CodeGen/X86/anyregcc.ll vendor/llvm/dist/test/CodeGen/X86/avx-intrinsics-fast-isel.ll vendor/llvm/dist/test/CodeGen/X86/avx512-intrinsics-fast-isel.ll vendor/llvm/dist/test/CodeGen/X86/bool-ext-inc.ll vendor/llvm/dist/test/CodeGen/X86/bswap_tree.ll vendor/llvm/dist/test/CodeGen/X86/clz.ll vendor/llvm/dist/test/CodeGen/X86/deopt-bundles.ll vendor/llvm/dist/test/CodeGen/X86/deopt-intrinsic-cconv.ll vendor/llvm/dist/test/CodeGen/X86/deopt-intrinsic.ll vendor/llvm/dist/test/CodeGen/X86/known-bits.ll vendor/llvm/dist/test/CodeGen/X86/known-signbits-vector.ll vendor/llvm/dist/test/CodeGen/X86/lea-opt-with-debug.mir vendor/llvm/dist/test/CodeGen/X86/mul-i1024.ll vendor/llvm/dist/test/CodeGen/X86/mul-i256.ll vendor/llvm/dist/test/CodeGen/X86/mul-i512.ll vendor/llvm/dist/test/CodeGen/X86/patchpoint-invoke.ll vendor/llvm/dist/test/CodeGen/X86/sse2-intrinsics-fast-isel.ll vendor/llvm/dist/test/CodeGen/X86/stack-protector-dbginfo.ll vendor/llvm/dist/test/CodeGen/X86/stackmap-fast-isel.ll vendor/llvm/dist/test/CodeGen/X86/stackmap-large-constants.ll vendor/llvm/dist/test/CodeGen/X86/stackmap-liveness.ll vendor/llvm/dist/test/CodeGen/X86/stackmap.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-allocas.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-live-in.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-stackmap-format.ll vendor/llvm/dist/test/CodeGen/X86/statepoint-vector.ll vendor/llvm/dist/test/CodeGen/X86/vector-shuffle-combining.ll vendor/llvm/dist/test/CodeGen/X86/widened-broadcast.ll vendor/llvm/dist/test/DebugInfo/COFF/cpp-mangling.ll vendor/llvm/dist/test/DebugInfo/COFF/scopes.ll vendor/llvm/dist/test/DebugInfo/Generic/dwarf-public-names.ll vendor/llvm/dist/test/DebugInfo/Generic/namespace.ll vendor/llvm/dist/test/DebugInfo/Generic/namespace_function_definition.ll vendor/llvm/dist/test/DebugInfo/Generic/namespace_inline_function_definition.ll vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-headers.test vendor/llvm/dist/test/DebugInfo/PDB/pdbdump-yaml-lineinfo.test vendor/llvm/dist/test/DebugInfo/X86/dwarf-linkage-names.ll vendor/llvm/dist/test/DebugInfo/X86/dwarf-public-names.ll vendor/llvm/dist/test/DebugInfo/X86/generate-odr-hash.ll vendor/llvm/dist/test/DebugInfo/X86/gnu-public-names-tu.ll vendor/llvm/dist/test/DebugInfo/X86/gnu-public-names.ll vendor/llvm/dist/test/DebugInfo/X86/inline-namespace.ll vendor/llvm/dist/test/DebugInfo/X86/lexical-block-file-inline.ll vendor/llvm/dist/test/DebugInfo/X86/multiple-at-const-val.ll vendor/llvm/dist/test/DebugInfo/X86/parameters.ll vendor/llvm/dist/test/DebugInfo/X86/pr19307.ll vendor/llvm/dist/test/DebugInfo/X86/union-template.ll vendor/llvm/dist/test/DebugInfo/dwarfdump-dump-gdbindex.test vendor/llvm/dist/test/Feature/optnone-opt.ll vendor/llvm/dist/test/Instrumentation/AddressSanitizer/global_metadata.ll vendor/llvm/dist/test/Instrumentation/AddressSanitizer/global_metadata_darwin.ll vendor/llvm/dist/test/Instrumentation/AddressSanitizer/global_metadata_windows.ll vendor/llvm/dist/test/Instrumentation/AddressSanitizer/instrument_global.ll vendor/llvm/dist/test/Linker/2011-08-18-unique-class-type.ll vendor/llvm/dist/test/Linker/2011-08-18-unique-class-type2.ll vendor/llvm/dist/test/Linker/pr26037.ll vendor/llvm/dist/test/MC/AArch64/adrp-relocation.s vendor/llvm/dist/test/MC/AArch64/arm32-elf-relocs.s vendor/llvm/dist/test/MC/AArch64/arm64-elf-reloc-condbr.s vendor/llvm/dist/test/MC/AArch64/arm64-elf-relocs.s vendor/llvm/dist/test/MC/AArch64/arm64-tls-relocs.s vendor/llvm/dist/test/MC/AArch64/directive-arch-negative.s vendor/llvm/dist/test/MC/AArch64/elf-reloc-ldrlit.s vendor/llvm/dist/test/MC/AArch64/elf-reloc-tstb.s vendor/llvm/dist/test/MC/AArch64/elf-reloc-uncondbrimm.s vendor/llvm/dist/test/MC/AArch64/error-location.s vendor/llvm/dist/test/MC/AArch64/ilp32-diagnostics.s vendor/llvm/dist/test/MC/AArch64/inline-asm-modifiers.s vendor/llvm/dist/test/MC/AArch64/tls-relocs.s vendor/llvm/dist/test/MC/AMDGPU/vop_dpp.s vendor/llvm/dist/test/MC/AMDGPU/vop_dpp_expr.s vendor/llvm/dist/test/MC/AVR/inst-lds.s vendor/llvm/dist/test/MC/AVR/inst-sts.s vendor/llvm/dist/test/MC/ELF/section-numeric-invalid-type.s vendor/llvm/dist/test/MC/Mips/relocation.s vendor/llvm/dist/test/Other/new-pm-defaults.ll vendor/llvm/dist/test/TableGen/GlobalISelEmitter.td vendor/llvm/dist/test/ThinLTO/X86/debuginfo-cu-import.ll vendor/llvm/dist/test/Transforms/CodeExtractor/MultipleExitBranchProb.ll vendor/llvm/dist/test/Transforms/CodeExtractor/PartialInlineOptRemark.ll vendor/llvm/dist/test/Transforms/CodeExtractor/unreachable-block.ll vendor/llvm/dist/test/Transforms/EarlyCSE/guards.ll vendor/llvm/dist/test/Transforms/GVNHoist/hoist-inline.ll vendor/llvm/dist/test/Transforms/InferAddressSpaces/AMDGPU/infer-getelementptr.ll vendor/llvm/dist/test/Transforms/InferAddressSpaces/NVPTX/bug31948.ll vendor/llvm/dist/test/Transforms/InstCombine/amdgcn-intrinsics.ll vendor/llvm/dist/test/Transforms/InstCombine/and-or-not.ll vendor/llvm/dist/test/Transforms/InstCombine/and.ll vendor/llvm/dist/test/Transforms/InstCombine/apint-not.ll vendor/llvm/dist/test/Transforms/InstCombine/apint-or.ll vendor/llvm/dist/test/Transforms/InstCombine/assume2.ll vendor/llvm/dist/test/Transforms/InstCombine/not.ll vendor/llvm/dist/test/Transforms/InstSimplify/shufflevector.ll vendor/llvm/dist/test/Transforms/JumpThreading/fold-not-thread.ll vendor/llvm/dist/test/Transforms/ObjCARC/rv.ll vendor/llvm/dist/test/tools/llvm-lto/error.ll vendor/llvm/dist/test/tools/llvm-readobj/reloc-types.test vendor/llvm/dist/test/tools/llvm-readobj/relocations.test vendor/llvm/dist/test/tools/llvm-readobj/sections.test vendor/llvm/dist/tools/llvm-dwarfdump/llvm-dwarfdump.cpp vendor/llvm/dist/tools/llvm-link/CMakeLists.txt vendor/llvm/dist/tools/llvm-link/llvm-link.cpp vendor/llvm/dist/tools/llvm-lto/llvm-lto.cpp vendor/llvm/dist/tools/llvm-pdbdump/CMakeLists.txt vendor/llvm/dist/tools/llvm-pdbdump/CompactTypeDumpVisitor.cpp vendor/llvm/dist/tools/llvm-pdbdump/CompactTypeDumpVisitor.h vendor/llvm/dist/tools/llvm-pdbdump/LLVMOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbdump/PdbYaml.cpp vendor/llvm/dist/tools/llvm-pdbdump/PdbYaml.h vendor/llvm/dist/tools/llvm-pdbdump/StreamUtil.cpp vendor/llvm/dist/tools/llvm-pdbdump/YAMLOutputStyle.cpp vendor/llvm/dist/tools/llvm-pdbdump/YAMLOutputStyle.h vendor/llvm/dist/tools/llvm-pdbdump/fuzzer/llvm-pdbdump-fuzzer.cpp vendor/llvm/dist/tools/llvm-pdbdump/llvm-pdbdump.cpp vendor/llvm/dist/tools/llvm-pdbdump/llvm-pdbdump.h vendor/llvm/dist/tools/llvm-readobj/COFFDumper.cpp vendor/llvm/dist/tools/llvm-readobj/ELFDumper.cpp vendor/llvm/dist/tools/llvm-readobj/ObjDumper.h vendor/llvm/dist/tools/llvm-readobj/WasmDumper.cpp vendor/llvm/dist/tools/llvm-readobj/llvm-readobj.cpp vendor/llvm/dist/tools/opt/BreakpointPrinter.cpp vendor/llvm/dist/unittests/ADT/APIntTest.cpp vendor/llvm/dist/unittests/DebugInfo/DWARF/DWARFDebugInfoTest.cpp vendor/llvm/dist/unittests/IR/IRBuilderTest.cpp vendor/llvm/dist/unittests/IR/MetadataTest.cpp vendor/llvm/dist/unittests/IR/ValueHandleTest.cpp vendor/llvm/dist/unittests/Support/BinaryStreamTest.cpp vendor/llvm/dist/unittests/Support/CMakeLists.txt vendor/llvm/dist/unittests/Target/AArch64/InstSizes.cpp vendor/llvm/dist/utils/TableGen/CodeGenDAGPatterns.cpp vendor/llvm/dist/utils/TableGen/CodeGenIntrinsics.h vendor/llvm/dist/utils/TableGen/CodeGenTarget.cpp vendor/llvm/dist/utils/TableGen/GlobalISelEmitter.cpp vendor/llvm/dist/utils/TableGen/IntrinsicEmitter.cpp vendor/llvm/dist/utils/TableGen/SubtargetFeatureInfo.cpp vendor/llvm/dist/utils/TableGen/SubtargetFeatureInfo.h vendor/llvm/dist/utils/TableGen/X86RecognizableInstr.cpp Modified: vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/cmake/modules/HandleLLVMOptions.cmake Tue May 2 18:30:13 2017 (r317683) @@ -17,6 +17,9 @@ else() set(LINKER_IS_LLD_LINK FALSE) endif() +set(LLVM_ENABLE_LTO OFF CACHE STRING "Build LLVM with LTO. May be specified as Thin or Full to use a particular kind of LTO") +string(TOUPPER "${LLVM_ENABLE_LTO}" uppercase_LLVM_ENABLE_LTO) + # Ninja Job Pool support # The following only works with the Ninja generator in CMake >= 3.0. set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING @@ -32,16 +35,19 @@ endif() set(LLVM_PARALLEL_LINK_JOBS "" CACHE STRING "Define the maximum number of concurrent link jobs.") -if(LLVM_PARALLEL_LINK_JOBS) - if(NOT CMAKE_MAKE_PROGRAM MATCHES "ninja") - message(WARNING "Job pooling is only available with Ninja generators.") - else() +if(CMAKE_MAKE_PROGRAM MATCHES "ninja") + if(NOT LLVM_PARALLEL_LINK_JOBS AND uppercase_LLVM_ENABLE_LTO STREQUAL "THIN") + message(STATUS "ThinLTO provides its own parallel linking - limiting parallel link jobs to 2.") + set(LLVM_PARALLEL_LINK_JOBS "2") + endif() + if(LLVM_PARALLEL_LINK_JOBS) set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${LLVM_PARALLEL_LINK_JOBS}) set(CMAKE_JOB_POOL_LINK link_job_pool) endif() +elseif(LLVM_PARALLEL_LINK_JOBS) + message(WARNING "Job pooling is only available with Ninja generators.") endif() - if (LINKER_IS_LLD_LINK) # Pass /MANIFEST:NO so that CMake doesn't run mt.exe on our binaries. Adding # manifests with mt.exe breaks LLD's symbol tables and takes as much time as @@ -724,8 +730,6 @@ append_if(LLVM_BUILD_INSTRUMENTED_COVERA CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS) -set(LLVM_ENABLE_LTO OFF CACHE STRING "Build LLVM with LTO. May be specified as Thin or Full to use a particular kind of LTO") -string(TOUPPER "${LLVM_ENABLE_LTO}" uppercase_LLVM_ENABLE_LTO) if(LLVM_ENABLE_LTO AND LLVM_ON_WIN32 AND NOT LINKER_IS_LLD_LINK) message(FATAL_ERROR "When compiling for Windows, LLVM_ENABLE_LTO requires using lld as the linker (point CMAKE_LINKER at lld-link.exe)") endif() Modified: vendor/llvm/dist/cmake/modules/VersionFromVCS.cmake ============================================================================== --- vendor/llvm/dist/cmake/modules/VersionFromVCS.cmake Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/cmake/modules/VersionFromVCS.cmake Tue May 2 18:30:13 2017 (r317683) @@ -33,7 +33,8 @@ function(add_version_info_from_vcs VERS) execute_process(COMMAND ${git_executable} rev-parse --git-dir WORKING_DIRECTORY ${SOURCE_DIR}/cmake RESULT_VARIABLE git_result - OUTPUT_VARIABLE git_dir) + OUTPUT_VARIABLE git_dir + ERROR_QUIET) if(git_result EQUAL 0) # Try to get a ref-id string(STRIP "${git_dir}" git_dir) @@ -45,7 +46,8 @@ function(add_version_info_from_vcs VERS) WORKING_DIRECTORY ${SOURCE_DIR} TIMEOUT 5 RESULT_VARIABLE git_result - OUTPUT_VARIABLE git_output) + OUTPUT_VARIABLE git_output + ERROR_QUIET) if( git_result EQUAL 0 ) string(REGEX MATCH "URL: ([^ \n]*)" svn_url ${git_output}) if(svn_url) Modified: vendor/llvm/dist/docs/AMDGPUUsage.rst ============================================================================== --- vendor/llvm/dist/docs/AMDGPUUsage.rst Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/docs/AMDGPUUsage.rst Tue May 2 18:30:13 2017 (r317683) @@ -83,7 +83,7 @@ handler as follows: Usage Code Sequence Description =============== ============= =============================================== llvm.trap s_endpgm Causes wavefront to be terminated. - llvm.debugtrap Nothing. Compiler warning generated that there is no trap handler installed. + llvm.debugtrap Nothing Compiler warning generated that there is no trap handler installed. =============== ============= =============================================== Assembler Modified: vendor/llvm/dist/docs/CMakeLists.txt ============================================================================== --- vendor/llvm/dist/docs/CMakeLists.txt Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/docs/CMakeLists.txt Tue May 2 18:30:13 2017 (r317683) @@ -1,8 +1,8 @@ if (DOXYGEN_FOUND) if (LLVM_ENABLE_DOXYGEN) - set(abs_top_srcdir ${LLVM_MAIN_SRC_DIR}) - set(abs_top_builddir ${LLVM_BINARY_DIR}) + set(abs_top_srcdir ${CMAKE_CURRENT_SOURCE_DIR}) + set(abs_top_builddir ${CMAKE_CURRENT_BINARY_DIR}) if (HAVE_DOT) set(DOT ${LLVM_PATH_DOT}) Modified: vendor/llvm/dist/docs/LangRef.rst ============================================================================== --- vendor/llvm/dist/docs/LangRef.rst Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/docs/LangRef.rst Tue May 2 18:30:13 2017 (r317683) @@ -1535,6 +1535,17 @@ example: ``sanitize_thread`` This attribute indicates that ThreadSanitizer checks (dynamic thread safety analysis) are enabled for this function. +``speculatable`` + This function attribute indicates that the function does not have any + effects besides calculating its result and does not have undefined behavior. + Note that ``speculatable`` is not enough to conclude that along any + particular exection path the number of calls to this function will not be + externally observable. This attribute is only valid on functions + and declarations, not on individual call sites. If a function is + incorrectly marked as speculatable and really does exhibit + undefined behavior, the undefined behavior may be observed even + if the call site is dead code. + ``ssp`` This attribute indicates that the function should emit a stack smashing protector. It is in the form of a "canary" --- a random value Modified: vendor/llvm/dist/docs/ProgrammersManual.rst ============================================================================== --- vendor/llvm/dist/docs/ProgrammersManual.rst Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/docs/ProgrammersManual.rst Tue May 2 18:30:13 2017 (r317683) @@ -776,22 +776,21 @@ readability. Using cantFail to simplify safe callsites """"""""""""""""""""""""""""""""""""""""" -Some functions may only fail for a subset of their inputs. For such functions -call-sites using known-safe inputs can assume that the result will be a success -value. +Some functions may only fail for a subset of their inputs, so calls using known +safe inputs can be assumed to succeed. The cantFail functions encapsulate this by wrapping an assertion that their argument is a success value and, in the case of Expected, unwrapping the -T value from the Expected argument: +T value: .. code-block:: c++ - Error mayFail(int X); - Expected mayFail2(int X); + Error onlyFailsForSomeXValues(int X); + Expected onlyFailsForSomeXValues2(int X); void foo() { - cantFail(mayFail(KnownSafeValue)); - int Y = cantFail(mayFail2(KnownSafeValue)); + cantFail(onlyFailsForSomeXValues(KnownSafeValue)); + int Y = cantFail(onlyFailsForSomeXValues2(KnownSafeValue)); ... } @@ -801,8 +800,8 @@ terminate the program on an error input, is success. In debug builds this will result in an assertion failure if an error is encountered. In release builds the behavior of cantFail for failure values is undefined. As such, care must be taken in the use of cantFail: clients must be -certain that a cantFail wrapped call really can not fail under any -circumstances. +certain that a cantFail wrapped call really can not fail with the given +arguments. Use of the cantFail functions should be rare in library code, but they are likely to be of more use in tool and unit-test code where inputs and/or Modified: vendor/llvm/dist/docs/README.txt ============================================================================== --- vendor/llvm/dist/docs/README.txt Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/docs/README.txt Tue May 2 18:30:13 2017 (r317683) @@ -51,3 +51,18 @@ running: cd docs/ make -f Makefile.sphinx linkcheck + +Doxygen page Output +============== + +Install doxygen and dot2tex . + + cd + cmake -DLLVM_ENABLE_DOXYGEN=On + make doxygen-llvm # for LLVM docs + make doxygen-clang # for clang docs + +It will generate html in + + /docs/doxygen/html # for LLVM docs + /tools/clang/docs/doxygen/html # for clang docs Modified: vendor/llvm/dist/docs/StackMaps.rst ============================================================================== --- vendor/llvm/dist/docs/StackMaps.rst Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/docs/StackMaps.rst Tue May 2 18:30:13 2017 (r317683) @@ -319,7 +319,7 @@ format of this section follows: .. code-block:: none Header { - uint8 : Stack Map Version (current version is 2) + uint8 : Stack Map Version (current version is 3) uint8 : Reserved (expected to be 0) uint16 : Reserved (expected to be 0) } @@ -341,10 +341,13 @@ format of this section follows: uint16 : NumLocations Location[NumLocations] { uint8 : Register | Direct | Indirect | Constant | ConstantIndex - uint8 : Reserved (location flags) + uint8 : Reserved (expected to be 0) + uint16 : Location Size uint16 : Dwarf RegNum + uint16 : Reserved (expected to be 0) int32 : Offset or SmallConstant } + uint32 : Padding (only if required to align to 8 byte) uint16 : Padding uint16 : NumLiveOuts LiveOuts[NumLiveOuts] Modified: vendor/llvm/dist/docs/TableGen/LangIntro.rst ============================================================================== --- vendor/llvm/dist/docs/TableGen/LangIntro.rst Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/docs/TableGen/LangIntro.rst Tue May 2 18:30:13 2017 (r317683) @@ -58,6 +58,10 @@ types are: The 'string' type represents an ordered sequence of characters of arbitrary length. +``code`` + The `code` type represents a code fragment, which can be single/multi-line + string literal. + ``bits`` A 'bits' type is an arbitrary, but fixed, size integer that is broken up into individual bits. This type is useful because it can handle some bits @@ -105,7 +109,7 @@ supported include: hexadecimal integer value ``"foo"`` - string value + a single-line string value, can be assigned to ``string`` or ``code`` variable. ``[{ ... }]`` usually called a "code fragment", but is just a multiline string literal @@ -126,7 +130,8 @@ supported include: access to one bit of a value ``value{15-17}`` - access to multiple bits of a value + access to an ordered sequence of bits of a value, in particular ``value{15-17}`` + produces an order that is the reverse of ``value{17-15}``. ``DEF`` reference to a record definition Modified: vendor/llvm/dist/docs/doxygen.cfg.in ============================================================================== --- vendor/llvm/dist/docs/doxygen.cfg.in Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/docs/doxygen.cfg.in Tue May 2 18:30:13 2017 (r317683) @@ -58,7 +58,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = @abs_top_builddir@/docs/doxygen +OUTPUT_DIRECTORY = @abs_top_builddir@/doxygen # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -132,7 +132,7 @@ INLINE_INHERITED_MEMB = NO # shortest path that makes the file name unique will be used # The default value is: YES. -FULL_PATH_NAMES = NO +FULL_PATH_NAMES = YES # The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. # Stripping is only done if one of the specified strings matches the left-hand @@ -144,7 +144,7 @@ FULL_PATH_NAMES = NO # will be relative from the directory where doxygen is started. # This tag requires that the tag FULL_PATH_NAMES is set to YES. -STRIP_FROM_PATH = ../.. +STRIP_FROM_PATH = @abs_top_srcdir@/.. # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the # path mentioned in the documentation of a class, which tells the reader which @@ -153,7 +153,8 @@ STRIP_FROM_PATH = ../.. # specify the list of include paths that are normally passed to the compiler # using the -I flag. -STRIP_FROM_INC_PATH = +STRIP_FROM_INC_PATH = @abs_top_srcdir@/../include +STRIP_FROM_INC_PATH += @abs_top_srcdir@/../lib # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but # less readable) file names. This can be useful is your file systems doesn't @@ -513,7 +514,7 @@ SHOW_GROUPED_MEMB_INC = NO # files with double quotes in the documentation rather than with sharp brackets. # The default value is: NO. -FORCE_LOCAL_INCLUDES = NO +FORCE_LOCAL_INCLUDES = YES # If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the # documentation for inline members. @@ -743,9 +744,9 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = @abs_top_srcdir@/include \ - @abs_top_srcdir@/lib \ - @abs_top_srcdir@/docs/doxygen-mainpage.dox +INPUT = @abs_top_srcdir@/../include \ + @abs_top_srcdir@/../lib \ + @abs_top_srcdir@/doxygen-mainpage.dox # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -813,7 +814,7 @@ EXCLUDE_SYMBOLS = # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = @abs_top_srcdir@/examples +EXAMPLE_PATH = @abs_top_srcdir@/../examples # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -833,7 +834,7 @@ EXAMPLE_RECURSIVE = YES # that contain images that are to be included in the documentation (see the # \image command). -IMAGE_PATH = @abs_top_srcdir@/docs/img +IMAGE_PATH = @abs_top_srcdir@/img # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program Modified: vendor/llvm/dist/include/llvm/ADT/APInt.h ============================================================================== --- vendor/llvm/dist/include/llvm/ADT/APInt.h Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/include/llvm/ADT/APInt.h Tue May 2 18:30:13 2017 (r317683) @@ -366,7 +366,7 @@ public: /// that 0 is not a positive value. /// /// \returns true if this APInt is positive. - bool isStrictlyPositive() const { return isNonNegative() && !!*this; } + bool isStrictlyPositive() const { return isNonNegative() && !isNullValue(); } /// \brief Determine if all bits are set /// @@ -377,6 +377,12 @@ public: return countPopulationSlowCase() == BitWidth; } + /// \brief Determine if all bits are clear + /// + /// This checks to see if the value has all bits of the APInt are clear or + /// not. + bool isNullValue() const { return !*this; } + /// \brief Determine if this is the largest unsigned value. /// /// This checks to see if the value of this APInt is the maximum unsigned @@ -395,7 +401,7 @@ public: /// /// This checks to see if the value of this APInt is the minimum unsigned /// value for the APInt's bit width. - bool isMinValue() const { return !*this; } + bool isMinValue() const { return isNullValue(); } /// \brief Determine if this is the smallest signed value. /// @@ -611,15 +617,7 @@ public: } /// \brief Return a value containing V broadcasted over NewLen bits. - static APInt getSplat(unsigned NewLen, const APInt &V) { - assert(NewLen >= V.getBitWidth() && "Can't splat to smaller bit width!"); - - APInt Val = V.zextOrSelf(NewLen); - for (unsigned I = V.getBitWidth(); I < NewLen; I <<= 1) - Val |= Val << I; - - return Val; - } + static APInt getSplat(unsigned NewLen, const APInt &V); /// \brief Determine if two APInts have the same value, after zero-extending /// one of them (if needed!) to ensure that the bit-widths match. @@ -687,7 +685,9 @@ public: /// /// \returns true if *this is zero, false otherwise. bool operator!() const { - return *this == 0; + if (isSingleWord()) + return VAL == 0; + return countLeadingZerosSlowCase() == BitWidth; } /// @} @@ -874,6 +874,13 @@ public: return *this; } + /// \brief Left-shift assignment function. + /// + /// Shifts *this left by shiftAmt and assigns the result to *this. + /// + /// \returns *this after shifting left by ShiftAmt + APInt &operator<<=(const APInt &ShiftAmt); + /// @} /// \name Binary Operators /// @{ @@ -981,7 +988,11 @@ public: /// \brief Left-shift function. /// /// Left-shift this APInt by shiftAmt. - APInt shl(const APInt &shiftAmt) const; + APInt shl(const APInt &ShiftAmt) const { + APInt R(*this); + R <<= ShiftAmt; + return R; + } /// \brief Rotate left by rotateAmt. APInt rotl(const APInt &rotateAmt) const; @@ -1333,7 +1344,14 @@ public: /// \brief Set a given bit to 1. /// /// Set the given bit to 1 whose position is given as "bitPosition". - void setBit(unsigned bitPosition); + void setBit(unsigned BitPosition) { + assert(BitPosition <= BitWidth && "BitPosition out of range"); + WordType Mask = maskBit(BitPosition); + if (isSingleWord()) + VAL |= Mask; + else + pVal[whichWord(BitPosition)] |= Mask; + } /// Set the sign bit to 1. void setSignBit() { @@ -1344,13 +1362,9 @@ public: void setBits(unsigned loBit, unsigned hiBit) { assert(hiBit <= BitWidth && "hiBit out of range"); assert(loBit <= BitWidth && "loBit out of range"); + assert(loBit <= hiBit && "loBit greater than hiBit"); if (loBit == hiBit) return; - if (loBit > hiBit) { - setLowBits(hiBit); - setHighBits(BitWidth - loBit); - return; - } if (loBit < APINT_BITS_PER_WORD && hiBit <= APINT_BITS_PER_WORD) { uint64_t mask = WORD_MAX >> (APINT_BITS_PER_WORD - (hiBit - loBit)); mask <<= loBit; @@ -1389,7 +1403,19 @@ public: /// \brief Set a given bit to 0. /// /// Set the given bit to 0 whose position is given as "bitPosition". - void clearBit(unsigned bitPosition); + void clearBit(unsigned BitPosition) { + assert(BitPosition <= BitWidth && "BitPosition out of range"); + WordType Mask = ~maskBit(BitPosition); + if (isSingleWord()) + VAL &= Mask; + else + pVal[whichWord(BitPosition)] &= Mask; + } + + /// Set the sign bit to 0. + void clearSignBit() { + clearBit(BitWidth - 1); + } /// \brief Toggle every bit to its opposite value. void flipAllBits() { @@ -1695,7 +1721,7 @@ public: return VAL - 1; // Handle the zero case. - if (!getBoolValue()) + if (isNullValue()) return UINT32_MAX; // The non-zero case is handled by computing: Modified: vendor/llvm/dist/include/llvm/Analysis/AssumptionCache.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/AssumptionCache.h Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/include/llvm/Analysis/AssumptionCache.h Tue May 2 18:30:13 2017 (r317683) @@ -43,7 +43,7 @@ class AssumptionCache { /// \brief Vector of weak value handles to calls of the @llvm.assume /// intrinsic. - SmallVector AssumeHandles; + SmallVector AssumeHandles; class AffectedValueCallbackVH final : public CallbackVH { AssumptionCache *AC; @@ -62,12 +62,12 @@ class AssumptionCache { /// \brief A map of values about which an assumption might be providing /// information to the relevant set of assumptions. using AffectedValuesMap = - DenseMap, - AffectedValueCallbackVH::DMI>; + DenseMap, + AffectedValueCallbackVH::DMI>; AffectedValuesMap AffectedValues; /// Get the vector of assumptions which affect a value from the cache. - SmallVector &getOrInsertAffectedValues(Value *V); + SmallVector &getOrInsertAffectedValues(Value *V); /// Copy affected values in the cache for OV to be affected values for NV. void copyAffectedValuesInCache(Value *OV, Value *NV); @@ -120,20 +120,20 @@ public: /// FIXME: We should replace this with pointee_iterator> /// when we can write that to filter out the null values. Then caller code /// will become simpler. - MutableArrayRef assumptions() { + MutableArrayRef assumptions() { if (!Scanned) scanFunction(); return AssumeHandles; } /// \brief Access the list of assumptions which affect this value. - MutableArrayRef assumptionsFor(const Value *V) { + MutableArrayRef assumptionsFor(const Value *V) { if (!Scanned) scanFunction(); auto AVI = AffectedValues.find_as(const_cast(V)); if (AVI == AffectedValues.end()) - return MutableArrayRef(); + return MutableArrayRef(); return AVI->second; } Modified: vendor/llvm/dist/include/llvm/Analysis/CGSCCPassManager.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/CGSCCPassManager.h Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/include/llvm/Analysis/CGSCCPassManager.h Tue May 2 18:30:13 2017 (r317683) @@ -646,7 +646,7 @@ public: LazyCallGraph::SCC *C = &InitialC; // Collect value handles for all of the indirect call sites. - SmallVector CallHandles; + SmallVector CallHandles; // Struct to track the counts of direct and indirect calls in each function // of the SCC. @@ -658,7 +658,7 @@ public: // Put value handles on all of the indirect calls and return the number of // direct calls for each function in the SCC. auto ScanSCC = [](LazyCallGraph::SCC &C, - SmallVectorImpl &CallHandles) { + SmallVectorImpl &CallHandles) { assert(CallHandles.empty() && "Must start with a clear set of handles."); SmallVector CallCounts; @@ -671,7 +671,7 @@ public: ++Count.Direct; } else { ++Count.Indirect; - CallHandles.push_back(WeakVH(&I)); + CallHandles.push_back(WeakTrackingVH(&I)); } } } @@ -699,7 +699,7 @@ public: "Cannot have changed the size of the SCC!"); // Check whether any of the handles were devirtualized. - auto IsDevirtualizedHandle = [&](WeakVH &CallH) { + auto IsDevirtualizedHandle = [&](WeakTrackingVH &CallH) { if (!CallH) return false; auto CS = CallSite(CallH); Modified: vendor/llvm/dist/include/llvm/Analysis/CallGraph.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/CallGraph.h Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/include/llvm/Analysis/CallGraph.h Tue May 2 18:30:13 2017 (r317683) @@ -172,7 +172,7 @@ class CallGraphNode { public: /// \brief A pair of the calling instruction (a call or invoke) /// and the call graph node being called. - typedef std::pair CallRecord; + typedef std::pair CallRecord; public: typedef std::vector CalledFunctionsVector; Modified: vendor/llvm/dist/include/llvm/Analysis/IVUsers.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/IVUsers.h Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/include/llvm/Analysis/IVUsers.h Tue May 2 18:30:13 2017 (r317683) @@ -80,7 +80,7 @@ private: /// OperandValToReplace - The Value of the operand in the user instruction /// that this IVStrideUse is representing. - WeakVH OperandValToReplace; + WeakTrackingVH OperandValToReplace; /// PostIncLoops - The set of loops for which Expr has been adjusted to /// use post-inc mode. This corresponds with SCEVExpander's post-inc concept. Modified: vendor/llvm/dist/include/llvm/Analysis/InlineCost.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/InlineCost.h Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/include/llvm/Analysis/InlineCost.h Tue May 2 18:30:13 2017 (r317683) @@ -160,6 +160,10 @@ InlineParams getInlineParams(int Thresho /// the -Oz flag. InlineParams getInlineParams(unsigned OptLevel, unsigned SizeOptLevel); +/// Return the cost associated with a callsite, including paramater passing +/// and the call/return instruction. +int getCallsiteCost(CallSite CS, const DataLayout &DL); + /// \brief Get an InlineCost object representing the cost of inlining this /// callsite. /// Modified: vendor/llvm/dist/include/llvm/Analysis/InstructionSimplify.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/InstructionSimplify.h Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/include/llvm/Analysis/InstructionSimplify.h Tue May 2 18:30:13 2017 (r317683) @@ -35,35 +35,41 @@ #include "llvm/IR/User.h" namespace llvm { - template - class ArrayRef; - class AssumptionCache; - class DominatorTree; - class Instruction; - class DataLayout; - class FastMathFlags; - class OptimizationRemarkEmitter; - class TargetLibraryInfo; - class Type; - class Value; - - struct SimplifyQuery { - const DataLayout &DL; - const TargetLibraryInfo *TLI = nullptr; - const DominatorTree *DT = nullptr; - AssumptionCache *AC = nullptr; - const Instruction *CxtI = nullptr; - SimplifyQuery(const DataLayout &DL) : DL(DL) {} - - SimplifyQuery(const DataLayout &DL, const TargetLibraryInfo *TLI, - const DominatorTree *DT, AssumptionCache *AC = nullptr, - const Instruction *CXTI = nullptr) - : DL(DL), TLI(TLI), DT(DT), AC(AC), CxtI(CXTI) {} - SimplifyQuery getWithInstruction(Instruction *I) const { - SimplifyQuery Copy(*this); - Copy.CxtI = I; - return Copy; - } +class Function; +template class AnalysisManager; +template class ArrayRef; +class AssumptionCache; +class DominatorTree; +class Instruction; +class DataLayout; +class FastMathFlags; +struct LoopStandardAnalysisResults; +class OptimizationRemarkEmitter; +class Pass; +class TargetLibraryInfo; +class Type; +class Value; + +struct SimplifyQuery { + const DataLayout &DL; + const TargetLibraryInfo *TLI = nullptr; + const DominatorTree *DT = nullptr; + AssumptionCache *AC = nullptr; + const Instruction *CxtI = nullptr; + + SimplifyQuery(const DataLayout &DL, const Instruction *CXTI = nullptr) + : DL(DL), CxtI(CXTI) {} + + SimplifyQuery(const DataLayout &DL, const TargetLibraryInfo *TLI, + const DominatorTree *DT = nullptr, + AssumptionCache *AC = nullptr, + const Instruction *CXTI = nullptr) + : DL(DL), TLI(TLI), DT(DT), AC(AC), CxtI(CXTI) {} + SimplifyQuery getWithInstruction(Instruction *I) const { + SimplifyQuery Copy(*this); + Copy.CxtI = I; + return Copy; + } }; // NOTE: the explicit multiple argument versions of these functions are @@ -73,257 +79,103 @@ namespace llvm { /// Given operands for an Add, fold the result or return null. Value *SimplifyAddInst(Value *LHS, Value *RHS, bool isNSW, bool isNUW, const SimplifyQuery &Q); - Value *SimplifyAddInst(Value *LHS, Value *RHS, bool isNSW, bool isNUW, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for a Sub, fold the result or return null. Value *SimplifySubInst(Value *LHS, Value *RHS, bool isNSW, bool isNUW, const SimplifyQuery &Q); - Value *SimplifySubInst(Value *LHS, Value *RHS, bool isNSW, bool isNUW, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an FAdd, fold the result or return null. Value *SimplifyFAddInst(Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q); - Value *SimplifyFAddInst(Value *LHS, Value *RHS, FastMathFlags FMF, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an FSub, fold the result or return null. Value *SimplifyFSubInst(Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q); - Value *SimplifyFSubInst(Value *LHS, Value *RHS, FastMathFlags FMF, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an FMul, fold the result or return null. Value *SimplifyFMulInst(Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q); - Value *SimplifyFMulInst(Value *LHS, Value *RHS, FastMathFlags FMF, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for a Mul, fold the result or return null. Value *SimplifyMulInst(Value *LHS, Value *RHS, const SimplifyQuery &Q); - Value *SimplifyMulInst(Value *LHS, Value *RHS, const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an SDiv, fold the result or return null. Value *SimplifySDivInst(Value *LHS, Value *RHS, const SimplifyQuery &Q); - Value *SimplifySDivInst(Value *LHS, Value *RHS, const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for a UDiv, fold the result or return null. Value *SimplifyUDivInst(Value *LHS, Value *RHS, const SimplifyQuery &Q); - Value *SimplifyUDivInst(Value *LHS, Value *RHS, const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an FDiv, fold the result or return null. Value *SimplifyFDivInst(Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q); - Value *SimplifyFDivInst(Value *LHS, Value *RHS, FastMathFlags FMF, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an SRem, fold the result or return null. Value *SimplifySRemInst(Value *LHS, Value *RHS, const SimplifyQuery &Q); - Value *SimplifySRemInst(Value *LHS, Value *RHS, const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for a URem, fold the result or return null. Value *SimplifyURemInst(Value *LHS, Value *RHS, const SimplifyQuery &Q); - Value *SimplifyURemInst(Value *LHS, Value *RHS, const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an FRem, fold the result or return null. Value *SimplifyFRemInst(Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q); - Value *SimplifyFRemInst(Value *LHS, Value *RHS, FastMathFlags FMF, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for a Shl, fold the result or return null. Value *SimplifyShlInst(Value *Op0, Value *Op1, bool isNSW, bool isNUW, const SimplifyQuery &Q); - Value *SimplifyShlInst(Value *Op0, Value *Op1, bool isNSW, bool isNUW, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for a LShr, fold the result or return null. Value *SimplifyLShrInst(Value *Op0, Value *Op1, bool isExact, const SimplifyQuery &Q); - Value *SimplifyLShrInst(Value *Op0, Value *Op1, bool isExact, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for a AShr, fold the result or return nulll. Value *SimplifyAShrInst(Value *Op0, Value *Op1, bool isExact, const SimplifyQuery &Q); - Value *SimplifyAShrInst(Value *Op0, Value *Op1, bool isExact, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an And, fold the result or return null. Value *SimplifyAndInst(Value *LHS, Value *RHS, const SimplifyQuery &Q); - Value *SimplifyAndInst(Value *LHS, Value *RHS, const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an Or, fold the result or return null. Value *SimplifyOrInst(Value *LHS, Value *RHS, const SimplifyQuery &Q); - Value *SimplifyOrInst(Value *LHS, Value *RHS, const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an Xor, fold the result or return null. Value *SimplifyXorInst(Value *LHS, Value *RHS, const SimplifyQuery &Q); - Value *SimplifyXorInst(Value *LHS, Value *RHS, const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an ICmpInst, fold the result or return null. Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS, const SimplifyQuery &Q); - Value *SimplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an FCmpInst, fold the result or return null. Value *SimplifyFCmpInst(unsigned Predicate, Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q); - Value *SimplifyFCmpInst(unsigned Predicate, Value *LHS, Value *RHS, - FastMathFlags FMF, const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for a SelectInst, fold the result or return null. Value *SimplifySelectInst(Value *Cond, Value *TrueVal, Value *FalseVal, const SimplifyQuery &Q); - Value *SimplifySelectInst(Value *Cond, Value *TrueVal, Value *FalseVal, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for a GetElementPtrInst, fold the result or return null. Value *SimplifyGEPInst(Type *SrcTy, ArrayRef Ops, const SimplifyQuery &Q); - Value *SimplifyGEPInst(Type *SrcTy, ArrayRef Ops, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an InsertValueInst, fold the result or return null. Value *SimplifyInsertValueInst(Value *Agg, Value *Val, ArrayRef Idxs, const SimplifyQuery &Q); - Value *SimplifyInsertValueInst(Value *Agg, Value *Val, - ArrayRef Idxs, const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an ExtractValueInst, fold the result or return null. Value *SimplifyExtractValueInst(Value *Agg, ArrayRef Idxs, const SimplifyQuery &Q); - Value *SimplifyExtractValueInst(Value *Agg, ArrayRef Idxs, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an ExtractElementInst, fold the result or return null. Value *SimplifyExtractElementInst(Value *Vec, Value *Idx, const SimplifyQuery &Q); - Value *SimplifyExtractElementInst(Value *Vec, Value *Idx, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for a CastInst, fold the result or return null. Value *SimplifyCastInst(unsigned CastOpc, Value *Op, Type *Ty, const SimplifyQuery &Q); - Value *SimplifyCastInst(unsigned CastOpc, Value *Op, Type *Ty, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for a ShuffleVectorInst, fold the result or return null. Value *SimplifyShuffleVectorInst(Value *Op0, Value *Op1, Constant *Mask, Type *RetTy, const SimplifyQuery &Q); - Value *SimplifyShuffleVectorInst(Value *Op0, Value *Op1, Constant *Mask, - Type *RetTy, const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); //=== Helper functions for higher up the class hierarchy. @@ -331,63 +183,29 @@ namespace llvm { /// Given operands for a CmpInst, fold the result or return null. Value *SimplifyCmpInst(unsigned Predicate, Value *LHS, Value *RHS, const SimplifyQuery &Q); - Value *SimplifyCmpInst(unsigned Predicate, Value *LHS, Value *RHS, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for a BinaryOperator, fold the result or return null. Value *SimplifyBinOp(unsigned Opcode, Value *LHS, Value *RHS, const SimplifyQuery &Q); - Value *SimplifyBinOp(unsigned Opcode, Value *LHS, Value *RHS, - const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given operands for an FP BinaryOperator, fold the result or return null. /// In contrast to SimplifyBinOp, try to use FastMathFlag when folding the /// result. In case we don't need FastMathFlags, simply fall to SimplifyBinOp. Value *SimplifyFPBinOp(unsigned Opcode, Value *LHS, Value *RHS, FastMathFlags FMF, const SimplifyQuery &Q); - Value *SimplifyFPBinOp(unsigned Opcode, Value *LHS, Value *RHS, - FastMathFlags FMF, const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given a function and iterators over arguments, fold the result or return /// null. Value *SimplifyCall(Value *V, User::op_iterator ArgBegin, User::op_iterator ArgEnd, const SimplifyQuery &Q); - Value *SimplifyCall(Value *V, User::op_iterator ArgBegin, - User::op_iterator ArgEnd, const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// Given a function and set of arguments, fold the result or return null. Value *SimplifyCall(Value *V, ArrayRef Args, const SimplifyQuery &Q); - Value *SimplifyCall(Value *V, ArrayRef Args, const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - const Instruction *CxtI = nullptr); /// See if we can compute a simplified version of this instruction. If not, /// return null. Value *SimplifyInstruction(Instruction *I, const SimplifyQuery &Q, OptimizationRemarkEmitter *ORE = nullptr); - Value *SimplifyInstruction(Instruction *I, const DataLayout &DL, - const TargetLibraryInfo *TLI = nullptr, - const DominatorTree *DT = nullptr, - AssumptionCache *AC = nullptr, - OptimizationRemarkEmitter *ORE = nullptr); /// Replace all uses of 'I' with 'SimpleV' and simplify the uses recursively. /// @@ -411,6 +229,15 @@ namespace llvm { const TargetLibraryInfo *TLI = nullptr, const DominatorTree *DT = nullptr, AssumptionCache *AC = nullptr); + // These helper functions return a SimplifyQuery structure that contains as + // many of the optional analysis we use as are currently valid. This is the + // strongly preferred way of constructing SimplifyQuery in passes. + const SimplifyQuery getBestSimplifyQuery(Pass &, Function &); + template + const SimplifyQuery getBestSimplifyQuery(AnalysisManager &, + Function &); + const SimplifyQuery getBestSimplifyQuery(LoopStandardAnalysisResults &, + const DataLayout &); } // end namespace llvm #endif Modified: vendor/llvm/dist/include/llvm/Analysis/MemoryBuiltins.h ============================================================================== --- vendor/llvm/dist/include/llvm/Analysis/MemoryBuiltins.h Tue May 2 17:16:24 2017 (r317682) +++ vendor/llvm/dist/include/llvm/Analysis/MemoryBuiltins.h Tue May 2 18:30:13 2017 (r317683) @@ -235,7 +235,7 @@ class ObjectSizeOffsetEvaluator *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 2 18:30:22 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D298D5BC90; Tue, 2 May 2017 18:30:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03CD74E; Tue, 2 May 2017 18:30:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v42IUKnO098592; Tue, 2 May 2017 18:30:20 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v42IUKM0098591; Tue, 2 May 2017 18:30:20 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705021830.v42IUKM0098591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 2 May 2017 18:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317684 - vendor/llvm/llvm-trunk-r301939 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 18:30:22 -0000 Author: dim Date: Tue May 2 18:30:20 2017 New Revision: 317684 URL: https://svnweb.freebsd.org/changeset/base/317684 Log: Tag llvm trunk r301939. Added: vendor/llvm/llvm-trunk-r301939/ - copied from r317683, vendor/llvm/dist/ From owner-svn-src-all@freebsd.org Tue May 2 18:30:49 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4DFD6D5BD23; Tue, 2 May 2017 18:30:49 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 05C7E26C; Tue, 2 May 2017 18:30:48 +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 v42IUme5000866; Tue, 2 May 2017 18:30:48 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v42IUkVx000848; Tue, 2 May 2017 18:30:46 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705021830.v42IUkVx000848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 2 May 2017 18:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317685 - in vendor/clang/dist: docs include/clang-c include/clang/AST include/clang/Basic include/clang/CodeGen include/clang/Driver include/clang/Edit include/clang/Frontend include/c... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 18:30:49 -0000 Author: dim Date: Tue May 2 18:30:45 2017 New Revision: 317685 URL: https://svnweb.freebsd.org/changeset/base/317685 Log: Vendor import of clang trunk r301939: https://llvm.org/svn/llvm-project/cfe/trunk@301939 Added: vendor/clang/dist/include/clang/AST/ASTStructuralEquivalence.h (contents, props changed) vendor/clang/dist/lib/AST/ASTStructuralEquivalence.cpp (contents, props changed) vendor/clang/dist/test/ARCMT/remap-applying.c (contents, props changed) vendor/clang/dist/test/ARCMT/remap-applying.c.result vendor/clang/dist/test/CodeGenCXX/attr-x86-no_caller_saved_registers.cpp (contents, props changed) vendor/clang/dist/test/CodeGenCXX/ubsan-nullability-assign.cpp (contents, props changed) vendor/clang/dist/test/CodeGenObjCXX/boxing.mm vendor/clang/dist/test/Frontend/Inputs/empty.h (contents, props changed) vendor/clang/dist/test/Headers/stdint-typeof-MINMAX.cpp (contents, props changed) vendor/clang/dist/test/Import/in-class-initializer/ vendor/clang/dist/test/Import/in-class-initializer/Inputs/ vendor/clang/dist/test/Import/in-class-initializer/Inputs/S.cpp (contents, props changed) vendor/clang/dist/test/Import/in-class-initializer/test.cpp (contents, props changed) vendor/clang/dist/test/Index/allow-editor-placeholders.cpp (contents, props changed) vendor/clang/dist/test/Index/target-info.c (contents, props changed) vendor/clang/dist/test/Modules/Inputs/diag_flags.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/incomplete-umbrella/ vendor/clang/dist/test/Modules/Inputs/incomplete-umbrella/Foo.framework/ vendor/clang/dist/test/Modules/Inputs/incomplete-umbrella/Foo.framework/Headers/ vendor/clang/dist/test/Modules/Inputs/incomplete-umbrella/Foo.framework/Headers/Bar.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/incomplete-umbrella/Foo.framework/Headers/FooPublic.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/incomplete-umbrella/Foo.framework/Modules/ vendor/clang/dist/test/Modules/Inputs/incomplete-umbrella/Foo.framework/Modules/module.modulemap vendor/clang/dist/test/Modules/Inputs/incomplete-umbrella/Foo.framework/Modules/module.private.modulemap vendor/clang/dist/test/Modules/Inputs/incomplete-umbrella/Foo.framework/PrivateHeaders/ vendor/clang/dist/test/Modules/Inputs/incomplete-umbrella/Foo.framework/PrivateHeaders/Baz.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/incomplete-umbrella/Foo.framework/PrivateHeaders/Foo.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/malformed-overload/ vendor/clang/dist/test/Modules/Inputs/malformed-overload/X.h (contents, props changed) vendor/clang/dist/test/Modules/Inputs/malformed-overload/module.modulemap vendor/clang/dist/test/Modules/diag-flags.cpp (contents, props changed) vendor/clang/dist/test/Modules/import-syntax.c (contents, props changed) vendor/clang/dist/test/Modules/incomplete-umbrella.m vendor/clang/dist/test/Modules/malformed-overload.m vendor/clang/dist/test/Modules/preprocess-module.cpp (contents, props changed) vendor/clang/dist/test/Preprocessor/Inputs/nonportable-hmaps/ vendor/clang/dist/test/Preprocessor/Inputs/nonportable-hmaps/foo.hmap (contents, props changed) vendor/clang/dist/test/Preprocessor/Inputs/nonportable-hmaps/headers/ vendor/clang/dist/test/Preprocessor/Inputs/nonportable-hmaps/headers/foo/ vendor/clang/dist/test/Preprocessor/Inputs/nonportable-hmaps/headers/foo/Foo.h (contents, props changed) vendor/clang/dist/test/Preprocessor/nonportable-include-with-hmap.c (contents, props changed) vendor/clang/dist/test/Preprocessor/pragma_module.c (contents, props changed) vendor/clang/dist/test/SemaCXX/attr-non-x86-no_caller_saved_registers.cpp (contents, props changed) vendor/clang/dist/test/SemaCXX/attr-x86-no_caller_saved_registers.cpp (contents, props changed) vendor/clang/dist/test/SemaCXX/constexpr-array-unknown-bound.cpp (contents, props changed) vendor/clang/dist/test/SemaObjC/x86-method-vector-values.m Deleted: vendor/clang/dist/test/Frontend/Rewriter/ Modified: vendor/clang/dist/docs/SanitizerCoverage.rst vendor/clang/dist/include/clang-c/Index.h vendor/clang/dist/include/clang/AST/DeclBase.h vendor/clang/dist/include/clang/AST/Type.h vendor/clang/dist/include/clang/Basic/Attr.td vendor/clang/dist/include/clang/Basic/AttrDocs.td vendor/clang/dist/include/clang/Basic/DiagnosticASTKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td vendor/clang/dist/include/clang/Basic/LangOptions.def vendor/clang/dist/include/clang/CodeGen/CGFunctionInfo.h vendor/clang/dist/include/clang/Driver/CLCompatOptions.td vendor/clang/dist/include/clang/Edit/EditedSource.h vendor/clang/dist/include/clang/Frontend/FrontendActions.h vendor/clang/dist/include/clang/Frontend/FrontendOptions.h vendor/clang/dist/include/clang/Frontend/LangStandard.h vendor/clang/dist/include/clang/Frontend/LangStandards.def vendor/clang/dist/include/clang/Lex/HeaderSearch.h vendor/clang/dist/include/clang/Lex/MacroInfo.h vendor/clang/dist/include/clang/Lex/PPCallbacks.h vendor/clang/dist/include/clang/Lex/PreprocessingRecord.h vendor/clang/dist/include/clang/Lex/Preprocessor.h vendor/clang/dist/include/clang/Sema/Sema.h vendor/clang/dist/lib/ARCMigrate/ObjCMT.cpp vendor/clang/dist/lib/AST/ASTContext.cpp vendor/clang/dist/lib/AST/ASTImporter.cpp vendor/clang/dist/lib/AST/CMakeLists.txt vendor/clang/dist/lib/AST/DeclBase.cpp vendor/clang/dist/lib/AST/ExprConstant.cpp vendor/clang/dist/lib/AST/TypePrinter.cpp vendor/clang/dist/lib/Basic/Targets.cpp vendor/clang/dist/lib/CodeGen/BackendUtil.cpp vendor/clang/dist/lib/CodeGen/CGBlocks.cpp vendor/clang/dist/lib/CodeGen/CGCall.cpp vendor/clang/dist/lib/CodeGen/CGDebugInfo.cpp vendor/clang/dist/lib/CodeGen/CGDeclCXX.cpp vendor/clang/dist/lib/CodeGen/CGExpr.cpp vendor/clang/dist/lib/CodeGen/CGObjC.cpp vendor/clang/dist/lib/CodeGen/CGObjCMac.cpp vendor/clang/dist/lib/CodeGen/CGStmtOpenMP.cpp vendor/clang/dist/lib/CodeGen/CodeGenAction.cpp vendor/clang/dist/lib/CodeGen/CodeGenFunction.h vendor/clang/dist/lib/CodeGen/CodeGenModule.cpp vendor/clang/dist/lib/CodeGen/CodeGenModule.h vendor/clang/dist/lib/CodeGen/MacroPPCallbacks.cpp vendor/clang/dist/lib/CodeGen/MacroPPCallbacks.h vendor/clang/dist/lib/Driver/Job.cpp vendor/clang/dist/lib/Driver/ToolChains/Clang.cpp vendor/clang/dist/lib/Edit/EditedSource.cpp vendor/clang/dist/lib/Format/UnwrappedLineParser.cpp vendor/clang/dist/lib/Frontend/ASTUnit.cpp vendor/clang/dist/lib/Frontend/CompilerInstance.cpp vendor/clang/dist/lib/Frontend/CompilerInvocation.cpp vendor/clang/dist/lib/Frontend/FrontendAction.cpp vendor/clang/dist/lib/Frontend/FrontendActions.cpp vendor/clang/dist/lib/Frontend/FrontendOptions.cpp vendor/clang/dist/lib/Frontend/InitPreprocessor.cpp vendor/clang/dist/lib/Frontend/LangStandards.cpp vendor/clang/dist/lib/Frontend/PrintPreprocessedOutput.cpp vendor/clang/dist/lib/Frontend/Rewrite/InclusionRewriter.cpp vendor/clang/dist/lib/Frontend/VerifyDiagnosticConsumer.cpp vendor/clang/dist/lib/Headers/avx512fintrin.h vendor/clang/dist/lib/Headers/avxintrin.h vendor/clang/dist/lib/Headers/bmiintrin.h vendor/clang/dist/lib/Headers/emmintrin.h vendor/clang/dist/lib/Headers/stdint.h vendor/clang/dist/lib/Index/IndexDecl.cpp vendor/clang/dist/lib/Index/USRGeneration.cpp vendor/clang/dist/lib/Lex/HeaderSearch.cpp vendor/clang/dist/lib/Lex/MacroInfo.cpp vendor/clang/dist/lib/Lex/PPDirectives.cpp vendor/clang/dist/lib/Lex/PPLexerChange.cpp vendor/clang/dist/lib/Lex/PPMacroExpansion.cpp vendor/clang/dist/lib/Lex/Pragma.cpp vendor/clang/dist/lib/Lex/PreprocessingRecord.cpp vendor/clang/dist/lib/Sema/SemaChecking.cpp vendor/clang/dist/lib/Sema/SemaDecl.cpp vendor/clang/dist/lib/Sema/SemaDeclAttr.cpp vendor/clang/dist/lib/Sema/SemaDeclObjC.cpp vendor/clang/dist/lib/Sema/SemaExpr.cpp vendor/clang/dist/lib/Sema/SemaExprObjC.cpp vendor/clang/dist/lib/Sema/SemaOpenMP.cpp vendor/clang/dist/lib/Sema/SemaOverload.cpp vendor/clang/dist/lib/Sema/SemaType.cpp vendor/clang/dist/lib/Serialization/ASTReader.cpp vendor/clang/dist/lib/Serialization/ASTWriter.cpp vendor/clang/dist/lib/StaticAnalyzer/Checkers/MallocChecker.cpp vendor/clang/dist/lib/StaticAnalyzer/Frontend/ModelInjector.cpp vendor/clang/dist/test/Analysis/malloc.c vendor/clang/dist/test/CodeGen/atomic-ops-libcall.c vendor/clang/dist/test/CodeGen/avx-builtins.c vendor/clang/dist/test/CodeGen/avx512f-builtins.c vendor/clang/dist/test/CodeGen/sse2-builtins.c vendor/clang/dist/test/CodeGenCXX/debug-info-namespace.cpp vendor/clang/dist/test/CodeGenObjC/arc-blocks.m vendor/clang/dist/test/CodeGenObjC/arc-foreach.m vendor/clang/dist/test/CodeGenObjC/ubsan-nullability.m vendor/clang/dist/test/Driver/cl-options.c vendor/clang/dist/test/Driver/split-debug.c vendor/clang/dist/test/Driver/unknown-std.c vendor/clang/dist/test/Driver/unknown-std.cl vendor/clang/dist/test/Driver/unknown-std.cpp vendor/clang/dist/test/Frontend/gnu-inline.c vendor/clang/dist/test/Frontend/rewrite-includes-line-markers.c vendor/clang/dist/test/Frontend/rewrite-includes-modules.c vendor/clang/dist/test/Index/Core/index-source.m vendor/clang/dist/test/Index/cursor-dynamic-call.mm vendor/clang/dist/test/Index/index-module.m vendor/clang/dist/test/Index/print-type.cpp vendor/clang/dist/test/Index/usrs.cpp vendor/clang/dist/test/Modules/ExtDebugInfo.cpp vendor/clang/dist/test/Modules/Inputs/module.map vendor/clang/dist/test/Modules/crash-vfs-path-emptydir-entries.m vendor/clang/dist/test/Modules/crash-vfs-path-symlink-component.m vendor/clang/dist/test/Modules/crash-vfs-path-symlink-topheader.m vendor/clang/dist/test/Modules/crash-vfs-path-traversal.m vendor/clang/dist/test/Modules/crash-vfs-relative-incdir.m vendor/clang/dist/test/Modules/crash-vfs-relative-overlay.m vendor/clang/dist/test/Modules/crash-vfs-run-reproducer.m vendor/clang/dist/test/Modules/odr_hash.cpp vendor/clang/dist/test/Modules/preprocess.cpp vendor/clang/dist/test/Modules/preprocess.m vendor/clang/dist/test/OpenMP/distribute_parallel_for_simd_aligned_messages.cpp vendor/clang/dist/test/OpenMP/distribute_simd_aligned_messages.cpp vendor/clang/dist/test/OpenMP/for_simd_aligned_messages.cpp vendor/clang/dist/test/OpenMP/parallel_for_simd_aligned_messages.cpp vendor/clang/dist/test/OpenMP/simd_aligned_messages.cpp vendor/clang/dist/test/OpenMP/target_parallel_for_simd_aligned_messages.cpp vendor/clang/dist/test/OpenMP/target_simd_aligned_messages.cpp vendor/clang/dist/test/OpenMP/target_teams_distribute_parallel_for_simd_aligned_messages.cpp vendor/clang/dist/test/OpenMP/target_teams_distribute_simd_aligned_messages.cpp vendor/clang/dist/test/OpenMP/taskloop_simd_aligned_messages.cpp vendor/clang/dist/test/OpenMP/teams_distribute_parallel_for_simd_aligned_messages.cpp vendor/clang/dist/test/OpenMP/teams_distribute_simd_aligned_messages.cpp vendor/clang/dist/test/Preprocessor/init.c vendor/clang/dist/test/Preprocessor/pp-modules.c vendor/clang/dist/test/Preprocessor/pragma_diagnostic.c vendor/clang/dist/test/Preprocessor/stdint.c vendor/clang/dist/test/Profile/c-outdated-data.c vendor/clang/dist/test/Sema/integer-overflow.c vendor/clang/dist/test/SemaCXX/typo-correction.cpp vendor/clang/dist/tools/c-index-test/c-index-test.c vendor/clang/dist/tools/libclang/CIndex.cpp vendor/clang/dist/tools/libclang/CXCursor.cpp vendor/clang/dist/tools/libclang/CXTranslationUnit.h vendor/clang/dist/tools/libclang/CXType.cpp vendor/clang/dist/tools/libclang/Indexing.cpp vendor/clang/dist/tools/libclang/libclang.exports vendor/clang/dist/unittests/Basic/SourceManagerTest.cpp vendor/clang/dist/unittests/Format/FormatTestJS.cpp vendor/clang/dist/unittests/Frontend/CodeGenActionTest.cpp vendor/clang/dist/unittests/Frontend/FrontendActionTest.cpp vendor/clang/dist/utils/TableGen/ClangAttrEmitter.cpp Modified: vendor/clang/dist/docs/SanitizerCoverage.rst ============================================================================== --- vendor/clang/dist/docs/SanitizerCoverage.rst Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/docs/SanitizerCoverage.rst Tue May 2 18:30:45 2017 (r317685) @@ -8,202 +8,12 @@ SanitizerCoverage Introduction ============ -Sanitizer tools have a very simple code coverage tool built in. It allows to -get function-level, basic-block-level, and edge-level coverage at a very low -cost. - -How to build and run -==================== - -SanitizerCoverage can be used with :doc:`AddressSanitizer`, -:doc:`LeakSanitizer`, :doc:`MemorySanitizer`, -UndefinedBehaviorSanitizer, or without any sanitizer. Pass one of the -following compile-time flags: - -* ``-fsanitize-coverage=func`` for function-level coverage (very fast). -* ``-fsanitize-coverage=bb`` for basic-block-level coverage (may add up to 30% - **extra** slowdown). -* ``-fsanitize-coverage=edge`` for edge-level coverage (up to 40% slowdown). - -At run time, pass ``coverage=1`` in ``ASAN_OPTIONS``, -``LSAN_OPTIONS``, ``MSAN_OPTIONS`` or ``UBSAN_OPTIONS``, as -appropriate. For the standalone coverage mode, use ``UBSAN_OPTIONS``. - -Example: - -.. code-block:: console - - % cat -n cov.cc - 1 #include - 2 __attribute__((noinline)) - 3 void foo() { printf("foo\n"); } - 4 - 5 int main(int argc, char **argv) { - 6 if (argc == 2) - 7 foo(); - 8 printf("main\n"); - 9 } - % clang++ -g cov.cc -fsanitize=address -fsanitize-coverage=func - % ASAN_OPTIONS=coverage=1 ./a.out; ls -l *sancov - main - -rw-r----- 1 kcc eng 4 Nov 27 12:21 a.out.22673.sancov - % ASAN_OPTIONS=coverage=1 ./a.out foo ; ls -l *sancov - foo - main - -rw-r----- 1 kcc eng 4 Nov 27 12:21 a.out.22673.sancov - -rw-r----- 1 kcc eng 8 Nov 27 12:21 a.out.22679.sancov - -Every time you run an executable instrumented with SanitizerCoverage -one ``*.sancov`` file is created during the process shutdown. -If the executable is dynamically linked against instrumented DSOs, -one ``*.sancov`` file will be also created for every DSO. - -Postprocessing -============== - -The format of ``*.sancov`` files is very simple: the first 8 bytes is the magic, -one of ``0xC0BFFFFFFFFFFF64`` and ``0xC0BFFFFFFFFFFF32``. The last byte of the -magic defines the size of the following offsets. The rest of the data is the -offsets in the corresponding binary/DSO that were executed during the run. - -A simple script -``$LLVM/projects/compiler-rt/lib/sanitizer_common/scripts/sancov.py`` is -provided to dump these offsets. - -.. code-block:: console - - % sancov.py print a.out.22679.sancov a.out.22673.sancov - sancov.py: read 2 PCs from a.out.22679.sancov - sancov.py: read 1 PCs from a.out.22673.sancov - sancov.py: 2 files merged; 2 PCs total - 0x465250 - 0x4652a0 - -You can then filter the output of ``sancov.py`` through ``addr2line --exe -ObjectFile`` or ``llvm-symbolizer --obj ObjectFile`` to get file names and line -numbers: - -.. code-block:: console - - % sancov.py print a.out.22679.sancov a.out.22673.sancov 2> /dev/null | llvm-symbolizer --obj a.out - cov.cc:3 - cov.cc:5 - -Sancov Tool -=========== - -A new experimental ``sancov`` tool is developed to process coverage files. -The tool is part of LLVM project and is currently supported only on Linux. -It can handle symbolization tasks autonomously without any extra support -from the environment. You need to pass .sancov files (named -``..sancov`` and paths to all corresponding binary elf files. -Sancov matches these files using module names and binaries file names. - -.. code-block:: console - - USAGE: sancov [options] (|<.sancov file>)... - - Action (required) - -print - Print coverage addresses - -covered-functions - Print all covered functions. - -not-covered-functions - Print all not covered functions. - -symbolize - Symbolizes the report. - - Options - -blacklist= - Blacklist file (sanitizer blacklist format). - -demangle - Print demangled function name. - -strip_path_prefix= - Strip this prefix from file paths in reports - - -Coverage Reports (Experimental) -================================ - -``.sancov`` files do not contain enough information to generate a source-level -coverage report. The missing information is contained -in debug info of the binary. Thus the ``.sancov`` has to be symbolized -to produce a ``.symcov`` file first: - -.. code-block:: console - - sancov -symbolize my_program.123.sancov my_program > my_program.123.symcov - -The ``.symcov`` file can be browsed overlayed over the source code by -running ``tools/sancov/coverage-report-server.py`` script that will start -an HTTP server. - - -How good is the coverage? -========================= - -It is possible to find out which PCs are not covered, by subtracting the covered -set from the set of all instrumented PCs. The latter can be obtained by listing -all callsites of ``__sanitizer_cov()`` in the binary. On Linux, ``sancov.py`` -can do this for you. Just supply the path to binary and a list of covered PCs: - -.. code-block:: console - - % sancov.py print a.out.12345.sancov > covered.txt - sancov.py: read 2 64-bit PCs from a.out.12345.sancov - sancov.py: 1 file merged; 2 PCs total - % sancov.py missing a.out < covered.txt - sancov.py: found 3 instrumented PCs in a.out - sancov.py: read 2 PCs from stdin - sancov.py: 1 PCs missing from coverage - 0x4cc61c - -Edge coverage -============= - -Consider this code: - -.. code-block:: c++ - - void foo(int *a) { - if (a) - *a = 0; - } - -It contains 3 basic blocks, let's name them A, B, C: - -.. code-block:: none - - A - |\ - | \ - | B - | / - |/ - C - -If blocks A, B, and C are all covered we know for certain that the edges A=>B -and B=>C were executed, but we still don't know if the edge A=>C was executed. -Such edges of control flow graph are called -`critical `_. The -edge-level coverage (``-fsanitize-coverage=edge``) simply splits all critical -edges by introducing new dummy blocks and then instruments those blocks: - -.. code-block:: none - - A - |\ - | \ - D B - | / - |/ - C - -Tracing PCs -=========== - -*Experimental* feature similar to tracing basic blocks, but with a different API. -With ``-fsanitize-coverage=trace-pc`` the compiler will insert -``__sanitizer_cov_trace_pc()`` on every edge. -With an additional ``...=trace-pc,indirect-calls`` flag -``__sanitizer_cov_trace_pc_indirect(void *callee)`` will be inserted on every indirect call. -These callbacks are not implemented in the Sanitizer run-time and should be defined -by the user. So, these flags do not require the other sanitizer to be used. -This mechanism is used for fuzzing the Linux kernel (https://github.com/google/syzkaller) -and can be used with `AFL `__. +LLVM has a simple code coverage instrumentation built in (SanitizerCoverage). +It inserts calls to user-defined functions on function-, basic-block-, and edge- levels. +Default implementations of those callbacks are provided and implement +simple coverage reporting and visualization, +however if you need *just* coverage visualization you may want to use +:doc:`SourceBasedCodeCoverage ` instead. Tracing PCs with guards ======================= @@ -217,7 +27,7 @@ on every edge: Every edge will have its own `guard_variable` (uint32_t). -The compler will also insert a module constructor that will call +The compler will also insert calls to a module constructor: .. code-block:: c++ @@ -226,7 +36,7 @@ The compler will also insert a module co // more than once with the same values of start/stop. __sanitizer_cov_trace_pc_guard_init(uint32_t *start, uint32_t *stop); -With `trace-pc-guards,indirect-calls` +With an additional ``...=trace-pc,indirect-calls`` flag ``__sanitizer_cov_trace_pc_indirect(void *callee)`` will be inserted on every indirect call. The functions `__sanitizer_cov_trace_pc_*` should be defined by the user. @@ -309,6 +119,75 @@ Example: guard: 0x71bcdc 4 PC 0x4ecdc7 in main trace-pc-guard-example.cc:4:17 guard: 0x71bcd0 1 PC 0x4ecd20 in foo() trace-pc-guard-example.cc:2:14 +Tracing PCs +=========== + +With ``-fsanitize-coverage=trace-pc`` the compiler will insert +``__sanitizer_cov_trace_pc()`` on every edge. +With an additional ``...=trace-pc,indirect-calls`` flag +``__sanitizer_cov_trace_pc_indirect(void *callee)`` will be inserted on every indirect call. +These callbacks are not implemented in the Sanitizer run-time and should be defined +by the user. +This mechanism is used for fuzzing the Linux kernel +(https://github.com/google/syzkaller). + + +Instrumentation points +====================== +Sanitizer Coverage offers different levels of instrumentation. + +* ``edge`` (default): edges are instrumented (see below). +* ``bb``: basic blocks are instrumented. +* ``func``: only the entry block of every function will be instrumented. + +Use these flags together with ``trace-pc-guard`` or ``trace-pc``, +like this: ``-fsanitize-coverage=func,trace-pc-guard``. + +When ``edge`` or ``bb`` is used, some of the edges/blocks may still be left +uninstrumented if such instrumentation is considered redundant. +**TODO**: add a user-visible option to disable the optimization. + + +Edge coverage +------------- + +Consider this code: + +.. code-block:: c++ + + void foo(int *a) { + if (a) + *a = 0; + } + +It contains 3 basic blocks, let's name them A, B, C: + +.. code-block:: none + + A + |\ + | \ + | B + | / + |/ + C + +If blocks A, B, and C are all covered we know for certain that the edges A=>B +and B=>C were executed, but we still don't know if the edge A=>C was executed. +Such edges of control flow graph are called +`critical `_. The +edge-level coverage simply splits all critical +edges by introducing new dummy blocks and then instruments those blocks: + +.. code-block:: none + + A + |\ + | \ + D B + | / + |/ + C Tracing data flow ================= @@ -349,50 +228,107 @@ the `LLVM GEP instructions + 2 __attribute__((noinline)) + 3 void foo() { printf("foo\n"); } + 4 + 5 int main(int argc, char **argv) { + 6 if (argc == 2) + 7 foo(); + 8 printf("main\n"); + 9 } + % clang++ -g cov.cc -fsanitize=address -fsanitize-coverage=trace-pc-guard + % ASAN_OPTIONS=coverage=1 ./a.out; wc -c *.sancov + main + SanitizerCoverage: ./a.out.7312.sancov 2 PCs written + 24 a.out.7312.sancov + % ASAN_OPTIONS=coverage=1 ./a.out foo ; wc -c *.sancov + foo + main + SanitizerCoverage: ./a.out.7316.sancov 3 PCs written + 24 a.out.7312.sancov + 32 a.out.7316.sancov -Sudden death -============ +Every time you run an executable instrumented with SanitizerCoverage +one ``*.sancov`` file is created during the process shutdown. +If the executable is dynamically linked against instrumented DSOs, +one ``*.sancov`` file will be also created for every DSO. -Normally, coverage data is collected in memory and saved to disk when the -program exits (with an ``atexit()`` handler), when a SIGSEGV is caught, or when -``__sanitizer_cov_dump()`` is called. - -If the program ends with a signal that ASan does not handle (or can not handle -at all, like SIGKILL), coverage data will be lost. This is a big problem on -Android, where SIGKILL is a normal way of evicting applications from memory. +Sancov data format +------------------ -With ``ASAN_OPTIONS=coverage=1:coverage_direct=1`` coverage data is written to a -memory-mapped file as soon as it collected. +The format of ``*.sancov`` files is very simple: the first 8 bytes is the magic, +one of ``0xC0BFFFFFFFFFFF64`` and ``0xC0BFFFFFFFFFFF32``. The last byte of the +magic defines the size of the following offsets. The rest of the data is the +offsets in the corresponding binary/DSO that were executed during the run. + +Sancov Tool +----------- + +An simple ``sancov`` tool is provided to process coverage files. +The tool is part of LLVM project and is currently supported only on Linux. +It can handle symbolization tasks autonomously without any extra support +from the environment. You need to pass .sancov files (named +``..sancov`` and paths to all corresponding binary elf files. +Sancov matches these files using module names and binaries file names. .. code-block:: console - % ASAN_OPTIONS="coverage=1:coverage_direct=1" ./a.out - main - % ls - 7036.sancov.map 7036.sancov.raw a.out - % sancov.py rawunpack 7036.sancov.raw - sancov.py: reading map 7036.sancov.map - sancov.py: unpacking 7036.sancov.raw - writing 1 PCs to a.out.7036.sancov - % sancov.py print a.out.7036.sancov - sancov.py: read 1 PCs from a.out.7036.sancov - sancov.py: 1 files merged; 1 PCs total - 0x4b2bae + USAGE: sancov [options] (|<.sancov file>)... -Note that on 64-bit platforms, this method writes 2x more data than the default, -because it stores full PC values instead of 32-bit offsets. + Action (required) + -print - Print coverage addresses + -covered-functions - Print all covered functions. + -not-covered-functions - Print all not covered functions. + -symbolize - Symbolizes the report. + + Options + -blacklist= - Blacklist file (sanitizer blacklist format). + -demangle - Print demangled function name. + -strip_path_prefix= - Strip this prefix from file paths in reports + + +Coverage Reports +---------------- + +**Experimental** + +``.sancov`` files do not contain enough information to generate a source-level +coverage report. The missing information is contained +in debug info of the binary. Thus the ``.sancov`` has to be symbolized +to produce a ``.symcov`` file first: + +.. code-block:: console + + sancov -symbolize my_program.123.sancov my_program > my_program.123.symcov + +The ``.symcov`` file can be browsed overlayed over the source code by +running ``tools/sancov/coverage-report-server.py`` script that will start +an HTTP server. + +Output directory +---------------- + +By default, .sancov files are created in the current working directory. +This can be changed with ``ASAN_OPTIONS=coverage_dir=/path``: + +.. code-block:: console + % ASAN_OPTIONS="coverage=1:coverage_dir=/tmp/cov" ./a.out foo + % ls -l /tmp/cov/*sancov + -rw-r----- 1 kcc eng 4 Nov 27 12:21 a.out.22673.sancov + -rw-r----- 1 kcc eng 8 Nov 27 12:21 a.out.22679.sancov Modified: vendor/clang/dist/include/clang-c/Index.h ============================================================================== --- vendor/clang/dist/include/clang-c/Index.h Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/include/clang-c/Index.h Tue May 2 18:30:45 2017 (r317685) @@ -32,7 +32,7 @@ * compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable. */ #define CINDEX_VERSION_MAJOR 0 -#define CINDEX_VERSION_MINOR 37 +#define CINDEX_VERSION_MINOR 38 #define CINDEX_VERSION_ENCODE(major, minor) ( \ ((major) * 10000) \ @@ -81,6 +81,12 @@ extern "C" { typedef void *CXIndex; /** + * \brief An opaque type representing target information for a given translation + * unit. + */ +typedef struct CXTargetInfoImpl *CXTargetInfo; + +/** * \brief A single translation unit, which resides in an index. */ typedef struct CXTranslationUnitImpl *CXTranslationUnit; @@ -1553,6 +1559,36 @@ CINDEX_LINKAGE CXTUResourceUsage clang_g CINDEX_LINKAGE void clang_disposeCXTUResourceUsage(CXTUResourceUsage usage); /** + * \brief Get target information for this translation unit. + * + * The CXTargetInfo object cannot outlive the CXTranslationUnit object. + */ +CINDEX_LINKAGE CXTargetInfo +clang_getTranslationUnitTargetInfo(CXTranslationUnit CTUnit); + +/** + * \brief Destroy the CXTargetInfo object. + */ +CINDEX_LINKAGE void +clang_TargetInfo_dispose(CXTargetInfo Info); + +/** + * \brief Get the normalized target triple as a string. + * + * Returns the empty string in case of any error. + */ +CINDEX_LINKAGE CXString +clang_TargetInfo_getTriple(CXTargetInfo Info); + +/** + * \brief Get the pointer width of the target in bits. + * + * Returns -1 in case of error. + */ +CINDEX_LINKAGE int +clang_TargetInfo_getPointerWidth(CXTargetInfo Info); + +/** * @} */ @@ -3975,8 +4011,8 @@ CINDEX_LINKAGE int clang_Cursor_getObjCS CINDEX_LINKAGE int clang_Cursor_isDynamicCall(CXCursor C); /** - * \brief Given a cursor pointing to an Objective-C message, returns the CXType - * of the receiver. + * \brief Given a cursor pointing to an Objective-C message or property + * reference, or C++ method call, returns the CXType of the receiver. */ CINDEX_LINKAGE CXType clang_Cursor_getReceiverType(CXCursor C); Added: vendor/clang/dist/include/clang/AST/ASTStructuralEquivalence.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/clang/dist/include/clang/AST/ASTStructuralEquivalence.h Tue May 2 18:30:45 2017 (r317685) @@ -0,0 +1,101 @@ +//===--- ASTStructuralEquivalence.h - ---------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines the StructuralEquivalenceContext class which checks for +// structural equivalence between types. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_AST_ASTSTRUCTURALEQUIVALENCE_H +#define LLVM_CLANG_AST_ASTSTRUCTURALEQUIVALENCE_H + +#include "llvm/ADT/DenseMap.h" +#include "llvm/ADT/DenseSet.h" +#include "llvm/ADT/Optional.h" +#include + +namespace clang { + +class ASTContext; +class Decl; +class DiagnosticBuilder; +class QualType; +class RecordDecl; +class SourceLocation; + +struct StructuralEquivalenceContext { + /// AST contexts for which we are checking structural equivalence. + ASTContext &FromCtx, &ToCtx; + + /// The set of "tentative" equivalences between two canonical + /// declarations, mapping from a declaration in the first context to the + /// declaration in the second context that we believe to be equivalent. + llvm::DenseMap TentativeEquivalences; + + /// Queue of declarations in the first context whose equivalence + /// with a declaration in the second context still needs to be verified. + std::deque DeclsToCheck; + + /// Declaration (from, to) pairs that are known not to be equivalent + /// (which we have already complained about). + llvm::DenseSet> &NonEquivalentDecls; + + /// Whether we're being strict about the spelling of types when + /// unifying two types. + bool StrictTypeSpelling; + + /// Whether warn or error on tag type mismatches. + bool ErrorOnTagTypeMismatch; + + /// Whether to complain about failures. + bool Complain; + + /// \c true if the last diagnostic came from ToCtx. + bool LastDiagFromC2; + + StructuralEquivalenceContext( + ASTContext &FromCtx, ASTContext &ToCtx, + llvm::DenseSet> &NonEquivalentDecls, + bool StrictTypeSpelling = false, bool Complain = true) + : FromCtx(FromCtx), ToCtx(ToCtx), NonEquivalentDecls(NonEquivalentDecls), + StrictTypeSpelling(StrictTypeSpelling), Complain(Complain), + LastDiagFromC2(false) {} + + DiagnosticBuilder Diag1(SourceLocation Loc, unsigned DiagID); + DiagnosticBuilder Diag2(SourceLocation Loc, unsigned DiagID); + + /// Determine whether the two declarations are structurally + /// equivalent. + bool IsStructurallyEquivalent(Decl *D1, Decl *D2); + + /// Determine whether the two types are structurally equivalent. + bool IsStructurallyEquivalent(QualType T1, QualType T2); + + /// Find the index of the given anonymous struct/union within its + /// context. + /// + /// \returns Returns the index of this anonymous struct/union in its context, + /// including the next assigned index (if none of them match). Returns an + /// empty option if the context is not a record, i.e.. if the anonymous + /// struct/union is at namespace or block scope. + /// + /// FIXME: This is needed by ASTImporter and ASTStructureEquivalence. It + /// probably makes more sense in some other common place then here. + static llvm::Optional + findUntaggedStructOrUnionIndex(RecordDecl *Anon); + +private: + /// Finish checking all of the structural equivalences. + /// + /// \returns true if an error occurred, false otherwise. + bool Finish(); +}; +} // namespace clang + +#endif // LLVM_CLANG_AST_ASTSTRUCTURALEQUIVALENCE_H Modified: vendor/clang/dist/include/clang/AST/DeclBase.h ============================================================================== --- vendor/clang/dist/include/clang/AST/DeclBase.h Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/include/clang/AST/DeclBase.h Tue May 2 18:30:45 2017 (r317685) @@ -616,6 +616,14 @@ public: getAvailability(std::string *Message = nullptr, VersionTuple EnclosingVersion = VersionTuple()) const; + /// \brief Retrieve the version of the target platform in which this + /// declaration was introduced. + /// + /// \returns An empty version tuple if this declaration has no 'introduced' + /// availability attributes, or the version tuple that's specified in the + /// attribute otherwise. + VersionTuple getVersionIntroduced() const; + /// \brief Determine whether this declaration is marked 'deprecated'. /// /// \param Message If non-NULL and the declaration is deprecated, Modified: vendor/clang/dist/include/clang/AST/Type.h ============================================================================== --- vendor/clang/dist/include/clang/AST/Type.h Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/include/clang/AST/Type.h Tue May 2 18:30:45 2017 (r317685) @@ -1396,7 +1396,7 @@ protected: /// Extra information which affects how the function is called, like /// regparm and the calling convention. - unsigned ExtInfo : 10; + unsigned ExtInfo : 11; /// Used only by FunctionProtoType, put here to pack with the /// other bitfields. @@ -2941,19 +2941,23 @@ class FunctionType : public Type { // * AST read and write // * Codegen class ExtInfo { - // Feel free to rearrange or add bits, but if you go over 10, + // Feel free to rearrange or add bits, but if you go over 11, // you'll need to adjust both the Bits field below and // Type::FunctionTypeBitfields. - // | CC |noreturn|produces|regparm| - // |0 .. 4| 5 | 6 | 7 .. 9| + // | CC |noreturn|produces|nocallersavedregs|regparm| + // |0 .. 4| 5 | 6 | 7 |8 .. 10| // // regparm is either 0 (no regparm attribute) or the regparm value+1. enum { CallConvMask = 0x1F }; enum { NoReturnMask = 0x20 }; enum { ProducesResultMask = 0x40 }; - enum { RegParmMask = ~(CallConvMask | NoReturnMask | ProducesResultMask), - RegParmOffset = 7 }; // Assumed to be the last field + enum { NoCallerSavedRegsMask = 0x80 }; + enum { + RegParmMask = ~(CallConvMask | NoReturnMask | ProducesResultMask | + NoCallerSavedRegsMask), + RegParmOffset = 8 + }; // Assumed to be the last field uint16_t Bits; @@ -2964,13 +2968,13 @@ class FunctionType : public Type { public: // Constructor with no defaults. Use this when you know that you // have all the elements (when reading an AST file for example). - ExtInfo(bool noReturn, bool hasRegParm, unsigned regParm, CallingConv cc, - bool producesResult) { - assert((!hasRegParm || regParm < 7) && "Invalid regparm value"); - Bits = ((unsigned) cc) | - (noReturn ? NoReturnMask : 0) | - (producesResult ? ProducesResultMask : 0) | - (hasRegParm ? ((regParm + 1) << RegParmOffset) : 0); + ExtInfo(bool noReturn, bool hasRegParm, unsigned regParm, CallingConv cc, + bool producesResult, bool noCallerSavedRegs) { + assert((!hasRegParm || regParm < 7) && "Invalid regparm value"); + Bits = ((unsigned)cc) | (noReturn ? NoReturnMask : 0) | + (producesResult ? ProducesResultMask : 0) | + (noCallerSavedRegs ? NoCallerSavedRegsMask : 0) | + (hasRegParm ? ((regParm + 1) << RegParmOffset) : 0); } // Constructor with all defaults. Use when for example creating a @@ -2983,6 +2987,7 @@ class FunctionType : public Type { bool getNoReturn() const { return Bits & NoReturnMask; } bool getProducesResult() const { return Bits & ProducesResultMask; } + bool getNoCallerSavedRegs() const { return Bits & NoCallerSavedRegsMask; } bool getHasRegParm() const { return (Bits >> RegParmOffset) != 0; } unsigned getRegParm() const { unsigned RegParm = Bits >> RegParmOffset; @@ -3016,6 +3021,13 @@ class FunctionType : public Type { return ExtInfo(Bits & ~ProducesResultMask); } + ExtInfo withNoCallerSavedRegs(bool noCallerSavedRegs) const { + if (noCallerSavedRegs) + return ExtInfo(Bits | NoCallerSavedRegsMask); + else + return ExtInfo(Bits & ~NoCallerSavedRegsMask); + } + ExtInfo withRegParm(unsigned RegParm) const { assert(RegParm < 7 && "Invalid regparm value"); return ExtInfo((Bits & ~RegParmMask) | Modified: vendor/clang/dist/include/clang/Basic/Attr.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/Attr.td Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/include/clang/Basic/Attr.td Tue May 2 18:30:45 2017 (r317685) @@ -1931,6 +1931,12 @@ def AnyX86Interrupt : InheritableAttr, T let Documentation = [AnyX86InterruptDocs]; } +def AnyX86NoCallerSavedRegisters : InheritableAttr, + TargetSpecificAttr { + let Spellings = [GCC<"no_caller_saved_registers">]; + let Documentation = [AnyX86NoCallerSavedRegistersDocs]; +} + def X86ForceAlignArgPointer : InheritableAttr, TargetSpecificAttr { let Spellings = [GNU<"force_align_arg_pointer">]; // Technically, this appertains to a FunctionDecl, but the target-specific Modified: vendor/clang/dist/include/clang/Basic/AttrDocs.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/AttrDocs.td Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/include/clang/Basic/AttrDocs.td Tue May 2 18:30:45 2017 (r317685) @@ -2657,6 +2657,40 @@ hardware design, touch the red zone. }]; } +def AnyX86NoCallerSavedRegistersDocs : Documentation { + let Category = DocCatFunction; + let Content = [{ +Use this attribute to indicate that the specified function has no +caller-saved registers. That is, all registers are callee-saved except for +registers used for passing parameters to the function or returning parameters +from the function. +The compiler saves and restores any modified registers that were not used for +passing or returning arguments to the function. + +The user can call functions specified with the 'no_caller_saved_registers' +attribute from an interrupt handler without saving and restoring all +call-clobbered registers. + +Note that 'no_caller_saved_registers' attribute is not a calling convention. +In fact, it only overrides the decision of which registers should be saved by +the caller, but not how the parameters are passed from the caller to the callee. + +For example: + + .. code-block:: c + + __attribute__ ((no_caller_saved_registers, fastcall)) + void f (int arg1, int arg2) { + ... + } + + In this case parameters 'arg1' and 'arg2' will be passed in registers. + In this case, on 32-bit x86 targets, the function 'f' will use ECX and EDX as + register parameters. However, it will not assume any scratch registers and + should save and restore any modified registers except for ECX and EDX. + }]; +} + def SwiftCallDocs : Documentation { let Category = DocCatVariable; let Content = [{ Modified: vendor/clang/dist/include/clang/Basic/DiagnosticASTKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticASTKinds.td Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/include/clang/Basic/DiagnosticASTKinds.td Tue May 2 18:30:45 2017 (r317685) @@ -154,12 +154,14 @@ def note_constexpr_baa_insufficient_alig def note_constexpr_baa_value_insufficient_alignment : Note< "value of the aligned pointer (%0) is not a multiple of the asserted %1 " "%plural{1:byte|:bytes}1">; +def note_constexpr_array_unknown_bound_arithmetic : Note< + "cannot perform pointer arithmetic on pointer to array without constant bound">; def warn_integer_constant_overflow : Warning< "overflow in expression; result is %0 with type %1">, InGroup>; -// This is a temporary diagnostic, and shall be removed once our +// This is a temporary diagnostic, and shall be removed once our // implementation is complete, and like the preceding constexpr notes belongs // in Sema. def note_unimplemented_constexpr_lambda_feature_ast : Note< Modified: vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/include/clang/Basic/DiagnosticDriverKinds.td Tue May 2 18:30:45 2017 (r317685) @@ -233,7 +233,9 @@ def note_drv_t_option_is_global : Note< "The last /TC or /TP option takes precedence over earlier instances">; def note_drv_address_sanitizer_debug_runtime : Note< "AddressSanitizer doesn't support linking with debug runtime libraries yet">; -def note_drv_use_standard : Note<"use '%0' for '%1' standard">; +def note_drv_use_standard : Note<"use '%0'" + "%select{| or '%3'|, '%3', or '%4'|, '%3', '%4', or '%5'}2 " + "for '%1' standard">; def err_analyzer_config_no_value : Error< "analyzer-config option '%0' has a key but no value">; Modified: vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/include/clang/Basic/DiagnosticGroups.td Tue May 2 18:30:45 2017 (r317685) @@ -890,6 +890,7 @@ def BackendOptimizationRemarkAnalysis : def BackendOptimizationFailure : DiagGroup<"pass-failed">; // Instrumentation based profiling warnings. +def ProfileInstrMissing : DiagGroup<"profile-instr-missing">; def ProfileInstrOutOfDate : DiagGroup<"profile-instr-out-of-date">; def ProfileInstrUnprofiled : DiagGroup<"profile-instr-unprofiled">; Modified: vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/include/clang/Basic/DiagnosticLexKinds.td Tue May 2 18:30:45 2017 (r317685) @@ -475,6 +475,8 @@ def warn_pragma_pop_macro_no_push : Warn def warn_pragma_message : Warning<"%0">, InGroup, DefaultWarnNoWerror; def err_pragma_message : Error<"%0">; +def err_pragma_module_import_expected_module_name : Error< + "expected %select{identifier in|'.' or end of directive after}0 module name">; def warn_pragma_ignored : Warning<"unknown pragma ignored">, InGroup, DefaultIgnore; def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">, @@ -503,7 +505,7 @@ def warn_pragma_diagnostic_invalid_token InGroup; def warn_pragma_diagnostic_unknown_warning : ExtWarn<"unknown warning group '%0', ignored">, - InGroup; + InGroup; // - #pragma __debug def warn_pragma_debug_unexpected_command : Warning< "unexpected debug command '%0'">, InGroup; Modified: vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td ============================================================================== --- vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/include/clang/Basic/DiagnosticSemaKinds.td Tue May 2 18:30:45 2017 (r317685) @@ -1180,6 +1180,10 @@ def err_objc_kindof_nonobject : Error< def err_objc_kindof_wrong_position : Error< "'__kindof' type specifier must precede the declarator">; +def err_objc_method_unsupported_param_ret_type : Error< + "%0 %select{parameter|return}1 type is unsupported; " + "support for vector types for this target is introduced in %2">; + // C++ declarations def err_static_assert_expression_is_not_constant : Error< "static_assert expression is not an integral constant expression">; @@ -2819,6 +2823,9 @@ def err_regparm_mismatch : Error<"functi def err_returns_retained_mismatch : Error< "function declared with the ns_returns_retained attribute " "was previously declared without the ns_returns_retained attribute">; +def err_function_attribute_mismatch : Error< + "function declared with %0 attribute " + "was previously declared without the %0 attribute">; def err_objc_precise_lifetime_bad_type : Error< "objc_precise_lifetime only applies to retainable types; type here is %0">; def warn_objc_precise_lifetime_meaningless : Error< @@ -8931,8 +8938,13 @@ def warn_not_a_doxygen_trailing_member_c let CategoryName = "Instrumentation Issue" in { def warn_profile_data_out_of_date : Warning< "profile data may be out of date: of %0 function%s0, %1 %plural{1:has|:have}1" - " no data and %2 %plural{1:has|:have}2 mismatched data that will be ignored">, + " mismatched data that will be ignored">, InGroup; +def warn_profile_data_missing : Warning< + "profile data may be incomplete: of %0 function%s0, %1 %plural{1:has|:have}1" + " no data">, + InGroup, + DefaultIgnore; def warn_profile_data_unprofiled : Warning< "no profile data available for file \"%0\"">, InGroup; Modified: vendor/clang/dist/include/clang/Basic/LangOptions.def ============================================================================== --- vendor/clang/dist/include/clang/Basic/LangOptions.def Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/include/clang/Basic/LangOptions.def Tue May 2 18:30:45 2017 (r317685) @@ -266,7 +266,8 @@ LANGOPT(SanitizeAddressFieldPadding, 2, LANGOPT(XRayInstrument, 1, 0, "controls whether to do XRay instrumentation") -LANGOPT(AllowEditorPlaceholders, 1, 0, "allow editor placeholders in source") +BENIGN_LANGOPT(AllowEditorPlaceholders, 1, 0, + "allow editor placeholders in source") #undef LANGOPT #undef COMPATIBLE_LANGOPT Modified: vendor/clang/dist/include/clang/CodeGen/CGFunctionInfo.h ============================================================================== --- vendor/clang/dist/include/clang/CodeGen/CGFunctionInfo.h Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/include/clang/CodeGen/CGFunctionInfo.h Tue May 2 18:30:45 2017 (r317685) @@ -461,7 +461,7 @@ class CGFunctionInfo final unsigned EffectiveCallingConvention : 8; /// The clang::CallingConv that this was originally created with. - unsigned ASTCallingConvention : 8; + unsigned ASTCallingConvention : 7; /// Whether this is an instance method. unsigned InstanceMethod : 1; @@ -475,6 +475,9 @@ class CGFunctionInfo final /// Whether this function is returns-retained. unsigned ReturnsRetained : 1; + /// Whether this function saved caller registers. + unsigned NoCallerSavedRegs : 1; + /// How many arguments to pass inreg. unsigned HasRegParm : 1; unsigned RegParm : 3; @@ -560,6 +563,9 @@ public: /// is not always reliable for call sites. bool isReturnsRetained() const { return ReturnsRetained; } + /// Whether this function no longer saves caller registers. + bool isNoCallerSavedRegs() const { return NoCallerSavedRegs; } + /// getASTCallingConvention() - Return the AST-specified calling /// convention. CallingConv getASTCallingConvention() const { @@ -583,10 +589,9 @@ public: unsigned getRegParm() const { return RegParm; } FunctionType::ExtInfo getExtInfo() const { - return FunctionType::ExtInfo(isNoReturn(), - getHasRegParm(), getRegParm(), - getASTCallingConvention(), - isReturnsRetained()); + return FunctionType::ExtInfo(isNoReturn(), getHasRegParm(), getRegParm(), + getASTCallingConvention(), isReturnsRetained(), + isNoCallerSavedRegs()); } CanQualType getReturnType() const { return getArgsBuffer()[0].type; } @@ -623,6 +628,7 @@ public: ID.AddBoolean(ChainCall); ID.AddBoolean(NoReturn); ID.AddBoolean(ReturnsRetained); + ID.AddBoolean(NoCallerSavedRegs); ID.AddBoolean(HasRegParm); ID.AddInteger(RegParm); ID.AddInteger(Required.getOpaqueData()); @@ -648,6 +654,7 @@ public: ID.AddBoolean(ChainCall); ID.AddBoolean(info.getNoReturn()); ID.AddBoolean(info.getProducesResult()); + ID.AddBoolean(info.getNoCallerSavedRegs()); ID.AddBoolean(info.getHasRegParm()); ID.AddInteger(info.getRegParm()); ID.AddInteger(required.getOpaqueData()); Modified: vendor/clang/dist/include/clang/Driver/CLCompatOptions.td ============================================================================== --- vendor/clang/dist/include/clang/Driver/CLCompatOptions.td Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/include/clang/Driver/CLCompatOptions.td Tue May 2 18:30:45 2017 (r317685) @@ -61,6 +61,8 @@ def _SLASH_Brepro_ : CLFlag<"Brepro-">, def _SLASH_C : CLFlag<"C">, HelpText<"Don't discard comments when preprocessing">, Alias; def _SLASH_c : CLFlag<"c">, HelpText<"Compile only">, Alias; +def _SLASH_d1reportAllClassLayout : CLFlag<"d1reportAllClassLayout">, + HelpText<"Dump record layout information">, Alias; def _SLASH_D : CLJoinedOrSeparate<"D">, HelpText<"Define macro">, MetaVarName<"">, Alias; def _SLASH_E : CLFlag<"E">, HelpText<"Preprocess to stdout">, Alias; Modified: vendor/clang/dist/include/clang/Edit/EditedSource.h ============================================================================== --- vendor/clang/dist/include/clang/Edit/EditedSource.h Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/include/clang/Edit/EditedSource.h Tue May 2 18:30:45 2017 (r317685) @@ -65,7 +65,7 @@ public: bool commit(const Commit &commit); - void applyRewrites(EditsReceiver &receiver); + void applyRewrites(EditsReceiver &receiver, bool adjustRemovals = true); void clearRewrites(); StringRef copyString(StringRef str) { return str.copy(StrAlloc); } Modified: vendor/clang/dist/include/clang/Frontend/FrontendActions.h ============================================================================== --- vendor/clang/dist/include/clang/Frontend/FrontendActions.h Tue May 2 18:30:20 2017 (r317684) +++ vendor/clang/dist/include/clang/Frontend/FrontendActions.h Tue May 2 18:30:45 2017 (r317685) @@ -99,8 +99,6 @@ class GenerateModuleAction : public ASTF CreateOutputFile(CompilerInstance &CI, StringRef InFile) = 0; protected: - bool BeginSourceFileAction(CompilerInstance &CI, StringRef Filename) override; - std::unique_ptr CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override; @@ -112,20 +110,11 @@ protected: }; class GenerateModuleFromModuleMapAction : public GenerateModuleAction { - clang::Module *Module = nullptr; - const FileEntry *ModuleMapForUniquing = nullptr; - bool IsSystem = false; - private: bool BeginSourceFileAction(CompilerInstance &CI, StringRef Filename) override; std::unique_ptr CreateOutputFile(CompilerInstance &CI, StringRef InFile) override; - *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 2 18:30:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B60A3D5BD29; Tue, 2 May 2017 18:30:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6AA8C2F0; Tue, 2 May 2017 18:30:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v42IUqVF000913; Tue, 2 May 2017 18:30:52 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v42IUq7W000912; Tue, 2 May 2017 18:30:52 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705021830.v42IUq7W000912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 2 May 2017 18:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317686 - vendor/clang/clang-trunk-r301939 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 18:30:53 -0000 Author: dim Date: Tue May 2 18:30:52 2017 New Revision: 317686 URL: https://svnweb.freebsd.org/changeset/base/317686 Log: Tag clang trunk r301939. Added: vendor/clang/clang-trunk-r301939/ - copied from r317685, vendor/clang/dist/ From owner-svn-src-all@freebsd.org Tue May 2 18:31:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7F49D5BD9A; Tue, 2 May 2017 18:31:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98AD2673; Tue, 2 May 2017 18:31:06 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v42IV5bA001085; Tue, 2 May 2017 18:31:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v42IV5tx001084; Tue, 2 May 2017 18:31:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705021831.v42IV5tx001084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 2 May 2017 18:31:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317689 - vendor/libc++/libc++-trunk-r301939 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 18:31:07 -0000 Author: dim Date: Tue May 2 18:31:05 2017 New Revision: 317689 URL: https://svnweb.freebsd.org/changeset/base/317689 Log: Tag libc++ trunk r301939. Added: vendor/libc++/libc++-trunk-r301939/ - copied from r317688, vendor/libc++/dist/ From owner-svn-src-all@freebsd.org Tue May 2 18:30:58 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FEA5D5BD3F; Tue, 2 May 2017 18:30:58 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5128366; Tue, 2 May 2017 18:30:57 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v42IUul9000981; Tue, 2 May 2017 18:30:56 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v42IUtnS000965; Tue, 2 May 2017 18:30:55 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705021830.v42IUtnS000965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 2 May 2017 18:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317687 - in vendor/compiler-rt/dist: cmake/Modules include/sanitizer include/xray lib/asan lib/sanitizer_common lib/scudo lib/tsan/go lib/tsan/rtl lib/tsan/tests/rtl lib/ubsan lib/xray... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 18:30:58 -0000 Author: dim Date: Tue May 2 18:30:55 2017 New Revision: 317687 URL: https://svnweb.freebsd.org/changeset/base/317687 Log: Vendor import of compiler-rt trunk r301939: https://llvm.org/svn/llvm-project/compiler-rt/trunk@301939 Added: vendor/compiler-rt/dist/lib/scudo/scudo_tls.h (contents, props changed) vendor/compiler-rt/dist/lib/scudo/scudo_tls_linux.cpp (contents, props changed) vendor/compiler-rt/dist/lib/scudo/scudo_tls_linux.h (contents, props changed) vendor/compiler-rt/dist/test/asan/TestCases/Linux/global-overflow-bfd.cc (contents, props changed) vendor/compiler-rt/dist/test/asan/TestCases/Linux/global-overflow-lld.cc (contents, props changed) vendor/compiler-rt/dist/test/asan/TestCases/Linux/globals-gc-sections-lld.cc (contents, props changed) vendor/compiler-rt/dist/test/asan/TestCases/small_memcpy_test.cc (contents, props changed) vendor/compiler-rt/dist/test/sanitizer_common/ios_commands/ vendor/compiler-rt/dist/test/sanitizer_common/ios_commands/iossim_compile.py (contents, props changed) vendor/compiler-rt/dist/test/sanitizer_common/ios_commands/iossim_env.py (contents, props changed) vendor/compiler-rt/dist/test/sanitizer_common/ios_commands/iossim_run.py (contents, props changed) Deleted: vendor/compiler-rt/dist/test/asan/TestCases/Linux/globals-gc-sections.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage-direct-activation.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage-direct-large.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage-direct.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/coverage-fork-direct.cc vendor/compiler-rt/dist/test/asan/TestCases/coverage-levels.cc Modified: vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake vendor/compiler-rt/dist/include/sanitizer/tsan_interface.h vendor/compiler-rt/dist/include/xray/xray_log_interface.h vendor/compiler-rt/dist/lib/asan/asan_globals.cc vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc vendor/compiler-rt/dist/lib/asan/asan_interface.inc vendor/compiler-rt/dist/lib/asan/asan_interface_internal.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.h vendor/compiler-rt/dist/lib/scudo/CMakeLists.txt vendor/compiler-rt/dist/lib/scudo/scudo_allocator.cpp vendor/compiler-rt/dist/lib/scudo/scudo_allocator.h vendor/compiler-rt/dist/lib/scudo/scudo_utils.cpp vendor/compiler-rt/dist/lib/scudo/scudo_utils.h vendor/compiler-rt/dist/lib/tsan/go/buildgo.sh vendor/compiler-rt/dist/lib/tsan/rtl/tsan_external.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_ann.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_linux.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_report.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_mutex.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_report.cc vendor/compiler-rt/dist/lib/tsan/tests/rtl/tsan_posix.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_diag.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc vendor/compiler-rt/dist/lib/xray/xray_log_interface.cc vendor/compiler-rt/dist/test/asan/CMakeLists.txt vendor/compiler-rt/dist/test/asan/TestCases/Darwin/dead-strip.c vendor/compiler-rt/dist/test/asan/TestCases/Darwin/dump_registers.cc vendor/compiler-rt/dist/test/asan/TestCases/Darwin/reexec-insert-libraries-env.cc vendor/compiler-rt/dist/test/asan/TestCases/Darwin/scribble.cc vendor/compiler-rt/dist/test/asan/TestCases/Darwin/unset-insert-libraries-on-exec.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/asan-sigbus.cpp vendor/compiler-rt/dist/test/asan/TestCases/Posix/current_allocated_bytes.cc vendor/compiler-rt/dist/test/asan/TestCases/Posix/fread_fwrite.cc vendor/compiler-rt/dist/test/asan/TestCases/coverage-disabled.cc vendor/compiler-rt/dist/test/asan/TestCases/initialization-bug.cc vendor/compiler-rt/dist/test/asan/TestCases/strtok.c vendor/compiler-rt/dist/test/asan/lit.cfg vendor/compiler-rt/dist/test/asan/lit.site.cfg.in vendor/compiler-rt/dist/test/lit.common.cfg vendor/compiler-rt/dist/test/lit.common.configured.in vendor/compiler-rt/dist/test/sanitizer_common/TestCases/sanitizer_coverage_symbolize.cc vendor/compiler-rt/dist/test/tsan/Darwin/xpc-cancel.mm vendor/compiler-rt/dist/test/tsan/Darwin/xpc-race.mm vendor/compiler-rt/dist/test/tsan/Darwin/xpc.mm vendor/compiler-rt/dist/test/tsan/ignore_lib1.cc vendor/compiler-rt/dist/test/tsan/ignore_lib5.cc vendor/compiler-rt/dist/test/ubsan/TestCases/Float/cast-overflow.cpp vendor/compiler-rt/dist/test/ubsan/TestCases/Misc/log-path_test.cc vendor/compiler-rt/dist/test/ubsan/TestCases/Misc/missing_return.cpp vendor/compiler-rt/dist/test/ubsan/TestCases/TypeCheck/misaligned.cpp Modified: vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake ============================================================================== --- vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake Tue May 2 18:30:52 2017 (r317686) +++ vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake Tue May 2 18:30:55 2017 (r317687) @@ -210,6 +210,14 @@ function(add_compiler_rt_runtime name ty set_target_properties(${libname} PROPERTIES IMPORT_PREFIX "") set_target_properties(${libname} PROPERTIES IMPORT_SUFFIX ".lib") endif() + if(APPLE) + # Ad-hoc sign the dylibs + add_custom_command(TARGET ${libname} + POST_BUILD + COMMAND codesign --sign - $ + WORKING_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR} + ) + endif() endif() install(TARGETS ${libname} ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} Modified: vendor/compiler-rt/dist/include/sanitizer/tsan_interface.h ============================================================================== --- vendor/compiler-rt/dist/include/sanitizer/tsan_interface.h Tue May 2 18:30:52 2017 (r317686) +++ vendor/compiler-rt/dist/include/sanitizer/tsan_interface.h Tue May 2 18:30:55 2017 (r317687) @@ -68,7 +68,8 @@ const unsigned __tsan_mutex_recursive_un void __tsan_mutex_create(void *addr, unsigned flags); // Annotate destruction of a mutex. -// Supported flags: none. +// Supported flags: +// - __tsan_mutex_linker_init void __tsan_mutex_destroy(void *addr, unsigned flags); // Annotate start of lock operation. Modified: vendor/compiler-rt/dist/include/xray/xray_log_interface.h ============================================================================== --- vendor/compiler-rt/dist/include/xray/xray_log_interface.h Tue May 2 18:30:52 2017 (r317686) +++ vendor/compiler-rt/dist/include/xray/xray_log_interface.h Tue May 2 18:30:55 2017 (r317687) @@ -10,7 +10,73 @@ // This file is a part of XRay, a function call tracing system. // // APIs for installing a new logging implementation. +// //===----------------------------------------------------------------------===// +/// +/// XRay allows users to implement their own logging handlers and install them +/// to replace the default runtime-controllable implementation that comes with +/// compiler-rt/xray. The "flight data recorder" (FDR) mode implementation uses +/// this API to install itself in an XRay-enabled binary. See +/// compiler-rt/lib/xray_fdr_logging.{h,cc} for details of that implementation. +/// +/// The high-level usage pattern for these APIs look like the following: +/// +/// // Before we try initializing the log implementation, we must set it as +/// // the log implementation. We provide the function pointers that define +/// // the various initialization, finalization, and other pluggable hooks +/// // that we need. +/// __xray_set_log_impl({...}); +/// +/// // Once that's done, we can now initialize the implementation. Each +/// // implementation has a chance to let users customize the implementation +/// // with a struct that their implementation supports. Roughly this might +/// // look like: +/// MyImplementationOptions opts; +/// opts.enable_feature = true; +/// ... +/// auto init_status = __xray_log_init( +/// BufferSize, MaxBuffers, &opts, sizeof opts); +/// if (init_status != XRayLogInitStatus::XRAY_LOG_INITIALIZED) { +/// // deal with the error here, if there is one. +/// } +/// +/// // When the log implementation has had the chance to initialize, we can +/// // now patch the sleds. +/// auto patch_status = __xray_patch(); +/// if (patch_status != XRayPatchingStatus::SUCCESS) { +/// // deal with the error here, if it is an error. +/// } +/// +/// // If we want to stop the implementation, we can then finalize it (before +/// // optionally flushing the log). +/// auto fin_status = __xray_log_finalize(); +/// if (fin_status != XRayLogInitStatus::XRAY_LOG_FINALIZED) { +/// // deal with the error here, if it is an error. +/// } +/// +/// // We can optionally wait before flushing the log to give other threads a +/// // chance to see that the implementation is already finalized. Also, at +/// // this point we can optionally unpatch the sleds to reduce overheads at +/// // runtime. +/// auto unpatch_status = __xray_unpatch(); +/// if (unpatch_status != XRayPatchingStatus::SUCCESS) { +// // deal with the error here, if it is an error. +// } +/// +/// // If there are logs or data to be flushed somewhere, we can do so only +/// // after we've finalized the log. Some implementations may not actually +/// // have anything to log (it might keep the data in memory, or periodically +/// // be logging the data anyway). +/// auto flush_status = __xray_log_flushLog(); +/// if (flush_status != XRayLogFlushStatus::XRAY_LOG_FLUSHED) { +/// // deal with the error here, if it is an error. +/// } +/// +/// +/// NOTE: Before calling __xray_patch() again, consider re-initializing the +/// implementation first. Some implementations might stay in an "off" state when +/// they are finalized, while some might be in an invalid/unknown state. +/// #ifndef XRAY_XRAY_LOG_INTERFACE_H #define XRAY_XRAY_LOG_INTERFACE_H @@ -19,36 +85,141 @@ extern "C" { +/// This enum defines the valid states in which the logging implementation can +/// be at. enum XRayLogInitStatus { + /// The default state is uninitialized, and in case there were errors in the + /// initialization, the implementation MUST return XRAY_LOG_UNINITIALIZED. XRAY_LOG_UNINITIALIZED = 0, + + /// Some implementations support multi-stage init (or asynchronous init), and + /// may return XRAY_LOG_INITIALIZING to signal callers of the API that + /// there's an ongoing initialization routine running. This allows + /// implementations to support concurrent threads attempting to initialize, + /// while only signalling success in one. XRAY_LOG_INITIALIZING = 1, + + /// When an implementation is done initializing, it MUST return + /// XRAY_LOG_INITIALIZED. When users call `__xray_patch()`, they are + /// guaranteed that the implementation installed with + /// `__xray_set_log_impl(...)` has been initialized. XRAY_LOG_INITIALIZED = 2, + + /// Some implementations might support multi-stage finalization (or + /// asynchronous finalization), and may return XRAY_LOG_FINALIZING to signal + /// callers of the API that there's an ongoing finalization routine running. + /// This allows implementations to support concurrent threads attempting to + /// finalize, while only signalling success/completion in one. XRAY_LOG_FINALIZING = 3, + + /// When an implementation is done finalizing, it MUST return + /// XRAY_LOG_FINALIZED. It is up to the implementation to determine what the + /// semantics of a finalized implementation is. Some implementations might + /// allow re-initialization once the log is finalized, while some might always + /// be on (and that finalization is a no-op). XRAY_LOG_FINALIZED = 4, }; +/// This enum allows an implementation to signal log flushing operations via +/// `__xray_log_flushLog()`, and the state of flushing the log. enum XRayLogFlushStatus { XRAY_LOG_NOT_FLUSHING = 0, XRAY_LOG_FLUSHING = 1, XRAY_LOG_FLUSHED = 2, }; +/// A valid XRay logging implementation MUST provide all of the function +/// pointers in XRayLogImpl when being installed through `__xray_set_log_impl`. +/// To be precise, ALL the functions pointers MUST NOT be nullptr. struct XRayLogImpl { + /// The log initialization routine provided by the implementation, always + /// provided with the following parameters: + /// + /// - buffer size + /// - maximum number of buffers + /// - a pointer to an argument struct that the implementation MUST handle + /// - the size of the argument struct + /// + /// See XRayLogInitStatus for details on what the implementation MUST return + /// when called. + /// + /// If the implementation needs to install handlers aside from the 0-argument + /// function call handler, it MUST do so in this initialization handler. + /// + /// See xray_interface.h for available handler installation routines. XRayLogInitStatus (*log_init)(size_t, size_t, void *, size_t); + + /// The log finalization routine provided by the implementation. + /// + /// See XRayLogInitStatus for details on what the implementation MUST return + /// when called. XRayLogInitStatus (*log_finalize)(); + + /// The 0-argument function call handler. XRay logging implementations MUST + /// always have a handler for function entry and exit events. In case the + /// implementation wants to support arg1 (or other future extensions to XRay + /// logging) those MUST be installed by the installed 'log_init' handler. void (*handle_arg0)(int32_t, XRayEntryType); + + /// The log implementation provided routine for when __xray_log_flushLog() is + /// called. + /// + /// See XRayLogFlushStatus for details on what the implementation MUST return + /// when called. XRayLogFlushStatus (*flush_log)(); }; +/// This function installs a new logging implementation that XRay will use. In +/// case there are any nullptr members in Impl, XRay will *uninstall any +/// existing implementations*. It does NOT patch the instrumentation sleds. +/// +/// NOTE: This function does NOT attempt to finalize the currently installed +/// implementation. Use with caution. +/// +/// It is guaranteed safe to call this function in the following states: +/// +/// - When the implementation is UNINITIALIZED. +/// - When the implementation is FINALIZED. +/// - When there is no current implementation installed. +/// +/// It is logging implementation defined what happens when this function is +/// called while in any other states. void __xray_set_log_impl(XRayLogImpl Impl); + +/// This function removes the currently installed implementation. It will also +/// uninstall any handlers that have been previously installed. It does NOT +/// unpatch the instrumentation sleds. +/// +/// NOTE: This function does NOT attempt to finalize the currently installed +/// implementation. Use with caution. +/// +/// It is guaranteed safe to call this function in the following states: +/// +/// - When the implementation is UNINITIALIZED. +/// - When the implementation is FINALIZED. +/// - When there is no current implementation installed. +/// +/// It is logging implementation defined what happens when this function is +/// called while in any other states. +void __xray_remove_log_impl(); + +/// Invokes the installed implementation initialization routine. See +/// XRayLogInitStatus for what the return values mean. XRayLogInitStatus __xray_log_init(size_t BufferSize, size_t MaxBuffers, void *Args, size_t ArgsSize); + +/// Invokes the installed implementation finalization routine. See +/// XRayLogInitStatus for what the return values mean. XRayLogInitStatus __xray_log_finalize(); + +/// Invokes the install implementation log flushing routine. See +/// XRayLogFlushStatus for what the return values mean. XRayLogFlushStatus __xray_log_flushLog(); } // extern "C" namespace __xray { + // Options used by the LLVM XRay FDR implementation. struct FDRLoggingOptions { bool ReportErrors = false; Modified: vendor/compiler-rt/dist/lib/asan/asan_globals.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_globals.cc Tue May 2 18:30:52 2017 (r317686) +++ vendor/compiler-rt/dist/lib/asan/asan_globals.cc Tue May 2 18:30:55 2017 (r317687) @@ -332,6 +332,26 @@ void __asan_unregister_image_globals(upt *flag = 0; } +void __asan_register_elf_globals(uptr *flag, void *start, void *stop) { + if (*flag) return; + if (!start) return; + CHECK_EQ(0, ((uptr)stop - (uptr)start) % sizeof(__asan_global)); + __asan_global *globals_start = (__asan_global*)start; + __asan_global *globals_stop = (__asan_global*)stop; + __asan_register_globals(globals_start, globals_stop - globals_start); + *flag = 1; +} + +void __asan_unregister_elf_globals(uptr *flag, void *start, void *stop) { + if (!*flag) return; + if (!start) return; + CHECK_EQ(0, ((uptr)stop - (uptr)start) % sizeof(__asan_global)); + __asan_global *globals_start = (__asan_global*)start; + __asan_global *globals_stop = (__asan_global*)stop; + __asan_unregister_globals(globals_start, globals_stop - globals_start); + *flag = 0; +} + // Register an array of globals. void __asan_register_globals(__asan_global *globals, uptr n) { if (!flags()->report_globals) return; Modified: vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc Tue May 2 18:30:52 2017 (r317686) +++ vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc Tue May 2 18:30:55 2017 (r317687) @@ -37,12 +37,19 @@ namespace __asan { // Return true if we can quickly decide that the region is unpoisoned. +// We assume that a redzone is at least 16 bytes. static inline bool QuickCheckForUnpoisonedRegion(uptr beg, uptr size) { if (size == 0) return true; if (size <= 32) return !AddressIsPoisoned(beg) && !AddressIsPoisoned(beg + size - 1) && !AddressIsPoisoned(beg + size / 2); + if (size <= 64) + return !AddressIsPoisoned(beg) && + !AddressIsPoisoned(beg + size / 4) && + !AddressIsPoisoned(beg + size - 1) && + !AddressIsPoisoned(beg + 3 * size / 4) && + !AddressIsPoisoned(beg + size / 2); return false; } Modified: vendor/compiler-rt/dist/lib/asan/asan_interface.inc ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_interface.inc Tue May 2 18:30:52 2017 (r317686) +++ vendor/compiler-rt/dist/lib/asan/asan_interface.inc Tue May 2 18:30:55 2017 (r317687) @@ -64,6 +64,7 @@ INTERFACE_FUNCTION(__asan_poison_stack_m INTERFACE_FUNCTION(__asan_print_accumulated_stats) INTERFACE_FUNCTION(__asan_region_is_poisoned) INTERFACE_FUNCTION(__asan_register_globals) +INTERFACE_FUNCTION(__asan_register_elf_globals) INTERFACE_FUNCTION(__asan_register_image_globals) INTERFACE_FUNCTION(__asan_report_error) INTERFACE_FUNCTION(__asan_report_exp_load1) @@ -149,6 +150,7 @@ INTERFACE_FUNCTION(__asan_unpoison_intra INTERFACE_FUNCTION(__asan_unpoison_memory_region) INTERFACE_FUNCTION(__asan_unpoison_stack_memory) INTERFACE_FUNCTION(__asan_unregister_globals) +INTERFACE_FUNCTION(__asan_unregister_elf_globals) INTERFACE_FUNCTION(__asan_unregister_image_globals) INTERFACE_FUNCTION(__asan_version_mismatch_check_v8) INTERFACE_FUNCTION(__sanitizer_finish_switch_fiber) Modified: vendor/compiler-rt/dist/lib/asan/asan_interface_internal.h ============================================================================== --- vendor/compiler-rt/dist/lib/asan/asan_interface_internal.h Tue May 2 18:30:52 2017 (r317686) +++ vendor/compiler-rt/dist/lib/asan/asan_interface_internal.h Tue May 2 18:30:55 2017 (r317687) @@ -67,6 +67,11 @@ extern "C" { SANITIZER_INTERFACE_ATTRIBUTE void __asan_unregister_image_globals(uptr *flag); + SANITIZER_INTERFACE_ATTRIBUTE + void __asan_register_elf_globals(uptr *flag, void *start, void *stop); + SANITIZER_INTERFACE_ATTRIBUTE + void __asan_unregister_elf_globals(uptr *flag, void *start, void *stop); + // These two functions should be called by the instrumented code. // 'globals' is an array of structures describing 'n' globals. SANITIZER_INTERFACE_ATTRIBUTE Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep.cc Tue May 2 18:30:52 2017 (r317686) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep.cc Tue May 2 18:30:55 2017 (r317687) @@ -84,7 +84,6 @@ class CoverageData { void AfterFork(int child_pid); void Extend(uptr npcs); void Add(uptr pc, u32 *guard); - void DumpAsBitSet(); void DumpOffsets(); void DumpAll(); @@ -156,6 +155,13 @@ void CoverageData::DirectOpen() { void CoverageData::Init() { pc_fd = kInvalidFd; + + if (!common_flags()->coverage) return; + Printf("**\n***\n***\n"); + Printf("**WARNING: this implementation of SanitizerCoverage is deprecated\n"); + Printf("**WARNING: and will be removed in future versions\n"); + Printf("**WARNING: See https://clang.llvm.org/docs/SanitizerCoverage.html\n"); + Printf("**\n***\n***\n"); } void CoverageData::Enable() { @@ -165,6 +171,8 @@ void CoverageData::Enable() { MmapNoReserveOrDie(sizeof(uptr) * kPcArrayMaxSize, "CovInit")); atomic_store(&pc_array_index, 0, memory_order_relaxed); if (common_flags()->coverage_direct) { + Report("coverage_direct=1 is deprecated, don't use it.\n"); + Die(); atomic_store(&pc_array_size, 0, memory_order_relaxed); } else { atomic_store(&pc_array_size, kPcArrayMaxSize, memory_order_relaxed); @@ -419,35 +427,6 @@ static fd_t CovOpenFile(InternalScopedSt return fd; } -void CoverageData::DumpAsBitSet() { - if (!common_flags()->coverage_bitset) return; - if (!size()) return; - InternalScopedBuffer out(size()); - InternalScopedString path(kMaxPathLength); - for (uptr m = 0; m < module_name_vec.size(); m++) { - uptr n_set_bits = 0; - auto r = module_name_vec[m]; - CHECK(r.copied_module_name); - CHECK_LE(r.beg, r.end); - CHECK_LE(r.end, size()); - for (uptr i = r.beg; i < r.end; i++) { - uptr pc = UnbundlePc(pc_array[i]); - out[i] = pc ? '1' : '0'; - if (pc) - n_set_bits++; - } - const char *base_name = StripModuleName(r.copied_module_name); - fd_t fd = CovOpenFile(&path, /* packed */false, base_name, "bitset-sancov"); - if (fd == kInvalidFd) return; - WriteToFile(fd, out.data() + r.beg, r.end - r.beg); - CloseFile(fd); - VReport(1, - " CovDump: bitset of %zd bits written for '%s', %zd bits are set\n", - r.end - r.beg, base_name, n_set_bits); - } -} - - void CoverageData::GetRangeOffsets(const NamedPcRange& r, Symbolizer* sym, InternalMmapVector* offsets) const { offsets->clear(); @@ -565,7 +544,6 @@ void CoverageData::DumpAll() { if (!coverage_enabled || common_flags()->coverage_direct) return; if (atomic_fetch_add(&dump_once_guard, 1, memory_order_relaxed)) return; - DumpAsBitSet(); DumpOffsets(); } Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc Tue May 2 18:30:52 2017 (r317686) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc Tue May 2 18:30:55 2017 (r317687) @@ -98,10 +98,6 @@ static void SanitizerDumpCoverage(const InternalFree(file_path); InternalFree(module_name); InternalFree(pcs); - - if (sancov_flags()->symbolize) { - Printf("TODO(aizatsky): call sancov to symbolize\n"); - } } // Collects trace-pc guard coverage. Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc Tue May 2 18:30:52 2017 (r317686) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.inc Tue May 2 18:30:55 2017 (r317687) @@ -142,12 +142,6 @@ COMMON_FLAG(bool, coverage_pcs, true, COMMON_FLAG(bool, coverage_order_pcs, false, "If true, the PCs will be dumped in the order they've" " appeared during the execution.") -COMMON_FLAG(bool, coverage_bitset, false, - "If set (and if 'coverage' is set too), the coverage information " - "will also be dumped as a bitset to a separate file.") -COMMON_FLAG(bool, coverage_counters, false, - "If set (and if 'coverage' is set too), the bitmap that corresponds" - " to coverage counters will be dumped.") COMMON_FLAG(bool, coverage_direct, SANITIZER_ANDROID, "If set, coverage information will be dumped directly to a memory " "mapped file. This way data is not lost even if the process is " Modified: vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.h ============================================================================== --- vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.h Tue May 2 18:30:52 2017 (r317686) +++ vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.h Tue May 2 18:30:55 2017 (r317687) @@ -88,6 +88,46 @@ bool LibraryNameIs(const char *full_name // Call cb for each region mapped by map. void ForEachMappedRegion(link_map *map, void (*cb)(const void *, uptr)); + +#if SANITIZER_ANDROID + +#if defined(__aarch64__) +# define __get_tls() \ + ({ void** __v; __asm__("mrs %0, tpidr_el0" : "=r"(__v)); __v; }) +#elif defined(__arm__) +# define __get_tls() \ + ({ void** __v; __asm__("mrc p15, 0, %0, c13, c0, 3" : "=r"(__v)); __v; }) +#elif defined(__mips__) +// On mips32r1, this goes via a kernel illegal instruction trap that's +// optimized for v1. +# define __get_tls() \ + ({ register void** __v asm("v1"); \ + __asm__(".set push\n" \ + ".set mips32r2\n" \ + "rdhwr %0,$29\n" \ + ".set pop\n" : "=r"(__v)); \ + __v; }) +#elif defined(__i386__) +# define __get_tls() \ + ({ void** __v; __asm__("movl %%gs:0, %0" : "=r"(__v)); __v; }) +#elif defined(__x86_64__) +# define __get_tls() \ + ({ void** __v; __asm__("mov %%fs:0, %0" : "=r"(__v)); __v; }) +#else +#error "Unsupported architecture." +#endif + +// The Android Bionic team has allocated a TLS slot for TSan starting with N, +// given that Android currently doesn't support ELF TLS. It is used to store +// Sanitizers thread specific data. +static const int TLS_SLOT_TSAN = 8; + +ALWAYS_INLINE uptr *get_android_tls_ptr() { + return reinterpret_cast(&__get_tls()[TLS_SLOT_TSAN]); +} + +#endif // SANITIZER_ANDROID + } // namespace __sanitizer #endif // SANITIZER_FREEBSD || SANITIZER_LINUX Modified: vendor/compiler-rt/dist/lib/scudo/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/scudo/CMakeLists.txt Tue May 2 18:30:52 2017 (r317686) +++ vendor/compiler-rt/dist/lib/scudo/CMakeLists.txt Tue May 2 18:30:55 2017 (r317687) @@ -14,6 +14,7 @@ set(SCUDO_SOURCES scudo_interceptors.cpp scudo_new_delete.cpp scudo_termination.cpp + scudo_tls_linux.cpp scudo_utils.cpp) # Enable the SSE 4.2 instruction set for scudo_crc32.cpp, if available. Modified: vendor/compiler-rt/dist/lib/scudo/scudo_allocator.cpp ============================================================================== --- vendor/compiler-rt/dist/lib/scudo/scudo_allocator.cpp Tue May 2 18:30:52 2017 (r317686) +++ vendor/compiler-rt/dist/lib/scudo/scudo_allocator.cpp Tue May 2 18:30:55 2017 (r317687) @@ -15,6 +15,7 @@ //===----------------------------------------------------------------------===// #include "scudo_allocator.h" +#include "scudo_tls.h" #include "scudo_utils.h" #include "sanitizer_common/sanitizer_allocator_interface.h" @@ -26,44 +27,6 @@ namespace __scudo { -#if SANITIZER_CAN_USE_ALLOCATOR64 -const uptr AllocatorSpace = ~0ULL; -const uptr AllocatorSize = 0x40000000000ULL; -typedef DefaultSizeClassMap SizeClassMap; -struct AP { - static const uptr kSpaceBeg = AllocatorSpace; - static const uptr kSpaceSize = AllocatorSize; - static const uptr kMetadataSize = 0; - typedef __scudo::SizeClassMap SizeClassMap; - typedef NoOpMapUnmapCallback MapUnmapCallback; - static const uptr kFlags = - SizeClassAllocator64FlagMasks::kRandomShuffleChunks; -}; -typedef SizeClassAllocator64 PrimaryAllocator; -#else -// Currently, the 32-bit Sanitizer allocator has not yet benefited from all the -// security improvements brought to the 64-bit one. This makes the 32-bit -// version of Scudo slightly less toughened. -static const uptr RegionSizeLog = 20; -static const uptr NumRegions = SANITIZER_MMAP_RANGE_SIZE >> RegionSizeLog; -# if SANITIZER_WORDSIZE == 32 -typedef FlatByteMap ByteMap; -# elif SANITIZER_WORDSIZE == 64 -typedef TwoLevelByteMap<(NumRegions >> 12), 1 << 12> ByteMap; -# endif // SANITIZER_WORDSIZE -typedef DefaultSizeClassMap SizeClassMap; -typedef SizeClassAllocator32<0, SANITIZER_MMAP_RANGE_SIZE, 0, SizeClassMap, - RegionSizeLog, ByteMap> PrimaryAllocator; -#endif // SANITIZER_CAN_USE_ALLOCATOR64 - -typedef SizeClassAllocatorLocalCache AllocatorCache; -typedef ScudoLargeMmapAllocator SecondaryAllocator; -typedef CombinedAllocator - ScudoBackendAllocator; - -static ScudoBackendAllocator &getBackendAllocator(); - -static thread_local Xorshift128Plus Prng; // Global static cookie, initialized at start-up. static uptr Cookie; @@ -88,6 +51,8 @@ INLINE u32 computeCRC32(u32 Crc, uptr Da #endif // defined(__SSE4_2__) } +static ScudoBackendAllocator &getBackendAllocator(); + struct ScudoChunk : UnpackedHeader { // We can't use the offset member of the chunk itself, as we would double // fetch it without any warranty that it wouldn't have been tampered. To @@ -188,32 +153,44 @@ ScudoChunk *getScudoChunk(uptr UserBeg) return reinterpret_cast(UserBeg - AlignedChunkHeaderSize); } -static bool ScudoInitIsRunning = false; +struct AllocatorOptions { + u32 QuarantineSizeMb; + u32 ThreadLocalQuarantineSizeKb; + bool MayReturnNull; + s32 ReleaseToOSIntervalMs; + bool DeallocationTypeMismatch; + bool DeleteSizeMismatch; + bool ZeroContents; -static pthread_once_t GlobalInited = PTHREAD_ONCE_INIT; -static pthread_key_t PThreadKey; + void setFrom(const Flags *f, const CommonFlags *cf); + void copyTo(Flags *f, CommonFlags *cf) const; +}; + +void AllocatorOptions::setFrom(const Flags *f, const CommonFlags *cf) { + MayReturnNull = cf->allocator_may_return_null; + ReleaseToOSIntervalMs = cf->allocator_release_to_os_interval_ms; + QuarantineSizeMb = f->QuarantineSizeMb; + ThreadLocalQuarantineSizeKb = f->ThreadLocalQuarantineSizeKb; + DeallocationTypeMismatch = f->DeallocationTypeMismatch; + DeleteSizeMismatch = f->DeleteSizeMismatch; + ZeroContents = f->ZeroContents; +} -static thread_local bool ThreadInited = false; -static thread_local bool ThreadTornDown = false; -static thread_local AllocatorCache Cache; - -static void teardownThread(void *p) { - uptr v = reinterpret_cast(p); - // The glibc POSIX thread-local-storage deallocation routine calls user - // provided destructors in a loop of PTHREAD_DESTRUCTOR_ITERATIONS. - // We want to be called last since other destructors might call free and the - // like, so we wait until PTHREAD_DESTRUCTOR_ITERATIONS before draining the - // quarantine and swallowing the cache. - if (v < PTHREAD_DESTRUCTOR_ITERATIONS) { - pthread_setspecific(PThreadKey, reinterpret_cast(v + 1)); - return; - } - drainQuarantine(); - getBackendAllocator().DestroyCache(&Cache); - ThreadTornDown = true; +void AllocatorOptions::copyTo(Flags *f, CommonFlags *cf) const { + cf->allocator_may_return_null = MayReturnNull; + cf->allocator_release_to_os_interval_ms = ReleaseToOSIntervalMs; + f->QuarantineSizeMb = QuarantineSizeMb; + f->ThreadLocalQuarantineSizeKb = ThreadLocalQuarantineSizeKb; + f->DeallocationTypeMismatch = DeallocationTypeMismatch; + f->DeleteSizeMismatch = DeleteSizeMismatch; + f->ZeroContents = ZeroContents; } -static void initInternal() { +static void initScudoInternal(const AllocatorOptions &Options); + +static bool ScudoInitIsRunning = false; + +void initScudo() { SanitizerToolName = "Scudo"; CHECK(!ScudoInitIsRunning && "Scudo init calls itself!"); ScudoInitIsRunning = true; @@ -227,25 +204,13 @@ static void initInternal() { AllocatorOptions Options; Options.setFrom(getFlags(), common_flags()); - initAllocator(Options); + initScudoInternal(Options); - MaybeStartBackgroudThread(); + // TODO(kostyak): determine if MaybeStartBackgroudThread could be of some use. ScudoInitIsRunning = false; } -static void initGlobal() { - pthread_key_create(&PThreadKey, teardownThread); - initInternal(); -} - -static void NOINLINE initThread() { - pthread_once(&GlobalInited, initGlobal); - pthread_setspecific(PThreadKey, reinterpret_cast(1)); - getBackendAllocator().InitCache(&Cache); - ThreadInited = true; -} - struct QuarantineCallback { explicit QuarantineCallback(AllocatorCache *Cache) : Cache_(Cache) {} @@ -278,26 +243,20 @@ struct QuarantineCallback { typedef Quarantine ScudoQuarantine; typedef ScudoQuarantine::Cache ScudoQuarantineCache; -static thread_local ScudoQuarantineCache ThreadQuarantineCache; +COMPILER_CHECK(sizeof(ScudoQuarantineCache) <= + sizeof(ScudoThreadContext::QuarantineCachePlaceHolder)); -void AllocatorOptions::setFrom(const Flags *f, const CommonFlags *cf) { - MayReturnNull = cf->allocator_may_return_null; - ReleaseToOSIntervalMs = cf->allocator_release_to_os_interval_ms; - QuarantineSizeMb = f->QuarantineSizeMb; - ThreadLocalQuarantineSizeKb = f->ThreadLocalQuarantineSizeKb; - DeallocationTypeMismatch = f->DeallocationTypeMismatch; - DeleteSizeMismatch = f->DeleteSizeMismatch; - ZeroContents = f->ZeroContents; +AllocatorCache *getAllocatorCache(ScudoThreadContext *ThreadContext) { + return &ThreadContext->Cache; } -void AllocatorOptions::copyTo(Flags *f, CommonFlags *cf) const { - cf->allocator_may_return_null = MayReturnNull; - cf->allocator_release_to_os_interval_ms = ReleaseToOSIntervalMs; - f->QuarantineSizeMb = QuarantineSizeMb; - f->ThreadLocalQuarantineSizeKb = ThreadLocalQuarantineSizeKb; - f->DeallocationTypeMismatch = DeallocationTypeMismatch; - f->DeleteSizeMismatch = DeleteSizeMismatch; - f->ZeroContents = ZeroContents; +ScudoQuarantineCache *getQuarantineCache(ScudoThreadContext *ThreadContext) { + return reinterpret_cast< + ScudoQuarantineCache *>(ThreadContext->QuarantineCachePlaceHolder); +} + +Xorshift128Plus *getPrng(ScudoThreadContext *ThreadContext) { + return &ThreadContext->Prng; } struct ScudoAllocator { @@ -313,6 +272,7 @@ struct ScudoAllocator { StaticSpinMutex FallbackMutex; AllocatorCache FallbackAllocatorCache; ScudoQuarantineCache FallbackQuarantineCache; + Xorshift128Plus FallbackPrng; bool DeallocationTypeMismatch; bool ZeroContents; @@ -361,13 +321,13 @@ struct ScudoAllocator { static_cast(Options.QuarantineSizeMb) << 20, static_cast(Options.ThreadLocalQuarantineSizeKb) << 10); BackendAllocator.InitCache(&FallbackAllocatorCache); - Cookie = Prng.getNext(); + FallbackPrng.initFromURandom(); + Cookie = FallbackPrng.getNext(); } // Helper function that checks for a valid Scudo chunk. nullptr isn't. bool isValidPointer(const void *UserPtr) { - if (UNLIKELY(!ThreadInited)) - initThread(); + initThreadMaybe(); if (!UserPtr) return false; uptr UserBeg = reinterpret_cast(UserPtr); @@ -379,8 +339,7 @@ struct ScudoAllocator { // Allocates a chunk. void *allocate(uptr Size, uptr Alignment, AllocType Type, bool ForceZeroContents = false) { - if (UNLIKELY(!ThreadInited)) - initThread(); + initThreadMaybe(); if (UNLIKELY(!IsPowerOfTwo(Alignment))) { dieWithMessage("ERROR: alignment is not a power of 2\n"); } @@ -407,11 +366,16 @@ struct ScudoAllocator { bool FromPrimary = PrimaryAllocator::CanAllocate(NeededSize, MinAlignment); void *Ptr; + uptr Salt; uptr AllocationAlignment = FromPrimary ? MinAlignment : Alignment; - if (LIKELY(!ThreadTornDown)) { - Ptr = BackendAllocator.Allocate(&Cache, NeededSize, AllocationAlignment); + ScudoThreadContext *ThreadContext = getThreadContext(); + if (LIKELY(ThreadContext)) { + Salt = getPrng(ThreadContext)->getNext(); + Ptr = BackendAllocator.Allocate(getAllocatorCache(ThreadContext), + NeededSize, AllocationAlignment); } else { SpinMutexLock l(&FallbackMutex); + Salt = FallbackPrng.getNext(); Ptr = BackendAllocator.Allocate(&FallbackAllocatorCache, NeededSize, AllocationAlignment); } @@ -453,7 +417,7 @@ struct ScudoAllocator { if (TrailingBytes) Header.SizeOrUnusedBytes = PageSize - TrailingBytes; } - Header.Salt = static_cast(Prng.getNext()); + Header.Salt = static_cast(Salt); getScudoChunk(UserBeg)->storeHeader(&Header); void *UserPtr = reinterpret_cast(UserBeg); // if (&__sanitizer_malloc_hook) __sanitizer_malloc_hook(UserPtr, Size); @@ -462,16 +426,17 @@ struct ScudoAllocator { // Place a chunk in the quarantine. In the event of a zero-sized quarantine, // we directly deallocate the chunk, otherwise the flow would lead to the - // chunk being checksummed twice, once before Put and once in Recycle, with - // no additional security value. + // chunk being loaded (and checked) twice, and stored (and checksummed) once, + // with no additional security value. void quarantineOrDeallocateChunk(ScudoChunk *Chunk, UnpackedHeader *Header, uptr Size) { bool BypassQuarantine = (AllocatorQuarantine.GetCacheSize() == 0); if (BypassQuarantine) { Chunk->eraseHeader(); void *Ptr = Chunk->getAllocBeg(Header); - if (LIKELY(!ThreadTornDown)) { - getBackendAllocator().Deallocate(&Cache, Ptr); + ScudoThreadContext *ThreadContext = getThreadContext(); + if (LIKELY(ThreadContext)) { + getBackendAllocator().Deallocate(getAllocatorCache(ThreadContext), Ptr); } else { SpinMutexLock Lock(&FallbackMutex); getBackendAllocator().Deallocate(&FallbackAllocatorCache, Ptr); @@ -480,9 +445,12 @@ struct ScudoAllocator { UnpackedHeader NewHeader = *Header; NewHeader.State = ChunkQuarantine; Chunk->compareExchangeHeader(&NewHeader, Header); - if (LIKELY(!ThreadTornDown)) { - AllocatorQuarantine.Put(&ThreadQuarantineCache, - QuarantineCallback(&Cache), Chunk, Size); + ScudoThreadContext *ThreadContext = getThreadContext(); + if (LIKELY(ThreadContext)) { + AllocatorQuarantine.Put(getQuarantineCache(ThreadContext), + QuarantineCallback( + getAllocatorCache(ThreadContext)), + Chunk, Size); } else { SpinMutexLock l(&FallbackMutex); AllocatorQuarantine.Put(&FallbackQuarantineCache, @@ -495,8 +463,7 @@ struct ScudoAllocator { // Deallocates a Chunk, which means adding it to the delayed free list (or // Quarantine). void deallocate(void *UserPtr, uptr DeleteSize, AllocType Type) { - if (UNLIKELY(!ThreadInited)) - initThread(); + initThreadMaybe(); // if (&__sanitizer_free_hook) __sanitizer_free_hook(UserPtr); if (!UserPtr) return; @@ -542,8 +509,7 @@ struct ScudoAllocator { // Reallocates a chunk. We can save on a new allocation if the new requested // size still fits in the chunk. void *reallocate(void *OldPtr, uptr NewSize) { - if (UNLIKELY(!ThreadInited)) - initThread(); + initThreadMaybe(); uptr UserBeg = reinterpret_cast(OldPtr); if (UNLIKELY(!IsAligned(UserBeg, MinAlignment))) { dieWithMessage("ERROR: attempted to reallocate a chunk not properly " @@ -585,8 +551,7 @@ struct ScudoAllocator { // Helper function that returns the actual usable size of a chunk. uptr getUsableSize(const void *Ptr) { - if (UNLIKELY(!ThreadInited)) - initThread(); + initThreadMaybe(); if (!Ptr) return 0; uptr UserBeg = reinterpret_cast(Ptr); @@ -602,22 +567,22 @@ struct ScudoAllocator { } void *calloc(uptr NMemB, uptr Size) { - if (UNLIKELY(!ThreadInited)) - initThread(); + initThreadMaybe(); uptr Total = NMemB * Size; if (Size != 0 && Total / Size != NMemB) // Overflow check return BackendAllocator.ReturnNullOrDieOnBadRequest(); return allocate(Total, MinAlignment, FromMalloc, true); } - void drainQuarantine() { - AllocatorQuarantine.Drain(&ThreadQuarantineCache, - QuarantineCallback(&Cache)); + void commitBack(ScudoThreadContext *ThreadContext) { + AllocatorCache *Cache = getAllocatorCache(ThreadContext); + AllocatorQuarantine.Drain(getQuarantineCache(ThreadContext), + QuarantineCallback(Cache)); + BackendAllocator.DestroyCache(Cache); } uptr getStats(AllocatorStat StatType) { - if (UNLIKELY(!ThreadInited)) - initThread(); + initThreadMaybe(); uptr stats[AllocatorStatCount]; BackendAllocator.GetStats(stats); return stats[StatType]; @@ -630,12 +595,18 @@ static ScudoBackendAllocator &getBackend return Instance.BackendAllocator; } -void initAllocator(const AllocatorOptions &Options) { +static void initScudoInternal(const AllocatorOptions &Options) { Instance.init(Options); } -void drainQuarantine() { - Instance.drainQuarantine(); +void ScudoThreadContext::init() { + getBackendAllocator().InitCache(&Cache); + Prng.initFromURandom(); + memset(QuarantineCachePlaceHolder, 0, sizeof(QuarantineCachePlaceHolder)); +} + +void ScudoThreadContext::commitBack() { + Instance.commitBack(this); } void *scudoMalloc(uptr Size, AllocType Type) { Modified: vendor/compiler-rt/dist/lib/scudo/scudo_allocator.h ============================================================================== --- vendor/compiler-rt/dist/lib/scudo/scudo_allocator.h Tue May 2 18:30:52 2017 (r317686) +++ vendor/compiler-rt/dist/lib/scudo/scudo_allocator.h Tue May 2 18:30:55 2017 (r317687) @@ -53,7 +53,7 @@ struct UnpackedHeader { u64 Offset : 16; // Offset from the beginning of the backend // allocation to the beginning of the chunk // itself, in multiples of MinAlignment. See - /// comment about its maximum value and in init(). + // comment about its maximum value and in init(). u64 Salt : 8; }; @@ -62,7 +62,7 @@ COMPILER_CHECK(sizeof(UnpackedHeader) == // Minimum alignment of 8 bytes for 32-bit, 16 for 64-bit const uptr MinAlignmentLog = FIRST_32_SECOND_64(3, 4); -const uptr MaxAlignmentLog = 24; // 16 MB +const uptr MaxAlignmentLog = 24; // 16 MB const uptr MinAlignment = 1 << MinAlignmentLog; const uptr MaxAlignment = 1 << MaxAlignmentLog; @@ -70,21 +70,44 @@ const uptr ChunkHeaderSize = sizeof(Pack const uptr AlignedChunkHeaderSize = (ChunkHeaderSize + MinAlignment - 1) & ~(MinAlignment - 1); -struct AllocatorOptions { - u32 QuarantineSizeMb; - u32 ThreadLocalQuarantineSizeKb; - bool MayReturnNull; - s32 ReleaseToOSIntervalMs; - bool DeallocationTypeMismatch; - bool DeleteSizeMismatch; - bool ZeroContents; - - void setFrom(const Flags *f, const CommonFlags *cf); - void copyTo(Flags *f, CommonFlags *cf) const; +#if SANITIZER_CAN_USE_ALLOCATOR64 +const uptr AllocatorSpace = ~0ULL; +const uptr AllocatorSize = 0x40000000000ULL; // 4TB. +typedef DefaultSizeClassMap SizeClassMap; +struct AP { + static const uptr kSpaceBeg = AllocatorSpace; + static const uptr kSpaceSize = AllocatorSize; + static const uptr kMetadataSize = 0; + typedef __scudo::SizeClassMap SizeClassMap; + typedef NoOpMapUnmapCallback MapUnmapCallback; + static const uptr kFlags = + SizeClassAllocator64FlagMasks::kRandomShuffleChunks; }; +typedef SizeClassAllocator64 PrimaryAllocator; +#else +// Currently, the 32-bit Sanitizer allocator has not yet benefited from all the +// security improvements brought to the 64-bit one. This makes the 32-bit +// version of Scudo slightly less toughened. +static const uptr RegionSizeLog = 20; +static const uptr NumRegions = SANITIZER_MMAP_RANGE_SIZE >> RegionSizeLog; +# if SANITIZER_WORDSIZE == 32 +typedef FlatByteMap ByteMap; +# elif SANITIZER_WORDSIZE == 64 +typedef TwoLevelByteMap<(NumRegions >> 12), 1 << 12> ByteMap; +# endif // SANITIZER_WORDSIZE +typedef DefaultSizeClassMap SizeClassMap; +typedef SizeClassAllocator32<0, SANITIZER_MMAP_RANGE_SIZE, 0, SizeClassMap, + RegionSizeLog, ByteMap> PrimaryAllocator; +#endif // SANITIZER_CAN_USE_ALLOCATOR64 + +#include "scudo_allocator_secondary.h" -void initAllocator(const AllocatorOptions &options); -void drainQuarantine(); +typedef SizeClassAllocatorLocalCache AllocatorCache; +typedef ScudoLargeMmapAllocator SecondaryAllocator; +typedef CombinedAllocator + ScudoBackendAllocator; + +void initScudo(); void *scudoMalloc(uptr Size, AllocType Type); void scudoFree(void *Ptr, AllocType Type); @@ -98,8 +121,6 @@ int scudoPosixMemalign(void **MemPtr, up void *scudoAlignedAlloc(uptr Alignment, uptr Size); uptr scudoMallocUsableSize(void *Ptr); -#include "scudo_allocator_secondary.h" - } // namespace __scudo #endif // SCUDO_ALLOCATOR_H_ Added: vendor/compiler-rt/dist/lib/scudo/scudo_tls.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/lib/scudo/scudo_tls.h Tue May 2 18:30:55 2017 (r317687) @@ -0,0 +1,40 @@ +//===-- scudo_tls.h ---------------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +/// +/// Scudo thread local structure definition. +/// Implementation will differ based on the thread local storage primitives +/// offered by the underlying platform. +/// +//===----------------------------------------------------------------------===// + +#ifndef SCUDO_TLS_H_ +#define SCUDO_TLS_H_ + +#include "scudo_allocator.h" +#include "scudo_utils.h" + +namespace __scudo { + +struct ALIGNED(64) ScudoThreadContext { + public: + AllocatorCache Cache; + Xorshift128Plus Prng; + uptr QuarantineCachePlaceHolder[4]; + void init(); + void commitBack(); +}; + +void initThread(); + +// Fastpath functions are defined in the following platform specific headers. +#include "scudo_tls_linux.h" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 2 18:31:03 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36B21D5BD70; Tue, 2 May 2017 18:31:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D74A75DF; Tue, 2 May 2017 18:31:02 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v42IV1VI001037; Tue, 2 May 2017 18:31:01 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v42IV1xB001036; Tue, 2 May 2017 18:31:01 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705021831.v42IV1xB001036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 2 May 2017 18:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317688 - vendor/compiler-rt/compiler-rt-trunk-r301939 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 18:31:03 -0000 Author: dim Date: Tue May 2 18:31:01 2017 New Revision: 317688 URL: https://svnweb.freebsd.org/changeset/base/317688 Log: Tag compiler-rt trunk r301939. Added: vendor/compiler-rt/compiler-rt-trunk-r301939/ - copied from r317687, vendor/compiler-rt/dist/ From owner-svn-src-all@freebsd.org Tue May 2 18:31:12 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E193D5BDE2; Tue, 2 May 2017 18:31:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B4F6275B; Tue, 2 May 2017 18:31:11 +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 v42IVAQ7001149; Tue, 2 May 2017 18:31:10 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v42IV9Qi001131; Tue, 2 May 2017 18:31:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201705021831.v42IV9Qi001131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 2 May 2017 18:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r317690 - in vendor/lld/dist: COFF ELF docs test/COFF test/COFF/Inputs test/ELF test/ELF/Inputs test/ELF/linkerscript X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 May 2017 18:31:12 -0000 Author: dim Date: Tue May 2 18:31:09 2017 New Revision: 317690 URL: https://svnweb.freebsd.org/changeset/base/317690 Log: Vendor import of lld trunk r301939: https://llvm.org/svn/llvm-project/lld/trunk@301939 Added: vendor/lld/dist/test/COFF/Inputs/constant-import.s (contents, props changed) vendor/lld/dist/test/COFF/constant.test vendor/lld/dist/test/COFF/icf-data.test vendor/lld/dist/test/ELF/Inputs/eh-frame-end.s (contents, props changed) vendor/lld/dist/test/ELF/debug-gnu-pubnames.s (contents, props changed) vendor/lld/dist/test/ELF/eh-frame-begin-end.s (contents, props changed) vendor/lld/dist/test/ELF/linkerscript/section-metadata.s (contents, props changed) Modified: vendor/lld/dist/COFF/Chunks.cpp vendor/lld/dist/COFF/Error.cpp vendor/lld/dist/COFF/ICF.cpp vendor/lld/dist/COFF/InputFiles.cpp vendor/lld/dist/COFF/InputFiles.h vendor/lld/dist/COFF/MapFile.cpp vendor/lld/dist/ELF/Config.h vendor/lld/dist/ELF/Driver.cpp vendor/lld/dist/ELF/Driver.h vendor/lld/dist/ELF/Error.cpp vendor/lld/dist/ELF/InputFiles.cpp vendor/lld/dist/ELF/InputFiles.h vendor/lld/dist/ELF/InputSection.cpp vendor/lld/dist/ELF/LTO.cpp vendor/lld/dist/ELF/LinkerScript.cpp vendor/lld/dist/ELF/LinkerScript.h vendor/lld/dist/ELF/MapFile.cpp vendor/lld/dist/ELF/Options.td vendor/lld/dist/ELF/OutputSections.cpp vendor/lld/dist/ELF/OutputSections.h vendor/lld/dist/ELF/Strings.h vendor/lld/dist/ELF/SymbolTable.cpp vendor/lld/dist/ELF/SyntheticSections.cpp vendor/lld/dist/ELF/Writer.cpp vendor/lld/dist/docs/index.rst vendor/lld/dist/test/COFF/lldmap.test vendor/lld/dist/test/ELF/abs-conflict.s vendor/lld/dist/test/ELF/driver-access.test vendor/lld/dist/test/ELF/gdb-index.s vendor/lld/dist/test/ELF/linkerscript/sections.s vendor/lld/dist/test/ELF/map-file.s vendor/lld/dist/test/ELF/relocation-in-merge.s Modified: vendor/lld/dist/COFF/Chunks.cpp ============================================================================== --- vendor/lld/dist/COFF/Chunks.cpp Tue May 2 18:31:05 2017 (r317689) +++ vendor/lld/dist/COFF/Chunks.cpp Tue May 2 18:31:09 2017 (r317690) @@ -326,41 +326,38 @@ void SEHTableChunk::writeTo(uint8_t *Buf // usually loaded to that address. However, if there's already another // DLL that overlaps, the loader has to relocate it. To do that, DLLs // contain .reloc sections which contain offsets that need to be fixed -// up at runtime. If the loader find that a DLL cannot be loaded to its +// up at runtime. If the loader finds that a DLL cannot be loaded to its // desired base address, it loads it to somewhere else, and add - to each offset that is -// specified by .reloc section. +// specified by the .reloc section. In ELF terms, .reloc sections +// contain relative relocations in REL format (as opposed to RELA.) // -// In ELF terms, .reloc sections contain arrays of relocation offsets. -// All these offsets in the section are implicitly R_*_RELATIVE, and -// addends are read from section contents (so it is REL as opposed to -// RELA). +// This already significantly reduces the size of relocations compared +// to ELF .rel.dyn, but Windows does more to reduce it (probably because +// it was invented for PCs in the late '80s or early '90s.) Offsets in +// .reloc are grouped by page where the page size is 12 bits, and +// offsets sharing the same page address are stored consecutively to +// represent them with less space. This is very similar to the page +// table which is grouped by (multiple stages of) pages. // -// This already reduce the size of relocations to 1/3 compared to ELF -// .dynrel, but Windows does more to reduce it (probably because it was -// invented for PCs in the late '80s or early '90s.) Offsets in .reloc -// are grouped by page where page size is 16 bits, and offsets sharing -// the same page address are stored consecutively to represent them with -// less space. This is a very similar to the page table which is grouped -// by (multiple stages of) pages. -// -// For example, let's say we have 0x00030, 0x00500, 0x01000, 0x01100, -// 0x20004, and 0x20008 in a .reloc section. In the section, they are -// represented like this: +// For example, let's say we have 0x00030, 0x00500, 0x00700, 0x00A00, +// 0x20004, and 0x20008 in a .reloc section for x64. The uppermost 4 +// bits have a type IMAGE_REL_BASED_DIR64 or 0xA. In the section, they +// are represented like this: // // 0x00000 -- page address (4 bytes) // 16 -- size of this block (4 bytes) -// 0x0030 -- entries (2 bytes each) -// 0x0500 -// 0x1000 -// 0x1100 +// 0xA030 -- entries (2 bytes each) +// 0xA500 +// 0xA700 +// 0xAA00 // 0x20000 -- page address (4 bytes) // 12 -- size of this block (4 bytes) -// 0x0004 -- entries (2 bytes each) -// 0x0008 +// 0xA004 -- entries (2 bytes each) +// 0xA008 // -// Usually we have a lot of relocatinos for each page, so the number of -// bytes for one .reloc entry is close to 2 bytes. +// Usually we have a lot of relocations for each page, so the number of +// bytes for one .reloc entry is close to 2 bytes on average. BaserelChunk::BaserelChunk(uint32_t Page, Baserel *Begin, Baserel *End) { // Block header consists of 4 byte page RVA and 4 byte block size. // Each entry is 2 byte. Last entry may be padding. Modified: vendor/lld/dist/COFF/Error.cpp ============================================================================== --- vendor/lld/dist/COFF/Error.cpp Tue May 2 18:31:05 2017 (r317689) +++ vendor/lld/dist/COFF/Error.cpp Tue May 2 18:31:09 2017 (r317690) @@ -59,6 +59,7 @@ void log(const Twine &Msg) { if (Config->Verbose) { std::lock_guard Lock(Mu); outs() << Argv0 << ": " << Msg << "\n"; + outs().flush(); } } Modified: vendor/lld/dist/COFF/ICF.cpp ============================================================================== --- vendor/lld/dist/COFF/ICF.cpp Tue May 2 18:31:05 2017 (r317689) +++ vendor/lld/dist/COFF/ICF.cpp Tue May 2 18:31:09 2017 (r317690) @@ -71,10 +71,18 @@ uint32_t ICF::getHash(SectionChunk *C) { } // Returns true if section S is subject of ICF. +// +// Microsoft's documentation +// (https://msdn.microsoft.com/en-us/library/bxwfs976.aspx; visited April +// 2017) says that /opt:icf folds both functions and read-only data. +// Despite that, the MSVC linker folds only functions. We found +// a few instances of programs that are not safe for data merging. +// Therefore, we merge only functions just like the MSVC tool. bool ICF::isEligible(SectionChunk *C) { bool Global = C->Sym && C->Sym->isExternal(); + bool Executable = C->getPermissions() & llvm::COFF::IMAGE_SCN_MEM_EXECUTE; bool Writable = C->getPermissions() & llvm::COFF::IMAGE_SCN_MEM_WRITE; - return C->isCOMDAT() && C->isLive() && Global && !Writable; + return C->isCOMDAT() && C->isLive() && Global && Executable && !Writable; } // Split a range into smaller ranges by recoloring sections Modified: vendor/lld/dist/COFF/InputFiles.cpp ============================================================================== --- vendor/lld/dist/COFF/InputFiles.cpp Tue May 2 18:31:05 2017 (r317689) +++ vendor/lld/dist/COFF/InputFiles.cpp Tue May 2 18:31:09 2017 (r317690) @@ -327,6 +327,9 @@ void ImportFile::parse() { ImpSym = cast( Symtab->addImportData(ImpName, this)->body()); + if (Hdr->getType() == llvm::COFF::IMPORT_CONST) + ConstSym = + cast(Symtab->addImportData(Name, this)->body()); // If type is function, we need to create a thunk which jump to an // address pointed by the __imp_ symbol. (This allows you to call Modified: vendor/lld/dist/COFF/InputFiles.h ============================================================================== --- vendor/lld/dist/COFF/InputFiles.h Tue May 2 18:31:05 2017 (r317689) +++ vendor/lld/dist/COFF/InputFiles.h Tue May 2 18:31:09 2017 (r317690) @@ -167,6 +167,7 @@ public: static bool classof(const InputFile *F) { return F->kind() == ImportKind; } DefinedImportData *ImpSym = nullptr; + DefinedImportData *ConstSym = nullptr; DefinedImportThunk *ThunkSym = nullptr; std::string DLLName; Modified: vendor/lld/dist/COFF/MapFile.cpp ============================================================================== --- vendor/lld/dist/COFF/MapFile.cpp Tue May 2 18:31:05 2017 (r317689) +++ vendor/lld/dist/COFF/MapFile.cpp Tue May 2 18:31:09 2017 (r317690) @@ -11,21 +11,21 @@ // hierarchically the output sections, input sections, input files and // symbol: // -// Address Size Align Out In File Symbol -// ================================================================= -// 00201000 00000015 4 .text -// 00201000 0000000e 4 .text -// 00201000 0000000e 4 test.o -// 0020100e 00000000 0 local -// 00201005 00000000 0 f(int) +// Address Size Align Out File Symbol +// 00201000 00000015 4 .text +// 00201000 0000000e 4 test.o:(.text) +// 0020100e 00000000 0 local +// 00201005 00000000 0 f(int) // //===----------------------------------------------------------------------===// #include "MapFile.h" #include "Error.h" +#include "SymbolTable.h" #include "Symbols.h" #include "Writer.h" +#include "lld/Core/Parallel.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; @@ -34,72 +34,58 @@ using namespace llvm::object; using namespace lld; using namespace lld::coff; -static void writeOutSecLine(raw_fd_ostream &OS, uint64_t Address, uint64_t Size, - uint64_t Align, StringRef Name) { - OS << format("%08llx %08llx %5lld ", Address, Size, Align) - << left_justify(Name, 7); -} - -static void writeInSecLine(raw_fd_ostream &OS, uint64_t Address, uint64_t Size, - uint64_t Align, StringRef Name) { - // Pass an empty name to align the text to the correct column. - writeOutSecLine(OS, Address, Size, Align, ""); - OS << ' ' << left_justify(Name, 7); -} - -static void writeFileLine(raw_fd_ostream &OS, uint64_t Address, uint64_t Size, - uint64_t Align, StringRef Name) { - // Pass an empty name to align the text to the correct column. - writeInSecLine(OS, Address, Size, Align, ""); - OS << ' ' << left_justify(Name, 7); -} +typedef DenseMap> + SymbolMapTy; -static void writeSymbolLine(raw_fd_ostream &OS, uint64_t Address, uint64_t Size, - StringRef Name) { - // Pass an empty name to align the text to the correct column. - writeFileLine(OS, Address, Size, 0, ""); - OS << ' ' << left_justify(Name, 7); -} - -static void writeSectionChunk(raw_fd_ostream &OS, const SectionChunk *SC, - StringRef &PrevName) { - StringRef Name = SC->getSectionName(); - if (Name != PrevName) { - writeInSecLine(OS, SC->getRVA(), SC->getSize(), SC->getAlign(), Name); - OS << '\n'; - PrevName = Name; - } - coff::ObjectFile *File = SC->File; - if (!File) - return; - writeFileLine(OS, SC->getRVA(), SC->getSize(), SC->getAlign(), - toString(File)); - OS << '\n'; - ArrayRef Syms = File->getSymbols(); - for (SymbolBody *Sym : Syms) { - auto *DR = dyn_cast(Sym); - if (!DR || DR->getChunk() != SC || - DR->getCOFFSymbol().isSectionDefinition()) - continue; - writeSymbolLine(OS, DR->getRVA(), SC->getSize(), toString(*Sym)); - OS << '\n'; +// Print out the first three columns of a line. +static void writeHeader(raw_ostream &OS, uint64_t Addr, uint64_t Size, + uint64_t Align) { + OS << format("%08llx %08llx %5lld ", Addr, Size, Align); +} + +static std::string indent(int Depth) { return std::string(Depth * 8, ' '); } + +// Returns a list of all symbols that we want to print out. +static std::vector getSymbols() { + std::vector V; + for (coff::ObjectFile *File : Symtab->ObjectFiles) + for (SymbolBody *B : File->getSymbols()) + if (auto *Sym = dyn_cast(B)) + if (Sym && !Sym->getCOFFSymbol().isSectionDefinition()) + V.push_back(Sym); + return V; +} + +// Returns a map from sections to their symbols. +static SymbolMapTy getSectionSyms(ArrayRef Syms) { + SymbolMapTy Ret; + for (DefinedRegular *S : Syms) + Ret[S->getChunk()].push_back(S); + + // Sort symbols by address. + for (auto &It : Ret) { + SmallVectorImpl &V = It.second; + std::sort(V.begin(), V.end(), [](DefinedRegular *A, DefinedRegular *B) { + return A->getRVA() < B->getRVA(); + }); } + return Ret; } -static void writeMapFile2(raw_fd_ostream &OS, - ArrayRef OutputSections) { - OS << "Address Size Align Out In File Symbol\n"; - - for (OutputSection *Sec : OutputSections) { - uint32_t VA = Sec->getRVA(); - writeOutSecLine(OS, VA, Sec->getVirtualSize(), /*Align=*/PageSize, - Sec->getName()); - OS << '\n'; - StringRef PrevName = ""; - for (Chunk *C : Sec->getChunks()) - if (const auto *SC = dyn_cast(C)) - writeSectionChunk(OS, SC, PrevName); - } +// Construct a map from symbols to their stringified representations. +static DenseMap +getSymbolStrings(ArrayRef Syms) { + std::vector Str(Syms.size()); + parallel_for((size_t)0, Syms.size(), [&](size_t I) { + raw_string_ostream OS(Str[I]); + writeHeader(OS, Syms[I]->getRVA(), 0, 0); + OS << indent(2) << toString(*Syms[I]); + }); + + DenseMap Ret; + for (size_t I = 0, E = Syms.size(); I < E; ++I) + Ret[Syms[I]] = std::move(Str[I]); + return Ret; } void coff::writeMapFile(ArrayRef OutputSections) { @@ -110,5 +96,30 @@ void coff::writeMapFile(ArrayRefMapFile, EC, sys::fs::F_None); if (EC) fatal("cannot open " + Config->MapFile + ": " + EC.message()); - writeMapFile2(OS, OutputSections); + + // Collect symbol info that we want to print out. + std::vector Syms = getSymbols(); + SymbolMapTy SectionSyms = getSectionSyms(Syms); + DenseMap SymStr = getSymbolStrings(Syms); + + // Print out the header line. + OS << "Address Size Align Out In Symbol\n"; + + // Print out file contents. + for (OutputSection *Sec : OutputSections) { + writeHeader(OS, Sec->getRVA(), Sec->getVirtualSize(), /*Align=*/PageSize); + OS << Sec->getName() << '\n'; + + for (Chunk *C : Sec->getChunks()) { + auto *SC = dyn_cast(C); + if (!SC) + continue; + + writeHeader(OS, SC->getRVA(), SC->getSize(), SC->getAlign()); + OS << indent(1) << SC->File->getName() << ":(" << SC->getSectionName() + << ")\n"; + for (DefinedRegular *Sym : SectionSyms[SC]) + OS << SymStr[Sym] << '\n'; + } + } } Modified: vendor/lld/dist/ELF/Config.h ============================================================================== --- vendor/lld/dist/ELF/Config.h Tue May 2 18:31:05 2017 (r317689) +++ vendor/lld/dist/ELF/Config.h Tue May 2 18:31:09 2017 (r317690) @@ -89,7 +89,7 @@ struct Configuration { llvm::StringRef SoName; llvm::StringRef Sysroot; llvm::StringRef ThinLTOCacheDir; - std::string RPath; + std::string Rpath; std::vector VersionDefinitions; std::vector AuxiliaryList; std::vector SearchPaths; Modified: vendor/lld/dist/ELF/Driver.cpp ============================================================================== --- vendor/lld/dist/ELF/Driver.cpp Tue May 2 18:31:05 2017 (r317689) +++ vendor/lld/dist/ELF/Driver.cpp Tue May 2 18:31:09 2017 (r317690) @@ -124,7 +124,7 @@ static std::tuple -LinkerDriver::getArchiveMembers(MemoryBufferRef MB) { +static getArchiveMembers(MemoryBufferRef MB) { std::unique_ptr File = check(Archive::create(MB), MB.getBufferIdentifier() + ": failed to parse archive"); @@ -242,6 +242,9 @@ static void checkOptions(opt::InputArgLi if (Config->Pie && Config->Shared) error("-shared and -pie may not be used together"); + if (!Config->Shared && !Config->AuxiliaryList.empty()) + error("-f may not be used without -shared"); + if (Config->Relocatable) { if (Config->Shared) error("-r and -shared may not be used together"); @@ -396,7 +399,7 @@ static std::vector getArgs(op return V; } -static std::string getRPath(opt::InputArgList &Args) { +static std::string getRpath(opt::InputArgList &Args) { std::vector V = getArgs(Args, OPT_rpath); return llvm::join(V.begin(), V.end(), ":"); } @@ -444,16 +447,14 @@ static UnresolvedPolicy getUnresolvedSym } static Target2Policy getTarget2(opt::InputArgList &Args) { - if (auto *Arg = Args.getLastArg(OPT_target2)) { - StringRef S = Arg->getValue(); - if (S == "rel") - return Target2Policy::Rel; - if (S == "abs") - return Target2Policy::Abs; - if (S == "got-rel") - return Target2Policy::GotRel; - error("unknown --target2 option: " + S); - } + StringRef S = getString(Args, OPT_target2, "got-rel"); + if (S == "rel") + return Target2Policy::Rel; + if (S == "abs") + return Target2Policy::Abs; + if (S == "got-rel") + return Target2Policy::GotRel; + error("unknown --target2 option: " + S); return Target2Policy::GotRel; } @@ -550,6 +551,29 @@ static std::pair getHashStyl return {true, true}; } +// Parse --build-id or --build-id=